結果

問題 No.688 E869120 and Constructing Array 2
ユーザー kohei2019kohei2019
提出日時 2022-03-12 16:08:30
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 344 bytes
コンパイル時間 274 ms
コンパイル使用メモリ 81,772 KB
実行使用メモリ 65,932 KB
最終ジャッジ日時 2023-10-16 23:47:27
合計ジャッジ時間 2,042 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 33 ms
53,532 KB
testcase_01 AC 33 ms
53,532 KB
testcase_02 AC 33 ms
53,532 KB
testcase_03 WA -
testcase_04 AC 33 ms
53,532 KB
testcase_05 AC 40 ms
59,672 KB
testcase_06 AC 38 ms
59,672 KB
testcase_07 AC 34 ms
53,532 KB
testcase_08 AC 36 ms
59,672 KB
testcase_09 RE -
testcase_10 AC 34 ms
53,532 KB
testcase_11 AC 35 ms
53,532 KB
testcase_12 AC 33 ms
53,532 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

K = int(input())
for i in range(2,10**5+1):
    if K < (i*(i-1) // 2):
        break
    if K % (i*(i-1) // 2) == 0:
        c = K // (i*(i-1) // 2)
        if bin(c).count('1') == 1:
            n1 = i
            n0 = 0
            while c > 1:
                c //= 2
                n0 += 1
ans = [1]*n1 + [0]*n0
print(len(ans))
print(*ans)
0