Submission #103179

# Submission time Handle Problem Language Result Execution time Memory
103179 2019-03-29T07:40:37 Z E869120 New Home (APIO18_new_home) C++14
47 / 100
5000 ms 452952 KB
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <functional>
#include <set>
#include <map>
#include <tuple>
using namespace std;
#pragma warning (disable: 4996)

// ------------------------------------------------------- 特殊な場合を除く -------------------------------------

class SegmentTree {
public:
	vector<priority_queue<pair<int, int>, vector<pair<int, int>>, less<pair<int, int>>>>dat;
	vector<bool> used; vector<int> cl, cr;
	int size_ = 1;

	void init(int sz) {
		while (size_ <= sz) size_ *= 2;
		dat.resize(size_ * 2);
	}
	void add_(int l, int r, int a, int b, int x, int u) {
		if (l <= a && b <= r) { dat[u].push(make_pair(x, used.size())); return; }
		if (r <= a || b <= l) return;

		add_(l, r, a, (a + b) >> 1, x, u * 2);
		add_(l, r, (a + b) >> 1, b, x, u * 2 + 1);
	}
	int add(int l, int r, int x) {
		add_(l, r, 0, size_, x, 1);
		used.push_back(false); cl.push_back(l); cr.push_back(r);
		return used.size() - 1;
	}
	void query(int l, int r, int a, int b, int u) {
		if (l <= a && b <= r) {
			while (!dat[u].empty()) {
				int t = dat[u].top().second;
				if (used[t] == true) dat[u].pop();
				else break;
			}
			return;
		}
		if (r <= a || b <= l) return;

		query(l, r, a, (a + b) >> 1, u * 2);
		query(l, r, (a + b) >> 1, b, u * 2 + 1);
	}
	void dels(int num) {
		used[num] = true;
		query(cl[num], cr[num], 0, size_, 1);
	}

	int answer(int pos) {
		pos += size_; int ans = -(1 << 30);

		while (pos >= 1) {
			if (!dat[pos].empty()) ans = max(ans, dat[pos].top().first);
			pos >>= 1;
		}
		return ans;
	}
};

const int MAX_N = (1 << 19);

int N, K, Q, R, X[MAX_N], T[MAX_N], A[MAX_N], B[MAX_N], L[MAX_N], Y[MAX_N], Answer[MAX_N], cnt1[MAX_N], cnt;
set<pair<int, int>> dishes[MAX_N]; map<tuple<int, int, int>, int>Map;

SegmentTree V1, V2; vector<int>VX; vector<tuple<int, int, int>>vec;

void delete_vision(int cl, int cr) {
	if (R == 1) return;
	if (cr != -2) V1.dels(Map[make_tuple(cl, cr, 1)]);
	if (cl != -1) V2.dels(Map[make_tuple(cl, cr, 2)]);
}

void add_vision(int cl, int cr) {
	if (R == 1) {
		if (cl != -1 && cr != -2) VX.push_back((X[cl] + X[cr]) / 2);
		return;
	}
	if (cl != -1 && cr != -2) {
		int pos1 = lower_bound(VX.begin(), VX.end(), X[cl]) - VX.begin();
		int pos2 = lower_bound(VX.begin(), VX.end(), (X[cl] + X[cr]) / 2) - VX.begin();
		int pos3 = lower_bound(VX.begin(), VX.end(), X[cr]) - VX.begin();

		int Z1 = V1.add(pos2, pos3 + 1, X[cr]); Map[make_tuple(cl, cr, 1)] = Z1;
		int Z2 = V2.add(pos1, pos2 + 1, -X[cl]); Map[make_tuple(cl, cr, 2)] = Z2;
	}
	else if (cr != -2) {
		int pos1 = lower_bound(VX.begin(), VX.end(), X[cr]) - VX.begin();

		int Z1 = V1.add(0, pos1 + 1, X[cr]); Map[make_tuple(cl, cr, 1)] = Z1;
	}
	else if (cl != -1) {
		int pos1 = lower_bound(VX.begin(), VX.end(), X[cl]) - VX.begin();

		int Z2 = V2.add(pos1, VX.size() + 1, -X[cl]); Map[make_tuple(cl, cr, 2)] = Z2;
	}
}

