結果

問題 No.688 E869120 and Constructing Array 2
ユーザー pluto77pluto77
提出日時 2018-05-21 12:49:17
言語 Python2
(2.7.18)
結果
AC  
実行時間 12 ms / 1,000 ms
コード長 269 bytes
コンパイル時間 385 ms
コンパイル使用メモリ 6,664 KB
実行使用メモリ 6,124 KB
最終ジャッジ日時 2023-09-21 20:36:03
合計ジャッジ時間 1,420 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 12 ms
6,068 KB
testcase_01 AC 12 ms
5,932 KB
testcase_02 AC 12 ms
5,936 KB
testcase_03 AC 12 ms
5,964 KB
testcase_04 AC 12 ms
5,920 KB
testcase_05 AC 12 ms
6,012 KB
testcase_06 AC 12 ms
5,920 KB
testcase_07 AC 11 ms
6,124 KB
testcase_08 AC 12 ms
5,972 KB
testcase_09 AC 11 ms
6,012 KB
testcase_10 AC 12 ms
5,912 KB
testcase_11 AC 12 ms
5,968 KB
testcase_12 AC 12 ms
5,896 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#yuki688
import math,sys

def nCr(n,r):
 f=math.factorial
 return f(n)/f(r)/f(n-r)

k=int(raw_input())
if k==0:
 print 1
 sys.exit()
for i in xrange(31):
 for j in xrange(2,31-i):
  if (1<<i)*nCr(j,2)==k:
   print i+j
   res='0'*i+'1'*j
   print ' '.join(map(str,res))
0