제출 #1151244

#제출 시각아이디문제언어결과실행 시간메모리
1151244Theo830Gap (APIO16_gap)C++20
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll INF = 1e9+7;
const ll MOD = 998244353;
typedef pair<ll,ll> ii;
#define iii pair<ii,ll>
#define f(i,a,b) for(ll i = a;i < b;i++)
#define pb push_back
#define vll vector<ll>
#define F first
#define S second
#define all(x) (x).begin(), (x).end()
///I hope I will get uprating and don't make mistakes
///I will never stop programming
///sqrt(-1) Love C++
///Please don't hack me
///@TheofanisOrfanou Theo830
///Think different approaches (bs,dp,greedy,graphs,shortest paths,mst)
///Stay Calm
///Look for special cases
///Beware of overflow and array bounds
///Think the problem backwards
///Training
#include "gap.h"
long long findGap(int T, int n){
    ll ans = 1e18;
    vector<ll>arr;
    ll l = 0;
    f(i,0,n){
        ll a,b;
        MinMax(l,l+1,a,b);
        arr.pb(a);
        l = a+1;
    }
    f(i,1,n){
        ans = min(ans,arr[i] - arr[i-1]);
    }
	return ans;
}

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

gap.cpp: In function 'long long int findGap(int, int)':
gap.cpp:32:22: error: invalid conversion from 'll' {aka 'long long int'} to 'long long int*' [-fpermissive]
   32 |         MinMax(l,l+1,a,b);
      |                      ^
      |                      |
      |                      ll {aka long long int}
In file included from gap.cpp:25:
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:32:24: error: invalid conversion from 'll' {aka 'long long int'} to 'long long int*' [-fpermissive]
   32 |         MinMax(l,l+1,a,b);
      |                        ^
      |                        |
      |                        ll {aka long long int}
In file included from gap.cpp:25:
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*);
      |                                               ^~~~~~~~~~