Submission #221477

#TimeUsernameProblemLanguageResultExecution timeMemory
221477staniewzkiGame (IOI14_game)C++14
Compilation error
0 ms0 KiB
#include<bits/stdc++.h> vector<int> cnt; void initialize(int n) { cnt.resize(n); } int hasEdge(int u, int v) { int x = min(u, v); return (++cnt[x] == n - x); }

Compilation message (stderr)

game.cpp:3:1: error: 'vector' does not name a type; did you mean 'wctob'?
 vector<int> cnt;
 ^~~~~~
 wctob
game.cpp: In function 'void initialize(int)':
game.cpp:5:2: error: 'cnt' was not declared in this scope
  cnt.resize(n); 
  ^~~
game.cpp:5:2: note: suggested alternative: 'int'
  cnt.resize(n); 
  ^~~
  int
game.cpp: In function 'int hasEdge(int, int)':
game.cpp:9:10: error: 'min' was not declared in this scope
  int x = min(u, v);
          ^~~
game.cpp:9:10: note: suggested alternative:
In file included from /usr/include/c++/7/algorithm:62:0,
                 from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:65,
                 from game.cpp:1:
/usr/include/c++/7/bits/stl_algo.h:3456:5: note:   'std::min'
     min(initializer_list<_Tp> __l, _Compare __comp)
     ^~~
game.cpp:10:12: error: 'cnt' was not declared in this scope
  return (++cnt[x] == n - x);
            ^~~
game.cpp:10:12: note: suggested alternative: 'int'
  return (++cnt[x] == n - x);
            ^~~
            int
game.cpp:10:22: error: 'n' was not declared in this scope
  return (++cnt[x] == n - x);
                      ^