結果

問題 No.688 E869120 and Constructing Array 2
ユーザー hakomori64hakomori64
提出日時 2018-05-25 20:00:18
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 528 bytes
コンパイル時間 89 ms
コンパイル使用メモリ 10,724 KB
実行使用メモリ 8,244 KB
最終ジャッジ日時 2023-09-21 20:43:09
合計ジャッジ時間 1,267 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
8,048 KB
testcase_01 AC 15 ms
8,044 KB
testcase_02 AC 15 ms
8,240 KB
testcase_03 AC 14 ms
8,244 KB
testcase_04 AC 14 ms
8,164 KB
testcase_05 AC 15 ms
8,112 KB
testcase_06 AC 15 ms
8,164 KB
testcase_07 AC 15 ms
8,104 KB
testcase_08 AC 15 ms
8,104 KB
testcase_09 WA -
testcase_10 AC 15 ms
8,156 KB
testcase_11 AC 15 ms
8,044 KB
testcase_12 AC 15 ms
8,164 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# -*- coding: utf-8 -*-
import sys

sum = int(input())
array = []

append_zero = 0
number_one = 0

for number_one in range(2, 31):
    x = number_one * (number_one - 1) / 2
    for append_zero in range(31):
        if (2 ** append_zero) * x == sum:
            for i in range(number_one):
                array.append(1)
            for j in range(append_zero):
                array.append(0)

            print(len(array))
            for i in range(len(array)):
                print(array[i], end=" ")
            sys.exit()
0