結果
問題 |
No.3287 Golden Ring
|
ユーザー |
![]() |
提出日時 | 2025-10-04 20:31:03 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 411 bytes |
コンパイル時間 | 1,335 ms |
コンパイル使用メモリ | 166,448 KB |
実行使用メモリ | 7,716 KB |
最終ジャッジ日時 | 2025-10-04 20:31:06 |
合計ジャッジ時間 | 2,637 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 14 |
ソースコード
#include <bits/stdc++.h> using namespace std; #define rep(i, a, b) for (int i = a; i < b; i++) using ll = long long; int main() { int n; cin >> n; if(n == 2) { cout << "No" << endl; return 0; } deque<int> q; int j = 0; for(int i = n - 1; i >= 0; i--) { if(j % 2) q.push_front(i + 1); else q.push_back(i + 1); j++; } cout << "Yes" << endl; for(auto x : q) cout << x << " "; cout << endl; }