제출 #1289185

#제출 시각아이디문제언어결과실행 시간메모리
1289185muhammad-mutahir게임 (IOI14_game)C++20
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; #include "game.h" void initialize(int ki){ n = ki; map<int,int>cnt; } int hasEdge(int u,int v){ if(u>v)swap(u,v); cnt[u]++; cnt[v]++; // int path = findcnt(u,v); if(cnt[u] == n-1 or cnt[v] == n-1){ return 1; } else{ return 0; } }

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

game.cpp: In function 'void initialize(int)':
game.cpp:6:9: error: 'n' was not declared in this scope; did you mean 'yn'?
    6 |         n = ki;
      |         ^
      |         yn
game.cpp: In function 'int hasEdge(int, int)':
game.cpp:12:9: error: 'cnt' was not declared in this scope; did you mean 'int'?
   12 |         cnt[u]++;
      |         ^~~
      |         int
game.cpp:16:22: error: 'n' was not declared in this scope
   16 |         if(cnt[u] == n-1 or cnt[v] == n-1){
      |                      ^
game.cpp:23:1: warning: control reaches end of non-void function [-Wreturn-type]
   23 | }
      | ^