QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#413934#4. Gapzeta75320 1ms5804kbC++17661b2024-05-18 12:35:352024-05-18 12:35:36

Judging History

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

  • [2024-05-18 12:35:36]
  • 评测
  • 测评结果:0
  • 用时:1ms
  • 内存:5804kb
  • [2024-05-18 12:35:35]
  • 提交

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;
	ll l,r;
	MinMax(0,1000000000000000000,&l,&r);
	A.push_back(l),A.push_back(r);
	N--;
	rep(i,N){
		ll j=i+1;
		ll a,b;
		ll x=l+((r-l)/N)*i+(((r-l)%N)*i)/N;
		ll y=l+((r-l)/N)*j+(((r-l)%N)*j)/N-1;
		MinMax(x,y,&a,&b);
		if(a!=-1) A.push_back(a);
		if(b!=-1) A.push_back(b);
	}
	sort(all(A));
	A.erase(unique(all(A)),A.end());
	ll ans=0;
	rep(i,N-1) ans=max(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: 0
Wrong Answer
time: 1ms
memory: 3984kb

input:

1 2
29659227736649406 728704890713443211

output:

0
2

result:

wrong answer returned 0 but expected 699045662976793805

Subtask #2:

score: 0
Wrong Answer

Test #33:

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

input:

2 2
78103569500113815 605712887753065418

output:

0
5

result:

wrong answer returned 0 but expected 527609318252951603