H1N1 like to solve acm problems.But they are very busy, one day they meet a problem. Given three intergers a,b,c, the task is to compute a^(b^c))%3170 Read More
void getprim(){ check[1] = 1; int sum = 0,i,j; for(i = 2;i <= n; i++) { if(!check[i]) primer[sum++] = i; for(j = 0;j < sum;j ++)/* 1 */ { if(i*primer[ Read More
Farmer John and Betsy are playing a game with N (1 <= N <= 30,000)identical cubes labeled 1 through N. They start with N stacks, each containing a sin Read More