結果
問題 | No.311 z in FizzBuzzString |
ユーザー | tsubaki961 |
提出日時 | 2016-05-21 22:06:21 |
言語 | Perl (5.38.2) |
結果 |
MLE
|
実行時間 | - |
コード長 | 697 bytes |
コンパイル時間 | 252 ms |
コンパイル使用メモリ | 6,944 KB |
実行使用メモリ | 816,424 KB |
最終ジャッジ日時 | 2024-09-24 21:41:44 |
合計ジャッジ時間 | 2,230 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 3 ms
6,812 KB |
testcase_01 | AC | 3 ms
6,944 KB |
testcase_02 | AC | 4 ms
6,944 KB |
testcase_03 | AC | 3 ms
6,944 KB |
testcase_04 | AC | 3 ms
6,940 KB |
testcase_05 | AC | 5 ms
6,940 KB |
testcase_06 | AC | 5 ms
6,944 KB |
testcase_07 | MLE | - |
testcase_08 | -- | - |
testcase_09 | -- | - |
testcase_10 | -- | - |
コンパイルメッセージ
Scalar value @box[0] better written as $box[0] at Main.pl line 30. Scalar value @box[0] better written as $box[0] at Main.pl line 31. Scalar value @box[1] better written as $box[1] at Main.pl line 32. Scalar value @box[0] better written as $box[0] at Main.pl line 33. Scalar value @box[0] better written as $box[0] at Main.pl line 38. Scalar value @box[...] better written as $box[...] at Main.pl line 39. Scalar value @box[...] better written as $box[...] at Main.pl line 39. Scalar value @box[...] better written as $box[...] at Main.pl line 40. Scalar value @count[...] better written as $count[...] at Main.pl line 5. Main.pl syntax OK
ソースコード
use strict; my $N = <STDIN>; my @count = Fire($N); for(my $i = @count - 1; $i >= 0; $i--){ print @count[$i]; } print "\n"; sub Fire { my @box; my $set = 0; my $N = $_[0]; if($N % 3 == 0 && $N % 5 == 0) { $set = 4; }elsif($N % 3 == 0){ $set = 2; }elsif($N % 5 == 0){ $set = 2; }else{ $set = 0; } if($N == 1){ @box = $set; return @box; }else{ @box = Fire($N - 1); @box[0] += $set; if(@box[0] >= 10 ** 4){ @box[1] += @box / 10 **4; @box[0] %= 10**4; } my $length = @box; if($length > 1){ for(my $i = 1; $i <= $length - 1; $i++){ if(@box[0] >= 10 ** 4){ @box[$i+1] += @box[$i] / 10 **4; @box[$i] %= 10**4; } } } return @box; } }