結果
| 問題 |
No.311 z in FizzBuzzString
|
| コンテスト | |
| ユーザー |
tsubaki961
|
| 提出日時 | 2016-05-21 22:06:21 |
| 言語 | Perl (5.40.0) |
| 結果 |
MLE
|
| 実行時間 | - |
| コード長 | 697 bytes |
| コンパイル時間 | 252 ms |
| コンパイル使用メモリ | 6,944 KB |
| 実行使用メモリ | 816,424 KB |
| 最終ジャッジ日時 | 2024-09-24 21:41:44 |
| 合計ジャッジ時間 | 2,230 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 7 MLE * 1 -- * 3 |
コンパイルメッセージ
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;
}
}
tsubaki961