結果
| 問題 |
No.1373 Directed Operations
|
| コンテスト | |
| ユーザー |
pyonth
|
| 提出日時 | 2021-02-06 00:45:05 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,161 bytes |
| コンパイル時間 | 2,053 ms |
| コンパイル使用メモリ | 198,232 KB |
| 最終ジャッジ日時 | 2025-01-18 13:17:01 |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 WA * 1 |
| other | AC * 8 WA * 11 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
#define repl(i, l, r) for (ll i = (l); i < (r); i++)
#define rep(i, n) repl(i, 0, n)
#define CST(x) cout << fixed << setprecision(x)
using ll = long long;
constexpr ll MOD = 1000000007;
constexpr int inf = 1e9 + 10;
constexpr ll INF = (ll)4e18 + 10;
constexpr int dx[9] = {1, 0, -1, 0, 1, -1, -1, 1, 0};
constexpr int dy[9] = {0, 1, 0, -1, 1, 1, -1, -1, 0};
template <typename T>
inline bool chmax(T &a, T b) {
return ((a < b) ? (a = b, true) : (false));
}
template <typename T>
inline bool chmin(T &a, T b) {
return ((a > b) ? (a = b, true) : (false));
}
int main() {
cin.tie(0);
cout.tie(0);
ios::sync_with_stdio(false);
int n;
cin >> n;
pair<int, int> a[n - 1];
rep(i, n - 1) {
cin >> a[i].first;
a[i].second = i;
}
sort(a, a + n - 1, greater<pair<int, int>>());
vector<int> ans(n - 1);
rep(i, n - 1) {
if (i + a[i].first >= n) {
cout << "NO" << endl;
return 0;
}
ans[a[i].second] = i + 1;
}
rep(i, n - 1) cout << "YES" << endl;
rep(i, n - 1) cout << ans[i] << endl;
return 0;
}
pyonth