結果

問題 No.1373 Directed Operations
ユーザー NatsubiSogan
提出日時 2021-02-05 21:53:51
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 434 bytes
コンパイル時間 278 ms
コンパイル使用メモリ 82,192 KB
実行使用メモリ 91,412 KB
最終ジャッジ日時 2024-07-02 12:25:13
合計ジャッジ時間 4,020 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other TLE * 1 -- * 18
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
a = list(map(int, input().split()))
v = [0] * n
v[0] = 1
ans = []
for i in range(n - 1):
    for j in range(n):
        if v[j]:
            try:
                if v[a[i] + j]:
                    continue
                else:
                    v[a[i] + j] = 1
                    ans.append(j + 1)
                    break
            except:
                exit(print("NO"))
print("YES")
print(*ans, sep="\n")
0