Submission #450527
Source Code Expand
n = input() start, end = [], [] for i in range(n): s, e = map(int, raw_input().split("-")) if s%10 > 5: s = s/10 * 10+5 elif s%10 < 5: s = s / 10 * 10 if e%10 > 5: e = e/10 * 10 + 10 elif e%10 < 5 and e%10!=0: e = e/10*10+5 if e%100 == 60: e = (e/100+1)*100 start.append(s) end.append(e) idx = sorted(range(n), key = lambda x: start[x]) ret = [] for i in idx: if not ret: ret.append([start[i], end[i]]) else: if start[i] >= ret[-1][0] and start[i] <= ret[-1][1] and end[i] > ret[-1][1]: ret[-1][1] = end[i] elif start[i] > ret[-1][1]: ret.append([start[i], end[i]]) for i in ret: print "-".join(map(lambda x:str(x).zfill(4), i))
Submission Info
Submission Time | |
---|---|
Task | D - 感雨時刻の整理 |
User | grayzer |
Language | Python (2.7.3) |
Score | 100 |
Code Size | 746 Byte |
Status | AC |
Exec Time | 330 ms |
Memory | 7620 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 | 58 ms | 3420 KB |
00_sample_02.txt | AC | 56 ms | 3412 KB |
00_sample_03.txt | AC | 56 ms | 3420 KB |
cho_cho_chokudai.txt | AC | 294 ms | 6852 KB |
chokudai_ga_cho.txt | AC | 287 ms | 7400 KB |
test_01.txt | AC | 58 ms | 3416 KB |
test_02.txt | AC | 58 ms | 3420 KB |
test_03.txt | AC | 60 ms | 3508 KB |
test_04.txt | AC | 60 ms | 3504 KB |
test_05.txt | AC | 57 ms | 3536 KB |
test_06.txt | AC | 57 ms | 3508 KB |
test_07.txt | AC | 59 ms | 3432 KB |
test_08.txt | AC | 58 ms | 3412 KB |
test_09.txt | AC | 62 ms | 3540 KB |
test_10.txt | AC | 61 ms | 3540 KB |
test_11.txt | AC | 61 ms | 3540 KB |
test_12.txt | AC | 59 ms | 3540 KB |
test_13.txt | AC | 58 ms | 3416 KB |
test_14.txt | AC | 60 ms | 3544 KB |
test_15.txt | AC | 64 ms | 3544 KB |
test_16.txt | AC | 61 ms | 3500 KB |
test_17.txt | AC | 64 ms | 3632 KB |
test_18.txt | AC | 61 ms | 3504 KB |
test_19.txt | AC | 62 ms | 3496 KB |
test_20.txt | AC | 60 ms | 3540 KB |
test_21.txt | AC | 306 ms | 7516 KB |
test_22.txt | AC | 314 ms | 7484 KB |
test_23.txt | AC | 322 ms | 7556 KB |
test_24.txt | AC | 314 ms | 7476 KB |
test_25.txt | AC | 314 ms | 7620 KB |
test_26.txt | AC | 321 ms | 7396 KB |
test_27.txt | AC | 304 ms | 7480 KB |
test_28.txt | AC | 311 ms | 7488 KB |
test_29.txt | AC | 60 ms | 3444 KB |
test_30.txt | AC | 60 ms | 3412 KB |
test_31.txt | AC | 105 ms | 4052 KB |
test_32.txt | AC | 62 ms | 3512 KB |
test_33.txt | AC | 218 ms | 6152 KB |
test_34.txt | AC | 59 ms | 3464 KB |
test_35.txt | AC | 59 ms | 3540 KB |
test_36.txt | AC | 307 ms | 7528 KB |
test_37.txt | AC | 312 ms | 7396 KB |
test_38.txt | AC | 330 ms | 7440 KB |
test_39.txt | AC | 323 ms | 7560 KB |
test_40.txt | AC | 321 ms | 7384 KB |
test_41.txt | AC | 286 ms | 7228 KB |
test_42.txt | AC | 294 ms | 7432 KB |
test_43.txt | AC | 280 ms | 7404 KB |