Submission #101361

# Submission time Handle Problem Language Result Execution time Memory
101361 2019-03-18T17:23:04 Z shafinalam Gap (APIO16_gap) C++14
Compilation error
0 ms 0 KB
#include <bits/stdc++.h>
#include "gap.h"
using namespace std;

typedef long long ll;
const int lim = 1e5+5;
#define  sf scanf
#define  pf printf

#define  inf 1e18
ll arr[lim];

ll findGap(int T, int N)
{
    ll s = 0, t = inf, mn, mx;
    ll l = 1, r = N;

    while(l<=r)
    {
        MinMax(s, t, mn, mx);
        arr[l++] = mn;
        arr[r--] = mx;
        mn++;
        mx--;
    }
    ll ans = -inf;
    for(int i = 2; i <= N; i++) max(ans, arr[i]-arr[i-1]);
    return ans;
}

Compilation message

gap.cpp: In function 'll findGap(int, int)':
gap.cpp:20:28: error: invalid conversion from 'll {aka long long int}' to 'long long int*' [-fpermissive]
         MinMax(s, t, mn, mx);
                            ^
In file included from gap.cpp:2: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:20:28: error: invalid conversion from 'll {aka long long int}' to 'long long int*' [-fpermissive]
         MinMax(s, t, mn, mx);
                            ^
In file included from gap.cpp:2: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*);
      ^~~~~~