結果

問題 No.688 E869120 and Constructing Array 2
ユーザー syunsukesyunsuke
提出日時 2018-08-27 00:09:33
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 679 bytes
コンパイル時間 70 ms
コンパイル使用メモリ 10,908 KB
実行使用メモリ 8,336 KB
最終ジャッジ日時 2023-09-13 19:28:21
合計ジャッジ時間 1,360 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 17 ms
8,224 KB
testcase_01 AC 17 ms
8,256 KB
testcase_02 AC 16 ms
8,264 KB
testcase_03 AC 16 ms
8,160 KB
testcase_04 AC 15 ms
8,304 KB
testcase_05 AC 16 ms
8,260 KB
testcase_06 AC 16 ms
8,336 KB
testcase_07 AC 15 ms
8,228 KB
testcase_08 AC 16 ms
8,140 KB
testcase_09 WA -
testcase_10 AC 16 ms
8,196 KB
testcase_11 AC 17 ms
8,164 KB
testcase_12 AC 16 ms
8,256 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

K=int(input())

if K==0:
    print(0)
    print("")
    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