結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 29 ms
10,496 KB
testcase_01 AC 96 ms
15,488 KB
testcase_02 AC 51 ms
12,288 KB
testcase_03 AC 59 ms
12,928 KB
testcase_04 AC 93 ms
15,360 KB
testcase_05 WA -
testcase_06 AC 73 ms
13,952 KB
testcase_07 AC 98 ms
15,744 KB
testcase_08 WA -
testcase_09 AC 44 ms
11,648 KB
testcase_10 AC 63 ms
13,312 KB
testcase_11 AC 30 ms
10,624 KB
testcase_12 AC 31 ms
10,624 KB
testcase_13 AC 31 ms
10,624 KB
testcase_14 AC 31 ms
10,752 KB
testcase_15 AC 31 ms
10,624 KB
testcase_16 AC 30 ms
10,752 KB
testcase_17 AC 30 ms
10,752 KB
testcase_18 AC 105 ms
16,256 KB
testcase_19 AC 105 ms
16,384 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
    A.append((r+2)//2)

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