Submission #882382

# Submission time Handle Problem Language Result Execution time Memory
882382 2023-12-03T06:01:04 Z dubabuba Gap (APIO16_gap) C++14
0 / 100
15 ms 5700 KB
#include "gap.h"
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef pair<int, int> pii;
#define ff first
#define ss second

struct node {
	node *LC, *RC;
	ll tl, tr;
	ll mn, mx;
	ll ans;

	node(ll l, ll r) {
		ans = -1;
		tl = l, tr = r;
		MinMax(l, r, &mn, &mx);
	}

	bool birth() {
		if(tl == tr) return 0;
		if(mn == mx) return 0;
		LC = new node(tl, (tl + tr) / 2);
		RC = new node((tl + tr) / 2 + 1, tr);
		return 1;
	}

	void build() {
		if(tl == tr) return;
		if(mn == mx) return;

		LC-> build();
		RC-> build();

		ans = max(LC-> ans, RC-> ans);
		if(LC-> mx != -1 && RC-> mn != -1)
			ans = max(ans, RC-> mn - LC-> mx);
	}
};

ll findGap(int T, int N) {
	const ll mxn = (ll)1e18 + 10;
	node *root = new node(0LL, mxn);
	root-> build();
	return root-> ans;
}
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 344 KB Execution killed with signal 11
2 Runtime error 3 ms 4696 KB Execution killed with signal 11
3 Runtime error 3 ms 4696 KB Execution killed with signal 11
4 Runtime error 2 ms 4696 KB Execution killed with signal 11
5 Runtime error 2 ms 4532 KB Execution killed with signal 11
6 Runtime error 2 ms 4696 KB Execution killed with signal 11
7 Runtime error 2 ms 4696 KB Execution killed with signal 11
8 Runtime error 2 ms 4696 KB Execution killed with signal 11
9 Runtime error 2 ms 4696 KB Execution killed with signal 11
10 Runtime error 2 ms 4696 KB Execution killed with signal 11
11 Runtime error 2 ms 4696 KB Execution killed with signal 11
12 Runtime error 2 ms 4636 KB Execution killed with signal 11
13 Runtime error 2 ms 4540 KB Execution killed with signal 11
14 Runtime error 3 ms 4696 KB Execution killed with signal 11
15 Runtime error 2 ms 4696 KB Execution killed with signal 11
16 Runtime error 5 ms 4892 KB Execution killed with signal 11
17 Runtime error 6 ms 4888 KB Execution killed with signal 11
18 Runtime error 5 ms 5064 KB Execution killed with signal 11
19 Runtime error 5 ms 4892 KB Execution killed with signal 11
20 Runtime error 4 ms 4876 KB Execution killed with signal 11
21 Runtime error 15 ms 5412 KB Execution killed with signal 11
22 Runtime error 15 ms 5408 KB Execution killed with signal 11
23 Runtime error 14 ms 5416 KB Execution killed with signal 11
24 Runtime error 14 ms 5464 KB Execution killed with signal 11
25 Runtime error 12 ms 5700 KB Execution killed with signal 11
26 Runtime error 14 ms 5412 KB Execution killed with signal 11
27 Runtime error 14 ms 5572 KB Execution killed with signal 11
28 Runtime error 14 ms 5568 KB Execution killed with signal 11
29 Runtime error 14 ms 5416 KB Execution killed with signal 11
30 Runtime error 9 ms 5404 KB Execution killed with signal 11
31 Runtime error 2 ms 4696 KB Execution killed with signal 11
32 Runtime error 2 ms 4696 KB Execution killed with signal 11
# Verdict Execution time Memory Grader output
1 Runtime error 3 ms 4696 KB Execution killed with signal 11
2 Runtime error 2 ms 4696 KB Execution killed with signal 11
3 Runtime error 4 ms 4696 KB Execution killed with signal 11
4 Runtime error 2 ms 4696 KB Execution killed with signal 11
5 Runtime error 2 ms 4696 KB Execution killed with signal 11
6 Runtime error 2 ms 4696 KB Execution killed with signal 11
7 Runtime error 2 ms 4696 KB Execution killed with signal 11
8 Runtime error 2 ms 4696 KB Execution killed with signal 11
9 Runtime error 2 ms 4696 KB Execution killed with signal 11
10 Runtime error 2 ms 4696 KB Execution killed with signal 11
11 Runtime error 2 ms 4696 KB Execution killed with signal 11
12 Runtime error 4 ms 4664 KB Execution killed with signal 11
13 Runtime error 2 ms 4696 KB Execution killed with signal 11
14 Runtime error 2 ms 4948 KB Execution killed with signal 11
15 Runtime error 2 ms 4696 KB Execution killed with signal 11
16 Runtime error 5 ms 5056 KB Execution killed with signal 11
17 Runtime error 5 ms 4876 KB Execution killed with signal 11
18 Runtime error 5 ms 4892 KB Execution killed with signal 11
19 Runtime error 6 ms 4800 KB Execution killed with signal 11
20 Runtime error 4 ms 4876 KB Execution killed with signal 11
21 Runtime error 15 ms 5252 KB Execution killed with signal 11
22 Runtime error 14 ms 5412 KB Execution killed with signal 11
23 Runtime error 14 ms 5380 KB Execution killed with signal 11
24 Runtime error 14 ms 5416 KB Execution killed with signal 11
25 Runtime error 11 ms 5404 KB Execution killed with signal 11
26 Runtime error 14 ms 5412 KB Execution killed with signal 11
27 Runtime error 14 ms 5416 KB Execution killed with signal 11
28 Runtime error 14 ms 5408 KB Execution killed with signal 11
29 Runtime error 14 ms 5412 KB Execution killed with signal 11
30 Runtime error 10 ms 5412 KB Execution killed with signal 11
31 Runtime error 2 ms 4720 KB Execution killed with signal 11
32 Runtime error 2 ms 4696 KB Execution killed with signal 11