結果

問題 No.688 E869120 and Constructing Array 2
ユーザー akitsugu777akitsugu777
提出日時 2019-07-16 15:58:31
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 16 ms / 1,000 ms
コード長 257 bytes
コンパイル時間 174 ms
コンパイル使用メモリ 10,520 KB
実行使用メモリ 7,972 KB
最終ジャッジ日時 2023-08-20 18:28:41
合計ジャッジ時間 1,178 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 13 ms
7,916 KB
testcase_01 AC 16 ms
7,800 KB
testcase_02 AC 14 ms
7,916 KB
testcase_03 AC 12 ms
7,972 KB
testcase_04 AC 12 ms
7,772 KB
testcase_05 AC 12 ms
7,792 KB
testcase_06 AC 12 ms
7,832 KB
testcase_07 AC 12 ms
7,868 KB
testcase_08 AC 12 ms
7,824 KB
testcase_09 AC 12 ms
7,716 KB
testcase_10 AC 12 ms
7,832 KB
testcase_11 AC 12 ms
7,844 KB
testcase_12 AC 12 ms
7,772 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

k = int(input())

if k == 0:
    print(1)
    print(0)

else:
    for i in range(31):
        for j in range(31):
            if j*(j-1)/2 * 2**(i-j) == k:
                print(i)
                print(" ".join(['0']*(i-j) + ['1']*j))
                break
0