結果

問題 No.688 E869120 and Constructing Array 2
ユーザー titia
提出日時 2024-09-29 05:16:23
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 32 ms / 1,000 ms
コード長 378 bytes
コンパイル時間 154 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-09-29 05:16:34
合計ジャッジ時間 1,289 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 10
権限があれば一括ダウンロードができます

ソースコード

diff #

K=int(input())

if K==0:
    ANS=[1]
    print(len(ANS))
    print(*ANS)
    exit()

for i in range(2,10000000):
    x=i*(i-1)//2

    if K%x==0:
        r=K//x

        for j in range(31):
            if r==(1<<j):

                ANS=[1]*i+[0]*j

                if len(ANS)<=30:
                    print(len(ANS))
                    print(*ANS)
                    exit()
0