HDU 1397 Goldbach's Conjecture
摘要:
这题用素数筛选法。。。。 不过数组要开大点。。。 否则会挂掉去#include<stdio.h>#include<string.h>#define max 1 << 15 + 1int num[max + 5],n;void fun( ){ memset( num,0,sizeof( num ) ); num[0] = num[1] = 1; for( int i = 2; i <= max / 2; ++i ) if( !num[i] ) for( int j = i + i; j <= max; j += i ) num[j] = 1;}in 阅读全文
posted @ 2011-05-23 12:25 LeeBlog 阅读(278) 评论(0) 推荐(0) 编辑