J. 「一本通 6.6 练习 9」网格

    Type: Default 1000ms 512MiB

「一本通 6.6 练习 9」网格

You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.

题目描述

原题来自:BZOJ 3907

某城市的街道呈网格状,左下角坐标为 A(0,0)A(0, 0),右上角坐标为 B(n,m)B(n, m),其中 nmn \ge m。现在从 A(0,0)A(0, 0) 点出发,只能沿着街道向正右方或者正上方行走,且不能经过图示中直线左上方的点,即任何途径的点 (x,y)(x, y) 都要满足 xyx \ge y,请问在这些前提下,到达 B(n,m)B(n, m) 有多少种走法。

gird.png

输入格式

仅有一行,包含两个整数 nnmm,表示城市街区的规模。

输出格式

仅有一个整数和一个换行/回车符,表示不同的方案总数。

样例

6 6
132

数据范围与提示

对于全部数据,1mn50001\le m\le n\le 5000

中学生信息奥林匹克(提高)作业——组合数学

Not Claimed
Status
Done
Problem
12
Open Since
2025-12-13 11:30
Deadline
2026-1-24 23:59
Extension
24 hour(s)