Submission #433855

#TimeUsernameProblemLanguageResultExecution timeMemory
433855medmdgGame (IOI14_game)C++14
Compilation error
0 ms0 KiB
#include "game.h" #include<bits/stdc++.h> using namespace std; vector<ll> c; vector<bool> vis; ll h=0; void initialize(int n) { for(int i=0;i<n;i++){ c.push_back(0); vis.push_back(false); } } int hasEdge(int u, int v) { h++; if(h==n) return 1; u--; v--; c[u]++; c[v]++; if((c[u]==n&&!vis[u])||c[v]==n&&!vis[v]){ vis[u]=true; vis[v]=true; return 1; } return 0; }

Compilation message (stderr)

game.cpp:4:8: error: 'll' was not declared in this scope
    4 | vector<ll> c;
      |        ^~
game.cpp:4:10: error: template argument 1 is invalid
    4 | vector<ll> c;
      |          ^
game.cpp:4:10: error: template argument 2 is invalid
game.cpp:6:1: error: 'll' does not name a type
    6 | ll h=0;
      | ^~
game.cpp: In function 'void initialize(int)':
game.cpp:9:11: error: request for member 'push_back' in 'c', which is of non-class type 'int'
    9 |         c.push_back(0);
      |           ^~~~~~~~~
game.cpp: In function 'int hasEdge(int, int)':
game.cpp:15:5: error: 'h' was not declared in this scope
   15 |     h++;
      |     ^
game.cpp:16:11: error: 'n' was not declared in this scope
   16 |     if(h==n)    return 1;
      |           ^
game.cpp:19:6: error: invalid types 'int[int]' for array subscript
   19 |     c[u]++;
      |      ^
game.cpp:20:6: error: invalid types 'int[int]' for array subscript
   20 |     c[v]++;
      |      ^
game.cpp:21:10: error: invalid types 'int[int]' for array subscript
   21 |     if((c[u]==n&&!vis[u])||c[v]==n&&!vis[v]){
      |          ^
game.cpp:21:15: error: 'n' was not declared in this scope
   21 |     if((c[u]==n&&!vis[u])||c[v]==n&&!vis[v]){
      |               ^
game.cpp:21:29: error: invalid types 'int[int]' for array subscript
   21 |     if((c[u]==n&&!vis[u])||c[v]==n&&!vis[v]){
      |                             ^