結果

問題 No.1528 Not 1
ユーザー wolgnikwolgnik
提出日時 2021-06-04 20:36:38
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 107 ms / 2,000 ms
コード長 330 bytes
コンパイル時間 595 ms
コンパイル使用メモリ 87,200 KB
実行使用メモリ 96,804 KB
最終ジャッジ日時 2023-08-12 09:48:52
合計ジャッジ時間 4,434 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
71,232 KB
testcase_01 AC 102 ms
94,220 KB
testcase_02 AC 88 ms
81,224 KB
testcase_03 AC 86 ms
82,480 KB
testcase_04 AC 101 ms
94,132 KB
testcase_05 AC 79 ms
77,348 KB
testcase_06 AC 95 ms
88,192 KB
testcase_07 AC 107 ms
94,828 KB
testcase_08 AC 89 ms
83,584 KB
testcase_09 AC 84 ms
79,140 KB
testcase_10 AC 89 ms
84,424 KB
testcase_11 AC 72 ms
71,300 KB
testcase_12 AC 71 ms
71,508 KB
testcase_13 AC 68 ms
71,176 KB
testcase_14 AC 70 ms
71,404 KB
testcase_15 AC 71 ms
71,576 KB
testcase_16 AC 70 ms
71,388 KB
testcase_17 AC 69 ms
71,316 KB
testcase_18 AC 106 ms
96,804 KB
testcase_19 AC 104 ms
96,612 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
from math import gcd
input = sys.stdin.readline
N = int(input())
if N == 1:
  print(1)
  exit(0)
if N == 2:
  print(1)
  exit(0)
res = [i * 2 for i in range(1, -(-N // 2))]
s = set(res)
for i in range(1, N + 1):
  if i in s: continue
  if gcd(i, res[-1]) > 1:
    res.append(i)
    print(*res)
    break
else: print(-1)
0