結果

問題 No.1528 Not 1
ユーザー ygd.
提出日時 2021-06-06 12:05:14
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 68 ms / 2,000 ms
コード長 541 bytes
コンパイル時間 158 ms
コンパイル使用メモリ 81,976 KB
実行使用メモリ 85,848 KB
最終ジャッジ日時 2024-11-22 18:15:00
合計ジャッジ時間 3,155 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 19
権限があれば一括ダウンロードができます

ソースコード

diff #

def main():
    n = int(input())
    if n == 1 or n == 2:
        print(1)
    elif n == 3 or n == 5:
        print(-1)
    else:
        if n%2 == 0:
            ans = [2*i+2 for i in range(n//2)]
        else:
            ans = []
            now = 2
            while now <= n:
                if now == 6:
                    now += 2
                else:
                    ans.append(now)
                    now += 2
            ans.append(6)
            ans.append(3)
        print(*ans)
    

if __name__ == '__main__':
    main()
0