結果
| 問題 | No.2324 Two Countries within UEC |
| コンテスト | |
| ユーザー |
Schnee
|
| 提出日時 | 2023-05-28 15:35:03 |
| 言語 | Python3 (3.14.3 + numpy 2.4.4 + scipy 1.17.1) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 298 bytes |
| 記録 | |
| コンパイル時間 | 557 ms |
| コンパイル使用メモリ | 20,820 KB |
| 実行使用メモリ | 464,080 KB |
| 最終ジャッジ日時 | 2026-06-01 23:15:02 |
| 合計ジャッジ時間 | 7,943 ms |
|
ジャッジサーバーID (参考情報) |
judge2_1 / judge1_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | -- * 2 |
| other | TLE * 1 -- * 40 |
ソースコード
n, m, p, q = map(int, input().split())
inv = [0]*(n+1)
for i in range(1, n+1):
inv[i] = pow(i, p-2, p)
for _ in range(q):
x, f = map(int, input().split())
y_cand = f*inv[x]%p
if y_cand == 0:
y_cnt = m//p
else:
y_cnt = m//p + int(m%p >= y_cand)
print(y_cnt)
Schnee