Submission #448500
Source Code Expand
import java.util.Arrays; import java.util.Scanner; public class Main { public static void main(String[] args){ Scanner sc = new Scanner(System.in); int N = sc.nextInt(); int[] record = new int[2401]; Arrays.fill(record, 0); for(int i =0; i<N; i++){ String input = sc.next(); int start = Integer.parseInt(input.split("-")[0]); int end = Integer.parseInt(input.split("-")[1]); start = start/5 * 5; end = ((int)Math.ceil(end/5d)) * 5; if(end%100 == 60){ end += 40; } record[start]++; record[end]--; } int counter = 0; for(int i=0; i<2401; i++){ if(record[i] > 0){ if(counter == 0) System.out.format("%1$04d-", i); counter+=record[i]; } else if(record[i] < 0){ counter+=record[i]; if(counter == 0)System.out.format("%1$04d%n", i); } } } }
Submission Info
Submission Time | |
---|---|
Task | D - 感雨時刻の整理 |
User | plane812 |
Language | Java (OpenJDK 1.7.0) |
Score | 100 |
Code Size | 1089 Byte |
Status | AC |
Exec Time | 1013 ms |
Memory | 39760 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 | 506 ms | 23464 KB |
00_sample_02.txt | AC | 465 ms | 23600 KB |
00_sample_03.txt | AC | 464 ms | 23628 KB |
cho_cho_chokudai.txt | AC | 963 ms | 37956 KB |
chokudai_ga_cho.txt | AC | 975 ms | 38768 KB |
test_01.txt | AC | 529 ms | 24292 KB |
test_02.txt | AC | 523 ms | 24180 KB |
test_03.txt | AC | 519 ms | 24148 KB |
test_04.txt | AC | 517 ms | 24164 KB |
test_05.txt | AC | 514 ms | 24064 KB |
test_06.txt | AC | 473 ms | 24364 KB |
test_07.txt | AC | 473 ms | 23908 KB |
test_08.txt | AC | 474 ms | 23712 KB |
test_09.txt | AC | 532 ms | 25256 KB |
test_10.txt | AC | 545 ms | 25496 KB |
test_11.txt | AC | 525 ms | 24876 KB |
test_12.txt | AC | 497 ms | 24208 KB |
test_13.txt | AC | 479 ms | 23852 KB |
test_14.txt | AC | 524 ms | 25068 KB |
test_15.txt | AC | 552 ms | 25980 KB |
test_16.txt | AC | 483 ms | 23848 KB |
test_17.txt | AC | 530 ms | 25052 KB |
test_18.txt | AC | 482 ms | 23852 KB |
test_19.txt | AC | 495 ms | 24240 KB |
test_20.txt | AC | 525 ms | 24608 KB |
test_21.txt | AC | 980 ms | 38912 KB |
test_22.txt | AC | 974 ms | 38236 KB |
test_23.txt | AC | 983 ms | 38608 KB |
test_24.txt | AC | 978 ms | 38112 KB |
test_25.txt | AC | 977 ms | 37720 KB |
test_26.txt | AC | 970 ms | 38372 KB |
test_27.txt | AC | 961 ms | 37460 KB |
test_28.txt | AC | 996 ms | 39760 KB |
test_29.txt | AC | 450 ms | 23512 KB |
test_30.txt | AC | 465 ms | 23556 KB |
test_31.txt | AC | 761 ms | 32376 KB |
test_32.txt | AC | 466 ms | 23592 KB |
test_33.txt | AC | 949 ms | 38496 KB |
test_34.txt | AC | 453 ms | 23568 KB |
test_35.txt | AC | 495 ms | 23972 KB |
test_36.txt | AC | 1013 ms | 38460 KB |
test_37.txt | AC | 976 ms | 38436 KB |
test_38.txt | AC | 996 ms | 39296 KB |
test_39.txt | AC | 958 ms | 38584 KB |
test_40.txt | AC | 962 ms | 38456 KB |
test_41.txt | AC | 983 ms | 38688 KB |
test_42.txt | AC | 988 ms | 38316 KB |
test_43.txt | AC | 941 ms | 37540 KB |