【HDU5810】Balls and Boxes(数学题)
来源:互联网 发布:怎么开好淘宝店 编辑:程序博客网 时间:2024/05/17 22:00
记录一个菜逼的成长。。
找规律推导
ans = n*(m-1)/m^2;
#include <cstdio>#include <iostream>#include <cstring>#include <string>#include <algorithm>#include <cstdlib>#include <vector>#include <set>#include <map>#include <queue>#include <list>#include <deque>#include <cctype>#include <bitset>#include <cmath>using namespace std;#define ALL(v) (v).begin(),(v).end()#define cl(a) memset(a,0,sizeof(a))typedef long long LL;typedef unsigned long long ULL;typedef pair<int,int> PII;typedef pair<LL,LL> PLL;const int INF = 0x3f3f3f3f;int main(){ LL n,m; while(~scanf("%lld%lld",&n,&m)){ if(!n && !m)break; LL x = n * ( m - 1 ); LL y = m * m; LL gcd = __gcd(x,y); printf("%lld/%lld\n",x/gcd,y/gcd); } return 0;}
0 0
- 【HDU5810】Balls and Boxes(数学题)
- HDU5810 Balls and Boxes
- HDU5810-Balls and Boxes
- hdu5810 Balls and Boxes(数学)
- hdu5810——Balls and Boxes(数学推导)
- HDU5810(2016多校第七场)——Balls and Boxes(组合数学,概率)
- Balls and Boxes
- Boxes and Balls
- Balls and Boxes CodeForces
- Boxes and Balls UVALive
- Boxes And Balls CodeForces
- Boxes and Balls UVALive
- hdu 5810 Balls and Boxes(2016 Multi-University Training Contest 7——数学题)
- hhuoj Boxes and Balls TWT Tokyo Olympic 3 COMBO-1 数学题
- UVALive 7500 Boxes and Balls
- HDU 5810 Balls and Boxes
- hdu 5810 Balls and Boxes
- UVALive-7500-Boxes and Balls
- CodeForces Gym100935 水题专场
- HDUHdu 2602 Bone Collector 01背包
- 安卓项目第一步:viewpager
- dos命令oracle数据库导入导出命令
- 高通手机 进入 高通9008模式
- 【HDU5810】Balls and Boxes(数学题)
- UVa 272 Tex Quotes(TEX中的引号)
- SpringMVC介绍之Validation
- Spring3 MVC 注解(一)---注解基本配置及@controller和 @RequestMapping 常用解释
- 面试算法——双指针的应用
- HTTP消息头详解
- struts2框架内部执行流程
- HDU 5769 Substring(后缀数组)
- 每日一linux命令(48)-------scp命令