結果

問題 No.2138 Add Bacon
ユーザー Yuzu Mashiro
提出日時 2024-06-25 20:04:49
言語 Swift
(6.0.3)
結果
AC  
実行時間 10 ms / 2,000 ms
コード長 231 bytes
コンパイル時間 6,493 ms
コンパイル使用メモリ 128,072 KB
実行使用メモリ 9,344 KB
最終ジャッジ日時 2024-06-25 20:04:57
合計ジャッジ時間 4,189 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 25
権限があれば一括ダウンロードができます

ソースコード

diff #

let v = readLine()!.split(separator: " ").map { Int($0)! }
let (a, b, c, d, e) = (v[0], v[1], v[2], v[3], v[4])

var result = [Int]()

for bacon in 0...c {
  result.append((a + bacon * d) - (b + bacon * e))
}

print(result.max()!)
0