結果

問題 No.2324 Two Countries within UEC
ユーザー lloyzlloyz
提出日時 2023-06-03 01:33:35
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 269 bytes
コンパイル時間 1,462 ms
コンパイル使用メモリ 86,800 KB
実行使用メモリ 78,896 KB
最終ジャッジ日時 2023-08-28 07:20:34
合計ジャッジ時間 14,498 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 368 ms
78,668 KB
testcase_01 AC 395 ms
78,788 KB
testcase_02 AC 159 ms
78,220 KB
testcase_03 AC 322 ms
78,832 KB
testcase_04 AC 340 ms
78,680 KB
testcase_05 AC 163 ms
78,232 KB
testcase_06 AC 203 ms
78,552 KB
testcase_07 AC 154 ms
78,060 KB
testcase_08 AC 310 ms
78,772 KB
testcase_09 AC 318 ms
78,704 KB
testcase_10 AC 392 ms
78,700 KB
testcase_11 AC 380 ms
78,668 KB
testcase_12 AC 197 ms
78,568 KB
testcase_13 AC 196 ms
78,664 KB
testcase_14 AC 159 ms
77,928 KB
testcase_15 AC 153 ms
78,276 KB
testcase_16 AC 303 ms
78,696 KB
testcase_17 AC 236 ms
78,896 KB
testcase_18 AC 161 ms
78,092 KB
testcase_19 AC 389 ms
78,820 KB
testcase_20 AC 145 ms
78,252 KB
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 AC 391 ms
78,800 KB
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 AC 68 ms
71,172 KB
testcase_32 AC 69 ms
71,140 KB
testcase_33 AC 70 ms
71,176 KB
testcase_34 AC 69 ms
71,300 KB
testcase_35 AC 70 ms
71,504 KB
testcase_36 AC 70 ms
71,176 KB
testcase_37 AC 70 ms
71,364 KB
testcase_38 AC 68 ms
71,300 KB
testcase_39 AC 69 ms
71,188 KB
testcase_40 AC 69 ms
71,104 KB
testcase_41 WA -
testcase_42 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

n, m, p, q = map(int, input().split())
c, r = divmod(m, p)
for _ in range(q):
    x, f = map(int, input().split())
    y = f * pow(x, p - 2, p) % p
    if y <= r:
        ans = c + 1
    else:
        ans = c
    if y == 0:
        ans = max(ans - 1, 0)
    print(ans)
0