Submission #526775

# Submission time Handle Problem Language Result Execution time Memory
526775 2022-02-16T04:54:47 Z kabika Best Place (NOI17_bestplace) C++14
100 / 100
37 ms 4040 KB
#include <bits/stdc++.h>
using namespace std;
#define ll long long

int main()
{
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n;
  cin >> n;
  vector<ll> x(n,0), y(n,0);
  for(int i = 0; i<n; i++)
  {
    cin >> x[i] >> y[i];
  }
  sort(x.begin(),x.end());
  sort(y.begin(),y.end());
  if(n%2==0)
  {
    ll xp = (x[n/2] + x[n/2 - 1])/2;
    ll yp = (y[n/2] + y[n/2 - 1])/2;
    cout << xp << " " << yp << '\n';
  }
  else
  {
    ll xp = x[n/2];
    ll yp = y[n/2];
    cout << xp << " " << yp << '\n';
  }
  return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 208 KB Output is correct
2 Correct 1 ms 292 KB Output is correct
3 Correct 0 ms 208 KB Output is correct
4 Correct 1 ms 316 KB Output is correct
5 Correct 1 ms 208 KB Output is correct
6 Correct 1 ms 208 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 320 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 336 KB Output is correct
5 Correct 1 ms 316 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 15 ms 2860 KB Output is correct
2 Correct 23 ms 3036 KB Output is correct
3 Correct 22 ms 3032 KB Output is correct
4 Correct 18 ms 3016 KB Output is correct
5 Correct 20 ms 3032 KB Output is correct
6 Correct 26 ms 3016 KB Output is correct
7 Correct 24 ms 2904 KB Output is correct
8 Correct 23 ms 3028 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 1 ms 208 KB Output is correct
4 Correct 0 ms 208 KB Output is correct
5 Correct 1 ms 312 KB Output is correct
6 Correct 1 ms 208 KB Output is correct
7 Correct 0 ms 208 KB Output is correct
8 Correct 1 ms 316 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 336 KB Output is correct
2 Correct 1 ms 336 KB Output is correct
3 Correct 1 ms 336 KB Output is correct
4 Correct 1 ms 336 KB Output is correct
5 Correct 1 ms 352 KB Output is correct
6 Correct 1 ms 356 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 34 ms 3776 KB Output is correct
2 Correct 34 ms 3784 KB Output is correct
3 Correct 24 ms 4040 KB Output is correct
4 Correct 31 ms 3108 KB Output is correct
5 Correct 33 ms 3764 KB Output is correct
6 Correct 37 ms 3800 KB Output is correct
7 Correct 33 ms 3784 KB Output is correct
8 Correct 32 ms 3772 KB Output is correct