結果

問題 No.1380 Borderline
ユーザー Rayhan Ahmad
提出日時 2021-02-07 21:39:42
言語 C++17(clang)
(17.0.6 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 370 bytes
コンパイル時間 3,954 ms
コンパイル使用メモリ 164,556 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-07-05 17:08:31
合計ジャッジ時間 4,956 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 41
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n, k ;
    cin >> n >> k;
    vector<int>v(n);
    for(int i=0; i<n; i++)cin >> v[i];
    int ans = 0;
    for(int i=0; i<=500; i++)
    {
        int cnt = 0;
        for(int x : v)
        {
            if (x>=i) cnt++;
        }
        if(cnt<=k) ans = max(ans,cnt);
    }
    cout << ans << endl;
}
0