結果
| 問題 |
No.688 E869120 and Constructing Array 2
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-12-01 08:14:13 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 51 ms / 1,000 ms |
| コード長 | 466 bytes |
| コンパイル時間 | 427 ms |
| コンパイル使用メモリ | 81,980 KB |
| 実行使用メモリ | 55,424 KB |
| 最終ジャッジ日時 | 2024-10-08 07:11:02 |
| 合計ジャッジ時間 | 1,665 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 10 |
ソースコード
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)