답안 #101360

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
101360 2019-03-18T17:20:37 Z asifthegreat Gap (APIO16_gap) C++14
컴파일 오류
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*);
      ^~~~~~
gap.cpp:21:9: error: expected ';' before 'arr'
         arr[l++] = mn;
         ^~~