ZOJ Access System
Time Limit: 2 Seconds Memory Limit: 65536 KB For security issues, Marjar University has an access control system for each dormitory building.The system requires the students to use their personal identification cards to open the gate if th
For security issues, Marjar University has an access control system for each dormitory building.The system requires the students to use their personal identification cards to open the gate if they want to enter the building.
The gate will then remain unlocked for L seconds. For example L = 15, if a student came to the dormitory at 17:00:00 (in the format of HH:MM:SS) and used his card to open the gate. Any other students who come to the dormitory between [17:00:00, 17:00:15) can enter the building without authentication. If there is another student comes to the dorm at 17:00:15 or later, he must take out his card to unlock the gate again.
There are N students need to enter the dormitory. You are given the time they come to the gate. These lazy students will not use their cards unless necessary. Please find out the students who need to do so.
Input
There are multiple test cases. The first line of input contains an integer T indicating the number of test cases. For each test case:
The first line contains two integers N (1 N L (1 L N lines, each line is a unique time between [00:00:00, 24:00:00) on the same day.
Output
For each test case, output two lines. The first line is the number of students who need to use the card to open the gate. The second line the the index (1-based) of these students in ascending order, separated by a space.
Sample Input
3
2 1
12:30:00
12:30:01
5 15
17:00:00
17:00:15
17:00:06
17:01:00
17:00:14
3 5
12:00:09
12:00:05
12:00:00
Sample Output
2
1 2
3
1 2 4
2
2 3
#include#include #include using namespace std; typedef struct nnn { int s,i; }Time; int cmp(Time a,Time b) { return a.s
上一篇: php设计模式之简单工厂模式详解
下一篇: 同一个编辑器EclipsePHP Studio v1.2.2编纂的两个页面,print_r输出为何字体大小格式不一致? 用ajax.php正常,用osg_aja
推荐阅读
-
node微信开发之获取access_token+自定义菜单
-
解决mysql ERROR 1045 (28000)-- Access denied for user问题
-
Excel Services OverView系列2 使用Excel Web Access技术在线浏览Excel工作薄
-
在网页上进行access数据库压缩的方法
-
将ACCESS数据库迁移到SQLSERVER数据库两种方法(图文详解)
-
浅谈mssql access数据库 top分页方法
-
SQL语句实现删除ACCESS重复记录的两种方法
-
C#实现的ACCESS数据库操作类完整实例
-
C#操作Access通用类实例
-
C#通过oledb访问access数据库的方法