結果

問題 No.2324 Two Countries within UEC
ユーザー nautnaut
提出日時 2023-09-30 13:37:28
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 332 bytes
コンパイル時間 175 ms
コンパイル使用メモリ 10,740 KB
実行使用メモリ 28,172 KB
最終ジャッジ日時 2023-09-30 13:37:46
合計ジャッジ時間 17,492 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 647 ms
27,372 KB
testcase_01 AC 725 ms
28,112 KB
testcase_02 AC 131 ms
12,100 KB
testcase_03 AC 497 ms
23,288 KB
testcase_04 AC 581 ms
25,428 KB
testcase_05 AC 142 ms
12,220 KB
testcase_06 AC 238 ms
15,240 KB
testcase_07 AC 116 ms
11,404 KB
testcase_08 AC 507 ms
23,452 KB
testcase_09 AC 497 ms
23,728 KB
testcase_10 AC 726 ms
28,132 KB
testcase_11 AC 655 ms
28,172 KB
testcase_12 AC 209 ms
14,344 KB
testcase_13 AC 212 ms
14,444 KB
testcase_14 AC 133 ms
12,044 KB
testcase_15 AC 115 ms
11,524 KB
testcase_16 AC 465 ms
21,704 KB
testcase_17 AC 332 ms
16,696 KB
testcase_18 AC 134 ms
12,240 KB
testcase_19 AC 689 ms
28,160 KB
testcase_20 AC 97 ms
10,840 KB
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 AC 674 ms
28,116 KB
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 AC 15 ms
7,912 KB
testcase_32 AC 15 ms
7,832 KB
testcase_33 AC 15 ms
7,820 KB
testcase_34 AC 14 ms
7,960 KB
testcase_35 AC 15 ms
7,912 KB
testcase_36 AC 15 ms
7,852 KB
testcase_37 AC 15 ms
7,972 KB
testcase_38 AC 15 ms
7,812 KB
testcase_39 AC 15 ms
7,932 KB
testcase_40 AC 15 ms
7,792 KB
testcase_41 WA -
testcase_42 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

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

    XF = [list(map(int, input().split())) for _ in range(Q)]

    for i in range(Q):
        x, f = XF[i]

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

        if y_0 == 0:
            print((M - y_0) // P)
        else:
            print((M - y_0) // P + 1)
    return 0


main()
0