結果

問題 No.1528 Not 1
ユーザー ethan_hethan_h
提出日時 2021-06-05 03:41:50
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
OLE  
実行時間 -
コード長 452 bytes
コンパイル時間 1,588 ms
コンパイル使用メモリ 165,632 KB
実行使用メモリ 13,760 KB
最終ジャッジ日時 2024-04-30 21:19:49
合計ジャッジ時間 5,763 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
13,760 KB
testcase_01 OLE -
testcase_02 -- -
testcase_03 -- -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_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