結果

問題 No.1528 Not 1
ユーザー sigmanisigmani
提出日時 2022-03-14 20:13:19
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 555 bytes
コンパイル時間 1,613 ms
コンパイル使用メモリ 167,076 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-21 07:12:11
合計ジャッジ時間 5,024 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 11 ms
4,348 KB
testcase_02 AC 5 ms
4,348 KB
testcase_03 AC 6 ms
4,348 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 8 ms
4,348 KB
testcase_07 AC 11 ms
4,348 KB
testcase_08 WA -
testcase_09 AC 4 ms
4,348 KB
testcase_10 AC 6 ms
4,348 KB
testcase_11 WA -
testcase_12 AC 2 ms
4,348 KB
testcase_13 AC 2 ms
4,348 KB
testcase_14 AC 2 ms
4,348 KB
testcase_15 AC 2 ms
4,348 KB
testcase_16 AC 2 ms
4,348 KB
testcase_17 AC 2 ms
4,348 KB
testcase_18 AC 12 ms
4,348 KB
testcase_19 WA -
権限があれば一括ダウンロードができます

ソースコード

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<<" ";
    }
    else {
        if(N==1)cout<<-1;
        if(N==3)cout<<-1;
        if(N==5)cout<<-1;
        if(N>=7){
            int A[202020];
            A[1]=2;
            A[2]=4;
            A[3]=6;
            A[4]=3;
            A[5]=15;
            A[6]=10;
            for(int i=7;i<=2000;i++)A[i]=A[i-1]+2;
            int U=(N+1)/2;
            for(int i=1;i<=U;i++)cout<<A[i]<<" ";
        }
    }
  
}
0