Submission #121616
Source Code Expand
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); boolean[] rainData = new boolean[24 * 12]; System.out.println(rainData[0]); int N = sc.nextInt(); for(int i = 0; i < N; i++) { String[] time = sc.next().split("-"); int startHour = Integer.parseInt(time[0].substring(0, 2)); int startMinute = Integer.parseInt(time[0].substring(2, 4)); int endHour = Integer.parseInt(time[1].substring(0, 2)); int endMinute = Integer.parseInt(time[1].substring(2, 4)); for (int j = startHour*12 + startMinute/5; j < endHour*12 + Math.ceil(endMinute/5.0); j++) { rainData[j] = true; } } String line = null; int length = rainData.length; for (int i = 0; i < length; i++) { if (rainData[i]) { if (line == null) { String startHour = String.format("%02d", i / 12); String startMinute = String.format("%02d", i % 12 * 5); line = startHour + startMinute + "-"; } } else { if (line != null) { int endHour = i / 12; int endMinute = i % 12 * 5; if (endMinute == 60) { endHour++; endMinute = 0; } String endHourStr = String.format("%02d", endHour); String endMinuteStr = String.format("%02d", endMinute); System.out.println(line + endHourStr + endMinuteStr); line = null; } } } if (line != null) { int endHour = length / 12; int endMinute = length % 12 * 5; if (endMinute == 60) { endHour++; endMinute = 0; } String endHourStr = String.format("%02d", endHour); String endMinuteStr = String.format("%02d", endMinute); System.out.println(line + endHourStr + endMinuteStr); } } }
Submission Info
Submission Time | |
---|---|
Task | D - 感雨時刻の整理 |
User | shibu_t |
Language | Java (OpenJDK 1.7.0) |
Score | 0 |
Code Size | 1823 Byte |
Status | WA |
Exec Time | 887 ms |
Memory | 39332 KB |
Judge Result
Set Name | all | ||
---|---|---|---|
Score / Max Score | 0 / 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 | WA | 792 ms | 21796 KB |
00_sample_02.txt | WA | 382 ms | 21804 KB |
00_sample_03.txt | WA | 383 ms | 21936 KB |
cho_cho_chokudai.txt | WA | 837 ms | 35088 KB |
chokudai_ga_cho.txt | WA | 879 ms | 35924 KB |
test_01.txt | WA | 471 ms | 22872 KB |
test_02.txt | WA | 460 ms | 22816 KB |
test_03.txt | WA | 453 ms | 22896 KB |
test_04.txt | WA | 462 ms | 22828 KB |
test_05.txt | WA | 475 ms | 22708 KB |
test_06.txt | WA | 485 ms | 24476 KB |
test_07.txt | WA | 455 ms | 23560 KB |
test_08.txt | WA | 445 ms | 23244 KB |
test_09.txt | WA | 503 ms | 25888 KB |
test_10.txt | WA | 470 ms | 25056 KB |
test_11.txt | WA | 464 ms | 25040 KB |
test_12.txt | WA | 481 ms | 24800 KB |
test_13.txt | WA | 423 ms | 22184 KB |
test_14.txt | WA | 494 ms | 25600 KB |
test_15.txt | WA | 495 ms | 25540 KB |
test_16.txt | WA | 430 ms | 22064 KB |
test_17.txt | WA | 476 ms | 24164 KB |
test_18.txt | WA | 435 ms | 22188 KB |
test_19.txt | WA | 490 ms | 24408 KB |
test_20.txt | WA | 476 ms | 23232 KB |
test_21.txt | WA | 801 ms | 36408 KB |
test_22.txt | WA | 833 ms | 35488 KB |
test_23.txt | WA | 813 ms | 35676 KB |
test_24.txt | WA | 822 ms | 35436 KB |
test_25.txt | WA | 834 ms | 35024 KB |
test_26.txt | WA | 809 ms | 37256 KB |
test_27.txt | WA | 812 ms | 36488 KB |
test_28.txt | WA | 799 ms | 36672 KB |
test_29.txt | WA | 389 ms | 21812 KB |
test_30.txt | WA | 407 ms | 21972 KB |
test_31.txt | WA | 607 ms | 28800 KB |
test_32.txt | WA | 396 ms | 21920 KB |
test_33.txt | WA | 791 ms | 37304 KB |
test_34.txt | WA | 402 ms | 21940 KB |
test_35.txt | WA | 424 ms | 22320 KB |
test_36.txt | WA | 810 ms | 35296 KB |
test_37.txt | WA | 887 ms | 39332 KB |
test_38.txt | WA | 855 ms | 36872 KB |
test_39.txt | WA | 756 ms | 36192 KB |
test_40.txt | WA | 792 ms | 36588 KB |
test_41.txt | WA | 766 ms | 34900 KB |
test_42.txt | WA | 816 ms | 36136 KB |
test_43.txt | WA | 775 ms | 36212 KB |