結果

問題 No.1373 Directed Operations
ユーザー publfl
提出日時 2021-02-05 21:30:05
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 301 bytes
コンパイル時間 373 ms
コンパイル使用メモリ 44,632 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-07-02 11:41:59
合計ジャッジ時間 3,642 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1 WA * 1
other AC * 5 WA * 14
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>
#include <algorithm>

int x[100010];
int main()
{
	int a;
	scanf("%d",&a);
	for(int i=1;i<a;i++) scanf("%d",&x[i]);
	std::sort(x+1,x+a);
	for(int i=1;i<a;i++)
	{
		if(x[i]>i)
		{
			printf("NO");
			return 0;
		}
	}
	printf("YES\n");
	for(int i=1;i<a;i++) printf("%d\n",i+1-x[i]);
}
0