結果
問題 | No.1380 Borderline |
ユーザー |
![]() |
提出日時 | 2021-02-14 20:40:48 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 338 bytes |
コンパイル時間 | 1,394 ms |
コンパイル使用メモリ | 168,032 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-22 07:59:16 |
合計ジャッジ時間 | 2,787 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 41 |
ソースコード
#include <bits/stdc++.h>using namespace std;int main() {int N, K, ans = 0;cin >> N >> K;vector<int> p(401);for (int i = 0; i < N; i++) {int a;cin >> a;p.at(a)++;}for (int i = 400; 0 <= i; i--) {if (K - p.at(i) < 0)break;ans += p.at(i);K -= p.at(i);}cout << ans << endl;}