QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#290419#6. 玛里苟斯MoRanSkyCompile Error//C++201.2kb2023-12-24 23:34:282023-12-24 23:34:29

Judging History

你现在查看的是最新测评结果

  • [2023-12-24 23:34:29]
  • 评测
  • [2023-12-24 23:34:28]
  • 提交

answer

#include "gap.h"

#include <bits/stdc++.h>

// Skyqwq
#define pb push_back
#define fi first
#define se second
#define mp make_pair

using namespace std;

typedef pair<int, int> PII;
typedef long long LL;

template <typename T> bool chkMax(T &x, T y) { return (y > x) ? x = y, 1 : 0; }
template <typename T> bool chkMin(T &x, T y) { return (y < x) ? x = y, 1 : 0; }

long long findGap(int T, int n)
{	
	if (T == 1) {
		int x = n;
		LL mx, mn;
		vector<LL> a;
		LL L = 0, R = 1e18;
		while (x > 0) {
			MinMax(L, R, &mn, &mx);
			if (x == 1) {
				a.pb(mx);
				x--;
				break;
			}
			L = mn + 1, R = mx - 1;
			a.pb(mn), a.pb(mx);
			x -= 2;
		}
		sort(a.begin(), a.end());
		LL ans = 0;
		for (int i = 0; i + 1 < a.size(); i++)
			chkMax(ans, a[i + 1] - a[i]);
		return ans;
	} else {
		LL mx, mn;
		LL L = 0, R = 1e18;
		MinMax(L, R, &mn, &mx);
		LL o = (mx - mn + 1 + n - 2) / (n - 1);
		LL la = -1, ans = 0;
		LL now = mn;
		while (now <= mx) {
			LL rt = min(mx, now + o - 1);
			LL p, q;
			MinMax(now, rt, &p, &q);
			if (p != -1) {
				if (la != -1) chkMax(ans, p - la);
				la = q;
				chkMax(ans, q - p);
			}
			now = rt + 1;
		}
		return ans;
	}
	return 0;
}

詳細信息

answer.code:1:10: fatal error: gap.h: No such file or directory
    1 | #include "gap.h"
      |          ^~~~~~~
compilation terminated.