結果

問題 No.2324 Two Countries within UEC
ユーザー aaaaaaaaaa2230aaaaaaaaaa2230
提出日時 2023-05-28 14:29:31
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 230 bytes
コンパイル時間 1,114 ms
コンパイル使用メモリ 87,124 KB
実行使用メモリ 79,020 KB
最終ジャッジ日時 2023-08-27 09:58:08
合計ジャッジ時間 13,421 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 380 ms
78,808 KB
testcase_01 AC 401 ms
78,488 KB
testcase_02 AC 169 ms
78,408 KB
testcase_03 AC 326 ms
78,936 KB
testcase_04 AC 354 ms
78,672 KB
testcase_05 AC 172 ms
78,424 KB
testcase_06 AC 211 ms
78,772 KB
testcase_07 AC 158 ms
78,400 KB
testcase_08 AC 316 ms
78,580 KB
testcase_09 AC 326 ms
79,020 KB
testcase_10 AC 400 ms
78,780 KB
testcase_11 AC 387 ms
78,884 KB
testcase_12 AC 207 ms
79,020 KB
testcase_13 AC 205 ms
78,948 KB
testcase_14 AC 166 ms
78,200 KB
testcase_15 AC 164 ms
78,124 KB
testcase_16 AC 304 ms
78,728 KB
testcase_17 AC 247 ms
78,800 KB
testcase_18 AC 172 ms
78,436 KB
testcase_19 AC 400 ms
78,908 KB
testcase_20 AC 155 ms
78,440 KB
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 AC 393 ms
78,732 KB
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 AC 73 ms
71,428 KB
testcase_32 AC 72 ms
71,372 KB
testcase_33 AC 74 ms
71,516 KB
testcase_34 AC 74 ms
71,484 KB
testcase_35 AC 74 ms
71,192 KB
testcase_36 AC 73 ms
71,524 KB
testcase_37 AC 73 ms
71,520 KB
testcase_38 AC 73 ms
71,416 KB
testcase_39 AC 72 ms
71,312 KB
testcase_40 AC 72 ms
71,188 KB
testcase_41 WA -
testcase_42 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

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

    if x%p == 0 and f == 0:
        ans = m
    print(ans)
0