結果
| 問題 |
No.1170 Never Want to Walk
|
| コンテスト | |
| ユーザー |
nehan_der_thal
|
| 提出日時 | 2020-08-14 22:45:19 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 521 bytes |
| コンパイル時間 | 779 ms |
| コンパイル使用メモリ | 82,116 KB |
| 実行使用メモリ | 122,952 KB |
| 最終ジャッジ日時 | 2024-10-10 16:07:29 |
| 合計ジャッジ時間 | 5,568 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 5 WA * 32 |
ソースコード
N, A, B = map(int, input().split())
X = list(map(int, input().split()))
X.append(10**19)
d = [i for i in range(N)]
C = [1]*N
j=k=-1
cc = 1
for i in range(N):
jj = j
while X[j+1] < X[i]+A:
j+=1
ks = []
while X[k+1] <= X[i]+B:
k+=1
ks.append(k)
if j < k and d[j+1] != j+1:
d[i] = d[i-1]
C[d[i]] += 1
for kk in ks:
if j<kk:
d[kk] = d[i]
C[d[i]] += 1
# print(i, j, k)
#print(d)
#print(C)
for i in range(N):
print(C[d[i]])
nehan_der_thal