This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <iostream>
#include <vector>
#include <cmath>
using namespace std;
int main() {
int n;
cin >> n;
vector<int> x_coordinates(n);
vector<int> y_coordinates(n);
// Input coordinates of participants
for (int i = 0; i < n; ++i) {
cin >> x_coordinates[i] >> y_coordinates[i];
}
// Calculate the sum of x and y coordinates separately
int sum_x = 0, sum_y = 0;
for (int i = 0; i < n; ++i) {
sum_x += x_coordinates[i];
sum_y += y_coordinates[i];
}
// Find the average coordinates
int avg_x = round(static_cast<double>(sum_x) / n);
int avg_y = round(static_cast<double>(sum_y) / n);
// Output the average coordinates
cout << avg_x << " " << avg_y << endl;
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |