最新文章专题视频专题问答1问答10问答100问答1000问答2000关键字专题1关键字专题50关键字专题500关键字专题1500TAG最新视频文章推荐1 推荐3 推荐5 推荐7 推荐9 推荐11 推荐13 推荐15 推荐17 推荐19 推荐21 推荐23 推荐25 推荐27 推荐29 推荐31 推荐33 推荐35 推荐37视频文章20视频文章30视频文章40视频文章50视频文章60 视频文章70视频文章80视频文章90视频文章100视频文章120视频文章140 视频2关键字专题关键字专题tag2tag3文章专题文章专题2文章索引1文章索引2文章索引3文章索引4文章索引5123456789101112131415文章专题3
当前位置: 首页 - 科技 - 知识百科 - 正文

L、AccessSystem

来源:动视网 责编:小采 时间:2020-11-09 07:19:14
文档

L、AccessSystem

L、AccessSystem: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
推荐度:
导读L、AccessSystem: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


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

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 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 <= 20000) and L (1 <= L <= 3600). The next 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
using namespace std;
typedef struct stu{
	int time;
	int inde;
}re;
bool cmp1(const re& a,const re& b){
	return a.time>t;
	while(t--){
	int N,L,len=0,b[20005]={0},ti;
	cin>>N>>L;
	string s;
	re a[20005];
	for(int i=0;i>s;
	a[i].time=((s[0]-'0')*10+(s[1]-'0'))*3600+((s[3]-'0')*10+
	 (s[4]-'0'))*60+(s[6]-'0')*10+(s[7]-'0');
	 a[i].inde=i+1;
	}
	sort(a,a+N,cmp1);
	b[len++]=a[0].inde;
	ti=a[0].time;
	for(int i=1;ia[i].time)continue;
	else{
	 b[len++]=a[i].inde;
	 ti=a[i].time;
	} 
	sort(b,b+len);
	cout<

文档

L、AccessSystem

L、AccessSystem: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
推荐度:
标签: ti system access
  • 热门焦点

最新推荐

猜你喜欢

热门推荐

专题
Top