c++题目
cvb00052
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
最小次数(递归)
对于一个整数,有如下操作规则:如果n为偶数,将其除以2;如果n为奇数,可以加1或减1;一直处理下去。那么,最终该数会变为1。例如:当n为7时,可以证明最少需要4次运算n = 7n-1 6n/2 3n-1 2n/2 1最终该数会变为1.现在给出一个整数,求它变为1的最少运算次数。第一次接触递归,从大局来思考递归。#include us原创 2015-12-09 20:31:12 · 724 阅读 · 0 评论 -
hdu 1084 What Is Your Grade?(标记数据)
What Is Your Grade?Problem Description“Point, point, life of student!”This is a ballad(歌谣)well known in colleges, and you must care about your score in this exam too. How many points can y原创 2015-11-25 21:44:06 · 459 阅读 · 0 评论 -
HDU 1722 Cake
题目:http://acm.hdu.edu.cn/showproblem.php?pid=1722可以转换成 一个矩形分同时切成p份或是q份会有多少条线。其中必有gad(p,q)条线重合。以后理解。#include using namespace std;int gcd(int a, int b){ while(b) { int t = a;转载 2015-12-04 21:41:21 · 253 阅读 · 0 评论 -
hdu 2108 Shape of HDU 计算几何(向量的叉积)
Shape of HDUTime Limit : 3000/1000ms (Java/Other) Memory Limit : 32768/32768K (Java/Other)Total Submission(s) : 4 Accepted Submission(s) : 4Problem Description话说上回讲到海东集团推选老总的事情,最终的转载 2015-12-06 16:51:06 · 589 阅读 · 0 评论 -
codevs 1501二叉树最大宽度和高度
地址:http://codevs.cn/problem/1501/第一次接触树。幸好这题的节点都是一定的,不是随便定下来的。(其实上网查了题解才知道理解错题意了。。)所以用深搜来做不用想这么多。不然我暂时也做不了。#include using namespace std;int width[10], tree[20][2];int layernum,原创 2016-07-30 20:12:45 · 431 阅读 · 0 评论
分享