Submission #109925
Source Code Expand
#!/usr/bin/env ruby timebelt = Array.new(24 * 12 + 1,0) #p timebelt n = gets.chomp.to_i timedata = Array.new() n.times do timedata << gets.chomp.split("-") end timedata.each do |element| element[0] = element[0].to_i element[1] = element[1].to_i if((element[0] % 5) > 0) (element[0] -= element[0] % 5) end if((element[1] % 5) > 0) (element[1] += (5 - element[1] % 5)) if(element[1] % 100 == 60) element[1] = element[1] + 40 end end end #p timedata timedata.each do |element| first_hour = element[0] / 100 first_min = (element[0] % 100) /5 start = first_hour * 12 + first_min last_hour = element[1] / 100 last_min = (element[1] % 100) /5 last = last_hour * 12 + last_min - 1 # puts start # puts last (start..last).each do |i| timebelt[i] = 1 end end # p timebelt anser = Array.new timebelt.each_with_index do |i,idx| if( i == 1 && (timebelt[idx - 1] == 0 || idx == 0)) anser << idx end if( i == 1 && (timebelt[idx + 1] == 0 || idx == 288)) anser << idx + 1 end end anser.map! do |i| anser_hour = ( i - i % 12)/12 * 100 anser_min = ( i % 12) * 5 "%04d" % (anser_hour + anser_min) end while( anser.size > 0) text = anser.shift.to_s + '-' text += anser.shift.to_s puts text end
Submission Info
Submission Time | |
---|---|
Task | D - 感雨時刻の整理 |
User | tomcha |
Language | Ruby (1.9.3) |
Score | 100 |
Code Size | 1430 Byte |
Status | AC |
Exec Time | 1614 ms |
Memory | 11256 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 | 67 ms | 4252 KB |
00_sample_02.txt | AC | 62 ms | 4236 KB |
00_sample_03.txt | AC | 63 ms | 4128 KB |
cho_cho_chokudai.txt | AC | 1614 ms | 11164 KB |
chokudai_ga_cho.txt | AC | 681 ms | 11164 KB |
test_01.txt | AC | 64 ms | 4124 KB |
test_02.txt | AC | 60 ms | 4120 KB |
test_03.txt | AC | 64 ms | 4248 KB |
test_04.txt | AC | 59 ms | 4244 KB |
test_05.txt | AC | 61 ms | 4252 KB |
test_06.txt | AC | 69 ms | 4124 KB |
test_07.txt | AC | 65 ms | 4124 KB |
test_08.txt | AC | 61 ms | 4240 KB |
test_09.txt | AC | 81 ms | 4248 KB |
test_10.txt | AC | 74 ms | 4252 KB |
test_11.txt | AC | 61 ms | 4244 KB |
test_12.txt | AC | 72 ms | 4248 KB |
test_13.txt | AC | 58 ms | 4120 KB |
test_14.txt | AC | 71 ms | 4248 KB |
test_15.txt | AC | 80 ms | 4340 KB |
test_16.txt | AC | 61 ms | 4124 KB |
test_17.txt | AC | 66 ms | 4248 KB |
test_18.txt | AC | 63 ms | 4240 KB |
test_19.txt | AC | 66 ms | 4252 KB |
test_20.txt | AC | 66 ms | 4248 KB |
test_21.txt | AC | 284 ms | 11164 KB |
test_22.txt | AC | 445 ms | 11164 KB |
test_23.txt | AC | 306 ms | 11164 KB |
test_24.txt | AC | 443 ms | 11156 KB |
test_25.txt | AC | 341 ms | 11164 KB |
test_26.txt | AC | 207 ms | 11160 KB |
test_27.txt | AC | 204 ms | 11160 KB |
test_28.txt | AC | 216 ms | 11160 KB |
test_29.txt | AC | 61 ms | 4228 KB |
test_30.txt | AC | 60 ms | 4252 KB |
test_31.txt | AC | 83 ms | 5008 KB |
test_32.txt | AC | 58 ms | 4252 KB |
test_33.txt | AC | 161 ms | 7828 KB |
test_34.txt | AC | 64 ms | 4260 KB |
test_35.txt | AC | 63 ms | 4224 KB |
test_36.txt | AC | 550 ms | 11156 KB |
test_37.txt | AC | 218 ms | 11160 KB |
test_38.txt | AC | 215 ms | 11160 KB |
test_39.txt | AC | 235 ms | 11156 KB |
test_40.txt | AC | 237 ms | 11164 KB |
test_41.txt | AC | 893 ms | 11256 KB |
test_42.txt | AC | 906 ms | 11156 KB |
test_43.txt | AC | 915 ms | 11160 KB |