Submission #949021

# Submission time Handle Problem Language Result Execution time Memory
949021 2024-03-18T19:29:59 Z anotherPROgrammer Best Place (NOI17_bestplace) C++14
3 / 100
54 ms 1364 KB
#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
1 Correct 1 ms 344 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 344 KB Output is correct
5 Correct 0 ms 344 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 344 KB Output is correct
2 Incorrect 1 ms 348 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 38 ms 1364 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 344 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 344 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 54 ms 1116 KB Output isn't correct
2 Halted 0 ms 0 KB -