제출 #109878

#제출 시각아이디문제언어결과실행 시간메모리
109878dantoh000게임 (IOI14_game)C++14
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> #include "game.h" int ct[1005]; int n; void initialize(int _n) { n = _n; } int hasEdge(int u, int v) { int k = max(u,v); ct[k]++; if (ct[k] == k) return 1; else return 0; }

컴파일 시 표준 에러 (stderr) 메시지

game.cpp: In function 'int hasEdge(int, int)':
game.cpp:9:13: error: 'max' was not declared in this scope
     int k = max(u,v);
             ^~~
game.cpp:9:13: 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:3468:5: note:   'std::max'
     max(initializer_list<_Tp> __l, _Compare __comp)
     ^~~