結果

問題 No.688 E869120 and Constructing Array 2
ユーザー Navier_BoltzmannNavier_Boltzmann
提出日時 2022-12-01 08:14:13
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 54 ms / 1,000 ms
コード長 466 bytes
コンパイル時間 252 ms
コンパイル使用メモリ 82,176 KB
実行使用メモリ 55,808 KB
最終ジャッジ日時 2024-04-16 23:58:55
合計ジャッジ時間 2,002 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 52 ms
55,040 KB
testcase_01 AC 54 ms
55,808 KB
testcase_02 AC 52 ms
55,168 KB
testcase_03 AC 52 ms
55,168 KB
testcase_04 AC 51 ms
55,040 KB
testcase_05 AC 52 ms
54,912 KB
testcase_06 AC 52 ms
54,912 KB
testcase_07 AC 52 ms
55,296 KB
testcase_08 AC 52 ms
55,424 KB
testcase_09 AC 54 ms
55,296 KB
testcase_10 AC 52 ms
55,040 KB
testcase_11 AC 53 ms
54,912 KB
testcase_12 AC 52 ms
55,168 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import *
from functools import *
from itertools import *
from heapq import *
import sys,math
input = sys.stdin.readline

K = int(input())
if K==0:
    print(1)
    print(0)
    exit()
    
for i in range(2,40):
    
    tmp = i*(i-1)//2
    
    if K%tmp==0:
        if bin(K//tmp).count('1')==1:
            
            b = i
            break

a2 = K//(tmp)
a = 0
while a2%2==0:
    a += 1
    a2 //= 2

print(a+b)
ans = [1]*b + [0]*a
print(*ans)
0