Submission #109254
Source Code Expand
import sys N = int(raw_input()) tl = [] for i in range(N): a = raw_input() start, goal = map(str, a.split("-")) if (start[3] > "0") and (start[3] < "5"): start = start[0] + start[1] + start[2] + "0" elif start[3] > "5" and start[3] <= "9": start = start[0] + start[1] + start[2] + "5" # x1 - x4 if goal[3] > "0" and goal[3] < "5": goal = goal[0] + goal[1] + goal[2] + "5" # x6 - x9 elif goal[3] > "5" and goal[3] <= "9": if goal[2] < "5": goal = goal[0] + goal[1] + str(int(goal[2]) + 1) + "0" # 0956 - 0959 elif goal[0] == "0" and goal[1] == "9" and goal[2] == "5": goal = "1000" # 1956-1959 elif goal[0] == "1" and goal[1] == "9" and goal[2] == "5": goal = "2000" # 2356 - 2359 elif goal[0] == "2" and goal[1] == "3" and goal[2] == "5": goal = "2400" # 005x-085x 105x-185x 205x-235x elif goal[1] < "9": goal = goal[0] + str(int(goal[1]) + 1) + "00" tl.append([start, goal]) tl.sort() # print "tl " # for i in tl: # print str(i[0]) + str(i[1]) for i in range(len(tl) - 1): if tl[i][0] == tl[i + 1][0] and tl[i][1] == tl[i + 1][1]: continue elif tl[i][1] > tl[i + 1][1]: tl[i + 1][0] = tl[i][0] tl[i + 1][1] = tl[i][1] continue elif tl[i][1] >= tl[i + 1][0]: tl[i + 1][0] = tl[i][0] continue else: print tl[i][0] + "-" + tl[i][1] print tl[len(tl) - 1][0] + "-" + tl[len(tl) - 1][1]
Submission Info
Submission Time | |
---|---|
Task | D - 感雨時刻の整理 |
User | kktn1109 |
Language | Python (2.7.3) |
Score | 100 |
Code Size | 1415 Byte |
Status | AC |
Exec Time | 329 ms |
Memory | 11108 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 | 61 ms | 3376 KB |
00_sample_02.txt | AC | 47 ms | 3384 KB |
00_sample_03.txt | AC | 49 ms | 3376 KB |
cho_cho_chokudai.txt | AC | 240 ms | 9028 KB |
chokudai_ga_cho.txt | AC | 280 ms | 10436 KB |
test_01.txt | AC | 50 ms | 3484 KB |
test_02.txt | AC | 46 ms | 3404 KB |
test_03.txt | AC | 46 ms | 3380 KB |
test_04.txt | AC | 48 ms | 3592 KB |
test_05.txt | AC | 48 ms | 3396 KB |
test_06.txt | AC | 51 ms | 3376 KB |
test_07.txt | AC | 50 ms | 3500 KB |
test_08.txt | AC | 50 ms | 3484 KB |
test_09.txt | AC | 55 ms | 3496 KB |
test_10.txt | AC | 52 ms | 3376 KB |
test_11.txt | AC | 53 ms | 3380 KB |
test_12.txt | AC | 49 ms | 3380 KB |
test_13.txt | AC | 51 ms | 3500 KB |
test_14.txt | AC | 51 ms | 3376 KB |
test_15.txt | AC | 53 ms | 3488 KB |
test_16.txt | AC | 50 ms | 3376 KB |
test_17.txt | AC | 51 ms | 3388 KB |
test_18.txt | AC | 49 ms | 3384 KB |
test_19.txt | AC | 50 ms | 3384 KB |
test_20.txt | AC | 50 ms | 3380 KB |
test_21.txt | AC | 303 ms | 10436 KB |
test_22.txt | AC | 329 ms | 10436 KB |
test_23.txt | AC | 306 ms | 10440 KB |
test_24.txt | AC | 319 ms | 10432 KB |
test_25.txt | AC | 321 ms | 11108 KB |
test_26.txt | AC | 305 ms | 10440 KB |
test_27.txt | AC | 260 ms | 10624 KB |
test_28.txt | AC | 301 ms | 10436 KB |
test_29.txt | AC | 49 ms | 3380 KB |
test_30.txt | AC | 48 ms | 3380 KB |
test_31.txt | AC | 86 ms | 4268 KB |
test_32.txt | AC | 47 ms | 3376 KB |
test_33.txt | AC | 217 ms | 7980 KB |
test_34.txt | AC | 47 ms | 3376 KB |
test_35.txt | AC | 48 ms | 3400 KB |
test_36.txt | AC | 315 ms | 10440 KB |
test_37.txt | AC | 306 ms | 10432 KB |
test_38.txt | AC | 308 ms | 10420 KB |
test_39.txt | AC | 304 ms | 10436 KB |
test_40.txt | AC | 296 ms | 10444 KB |
test_41.txt | AC | 219 ms | 10436 KB |
test_42.txt | AC | 244 ms | 10432 KB |
test_43.txt | AC | 208 ms | 10428 KB |