結果

問題 No.688 E869120 and Constructing Array 2
ユーザー 👑 KazunKazun
提出日時 2020-05-31 18:25:12
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 78 ms / 1,000 ms
コード長 252 bytes
コンパイル時間 1,373 ms
コンパイル使用メモリ 86,504 KB
実行使用メモリ 71,560 KB
最終ジャッジ日時 2023-08-11 08:31:22
合計ジャッジ時間 3,227 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
71,276 KB
testcase_01 AC 76 ms
71,404 KB
testcase_02 AC 74 ms
71,324 KB
testcase_03 AC 76 ms
71,192 KB
testcase_04 AC 75 ms
71,560 KB
testcase_05 AC 75 ms
71,348 KB
testcase_06 AC 75 ms
71,400 KB
testcase_07 AC 75 ms
71,296 KB
testcase_08 AC 75 ms
71,276 KB
testcase_09 AC 75 ms
71,280 KB
testcase_10 AC 76 ms
71,392 KB
testcase_11 AC 78 ms
71,260 KB
testcase_12 AC 74 ms
71,392 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

K=int(input())

N=-1
A=-1
for n in range(1,31):
    for a in range(n+1):
        if 2**(a-1)*(n-a)*(n-a-1)==K:
            N,A=n,a

S=""
for i in range(N):
    if i<A:
        S+="0 "
    else:
        S+="1 "
        
print("{}\n{}".format(N,S[:-1]))
0