結果

問題 No.1528 Not 1
ユーザー O2MT
提出日時 2021-06-04 21:46:58
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 747 bytes
コンパイル時間 733 ms
コンパイル使用メモリ 82,272 KB
実行使用メモリ 86,528 KB
最終ジャッジ日時 2024-11-19 13:40:43
合計ジャッジ時間 3,190 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 18 WA * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

from  math import ceil
N = int(input())
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
  five = -1
  flg = True
  for i in range(3,N+1,3):
    if la == M:
      break
    if i == num:
      continue
    if i%5 == 0:
      if flg:
        five = i
        flg = False
    else:
      la += 1
      ansList.append(i)
  if five != -1 and la < M:
    ansList.append(num)
    la += 1
    for i in range(5,N+1,5):
      if la == M:
        break
      if i == num:
        continue
      ansList.append(i)

if la == M:
  print(*ansList)
else:
  print(-1)
0