結果

問題 No.688 E869120 and Constructing Array 2
ユーザー prd_xxx
提出日時 2018-05-18 22:39:17
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 208 bytes
コンパイル時間 142 ms
コンパイル使用メモリ 12,416 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2024-07-07 13:27:22
合計ジャッジ時間 1,354 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 7 WA * 3
権限があれば一括ダウンロードができます

ソースコード

diff #

import math
K = int(input())

for i in range(1,31):
    d = K//(2**i)
    a = int(math.sqrt(d*2))
    if a*(a+1) == d*2:
        print(i+a+1)
        arr = [0]*i + [1]*(a+1)
        print(*arr)
        exit()
0