上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 18 下一页

2015年10月17日

判断圆和矩形是否相交C - Rectangle and Circle

摘要: DescriptionGiven a rectangle and a circle in the coordinate system(two edges of the rectangle are parallel with the X-axis, and the other two are para... 阅读全文

posted @ 2015-10-17 21:32 张明明_1 阅读(2106) 评论(0) 推荐(0)

转化为用欧几里得算法判断互质的问题D - Wolf and Rabbit

摘要: DescriptionThere is a hill with n holes around. The holes are signed from 0 to n-1.A rabbit must hide in one of the holes. A wolf searches the rabbit ... 阅读全文

posted @ 2015-10-17 20:34 张明明_1 阅读(318) 评论(0) 推荐(0)

(记录前面算过的后面仍然会用的数减小复杂度)A - AC Me

摘要: DescriptionIgnatius is doing his homework now. The teacher gives him some articles and asks him to tell how many times each letter appears.It's really... 阅读全文

posted @ 2015-10-17 20:32 张明明_1 阅读(226) 评论(0) 推荐(0)

扩展欧几里德算法解二元一次方程之B - 青蛙的约会

摘要: Description两只青蛙在网上相识了,它们聊得很开心,于是觉得很有必要见一面。它们很高兴地发现它们住在同一条纬度线上,于是它们约定各自朝西跳,直到碰面为止。可是它们出发之前忘记了一件很重要的事情,既没有问清楚对方的特征,也没有约定见面的具体位置。不过青蛙们都是很乐观的,它们觉得只要一直朝着某个... 阅读全文

posted @ 2015-10-17 12:38 张明明_1 阅读(824) 评论(0) 推荐(0)

2015年10月16日

欧拉函数K - Relatives

摘要: 欧拉函数是积性函数——若m,n互质,φ(mn)=φ(m)φ(n)。特殊性质:当n为奇数时,φ(2n)=φ(n),φ(x)=x(1-1/p1)(1-1/p2)(1-1/p3)(1-1/p4)…..(1-1/pn),其中p1,p2,p3,p4,……pn为x的所有质因数,原因:如果x = p^k,那么p的... 阅读全文

posted @ 2015-10-16 19:31 张明明_1 阅读(232) 评论(0) 推荐(0)

E - Fibonacci Again(找规律)

摘要: 逐渐发现找规律的美妙之处啦,真不错,用普通方法解决很久或者很麻烦的问题,找到规律就很方便,算法最主要还是思想DescriptionThere are another kind of Fibonacci numbers: F(0) = 7, F(1) = 11, F(n) = F(n-1) + F(n... 阅读全文

posted @ 2015-10-16 15:33 张明明_1 阅读(319) 评论(0) 推荐(0)

K - K.Bro Sorting

摘要: DescriptionMatt’s friend K.Bro is an ACMer.Yesterday, K.Bro learnt an algorithm: Bubble sort. Bubble sort will compare each pair of adjacent items and... 阅读全文

posted @ 2015-10-16 13:34 张明明_1 阅读(456) 评论(0) 推荐(0)

2015年10月15日

运算符的重载

摘要: #include using namespace std;class num{public: num(){n = 1;} ~num(){} int get()const{return n;} void set(int i){n = i;} void operator++... 阅读全文

posted @ 2015-10-15 18:59 张明明_1 阅读(182) 评论(0) 推荐(0)

2015年10月14日

C - Virtual Friends

摘要: 网上搜了,好多c++里的东西啊有思路不会做,真烦,还是好好学c++;先把题和代码粘过来,过几天学c++好了再看http://acm.hust.edu.cn/vjudge/contest/view.action?cid=94494#problem/C#include #include #include... 阅读全文

posted @ 2015-10-14 20:40 张明明_1 阅读(216) 评论(0) 推荐(0)

判断是否是树(Is It A Tree?)

摘要: DescriptionA tree is a well-known data structure that is either empty (null, void, nothing) or is a set of one or more nodes connected by directed edg... 阅读全文

posted @ 2015-10-14 19:00 张明明_1 阅读(601) 评论(0) 推荐(0)

上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 18 下一页

导航