結果

問題 No.688 E869120 and Constructing Array 2
ユーザー O2MTO2MT
提出日時 2020-12-15 20:44:36
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 355 bytes
コンパイル時間 162 ms
コンパイル使用メモリ 81,920 KB
実行使用メモリ 76,236 KB
最終ジャッジ日時 2024-09-20 02:08:40
合計ジャッジ時間 1,685 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
52,352 KB
testcase_01 AC 41 ms
58,624 KB
testcase_02 AC 61 ms
66,432 KB
testcase_03 AC 69 ms
73,472 KB
testcase_04 AC 60 ms
68,352 KB
testcase_05 AC 77 ms
76,236 KB
testcase_06 AC 74 ms
75,904 KB
testcase_07 AC 41 ms
58,496 KB
testcase_08 AC 65 ms
72,448 KB
testcase_09 WA -
testcase_10 AC 45 ms
60,416 KB
testcase_11 AC 48 ms
62,080 KB
testcase_12 AC 50 ms
62,720 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

K = int(input())
if K == 0:
    print(0)
    print(0)
    exit()
for i in range(31):
    for j in range(2,31-i):
        if (2**i)*combinations_count(j,2) == K:
            print(i+j)
            print(*([0]*i+[1]*j))
            exit()
0