摘要:
http://acm.hdu.edu.cn/showproblem.php?pid=1874View Code #include<iostream>#define _max 9999999#define M 201using namespace std;int map[M][M];int visit[M];int dir[M];int n , m ;int a , b , c ;int len;void Init(int n){ int i,j; for(i = 0 ; i <n ; i++) { for(j=0 ; j <n; j++) map[i][j] = _ma 阅读全文
摘要:
View Code #include<iostream>#include<cstring>using namespace std;typedef long long ll;int p[100001] , tem[100001] ,t;void Init(){ memset(p,0,sizeof(p)); for(ll i=2; i<=100000; i++) { if( !p[i] ) { for( ll j = 2 ; j*i<=100000 ; j++ ) p[j*i]=1; } } t=0; for(int i=2;i<1000000;i++) 阅读全文