제출 #960415

#제출 시각아이디문제언어결과실행 시간메모리
960415IUA_Hasin게임 (IOI14_game)C++17
0 / 100
1 ms348 KiB
#include <bits/stdc++.h> #define endl "\n" #define yeap cout<<"YES"<<endl #define nope cout<<"NO"<<endl #define ll long long using namespace std; #include "game.h" const ll N = 1500; ll query[N], deg[N], vis[N]; ll cnt, a; void initialize(int n) { cnt = 0; a = n; for(int i=0; i<N; i++){ query[i]=0; deg[i] = 0; vis[i] = 0; } } int hasEdge(int u, int v) { if(vis[u]==0 && vis[v]==0){ query[u]++; query[v]++; deg[u]++; deg[v]++; vis[u]++; vis[v]++; return 1; } else { if(vis[u]>0 && vis[v]>0){ query[u]++; query[v]++; return 0; } else { if(vis[u]==0){ if(query[u]==a-2){ query[u]++; query[v]++; deg[u]++; deg[v]++; vis[u]++; vis[v]++; return 1; } else { query[u]++; query[v]++; return 0; } } else if(vis[v]==0){ if(query[v]==a-1){ query[u]++; query[v]++; deg[u]++; deg[v]++; vis[u]++; vis[v]++; return 1; } else { query[u]++; query[v]++; return 0; } } } } }

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

game.cpp: In function 'int hasEdge(int, int)':
game.cpp:73:1: warning: control reaches end of non-void function [-Wreturn-type]
   73 | }
      | ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...