void delete_relation(int ty, int pos) {
	if (ty == 1) {
		// 2 点の場合
		auto itr1 = dishes[T[pos]].lower_bound(make_pair(X[pos], pos));
		auto itr2 = dishes[T[pos]].lower_bound(make_pair(X[pos], pos));

		int P1 = -1; if (itr1 != dishes[T[pos]].begin()) { itr1--; P1 = (*itr1).second; }
		int P2 = -2; if (itr2 != dishes[T[pos]].end()) { P2 = (*itr2).second; }

		delete_vision(P1, P2);
	}
	if (ty == 2) {
		auto itr1 = dishes[T[pos]].lower_bound(make_pair(X[pos], pos));
		auto itr2 = dishes[T[pos]].lower_bound(make_pair(X[pos], pos + 1));

		int P1 = -1; if (itr1 != dishes[T[pos]].begin()) { itr1--; P1 = (*itr1).second; }
		int P2 = -2; if (itr2 != dishes[T[pos]].end()) { P2 = (*itr2).second; }

		delete_vision(P1, pos);
		delete_vision(pos, P2);
	}
}

void add_relation(int ty, int pos) {
	if (ty == 1) {
		// 3 点の場合
		auto itr1 = dishes[T[pos]].lower_bound(make_pair(X[pos], pos));
		auto itr2 = dishes[T[pos]].lower_bound(make_pair(X[pos], pos + 1));

		int P1 = -1; if (itr1 != dishes[T[pos]].begin()) { itr1--; P1 = (*itr1).second; }
		int P2 = -2; if (itr2 != dishes[T[pos]].end()) { P2 = (*itr2).second; }

		add_vision(P1, pos);
		add_vision(pos, P2);
	}
	if (ty == 2) {
		// 2 点の場合
		auto itr1 = dishes[T[pos]].lower_bound(make_pair(X[pos], pos));
		auto itr2 = dishes[T[pos]].lower_bound(make_pair(X[pos], pos));

		int P1 = -1; if (itr1 != dishes[T[pos]].begin()) { itr1--; P1 = (*itr1).second; }
		int P2 = -2; if (itr2 != dishes[T[pos]].end()) { P2 = (*itr2).second; }

		add_vision(P1, P2);
	}
}

void add(int pos) {
	cnt1[T[pos]]++; if (cnt1[T[pos]] == 1) cnt++;
	delete_relation(1, pos);
	dishes[T[pos]].insert(make_pair(X[pos], pos));
	add_relation(1, pos);
}

void lose(int pos) {
	cnt1[T[pos]]--; if (cnt1[T[pos]] == 0) cnt--;

	delete_relation(2, pos);
	dishes[T[pos]].erase(make_pair(X[pos], pos));
	add_relation(2, pos);
}

int getval(int pos) {
	int pos1 = lower_bound(VX.begin(), VX.end(), pos) - VX.begin();
	int val1 = V1.answer(pos1) - pos;

	int pos2 = lower_bound(VX.begin(), VX.end(), pos) - VX.begin();
	int val2 = V2.answer(pos2) + pos;

	return max(val1, val2);
}

// ---------------------------------- 特殊な場合に対処 -----------------------------------

int RR = 2; vector<int>G[MAX_N]; bool uses[MAX_N];

