結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,884 KB
testcase_01 RE -
testcase_02 AC 16 ms
7,840 KB
testcase_03 AC 31 ms
7,840 KB
testcase_04 AC 17 ms
7,836 KB
testcase_05 AC 154 ms
7,804 KB
testcase_06 AC 67 ms
7,804 KB
testcase_07 RE -
testcase_08 AC 24 ms
7,840 KB
testcase_09 RE -
testcase_10 AC 15 ms
7,828 KB
testcase_11 AC 15 ms
7,864 KB
testcase_12 AC 15 ms
7,756 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

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