Submission #347914
Source Code Expand
import java.util.*; public class Main{ public static void main(String[] args){ Scanner stdIn = new Scanner(System.in); int N = stdIn.nextInt(); String[] str = new String[N]; int[] S = new int[N]; int[] E = new int[N]; boolean[] isRaining = new boolean[289]; for(int i = 0; i < N; i++) { str[i] = stdIn.next(); S[i] = Integer.parseInt(str[i].split("-")[0]); E[i] = Integer.parseInt(str[i].split("-")[1]); for(int j = (S[i]/100)*12 + (S[i]%100)/5; j < (E[i]/100)*12 + ((E[i]%100)+4)/5; j++) { isRaining[j] = true; } } boolean wasTrue = false; for(int i = 0; i <= 288; i++) { if(isRaining[i]) { if(!wasTrue) { System.out.printf("%02d", (i/12)); System.out.printf("%02d", ((i%12)*5)); System.out.print("-"); } wasTrue = true; } else { if(wasTrue) { System.out.printf("%02d", (i/12)); System.out.printf("%02d", ((i%12)*5)); System.out.println(); } wasTrue = false; } } } }
Submission Info
Submission Time | |
---|---|
Task | D - 感雨時刻の整理 |
User | ste234689ado |
Language | Java (OpenJDK 1.7.0) |
Score | 100 |
Code Size | 1025 Byte |
Status | AC |
Exec Time | 871 ms |
Memory | 41608 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 | 362 ms | 23336 KB |
00_sample_02.txt | AC | 361 ms | 23212 KB |
00_sample_03.txt | AC | 357 ms | 23344 KB |
cho_cho_chokudai.txt | AC | 826 ms | 38876 KB |
chokudai_ga_cho.txt | AC | 782 ms | 38524 KB |
test_01.txt | AC | 438 ms | 24208 KB |
test_02.txt | AC | 447 ms | 24168 KB |
test_03.txt | AC | 443 ms | 24228 KB |
test_04.txt | AC | 443 ms | 24132 KB |
test_05.txt | AC | 441 ms | 24160 KB |
test_06.txt | AC | 398 ms | 25008 KB |
test_07.txt | AC | 388 ms | 24900 KB |
test_08.txt | AC | 386 ms | 24564 KB |
test_09.txt | AC | 439 ms | 25796 KB |
test_10.txt | AC | 433 ms | 25660 KB |
test_11.txt | AC | 444 ms | 25924 KB |
test_12.txt | AC | 413 ms | 25384 KB |
test_13.txt | AC | 378 ms | 23676 KB |
test_14.txt | AC | 448 ms | 25688 KB |
test_15.txt | AC | 458 ms | 26032 KB |
test_16.txt | AC | 378 ms | 23672 KB |
test_17.txt | AC | 425 ms | 24568 KB |
test_18.txt | AC | 383 ms | 23568 KB |
test_19.txt | AC | 417 ms | 25264 KB |
test_20.txt | AC | 410 ms | 24468 KB |
test_21.txt | AC | 839 ms | 39072 KB |
test_22.txt | AC | 811 ms | 38560 KB |
test_23.txt | AC | 815 ms | 39224 KB |
test_24.txt | AC | 804 ms | 39664 KB |
test_25.txt | AC | 845 ms | 39048 KB |
test_26.txt | AC | 840 ms | 40304 KB |
test_27.txt | AC | 797 ms | 39120 KB |
test_28.txt | AC | 831 ms | 40492 KB |
test_29.txt | AC | 347 ms | 23304 KB |
test_30.txt | AC | 360 ms | 23472 KB |
test_31.txt | AC | 645 ms | 32344 KB |
test_32.txt | AC | 355 ms | 23444 KB |
test_33.txt | AC | 787 ms | 39464 KB |
test_34.txt | AC | 348 ms | 23308 KB |
test_35.txt | AC | 381 ms | 23916 KB |
test_36.txt | AC | 800 ms | 39280 KB |
test_37.txt | AC | 864 ms | 41608 KB |
test_38.txt | AC | 846 ms | 40276 KB |
test_39.txt | AC | 871 ms | 39532 KB |
test_40.txt | AC | 820 ms | 39568 KB |
test_41.txt | AC | 800 ms | 38728 KB |
test_42.txt | AC | 783 ms | 38692 KB |
test_43.txt | AC | 816 ms | 38604 KB |