結果
| 問題 |
No.1380 Borderline
|
| コンテスト | |
| ユーザー |
onsen_manjuuu
|
| 提出日時 | 2021-02-07 20:33:26 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 3 ms / 2,000 ms |
| コード長 | 367 bytes |
| コンパイル時間 | 2,026 ms |
| コンパイル使用メモリ | 192,376 KB |
| 最終ジャッジ日時 | 2025-01-18 13:53:03 |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 41 |
ソースコード
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using pint = pair<int,int>;
int main()
{
int n, k; cin >> n >> k;
vector<int> p(500);
for(int i = 0; i < n; i++) {
int c; cin >> c;
p[c]++;
}
int ans = 0, sum = 0;
for(int i = 499; i >= 0; i--) {
sum += p[i];
if(sum <= k) ans = max(ans, sum);
else break;
}
cout << ans << endl;
}
onsen_manjuuu