Submission #694290
Source Code Expand
#! /usr/bin/perl $N = <STDIN>; %input_hash; %output_hash; foreach $i (1..$N){ $line = <STDIN>; chomp $line; ($start,$end) = split(/-/, $line); if( substr($start,-1,1) % 5 == 0 ){ # do tnohigj }elsif( substr($start,-1,1) < 5){ $start = int($start/10) * 10; }else{ $start = int($start/10) * 10 + 5; } if( substr($end,-1,1) % 5 == 0){ #do nothing }elsif( 0 < substr($end,-1,1 ) && substr($end,-1,1) < 5){ $end = int($end/10) * 10 + 5; }else{ $end = int($end/10 + 1) *10; } $input_hash{$start} = $end; print "start:".$start."\n"; print "end:".$end."\n"; print "------\n"; } $s; $e; foreach $key(sort keys %input_hash){ print "s:".$s."\n"; print "e:".$e."\n"; print "------\n"; if(!$s){ $s = $key; $e = $input_hash{$key}; next; } if( $e < $key){ $output_hash{$s} = $e; $s = $key; $e = $input_hash{$key}; next; } if( $key < $input_hash{$key}){ $e = $input_hash{$key}; } } $output_hash{$s} = $e; foreach $key(sort keys %output_hash){ print $key."-".$output_hash{$key}."\n"; }
Submission Info
Submission Time | |
---|---|
Task | D - 感雨時刻の整理 |
User | stokuda |
Language | Perl (5.14.2) |
Score | 0 |
Code Size | 1186 Byte |
Status | WA |
Exec Time | 191 ms |
Memory | 1312 KB |
Compile Error
Useless use of a variable in void context at ./Main.pl line 7. Useless use of a variable in void context at ./Main.pl line 8. Useless use of a variable in void context at ./Main.pl line 38. Useless use of a variable in void context at ./Main.pl line 39. Name "main::i" used only once: possible typo at ./Main.pl line 10. ./Main.pl syntax OK
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 | WA | 31 ms | 1176 KB |
00_sample_02.txt | WA | 29 ms | 1172 KB |
00_sample_03.txt | WA | 31 ms | 1116 KB |
cho_cho_chokudai.txt | WA | 191 ms | 1180 KB |
chokudai_ga_cho.txt | WA | 181 ms | 1184 KB |
test_01.txt | WA | 31 ms | 1184 KB |
test_02.txt | WA | 30 ms | 1112 KB |
test_03.txt | WA | 28 ms | 1192 KB |
test_04.txt | WA | 30 ms | 1188 KB |
test_05.txt | WA | 30 ms | 1240 KB |
test_06.txt | WA | 32 ms | 1204 KB |
test_07.txt | WA | 31 ms | 1188 KB |
test_08.txt | WA | 31 ms | 1176 KB |
test_09.txt | WA | 33 ms | 1180 KB |
test_10.txt | WA | 32 ms | 1176 KB |
test_11.txt | WA | 32 ms | 1112 KB |
test_12.txt | WA | 33 ms | 1168 KB |
test_13.txt | WA | 32 ms | 1200 KB |
test_14.txt | WA | 34 ms | 1136 KB |
test_15.txt | WA | 35 ms | 1176 KB |
test_16.txt | WA | 31 ms | 1176 KB |
test_17.txt | WA | 35 ms | 1172 KB |
test_18.txt | WA | 32 ms | 1188 KB |
test_19.txt | WA | 32 ms | 1312 KB |
test_20.txt | WA | 34 ms | 1136 KB |
test_21.txt | WA | 187 ms | 1304 KB |
test_22.txt | WA | 185 ms | 1260 KB |
test_23.txt | WA | 182 ms | 1192 KB |
test_24.txt | WA | 189 ms | 1268 KB |
test_25.txt | WA | 185 ms | 1248 KB |
test_26.txt | WA | 186 ms | 1232 KB |
test_27.txt | WA | 183 ms | 1176 KB |
test_28.txt | WA | 183 ms | 1200 KB |
test_29.txt | WA | 28 ms | 1116 KB |
test_30.txt | WA | 30 ms | 1168 KB |
test_31.txt | WA | 54 ms | 1200 KB |
test_32.txt | WA | 29 ms | 1116 KB |
test_33.txt | WA | 132 ms | 1252 KB |
test_34.txt | WA | 27 ms | 1184 KB |
test_35.txt | WA | 30 ms | 1176 KB |
test_36.txt | WA | 185 ms | 1192 KB |
test_37.txt | WA | 183 ms | 1124 KB |
test_38.txt | WA | 183 ms | 1236 KB |
test_39.txt | WA | 186 ms | 1112 KB |
test_40.txt | WA | 187 ms | 1180 KB |
test_41.txt | WA | 123 ms | 1112 KB |
test_42.txt | WA | 127 ms | 1104 KB |
test_43.txt | WA | 125 ms | 1108 KB |