摘要:
Being a programmer, you like arrays a lot. For your birthday, your friends have given you an array a consisting of n distinct integers. Unfortunately, 阅读全文
摘要:
Raju and Meena love to play with Marbles. They have got a lot of marbles with numbers written on them. At the beginning, Raju would place the marbles 阅读全文
摘要:
Contest time again! How excited it is to see balloons floating around. But to tell you a secret, the judges' favorite time is guessing the most popula 阅读全文
摘要:
#include #include #define maxn 3000 int f[maxn]; int main() { int n,i,j; scanf("%d",&n); memset(f, 0, sizeof(f)); f[0] = 1; for( i = 2;i = 0; j--) if(f[j])break; for(... 阅读全文
摘要:
# include int main() { int a,b,c,x,y; printf("请输入两个正整数,用逗号间隔:"); scanf("%d,%d",&a,&b); x=a; y=b; if (ab b=c; } while (b!=0) { c=a; a=b; b=c%b; } c=x*y/a; printf("最大公约数为%d,最小公倍数为%d",a,c); return 0; } ... 阅读全文
摘要:
The SUM problem can be formulated as follows: given four lists A, B, C, D of integer values, compute how many quadruplet (a, b, c, d ) ∈ A x B x C x D 阅读全文
摘要:
在C++ 中 sort函数 sort (起始位置的地址,最后位置的地址 ) 阅读全文
摘要:
Given n points (1 dimensional) and q segments, you have to find the number of points that lie in each of the segments. A point pi will lie in a segmen 阅读全文
摘要:
给定两个正整数a(a>1)和b。可以知道一定存在整数x,使得 x <= logab < x + 1 或者 ax<= b < ax+1 请计算x。 Input两行,第一行是a,第二行是b。每个整数均不超过100位。Output一行,即对应的x。输入数据保证x不大于20。Sample Input Sam 阅读全文
摘要:
Have you ever heard the story of Blue.Mary, the great civil engineer? Unlike Mr. Wolowitz, Dr. Blue.Mary has accomplished many great projects, one of 阅读全文