結果

問題 No.688 E869120 and Constructing Array 2
ユーザー tcltktcltk
提出日時 2021-11-20 03:17:59
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 233 ms / 1,000 ms
コード長 655 bytes
コンパイル時間 1,920 ms
コンパイル使用メモリ 86,628 KB
実行使用メモリ 89,376 KB
最終ジャッジ日時 2023-08-30 17:05:11
合計ジャッジ時間 6,582 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 223 ms
88,992 KB
testcase_01 AC 224 ms
89,072 KB
testcase_02 AC 228 ms
89,184 KB
testcase_03 AC 228 ms
89,120 KB
testcase_04 AC 233 ms
89,196 KB
testcase_05 AC 226 ms
89,376 KB
testcase_06 AC 225 ms
89,352 KB
testcase_07 AC 229 ms
89,208 KB
testcase_08 AC 228 ms
89,372 KB
testcase_09 AC 227 ms
89,116 KB
testcase_10 AC 227 ms
89,084 KB
testcase_11 AC 226 ms
89,320 KB
testcase_12 AC 225 ms
89,364 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/env python3
# from typing import *

import sys
import io
import math
import collections
import decimal
import itertools
import bisect
import heapq


def input():
    return sys.stdin.readline()[:-1]


# sys.setrecursionlimit(1000000)

# _INPUT = """# paste here...
# """
# sys.stdin = io.StringIO(_INPUT)

INF = 10**10

def solve(K):
    if K == 0:
        return [0]

    for N in range(2, 31):
        for n1 in range(2, N+1):
            n0 = N - n1
            v = (n1 * (n1-1) //2) * (2 ** n0)
            if v == K:
                return [1] * n1 + [0] * n0
    return [-1]



K = int(input())
ans = solve(K)
print(len(ans))
print(*ans)
0