結果

問題 No.688 E869120 and Constructing Array 2
ユーザー O2MTO2MT
提出日時 2020-12-15 20:25:34
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 302 bytes
コンパイル時間 187 ms
コンパイル使用メモリ 81,704 KB
実行使用メモリ 76,048 KB
最終ジャッジ日時 2023-10-20 06:29:41
合計ジャッジ時間 4,122 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import math
def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

K = int(input())

for i in range(30):
    for j in range(2,30):
        if (2**i)*combinations_count(j,2) == K:
            print(i+j)
            print([0]*i+[1]*j)
            break
0