摘要:
#include #include using namespace std; const int N=1000000; int p[N],n,m,nop[N],cnt,sum,ans[N]; int main(){ scanf("%d%d",&n,&m); nop[1]=1; for(int i=2;im){puts("Crossing the line"); co... 阅读全文
摘要:
#include #include #include using namespace std; const int N=30; int n,s1[4][N],num[N]; char s[4][N]; bool vis[N]; void dfs(int x,int y,int t){ if(x==0){ if(t==0){ for(int ... 阅读全文
摘要:
#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]); } ... 阅读全文