結果

問題 No.3267 PQ Straight
ユーザー GOTKAKO
提出日時 2025-09-12 23:43:36
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 36 ms / 1,000 ms
コード長 545 bytes
コンパイル時間 2,051 ms
コンパイル使用メモリ 198,136 KB
実行使用メモリ 7,716 KB
最終ジャッジ日時 2025-09-12 23:46:53
合計ジャッジ時間 4,653 ms
ジャッジサーバーID
(参考情報)
judge4 / judge7
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);

    int N; cin >> N;
    if(N%2 == 0){cout << "No\n"; return 0;}
    int x = 1,y = 2;
    vector<int> P,Q;
    for(int i=1; i<=N; i+=2) P.push_back(i);
    for(int i=2; i<=N; i+=2) P.push_back(i);
    for(int i=(N+1)/2; i>=1; i--) Q.push_back(i);
    for(int i=N; i>(N+1)/2; i--) Q.push_back(i);
    cout << "Yes\n";
    for(auto &p : P) cout << p << " "; cout << endl;
    for(auto &q : Q) cout << q << " "; cout << endl;

}
0