結果
| 問題 | No.1950 片道きゃっちぼーる |
| コンテスト | |
| ユーザー |
pitP
|
| 提出日時 | 2022-05-20 23:26:14 |
| 言語 | PyPy3 (8.0.0 + ACL) |
| 結果 |
WA
不安定
|
| 実行時間 | - |
| コード長 | 402 bytes |
| 記録 | |
| コンパイル時間 | 230 ms |
| コンパイル使用メモリ | 96,076 KB |
| 実行使用メモリ | 200,372 KB |
| 最終ジャッジ日時 | 2026-08-31 17:41:10 |
| 合計ジャッジ時間 | 11,699 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_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])
ans = [0] * n
hq.sort()
for j in range(n):
dist,i = hq[j]
ans[i] = max(a[i] , d[x[i] + a[i]] + a[i] , d[x[i] - a[i]] - a[i])
d[x[i]] = ans[i]
print(*ans,sep="\n")
pitP