結果

問題 No.143 豆
ユーザー kryu_______2740kryu_______2740
提出日時 2018-02-26 23:42:19
言語 Ruby
(3.3.0)
結果
AC  
実行時間 87 ms / 1,000 ms
コード長 229 bytes
コンパイル時間 42 ms
コンパイル使用メモリ 11,556 KB
実行使用メモリ 15,244 KB
最終ジャッジ日時 2023-09-30 17:12:38
合計ジャッジ時間 2,359 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 86 ms
15,012 KB
testcase_01 AC 82 ms
15,092 KB
testcase_02 AC 82 ms
15,080 KB
testcase_03 AC 82 ms
15,040 KB
testcase_04 AC 85 ms
15,136 KB
testcase_05 AC 87 ms
15,172 KB
testcase_06 AC 86 ms
15,172 KB
testcase_07 AC 82 ms
15,080 KB
testcase_08 AC 84 ms
15,000 KB
testcase_09 AC 84 ms
15,032 KB
testcase_10 AC 83 ms
15,096 KB
testcase_11 AC 84 ms
15,244 KB
testcase_12 AC 82 ms
15,004 KB
testcase_13 AC 83 ms
15,180 KB
testcase_14 AC 84 ms
15,036 KB
testcase_15 AC 83 ms
15,172 KB
testcase_16 AC 82 ms
15,040 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

a = gets
a = a.split(" ")
a = a.map!{|x| x.to_i}
age = gets
age = age.split(" ")
age = age.map!{|x| x.to_i}
sum = a[0]*a[1]
ans = sum
for i in 0..a[2]-1
    ans = ans - age[i]
end
if ans >=0 
    puts(ans)
else 
    puts "-1"
end
0