結果
問題 |
No.3197 Frequency Counter
|
ユーザー |
![]() |
提出日時 | 2025-07-11 21:29:53 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 1,027 ms / 2,000 ms |
コード長 | 1,110 bytes |
コンパイル時間 | 1,064 ms |
コンパイル使用メモリ | 106,860 KB |
実行使用メモリ | 7,844 KB |
最終ジャッジ日時 | 2025-07-11 21:30:22 |
合計ジャッジ時間 | 10,967 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 21 |
ソースコード
#include <iostream> using std::cerr, std::cin, std::cout, std::endl, std::fixed, std::flush; #include <vector> using std::vector; #include <algorithm> using std::clamp, std::ranges::count, std::ranges::count_if, std::ranges::fill, std::ranges::find, std::ranges::find_if, std::ranges::is_permutation; using std::ranges::lower_bound, std::ranges::max, std::ranges::max_element, std::ranges::min, std::ranges::min_element, std::ranges::next_permutation; using std::ranges::prev_permutation, std::ranges::reverse, std::ranges::rotate, std::ranges::sort, std::ranges::unique, std::ranges::upper_bound; static_assert(sizeof(long) == 8); int main() { int N; cin >> N; vector<int> A(N); for (int i = 0; i < N; i++) { cin >> A[i]; } sort(A); int Q; cin >> Q; for (int i = 0; i < Q; i++) { int x, k; cin >> x >> k; cerr << upper_bound(A, x) - lower_bound(A, x) << '\n'; if (upper_bound(A, x) - lower_bound(A, x) >= k) cout << "Yes\n"; else cout << "No\n"; } return 0; } /* File : ~/kyopro/yukicoder/554/3197.cpp Date : 2025/07/11 Time : 21:27:05 */