結果
問題 |
No.1380 Borderline
|
ユーザー |
![]() |
提出日時 | 2024-10-23 00:19:41 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 6 ms / 2,000 ms |
コード長 | 605 bytes |
コンパイル時間 | 3,438 ms |
コンパイル使用メモリ | 250,472 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-10-23 00:19:46 |
合計ジャッジ時間 | 5,216 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 41 |
ソースコード
#include <bits/stdc++.h> using namespace std; #ifdef LOCAL #include "settings/debug.cpp" #else #define Debug(...) void(0) #endif #define rep(i, n) for (int i = 0; i < (n); ++i) using ll = long long; using ull = unsigned long long; int main() { int n, k; cin >> n >> k; vector<int> p(n); rep(i, n) cin >> p[i]; sort(p.begin(), p.end()); int ok = 1e9, ng = -1; while (ok - ng > 1) { int mid = (ok + ng) / 2; int ac = p.end() - lower_bound(p.begin(), p.end(), mid); (ac > k ? ng : ok) = mid; } cout << (p.end() - lower_bound(p.begin(), p.end(), ok)) << endl; return 0; }