Submission #109573
Source Code Expand
import java.util.ArrayList; import java.util.Scanner; public class Main { Scanner sc = new Scanner(System.in); public void run() { int n = sc.nextInt(); calc(n); } public void calc(int n){ int[] list = new int[24 * 12 + 1]; for(int i = 0; i < n; i++){ String[] times = sc.next().split("-"); int start = Integer.valueOf(times[0]); int end = Integer.valueOf(times[1]); int s = (start / 100) * 12 + (start % 100) / 5; int e = (end / 100) * 12 + (end % 100) / 5; if(end % 5 != 0) e = e + 1; if(e > 24 * 12) e = 24 * 12; for(int j = s; j < e; j++){ list[j] = 1; } } int start = -1; for(int i = 0; i < 24 * 12 + 1; i++){ if(list[i] == 0 && start != -1){ int s = (start / 12) * 100 + (start % 12) * 5; int e = (i / 12) * 100 + (i % 12) * 5; System.out.println(toStr(s) + "-" + toStr(e)); start = -1; } else if(list[i] == 1 && start == -1){ start = i; } } if(start != -1){ int s = (start / 12) * 100 + (start % 12) * 5; System.out.println(toStr(s) + "-2400"); } } public String toStr(int time){ String ans = ""; if(time / 1000 == 0) ans = ans + "0"; if(time / 100 == 0) ans = ans + "0"; if(time / 10 == 0) ans = ans + "0"; return ans + Integer.toString(time); } public static void main(String[] args) { new Main().run(); } }
Submission Info
Submission Time | |
---|---|
Task | D - 感雨時刻の整理 |
User | wapiko |
Language | Java (OpenJDK 1.7.0) |
Score | 100 |
Code Size | 1405 Byte |
Status | AC |
Exec Time | 950 ms |
Memory | 39204 KB |
Judge Result
Set Name | all | ||
---|---|---|---|
Score / Max Score | 100 / 100 | ||
Status |
|
Set Name | Test Cases |
---|---|
all | 00_sample_01.txt, 00_sample_02.txt, 00_sample_03.txt, cho_cho_chokudai.txt, chokudai_ga_cho.txt, test_01.txt, test_02.txt, test_03.txt, test_04.txt, test_05.txt, test_06.txt, test_07.txt, test_08.txt, test_09.txt, test_10.txt, test_11.txt, test_12.txt, test_13.txt, test_14.txt, test_15.txt, test_16.txt, test_17.txt, test_18.txt, test_19.txt, test_20.txt, test_21.txt, test_22.txt, test_23.txt, test_24.txt, test_25.txt, test_26.txt, test_27.txt, test_28.txt, test_29.txt, test_30.txt, test_31.txt, test_32.txt, test_33.txt, test_34.txt, test_35.txt, test_36.txt, test_37.txt, test_38.txt, test_39.txt, test_40.txt, test_41.txt, test_42.txt, test_43.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
00_sample_01.txt | AC | 457 ms | 23388 KB |
00_sample_02.txt | AC | 455 ms | 23264 KB |
00_sample_03.txt | AC | 449 ms | 23312 KB |
cho_cho_chokudai.txt | AC | 813 ms | 35932 KB |
chokudai_ga_cho.txt | AC | 860 ms | 35776 KB |
test_01.txt | AC | 459 ms | 23516 KB |
test_02.txt | AC | 494 ms | 23520 KB |
test_03.txt | AC | 484 ms | 23652 KB |
test_04.txt | AC | 480 ms | 23644 KB |
test_05.txt | AC | 490 ms | 23512 KB |
test_06.txt | AC | 494 ms | 24656 KB |
test_07.txt | AC | 489 ms | 24532 KB |
test_08.txt | AC | 478 ms | 23572 KB |
test_09.txt | AC | 526 ms | 25060 KB |
test_10.txt | AC | 564 ms | 25404 KB |
test_11.txt | AC | 528 ms | 25176 KB |
test_12.txt | AC | 507 ms | 24900 KB |
test_13.txt | AC | 492 ms | 23524 KB |
test_14.txt | AC | 557 ms | 24776 KB |
test_15.txt | AC | 552 ms | 25352 KB |
test_16.txt | AC | 486 ms | 23524 KB |
test_17.txt | AC | 566 ms | 26068 KB |
test_18.txt | AC | 489 ms | 23656 KB |
test_19.txt | AC | 512 ms | 24868 KB |
test_20.txt | AC | 526 ms | 24540 KB |
test_21.txt | AC | 828 ms | 36556 KB |
test_22.txt | AC | 883 ms | 37436 KB |
test_23.txt | AC | 832 ms | 37556 KB |
test_24.txt | AC | 863 ms | 36628 KB |
test_25.txt | AC | 855 ms | 38376 KB |
test_26.txt | AC | 872 ms | 37132 KB |
test_27.txt | AC | 845 ms | 36996 KB |
test_28.txt | AC | 876 ms | 37680 KB |
test_29.txt | AC | 497 ms | 23260 KB |
test_30.txt | AC | 462 ms | 23280 KB |
test_31.txt | AC | 656 ms | 28596 KB |
test_32.txt | AC | 468 ms | 23392 KB |
test_33.txt | AC | 851 ms | 38288 KB |
test_34.txt | AC | 454 ms | 23396 KB |
test_35.txt | AC | 491 ms | 24160 KB |
test_36.txt | AC | 948 ms | 35812 KB |
test_37.txt | AC | 855 ms | 36664 KB |
test_38.txt | AC | 950 ms | 39204 KB |
test_39.txt | AC | 902 ms | 36828 KB |
test_40.txt | AC | 852 ms | 37308 KB |
test_41.txt | AC | 867 ms | 37568 KB |
test_42.txt | AC | 849 ms | 37744 KB |
test_43.txt | AC | 888 ms | 37492 KB |