結果

問題 No.1528 Not 1
ユーザー O2MTO2MT
提出日時 2021-06-04 21:46:58
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 747 bytes
コンパイル時間 2,512 ms
コンパイル使用メモリ 86,860 KB
実行使用メモリ 86,976 KB
最終ジャッジ日時 2023-08-12 12:25:50
合計ジャッジ時間 4,526 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 77 ms
71,512 KB
testcase_01 AC 112 ms
85,592 KB
testcase_02 AC 95 ms
78,464 KB
testcase_03 AC 96 ms
79,192 KB
testcase_04 AC 108 ms
85,716 KB
testcase_05 AC 90 ms
76,412 KB
testcase_06 AC 103 ms
81,940 KB
testcase_07 AC 113 ms
85,848 KB
testcase_08 AC 97 ms
79,664 KB
testcase_09 AC 97 ms
77,340 KB
testcase_10 AC 102 ms
80,984 KB
testcase_11 WA -
testcase_12 AC 79 ms
70,996 KB
testcase_13 AC 78 ms
71,328 KB
testcase_14 AC 79 ms
71,592 KB
testcase_15 AC 76 ms
71,096 KB
testcase_16 AC 79 ms
71,260 KB
testcase_17 AC 77 ms
71,000 KB
testcase_18 AC 112 ms
86,976 KB
testcase_19 AC 116 ms
86,876 KB
権限があれば一括ダウンロードができます

ソースコード

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