結果
| 問題 | No.1528 Not 1 |
| コンテスト | |
| ユーザー |
bal4u
|
| 提出日時 | 2021-06-05 14:32:04 |
| 言語 | C (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 5 ms / 2,000 ms |
| コード長 | 800 bytes |
| コンパイル時間 | 314 ms |
| コンパイル使用メモリ | 29,952 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-11-21 12:14:08 |
| 合計ジャッジ時間 | 1,818 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 19 |
ソースコード
// yuki 1528 Not 1
// 2021.6.5 bal4u
#include <stdio.h>
int getchar_unlocked(void);
int putchar_unlocked(int c);
#define gc() getchar_unlocked()
#define pc(c) putchar_unlocked(c)
int in() { // 非負整数の入力
int n = 0; int c = gc();
do n = 10 * n + (c & 0xf); while ((c = gc()) >= '0');
return n;
}
void out(int n) { // 非負整数の表示(出力)
int i; char b[30];
if (!n) pc('0');
else {
i = 0; while (n) b[i++] = n % 10 + '0', n /= 10;
while (i--) pc(b[i]);
}
}
int main()
{
int N, i;
N = in();
if (N == 3 || N == 5) puts("-1");
else if (N == 1) puts("1");
else if ((N & 1) == 0) {
out(N);
while (N > 2) pc(' '), N -= 2, out(N);
pc('\n');
} else {
--N;
while (N > 1) {
if (N != 6) out(N), pc(' ');
N -= 2;
}
puts("6 3");
}
return 0;
}
bal4u