Submission #516353

# Submission time Handle Problem Language Result Execution time Memory
516353 2022-01-21T08:00:12 Z Jomnoi Best Place (NOI17_bestplace) C++17
100 / 100
42 ms 3268 KB
#include <bits/stdc++.h>
#define DEBUG 0
using namespace std;

int main() {
    int n;
    scanf(" %d", &n);
    vector <int> X, Y;
    for(int i = 1; i <= n; i++) {
        int x, y;
        scanf(" %d %d", &x, &y);
        X.push_back(x);
        Y.push_back(y);
    }
    sort(X.begin(), X.end());
    sort(Y.begin(), Y.end());
    if(n % 2 == 0) {
        X[n / 2] = (X[n / 2 - 1] + X[n / 2]) / 2;
        Y[n / 2] = (Y[n / 2 - 1] + Y[n / 2]) / 2;
    }

    printf("%d %d", X[n / 2], Y[n / 2]);
    return 0;
}

Compilation message

bestplace.cpp: In function 'int main()':
bestplace.cpp:7:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
    7 |     scanf(" %d", &n);
      |     ~~~~~^~~~~~~~~~~
bestplace.cpp:11:14: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   11 |         scanf(" %d %d", &x, &y);
      |         ~~~~~^~~~~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 0 ms 292 KB Output is correct
3 Correct 1 ms 284 KB Output is correct
4 Correct 0 ms 204 KB Output is correct
5 Correct 0 ms 288 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 276 KB Output is correct
4 Correct 1 ms 204 KB Output is correct
5 Correct 1 ms 300 KB Output is correct
6 Correct 1 ms 204 KB Output is correct
7 Correct 1 ms 204 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 23 ms 2364 KB Output is correct
2 Correct 35 ms 2444 KB Output is correct
3 Correct 31 ms 2396 KB Output is correct
4 Correct 23 ms 2436 KB Output is correct
5 Correct 24 ms 2360 KB Output is correct
6 Correct 30 ms 2528 KB Output is correct
7 Correct 27 ms 2344 KB Output is correct
8 Correct 27 ms 2340 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 292 KB Output is correct
4 Correct 1 ms 204 KB Output is correct
5 Correct 0 ms 204 KB Output is correct
6 Correct 1 ms 204 KB Output is correct
7 Correct 1 ms 292 KB Output is correct
8 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 204 KB Output is correct
4 Correct 1 ms 204 KB Output is correct
5 Correct 1 ms 204 KB Output is correct
6 Correct 1 ms 204 KB Output is correct
7 Correct 1 ms 204 KB Output is correct
8 Correct 1 ms 204 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 37 ms 3092 KB Output is correct
2 Correct 40 ms 3148 KB Output is correct
3 Correct 29 ms 3268 KB Output is correct
4 Correct 36 ms 2452 KB Output is correct
5 Correct 39 ms 3108 KB Output is correct
6 Correct 36 ms 3224 KB Output is correct
7 Correct 37 ms 3128 KB Output is correct
8 Correct 42 ms 3224 KB Output is correct