結果
問題 |
No.1380 Borderline
|
ユーザー |
![]() |
提出日時 | 2021-02-07 20:32:35 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 362 bytes |
コンパイル時間 | 1,688 ms |
コンパイル使用メモリ | 171,716 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-07-04 13:36:55 |
合計ジャッジ時間 | 2,910 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 37 WA * 4 |
ソースコード
#include <bits/stdc++.h> using namespace std; int main(){ int N, K; cin >> N >> K; vector<int> p(N); for (int i = 0; i < N; i++){ cin >> p[i]; } sort(p.begin(), p.end(), greater<int>()); if (p[K - 1] == p[0]){ cout << 0 << endl; } else { int ans = K; while (p[ans - 1] == p[ans]){ ans--; } cout << ans << endl; } }