結果
| 問題 | No.3197 Frequency Counter |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2025-06-27 11:44:36 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 198 ms / 2,000 ms |
| + 637µs | |
| コード長 | 549 bytes |
| 記録 | |
| コンパイル時間 | 241 ms |
| コンパイル使用メモリ | 95,724 KB |
| 実行使用メモリ | 153,416 KB |
| 最終ジャッジ日時 | 2026-07-13 02:38:33 |
| 合計ジャッジ時間 | 4,374 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 21 |
ソースコード
import sys
from collections import Counter
def solve():
# 高速な入力
input = sys.stdin.readline
N = int(input())
A = list(map(int, input().split()))
# Counterクラスで高速に頻度を数える
counts = Counter(A)
Q = int(input())
# 複数行の出力を高速化
output = []
for _ in range(Q):
x, k = map(int, input().split())
if counts[x] >= k:
output.append("Yes")
else:
output.append("No")
print("\n".join(output))
solve()