結果
| 問題 | No.2324 Two Countries within UEC |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-04-14 08:53:55 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 258 bytes |
| 記録 | |
| コンパイル時間 | 167 ms |
| コンパイル使用メモリ | 85,120 KB |
| 実行使用メモリ | 81,536 KB |
| 最終ジャッジ日時 | 2026-04-14 08:54:05 |
| 合計ジャッジ時間 | 9,221 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 30 WA * 11 |
ソースコード
N,M,P,Q = map(int,input().split())
for _ in range(Q):
x,f = map(int,input().split())
y = (pow(x,P-2,P)*f)%P
if y>M:
print(0)
else:
ans = (M-y)//P+1
if y==0:
print(ans-1)
else:
print(ans)