제출 #636785

#제출 시각아이디문제언어결과실행 시간메모리
636785lovrotGap (APIO16_gap)C++11
컴파일 에러
0 ms0 KiB
#include "gap.h" #include <bits/stdc++.h> #define ll long long using namespace std; const ll INF = 1e18; const int N = 3 * 1e5 + 10; ll niz[N]; ll findGap(int t, int n){ int minp = 0; int maxp = n - 1; ll mn = 0, minr; ll mx = INF, maxr; while(minp <= maxp){ MinMax(mn, mx, minr, maxr); niz[minp] = minr; niz[maxp] = maxr; mn = minr + 1; mx = maxr - 1; minp++; maxp--; } ll ans = 0; for(int i = 0; i < n - 1; i++) ans = max(ans, niz[i + 1] - niz[i]); return ans; }

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

gap.cpp: In function 'long long int findGap(int, int)':
gap.cpp:19:18: error: invalid conversion from 'long long int' to 'long long int*' [-fpermissive]
   19 |   MinMax(mn, mx, minr, maxr);
      |                  ^~~~
      |                  |
      |                  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:19:24: error: invalid conversion from 'long long int' to 'long long int*' [-fpermissive]
   19 |   MinMax(mn, mx, minr, maxr);
      |                        ^~~~
      |                        |
      |                        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*);
      |                                               ^~~~~~~~~~