結果

問題 No.1170 Never Want to Walk
ユーザー nehan_der_thal
提出日時 2020-08-14 22:34:22
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 505 bytes
コンパイル時間 154 ms
コンパイル使用メモリ 82,224 KB
実行使用メモリ 122,808 KB
最終ジャッジ日時 2024-10-10 15:55:46
合計ジャッジ時間 4,853 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 5 WA * 32
権限があれば一括ダウンロードができます

ソースコード

diff #

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=0
cc = 1
for i in range(N):
    while X[j+1] < X[i]+A:
        j+=1
    ks = []
    f = (k <= j)
    while X[k+1] <= X[i]+B:
        k+=1
        ks.append(k)
    if not f:
        d[i] = d[i-1]
        C[d[i]] += 1
    for k in ks:
        if j<k:
            d[k] = d[i]
            C[d[i]] += 1
#    print(i, j, k)
#print(d)
#print(C)
for i in range(N):
    print(C[d[i]])
0