Submission #108586
Source Code Expand
#!/usr/bin/ruby -Ku x = gets().chomp.to_i times = Array.new() for i in 1..x tmp = gets().chomp.split(/-/) s = tmp[0] e = tmp[1] tmps = s[3].to_i if tmps < 5 tmps = 0 else tmps = 5 end tmpe = e[3].to_i if tmpe == 0 tmpe = 0 elsif tmpe <= 5 tmpe = 5 else tmpe = 10 end s_m = (s[0..1].to_i * 60 + s[2].to_i * 10 + tmps) e_m = (e[0..1].to_i * 60 + e[2].to_i * 10 + tmpe) times << [s_m, e_m] end i = 0 while i < times.size flag = true while flag flag = false j = times.size-1 while j > i if times[i][0] < times[j][0] && times[i][1] > times[j][1] times.delete_at(j) elsif (times[j][1] - times[i][0]) == 5 || (times[j][1] - times[i][0]) == 0 times[i][0] = times[j][0] times.delete_at(j) flag = true elsif (times[i][1] - times[j][0]) == 5 || (times[i][1] - times[j][0]) == 0 times[i][1] = times[j][1] times.delete_at(j) flag = true elsif times[i][0] < times[j][0] && times[i][1] > times[j][0] times[i][1] = times[j][1] times.delete_at(j) flag = true elsif times[j][0] < times[i][0] && times[j][1] > times[i][0] times[i][0] = times[j][0] times.delete_at(j) flag = true end j -= 1 end end i += 1 end times.each do |x| s_h = x[0] / 60 s_m = x[0] % 60 e_h = x[1] / 60 e_m = x[1] % 60 printf("%02d", s_h) printf("%02d", s_m) print "-" printf("%02d", e_h) printf("%02d", e_m) puts end
Submission Info
Submission Time | |
---|---|
Task | D - 感雨時刻の整理 |
User | kato_coffee |
Language | Ruby (1.9.3) |
Score | 0 |
Code Size | 1589 Byte |
Status | WA |
Exec Time | 2038 ms |
Memory | 6652 KB |
Compile Error
./Main.rb:61: warning: shadowing outer local variable - x
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 | 63 ms | 4220 KB |
00_sample_02.txt | AC | 57 ms | 4212 KB |
00_sample_03.txt | WA | 58 ms | 4212 KB |
cho_cho_chokudai.txt | TLE | 2035 ms | 6652 KB |
chokudai_ga_cho.txt | WA | 335 ms | 6516 KB |
test_01.txt | AC | 70 ms | 4212 KB |
test_02.txt | WA | 67 ms | 4212 KB |
test_03.txt | WA | 68 ms | 4208 KB |
test_04.txt | AC | 70 ms | 4212 KB |
test_05.txt | WA | 70 ms | 4212 KB |
test_06.txt | WA | 60 ms | 4212 KB |
test_07.txt | AC | 60 ms | 4208 KB |
test_08.txt | AC | 58 ms | 4208 KB |
test_09.txt | WA | 63 ms | 4336 KB |
test_10.txt | WA | 62 ms | 4340 KB |
test_11.txt | WA | 203 ms | 4220 KB |
test_12.txt | WA | 61 ms | 4208 KB |
test_13.txt | WA | 61 ms | 4208 KB |
test_14.txt | WA | 62 ms | 4320 KB |
test_15.txt | WA | 63 ms | 4208 KB |
test_16.txt | WA | 57 ms | 4208 KB |
test_17.txt | AC | 63 ms | 4212 KB |
test_18.txt | AC | 57 ms | 4212 KB |
test_19.txt | AC | 57 ms | 4336 KB |
test_20.txt | AC | 62 ms | 4220 KB |
test_21.txt | WA | 317 ms | 6512 KB |
test_22.txt | WA | 300 ms | 6512 KB |
test_23.txt | WA | 324 ms | 6512 KB |
test_24.txt | AC | 309 ms | 6516 KB |
test_25.txt | AC | 314 ms | 6512 KB |
test_26.txt | AC | 427 ms | 6496 KB |
test_27.txt | TLE | 2038 ms | 6640 KB |
test_28.txt | TLE | 2035 ms | 6640 KB |
test_29.txt | AC | 87 ms | 4192 KB |
test_30.txt | WA | 58 ms | 4168 KB |
test_31.txt | WA | 263 ms | 4592 KB |
test_32.txt | WA | 59 ms | 4216 KB |
test_33.txt | WA | 660 ms | 5364 KB |
test_34.txt | WA | 60 ms | 4212 KB |
test_35.txt | WA | 64 ms | 4212 KB |
test_36.txt | WA | 304 ms | 6508 KB |
test_37.txt | TLE | 2035 ms | 6644 KB |
test_38.txt | WA | 443 ms | 6512 KB |
test_39.txt | TLE | 2036 ms | 6640 KB |
test_40.txt | TLE | 2035 ms | 6640 KB |
test_41.txt | WA | 333 ms | 6516 KB |
test_42.txt | WA | 320 ms | 6520 KB |
test_43.txt | WA | 320 ms | 6512 KB |