結果

問題 No.1373 Directed Operations
ユーザー NatsubiSoganNatsubiSogan
提出日時 2021-02-05 22:12:26
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 254 bytes
コンパイル時間 524 ms
コンパイル使用メモリ 10,744 KB
実行使用メモリ 23,724 KB
最終ジャッジ日時 2023-09-15 08:26:00
合計ジャッジ時間 5,336 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 18 ms
8,552 KB
testcase_01 AC 18 ms
8,600 KB
testcase_02 AC 119 ms
15,412 KB
testcase_03 AC 80 ms
13,036 KB
testcase_04 AC 48 ms
20,028 KB
testcase_05 AC 18 ms
8,408 KB
testcase_06 AC 148 ms
23,708 KB
testcase_07 AC 21 ms
8,864 KB
testcase_08 AC 32 ms
10,608 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 88 ms
18,840 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 64 ms
11,640 KB
testcase_19 WA -
testcase_20 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import defaultdict


n = int(input())
a = list(map(int, input().split()))
d = defaultdict(int)
ans = []
for i in a:
    if d[i] + i >= n:
        exit(print("NO"))
    ans.append(d[i] + 1)
    d[i] += 1
print("YES")
print(*ans, sep="\n")
0