結果
問題 |
No.156 キャンディー・ボックス
|
ユーザー |
![]() |
提出日時 | 2020-07-18 20:46:45 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
RE
|
実行時間 | - |
コード長 | 349 bytes |
コンパイル時間 | 1,625 ms |
コンパイル使用メモリ | 169,116 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-12-14 06:34:53 |
合計ジャッジ時間 | 6,084 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 3 RE * 1 |
other | AC * 2 WA * 6 RE * 22 |
ソースコード
#include <bits/stdc++.h> using namespace std; int main(){ int N, M; cin >> N >> M; vector<int> C(N); for (int i = 0; i < N; i++){ cin >> C[i]; } for (int i = 0; i < M; i++){ (*min_element(C.begin(), C.end()))--; } int ans = 0; for (int i = 0; i < M; i++){ if (C[i] == 0){ ans++; } } cout << ans << endl; }