제출 #629887

#제출 시각아이디문제언어결과실행 시간메모리
629887hy_1Gap (APIO16_gap)C++14
컴파일 에러
0 ms0 KiB
#include "gap.h" #include <algorithm> #include <bitset> #include <complex> #include <deque> #include <exception> #include <fstream> #include <functional> #include <iomanip> #include <ios> #include <iosfwd> #include <iostream> #include <istream> #include <iterator> #include <limits> #include <list> #include <cmath> #include <locale> #include <map> #include <memory> #include <new> #include <numeric> #include <ostream> #include <queue> #include <set> #include <sstream> #include <stack> #include <stdio.h> #include <stdexcept> #include <streambuf> #include <string> #include <typeinfo> #include <utility> #include <valarray> #include <vector> #include <unordered_map> #define ll long long long long findGap(int T, int N){ ll n = N; ll arr[N]; ll mn,mx; for(int i =0; i <= 1e18; i++){ MinMax(i , i , mn , mx); arr[i] = mn; } ll ans = 0; for(int i =0; i<n-1; i++){ ll y = arr[i+1] - arr[i]; ans = max(ans , y); } return ans; }

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

gap.cpp: In function 'long long int findGap(int, int)':
gap.cpp:45:18: error: invalid conversion from 'long long int' to 'long long int*' [-fpermissive]
   45 |   MinMax(i , i , mn , mx);
      |                  ^~
      |                  |
      |                  long long int
In file included from gap.cpp:1:
gap.h:1:35: note:   initializing argument 3 of 'void MinMax(long long int, long long int, long long int*, long long int*)'
    1 | void MinMax(long long, long long, long long*, long long*);
      |                                   ^~~~~~~~~~
gap.cpp:45:23: error: invalid conversion from 'long long int' to 'long long int*' [-fpermissive]
   45 |   MinMax(i , i , mn , mx);
      |                       ^~
      |                       |
      |                       long long int
In file included from gap.cpp:1:
gap.h:1:47: note:   initializing argument 4 of 'void MinMax(long long int, long long int, long long int*, long long int*)'
    1 | void MinMax(long long, long long, long long*, long long*);
      |                                               ^~~~~~~~~~
gap.cpp:52:9: error: 'max' was not declared in this scope; did you mean 'std::max'?
   52 |   ans = max(ans , y);
      |         ^~~
      |         std::max
In file included from /usr/include/c++/10/algorithm:62,
                 from gap.cpp:2:
/usr/include/c++/10/bits/stl_algo.h:3486:5: note: 'std::max' declared here
 3486 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~