結果
| 問題 | No.156 キャンディー・ボックス |
| コンテスト | |
| ユーザー |
バカらっく
|
| 提出日時 | 2018-02-18 14:47:59 |
| 言語 | Swift (6.2.4) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 357 bytes |
| 記録 | |
| コンパイル時間 | 1,046 ms |
| コンパイル使用メモリ | 150,040 KB |
| 実行使用メモリ | 10,240 KB |
| 最終ジャッジ日時 | 2026-05-24 03:20:23 |
| 合計ジャッジ時間 | 2,356 ms |
|
ジャッジサーバーID (参考情報) |
judge1_1 / judge3_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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);
バカらっく