結果

問題 No.1528 Not 1
ユーザー O2MTO2MT
提出日時 2021-06-04 22:06:33
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 113 ms / 2,000 ms
コード長 485 bytes
コンパイル時間 1,153 ms
コンパイル使用メモリ 87,104 KB
実行使用メモリ 87,036 KB
最終ジャッジ日時 2023-08-12 13:02:34
合計ジャッジ時間 4,582 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
71,112 KB
testcase_01 AC 105 ms
85,664 KB
testcase_02 AC 96 ms
78,424 KB
testcase_03 AC 98 ms
79,316 KB
testcase_04 AC 111 ms
85,260 KB
testcase_05 AC 94 ms
76,504 KB
testcase_06 AC 99 ms
81,960 KB
testcase_07 AC 108 ms
85,836 KB
testcase_08 AC 93 ms
79,744 KB
testcase_09 AC 89 ms
77,112 KB
testcase_10 AC 93 ms
79,652 KB
testcase_11 AC 73 ms
71,204 KB
testcase_12 AC 73 ms
71,328 KB
testcase_13 AC 73 ms
71,408 KB
testcase_14 AC 74 ms
71,628 KB
testcase_15 AC 74 ms
71,572 KB
testcase_16 AC 79 ms
71,632 KB
testcase_17 AC 80 ms
71,124 KB
testcase_18 AC 112 ms
87,036 KB
testcase_19 AC 113 ms
86,772 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from  math import ceil
N = int(input())
if N == 1:
  print(1)
  exit()
M = ceil(N/2)
evenList = []
num = -1
flg = True
for i in range(2,N+1,2):
  if i%3 == 0:
    if flg:
      num = i
      flg = False
  else:
    evenList.append(i)
ansList = evenList
la = len(ansList)
if num != -1:
  ansList.append(num)
  la += 1
  for i in range(3,N+1,3):
    if la == M:
      break
    if i == num:
      continue
    la += 1
    ansList.append(i)
if la == M:
  print(*ansList)
else:
  print(-1)
0