結果
| 問題 |
No.1528 Not 1
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-06-04 20:06:38 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 13 ms / 2,000 ms |
| コード長 | 422 bytes |
| コンパイル時間 | 615 ms |
| コンパイル使用メモリ | 70,152 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-11-19 08:00:12 |
| 合計ジャッジ時間 | 2,210 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 19 |
コンパイルメッセージ
main.cpp:5:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
5 | main()
| ^~~~
ソースコード
#include<iostream>
#include<vector>
using namespace std;
int N;
main()
{
cin>>N;
vector<int>ans((N+1)/2);
if(N%2==0)
{
for(int i=0;i<ans.size();i++)ans[i]=i*2+2;
}
else if(N>6)
{
ans[0]=3;
ans[1]=6;
ans[2]=2;
ans[3]=4;
for(int i=4;i<ans.size();i++)ans[i]=i*2;
}
else if(N==1)ans[0]=1;
else
{
cout<<-1<<endl;
return 0;
}
for(int i=0;i<ans.size();i++)cout<<ans[i]<<(i+1==ans.size()?"\n":" ");
}