結果

問題 No.688 E869120 and Constructing Array 2
ユーザー syunsukesyunsuke
提出日時 2018-06-19 22:29:23
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
RE  
実行時間 -
コード長 697 bytes
コンパイル時間 91 ms
コンパイル使用メモリ 10,696 KB
実行使用メモリ 7,932 KB
最終ジャッジ日時 2023-09-21 20:54:30
合計ジャッジ時間 1,882 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,744 KB
testcase_01 RE -
testcase_02 AC 18 ms
7,784 KB
testcase_03 AC 32 ms
7,744 KB
testcase_04 AC 18 ms
7,920 KB
testcase_05 AC 154 ms
7,812 KB
testcase_06 AC 69 ms
7,868 KB
testcase_07 RE -
testcase_08 AC 25 ms
7,932 KB
testcase_09 RE -
testcase_10 AC 16 ms
7,796 KB
testcase_11 AC 16 ms
7,808 KB
testcase_12 AC 16 ms
7,800 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# coding: utf-8
# Your code here!

N=int(input())
for i in range(-2,int((N/2)**0.5)):
    
    for j in range(100):
        if (int((N/2)**0.5)-i)*(int((N/2)**0.5)-i+1)*(2**(j))>N:
            
            break
        elif (int((N/2)**0.5)-i)*(int((N/2)**0.5)-i+1)*(2**(j))==N:
            
            listans=[int((N/2)**0.5)-i+1,j]
        elif (int((N/2)**0.5)-i)*(int((N/2)**0.5)-i+1)*(2**(j))<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]+1):
    list1.append(0)
print(listans[0]+listans[1]+1)
a=""
for m in range(len(list1)):
    a=a+" "+str(list1[m])
print(a.lstrip())
    
0