結果
| 問題 |
No.156 キャンディー・ボックス
|
| コンテスト | |
| ユーザー |
バカらっく
|
| 提出日時 | 2018-02-18 14:47:59 |
| 言語 | Swift (6.0.3) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 357 bytes |
| コンパイル時間 | 1,224 ms |
| コンパイル使用メモリ | 137,704 KB |
| 実行使用メモリ | 9,472 KB |
| 最終ジャッジ日時 | 2024-11-30 11:52:27 |
| 合計ジャッジ時間 | 2,388 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 4 |
| other | AC * 7 WA * 23 |
ソースコード
let inpt = readLine()!.split(separator: " ").map({Int($0)});
let boxCount = inpt[0]!;
let removeCount = inpt[1]!;
var candyList = readLine()!.split(separator: " ").map({Int($0)!}).sorted(by: {$0<$1});
for _ in 1...removeCount {
candyList[0] = candyList[0]-1;
if(candyList[0]<=0) {
candyList.removeFirst();
}
}
print(candyList.count);
バカらっく