結果
問題 | No.1380 Borderline |
ユーザー |
👑 ![]() |
提出日時 | 2021-02-07 22:41:01 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 3 ms / 2,000 ms |
コード長 | 328 bytes |
コンパイル時間 | 2,032 ms |
コンパイル使用メモリ | 193,600 KB |
最終ジャッジ日時 | 2025-01-18 15:06:10 |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 41 |
ソースコード
#include <bits/stdc++.h> using namespace std; using LL=long long; using ULL=unsigned long long; #define rep(i,n) for(int i=0; i<(n); i++) int N,K; int A[172]; int main(){ cin>>N>>K; rep(i,N) cin>>A[i]; sort(A,A+N,greater<int>()); int p=K; if(K!=N) while(p!=0?A[p]==A[p-1]:false) p--; cout<<p<<endl; return 0; }