結果

問題 No.2324 Two Countries within UEC
ユーザー googol_S0googol_S0
提出日時 2023-05-28 13:33:55
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 246 bytes
コンパイル時間 271 ms
コンパイル使用メモリ 87,164 KB
実行使用メモリ 79,060 KB
最終ジャッジ日時 2023-08-27 08:02:47
合計ジャッジ時間 14,977 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 386 ms
78,964 KB
testcase_01 AC 405 ms
78,964 KB
testcase_02 AC 163 ms
78,508 KB
testcase_03 AC 324 ms
78,768 KB
testcase_04 AC 346 ms
79,000 KB
testcase_05 AC 167 ms
78,484 KB
testcase_06 AC 210 ms
79,060 KB
testcase_07 AC 157 ms
78,500 KB
testcase_08 AC 325 ms
78,816 KB
testcase_09 AC 325 ms
78,820 KB
testcase_10 AC 402 ms
78,932 KB
testcase_11 AC 395 ms
78,916 KB
testcase_12 AC 197 ms
78,860 KB
testcase_13 AC 202 ms
79,000 KB
testcase_14 AC 165 ms
78,524 KB
testcase_15 AC 159 ms
78,468 KB
testcase_16 AC 307 ms
78,692 KB
testcase_17 AC 243 ms
78,992 KB
testcase_18 AC 167 ms
78,284 KB
testcase_19 AC 402 ms
79,008 KB
testcase_20 AC 150 ms
78,552 KB
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 AC 397 ms
78,940 KB
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 AC 74 ms
71,332 KB
testcase_32 AC 73 ms
71,432 KB
testcase_33 AC 74 ms
71,648 KB
testcase_34 AC 74 ms
71,316 KB
testcase_35 AC 73 ms
71,588 KB
testcase_36 AC 73 ms
71,380 KB
testcase_37 AC 75 ms
71,648 KB
testcase_38 AC 74 ms
71,260 KB
testcase_39 AC 75 ms
71,444 KB
testcase_40 AC 76 ms
71,516 KB
testcase_41 WA -
testcase_42 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

N,M,P,Q=map(int,input().split())
for i in range(Q):
    x,f=map(int,input().split())
    x%=P
    if f==0:
        if x==0:
            print(M)
        else:
            print(M//P)
    else:
        v=pow(x,P-2,P)*f%P
        print((M+P-v)//P)
0