結果

問題 No.895 MESE
ユーザー MNGOFMNGOF
提出日時 2019-09-30 05:05:55
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 916 bytes
コンパイル時間 285 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 34,432 KB
最終ジャッジ日時 2024-04-14 07:56:28
合計ジャッジ時間 37,944 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 AC 1,218 ms
34,304 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def my_pow(a, n, r=1):
    r = ((r * a) % 1000000007) if n & 0b1 else r
    if n > 2:
        return my_pow((a * a) % 1000000007, n // 2, r)
    else:
        return r


def my_div(a, b):
    return (a * my_pow(b, 1000000005)) % 1000000007


# a, b, c = map(int, input().split())
# 標準入力
input_str = "100000 100000 100000"

# 入力の分解
# str = input()
s = input_str
s = s.split()
inp = [int(tmp) for tmp in s]

a = inp[0]
b = inp[1]
c = inp[2]

my_fact = [-1, 1, 1]
tmp = 1
for i in range(2, 300000):
    my_fact.append(my_fact[-1] * i % 1000000007)

my_2xp = [1]
tmp = 1
for i in range(1, 299999):
    my_2xp.append(my_2xp[-1] * 2 % 1000000007)

res = 0
k = a + b + c - 1
for i in range(0, a):
    k -= 1
    tmp = my_2xp[k] - 1
    tmp = (tmp * my_fact[k]) % 1000000007
    res += my_div(tmp, my_fact[a - i])
    res %= 1000000007

res = my_div(res, (my_fact[b] * my_fact[c]) % 1000000007)
print(res)
0