Submission #110400
Source Code Expand
def roundBefore(time) if time % 10 < 5 then time - (time % 10) else time - (time % 10) + 5 end end def roundAfter(time) if time % 10 == 0 then time elsif time % 10 < 5 then time - (time % 10) + 5 else time - (time % 10) + 10 end end data = Array.new $stdin.gets.to_i.times{ tmp = $stdin.gets.chomp.split("-").map(&:to_i) data << [roundBefore(tmp[0]), roundAfter(tmp[1])] } data.sort! record = Array.new(2405) data.each{|r| startTime = r[0] endTime = r[1] startTime.step(endTime, 1){|t| record[t] = true } } rained = false startTime = nil endTime = data[data.size - 1][1] (start = data[0][0]).step(endTime + 5, 5){|t| #降り始め if !rained && record[t] then rained = true startTime = t printf "%04d", startTime #雨やんだ elsif rained && !record[t] rained = false printf "-%04d\n", t - 5 end }
Submission Info
Submission Time | |
---|---|
Task | D - 感雨時刻の整理 |
User | matasaburou |
Language | Ruby (1.9.3) |
Score | 0 |
Code Size | 896 Byte |
Status | TLE |
Exec Time | 2038 ms |
Memory | 4648 KB |
Judge Result
Set Name | all | ||||||
---|---|---|---|---|---|---|---|
Score / Max Score | 0 / 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 | 39 ms | 2576 KB |
00_sample_02.txt | AC | 34 ms | 2468 KB |
00_sample_03.txt | WA | 38 ms | 2584 KB |
cho_cho_chokudai.txt | TLE | 2034 ms | 4640 KB |
chokudai_ga_cho.txt | TLE | 2033 ms | 4636 KB |
test_01.txt | WA | 38 ms | 2468 KB |
test_02.txt | WA | 38 ms | 2584 KB |
test_03.txt | WA | 37 ms | 2472 KB |
test_04.txt | WA | 36 ms | 2468 KB |
test_05.txt | WA | 33 ms | 2460 KB |
test_06.txt | AC | 83 ms | 2472 KB |
test_07.txt | AC | 62 ms | 2468 KB |
test_08.txt | AC | 61 ms | 2472 KB |
test_09.txt | AC | 156 ms | 2472 KB |
test_10.txt | AC | 99 ms | 2464 KB |
test_11.txt | AC | 59 ms | 2472 KB |
test_12.txt | AC | 131 ms | 2472 KB |
test_13.txt | AC | 45 ms | 2472 KB |
test_14.txt | AC | 118 ms | 2468 KB |
test_15.txt | AC | 175 ms | 2468 KB |
test_16.txt | AC | 46 ms | 2464 KB |
test_17.txt | AC | 65 ms | 2468 KB |
test_18.txt | AC | 41 ms | 2464 KB |
test_19.txt | AC | 62 ms | 2472 KB |
test_20.txt | WA | 50 ms | 2464 KB |
test_21.txt | AC | 971 ms | 4564 KB |
test_22.txt | TLE | 2037 ms | 4644 KB |
test_23.txt | AC | 1192 ms | 4520 KB |
test_24.txt | TLE | 2033 ms | 4648 KB |
test_25.txt | AC | 1605 ms | 4524 KB |
test_26.txt | WA | 381 ms | 4516 KB |
test_27.txt | AC | 245 ms | 4520 KB |
test_28.txt | WA | 433 ms | 4516 KB |
test_29.txt | AC | 35 ms | 2468 KB |
test_30.txt | WA | 33 ms | 2464 KB |
test_31.txt | WA | 86 ms | 2788 KB |
test_32.txt | WA | 33 ms | 2464 KB |
test_33.txt | WA | 249 ms | 3492 KB |
test_34.txt | AC | 32 ms | 2560 KB |
test_35.txt | WA | 35 ms | 2464 KB |
test_36.txt | TLE | 2033 ms | 4636 KB |
test_37.txt | WA | 397 ms | 4504 KB |
test_38.txt | WA | 390 ms | 4516 KB |
test_39.txt | AC | 591 ms | 4512 KB |
test_40.txt | WA | 560 ms | 4480 KB |
test_41.txt | TLE | 2035 ms | 4560 KB |
test_42.txt | TLE | 2032 ms | 4644 KB |
test_43.txt | TLE | 2038 ms | 4644 KB |