Submission #41242

# Submission time Handle Problem Language Result Execution time Memory
41242 2018-02-15T06:00:35 Z Just_Solve_The_Problem Gap (APIO16_gap) C++11
Compilation error
0 ms 0 KB
#include <gap.h>
#include <bits/stdc++.h> 

#define ll long long

using namespace std;

ll findgap(int t, int n) {
	ll l, r;
	MinMax(0, 1e18, l, r);
	l++; r--;
	ll dif = (r - l + 1) / n;
	ll start = l;
	ll fin = start + dif - 1;
	ll fre = 0;
	ll mx = 0;
	mx = l - 1;
	ll ans = 0;
	while (fin != r) {
		ll l1, r1;
		MinMax(start, fin, l1, r1);
		if (l1 == -1) {
			fre += dif;
		} else {
			if (fre != 0) {
				ans = max(ans, fre + mx + l1);
			}
			fre = 0;             
			mx = fin - r1;
		}                
		start = fin + 1;
		fin = min(start + dif - 1, r);
	}
	return ans;
}

Compilation message

gap.cpp: In function 'long long int findgap(int, int)':
gap.cpp:10:22: error: invalid conversion from 'long long int' to 'long long int*' [-fpermissive]
  MinMax(0, 1e18, l, r);
                      ^
In file included from gap.cpp:1:0:
gap.h:1:6: note:   initializing argument 3 of 'void MinMax(long long int, long long int, long long int*, long long int*)'
 void MinMax(long long, long long, long long*, long long*);
      ^
gap.cpp:10:22: error: invalid conversion from 'long long int' to 'long long int*' [-fpermissive]
  MinMax(0, 1e18, l, r);
                      ^
In file included from gap.cpp:1:0:
gap.h:1:6: note:   initializing argument 4 of 'void MinMax(long long int, long long int, long long int*, long long int*)'
 void MinMax(long long, long long, long long*, long long*);
      ^
gap.cpp:21:28: error: invalid conversion from 'long long int' to 'long long int*' [-fpermissive]
   MinMax(start, fin, l1, r1);
                            ^
In file included from gap.cpp:1:0:
gap.h:1:6: note:   initializing argument 3 of 'void MinMax(long long int, long long int, long long int*, long long int*)'
 void MinMax(long long, long long, long long*, long long*);
      ^
gap.cpp:21:28: error: invalid conversion from 'long long int' to 'long long int*' [-fpermissive]
   MinMax(start, fin, l1, r1);
                            ^
In file included from gap.cpp:1:0:
gap.h:1:6: note:   initializing argument 4 of 'void MinMax(long long int, long long int, long long int*, long long int*)'
 void MinMax(long long, long long, long long*, long long*);
      ^