結果

問題 No.2324 Two Countries within UEC
ユーザー NP
提出日時 2023-05-28 14:26:30
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 250 bytes
コンパイル時間 573 ms
コンパイル使用メモリ 81,872 KB
実行使用メモリ 1,689,312 KB
最終ジャッジ日時 2024-12-27 01:14:48
合計ジャッジ時間 41,839 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 10 RE * 13 TLE * 4 MLE * 14
権限があれば一括ダウンロードができます

ソースコード

diff #

N, M, P, Q = map(int, input().split())
ymodP = [y % P for y in range(1, M+1)]

for _ in range(Q):
    xi, fi = map(int, input().split())
    count = 0
    for ymodp in ymodP:
        if (xi * ymodp) % P == fi:
            count += 1
    print(count)
0