結果
問題 |
No.3267 PQ Straight
|
ユーザー |
![]() |
提出日時 | 2025-09-12 23:36:47 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 39 ms / 1,000 ms |
コード長 | 1,564 bytes |
コンパイル時間 | 2,149 ms |
コンパイル使用メモリ | 198,520 KB |
実行使用メモリ | 7,716 KB |
最終ジャッジ日時 | 2025-09-12 23:45:28 |
合計ジャッジ時間 | 4,353 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge10 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 22 |
ソースコード
#include <bits/stdc++.h> using namespace std; //#include <atcoder/all> //using namespace atcoder; using ll = long long; using pp = pair<int,int>; #define rep(i, n) for (i = 0; (i) < (n); ++(i)) #define reps(i, a, n) for (i = (a); (i) < (n); ++(i)) #define rrep(i, n) for (i = (n-1); (i) >= (0); --(i)) #define all(a) (a).begin(), (a).end() #define oor(a,b,h,w) (a<0||a>=h||b<0||b>=w)//out of range #define fi first #define se second #define mkpr(a,b) make_pair(a,b) #define mktpl(a,b,c) make_tuple(a,b,c) #define fixp(a) fixed<<setprecision(a) //小数点以下指定 vector<int> dx={1,0,-1,0};//{1,1,0,-1,-1,-1,0,1}; vector<int> dy={0,-1,0,1};//{0,-1,-1,-1,0,1,1,1}; //ll keta_calc(ll x){ll ans=0;while(x){x/=10;ans++;}return ans;} //ll powll(ll x,ll y){ll ans=1;while(y){ans*=x;y--;}return ans;} //alias g++='g++ -std=c++17' #define chmin(a,b) a=min(a,(b)) #define chmax(a,b) a=max(a,(b)) int main(){ int i=0,j=0; int n,m,k; cin >> n ; if(n%2==0){ cout << "No" << endl; return 0; } vector<int> a(n,0); rep(i,n){ if(i<n/2+1){ a[i] = i*2+1; }else{ a[i] = (i-n/2)*2; } } cout << "Yes" << endl; rep(i,n){ cout << a[i] << " "; }cout << endl; rep(i,n){ cout << ( (n+1)/2 +i+1 ) - a[i] << " "; }cout << endl; //sort(aitem.begin(),aitem.end(), //[](const vector<int> &alpha,const vector<int> &beta){return alpha[1] < beta[1];}); //if(flag==0)printf("Yes\n"); //else printf("No\n"); return 0; }