답안 #70601

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
70601 2018-08-23T07:19:43 Z polyfish Gap (APIO16_gap) C++14
컴파일 오류
0 ms 0 KB
//I love armpit fetish

#include <bits/stdc++.h>
#include "gap.h"
using namespace std;

#define debug(x) cerr << #x << " = " << x << '\n';
#define BP() cerr << "OK!\n";
#define PR(A, n) {cerr << #A << " = "; for (int _=1; _<=n; ++_) cerr << A[_] << ' '; cerr << '\n';}
#define PR0(A, n) {cerr << #A << " = "; for (int _=0; _<n; ++_) cerr << A[_] << ' '; cerr << '\n';}
#define FILE_NAME "data"

const int64_t INF = 1e18;
const int MAX_N = 100002;

int n;
int64_t a[MAX_N];

int64_t solve_subtask_1() {
    int l = 1, r = n;
    int64_t s = 1, t = INF;
    while (l<=r) {
        int64_t *mn;
        int64_t *mx;
        MinMax(s, t, mn, mx);
        a[l] = *mn;
        a[r] = *mx;
        s = *mn + 1;
        t = *mx - 1;
    }
    int64_t res = 0;
    for (int i=2; i<=n; ++i)
        res = max(res, a[i] - a[i-1]);
    return res;
}

int64_t findGap(int testID, int N) {
    n = N;
    if (testID==1)
        return solve_subtask_1();
    return 0;
//    else
//        return solve_subtask_2();
}

Compilation message

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