답안 #62398

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
62398 2018-07-28T10:39:45 Z evpipis 게임 (IOI14_game) C++11
컴파일 오류
0 ms 0 KB
#include "game.h"
#include <bits/stdc++.h>

const int len = 1505;
int cnt[len];

void initialize(int n){
    for (int i = 0; i < n; i++)
        cnt[i] = i;
}

int hasEdge(int u, int v){
    cnt[max(v, u)]--;
    return (cnt[max(v, u)] == 0);
}

Compilation message

game.cpp: In function 'int hasEdge(int, int)':
game.cpp:13:9: error: 'max' was not declared in this scope
     cnt[max(v, u)]--;
         ^~~
game.cpp:13:9: 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:2:
/usr/include/c++/7/bits/stl_algo.h:3468:5: note:   'std::max'
     max(initializer_list<_Tp> __l, _Compare __comp)
     ^~~