結果
| 問題 |
No.3197 Frequency Counter
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2025-06-27 11:44:36 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 243 ms / 2,000 ms |
| コード長 | 549 bytes |
| コンパイル時間 | 380 ms |
| コンパイル使用メモリ | 82,280 KB |
| 実行使用メモリ | 134,904 KB |
| 最終ジャッジ日時 | 2025-07-10 14:46:44 |
| 合計ジャッジ時間 | 4,101 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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()