QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#413873 | #4. Gap | zeta7532 | 0 | 1ms | 5916kb | C++17 | 597b | 2024-05-18 11:04:46 | 2024-05-18 11:04:47 |
answer
#include "gap.h"
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define fi first
#define se second
#define rep(i,n) for(int i=0;i<n;i++)
#define all(x) x.begin(),x.end()
long long findGap(int T, int N)
{
vector<ll> A(N);
ll l=-1,r=N;
rep(loop,(N+1)/2){
if(loop==0){
ll mn,mx;
MinMax(0,1000000000000000000,&mn,&mx);
l++,r--;
A[l]=mn;
A[r]=mx;
}else{
ll mn,mx;
MinMax(A[l]+1,A[r]-1,&mn,&mx);
l++,r--;
A[l]=mn;
A[r]=mx;
}
}
ll ans=1000000000000000000;
rep(i,N-1) ans=min(ans,A[i+1]-A[i]);
return ans;
}
Details
Tip: Click on the bar to expand more detailed information
Subtask #1:
score: 0
Wrong Answer
Test #1:
score: 30
Accepted
time: 0ms
memory: 4060kb
input:
1 2 29659227736649406 728704890713443211
output:
699045662976793805 1
result:
points 1 M = 1
Test #2:
score: -30
Wrong Answer
time: 1ms
memory: 5916kb
input:
1 15 4910834401530995 82366510858893943 154224513006215114 167111470747458922 291518420333647381 360708376904159067 475438451423179257 514521822479974099 544779904916816505 631359818684602077 636047253191505154 815280682985156693 908104066692014481 977273719899584711 997330329109444588
output:
4687434506903077 8
result:
wrong answer returned 4687434506903077 but expected 179233429793651539
Subtask #2:
score: 0
Wrong Answer
Test #33:
score: 70
Accepted
time: 1ms
memory: 5840kb
input:
2 2 78103569500113815 605712887753065418
output:
527609318252951603 3
result:
points 1.0 M = 3
Test #34:
score: 0
Wrong Answer
time: 1ms
memory: 5908kb
input:
2 15 61436558421029682 83429206007963488 214541359837684412 243514252712970384 305484811504551902 336434369562156870 338340290496962958 497057755642276106 550273649621370145 553677540845214422 598379388791730666 658501786507934652 711557595985663747 814649872154415032 878126866231709433
output:
1905920934806088 72
result:
wrong answer returned 1905920934806088 but expected 158717465145313148