結果

問題 No.193 筒の数式
ユーザー tubo28tubo28
提出日時 2015-04-26 22:43:30
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 277 bytes
コンパイル時間 316 ms
コンパイル使用メモリ 11,360 KB
実行使用メモリ 15,324 KB
最終ジャッジ日時 2023-09-18 12:15:05
合計ジャッジ時間 3,227 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 83 ms
15,100 KB
testcase_01 WA -
testcase_02 AC 81 ms
15,136 KB
testcase_03 AC 82 ms
15,144 KB
testcase_04 AC 82 ms
15,232 KB
testcase_05 AC 81 ms
15,312 KB
testcase_06 AC 81 ms
15,260 KB
testcase_07 AC 82 ms
15,316 KB
testcase_08 AC 82 ms
15,080 KB
testcase_09 AC 82 ms
15,228 KB
testcase_10 AC 82 ms
15,156 KB
testcase_11 AC 84 ms
15,044 KB
testcase_12 AC 82 ms
15,152 KB
testcase_13 AC 82 ms
15,136 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

s = gets.chomp
n = s.size
n.times do |i|
  s += s[i]
end

ans = 0

n.times do |i|
  begin
    t = s[i,n]
    next if t[0] == "+"
    next if t[0] == "-"
    next if t[-1] == "+"
    next if t[-1] == "-"
    ans = [ans,eval(t)].max
  rescue SyntaxError => s
  end
end

puts ans
0