結果

問題 No.688 E869120 and Constructing Array 2
ユーザー brthyyjpbrthyyjp
提出日時 2020-11-12 22:25:38
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 395 bytes
コンパイル時間 760 ms
コンパイル使用メモリ 87,180 KB
実行使用メモリ 71,788 KB
最終ジャッジ日時 2023-09-30 01:51:38
合計ジャッジ時間 3,218 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 AC 72 ms
71,472 KB
testcase_03 AC 72 ms
71,224 KB
testcase_04 AC 71 ms
71,368 KB
testcase_05 AC 73 ms
71,288 KB
testcase_06 AC 75 ms
71,400 KB
testcase_07 WA -
testcase_08 AC 72 ms
71,284 KB
testcase_09 AC 72 ms
71,144 KB
testcase_10 AC 70 ms
71,512 KB
testcase_11 AC 75 ms
71,184 KB
testcase_12 AC 72 ms
71,368 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

k = int(input())
if k == 0:
    print(1)
    print(0)
    exit()

if k == 1:
    print(1)
    print(1)
    exit()

import math
for i in range(2, int(math.sqrt(k))+1):
    t = i*(i-1)
    if (2*k)%t != 0:
        continue
    p = (2*k)//t
    c = 0
    while p%2 == 0:
        c += 1
        p //= 2
    if p != 1:
        continue
    print(c+i)
    ans = [0]*c+[1]*i
    print(*ans)
    exit()
0