제출 #464710

#제출 시각아이디문제언어결과실행 시간메모리
464710nickmet2004Gap (APIO16_gap)C++11
컴파일 에러
0 ms0 KiB
#include<bits/stdc++.h> #include "gap.h" #define ll long long using namespace std; ll findGap(int T , int n){ ll ANS = 0; if(T == 1){ ll x = 0 , y = 1e18 , mn , mx ,k; for(int i = 1; i <= (n + 1) /2; ++i){ MinMax(x , 1e18 , mn , mx); if(x) ANS = max(ANS , mn - x + 1); k = mn; MinMax(0 , y , mn , mx); if(y != 1e18) ANS = max(ANS , y - mx + 1); if(i == (n + 1)/2) ANS = max(ANS , mx - k); x = mx + 1; y = mn - 1; } } return ANS; }

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

gap.cpp: In function 'long long int findGap(int, int)':
gap.cpp:11:31: error: invalid conversion from 'long long int' to 'long long int*' [-fpermissive]
   11 |             MinMax(x , 1e18 , mn , mx);
      |                               ^~
      |                               |
      |                               long long int
In file included from gap.cpp:2:
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:11:36: error: invalid conversion from 'long long int' to 'long long int*' [-fpermissive]
   11 |             MinMax(x , 1e18 , mn , mx);
      |                                    ^~
      |                                    |
      |                                    long long int
In file included from gap.cpp:2:
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:14:28: error: invalid conversion from 'long long int' to 'long long int*' [-fpermissive]
   14 |             MinMax(0 , y , mn , mx);
      |                            ^~
      |                            |
      |                            long long int
In file included from gap.cpp:2:
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:14:33: error: invalid conversion from 'long long int' to 'long long int*' [-fpermissive]
   14 |             MinMax(0 , y , mn , mx);
      |                                 ^~
      |                                 |
      |                                 long long int
In file included from gap.cpp:2:
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*);
      |                                               ^~~~~~~~~~