結果
問題 | No.895 MESE |
ユーザー | roaris |
提出日時 | 2019-09-28 10:48:29 |
言語 | PyPy3 (7.3.15) |
結果 |
TLE
|
実行時間 | - |
コード長 | 402 bytes |
コンパイル時間 | 215 ms |
コンパイル使用メモリ | 82,472 KB |
実行使用メモリ | 158,452 KB |
最終ジャッジ日時 | 2024-04-09 19:14:58 |
合計ジャッジ時間 | 5,167 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 85 ms
142,548 KB |
testcase_01 | AC | 82 ms
135,524 KB |
testcase_02 | AC | 80 ms
135,920 KB |
testcase_03 | AC | 79 ms
135,548 KB |
testcase_04 | AC | 80 ms
135,980 KB |
testcase_05 | AC | 78 ms
135,236 KB |
testcase_06 | AC | 80 ms
135,976 KB |
testcase_07 | AC | 82 ms
135,988 KB |
testcase_08 | AC | 85 ms
138,908 KB |
testcase_09 | AC | 93 ms
141,400 KB |
testcase_10 | AC | 90 ms
142,336 KB |
testcase_11 | AC | 93 ms
142,272 KB |
testcase_12 | AC | 86 ms
139,260 KB |
testcase_13 | TLE | - |
testcase_14 | -- | - |
testcase_15 | -- | - |
testcase_16 | -- | - |
testcase_17 | -- | - |
testcase_18 | -- | - |
testcase_19 | -- | - |
testcase_20 | -- | - |
testcase_21 | -- | - |
testcase_22 | -- | - |
testcase_23 | -- | - |
testcase_24 | -- | - |
testcase_25 | -- | - |
testcase_26 | -- | - |
testcase_27 | -- | - |
testcase_28 | -- | - |
ソースコード
def inv(x): return pow(x, MOD-2, MOD) def C(n, r): return fact[n] * inv(fact[r]) * inv(fact[n-r]) a, b, c = map(int, input().split()) MOD = 10**9 + 7 fact = [1] for i in range(1, 10**6): fact.append(i * fact[-1] % MOD) ans = 0 for i in range(b+c-1, a+b+c-1): #iはyの最上位ビットの位置(0_indexed) ans += (2**i-1) * C(i-1, b-1) * C(i-b, c-1) ans %= MOD print(ans)