結果

問題 No.2324 Two Countries within UEC
ユーザー とりゐとりゐ
提出日時 2023-05-28 13:38:04
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 208 bytes
コンパイル時間 248 ms
コンパイル使用メモリ 87,104 KB
実行使用メモリ 79,180 KB
最終ジャッジ日時 2023-08-27 08:10:40
合計ジャッジ時間 12,302 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 377 ms
78,588 KB
testcase_01 AC 394 ms
78,780 KB
testcase_02 AC 161 ms
78,368 KB
testcase_03 AC 317 ms
78,880 KB
testcase_04 AC 344 ms
78,736 KB
testcase_05 AC 163 ms
78,472 KB
testcase_06 AC 205 ms
78,736 KB
testcase_07 AC 155 ms
78,476 KB
testcase_08 AC 316 ms
78,488 KB
testcase_09 AC 318 ms
78,652 KB
testcase_10 AC 389 ms
78,560 KB
testcase_11 AC 380 ms
78,580 KB
testcase_12 AC 194 ms
78,792 KB
testcase_13 AC 194 ms
78,528 KB
testcase_14 AC 159 ms
78,352 KB
testcase_15 AC 151 ms
78,472 KB
testcase_16 AC 303 ms
78,876 KB
testcase_17 AC 235 ms
78,880 KB
testcase_18 AC 162 ms
78,184 KB
testcase_19 AC 388 ms
78,688 KB
testcase_20 AC 144 ms
78,492 KB
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 AC 390 ms
78,764 KB
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 AC 72 ms
71,520 KB
testcase_32 AC 69 ms
71,396 KB
testcase_33 AC 72 ms
71,620 KB
testcase_34 AC 69 ms
71,144 KB
testcase_35 AC 70 ms
71,616 KB
testcase_36 AC 71 ms
71,572 KB
testcase_37 AC 71 ms
71,620 KB
testcase_38 AC 71 ms
71,432 KB
testcase_39 AC 71 ms
71,452 KB
testcase_40 AC 73 ms
71,292 KB
testcase_41 WA -
testcase_42 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

n,m,p,q=map(int,input().split())
for _ in range(q):
  x,f=map(int,input().split())
  if f==0:
    if x%p==0:
      print(m)
    else:
      print(m//p)
  else:
    inv=f*pow(x,p-2,p)%p
    print((m-inv+p)//p)
0