結果

問題 No.1785 Inequality Signs
ユーザー mkawa2mkawa2
提出日時 2021-12-14 00:44:35
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 1,359 bytes
コンパイル時間 250 ms
コンパイル使用メモリ 87,124 KB
実行使用メモリ 99,156 KB
最終ジャッジ日時 2023-09-30 06:47:50
合計ジャッジ時間 9,387 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 79 ms
91,204 KB
testcase_01 AC 86 ms
92,344 KB
testcase_02 RE -
testcase_03 RE -
testcase_04 RE -
testcase_05 RE -
testcase_06 RE -
testcase_07 RE -
testcase_08 RE -
testcase_09 RE -
testcase_10 RE -
testcase_11 RE -
testcase_12 RE -
testcase_13 RE -
testcase_14 RE -
testcase_15 RE -
testcase_16 RE -
testcase_17 RE -
testcase_18 RE -
testcase_19 RE -
testcase_20 RE -
testcase_21 RE -
testcase_22 RE -
testcase_23 RE -
testcase_24 RE -
testcase_25 RE -
testcase_26 RE -
testcase_27 RE -
testcase_28 RE -
testcase_29 RE -
testcase_30 RE -
testcase_31 RE -
testcase_32 RE -
testcase_33 AC 79 ms
91,280 KB
testcase_34 AC 86 ms
91,232 KB
testcase_35 AC 90 ms
93,416 KB
testcase_36 RE -
testcase_37 RE -
testcase_38 AC 93 ms
91,596 KB
testcase_39 AC 92 ms
94,520 KB
testcase_40 AC 93 ms
95,872 KB
testcase_41 AC 100 ms
98,092 KB
testcase_42 RE -
testcase_43 RE -
testcase_44 RE -
testcase_45 AC 93 ms
95,544 KB
testcase_46 AC 86 ms
91,228 KB
testcase_47 AC 97 ms
97,596 KB
testcase_48 AC 100 ms
99,156 KB
testcase_49 AC 86 ms
91,708 KB
testcase_50 RE -
testcase_51 AC 90 ms
91,740 KB
testcase_52 AC 84 ms
91,344 KB
testcase_53 AC 92 ms
92,772 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys

sys.setrecursionlimit(200005)
int1 = lambda x: int(x)-1
pDB = lambda *x: print(*x, end="\n", file=sys.stderr)
p2D = lambda x: print(*x, sep="\n", end="\n\n", file=sys.stderr)
def II(): return int(sys.stdin.readline())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def LI1(): return list(map(int1, sys.stdin.readline().split()))
def LLI1(rows_number): return [LI1() for _ in range(rows_number)]
def SI(): return sys.stdin.readline().rstrip()
dij = [(0, 1), (-1, 0), (0, -1), (1, 0)]
# dij = [(0, 1), (-1, 0), (0, -1), (1, 0), (1, 1), (1, -1), (-1, 1), (-1, -1)]
# inf = 18446744073709551615
inf = 4294967295
md = 10**9+7
# md = 998244353

def nHr(hn, hr):
    return nCr(hn+hr-1, hr-1)

def nPr(com_n, com_r):
    if com_r < 0: return 0
    if com_n < com_r: return 0
    return fac[com_n]*ifac[com_n-com_r]%md

def nCr(com_n, com_r):
    if com_r < 0: return 0
    if com_n < com_r: return 0
    return fac[com_n]*ifac[com_r]%md*ifac[com_n-com_r]%md

# 準備
n_max = 200005
fac = [1]
for i in range(1, n_max+1): fac.append(fac[-1]*i%md)
ifac = [1]*(n_max+1)
ifac[n_max] = pow(fac[n_max], md-2, md)
for i in range(n_max-1, 1, -1): ifac[i] = ifac[i+1]*(i+1)%md

n, k = LI()
ans = 0
for i in range(n):
    ans += nCr(n+k-1-i, n)*nCr(n-1, i)%md
    ans %= md
print(ans)
0