結果
| 問題 | No.1950 片道きゃっちぼーる |
| コンテスト | |
| ユーザー |
pitP
|
| 提出日時 | 2022-05-21 13:42:57 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 456 bytes |
| 記録 | |
| コンパイル時間 | 257 ms |
| コンパイル使用メモリ | 84,748 KB |
| 実行使用メモリ | 209,244 KB |
| 最終ジャッジ日時 | 2026-04-08 22:42:18 |
| 合計ジャッジ時間 | 14,031 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 16 WA * 7 |
ソースコード
from collections import defaultdict
n = int(input())
x = list(map(int,input().split()))
a = list(map(int,input().split()))
d = defaultdict(int)
hq = []
for i in range(n):
d[x[i]] = a[i]
hq.append([-x[i]-a[i] , i])
hq.append([-x[i]+a[i] , i])
ans = [0] * n
hq.sort()
for j in range(2*n):
dist,i = hq[j]
ans[i] = max(a[i] , d[x[i] + a[i]] + a[i] , d[x[i] - a[i]] - a[i],ans[i])
d[x[i]] = max(d[x[i]],ans[i])
print(*ans,sep="\n")
pitP