結果

問題 No.193 筒の数式
ユーザー sune232002sune232002
提出日時 2015-04-26 22:06:46
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 171 bytes
コンパイル時間 36 ms
コンパイル使用メモリ 11,456 KB
実行使用メモリ 15,336 KB
最終ジャッジ日時 2023-09-18 11:50:54
合計ジャッジ時間 2,421 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 78 ms
15,220 KB
testcase_01 WA -
testcase_02 AC 81 ms
15,060 KB
testcase_03 AC 77 ms
15,192 KB
testcase_04 AC 76 ms
15,228 KB
testcase_05 AC 77 ms
15,296 KB
testcase_06 AC 77 ms
15,092 KB
testcase_07 AC 76 ms
15,124 KB
testcase_08 AC 78 ms
15,332 KB
testcase_09 AC 79 ms
15,088 KB
testcase_10 AC 77 ms
15,168 KB
testcase_11 AC 79 ms
15,184 KB
testcase_12 AC 78 ms
15,004 KB
testcase_13 AC 80 ms
15,132 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

s = gets.strip
n = s.size
s = s+s
ans = 0
n.times{|i|
  t = s[i,n]
  next if t[0] == '+' || t[-1] == '+' || t[0] == '-' || t[-1] == '-'
  ans = [ans, eval(t)].max
}
p ans
0