結果
| 問題 | No.1380 Borderline |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-02-13 21:32:07 |
| 言語 | C++14 (gcc 15.3.0 + boost 1.92.0) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 2,000 ms |
| + 585µs | |
| コード長 | 555 bytes |
| 記録 | |
| コンパイル時間 | 353 ms |
| コンパイル使用メモリ | 90,208 KB |
| 実行使用メモリ | 5,888 KB |
| 最終ジャッジ日時 | 2026-08-20 22:44:13 |
| 合計ジャッジ時間 | 3,551 ms |
|
ジャッジサーバーID (参考情報) |
judge1_1 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 41 |
ソースコード
#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
int main(){
int n,k;
cin >> n >> k;
int bm = 0;
vector<int> p(n);
for(int i=0; i<n; i++){
cin >> p.at(i);
bm = max(bm,p.at(i));
}
int b = 0;
int cnt = 0;
int ans = 0;
while(b <= bm){
for(int i=0; i<n; i++){
if(p.at(i) >= b){
cnt++;
}
}
if(cnt <= k){
ans = max(ans,cnt);
}
b++;
cnt = 0;
}
cout << ans << endl;
}