Submission #494775

# Submission time Handle Problem Language Result Execution time Memory
494775 2021-12-16T08:22:45 Z AJ00 Best Place (NOI17_bestplace) C++14
100 / 100
47 ms 3260 KB
#include <bits/stdc++.h>
using namespace std;
vector<int> xs,ys;
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    int t=1,n,x,y; 
    //cin >> t; 
    while (t--){
        cin >> n;
      for (int i = 0; i < n; i++){
        cin >> x >> y;
        xs.push_back(x);
        ys.push_back(y);
      }
      sort(xs.begin(),xs.end());
      sort(ys.begin(),ys.end());
      if (n%2==1){
        cout << xs[(n/2)] << " " << ys[(n/2)] << "\n";
      }
      else {
        cout << (xs[n/2]+xs[(n/2)-1])/2 << " " << (ys[n/2]+ys[(n/2)-1])/2 << "\n";
      }
    }
    return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 0 ms 296 KB Output is correct
3 Correct 1 ms 208 KB Output is correct
4 Correct 0 ms 208 KB Output is correct
5 Correct 0 ms 208 KB Output is correct
6 Correct 0 ms 208 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 336 KB Output is correct
2 Correct 0 ms 320 KB Output is correct
3 Correct 1 ms 296 KB Output is correct
4 Correct 1 ms 320 KB Output is correct
5 Correct 1 ms 336 KB Output is correct
6 Correct 1 ms 336 KB Output is correct
7 Correct 1 ms 336 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 18 ms 2352 KB Output is correct
2 Correct 22 ms 2488 KB Output is correct
3 Correct 30 ms 2392 KB Output is correct
4 Correct 20 ms 2464 KB Output is correct
5 Correct 20 ms 2352 KB Output is correct
6 Correct 27 ms 2352 KB Output is correct
7 Correct 24 ms 2364 KB Output is correct
8 Correct 33 ms 2368 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 208 KB Output is correct
2 Correct 1 ms 208 KB Output is correct
3 Correct 0 ms 208 KB Output is correct
4 Correct 1 ms 208 KB Output is correct
5 Correct 1 ms 208 KB Output is correct
6 Correct 1 ms 208 KB Output is correct
7 Correct 1 ms 208 KB Output is correct
8 Correct 1 ms 208 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 336 KB Output is correct
2 Correct 1 ms 324 KB Output is correct
3 Correct 1 ms 336 KB Output is correct
4 Correct 1 ms 320 KB Output is correct
5 Correct 1 ms 328 KB Output is correct
6 Correct 1 ms 324 KB Output is correct
7 Correct 1 ms 336 KB Output is correct
8 Correct 1 ms 336 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 47 ms 3244 KB Output is correct
2 Correct 38 ms 3140 KB Output is correct
3 Correct 29 ms 3260 KB Output is correct
4 Correct 33 ms 2492 KB Output is correct
5 Correct 41 ms 3176 KB Output is correct
6 Correct 40 ms 3260 KB Output is correct
7 Correct 46 ms 3128 KB Output is correct
8 Correct 40 ms 3124 KB Output is correct