結果

問題 No.143 豆
ユーザー Maboy
提出日時 2021-06-16 13:14:18
言語 Swift
(6.0.3)
結果
WA  
実行時間 -
コード長 247 bytes
コンパイル時間 13,542 ms
コンパイル使用メモリ 129,288 KB
実行使用メモリ 9,344 KB
最終ジャッジ日時 2024-12-30 08:46:47
合計ジャッジ時間 14,661 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 16 WA * 1
権限があれば一括ダウンロードができます

ソースコード

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