目錄
Input
Output
Sample Input
Sample Output
首頁 資料庫 mysql教程 L、Access System

L、Access System

Jun 07, 2016 pm 03:49 PM
access system ti

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 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>
登入後複製
登入後複製
登入後複製
<span>转化做法</span>
登入後複製
登入後複製
登入後複製
<pre class="brush:php;toolbar:false">#include<iostream>
#include<algorithm>
using namespace std;
typedef struct stu{
	int time;
	int inde;
}re;
bool cmp1(const re& a,const re& b){
	return a.time<b.time int main t cin>>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<n cin>>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;i<n if>a[i].time)continue;
			else{
				 b[len++]=a[i].inde;
				 ti=a[i].time;
			} 
		sort(b,b+len);
		cout<br><br></n></n></b.time></algorithm></iostream>
登入後複製
本網站聲明
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn

熱AI工具

Undresser.AI Undress

Undresser.AI Undress

人工智慧驅動的應用程序,用於創建逼真的裸體照片

AI Clothes Remover

AI Clothes Remover

用於從照片中去除衣服的線上人工智慧工具。

Undress AI Tool

Undress AI Tool

免費脫衣圖片

Clothoff.io

Clothoff.io

AI脫衣器

AI Hentai Generator

AI Hentai Generator

免費產生 AI 無盡。

熱門文章

R.E.P.O.能量晶體解釋及其做什麼(黃色晶體)
2 週前 By 尊渡假赌尊渡假赌尊渡假赌
倉庫:如何復興隊友
4 週前 By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island冒險:如何獲得巨型種子
3 週前 By 尊渡假赌尊渡假赌尊渡假赌

熱工具

記事本++7.3.1

記事本++7.3.1

好用且免費的程式碼編輯器

SublimeText3漢化版

SublimeText3漢化版

中文版,非常好用

禪工作室 13.0.1

禪工作室 13.0.1

強大的PHP整合開發環境

Dreamweaver CS6

Dreamweaver CS6

視覺化網頁開發工具

SublimeText3 Mac版

SublimeText3 Mac版

神級程式碼編輯軟體(SublimeText3)

Windows11怎麼停用後台應用程式_Windows11停用後台應用程式教學 Windows11怎麼停用後台應用程式_Windows11停用後台應用程式教學 May 07, 2024 pm 04:20 PM

Windows11怎麼停用後台應用程式_Windows11停用後台應用程式教學

deepseek怎麼轉換pdf deepseek怎麼轉換pdf Feb 19, 2025 pm 05:24 PM

deepseek怎麼轉換pdf

java裡面的dao是什麼意思 java裡面的dao是什麼意思 Apr 21, 2024 am 02:08 AM

java裡面的dao是什麼意思

無法允許存取 iPhone 中的相機和麥克風 無法允許存取 iPhone 中的相機和麥克風 Apr 23, 2024 am 11:13 AM

無法允許存取 iPhone 中的相機和麥克風

field在java中是什麼意思 field在java中是什麼意思 Apr 25, 2024 pm 10:18 PM

field在java中是什麼意思

oracle儲存程序執行計劃怎麼看 oracle儲存程序執行計劃怎麼看 Apr 18, 2024 pm 10:18 PM

oracle儲存程序執行計劃怎麼看

Java反射機制如何修改類別的行為? Java反射機制如何修改類別的行為? May 03, 2024 pm 06:15 PM

Java反射機制如何修改類別的行為?

vue中iframe跨域的方法 vue中iframe跨域的方法 May 02, 2024 pm 10:48 PM

vue中iframe跨域的方法

See all articles