結果

問題 No.1528 Not 1
ユーザー srjywrdnprkt
提出日時 2023-06-13 21:41:09
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 41 ms / 2,000 ms
コード長 643 bytes
コンパイル時間 1,209 ms
コンパイル使用メモリ 104,400 KB
最終ジャッジ日時 2025-02-14 02:26:22
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 19
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <cmath>
#include <map>
#include <set>
#include <iomanip>
#include <queue>
#include <algorithm>
#include <numeric>
#include <deque>
#include <complex>
#include <cassert>

using namespace std;
using ll = long long;

int main(){

    int N;
    cin >> N;
    if (N == 1) cout << 1 << endl;
    else if (N % 2 == 0){
        for (int i=2; i<=N; i+=2) cout << i << " ";
        cout << endl;
    }
    else if (N >= 7){
        cout << 2 << " " << 4 << " ";
        for (int i=8; i<=N; i+=2) cout << i << " ";
        cout << 6 << " " << 3 << endl;
    }
    else cout << -1 << endl;

    return 0;
}
0