結果
| 問題 |
No.688 E869120 and Constructing Array 2
|
| コンテスト | |
| ユーザー |
hang_hang_cln
|
| 提出日時 | 2018-06-09 10:07:56 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 599 bytes |
| コンパイル時間 | 87 ms |
| コンパイル使用メモリ | 12,416 KB |
| 実行使用メモリ | 10,880 KB |
| 最終ジャッジ日時 | 2024-07-07 14:15:00 |
| 合計ジャッジ時間 | 1,240 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 9 WA * 1 |
ソースコード
import math
def cb(n,k):
return int(math.factorial(n) / math.factorial(k) / math.factorial(n-k))
def sumCB(n): # nC0 ~ nCnまでの合計
return 2**n
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()
hang_hang_cln