結果

問題 No.1528 Not 1
ユーザー titiatitia
提出日時 2021-06-04 21:07:52
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 503 bytes
コンパイル時間 114 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 16,256 KB
最終ジャッジ日時 2024-04-30 01:02:40
合計ジャッジ時間 3,027 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 31 ms
10,752 KB
testcase_01 AC 99 ms
15,616 KB
testcase_02 AC 53 ms
12,416 KB
testcase_03 AC 60 ms
13,056 KB
testcase_04 AC 92 ms
15,360 KB
testcase_05 WA -
testcase_06 AC 74 ms
14,080 KB
testcase_07 AC 100 ms
15,872 KB
testcase_08 WA -
testcase_09 AC 44 ms
11,648 KB
testcase_10 AC 63 ms
13,312 KB
testcase_11 AC 31 ms
10,880 KB
testcase_12 AC 30 ms
10,752 KB
testcase_13 AC 30 ms
10,752 KB
testcase_14 AC 30 ms
10,752 KB
testcase_15 AC 30 ms
10,752 KB
testcase_16 AC 30 ms
10,752 KB
testcase_17 AC 30 ms
10,880 KB
testcase_18 AC 107 ms
16,256 KB
testcase_19 AC 105 ms
16,256 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(A[-1]//2)
        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