結果

問題 No.688 E869120 and Constructing Array 2
ユーザー wagasa2wagasa2
提出日時 2018-05-24 00:45:15
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
RE  
実行時間 -
コード長 496 bytes
コンパイル時間 111 ms
コンパイル使用メモリ 10,840 KB
実行使用メモリ 8,132 KB
最終ジャッジ日時 2023-09-21 20:42:52
合計ジャッジ時間 2,919 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
8,132 KB
testcase_01 RE -
testcase_02 AC 17 ms
7,932 KB
testcase_03 AC 16 ms
8,012 KB
testcase_04 AC 16 ms
7,960 KB
testcase_05 AC 17 ms
8,032 KB
testcase_06 AC 17 ms
7,976 KB
testcase_07 RE -
testcase_08 AC 16 ms
8,008 KB
testcase_09 AC 16 ms
7,960 KB
testcase_10 AC 16 ms
7,932 KB
testcase_11 AC 16 ms
8,068 KB
testcase_12 AC 16 ms
7,948 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import math
def combi(n ,r):
    p = 1
    for i in range(1, r+1):
        p = p * (n - i + 1) / i
    return p

N = int(input())
length = 1
flag = True
while flag:
    length += 1
    for one in range(1,length):
        if N == combi(one,2)*pow(2,length-one):
            flag = False
            break

b = ""
for i in range(one):
    b += "1"
    if i != one:
        b += " "
for i  in range(length - one):
    b += "0"
    if i != length - one:
        b += " "
    


print(length)
print(b)
0