結果
| 問題 | No.3795 Circular railway |
| ユーザー |
👑 |
| 提出日時 | 2026-11-13 22:36:40 |
| 言語 | PyPy3 (8.0.1 + ACL) |
| 結果 |
RE
不安定
|
| 実行時間 | - |
| コード長 | 231 bytes |
| 記録 | |
| コンパイル時間 | 83 ms |
| コンパイル使用メモリ | 64,156 KB |
| 実行使用メモリ | 63,644 KB |
| 最終ジャッジ日時 | 2026-11-13 22:36:50 |
| 合計ジャッジ時間 | 8,510 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | RE * 3 |
| other | AC * 10 WA * 5 RE * 18 |
ソースコード
N, Q, S, T, C = [int(s) for s in input().split()]
S -= 1
T -= 1
def dist(s, t):
return (t - s) % N
for _ in range(N):
U, V = [int(s) - 1 for s in input().split()]
print(min(dist(U, V), dist(U, S) + C + dist(T, V)))