제출 #370894

#제출 시각아이디문제언어결과실행 시간메모리
370894Fysty게임 (IOI14_game)C++17
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> #define rep(i,n) for(int i=0;i<n;i++) #define rep1(i,n) for(int i=1;i<=n;i++) #define F first #define S second #define pb push_back int N,d[1505],cnt=0; void initializer(int n) { N=n; } int hasEdge(int u,int v) { if(d[u]==n-1||d[v]==n-1) { d[u]++,d[v]++; return 1; } else if(cnt==n*(n-1)/2-(n-1)) { d[u]++,d[v]++; return 1; } else { cnt++; return 0; } }

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

game.cpp: In function 'int hasEdge(int, int)':
game.cpp:14:14: error: 'n' was not declared in this scope
   14 |     if(d[u]==n-1||d[v]==n-1)
      |              ^
game.cpp:29:1: warning: control reaches end of non-void function [-Wreturn-type]
   29 | }
      | ^