結果

問題 No.2324 Two Countries within UEC
ユーザー aaaaaaaaaa2230aaaaaaaaaa2230
提出日時 2023-05-28 14:32:20
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 407 ms / 2,000 ms
コード長 276 bytes
コンパイル時間 273 ms
コンパイル使用メモリ 87,300 KB
実行使用メモリ 78,848 KB
最終ジャッジ日時 2023-09-09 06:13:13
合計ジャッジ時間 12,704 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 387 ms
78,652 KB
testcase_01 AC 407 ms
78,424 KB
testcase_02 AC 167 ms
78,188 KB
testcase_03 AC 329 ms
78,848 KB
testcase_04 AC 357 ms
78,612 KB
testcase_05 AC 170 ms
78,452 KB
testcase_06 AC 214 ms
78,604 KB
testcase_07 AC 158 ms
78,084 KB
testcase_08 AC 326 ms
78,564 KB
testcase_09 AC 328 ms
78,728 KB
testcase_10 AC 402 ms
78,760 KB
testcase_11 AC 394 ms
78,628 KB
testcase_12 AC 202 ms
78,716 KB
testcase_13 AC 200 ms
78,688 KB
testcase_14 AC 163 ms
78,408 KB
testcase_15 AC 159 ms
78,152 KB
testcase_16 AC 311 ms
78,748 KB
testcase_17 AC 246 ms
78,760 KB
testcase_18 AC 167 ms
78,136 KB
testcase_19 AC 402 ms
78,696 KB
testcase_20 AC 151 ms
78,128 KB
testcase_21 AC 297 ms
78,460 KB
testcase_22 AC 347 ms
78,464 KB
testcase_23 AC 190 ms
78,660 KB
testcase_24 AC 322 ms
78,628 KB
testcase_25 AC 401 ms
78,752 KB
testcase_26 AC 359 ms
78,680 KB
testcase_27 AC 394 ms
78,608 KB
testcase_28 AC 349 ms
78,484 KB
testcase_29 AC 347 ms
78,472 KB
testcase_30 AC 341 ms
78,448 KB
testcase_31 AC 72 ms
71,184 KB
testcase_32 AC 70 ms
71,196 KB
testcase_33 AC 71 ms
71,356 KB
testcase_34 AC 71 ms
71,308 KB
testcase_35 AC 70 ms
71,068 KB
testcase_36 AC 72 ms
71,040 KB
testcase_37 AC 73 ms
71,104 KB
testcase_38 AC 71 ms
71,068 KB
testcase_39 AC 72 ms
71,336 KB
testcase_40 AC 72 ms
71,172 KB
testcase_41 AC 73 ms
71,248 KB
testcase_42 AC 72 ms
71,188 KB
権限があれば一括ダウンロードができます

ソースコード

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:
        if f == 0:
            ans = m
        else:
            ans = 0
    print(ans)
0