結果
問題 | No.1380 Borderline |
ユーザー |
![]() |
提出日時 | 2024-11-04 11:53:30 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 34 ms / 2,000 ms |
コード長 | 613 bytes |
コンパイル時間 | 4,183 ms |
コンパイル使用メモリ | 249,788 KB |
最終ジャッジ日時 | 2025-02-25 02:12:29 |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 41 |
ソースコード
#include <bits/stdc++.h>#include<atcoder/all>using namespace atcoder;using namespace std;using ll=long long;using ld=long double;ll mod=998244353;ll inf=1000000000000000000;int main(){ll n,k;cin >> n >> k;vector<ll>p(n);for (ll i = 0; i < n; i++){cin >> p[i];}ll ans=0;for (ll i = 0; i < n; i++){ll now=0;for (ll j = 0; j < n; j++){if (p[j]>=p[i]){now++;}}if (now<=k){ans=max(ans,now);}}cout << ans << endl;}