結果

問題 No.1528 Not 1
ユーザー polyester
提出日時 2021-06-04 20:45:07
言語 C++17(clang)
(17.0.6 + boost 1.87.0)
結果
AC  
実行時間 12 ms / 2,000 ms
コード長 708 bytes
コンパイル時間 943 ms
コンパイル使用メモリ 140,268 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-11-19 10:11:15
合計ジャッジ時間 3,032 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 19
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <algorithm>
#include <cmath>
#include <cstdio>
#include <functional>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
using ll = long long;
int main() {
  int n;
  cin >> n;
  if(n == 1) {
    cout << 1 << endl;
  } else if(n % 2 == 1 && n <= 5) {
    cout << -1 << endl;
  } else if(n % 2 == 0) {
    for(int i = 0; i < n / 2; i++) {
      cout << (i + 1) * 2 << " ";
    }
    cout << endl;
  } else {
    for(int i = 0; i < n / 2; i++) {
      if((i + 1) * 2 == 6) {
        continue;
      }
      cout << (i + 1) * 2 << " ";
    }
    cout << 6 << " " << 3 << endl;
  }
  return 0;
}
0