結果
問題 |
No.1373 Directed Operations
|
ユーザー |
|
提出日時 | 2021-02-05 23:39:48 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 623 bytes |
コンパイル時間 | 2,414 ms |
コンパイル使用メモリ | 196,556 KB |
最終ジャッジ日時 | 2025-01-18 13:13:01 |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 12 WA * 7 |
ソースコード
/** * author: shu8Cream * created: 05.02.2021 22:21:24 **/ #include <bits/stdc++.h> using namespace std; #define rep(i,n) for (int i=0; i<(n); i++) #define all(x) (x).begin(), (x).end() using ll = long long; using P = pair<int,int>; using vi = vector<int>; using vvi = vector<vi>; int main() { cin.tie(nullptr); ios::sync_with_stdio(false); int n; cin >> n; vi a(n-1); rep(i,n-1) cin >> a[i]; sort(all(a)); rep(i,n-1){ if(a[i]>(i+1)){ cout << "NO" << endl; return 0; } } cout << "YES" << endl; rep(i,n-1) cout << (i+2)-a[i] << endl; }