結果

問題 No.3267 PQ Straight
コンテスト
ユーザー Unbakedbread
提出日時 2025-12-29 23:41:44
言語 C++23
(gcc 15.2.0 + boost 1.89.0)
結果
AC  
実行時間 37 ms / 1,000 ms
コード長 394 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 2,750 ms
コンパイル使用メモリ 278,476 KB
実行使用メモリ 7,848 KB
最終ジャッジ日時 2025-12-29 23:41:54
合計ジャッジ時間 5,345 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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

int main(void) {
	int N;
	cin >> N;
	
	if(N % 2 == 0) {
		cout << "No\n";
		return 0;
	}
	
	vector<int> P(N), Q(N);
	P[0] = 1, Q[0] = (1 + N) / 2;
	for(int i = 1; i < N; ++i) P[i] = Q[i - 1] + 1, Q[i] = P[i - 1];
	
	cout << "Yes\n";
	for(auto x : P) cout << x << " ";
	cout << "\n";
	for(auto x : Q) cout << x << " ";
	cout << "\n";
	
	return 0;
}
0