結果

問題 No.688 E869120 and Constructing Array 2
ユーザー SalmonizeSalmonize
提出日時 2020-03-10 12:35:30
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 16 ms / 1,000 ms
コード長 270 bytes
コンパイル時間 136 ms
コンパイル使用メモリ 10,580 KB
実行使用メモリ 8,084 KB
最終ジャッジ日時 2023-08-10 00:33:23
合計ジャッジ時間 1,572 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,836 KB
testcase_01 AC 16 ms
7,788 KB
testcase_02 AC 16 ms
7,796 KB
testcase_03 AC 15 ms
7,772 KB
testcase_04 AC 15 ms
7,784 KB
testcase_05 AC 15 ms
7,804 KB
testcase_06 AC 15 ms
7,792 KB
testcase_07 AC 16 ms
7,720 KB
testcase_08 AC 16 ms
7,720 KB
testcase_09 AC 16 ms
8,084 KB
testcase_10 AC 16 ms
7,860 KB
testcase_11 AC 16 ms
7,824 KB
testcase_12 AC 16 ms
7,884 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

k = int(input())
if k == 0:
    print(1)
    print(0)
    exit(0)
for i in range(2,100000):
    t = i*(i-1)//2
    v = (k//t).bit_length()-1
    if k%t == 0 and k//t == 1 << v and i + v < 31:
        print(i + v)
        l = [1]*i + [0]*v
        print(*l)
        break
0