結果

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

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;

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

    }
    else{
        for(int i=2;i<=n;i+=2){
            cout<<i<<" ";
        }
    }

    return 0;
}
0