Problem A
Flyafgange
Languages
da
en
Vedligehold afgangstavlen på verdens travleste lufthavn. Hver afgang består af et planlagt tidspunkt og en destination; afgangstidspunkterne er unikke i den forstand, at der aldrig afgår to fly på samme tidspunkt.
Du skal kunne håndtere følgende operationer:
- Aflysninger:
-
Formatet er »cancel
«. Aflys den planlagte afgang kl. . - Forsinkelser:
-
The format is »delay
«. Den planlagte afgang kl. forsinkes med sekunder. - Omdirigering:
-
Formatet er »reroute
«. Den planlagte afgang kl. omdirigeres til destinationen . - Destination?
-
Formatet er »destination
«. Er der planlagt en afgang kl. ; og i så fald hvorhen? - Næste afgang?
-
Formatet er »next
«; denne forespørgsel forekommer kun i testgrupper 2 og 4. Hvorhen går den næste afgang? Mere nøjagtig, hvad er den tidligst planlagte afgang med . - Tæl afgange.
-
Formatet er »count
«; denne forespørgsel forekommer kun i testgrupper 2 og 4. Hvor mange afgange er planlagte inden for et vist tidsrum? Mere nøjagtigt, hvor mange eksisterende afgangstider opfylder ?
Indlæsning
Indlæsningen begynder med det oprindelige antal
Derpå følger
Navnet
Udskrift
Udskriv svarene til hver forespørgsel, et per linje, i samme rækkefølge. Destinationen for et tidspunkt, hvor der ikke er en planlagt afgang, er et enkelt minustegn »-«. Destinationsnavne er versalfølsomme.
Testgrupper
Der er fire testrupper
Testgruppe |
Points |
Begrænsninger |
1 |
22 |
|
2 |
23 |
|
3 |
24 |
|
4 |
31 |
|
Sample Input 1 | Sample Output 1 |
---|---|
14 10 09:00:00 Chicago 09:00:03 Phoenix 09:00:13 Houston 09:00:59 Chicago 09:01:10 Houston 09:03:13 Chicago 09:10:11 Seattle 09:10:25 Seattle 09:14:25 Phoenix 09:19:32 Chicago 09:19:46 Chicago 09:21:05 Chicago 09:22:43 Seattle 09:22:54 Seattle destination 09:00:03 destination 09:21:45 destination 09:14:25 cancel 09:14:25 destination 09:14:25 delay 09:00:59 1 destination 09:00:59 destination 09:01:00 reroute 09:01:00 Houston destination 09:01:00 |
Phoenix - Phoenix - - Chicago Houston |
Sample Input 2 | Sample Output 2 |
---|---|
14 3 09:00:00 Chicago 09:00:03 Phoenix 09:00:13 Houston 09:00:59 Chicago 09:01:10 Houston 09:03:13 Chicago 09:10:11 Seattle 09:10:25 Seattle 09:14:25 Phoenix 09:19:32 Chicago 09:19:46 Chicago 09:21:05 Chicago 09:22:43 Seattle 09:22:54 Seattle next 09:21:45 next 09:22:54 count 09:00:30 09:10:25 |
09:22:43 Seattle 09:22:54 Seattle 5 |
Sample Input 3 | Sample Output 3 |
---|---|
1 2 12:00:00 Seattle cancel 12:00:00 count 11:00:01 12:59:59 |
0 |
Sample Input 4 | Sample Output 4 |
---|---|
2 9 11:00:00 Chicago 12:00:00 Seattle delay 12:00:00 3600 delay 13:00:00 3600 reroute 14:00:00 Spokane destination 12:00:00 destination 13:00:00 destination 14:00:00 delay 11:00:00 3600 destination 11:00:00 destination 12:00:00 |
- - Spokane - Chicago |