結果
問題 |
No.1373 Directed Operations
|
ユーザー |
![]() |
提出日時 | 2021-02-05 21:55:52 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 423 bytes |
コンパイル時間 | 1,008 ms |
コンパイル使用メモリ | 78,216 KB |
最終ジャッジ日時 | 2025-01-18 12:18:26 |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 2 |
other | WA * 19 |
ソースコード
#include <algorithm> #include <vector> #include <iostream> using namespace std; int main() { int n; cin >> n; int a[n-1]; for (int i = 0; i < n-1; i++) cin >> a[i]; sort(a, a+n-1); vector<int> ans; for (int i = 0; i < n-1; i++) { if (i + 2 - a[i] <= 0) { cout << "No\n"; return 0; } else ans.push_back(i + 2 - a[i]); } cout << "Yes\n"; for (int x : ans) cout << x << endl; }