Submission #332029

# Submission time Handle Problem Language Result Execution time Memory
332029 2020-12-01T08:49:32 Z zggf Game (IOI14_game) C++14
Compilation error
0 ms 0 KB
#include "game.h"
vector<int> tab;
void initialize(int n) {
    tab.resize(n+1, n-1);
}

int hasEdge(int u, int v) {
        tab[u]--;
        tab[v]--;
        if(tab[u]==0||tab[v]==0) {tab[u]=-1; tab[v]=-1; return 1;}
        return 0;
}

Compilation message

game.cpp:2:1: error: 'vector' does not name a type
    2 | vector<int> tab;
      | ^~~~~~
game.cpp: In function 'void initialize(int)':
game.cpp:4:5: error: 'tab' was not declared in this scope
    4 |     tab.resize(n+1, n-1);
      |     ^~~
game.cpp: In function 'int hasEdge(int, int)':
game.cpp:8:9: error: 'tab' was not declared in this scope
    8 |         tab[u]--;
      |         ^~~