Submission #746175

#TimeUsernameProblemLanguageResultExecution timeMemory
746175mnbvcxz123Game (IOI14_game)C++17
Compilation error
0 ms0 KiB
#include<bits/stdc++.h> int n; int g[1505][1505]; struct DSU{ int p[1505]; void init(){memset(p,-1,sizeof(p));} int find(int x){ if(p[x]<0)return x; return p[x]=find(p[x]); } void unite(int a, int b){ a=find(a); b=find(b); if(a==b)return; p[a]+=p[b]; p[b]=a; } int get(int x){return -p[find(x)];} }dsu; void initialize(int N){ n=N; dsu.init(); } int has_Edge(int a, int b){ a=dsu.find(a); b=dsu.find(b); ++g[a][b],++g[b][a]; if(g[a][b]==dsu.get(a)*dsu.get(b)){ dsu.unite(a,b); for(int i=0;i<n;++i){ g[a][i]+=g[b][i]; g[i][a]+=g[i][b]; } return 1; } return 0; }

Compilation message (stderr)

/usr/bin/ld: /tmp/ccbKBUj4.o: in function `main':
grader.cpp:(.text.startup+0x94): undefined reference to `hasEdge(int, int)'
collect2: error: ld returned 1 exit status