제출 #1330562

#제출 시각아이디문제언어결과실행 시간메모리
1330562SulA게임 (IOI14_game)C++20
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h>

void init() {}
int c[1500];
int hasEdge(int u, int v) { return ++c[max(u, v)] == max(u, v); }

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

game.cpp: In function 'int hasEdge(int, int)':
game.cpp:5:40: error: 'max' was not declared in this scope
    5 | int hasEdge(int u, int v) { return ++c[max(u, v)] == max(u, v); }
      |                                        ^~~
game.cpp:5:40: note: suggested alternatives:
In file included from /usr/include/c++/13/algorithm:61,
                 from /usr/include/x86_64-linux-gnu/c++/13/bits/stdc++.h:51,
                 from game.cpp:1:
/usr/include/c++/13/bits/stl_algo.h:5805:5: note:   'std::max'
 5805 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
In file included from /usr/include/c++/13/algorithm:63:
/usr/include/c++/13/bits/ranges_algo.h:2928:29: note:   'std::ranges::max'
 2928 |   inline constexpr __max_fn max{};
      |                             ^~~