結果

問題 No.688 E869120 and Constructing Array 2
ユーザー prd_xxxprd_xxx
提出日時 2018-05-18 22:41:01
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 206 bytes
コンパイル時間 91 ms
コンパイル使用メモリ 10,724 KB
実行使用メモリ 8,424 KB
最終ジャッジ日時 2023-09-21 19:55:53
合計ジャッジ時間 1,387 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 18 ms
8,280 KB
testcase_01 AC 17 ms
8,364 KB
testcase_02 AC 16 ms
8,364 KB
testcase_03 WA -
testcase_04 AC 16 ms
8,200 KB
testcase_05 AC 16 ms
8,368 KB
testcase_06 AC 16 ms
8,260 KB
testcase_07 AC 17 ms
8,276 KB
testcase_08 AC 16 ms
8,288 KB
testcase_09 AC 16 ms
8,260 KB
testcase_10 AC 16 ms
8,200 KB
testcase_11 AC 16 ms
8,384 KB
testcase_12 AC 16 ms
8,204 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import math
K = int(input())

for i in range(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