結果

問題 No.2324 Two Countries within UEC
ユーザー 👑 SPD_9X2SPD_9X2
提出日時 2023-05-28 15:02:39
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 291 bytes
コンパイル時間 329 ms
コンパイル使用メモリ 87,284 KB
実行使用メモリ 83,716 KB
最終ジャッジ日時 2023-08-27 11:16:25
合計ジャッジ時間 9,614 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 226 ms
83,064 KB
testcase_01 AC 246 ms
83,208 KB
testcase_02 AC 123 ms
78,348 KB
testcase_03 AC 204 ms
81,124 KB
testcase_04 AC 211 ms
81,952 KB
testcase_05 AC 129 ms
78,304 KB
testcase_06 AC 151 ms
80,276 KB
testcase_07 AC 127 ms
77,440 KB
testcase_08 AC 197 ms
81,020 KB
testcase_09 AC 201 ms
81,048 KB
testcase_10 AC 247 ms
83,140 KB
testcase_11 AC 234 ms
83,632 KB
testcase_12 AC 144 ms
79,392 KB
testcase_13 AC 146 ms
79,544 KB
testcase_14 AC 131 ms
78,456 KB
testcase_15 AC 125 ms
77,284 KB
testcase_16 AC 199 ms
81,648 KB
testcase_17 AC 166 ms
79,368 KB
testcase_18 AC 128 ms
78,256 KB
testcase_19 AC 242 ms
83,280 KB
testcase_20 AC 120 ms
77,364 KB
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 AC 247 ms
83,716 KB
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 AC 72 ms
71,372 KB
testcase_33 AC 71 ms
71,304 KB
testcase_34 AC 68 ms
71,540 KB
testcase_35 AC 70 ms
71,316 KB
testcase_36 AC 72 ms
71,276 KB
testcase_37 AC 71 ms
71,340 KB
testcase_38 AC 72 ms
71,356 KB
testcase_39 AC 71 ms
71,580 KB
testcase_40 AC 73 ms
71,096 KB
testcase_41 WA -
testcase_42 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

N,M,P,Q = map(int,input().split())

ANS = []

for lp in range(Q):

    x,f = map(int,input().split())

    y = f * pow(x,P-2,P) % P

    if y >= M:
        ANS.append(0)
    elif y == 0:
        ANS.append( (M-y) // P )
    else:
        ANS.append( (M-y) // P + 1 )

print (*ANS,sep="\n")
0