2017 ICPC Mid-Central USA Region-Hopscotch

该博客介绍了ICPC Mid-Central USA Region的一道竞赛题目,内容涉及从(0,0)到(N,N)的跳格子问题。玩家必须在每个跳跃中使x坐标增加至少X,y坐标增加至少Y。博客提供了输入输出格式,并展示了如何通过数学和组合优化策略计算出不同路径的数量,最后给出了样例输入输出以及解决方案的思路和代码实现。" 117189243,10545198,16位二进制到BCD码转换的C51汇编实现,"['C51', '汇编程序', '二进制转换', 'BCD码转换']
摘要由CSDN通过智能技术生成

题目描述
You’re playing hopscotch! You start at the origin and your goal is to hop to the lattice point (N, N). A hop consists of going from lattice point (x1, y1) to (x2, y2), where x1 < x2 and y1 < y2.
You dislike making small hops though. You’ve decided that for every hop you make between two lattice points, the x-coordinate must increase by at least X and the y-coordinate must increase by at least Y .
Compute the number of distinct paths you can take between (0, 0) and (N, N) that respect the above constraints. Two paths are distinct if there is some lattice point that you visit in one path which you don’t visit in the other.
Hint: The output involves arithmetic mod 109+ 7. Note that with p a prime like 109+ 7, and x an integer not equal to 0 mod p, then x(xp−2) mod p equals 1 mod p.
输入
The input consists of a line of three integers, N X Y . You may assume 1 ≤ X, Y ≤ N ≤ 106.
输出
The number of distinct paths you can take b

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值