結果

問題 No.2324 Two Countries within UEC
ユーザー NP
提出日時 2023-05-28 14:00:42
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 208 bytes
コンパイル時間 448 ms
コンパイル使用メモリ 82,432 KB
実行使用メモリ 1,682,048 KB
最終ジャッジ日時 2024-12-26 22:42:58
合計ジャッジ時間 35,018 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 8 WA * 7 RE * 15 TLE * 5 MLE * 6
権限があれば一括ダウンロードができます

ソースコード

diff #

N, M, P, Q = map(int, input().split())

counts = [0] * P
for y in range(1, M + 1):
    counts[y % P] += 1

for _ in range(Q):
    x, f = map(int, input().split())
    print(counts[(f * pow(x, P - 2, P)) % P])
0