Submission #246474
Source Code Expand
import sys def int_to_str(i): return str(i) if i >= 10 else '0' + str(i) def m_to_hhmm(m): hh, mm = divmod(m, 60) return int_to_str(hh) + int_to_str(mm) def hhmm_to_m(hhmm): h = int(hhmm[:2]) m = int(hhmm[2:]) return h * 60 + m def round_down(hhmm): m = hhmm_to_m(hhmm) m = (m//5) * 5 return m_to_hhmm(m) def round_up(hhmm): m = hhmm_to_m(hhmm) di, mo = divmod(m, 5) m = (di + (mo > 0)) * 5 return m_to_hhmm(m) N = int(input()) rain_events = [list(line.strip().split('-')) for line in sys.stdin] rain_events = [(round_down(s), round_up(e)) for s, e in rain_events] rain_events.sort() s, e = rain_events[0] for new_s, new_e in rain_events[1:]: if new_s <= e and new_e >= e: e = new_e elif new_s > e: print('-'.join([s,e])) s, e = new_s, new_e print('-'.join([s,e]))
Submission Info
Submission Time | |
---|---|
Task | D - 感雨時刻の整理 |
User | hyas |
Language | Python (3.2.3) |
Score | 100 |
Code Size | 900 Byte |
Status | AC |
Exec Time | 587 ms |
Memory | 24540 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 | 170 ms | 8620 KB |
00_sample_02.txt | AC | 137 ms | 8616 KB |
00_sample_03.txt | AC | 136 ms | 8652 KB |
cho_cho_chokudai.txt | AC | 502 ms | 24540 KB |
chokudai_ga_cho.txt | AC | 536 ms | 24540 KB |
test_01.txt | AC | 139 ms | 8772 KB |
test_02.txt | AC | 136 ms | 8756 KB |
test_03.txt | AC | 136 ms | 8600 KB |
test_04.txt | AC | 140 ms | 8616 KB |
test_05.txt | AC | 136 ms | 8748 KB |
test_06.txt | AC | 139 ms | 8736 KB |
test_07.txt | AC | 139 ms | 8616 KB |
test_08.txt | AC | 136 ms | 8620 KB |
test_09.txt | AC | 145 ms | 8768 KB |
test_10.txt | AC | 142 ms | 8856 KB |
test_11.txt | AC | 138 ms | 8732 KB |
test_12.txt | AC | 141 ms | 8656 KB |
test_13.txt | AC | 141 ms | 8728 KB |
test_14.txt | AC | 145 ms | 8712 KB |
test_15.txt | AC | 144 ms | 8860 KB |
test_16.txt | AC | 136 ms | 8616 KB |
test_17.txt | AC | 143 ms | 8736 KB |
test_18.txt | AC | 143 ms | 8620 KB |
test_19.txt | AC | 140 ms | 8620 KB |
test_20.txt | AC | 139 ms | 8620 KB |
test_21.txt | AC | 570 ms | 24416 KB |
test_22.txt | AC | 571 ms | 24336 KB |
test_23.txt | AC | 587 ms | 24416 KB |
test_24.txt | AC | 573 ms | 24412 KB |
test_25.txt | AC | 573 ms | 24416 KB |
test_26.txt | AC | 566 ms | 24424 KB |
test_27.txt | AC | 528 ms | 24312 KB |
test_28.txt | AC | 567 ms | 24316 KB |
test_29.txt | AC | 138 ms | 8624 KB |
test_30.txt | AC | 138 ms | 8624 KB |
test_31.txt | AC | 194 ms | 10788 KB |
test_32.txt | AC | 141 ms | 8624 KB |
test_33.txt | AC | 406 ms | 18948 KB |
test_34.txt | AC | 140 ms | 8612 KB |
test_35.txt | AC | 139 ms | 8620 KB |
test_36.txt | AC | 587 ms | 24416 KB |
test_37.txt | AC | 562 ms | 24416 KB |
test_38.txt | AC | 567 ms | 24396 KB |
test_39.txt | AC | 569 ms | 24412 KB |
test_40.txt | AC | 565 ms | 24464 KB |
test_41.txt | AC | 503 ms | 24464 KB |
test_42.txt | AC | 551 ms | 24344 KB |
test_43.txt | AC | 505 ms | 24416 KB |