結果

問題 No.688 E869120 and Constructing Array 2
ユーザー syunsukesyunsuke
提出日時 2018-08-27 00:19:42
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
AC  
実行時間 17 ms / 1,000 ms
コード長 678 bytes
コンパイル時間 149 ms
コンパイル使用メモリ 10,852 KB
実行使用メモリ 8,332 KB
最終ジャッジ日時 2023-09-13 19:28:45
合計ジャッジ時間 1,282 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
8,264 KB
testcase_01 AC 17 ms
8,092 KB
testcase_02 AC 16 ms
8,332 KB
testcase_03 AC 16 ms
8,288 KB
testcase_04 AC 16 ms
8,200 KB
testcase_05 AC 16 ms
8,088 KB
testcase_06 AC 16 ms
8,196 KB
testcase_07 AC 16 ms
8,112 KB
testcase_08 AC 16 ms
8,268 KB
testcase_09 AC 15 ms
8,132 KB
testcase_10 AC 16 ms
8,152 KB
testcase_11 AC 16 ms
8,256 KB
testcase_12 AC 16 ms
8,296 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

K=int(input())

if K==0:
    print(1)
    print(0)
    exit()
else:
    list1=[]
    for i in range(1,30):
        if K%((i*(i+1))/2)==0:
            for j in range(30):
                if 2**j>1000000000:
                    pass
                else:
                    if K/((i*(i+1))/2)==2**j:
                        ans=[i+1,j]
                        print(sum(ans))
                        for k in range(i+1):
                            list1.append("1")
                        for l in range(j):
                            list1.append("0")
                        print(" ".join(list1))
                        exit()
                            
                
0