cuts专题

hdu-2134-Cuts the cake

#include<stdio.h> #include<math.h> #define m 3.14 int main() {  int n;  double x,y=0;  while(scanf("%d",&n)&&n!=0)  {   x=sqrt(m*n*n/(3*m));   y=sqrt(2*m*x*x/m);   printf("%.3lf

POJ 1095 Prime Cuts 素数

题解: #include<cstdio>#include<cstring>using namespace std;const int MAX = 2000;int p[MAX], a[MAX], pn;;void prime (){int i, j;memset(a,0,sizeof(a));p[1] = 1; pn = 1;for ( i = 2; i < MAX; i++ ){i

poj1595 prime cuts(快速筛选)

题意:  给定一个数字N,将1到N中的所有质数按照中心值为c的规定输出,规则详见题目。 本题不难,但是要注意这里1也算是素数列中的一员。其它的都是小事儿啦,用快速筛选找到1--1000内所有的素数和合数。然后A了。 #include <iostream>#include<cstdio>using namespace std;bool notpri[1001];int prime[1