# bzoj3275: Number

#include<cstdio>
#include<cstring>
#include<iostream>
#include<cmath>
#include<algorithm>
using namespace std;
#define rep(i,n) for(int i=1;i<=n;i++)
#define clr(x,c) memset(x,c,sizeof(x))
#define REP(i,s,t) for(int i=s;i<=t;i++)
int x=0;char c=getchar();bool f=true;
while(!isdigit(c)) {
if(c=='-') f=false;c=getchar();
}
while(isdigit(c)) x=x*10+c-'0',c=getchar();
return x;
}
const int nmax=3005;
const int maxn=6000005;
const int inf=0x7f7f7f7f;
struct edge{
int to,cap;edge *next,*rev;
};
int cnt[nmax],h[nmax],g[nmax];
}
}
int maxflow(int s,int t,int n){
clr(cnt,0);cnt[0]=n;clr(h,0);
int flow=0,a=inf,x=s;edge *e;
while(h[s]<n){
for(e=cur[x];e;e=e->next) if(e->cap>0&&h[x]==h[e->to]+1) break;
if(e){
a=min(a,e->cap);p[e->to]=cur[x]=e;x=e->to;
if(x==t){
while(x!=s) p[x]->cap-=a,p[x]->rev->cap+=a,x=p[x]->rev->to;
flow+=a,a=inf;
}
}else{
if(!--cnt[h[x]]) break;
h[x]=n;
h[x]=h[e->to]+1,cur[x]=e;
cnt[h[x]]++;
if(x!=s) x=p[x]->rev->to;
}
}
return flow;
}
int gcd(int x,int y){
return y==0?x:gcd(y,x%y);
}
bool check(int x,int y){
if(gcd(x,y)!=1) return false;
int tmp=x*x+y*y,temp=sqrt(tmp);
if(temp*temp==tmp) return true;
return false;
}
int main(){
op();
rep(i,n){
}
rep(i,n) if(g[i]%2) rep(j,n) if(!(g[j]%2))
/*REP(i,s,t) {
qwq(i) printf("%d ",o->to);printf("\n");
}*/
printf("%d\n",ans-maxflow(s,t,t+1));
return 0;
}


## 3275: Number

Time Limit: 10 Sec  Memory Limit: 128 MB
Submit: 778  Solved: 329
[Submit][Status][Discuss]

## Description

1:存在正整数C，使a*a+b*b=c*c
2:gcd(a,b)=1

5
3 4 5 6 7

22

n<=3000。

## Source

[Submit][Status][Discuss]
posted @ 2016-07-13 11:15  BBChq  阅读(107)  评论(0编辑  收藏  举报