結果
| 問題 | 
                            No.1528 Not 1
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2021-06-04 21:32:04 | 
| 言語 | C++14  (gcc 13.3.0 + boost 1.87.0)  | 
                    
| 結果 | 
                             
                                AC
                                 
                             
                            
                         | 
                    
| 実行時間 | 12 ms / 2,000 ms | 
| コード長 | 635 bytes | 
| コンパイル時間 | 1,982 ms | 
| コンパイル使用メモリ | 168,132 KB | 
| 実行使用メモリ | 6,824 KB | 
| 最終ジャッジ日時 | 2024-11-19 12:42:52 | 
| 合計ジャッジ時間 | 3,519 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge3 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 1 | 
| other | AC * 19 | 
ソースコード
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;
typedef long long ll;
int main() {
    int N;
    cin >> N;
    if (N % 2) {
        if (N == 1) {
            cout << 1 << endl;
        } else if (N == 3 || N == 5) {
            cout << -1 << endl;
        } else {
            cout << "3 6 2 4";
            rep(i, N / 2 - 3) {
                cout << " " << i * 2 + 8;
            }
            cout << endl;
        }
    } else {
        rep(i, N / 2) {
            cout << i * 2 + 2;
            if (i == N / 2 - 1) cout << endl;
            else cout << " ";
        }
    }
}