QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#643818#4. Gapmakrav0 1ms5896kbC++20568b2024-10-16 01:27:582024-10-16 01:27:58

Judging History

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

  • [2024-10-16 01:27:58]
  • 评测
  • 测评结果:0
  • 用时:1ms
  • 内存:5896kb
  • [2024-10-16 01:27:58]
  • 提交

answer

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

using namespace std;
using ll = long long;

long long findGap(int T, int N) {
	if (T == 1) {
		ll lf = -1, rg = 1e18 + 1, bs = 0;
		for (int j = 0; j < (N + 1) / 2; j++) {
			ll mn, mx;
			ll *uk_mn{&mn}, *uk_mx{&mx};
			MinMax(lf + 1, rg - 1, uk_mn, uk_mx);
			if (lf != -1) bs = max(bs, mn - lf);
			if (rg != 1000000000000000000 + 1) bs = max(bs, rg - mx);
			///bs = max(bs, mx - mn);
			if (N % 2 == 0 && j + 1 == N / 2) bs = max(bs, mx - mn);
			lf = mn; rg = mx;
		} 
		return bs;
	}
	return 0;
}

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: 3816kb

input:

1 2
29659227736649406 728704890713443211

output:

699045662976793805
1

result:

points 1 M = 1

Test #2:

score: 30
Accepted
time: 1ms
memory: 5896kb

input:

1 15
4910834401530995 82366510858893943 154224513006215114 167111470747458922 291518420333647381 360708376904159067 475438451423179257 514521822479974099 544779904916816505 631359818684602077 636047253191505154 815280682985156693 908104066692014481 977273719899584711 997330329109444588

output:

179233429793651539
8

result:

points 1 M = 8

Test #3:

score: 30
Accepted
time: 0ms
memory: 3752kb

input:

1 15
26822012613602297 83016336616322262 240236403235204784 251263501103080046 267418872581278273 283465011506182121 387188614324429897 405999856871910796 621222868183510412 705139383465288123 737738410068055892 825642738416654428 854722383986606367 855077944176184296 908358416490444978

output:

215223011311599616
8

result:

points 1 M = 8

Test #4:

score: 30
Accepted
time: 0ms
memory: 3744kb

input:

1 15
9924552505919890 20650946047777351 137465276238229613 316776581684046368 328799260840899945 352871104748474083 461843498111917783 467004768858109370 483649564461099301 522358288815328209 604961424367736207 741995299386981061 796141495301995014 806409479876611358 985852922191990473

output:

179443442315379115
8

result:

points 1 M = 8

Test #5:

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

input:

1 15
5829742 7847985 9866228 11884471 13902714 15920957 17939200 19957443 21975686 23993929 26012172 28030415 30048658 32066901 34085144

output:

999999999965914856
8

result:

wrong answer returned 999999999965914856 but expected 2018243

Subtask #2:

score: 0
Wrong Answer

Test #33:

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

input:

2 2
78103569500113815 605712887753065418

output:

0
0

result:

wrong answer returned 0 but expected 527609318252951603