結果

問題 No.193 筒の数式
ユーザー motimoti
提出日時 2018-05-24 01:38:57
言語 Perl
(5.38.2)
結果
WA  
実行時間 -
コード長 312 bytes
コンパイル時間 279 ms
コンパイル使用メモリ 5,328 KB
実行使用メモリ 4,864 KB
最終ジャッジ日時 2023-09-11 02:11:08
合計ジャッジ時間 1,829 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,780 KB
testcase_01 WA -
testcase_02 AC 2 ms
4,800 KB
testcase_03 AC 3 ms
4,656 KB
testcase_04 AC 3 ms
4,776 KB
testcase_05 AC 3 ms
4,664 KB
testcase_06 AC 3 ms
4,772 KB
testcase_07 AC 3 ms
4,756 KB
testcase_08 AC 2 ms
4,796 KB
testcase_09 AC 3 ms
4,752 KB
testcase_10 AC 3 ms
4,656 KB
testcase_11 AC 3 ms
4,704 KB
testcase_12 AC 2 ms
4,828 KB
testcase_13 AC 3 ms
4,656 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.pl syntax OK

ソースコード

diff #

my $s = <>; chomp $s;
my $n = length $s;
my @sa = split //, $s . $s;
my $ma = 0;
for (my $i = 0; $i < $n; $i++) {
  next if $sa[$i] eq '+' || $sa[$i] eq '-';
  next if $sa[$i + $n - 1] eq '+' || $sa[$i + $n - 1] eq '-';
  my $cand = eval (join('', @sa[$i..($i+$n-1)]));
  $ma = $cand if $ma < $cand;
}
print $ma;
0