Submission #654771

#TimeUsernameProblemLanguageResultExecution timeMemory
6547710x9oBest Place (NOI17_bestplace)C++14
3 / 100
35 ms3012 KiB
#include <bits/stdc++.h>
using namespace std;

int query(int* K, int l) {
	int sum = K[0] + K[l-1];
	// cout << K[0] << " " << K[l-1] << "\n";
	if (sum%2 != 0) {
		return ((sum/2) + 1);
	}
	return (sum/2);
}

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

	int N;
	std::cin >> N;

	int X[N], Y[N];

	for (int i=0; i<N; i++) {
		std::cin >> X[i] >> Y[i];
	}

	std::sort(X, X+N);
	std::sort(Y, Y+N);

	std::cout << query(X, N) << " " << query(Y, N) << "\n";
	return 0;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...