結果

問題 No.49 算数の宿題
ユーザー cympfhcympfh
提出日時 2015-12-01 16:11:37
言語 Ruby
(3.3.0)
結果
AC  
実行時間 86 ms / 5,000 ms
コード長 128 bytes
コンパイル時間 72 ms
コンパイル使用メモリ 11,460 KB
実行使用メモリ 15,336 KB
最終ジャッジ日時 2023-08-24 17:27:27
合計ジャッジ時間 1,568 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 86 ms
15,132 KB
testcase_01 AC 80 ms
15,236 KB
testcase_02 AC 82 ms
15,288 KB
testcase_03 AC 82 ms
15,236 KB
testcase_04 AC 82 ms
15,200 KB
testcase_05 AC 83 ms
15,156 KB
testcase_06 AC 85 ms
15,224 KB
testcase_07 AC 83 ms
15,336 KB
testcase_08 AC 83 ms
15,248 KB
testcase_09 AC 82 ms
15,184 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

xs=gets.chomp.gsub(/[*+]/,"@\\&@").split'@'
x=xs[0].to_i
i=-1
xs[i+=2]=="+"?x*=xs[i+1].to_i: x+=xs[i+1].to_i while i<xs.size
p x
0