제출 #309051

#제출 시각아이디문제언어결과실행 시간메모리
309051mohamedsobhi777게임 (IOI14_game)C++14
컴파일 에러
0 ms0 KiB
#include<bits/stdc++.h>
#include "game.h"

const int MX = 1600 + 7 ; 
int gn ; 
bool del[MX][MX] ;
int viz[MX] ;
int Cnt = 0 ; 
set<int> adz[N] ; 

void initialize(int x) {
        gn = x; 
        for(int i = 0 ;i < x ; ++ i){
                for(int j = 0 ;j < x ; ++ j){
                        if(i != j){
                                adz[i].insert(j) ; 
                        }
                }
        }
}

void dfz(int x , int p){

        if(viz[x]++)
                return ; 

        for(auto u : adz[x]){
                if(u == p)
                        continue ; 
                dfz(u , x) ;
        }
}

int count(){
        Cnt = 0 ; 
        memset(viz , 0 , sizeof viz) ; 
        for(int i = 0 ; i < gn; ++ i){
                if(!viz[i]){
                        ++ Cnt ; 
                }
                dfz(i , i) ; 
        }
        return Cnt ; 
}

int hasEdge(int u, int v) {
        adz[u].erase(v) ; 
        adz[v].erase(u) ; 
        if(count() == 1){
                return 0 ; 
        }
        adz[u].insert(v) ; 
        adz[v].insert(u) ; 
        return 1 ; 
}

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

game.cpp:9:1: error: 'set' does not name a type
    9 | set<int> adz[N] ;
      | ^~~
game.cpp: In function 'void initialize(int)':
game.cpp:16:33: error: 'adz' was not declared in this scope
   16 |                                 adz[i].insert(j) ;
      |                                 ^~~
game.cpp: In function 'void dfz(int, int)':
game.cpp:27:22: error: 'adz' was not declared in this scope
   27 |         for(auto u : adz[x]){
      |                      ^~~
game.cpp: In function 'int hasEdge(int, int)':
game.cpp:47:9: error: 'adz' was not declared in this scope
   47 |         adz[u].erase(v) ;
      |         ^~~