結果
問題 |
No.688 E869120 and Constructing Array 2
|
ユーザー |
![]() |
提出日時 | 2018-06-09 09:56:53 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
TLE
|
実行時間 | - |
コード長 | 634 bytes |
コンパイル時間 | 106 ms |
コンパイル使用メモリ | 12,416 KB |
実行使用メモリ | 115,204 KB |
最終ジャッジ日時 | 2024-07-07 14:14:54 |
合計ジャッジ時間 | 4,521 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | -- * 3 |
other | TLE * 1 -- * 9 |
ソースコード
from scipy.special import comb def cb(n,k): return int(comb(n,k)) def sumCB(n): # nC0 ~ nCnまでの合計 ans = 0 for i in range(0,n+1): ans += cb(n,i) return ans def main(): K = int(input()) for n in range(2,31): for i in range(2,n+1): # i:1の個数 if K % cb(i,2) == 0: if cb(i,2) * sumCB(n-i) == K: print(n) b = '1' * i b += '0' * (n-i) print(' '.join(list(b))) break else: continue if __name__ == '__main__': main()