結果
| 問題 | No.1373 Directed Operations |
| コンテスト | |
| ユーザー |
nephrologist
|
| 提出日時 | 2021-02-05 21:38:34 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 520 bytes |
| 記録 | |
| コンパイル時間 | 221 ms |
| コンパイル使用メモリ | 95,980 KB |
| 実行使用メモリ | 107,520 KB |
| 最終ジャッジ日時 | 2026-08-04 00:45:43 |
| 合計ジャッジ時間 | 4,834 ms |
|
ジャッジサーバーID (参考情報) |
judge2_1 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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