Submission #882300

# Submission time Handle Problem Language Result Execution time Memory
882300 2023-12-03T03:26:07 Z ono_de206 Gap (APIO16_gap) C++14
Compilation error
0 ms 0 KB
#include "gap.h"
#include<bits/stdc++.h>
using namespace std;

#define in insert
#define all(x) x.begin(),x.end()
#define pb push_back
#define eb emplace_back
#define ff first
#define ss second

// #define int long long

typedef long long ll;
typedef vector<int> vi;
typedef set<int> si;
typedef multiset<int> msi;
typedef pair<int, int> pii;
typedef vector<pii> vpii;

long long findGap(int T, int N) {
	long long *qn, *qx;

	auto ask = [&](long long l, long long r) -> void {
		assert(l <= r);
		MinMax(l, r, &qn, &qx);
	};

	long long sus1 = 0, sus2 = (long long)1e18;

	ask(sus1, sus2);

	long long mn = *qn, mx = *qx, ans = 0;
	long long d = (mx - mn) / N;
	long long ls = mn, l = mn + 1;
	while(l <= mx) {
		long long r = l + d - 1;
		ask(l, r);
		if(*qn != -1) {
			ans = max(ans, *qn - ls);
			ls = *qx;
		}
		l = r + 1;
	}
	return ans;
}

Compilation message

gap.cpp: In lambda function:
gap.cpp:26:16: error: cannot convert 'long long int**' to 'long long int*'
   26 |   MinMax(l, r, &qn, &qx);
      |                ^~~
      |                |
      |                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*);
      |                                   ^~~~~~~~~~