結果
問題 |
No.3287 Golden Ring
|
ユーザー |
![]() |
提出日時 | 2025-10-03 23:29:20 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 1,047 bytes |
コンパイル時間 | 5,415 ms |
コンパイル使用メモリ | 334,880 KB |
実行使用メモリ | 7,716 KB |
最終ジャッジ日時 | 2025-10-03 23:30:03 |
合計ジャッジ時間 | 5,581 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 14 |
ソースコード
#include <iostream> #include <vector> #include <algorithm> #include <cmath> #include <bits/stdc++.h> #include <atcoder/all> using namespace std; using namespace atcoder; using ll = long long; using mint = modint998244353; using vi = vector<int>; using vvi = vector<vi>; using vvvi = vector<vvi>; using vll = vector<ll>; using vvll = vector<vll>; using vvvll = vector<vvll>; using vmi = vector<mint>; using vvmi = vector<vmi>; using vvvmi = vector<vvmi>; #define all(a) (a).begin(), (a).end() #define rep2(i, m, n) for (int i = (m); i < (n); ++i) #define rep(i, n) rep2(i, 0, n) #define drep2(i, m, n) for (int i = (m)-1; i >= (n); --i) #define drep(i, n) drep2(i, n, 0) int main(){ int n; cin >> n; if(n == 2){ cout << "No" << endl; return 0; } cout << "Yes" << endl; int w = n; while(w > 0){ cout << w << " "; w -= 2; } if(w == 0){ w = 1; }else{ w = 2; } while(w <= n){ cout << w << " "; w += 2; } cout << endl; return 0; }