编程介的小学生 2019-03-16 22:40 采纳率: 20.5%
浏览 449

字母字面值和数字的组合排序算法问题,采用C语言编程思路的实现方式

Problem Description
Now is spring ! The sunshine is warm , the flowers is coming out . How lovely it is! So my classmates and I want to go out for a spring-outing.

But we all select courses ourselves. We don't have classes at the same time.Now our monitor has a big trouble in arranging the time of the spring-outing.

Can you help him?

I will give you our courses information and the time of the spring-outing.You just need to tell me that who can't go with us.

Input
The first line contains an integer CA which indicates the number of test cases.
Then CA cases follow.
Each case contains two parts,the students' courses information and the query.

In the first part ,first there is an integer N(N<200) which means the number of the student,and then comes the N students’ courses information.
A student's courses information is in this format:

line1: name K
line2: day1 b1 e1
.....
lineK+1: dayK bK eK

The first line of a student's courses infomation contains his name(less than 20 characters and in lowercase) and the number(K,K<1000) of his courses . Then next K lines describe his courses. Each Line contain three integers indicate the day of a week( 1 <= day <= 7 means Monday to Sunday ), the begin time and the end time of the course.
To make the problem easier,the begin time and the end time will be in the range from 1 to 11 .(Because in HDU,there is 11 classes one day).

In the query part , first there is an integer Q which means the query number,and then Q lines follow.
A query contains three integers which means the day ,the begin time and the end time of the spring-outing.And the time is described as the courses.
Notice,everyone may have more than one course at the same time for some special reasons.

Output
For each query , just print the names of the students who can't go out for a spring-outing in a line in lexicographic order.
Please separate two names with a blank.
If all of the students have time to go , just print "None" in a line.

Sample Input
1
3
linle 3
1 1 2
2 3 4
3 8 10
laili 1
4 1 4
xhd 2
1 2 4
4 5 6
3
1 2 2
4 4 5
5 1 2

Sample Output
linle xhd
laili xhd
None

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 安卓adb backup备份应用数据失败
    • ¥15 eclipse运行项目时遇到的问题
    • ¥15 关于#c##的问题:最近需要用CAT工具Trados进行一些开发
    • ¥15 南大pa1 小游戏没有界面,并且报了如下错误,尝试过换显卡驱动,但是好像不行
    • ¥15 没有证书,nginx怎么反向代理到只能接受https的公网网站
    • ¥50 成都蓉城足球俱乐部小程序抢票
    • ¥15 yolov7训练自己的数据集
    • ¥15 esp8266与51单片机连接问题(标签-单片机|关键词-串口)(相关搜索:51单片机|单片机|测试代码)
    • ¥15 电力市场出清matlab yalmip kkt 双层优化问题
    • ¥30 ros小车路径规划实现不了,如何解决?(操作系统-ubuntu)