結果
| 問題 | No.1380 Borderline |
| コンテスト | |
| ユーザー |
onsen_manjuuu
|
| 提出日時 | 2021-02-07 20:33:26 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.90.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 367 bytes |
| 記録 | |
| コンパイル時間 | 1,185 ms |
| コンパイル使用メモリ | 210,824 KB |
| 実行使用メモリ | 6,400 KB |
| 最終ジャッジ日時 | 2026-06-17 16:06:03 |
| 合計ジャッジ時間 | 2,478 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge2_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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