上一页 1 2 3 4 5 6 7 ··· 19 下一页
摘要: Problem Descriptionthe second year of the university somebody started a study on the romantic relations between the students. The relation “romantically involved” is defined between one girl and one boy. For the study reasons it is necessary to find out the maximum set satisfying the condition: ther 阅读全文
posted @ 2013-09-18 17:48 forevermemory 阅读(276) 评论(0) 推荐(0) 编辑
摘要: Problem DescriptionJason买来了n米长的竹篱笆,打算将n米长的竹篱笆全部用来围成一个三角形的养鸡场。为方便起见,养鸡场三条边的长度都为正整数。同时,他想让自己的养鸡场看起来更美观一些,要求三条边的长度分别在一个区间范围内。现在,他想知道有多少种不同的方案使得围成的养鸡场满足要求? Input输入包含多组数据。输入数据第一行是一个正整数n,表示竹篱笆的长度。在接下来三行中,第i行的两个正整数为xi,yi。表示三角形的第i条边的边长ai的范围在[xi,yi]内。注意:Jason规定a1≤a2≤a3。 Output输出一个整数,表示满足要求的不同方案数。约定:对于第二行至第四行 阅读全文
posted @ 2013-09-18 10:46 forevermemory 阅读(199) 评论(0) 推荐(0) 编辑
摘要: Problem Description现在有一个等式如下:x^2+s(x,m)x-n=0。其中s(x,m)表示把x写成m进制时,每个位数相加的和。现在,在给定n,m的情况下,求出满足等式的最小的正整数x。如果不存在,请输出-1。 Input有T组测试数据。以下有T(T#include#includeusing namespace std;#define ll __int64ll lmx(int x,int m){ll temp=x,sum=0;while(temp){ sum+=temp%m; temp/=m;}return sum;}int main(){ int test;ll n,m,x 阅读全文
posted @ 2013-09-17 20:27 forevermemory 阅读(177) 评论(0) 推荐(0) 编辑
摘要: Problem Description某省调查乡村交通状况,得到的统计表中列出了任意两村庄间的距离。省政府“畅通工程”的目标是使全省任何两个村庄间都可以实现公路交通(但不一定有直接的公路相连,只要能间接通过公路可达即可),并要求铺设的公路总长度为最小。请计算最小的公路总长度。Input测试输入包含若干测试用例。每个测试用例的第1行给出村庄数目N ( #include#include#includeusing namespace std;int p[105],n,sum;void init(){int i;for(i=1;i<=n;i++) p[i]=i;}int find(int x){ 阅读全文
posted @ 2013-09-16 16:39 forevermemory 阅读(123) 评论(0) 推荐(0) 编辑
摘要: Problem DescriptionThere was no donkey in the province of Gui Zhou, China. A trouble maker shipped one and put it in the forest which could be considered as an N×N grid. The coordinates of the up-left cell is (0,0) , the down-right cell is (N-1,N-1) and the cell below the up-left cell is (1,0). 阅读全文
posted @ 2013-09-16 10:11 forevermemory 阅读(438) 评论(0) 推荐(0) 编辑
摘要: Problem DescriptionIn the ancient three kingdom period, Zhuge Liang was the most famous and smartest military leader. His enemy was Shima Yi, who always looked stupid when fighting against Zhuge Liang. But it was Shima Yi who laughed to the end. Once, Zhuge Liang sent the arrogant Ma Shu to defend J 阅读全文
posted @ 2013-09-16 00:56 forevermemory 阅读(477) 评论(0) 推荐(0) 编辑
摘要: Problem DescriptionThere are n numbers in a array, as a0, a1 ... , an-1, and another number m. We define a function f(i, j) = ai|ai+1|ai+2| ... | aj . Where "|" is the bit-OR operation. (i int p[100005];int main(){ int test,n,i,ca=0,j,m;scanf("%d",&test);while(test--){ca++;in 阅读全文
posted @ 2013-09-15 10:25 forevermemory 阅读(262) 评论(0) 推荐(0) 编辑
摘要: Problem DescriptionThere are N points in total. Every point moves in certain direction and certain speed. We want to know at what time that the largest distance between any two points would be minimum. And also, we require you to calculate that minimum distance. We guarantee that no two points will 阅读全文
posted @ 2013-09-13 13:25 forevermemory 阅读(280) 评论(0) 推荐(0) 编辑
摘要: Problem DescriptionThree wizards are doing a experiment. To avoid from bothering, a special magic is set around them. The magic forms a circle, which covers those three wizards, in other words, all of them are inside or on the border of the circle. And due to save the magic power, circle's area 阅读全文
posted @ 2013-09-13 00:08 forevermemory 阅读(373) 评论(0) 推荐(0) 编辑
摘要: Problem DescriptionIf we sum up every digit of a number and the result can be exactly divided by 10, we say this number is a good number.You are required to count the number of good numbers in the range from A to B, inclusive.InputThe first line has a number T (T #include#define ll __int64using name 阅读全文
posted @ 2013-09-12 20:35 forevermemory 阅读(442) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 ··· 19 下一页