結果

問題 No.1528 Not 1
ユーザー titiatitia
提出日時 2021-06-04 21:10:34
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 64 ms / 2,000 ms
コード長 496 bytes
コンパイル時間 336 ms
コンパイル使用メモリ 10,788 KB
実行使用メモリ 13,728 KB
最終ジャッジ日時 2023-08-12 10:54:56
合計ジャッジ時間 2,283 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
8,084 KB
testcase_01 AC 57 ms
13,148 KB
testcase_02 AC 28 ms
9,884 KB
testcase_03 AC 36 ms
10,572 KB
testcase_04 AC 55 ms
12,944 KB
testcase_05 AC 20 ms
9,004 KB
testcase_06 AC 44 ms
11,192 KB
testcase_07 AC 59 ms
13,228 KB
testcase_08 AC 36 ms
10,336 KB
testcase_09 AC 22 ms
9,244 KB
testcase_10 AC 36 ms
10,740 KB
testcase_11 AC 14 ms
8,116 KB
testcase_12 AC 13 ms
8,228 KB
testcase_13 AC 13 ms
8,116 KB
testcase_14 AC 13 ms
8,148 KB
testcase_15 AC 13 ms
7,852 KB
testcase_16 AC 12 ms
7,856 KB
testcase_17 AC 13 ms
7,792 KB
testcase_18 AC 64 ms
13,728 KB
testcase_19 AC 64 ms
13,680 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N=int(input())

if N==1:
    print(1)
    exit()
elif N==3 or N==5:
    print(-1)
    exit()

A=[]
for i in range(N//2):
    A.append((i+1)*2)

if N%2==1:
    x=A[-1]
    while x%2==0:
        x//=2

    if x!=1:
        A.append(x)
        print(*A)
        exit()

    k=A[-1]//2
    x=A.index(k)
    A=A[:x+1]

    #print(A)

    r=N-1
    for i in range(x+1,N//2):
        A.append(r)
        r-=2

    x=r+2
    while x%2==0:
        x//=2
    A.append(x)

    print(*A)
else:
    print(*A)
0