結果

問題 No.688 E869120 and Constructing Array 2
ユーザー syunsukesyunsuke
提出日時 2018-06-19 22:40:23
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 629 bytes
コンパイル時間 92 ms
コンパイル使用メモリ 10,952 KB
実行使用メモリ 15,112 KB
最終ジャッジ日時 2023-09-21 20:54:46
合計ジャッジ時間 3,011 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

# coding: utf-8
# Your code here!

N=int(input())
for i in range(-4,int((N))):
    
    for j in range(100):
        if (int(N)-i)*(int(N)-i+1)*(2**(j))>2*N:
            
            break
        elif (int(N)-i)*(int(N)-i+1)*(2**(j))==2*N:
            
            listans=[int(N)-i+1,j]
        elif (int(N)-i)*(int(N)-i+1)*(2**(j))<2*N:
            j+=1
        
    

#print(listans)
#print(i+1)
#print(j+1)
list1=[]
for k in range(listans[0]):
    list1.append(1)


for l in range(listans[1]):
    list1.append(0)
print(listans[0]+listans[1])
a=""
for m in range(len(list1)):
    a=a+" "+str(list1[m])
print(a.lstrip())
    
0