結果

問題 No.688 E869120 and Constructing Array 2
ユーザー jiromarujiromaru
提出日時 2018-06-06 20:26:55
言語 PyPy2
(7.3.15)
結果
TLE  
実行時間 -
コード長 493 bytes
コンパイル時間 2,121 ms
コンパイル使用メモリ 77,400 KB
実行使用メモリ 76,444 KB
最終ジャッジ日時 2023-09-21 20:48:25
合計ジャッジ時間 6,975 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 77 ms
76,444 KB
testcase_01 TLE -
testcase_02 -- -
testcase_03 -- -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

K=int(input())
import math
list=[]
fin=0
def sumcomb(a):
    s=0
    for x in range(a+1):
        s+=math.factorial(a)/(math.factorial(x)*math.factorial(a-x))
    return s

N=2
while True:
    i=2
    while i<N:
        if round((i*(i-1)/2.0)*sumcomb(N-i))==K:
            fin=1
            break
        i+=1
    if fin==1:
        break
    N+=1

for y in range(N):
    if y+1<=i:
        list.append("1") 
    else:
        list.append("0")
    output=" ".join(list)
print(N)
print(output)
0