> 데이터 베이스 > MySQL 튜토리얼 > ZOJ Access System

ZOJ Access System

WBOY
풀어 주다: 2016-06-07 15:48:43
원래의
1112명이 탐색했습니다.

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

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 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
<span>3 5
12:00:09
12:00:05
12:00:00</span>
로그인 후 복사

Sample Output

2
1 2
3
1 2 4
<span>2
2 3
</span>
로그인 후 복사
<pre class="brush:php;toolbar:false">#include<stdio.h>
#include<iostream>
#include<algorithm>
using namespace std;

typedef struct nnn
{
    int s,i;
}Time;
int cmp(Time a,Time b)
{
    return a.s<b.s int main time student t scanf while sum="0;" for i="0;i<n;i++)" sort if loc node.s="student[0].s+L;" printf><br><br></b.s></algorithm></iostream></stdio.h>
로그인 후 복사
관련 라벨:
원천:php.cn
본 웹사이트의 성명
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.
인기 튜토리얼
더>
최신 다운로드
더>
웹 효과
웹사이트 소스 코드
웹사이트 자료
프론트엔드 템플릿