Submission #500591

# Submission time Handle Problem Language Result Execution time Memory
500591 2021-12-31T13:28:09 Z rajatshenoi Best Place (NOI17_bestplace) C++14
100 / 100
86 ms 3080 KB
#include <bits/stdc++.h>

using namespace std;

int main(int argc, char const *argv[])
{
	int N;
	cin >> N;

	int x[N];
	int y[N];

	for (int i = 0; i < N; i++)
	{
		cin >> x[i];
		cin >> y[i];
	}

	sort(x, x + N);
	sort(y, y + N);

	int minx;
	int miny;

	if (N % 2 == 0)
	{
		minx = (x[N / 2 - 1] + x[(N + 1) / 2 - 1]) / 2;
		miny = (y[N / 2 - 1] + y[(N + 1) / 2 - 1]) / 2;
	}
	else
	{
		minx = x[N / 2];
		miny = y[N / 2];
	}

	cout << minx << " " << miny << "\n";

	return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 0 ms 204 KB Output is correct
3 Correct 0 ms 288 KB Output is correct
4 Correct 0 ms 204 KB Output is correct
5 Correct 0 ms 204 KB Output is correct
6 Correct 0 ms 204 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 1 ms 272 KB Output is correct
4 Correct 1 ms 292 KB Output is correct
5 Correct 1 ms 204 KB Output is correct
6 Correct 1 ms 296 KB Output is correct
7 Correct 1 ms 204 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 49 ms 2052 KB Output is correct
2 Correct 57 ms 2192 KB Output is correct
3 Correct 57 ms 2188 KB Output is correct
4 Correct 52 ms 2184 KB Output is correct
5 Correct 56 ms 2216 KB Output is correct
6 Correct 58 ms 2184 KB Output is correct
7 Correct 56 ms 2056 KB Output is correct
8 Correct 57 ms 2116 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 0 ms 204 KB Output is correct
3 Correct 0 ms 204 KB Output is correct
4 Correct 0 ms 204 KB Output is correct
5 Correct 0 ms 292 KB Output is correct
6 Correct 0 ms 292 KB Output is correct
7 Correct 0 ms 204 KB Output is correct
8 Correct 0 ms 300 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 1 ms 300 KB Output is correct
4 Correct 1 ms 204 KB Output is correct
5 Correct 1 ms 308 KB Output is correct
6 Correct 1 ms 204 KB Output is correct
7 Correct 1 ms 300 KB Output is correct
8 Correct 1 ms 300 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 86 ms 2948 KB Output is correct
2 Correct 84 ms 2948 KB Output is correct
3 Correct 74 ms 2948 KB Output is correct
4 Correct 63 ms 2276 KB Output is correct
5 Correct 85 ms 2884 KB Output is correct
6 Correct 83 ms 2964 KB Output is correct
7 Correct 85 ms 2944 KB Output is correct
8 Correct 86 ms 3080 KB Output is correct