09 2017 档案
摘要:#include #include #include using namespace std; int n,m,p[1010],t,cnt,ans,sum; struct edge{int u,v,w;}e[100010]; bool cmp(edge x,edge y){return x.w<y.w;} int find(int x){return x==p[x]?x:p[x]=fi...
阅读全文
摘要:#include #include #include #include using namespace std; const int N=5010; const int INF=1<<30; int n,x[N],y[N],vis[N]; double ans,d[N]; double dist(int a,int b){ double dx=abs(x[a]-x[b]),dy=ab...
阅读全文
摘要:#include #include #include using namespace std; const int N=310; const int M=50010; struct edge{int u,v,w;}a[M]; int n,m,p[N],cnt,minn; int cmp(edge x,edge y){return x.w<y.w;} int find(int x){re...
阅读全文
摘要:#include #include #include #include #include #include using namespace std; int n,m,d[70][70]; bool G[70][70][70]; int read(){ char c; int x=0; c=getchar(); while(c=48){ x=x...
阅读全文
摘要:#include #include #include #include #include using namespace std; const int N=1010; int n,m,link[N],e; bool vis[N]; vector G[N]; bool can(int u){ for(int i=0;i<G[u].size();i++){ int v=G[u][i...
阅读全文
摘要:#include using namespace std; const int N=100010; int n,m,sum,dfs_clock; vector G[N]; int pre[N],low[N],iscut[N]; int dfs(int u,int fa){ int lowu=pre[u]=++dfs_clock; int child=0; for(int i=0;i=p...
阅读全文
摘要:#include #include using namespace std; const int N=10010; int n,a[N],b[N],sum;//1 有雷 0 无雷 inline int read(){ char c; int x=0; while(c=48){ x=x*10+c-'0'; c=getchar(); } return x; } int ma...
阅读全文
摘要:#include #include #include #include using namespace std; const int N=210; const int M=N*N/2; const int INF=1nt || t[end]>nt || d[beg][end]==INF)puts("-1"); else printf("%d\n",d[beg][end]); } ...
阅读全文
摘要://结构体函数版:
阅读全文
摘要:#include #include #include #include using namespace std; typedef long long LL; const LL Mod=1e9+7; int n; LL k; struct Matrix{ static const int N=101; int n; LL h[N][N]; void clear(in...
阅读全文
摘要:#include #include #include using namespace std; const int maxn=110; const int INF=1 q; vector G[maxn]; bool vis[maxn]; void spfa(){ for(int i=1;id[u]+k){ d[v]=d[u]+k; if(!vis[v]){q.push(...
阅读全文
摘要:#include #include #include #include #include using namespace std; const int maxn=10010; const int maxm=50010; const int INF=1 G[maxm]; queue q; bool spfa(int x){ memset(vis,0,sizeof(vis)); fo...
阅读全文
摘要:#include #include #include using namespace std; const int maxn=6210; const int INF=1 q; vector G[maxn]; void spfa(){ for(int i=1;i<=n;i++)d[i]=INF; q.push(s); d[s]=0; vis[s]=1; while(!q.empty(...
阅读全文
摘要:#include #include #include #include #include using namespace std; int n,ans[100010],cnt,in[60]; vector G[60]; bool vis[60],answer,dis[60][60],oula; char word[]={'A','B','C','D','E','F','G','H','...
阅读全文
摘要:#include #include #include using namespace std; const int maxn=100010; int n,m,sum,sum1,sum2; vector G[maxn]; int color[maxn],color2[maxn]; bool dfs(int u){ for(int i=0;i<G[u].size();i++){ ...
阅读全文
摘要:1 #include 2 using namespace std; 3 int n,m,cnt,prime[10000010],noprime[10000010]; 4 5 int main(){ 6 scanf("%d%d",&n,&m); 7 prime[1]=2; 8 noprime[1]=1; 9 for(int i=2;i<=n;i+...
阅读全文
摘要:#include using namespace std; int m,s,t,T,now,run,ans=99999999,k,maxn; int main(){ int i; scanf("%d%d%d",&m,&s,&t); while(now=t)break; if(runmaxn)maxn=run; if(run>=s){ ...
阅读全文
摘要:#include #include #include using namespace std; const int maxn=800+1; const int mod=1000000007; int dp[maxn][maxn][16][2],a[maxn][maxn],n, m, k; int main(){ scanf("%d%d%d",&n,&m,&k); k++;...
阅读全文
摘要:source $VIMRUNTIME/vimrc_example.vim source $VIMRUNTIME/mswin.vim behave mswin inoremap F( ()i inoremap f[ []i inoremap F{ {}O inoremap ii set softtabstop=4 set shiftwidth=4 set autoindent set cin...
阅读全文
摘要:#include<bits/stdc++.h> using namespace std; string a,b; int n; void dfs(int l,int r){ int now=0; for(int i=n-1;i>=0;i--)if(!now) for(int j=l;j<=r;j++
阅读全文
摘要:#include<bits/stdc++.h> using namespace std; int n; char a[100000]; void make(){ for(int i=n-1;i;i--){ if(a[i*2]=='B' && a[i*2+1]=='B')a[i]='B'; else
阅读全文
摘要:#include<bits/stdc++.h> using namespace std; #define MAXM 500010 #define MAXN 5010 #define INF 100000000 struct Edge{int from,to,cap,flow,cost;}; int
阅读全文
摘要:#include<bits/stdc++.h> using namespace std; #define MAXN 100010 #define INF 100000000 struct Edge{int from,to,cap,flow;}; vector<Edge> edges; vector<
阅读全文
摘要:#include<bits/stdc++.h> using namespace std; struct point{int x,y;}ans[100000]; int a[20][20],n,m,sx,sy,tx,ty,cnt=1; int dx[]={0,-1,0,1}; int dy[]={-1
阅读全文

浙公网安备 33010602011771号