結果
問題 |
No.1373 Directed Operations
|
ユーザー |
|
提出日時 | 2021-02-05 21:53:22 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
TLE
|
実行時間 | - |
コード長 | 434 bytes |
コンパイル時間 | 281 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 17,692 KB |
最終ジャッジ日時 | 2024-07-02 12:24:35 |
合計ジャッジ時間 | 3,890 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | TLE * 1 -- * 18 |
ソースコード
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")