結果

問題 No.1528 Not 1
ユーザー 👑 obakyanobakyan
提出日時 2021-07-01 23:52:30
言語 Lua
(LuaJit 2.1.1696795921)
結果
AC  
実行時間 72 ms / 2,000 ms
コード長 384 bytes
コンパイル時間 384 ms
コンパイル使用メモリ 5,328 KB
実行使用メモリ 7,020 KB
最終ジャッジ日時 2023-09-10 21:38:45
合計ジャッジ時間 3,502 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 61 ms
6,500 KB
testcase_02 AC 20 ms
4,384 KB
testcase_03 AC 26 ms
4,468 KB
testcase_04 AC 58 ms
6,184 KB
testcase_05 AC 9 ms
4,380 KB
testcase_06 AC 38 ms
4,956 KB
testcase_07 AC 64 ms
6,728 KB
testcase_08 AC 28 ms
4,408 KB
testcase_09 AC 13 ms
4,384 KB
testcase_10 AC 30 ms
4,380 KB
testcase_11 AC 1 ms
4,380 KB
testcase_12 AC 1 ms
4,376 KB
testcase_13 AC 1 ms
4,380 KB
testcase_14 AC 1 ms
4,380 KB
testcase_15 AC 1 ms
4,380 KB
testcase_16 AC 1 ms
4,380 KB
testcase_17 AC 1 ms
4,376 KB
testcase_18 AC 72 ms
6,952 KB
testcase_19 AC 72 ms
7,020 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

local n = io.read("*n")
if n % 2 == 0 then
  local t = {}
  n = math.floor(n / 2)
  for i = 1, n do
    t[i] = i * 2
  end
  print(table.concat(t, " "))
else
  if n == 1 then
    print(1)
  elseif n <= 5 then
    print(-1)
  else
    local t = {3, 6, 2, 4}
    n = math.floor(n / 2) - 3
    for i = 1, n do
      t[4 + i] = i * 2 + 6
    end
    print(table.concat(t, " "))
  end
end
0