結果

問題 No.1373 Directed Operations
ユーザー roarisroaris
提出日時 2021-02-13 01:02:01
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 175 ms / 2,000 ms
コード長 347 bytes
コンパイル時間 343 ms
コンパイル使用メモリ 86,872 KB
実行使用メモリ 117,204 KB
最終ジャッジ日時 2023-09-27 08:29:36
合計ジャッジ時間 5,350 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 81 ms
71,696 KB
testcase_01 AC 82 ms
71,816 KB
testcase_02 AC 147 ms
100,536 KB
testcase_03 AC 101 ms
90,088 KB
testcase_04 AC 105 ms
90,948 KB
testcase_05 AC 80 ms
71,964 KB
testcase_06 AC 174 ms
117,204 KB
testcase_07 AC 95 ms
78,096 KB
testcase_08 AC 104 ms
78,792 KB
testcase_09 AC 134 ms
106,672 KB
testcase_10 AC 116 ms
94,148 KB
testcase_11 AC 92 ms
79,844 KB
testcase_12 AC 110 ms
89,688 KB
testcase_13 AC 86 ms
77,032 KB
testcase_14 AC 168 ms
105,004 KB
testcase_15 AC 159 ms
100,412 KB
testcase_16 AC 175 ms
104,804 KB
testcase_17 AC 130 ms
95,212 KB
testcase_18 AC 118 ms
88,032 KB
testcase_19 AC 124 ms
86,844 KB
testcase_20 AC 146 ms
98,464 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline
from collections import *

N = int(input())
a = list(map(int, input().split()))
b = a[:]
b.sort()
ans = defaultdict(list)
now = 1

for bi in b:
    if now-bi>=0:
        ans[bi].append(now-bi)
        now += 1
    else:
        print('NO')
        exit()

print('YES')

for ai in a:
    print(ans[ai].pop()+1)
0