結果

問題 No.143 豆
ユーザー MaboyMaboy
提出日時 2021-06-16 13:14:18
言語 Swift
(5.10.0)
結果
WA  
実行時間 -
コード長 247 bytes
コンパイル時間 6,725 ms
コンパイル使用メモリ 126,496 KB
実行使用メモリ 8,240 KB
最終ジャッジ日時 2023-08-28 20:53:12
合計ジャッジ時間 8,106 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
8,112 KB
testcase_01 AC 3 ms
8,140 KB
testcase_02 AC 3 ms
8,144 KB
testcase_03 AC 3 ms
8,140 KB
testcase_04 AC 3 ms
8,084 KB
testcase_05 AC 3 ms
8,120 KB
testcase_06 AC 3 ms
8,068 KB
testcase_07 AC 3 ms
8,072 KB
testcase_08 AC 3 ms
8,200 KB
testcase_09 WA -
testcase_10 AC 4 ms
8,196 KB
testcase_11 AC 3 ms
8,208 KB
testcase_12 AC 3 ms
8,208 KB
testcase_13 AC 3 ms
8,220 KB
testcase_14 AC 3 ms
8,240 KB
testcase_15 AC 4 ms
8,192 KB
testcase_16 AC 4 ms
8,116 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

let inpA = readLine()!
let inpB = readLine()!

let inpAs = inpA.split(separator: " ").map{Int($0)!}
let ages = inpB.split(separator: " ").map{Int($0)!}.reduce(0, +)

let beans = inpAs[0] * inpAs[1]
let rem = beans - ages

print(rem > 0 ? rem : -1)
0