제출 #540514

#제출 시각아이디문제언어결과실행 시간메모리
540514dutinmeowGap (APIO16_gap)C++17
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; #include "gap.h" const long long MAX_A = 1e18; void findGap(int T, int N) { if (T == 1) { long long l = 1, r = MAX_A; vector<long long> A; for (int i = 0; i < (N + 1) / 2; i++) { long long nl, nr; MinMax(l, r, nl, nr); A.push_back(l); A.push_back(r); l = ++nl, r = --nr; } sort(A.begin(), A.end()); long long ans = 0; for (int i = 1; i < N; i++) ans = max(ans, A[i] - A[i - 1]); cout << ans << '\n'; } else { } }

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

gap.cpp: In function 'void findGap(int, int)':
gap.cpp:14:17: error: invalid conversion from 'long long int' to 'long long int*' [-fpermissive]
   14 |    MinMax(l, r, nl, nr);
      |                 ^~
      |                 |
      |                 long long int
In file included from gap.cpp:4:
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:21: error: invalid conversion from 'long long int' to 'long long int*' [-fpermissive]
   14 |    MinMax(l, r, nl, nr);
      |                     ^~
      |                     |
      |                     long long int
In file included from gap.cpp:4:
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*);
      |                                               ^~~~~~~~~~