Submission #2091723
Source Code Expand
import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.*; public class Main{ public static void main(String[] args)throws Exception{ BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int count = Integer.parseInt(br.readLine()); boolean[] isRaining = new boolean[289]; for(int i = 0;i<count;i++){ int[] numbers = Arrays.stream(br.readLine().split("")).filter(str->!str.equals("-")).mapToInt(Integer::parseInt).toArray(); int startTime = numbers[0]*120 + numbers[1]*12 + numbers[2]*2 + numbers[3]/5; int endTime = numbers[4]*120 + numbers[5]*12 + numbers[6]*2 + (numbers[7]+4)/5 -1; for(int j = startTime;j<=endTime;j++){ isRaining[j] = true; } } boolean inside = false; for(int i = 0;i<289;i++){ if(!inside){ if(isRaining[i]){ System.out.printf("%02d%02d-",i/12,i*5%60); inside = true; } }else{ if(i==288||!isRaining[i]){ System.out.printf("%02d%02d\n",i/12,i*5%60); inside = false; } } } } }
Submission Info
Submission Time | |
---|---|
Task | D - 感雨時刻の整理 |
User | rouh |
Language | Java8 (OpenJDK 1.8.0) |
Score | 100 |
Code Size | 1305 Byte |
Status | AC |
Exec Time | 518 ms |
Memory | 52252 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 | 218 ms | 30292 KB |
00_sample_02.txt | AC | 159 ms | 24788 KB |
00_sample_03.txt | AC | 155 ms | 25556 KB |
cho_cho_chokudai.txt | AC | 455 ms | 46096 KB |
chokudai_ga_cho.txt | AC | 505 ms | 48532 KB |
test_01.txt | AC | 222 ms | 26836 KB |
test_02.txt | AC | 212 ms | 26708 KB |
test_03.txt | AC | 224 ms | 24916 KB |
test_04.txt | AC | 211 ms | 24276 KB |
test_05.txt | AC | 202 ms | 26324 KB |
test_06.txt | AC | 181 ms | 26180 KB |
test_07.txt | AC | 176 ms | 24276 KB |
test_08.txt | AC | 186 ms | 26708 KB |
test_09.txt | AC | 192 ms | 26836 KB |
test_10.txt | AC | 214 ms | 26708 KB |
test_11.txt | AC | 196 ms | 24532 KB |
test_12.txt | AC | 190 ms | 24148 KB |
test_13.txt | AC | 180 ms | 24276 KB |
test_14.txt | AC | 208 ms | 26196 KB |
test_15.txt | AC | 211 ms | 24532 KB |
test_16.txt | AC | 169 ms | 23764 KB |
test_17.txt | AC | 188 ms | 24404 KB |
test_18.txt | AC | 178 ms | 26580 KB |
test_19.txt | AC | 193 ms | 24404 KB |
test_20.txt | AC | 197 ms | 24660 KB |
test_21.txt | AC | 470 ms | 52252 KB |
test_22.txt | AC | 471 ms | 48092 KB |
test_23.txt | AC | 462 ms | 48784 KB |
test_24.txt | AC | 470 ms | 47244 KB |
test_25.txt | AC | 497 ms | 48452 KB |
test_26.txt | AC | 511 ms | 49596 KB |
test_27.txt | AC | 478 ms | 46512 KB |
test_28.txt | AC | 516 ms | 49376 KB |
test_29.txt | AC | 157 ms | 24020 KB |
test_30.txt | AC | 177 ms | 25940 KB |
test_31.txt | AC | 303 ms | 32460 KB |
test_32.txt | AC | 161 ms | 24276 KB |
test_33.txt | AC | 443 ms | 47508 KB |
test_34.txt | AC | 163 ms | 22480 KB |
test_35.txt | AC | 185 ms | 24532 KB |
test_36.txt | AC | 454 ms | 47424 KB |
test_37.txt | AC | 496 ms | 48460 KB |
test_38.txt | AC | 518 ms | 45884 KB |
test_39.txt | AC | 498 ms | 50820 KB |
test_40.txt | AC | 476 ms | 49456 KB |
test_41.txt | AC | 452 ms | 48820 KB |
test_42.txt | AC | 478 ms | 49696 KB |
test_43.txt | AC | 488 ms | 46740 KB |