답안 #565322

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
565322 2022-05-20T17:05:10 Z Spade1 Gap (APIO16_gap) C++14
컴파일 오류
0 ms 0 KB
#include<bits/stdc++.h>
//#include "gap.h"
#define pii pair<int, int>
#define pll pair<long long, long long>
#define ll long long
#define ld long double
#define st first
#define nd second
#define pb push_back
#define INF INT_MAX

static void my_assert(int k){ if (!k) exit(1); }

using namespace std;

const int NN = 1e5 + 10;

ll mx[NN];
ll mn[NN];
pii ed[NN];
ll a[NN];
int cnt = 0;

ll findGap(int T, int N) {
    if (T == 1) {
        ll mn, mx;
        ll l = 0, r = 1e18;
        for (ll i = 0; i < (N+1)/2; ++i) {
            MinMax(l, r, &mn, &mx);
            a[cnt++] = mn;
            a[cnt++] = mx;
            l = mn+1, r = mx - 1;
        }
        sort(a, a+N);
        ll ans = 0;
        for (int i = 1; i <= N; ++i) ans = max(ans, a[i] - a[i-1]);
        return ans;
    }
}

Compilation message

gap.cpp: In function 'long long int findGap(int, int)':
gap.cpp:29:13: error: 'MinMax' was not declared in this scope
   29 |             MinMax(l, r, &mn, &mx);
      |             ^~~~~~
gap.cpp:39:1: warning: control reaches end of non-void function [-Wreturn-type]
   39 | }
      | ^
gap.cpp: At global scope:
gap.cpp:12:13: warning: 'void my_assert(int)' defined but not used [-Wunused-function]
   12 | static void my_assert(int k){ if (!k) exit(1); }
      |             ^~~~~~~~~