結果
| 問題 |
No.1373 Directed Operations
|
| コンテスト | |
| ユーザー |
nephrologist
|
| 提出日時 | 2021-02-05 21:38:34 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 520 bytes |
| コンパイル時間 | 222 ms |
| コンパイル使用メモリ | 82,332 KB |
| 実行使用メモリ | 99,712 KB |
| 最終ジャッジ日時 | 2024-07-02 11:51:57 |
| 合計ジャッジ時間 | 4,908 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 15 WA * 4 |
ソースコード
import sys
input = sys.stdin.buffer.readline
n = int(input())
A = list(map(int, input().split()))
memo = [0] * (n + 1)
for a in A:
memo[a] += 1
capacity = 0
for i in range(n):
capacity += 1
capacity -= memo[-(i + 1)]
if capacity < 0:
print("NO")
exit()
used = [0] * (n + 1)
now = 2
ans = [-1] * (n - 1)
kouho = []
for (idx, a) in enumerate(A):
kouho.append((a, idx))
kouho.sort()
for a, idx in kouho:
ans[idx] = now - a
now += 1
print("YES")
for a in ans:
print(a)
nephrologist