結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 RE -
testcase_02 AC 16 ms
7,816 KB
testcase_03 AC 30 ms
7,884 KB
testcase_04 AC 18 ms
7,744 KB
testcase_05 AC 154 ms
7,752 KB
testcase_06 AC 68 ms
7,852 KB
testcase_07 RE -
testcase_08 AC 23 ms
7,788 KB
testcase_09 RE -
testcase_10 AC 15 ms
7,756 KB
testcase_11 AC 15 ms
7,824 KB
testcase_12 AC 15 ms
7,920 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# coding: utf-8
# Your code here!

N=int(input())
for i in range(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

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