제출 #161150

#제출 시각아이디문제언어결과실행 시간메모리
161150nabilervatra게임 (IOI14_game)C++14
컴파일 에러
0 ms0 KiB
#include "game.h" #include <bits/stdc++.h> using namespace std; int par[1505],o1,akar,n; bool udah[1505][1505],first; int root(int a){ if(par[a]==a)return a; retrun par[a] = root(par[a]); } int merge(int a, int b){ par[root(b)] = root(a); } void initialize(int k) { n =k ; for(int i =0;i<n;i++){ par[i]=i; } first =1; } int hasEdge(int u, int v) { if(first){ first = 0; merge(u,v); akar = u; udah[u][v] =1; udah[v][u] = 1; return 1; } if(root(akar)==root(u)){ for(int i =0;i<n;i++){ if(i!=v){ if(!udah[i][v]&&root(i)==root(akar)){ o1++; } } } udah[u][v]=1; udah[v][u]=1; if(o1==1){ merge(u,v); return 1; } return 0; } o1=0; if(root(akar)==root(v)){ for(int i =0;i<n;i++){ if(i!=u){ if(!udah[i][u]&&root(i)==root(akar)){ o1++; } } } udah[u][v]=1; udah[v][u]=1; if(o1==1){ merge(u,v); return 1; } return 0; } udah[u][v]=1; udah[v][u]=1; return 0; }

컴파일 시 표준 에러 (stderr) 메시지

game.cpp: In function 'int root(int)':
game.cpp:8:2: error: 'retrun' was not declared in this scope
  retrun par[a] = root(par[a]);
  ^~~~~~
game.cpp:8:2: note: suggested alternative: 'setbuf'
  retrun par[a] = root(par[a]);
  ^~~~~~
  setbuf
game.cpp: In function 'int merge(int, int)':
game.cpp:12:1: warning: no return statement in function returning non-void [-Wreturn-type]
 }
 ^
game.cpp: In function 'int root(int)':
game.cpp:9:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^