제출 #719927

#제출 시각아이디문제언어결과실행 시간메모리
719927joelgun14Gap (APIO16_gap)C++17
컴파일 에러
0 ms0 KiB
#include "gap.h" #include <bits/stdc++.h> #define ll long long using namespace std; long long findGap(int T, int N) { // can call findmax function // let's say range is between 1 to 1e18 // divide n into blocks size n / k if(t == 1) { ll l = 0, r = 1e18; ll a[N]; for(int i = 0; i < N / 2 + N % 2; ++i) { MinMax(l, r, a[i], a[N - i - 1]); l = a[i] + 1, r = a[N - i - 1] - 1; } ll mxdiff = 0; for(int i = 1; i < N; ++i) mxdiff = max(mxdiff, a[i] - a[i - 1]); return mxdiff; } else { // divide N into blocks } return 0; }

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

gap.cpp: In function 'long long int findGap(int, int)':
gap.cpp:11:5: error: 't' was not declared in this scope
   11 |  if(t == 1) {
      |     ^
gap.cpp:15:20: error: invalid conversion from 'long long int' to 'long long int*' [-fpermissive]
   15 |    MinMax(l, r, a[i], a[N - i - 1]);
      |                 ~~~^
      |                    |
      |                    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:15:34: error: invalid conversion from 'long long int' to 'long long int*' [-fpermissive]
   15 |    MinMax(l, r, a[i], a[N - i - 1]);
      |                       ~~~~~~~~~~~^
      |                                  |
      |                                  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*);
      |                                               ^~~~~~~~~~