void solve_partial() {
	for (int i = 1; i <= N; i++) G[T[i]].push_back(X[i]);
	for (int i = 1; i <= K; i++) sort(G[i].begin(), G[i].end());

	vector<tuple<int, int, int, int>> Z;
	for (int i = 1; i <= Q; i++) Z.push_back(make_tuple(L[i], 3, i, 0));

	int cntv = 0;
	for (int i = 1; i <= K; i++) {
		if (G[i].size() == 0) {
			for (int j = 1; j <= Q; j++) Answer[j] = -1;
			return;
		}

		Z.push_back(make_tuple(0, 1, G[i][0], cntv));
		Z.push_back(make_tuple(G[i][0], 4, G[i][0], cntv));
		cntv++;

		for (int j = 0; j < G[i].size() - 1; j++) {
			int cl = G[i][j], cr = G[i][j + 1];
			Z.push_back(make_tuple(cl, 2, -cl, cntv));
			Z.push_back(make_tuple((cl + cr) >> 1, 5, -cl, cntv)); cntv++;
			Z.push_back(make_tuple((cl + cr) >> 1, 1, cr, cntv));
			Z.push_back(make_tuple(cr, 4, cr, cntv)); cntv++;
		}

		Z.push_back(make_tuple(G[i][G[i].size() - 1], 2, -G[i][G[i].size() - 1], cntv)); cntv++;
	}

	sort(Z.begin(), Z.end());

	priority_queue<pair<int, int>, vector<pair<int, int>>, less<pair<int, int>>> que1, que2;

	for (int i = 0; i < Z.size(); i++) {
		if (get<1>(Z[i]) == 1) {
			que1.push(make_pair(get<2>(Z[i]), get<3>(Z[i])));
		}
		if (get<1>(Z[i]) == 2) {
			que2.push(make_pair(get<2>(Z[i]), get<3>(Z[i])));
		}
		if (get<1>(Z[i]) == 3) {
			int val1 = 0; if (!que1.empty()) val1 = que1.top().first - get<0>(Z[i]);
			int val2 = 0; if (!que2.empty()) val2 = que2.top().first + get<0>(Z[i]);
			Answer[get<2>(Z[i])] = max(val1, val2);
		}
		if (get<1>(Z[i]) == 4) {
			uses[get<3>(Z[i])] = true;
			while (!que1.empty()) { if (uses[que1.top().second] == true) que1.pop(); else break; }
		}
		if (get<1>(Z[i]) == 5) {
			uses[get<3>(Z[i])] = true;
			while (!que2.empty()) { if (uses[que2.top().second] == true) que2.pop(); else break; }
		}
	}
	return;
}

int main() {
	scanf("%d%d%d", &N, &K, &Q);
	for (int i = 1; i <= N; i++) {
		scanf("%d%d%d%d", &X[i], &T[i], &A[i], &B[i]); if (!(A[i] == 1 && B[i] == 100000000)) RR = 1;
		vec.push_back(make_tuple(A[i], 1, i)); vec.push_back(make_tuple(B[i], 3, i)); X[i] *= 2;
	}
	for (int i = 1; i <= Q; i++) {
		scanf("%d%d", &L[i], &Y[i]);
		L[i] *= 2;
		vec.push_back(make_tuple(Y[i], 2, i));
	}

	if (RR == 2) {
		solve_partial();
	}
	if (RR == 1) {
		for (int i = 1; i <= N; i++) VX.push_back(X[i]);
		for (int i = 1; i <= Q; i++) VX.push_back(L[i]);

		sort(vec.begin(), vec.end());
		sort(VX.begin(), VX.end());

		// まず 1 回シミュレーションを行う
		R = 1;

		for (int i = 0; i < vec.size(); i++) {
			if (get<1>(vec[i]) == 1) {
				add(get<2>(vec[i]));
			}
			if (get<1>(vec[i]) == 3) {
				lose(get<2>(vec[i]));
			}
		}

		sort(VX.begin(), VX.end());
		VX.erase(unique(VX.begin(), VX.end()), VX.end());
		V1.init(VX.size() + 2);
		V2.init(VX.size() + 2);

		// 次に、本シミュレーション
		R = 2;

		for (int i = 0; i < vec.size(); i++) {
			if (get<1>(vec[i]) == 1) {
				add(get<2>(vec[i]));
			}
			if (get<1>(vec[i]) == 2) {
				Answer[get<2>(vec[i])] = getval(L[get<2>(vec[i])]);
				if (cnt != K) Answer[get<2>(vec[i])] = -2;
			}
			if (get<1>(vec[i]) == 3) {
				lose(get<2>(vec[i]));
			}
		}
	}

	for (int i = 1; i <= Q; i++) printf("%d\n", Answer[i] / 2);
	return 0;
}

Compilation message

new_home.cpp:10:0: warning: ignoring #pragma warning  [-Wunknown-pragmas]
 #pragma warning (disable: 4996)
 
