結果

問題 No.1528 Not 1
ユーザー V_Melville
提出日時 2021-06-25 15:42:38
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 12 ms / 2,000 ms
コード長 348 bytes
コンパイル時間 2,031 ms
コンパイル使用メモリ 191,092 KB
最終ジャッジ日時 2025-01-22 11:49:11
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 19
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

using std::cin;
using std::cout;

int main() {
	int n;
	cin >> n;
	
	if (n % 2 == 0) {
		for (int i = 2; i <= n; i += 2)
		    cout << i << " ";
		return 0;
	}
	
	if (n == 1) puts("1");
	else if (n <= 5) puts("-1");
	else {
		cout << "3 6 2 4 ";
		for (int i = 8; i <= n; i += 2) 
		    cout << i << " ";
	}
	
	return 0;
}
0