結果
問題 | No.1380 Borderline |
ユーザー |
![]() |
提出日時 | 2021-02-05 22:10:23 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 460 bytes |
コンパイル時間 | 1,542 ms |
コンパイル使用メモリ | 168,112 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-07-05 16:52:34 |
合計ジャッジ時間 | 2,945 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 41 |
ソースコード
#include <bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; #define fi first #define se second #define pb push_back int main(){ int n,k; cin>>n>>k; int p[n]; for(int i=0;i<n;i++){ cin>>p[i]; } int ans=0; for(int border=0;border<500;border++){ int x=0; for(int i=0;i<n;i++){ if(p[i]>=border){ x++; } } if(x<=k){ ans=max(ans,x); } } cout<<ans<<endl; }