제출 #262372

#제출 시각아이디문제언어결과실행 시간메모리
262372my99nGap (APIO16_gap)C++14
컴파일 에러
0 ms0 KiB
#include "gap.h" #include <bits/stdc++.h> using namespace std; vector<long long> a; long long findarr (long long low, long long high) { long long mnl, mxl, mnr, mxr; int mid = (low+high)/2; MinMax(low, low, mnl, mxl); MinMax(mid+1, high, mnr, mxr); if (mnl != -1) { a.push_back(mnl); a.push_back(mxl); } if (mnr != -1) { a.push_back(mnr); a.push_back(mxr); } if (mnl != mxl) findarr(mnl+1, mxl-1); if (mnr != mxr) findarr(mnr+1, mxr-1); } long long findGap(int T, int N) { if (T == 1) { long long mn, mx; long long l = 0, r = 1e18; while (true) { MinMax(l, r, mn, mx); if (mn != -1) {; a.push_back(mn); a.push_back(mx); } if (mn == mx) break; l = mn+1; r = mx-1; } } else { findarr(0, 1e18); } long long ans = 0; sort(a.begin(), a.end()); for (int i = 1; i < N; i++) { ans = max(ans, a[i]-a[i-1]); } return ans; }

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

gap.cpp: In function 'long long int findarr(long long int, long long int)':
gap.cpp:9:20: error: invalid conversion from 'long long int' to 'long long int*' [-fpermissive]
    9 |   MinMax(low, low, mnl, mxl);
      |                    ^~~
      |                    |
      |                    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:9:25: error: invalid conversion from 'long long int' to 'long long int*' [-fpermissive]
    9 |   MinMax(low, low, mnl, mxl);
      |                         ^~~
      |                         |
      |                         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:10:23: error: invalid conversion from 'long long int' to 'long long int*' [-fpermissive]
   10 |   MinMax(mid+1, high, mnr, mxr);
      |                       ^~~
      |                       |
      |                       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:10:28: error: invalid conversion from 'long long int' to 'long long int*' [-fpermissive]
   10 |   MinMax(mid+1, high, mnr, mxr);
      |                            ^~~
      |                            |
      |                            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:21:1: warning: no return statement in function returning non-void [-Wreturn-type]
   21 | }
      | ^
gap.cpp: In function 'long long int findGap(int, int)':
gap.cpp:28:20: error: invalid conversion from 'long long int' to 'long long int*' [-fpermissive]
   28 |       MinMax(l, r, 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:28:24: error: invalid conversion from 'long long int' to 'long long int*' [-fpermissive]
   28 |       MinMax(l, r, 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*);
      |                                               ^~~~~~~~~~