結果

問題 No.688 E869120 and Constructing Array 2
ユーザー johnjohn
提出日時 2018-06-22 22:26:41
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 542 bytes
コンパイル時間 270 ms
コンパイル使用メモリ 10,704 KB
実行使用メモリ 8,056 KB
最終ジャッジ日時 2023-09-21 20:55:15
合計ジャッジ時間 1,638 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 17 ms
7,900 KB
testcase_01 AC 17 ms
7,956 KB
testcase_02 AC 16 ms
7,936 KB
testcase_03 AC 16 ms
8,020 KB
testcase_04 AC 17 ms
8,056 KB
testcase_05 AC 17 ms
8,056 KB
testcase_06 AC 16 ms
7,916 KB
testcase_07 WA -
testcase_08 AC 16 ms
7,912 KB
testcase_09 RE -
testcase_10 AC 16 ms
7,952 KB
testcase_11 AC 17 ms
8,016 KB
testcase_12 AC 16 ms
7,916 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#coding utf-8
#https://yukicoder.me/problems/no/688
#No.688 E869120 and Constructing Array 2
import math
k = int(input())
a = 0
n = 0
def permutations_count(n,r):
    return math.factorial(n) // math.factorial(n - r)
for i in range(0,30):
    if i > 1:
        n = int(permutations_count(i,2) / 2)
        for j in range(0,30):
            a = n * (2 ** j)
            if a == k:
                break
    if a == k:
        break
print(i + j)
for k in range(0,j):
    print('0', end=" ")
for l in range(0,i):
    print('1', end=" ")
print()
0