QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#200864 | #4. Gap | _LAP_ | 0 | 1ms | 3740kb | C++14 | 463b | 2023-10-04 21:46:26 | 2023-10-04 21:46:28 |
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