結果
| 問題 | 
                            No.1528 Not 1
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2021-06-04 20:05:46 | 
| 言語 | C++17  (gcc 13.3.0 + boost 1.87.0)  | 
                    
| 結果 | 
                             
                                AC
                                 
                             
                            
                         | 
                    
| 実行時間 | 11 ms / 2,000 ms | 
| コード長 | 511 bytes | 
| コンパイル時間 | 644 ms | 
| コンパイル使用メモリ | 66,220 KB | 
| 最終ジャッジ日時 | 2025-01-21 21:31:11 | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge3 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 1 | 
| other | AC * 19 | 
ソースコード
#include <iostream>
using namespace std;
void solve() {
    int n;
    cin >> n;
    if (n == 1) {
        cout << "1\n";
    } else if (n % 2 == 0) {
        for (int i = 2; i <= n; i += 2) cout << i << " ";
        cout << "\n";
    } else if (n > 6) {
        cout << "3 6 2 4 ";
        for (int i = 8; i <= n; i += 2) cout << i << " ";
        cout << "\n";
    } else {
        cout << "-1\n";
    }
}
int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    solve();
    return 0;
}