Submission #2694

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
26942013-07-30 15:28:01ainta간선 파괴 (GA5_destroy)C++98
100 / 100
1944 ms2060 KiB
#include<stdio.h>
int n,m,b[700],e[700],Q,p[700],c;
struct Edge{
int a,b;
}E[123457];
void init(){
int i;
for(i=1;i<=n;i++)p[i]=i;
}
int find(int a){
if(a==p[a])return a;
return p[a]=find(p[a]);
}
int main(){
int i,j,x,y,R,bb,ee;
scanf("%d%d",&n,&m);
init();
for(i=0;i<m;i++){
scanf("%d%d",&E[i].a,&E[i].b);
x=find(E[i].a),y=find(E[i].b);
if(x!=y){
p[x]=y;
b[c++]=i;
}
}
init();
c=0;
for(i=m-1;i>=0;i--){
x=find(E[i].a),y=find(E[i].b);
if(x!=y){
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...