new_home.cpp: In function 'void solve_partial()':
new_home.cpp:198:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for (int j = 0; j < G[i].size() - 1; j++) {
                   ~~^~~~~~~~~~~~~~~~~
new_home.cpp:213:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for (int i = 0; i < Z.size(); i++) {
                  ~~^~~~~~~~~~
new_home.cpp: In function 'int main()':
new_home.cpp:262:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for (int i = 0; i < vec.size(); i++) {
                   ~~^~~~~~~~~~~~
new_home.cpp:279:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for (int i = 0; i < vec.size(); i++) {
                   ~~^~~~~~~~~~~~
new_home.cpp:238:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d%d%d", &N, &K, &Q);
  ~~~~~^~~~~~~~~~~~~~~~~~~~~~
new_home.cpp:240:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   scanf("%d%d%d%d", &X[i], &T[i], &A[i], &B[i]); if (!(A[i] == 1 && B[i] == 100000000)) RR = 1;
   ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
new_home.cpp:244:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   scanf("%d%d", &L[i], &Y[i]);
   ~~~~~^~~~~~~~~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 37 ms 37376 KB Output is correct
2 Correct 39 ms 37368 KB Output is correct
3 Correct 44 ms 37368 KB Output is correct
4 Correct 41 ms 37368 KB Output is correct
5 Correct 45 ms 37632 KB Output is correct
6 Correct 52 ms 37880 KB Output is correct
7 Correct 44 ms 37632 KB Output is correct
8 Correct 41 ms 37924 KB Output is correct
9 Correct 39 ms 37632 KB Output is correct
10 Correct 44 ms 38008 KB Output is correct
11 Correct 45 ms 37880 KB Output is correct
12 Correct 56 ms 37864 KB Output is correct
13 Correct 47 ms 37624 KB Output is correct
14 Correct 42 ms 37880 KB Output is correct
15 Correct 44 ms 38008 KB Output is correct
16 Correct 41 ms 37880 KB Output is correct
17 Correct 48 ms 37880 KB Output is correct
18 Correct 43 ms 37888 KB Output is correct
19 Correct 40 ms 37880 KB Output is correct
20 Correct 40 ms 37880 KB Output is correct
21 Correct 38 ms 37496 KB Output is correct
22 Correct 43 ms 37624 KB Output is correct
23 Correct 43 ms 37752 KB Output is correct
24 Correct 44 ms 37880 KB Output is correct
25 Correct 45 ms 37880 KB Output is correct
26 Correct 41 ms 37888 KB Output is correct
27 Correct 43 ms 37596 KB Output is correct
28 Correct 47 ms 37880 KB Output is correct
29 Correct 43 ms 37880 KB Output is correct
30 Correct 40 ms 37624 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 37 ms 37376 KB Output is correct
2 Correct 39 ms 37368 KB Output is correct
3 Correct 44 ms 37368 KB Output is correct
4 Correct 41 ms 37368 KB Output is correct
5 Correct 45 ms 37632 KB Output is correct
6 Correct 52 ms 37880 KB Output is correct
7 Correct 44 ms 37632 KB Output is correct
8 Correct 41 ms 37924 KB Output is correct
9 Correct 39 ms 37632 KB Output is correct
10 Correct 44 ms 38008 KB Output is correct
11 Correct 45 ms 37880 KB Output is correct
12 Correct 56 ms 37864 KB Output is correct
13 Correct 47 ms 37624 KB Output is correct
14 Correct 42 ms 37880 KB Output is correct
15 Correct 44 ms 38008 KB Output is correct
16 Correct 41 ms 37880 KB Output is correct
17 Correct 48 ms 37880 KB Output is correct
18 Correct 43 ms 37888 KB Output is correct
19 Correct 40 ms 37880 KB Output is correct
20 Correct 40 ms 37880 KB Output is correct
21 Correct 38 ms 37496 KB Output is correct
22 Correct 43 ms 37624 KB Output is correct
23 Correct 43 ms 37752 KB Output is correct
24 Correct 44 ms 37880 KB Output is correct
25 Correct 45 ms 37880 KB Output is correct
26 Correct 41 ms 37888 KB Output is correct
27 Correct 43 ms 37596 KB Output is correct
28 Correct 47 ms 37880 KB Output is correct
29 Correct 43 ms 37880 KB Output is correct
30 Correct 40 ms 37624 KB Output is correct
31 Correct 3778 ms 173224 KB Output is correct
32 Correct 860 ms 71356 KB Output is correct
33 Correct 2796 ms 155500 KB Output is correct
34 Correct 3779 ms 170384 KB Output is correct
35 Correct 3495 ms 168368 KB Output is correct
36 Correct 3007 ms 157156 KB Output is correct
37 Correct 2315 ms 157000 KB Output is correct
38 Correct 1820 ms 153316 KB Output is correct
39 Correct 1354 ms 152552 KB Output is correct
40 Correct 1294 ms 152928 KB Output is correct
41 Correct 1964 ms 112384 KB Output is correct
42 Correct 2212 ms 115592 KB Output is correct
43 Correct 140 ms 51552 KB Output is correct
44 Correct 2005 ms 114064 KB Output is correct
45 Correct 1688 ms 108644 KB Output is correct
46 Correct 1539 ms 107472 KB Output is correct
47 Correct 797 ms 103816 KB Output is correct
48 Correct 789 ms 104004 KB Output is correct
49 Correct 967 ms 107528 KB Output is correct
50 Correct 1160 ms 113596 KB Output is correct
51 Correct 943 ms 106332 KB Output is correct
# Verdict Execution time Memory Grader output
1 Runtime error 711 ms 140532 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 5041 ms 452952 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 37 ms 37376 KB Output is correct
2 Correct 39 ms 37368 KB Output is correct
3 Correct 44 ms 37368 KB Output is correct
4 Correct 41 ms 37368 KB Output is correct
5 Correct 45 ms 37632 KB Output is correct
6 Correct 52 ms 37880 KB Output is correct
7 Correct 44 ms 37632 KB Output is correct
8 Correct 41 ms 37924 KB Output is correct
9 Correct 39 ms 37632 KB Output is correct
10 Correct 44 ms 38008 KB Output is correct
11 Correct 45 ms 37880 KB Output is correct
12 Correct 56 ms 37864 KB Output is correct
13 Correct 47 ms 37624 KB Output is correct
14 Correct 42 ms 37880 KB Output is correct
15 Correct 44 ms 38008 KB Output is correct
16 Correct 41 ms 37880 KB Output is correct
17 Correct 48 ms 37880 KB Output is correct
18 Correct 43 ms 37888 KB Output is correct
19 Correct 40 ms 37880 KB Output is correct
20 Correct 40 ms 37880 KB Output is correct
21 Correct 38 ms 37496 KB Output is correct
22 Correct 43 ms 37624 KB Output is correct
23 Correct 43 ms 37752 KB Output is correct
24 Correct 44 ms 37880 KB Output is correct
25 Correct 45 ms 37880 KB Output is correct
26 Correct 41 ms 37888 KB Output is correct
27 Correct 43 ms 37596 KB Output is correct
28 Correct 47 ms 37880 KB Output is correct
29 Correct 43 ms 37880 KB Output is correct
30 Correct 40 ms 37624 KB Output is correct
31 Correct 3778 ms 173224 KB Output is correct
32 Correct 860 ms 71356 KB Output is correct
33 Correct 2796 ms 155500 KB Output is correct
34 Correct 3779 ms 170384 KB Output is correct
35 Correct 3495 ms 168368 KB Output is correct
36 Correct 3007 ms 157156 KB Output is correct
37 Correct 2315 ms 157000 KB Output is correct
38 Correct 1820 ms 153316 KB Output is correct
39 Correct 1354 ms 152552 KB Output is correct
40 Correct 1294 ms 152928 KB Output is correct
41 Correct 1964 ms 112384 KB Output is correct
42 Correct 2212 ms 115592 KB Output is correct
43 Correct 140 ms 51552 KB Output is correct
44 Correct 2005 ms 114064 KB Output is correct
45 Correct 1688 ms 108644 KB Output is correct
46 Correct 1539 ms 107472 KB Output is correct
47 Correct 797 ms 103816 KB Output is correct
48 Correct 789 ms 104004 KB Output is correct
49 Correct 967 ms 107528 KB Output is correct
50 Correct 1160 ms 113596 KB Output is correct
51 Correct 943 ms 106332 KB Output is correct
52 Correct 1189 ms 85136 KB Output is correct
53 Correct 1161 ms 80904 KB Output is correct
54 Correct 2327 ms 126180 KB Output is correct
55 Correct 1566 ms 113176 KB Output is correct
56 Correct 1481 ms 111812 KB Output is correct
57 Correct 1975 ms 116932 KB Output is correct
58 Correct 1799 ms 113964 KB Output is correct
59 Correct 1573 ms 112028 KB Output is correct
60 Correct 2020 ms 117656 KB Output is correct
61 Correct 117 ms 48988 KB Output is correct
62 Correct 1216 ms 87292 KB Output is correct
63 Correct 1788 ms 116196 KB Output is correct
64 Correct 2027 ms 121696 KB Output is correct
65 Correct 2247 ms 123920 KB Output is correct
66 Correct 2241 ms 116948 KB Output is correct
67 Correct 892 ms 68664 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 37 ms 37376 KB Output is correct
2 Correct 39 ms 37368 KB Output is correct
3 Correct 44 ms 37368 KB Output is correct
4 Correct 41 ms 37368 KB Output is correct
5 Correct 45 ms 37632 KB Output is correct
6 Correct 52 ms 37880 KB Output is correct
7 Correct 44 ms 37632 KB Output is correct
8 Correct 41 ms 37924 KB Output is correct
9 Correct 39 ms 37632 KB Output is correct
10 Correct 44 ms 38008 KB Output is correct
11 Correct 45 ms 37880 KB Output is correct
12 Correct 56 ms 37864 KB Output is correct
13 Correct 47 ms 37624 KB Output is correct
14 Correct 42 ms 37880 KB Output is correct
15 Correct 44 ms 38008 KB Output is correct
16 Correct 41 ms 37880 KB Output is correct
17 Correct 48 ms 37880 KB Output is correct
18 Correct 43 ms 37888 KB Output is correct
19 Correct 40 ms 37880 KB Output is correct
20 Correct 40 ms 37880 KB Output is correct
21 Correct 38 ms 37496 KB Output is correct
22 Correct 43 ms 37624 KB Output is correct
23 Correct 43 ms 37752 KB Output is correct
24 Correct 44 ms 37880 KB Output is correct
25 Correct 45 ms 37880 KB Output is correct
26 Correct 41 ms 37888 KB Output is correct
27 Correct 43 ms 37596 KB Output is correct
28 Correct 47 ms 37880 KB Output is correct
29 Correct 43 ms 37880 KB Output is correct
30 Correct 40 ms 37624 KB Output is correct
31 Correct 3778 ms 173224 KB Output is correct
32 Correct 860 ms 71356 KB Output is correct
33 Correct 2796 ms 155500 KB Output is correct
34 Correct 3779 ms 170384 KB Output is correct
35 Correct 3495 ms 168368 KB Output is correct
36 Correct 3007 ms 157156 KB Output is correct
37 Correct 2315 ms 157000 KB Output is correct
38 Correct 1820 ms 153316 KB Output is correct
39 Correct 1354 ms 152552 KB Output is correct
40 Correct 1294 ms 152928 KB Output is correct
41 Correct 1964 ms 112384 KB Output is correct
42 Correct 2212 ms 115592 KB Output is correct
43 Correct 140 ms 51552 KB Output is correct
44 Correct 2005 ms 114064 KB Output is correct
45 Correct 1688 ms 108644 KB Output is correct
46 Correct 1539 ms 107472 KB Output is correct
47 Correct 797 ms 103816 KB Output is correct
48 Correct 789 ms 104004 KB Output is correct
49 Correct 967 ms 107528 KB Output is correct
50 Correct 1160 ms 113596 KB Output is correct
51 Correct 943 ms 106332 KB Output is correct
52 Runtime error 711 ms 140532 KB Execution killed with signal 11 (could be triggered by violating memory limits)
53 Halted 0 ms 0 KB -