結果
問題 |
No.143 豆
|
ユーザー |
![]() |
提出日時 | 2016-04-03 20:01:00 |
言語 | Ruby (3.4.1) |
結果 |
AC
|
実行時間 | 92 ms / 1,000 ms |
コード長 | 176 bytes |
コンパイル時間 | 99 ms |
コンパイル使用メモリ | 7,424 KB |
実行使用メモリ | 12,416 KB |
最終ジャッジ日時 | 2024-07-23 10:28:06 |
合計ジャッジ時間 | 2,341 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 17 |
コンパイルメッセージ
Main.rb:10: warning: ambiguous first argument; put parentheses or a space even after `-' operator Syntax OK
ソースコード
total = 0 s = gets.chomp.split(" ") s2 = gets.chomp.split(" ") mame = s[0].to_i * s[1].to_i s2.each {|n| total += n.to_i} res = mame - total if res < 0 p -1 else p res end