結果
| 問題 | No.688 E869120 and Constructing Array 2 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-12-01 08:14:13 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 32 ms / 1,000 ms |
| コード長 | 466 bytes |
| 記録 | |
| コンパイル時間 | 208 ms |
| コンパイル使用メモリ | 85,400 KB |
| 実行使用メモリ | 55,552 KB |
| 最終ジャッジ日時 | 2026-04-24 13:54:22 |
| 合計ジャッジ時間 | 1,779 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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)