結果

問題 No.2324 Two Countries within UEC
ユーザー 👑 SPD_9X2SPD_9X2
提出日時 2023-05-28 15:03:39
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 290 bytes
コンパイル時間 1,414 ms
コンパイル使用メモリ 86,344 KB
実行使用メモリ 83,508 KB
最終ジャッジ日時 2023-08-27 11:18:01
合計ジャッジ時間 9,240 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 229 ms
83,000 KB
testcase_01 AC 244 ms
83,096 KB
testcase_02 AC 128 ms
78,036 KB
testcase_03 AC 205 ms
80,820 KB
testcase_04 AC 214 ms
81,228 KB
testcase_05 AC 126 ms
78,080 KB
testcase_06 AC 145 ms
79,744 KB
testcase_07 AC 119 ms
77,068 KB
testcase_08 AC 191 ms
80,768 KB
testcase_09 AC 194 ms
80,800 KB
testcase_10 AC 240 ms
82,880 KB
testcase_11 AC 228 ms
83,004 KB
testcase_12 AC 141 ms
78,968 KB
testcase_13 AC 142 ms
79,236 KB
testcase_14 AC 125 ms
78,072 KB
testcase_15 AC 121 ms
77,320 KB
testcase_16 AC 194 ms
81,688 KB
testcase_17 AC 162 ms
78,700 KB
testcase_18 AC 122 ms
77,928 KB
testcase_19 AC 239 ms
82,784 KB
testcase_20 AC 117 ms
77,264 KB
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 AC 237 ms
83,508 KB
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 AC 68 ms
71,316 KB
testcase_32 AC 68 ms
71,136 KB
testcase_33 AC 68 ms
71,308 KB
testcase_34 AC 67 ms
71,348 KB
testcase_35 AC 69 ms
71,344 KB
testcase_36 AC 68 ms
71,308 KB
testcase_37 AC 67 ms
71,164 KB
testcase_38 AC 71 ms
71,420 KB
testcase_39 AC 68 ms
71,444 KB
testcase_40 AC 67 ms
71,436 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