結果

問題 No.2324 Two Countries within UEC
ユーザー dangodango
提出日時 2023-06-13 21:21:31
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 409 ms / 2,000 ms
コード長 207 bytes
コンパイル時間 800 ms
コンパイル使用メモリ 86,772 KB
実行使用メモリ 78,868 KB
最終ジャッジ日時 2023-09-09 06:26:48
合計ジャッジ時間 13,334 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 388 ms
78,592 KB
testcase_01 AC 409 ms
78,560 KB
testcase_02 AC 167 ms
78,520 KB
testcase_03 AC 328 ms
78,856 KB
testcase_04 AC 357 ms
78,536 KB
testcase_05 AC 174 ms
78,484 KB
testcase_06 AC 213 ms
78,596 KB
testcase_07 AC 158 ms
78,516 KB
testcase_08 AC 323 ms
78,460 KB
testcase_09 AC 334 ms
78,396 KB
testcase_10 AC 405 ms
78,548 KB
testcase_11 AC 398 ms
78,612 KB
testcase_12 AC 203 ms
78,480 KB
testcase_13 AC 205 ms
78,812 KB
testcase_14 AC 171 ms
78,472 KB
testcase_15 AC 160 ms
78,372 KB
testcase_16 AC 313 ms
78,808 KB
testcase_17 AC 247 ms
78,700 KB
testcase_18 AC 169 ms
78,412 KB
testcase_19 AC 404 ms
78,776 KB
testcase_20 AC 151 ms
78,432 KB
testcase_21 AC 301 ms
78,824 KB
testcase_22 AC 354 ms
78,784 KB
testcase_23 AC 188 ms
78,764 KB
testcase_24 AC 314 ms
78,684 KB
testcase_25 AC 400 ms
78,868 KB
testcase_26 AC 353 ms
78,520 KB
testcase_27 AC 398 ms
78,756 KB
testcase_28 AC 351 ms
78,724 KB
testcase_29 AC 349 ms
78,708 KB
testcase_30 AC 352 ms
78,688 KB
testcase_31 AC 74 ms
71,312 KB
testcase_32 AC 74 ms
71,212 KB
testcase_33 AC 74 ms
71,216 KB
testcase_34 AC 73 ms
71,404 KB
testcase_35 AC 75 ms
71,328 KB
testcase_36 AC 71 ms
71,508 KB
testcase_37 AC 74 ms
71,336 KB
testcase_38 AC 74 ms
71,532 KB
testcase_39 AC 74 ms
71,144 KB
testcase_40 AC 71 ms
71,320 KB
testcase_41 AC 73 ms
71,284 KB
testcase_42 AC 72 ms
71,168 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N, M, P, Q = map(int, input().split())
for i in range(Q):
	X, F = map(int, input().split())
	Y = pow(X, P - 2, P) * F % P
	if Y < 1: Y = P
	print([[(M - Y) // P + 1, 0][M < Y], [0, M][F % P < 1]][X % P < 1])
0