Sicily 1634. Relax! It's just a game
来源:互联网 发布:sgd算法 编辑:程序博客网 时间:2024/06/07 16:34
http://soj.me/1634
一看题目这么长就不想看,乍看数据还差点以为真的直接做加法...o(╯□╰)o 但看提交和通过的比例就知道不对,还是老老实实看一遍吧。。。
这道题应该用组合数学的
但我直接用深搜了事
#include <iostream>#include <cstring>using namespace std;int ans;void dfs(int a, int b){if(a == 0 || b == 0){ans ++;return ;}dfs(a-1,b);dfs(a,b-1);}int main(){int n,m;while(cin>>n>>m && n != -1){ans = 0;dfs(n,m);if(ans == n+m)cout<<n<<'+'<<m<<'='<<ans<<endl;else cout<<n<<'+'<<m<<"!="<<n+m<<endl;}return 0;}
- Sicily 1634. Relax! It's just a game
- 1634. Relax! It's just a game
- Relax! It’s just a game HDU
- Relax! It's just a game(排列组合,简单)
- hdu 2922 Relax! It’s just a game
- It's just a test!
- It‘s just a begining
- relax ,just relax.......
- Sicily 1889. Max’s game
- sicily--1087. A Funny Game
- [sicily online1087. A Funny Game
- sicily 1087. A Funny Game
- sicily 1087 A Funny Game
- Sicily 1087. A Funny Game
- [sicily]1087. A Funny Game
- It is just a test
- It is just a test.
- Sicily 1087. A Funny Game[博弈]
- Xcode中显示Line Numbers行号
- jdk tomcat myeclipse 配置
- 我的Python小技巧
- Android中EditText属性
- 回调函数和函数指针
- Sicily 1634. Relax! It's just a game
- 查询一个数据库中的所有表
- KVM-QEMU vdagent实现机制分析(二)
- Android程序对不同手机屏幕分辨率自适应的总结
- API编程感悟
- HDOJBone Collector II
- Freemarker - 几个比较实用的例子
- ISO3834国际焊接认证简介
- C64+ cache资料集(更新中)