結果
| 問題 |
No.1528 Not 1
|
| コンテスト | |
| ユーザー |
tabae326
|
| 提出日時 | 2021-06-04 20:34:16 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 9 ms / 2,000 ms |
| コード長 | 812 bytes |
| コンパイル時間 | 1,824 ms |
| コンパイル使用メモリ | 193,788 KB |
| 最終ジャッジ日時 | 2025-01-21 22:12:35 |
|
ジャッジサーバーID (参考情報) |
judge5 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 19 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, srt, end) for (long long i = (srt); i < (long long)(end); i++)
void solve() {
ll n;
cin >> n;
if(n == 1) {
cout << 1 << endl;
} else if(n == 2) {
cout << 2 << endl;
} else if(n == 3) {
cout << -1 << endl;
} else if(n == 4) {
cout << 2 << " " << 4 << endl;
} else if(n == 5) {
cout << -1 << endl;
} else if(n % 2 == 0) {
for(ll i = 2; i <= n; i += 2) cout << i << (i == n ? "\n" : " ");
} else if(n % 2 == 1) {
cout << 3 << " " << 6 << " ";
for(ll i = 2; i <= n-1; i += 2) if(i != 6) cout << i << (i == n-1 ? "\n" : " ");
}
}
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
solve();
return 0;
}
tabae326