結果

問題 No.688 E869120 and Constructing Array 2
ユーザー rlangevinrlangevin
提出日時 2023-01-13 08:59:20
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 348 bytes
コンパイル時間 1,333 ms
コンパイル使用メモリ 87,104 KB
実行使用メモリ 71,516 KB
最終ジャッジ日時 2023-08-25 17:46:27
合計ジャッジ時間 3,620 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 88 ms
71,200 KB
testcase_01 AC 88 ms
71,208 KB
testcase_02 AC 66 ms
71,184 KB
testcase_03 AC 107 ms
71,516 KB
testcase_04 AC 66 ms
71,432 KB
testcase_05 AC 71 ms
71,316 KB
testcase_06 AC 70 ms
71,388 KB
testcase_07 AC 68 ms
71,268 KB
testcase_08 AC 77 ms
71,260 KB
testcase_09 WA -
testcase_10 AC 130 ms
71,392 KB
testcase_11 AC 74 ms
71,112 KB
testcase_12 AC 102 ms
71,192 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

K = int(input())
two = [1] * 31
for i in range(1, 31):
    two[i] = two[i - 1] * 2

ans = []
for i in range(2, 31):
    q, r = divmod(K, (i * (i - 1)//2))
    if r:
        continue
    if q not in two:
        continue
    ind = two.index(q)
    if ind + i > 30:
        continue
    ans = [0] * ind + [1] * i
    break
print(len(ans))
print(*ans)
0