結果

問題 No.688 E869120 and Constructing Array 2
ユーザー O2MTO2MT
提出日時 2020-12-15 20:26:46
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 306 bytes
コンパイル時間 207 ms
コンパイル使用メモリ 81,708 KB
実行使用メモリ 75,992 KB
最終ジャッジ日時 2023-10-20 06:30:29
合計ジャッジ時間 2,495 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 40 ms
53,516 KB
testcase_01 AC 46 ms
59,252 KB
testcase_02 AC 60 ms
67,648 KB
testcase_03 WA -
testcase_04 AC 67 ms
72,228 KB
testcase_05 AC 105 ms
75,968 KB
testcase_06 AC 92 ms
75,640 KB
testcase_07 AC 43 ms
59,256 KB
testcase_08 AC 80 ms
75,564 KB
testcase_09 WA -
testcase_10 AC 48 ms
61,484 KB
testcase_11 AC 48 ms
61,484 KB
testcase_12 AC 52 ms
63,548 KB
権限があれば一括ダウンロードができます

ソースコード

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(31):
    for j in range(2,31):
        if (2**i)*combinations_count(j,2) == K:
            print(i+j)
            print(*([0]*i+[1]*j))
            exit()
0