結果

問題 No.1528 Not 1
ユーザー _umbrella_kasa
提出日時 2021-06-04 20:16:33
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 13 ms / 2,000 ms
コード長 510 bytes
コンパイル時間 1,623 ms
コンパイル使用メモリ 167,064 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-11-19 08:23:32
合計ジャッジ時間 3,184 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 19
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
 
int main() {
    int N;
    cin >> N;
    if (N%2==0) {
        for (int i=1; i<=N/2; i++) {
            cout << 2*i << " ";
        }
        cout<<endl;
    }
    else if (N==1) {
        cout << 1 << endl;
    }
    else if (N==3 || N==5) {
        cout << -1 << endl;
    }
    else {
        cout << 3 << " " << 6 << " " << 2 << " " << 4 << " ";
        for (int i=4; i<(N+1)/2; i++) {
            cout << 2*i << " ";
        }
        cout << endl;
    }
}
0