QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#200864#4. Gap_LAP_0 1ms3740kbC++14463b2023-10-04 21:46:262023-10-04 21:46:28

Judging History

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

  • [2023-10-04 21:46:28]
  • 评测
  • 测评结果:0
  • 用时:1ms
  • 内存:3740kb
  • [2023-10-04 21:46:26]
  • 提交

answer

#include "gap.h"
#include <bits/stdc++.h>

using namespace std;

long long findGap(int T, int n) {
	if(T == 1) {
		vector<long long> a(n + 1);
		long long mn, mx, L = 0, R = 1e18;
		int l = 1, r = n;
		while(l <= r) {
			MinMax(L, R, &mn, &mx);
			a[l ++] = mn; if(l <= r) a[r --] = mx;
			L = mn + 1, R = mx - 1;
		}
		long long res = 0;
		for(int i = 2; i <= n; i ++) res = max(res, a[i] - a[i - 1]);
		return r;
	} else {
		return -1;
	}
}

詳細信息

Subtask #1:

score: 0
Wrong Answer

Test #1:

score: 0
Wrong Answer
time: 0ms
memory: 3740kb

input:

1 2
29659227736649406 728704890713443211

output:

1
1

result:

wrong answer returned 1 but expected 699045662976793805

Subtask #2:

score: 0
Wrong Answer

Test #33:

score: 0
Wrong Answer
time: 1ms
memory: 3652kb

input:

2 2
78103569500113815 605712887753065418

output:

-1
0

result:

wrong answer returned -1 but expected 527609318252951603