結果

問題 No.567 コンプリート
ユーザー yuppe19 😺yuppe19 😺
提出日時 2017-09-08 22:38:28
言語 Python2
(2.7.18)
結果
AC  
実行時間 12 ms / 2,000 ms
コード長 389 bytes
コンパイル時間 554 ms
コンパイル使用メモリ 6,508 KB
実行使用メモリ 6,428 KB
最終ジャッジ日時 2023-08-21 05:50:39
合計ジャッジ時間 1,598 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 11 ms
6,356 KB
testcase_01 AC 11 ms
6,352 KB
testcase_02 AC 11 ms
6,340 KB
testcase_03 AC 11 ms
6,184 KB
testcase_04 AC 12 ms
6,272 KB
testcase_05 AC 11 ms
6,240 KB
testcase_06 AC 11 ms
6,380 KB
testcase_07 AC 12 ms
6,188 KB
testcase_08 AC 11 ms
6,392 KB
testcase_09 AC 11 ms
6,428 KB
testcase_10 AC 11 ms
6,196 KB
testcase_11 AC 11 ms
5,864 KB
testcase_12 AC 11 ms
6,188 KB
testcase_13 AC 11 ms
6,340 KB
testcase_14 AC 12 ms
6,220 KB
testcase_15 AC 11 ms
6,252 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/python2
# -*- coding: utf-8 -*-
# †
def nCr(n, r):
    assert 0 <= r <= n
    k = r if r <= n-r else n-r
    res = 1
    for i in xrange(k):
        res *= n-i
        res /= i+1
    return res


def complete_prob(k, n):
    return float(sum((-1)**(k-i) * nCr(k-1, i-1) * (float(i)/k)**(n-1) for i in xrange(1, k+1)))

n = int(raw_input())
res = complete_prob(6, n)
print res
0