結果
問題 | No.1380 Borderline |
ユーザー | Mister |
提出日時 | 2021-02-07 20:36:22 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 453 bytes |
コンパイル時間 | 934 ms |
コンパイル使用メモリ | 80,308 KB |
最終ジャッジ日時 | 2025-01-18 13:54:03 |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 41 |
ソースコード
#line 1 "main.cpp" #include <iostream> #include <algorithm> #include <vector> using namespace std; void solve() { int n, k; cin >> n >> k; vector<int> xs(n); for (auto& x : xs) cin >> x; xs.push_back(-1); sort(xs.rbegin(), xs.rend()); int i = k - 1; while (i >= 0 && xs[i] == xs[k]) --i; cout << i + 1 << "\n"; } int main() { cin.tie(nullptr); ios::sync_with_stdio(false); solve(); return 0; }