Submission #381609

# Submission time Handle Problem Language Result Execution time Memory
381609 2021-03-25T10:56:18 Z strawberry2005 Game (IOI14_game) C++14
Compilation error
0 ms 0 KB
#include "game.h"
#include<bits/stdc++.h>

void initialize(int n) {

}
vector<int> cnt(1501);
int hasEdge(int u, int v) {
	cnt[max(u,v)]++;
	if(cnt[max(u,v)]==max(u,v)) return 1;
    return(0);
}

Compilation message

game.cpp:7:1: error: 'vector' does not name a type
    7 | vector<int> cnt(1501);
      | ^~~~~~
game.cpp: In function 'int hasEdge(int, int)':
game.cpp:9:2: error: 'cnt' was not declared in this scope; did you mean 'int'?
    9 |  cnt[max(u,v)]++;
      |  ^~~
      |  int
game.cpp:9:6: error: 'max' was not declared in this scope; did you mean 'std::max'?
    9 |  cnt[max(u,v)]++;
      |      ^~~
      |      std::max
In file included from /usr/include/c++/9/algorithm:62,
                 from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:65,
                 from game.cpp:2:
/usr/include/c++/9/bits/stl_algo.h:3462:5: note: 'std::max' declared here
 3462 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~