Submission #736602

#TimeUsernameProblemLanguageResultExecution timeMemory
736602ngano_upat_naGame (IOI14_game)C++17
Compilation error
0 ms0 KiB
#include "bits/stdc++.h" #include "game.h" using namespace std; int ct, N; vector<pair<int,int>> v; void initialize(int n) { ct = n * (n - 1) / 2; N = n; for (int i=0; i<n-2; i++) { v.push_back({i,i+1}); } } int hasEdge(int u, int v) { int U = min(u,v), V = max(u,v); ct--; if (binary_search(v.begin(),v.end(),{U,V}) || ct == 0) { return 1; } return 0; }

Compilation message (stderr)

game.cpp: In function 'int hasEdge(int, int)':
game.cpp:20:25: error: request for member 'begin' in 'v', which is of non-class type 'int'
   20 |     if (binary_search(v.begin(),v.end(),{U,V}) || ct == 0) {
      |                         ^~~~~
game.cpp:20:35: error: request for member 'end' in 'v', which is of non-class type 'int'
   20 |     if (binary_search(v.begin(),v.end(),{U,V}) || ct == 0) {
      |                                   ^~~