Submission #54879

# Submission time Handle Problem Language Result Execution time Memory
54879 2018-07-05T08:46:30 Z linkret Printed Circuit Board (CEOI12_circuit) C++14
0 / 100
49 ms 15892 KB
#include <bits/stdc++.h>

using namespace std;

typedef pair<int, int> pii;
#define f first
#define s second

const int maxn = 1 << 17;

int n;
pii p[maxn];
vector<pii> seg[2 * maxn];

void init(int i, int l, int r) {
	if(l == r) {
		if(l < n)
			seg[i].push_back(p[i]);
		return;
	}

	int m = (l + r + 1) / 2;

	init(i * 2, l, m - 1);
	init(i * 2 + 1, m, r);

	seg[i].reserve(seg[i * 2].size() + seg[i * 2 + 1].size());

	for(const pii &j : seg[i * 2])
		seg[i].push_back(j);

	for(const pii &j : seg[i * 2 + 1])
		seg[i].push_back(j);

	sort(seg[i].begin(), seg[i].end());
}

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);

	cin >> n;

	// assert(n <= 1000);

	for(int i = 0; i < n; i++) {
		cin >> p[i].f >> p[i].s;
	}

	init(1, 1, maxn);

	cout << 0 << endl;

	return 0;
}
# Verdict Execution time Memory Grader output
1 Incorrect 12 ms 6520 KB Output isn't correct
2 Incorrect 11 ms 6884 KB Output isn't correct
3 Runtime error 15 ms 13592 KB Execution killed with signal 11 (could be triggered by violating memory limits)
4 Runtime error 17 ms 13860 KB Execution killed with signal 11 (could be triggered by violating memory limits)
5 Runtime error 19 ms 13964 KB Execution killed with signal 11 (could be triggered by violating memory limits)
6 Runtime error 21 ms 13980 KB Execution killed with signal 11 (could be triggered by violating memory limits)
7 Runtime error 20 ms 14208 KB Execution killed with signal 11 (could be triggered by violating memory limits)
8 Runtime error 19 ms 14208 KB Execution killed with signal 11 (could be triggered by violating memory limits)
9 Runtime error 20 ms 14208 KB Execution killed with signal 11 (could be triggered by violating memory limits)
10 Runtime error 21 ms 14208 KB Execution killed with signal 11 (could be triggered by violating memory limits)
11 Runtime error 20 ms 14208 KB Execution killed with signal 11 (could be triggered by violating memory limits)
12 Runtime error 22 ms 14348 KB Execution killed with signal 11 (could be triggered by violating memory limits)
13 Runtime error 26 ms 14356 KB Execution killed with signal 11 (could be triggered by violating memory limits)
14 Runtime error 32 ms 14484 KB Execution killed with signal 11 (could be triggered by violating memory limits)
15 Runtime error 27 ms 14612 KB Execution killed with signal 11 (could be triggered by violating memory limits)
16 Runtime error 41 ms 15380 KB Execution killed with signal 11 (could be triggered by violating memory limits)
17 Runtime error 38 ms 15384 KB Execution killed with signal 11 (could be triggered by violating memory limits)
18 Runtime error 48 ms 15384 KB Execution killed with signal 11 (could be triggered by violating memory limits)
19 Runtime error 49 ms 15384 KB Execution killed with signal 11 (could be triggered by violating memory limits)
20 Runtime error 48 ms 15892 KB Execution killed with signal 11 (could be triggered by violating memory limits)