結果
| 問題 |
No.2324 Two Countries within UEC
|
| コンテスト | |
| ユーザー |
koncha
|
| 提出日時 | 2023-05-28 14:00:51 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 425 bytes |
| コンパイル時間 | 699 ms |
| コンパイル使用メモリ | 81,920 KB |
| 実行使用メモリ | 137,856 KB |
| 最終ジャッジ日時 | 2024-12-26 22:47:35 |
| 合計ジャッジ時間 | 100,147 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 8 WA * 2 TLE * 31 |
ソースコード
N, M, P, Q = map(int, input().split())
querys = [list(map(int, input().split())) for _ in range(Q)]
for x, f in querys:
count = 0
answer = M // P
tmp = M % P
now = x
while tmp >= count and f != 0:
if (f-now) % x == 0:
if ((f-now)//x + 1) + count <= tmp:
answer += 1
break
count += (P-now)//x + 1
now = (x - (P-now)%x) % x
print(answer)
koncha