Submission #499805

# Submission time Handle Problem Language Result Execution time Memory
499805 2021-12-29T13:49:12 Z ccno1 Best Place (NOI17_bestplace) C++17
100 / 100
91 ms 2200 KB
#include <bits/stdc++.h>
#include <climits>
#define ll long long int
#define all(x) (x).begin(), (x).end()
const ll inf = LLONG_MAX;

using namespace std;

ll nxt(){
    ll x = 0;
    cin >> x;
    return x;
}

template <typename type>
istream &operator>>(istream &in, vector <type> &vec){
    ll len = vec.size();
    for(int i = 0; i < len; i++){
        in >> vec[i];
    }
    return in;
}

template <typename type>
ostream &operator<<(ostream &out, vector <type> &vec){
    for (auto val : vec){
        out << val << " ";
    }
    return out;
}

ll round_n(double a){
    if(a - floor(a) > 0.5){
        return ceil(a);
    }else{
        return floor(a);
    }
}

void testcase(){
    ll n = nxt();
    vector <int> x(n);
    vector <int> y(n);
    for(int i = 0;i < n ; i++){
        x[i] = nxt();
        y[i] = nxt();
    }
    sort(all(x));
    sort(all(y));
    cout << x[floor(n/2)] << " " << y[floor(n/2)] << endl;
}

int main(){
    ios_base::sync_with_stdio;
    cin.tie(0);
    cout.tie(0);
    
    testcase();
    
    return 0;
}













Compilation message

bestplace.cpp: In function 'int main()':
bestplace.cpp:54:15: warning: statement is a reference, not call, to function 'std::ios_base::sync_with_stdio' [-Waddress]
   54 |     ios_base::sync_with_stdio;
      |     ~~~~~~~~~~^~~~~~~~~~~~~~~
bestplace.cpp:54:15: warning: statement has no effect [-Wunused-value]
# Verdict Execution time Memory Grader output
1 Correct 1 ms 288 KB Output is correct
2 Correct 0 ms 296 KB Output is correct
3 Correct 0 ms 204 KB Output is correct
4 Correct 0 ms 204 KB Output is correct
5 Correct 0 ms 292 KB Output is correct
6 Correct 0 ms 204 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 296 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 1 ms 296 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 292 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 46 ms 1392 KB Output is correct
2 Correct 57 ms 1400 KB Output is correct
3 Correct 63 ms 1584 KB Output is correct
4 Correct 49 ms 1612 KB Output is correct
5 Correct 55 ms 1656 KB Output is correct
6 Correct 60 ms 1656 KB Output is correct
7 Correct 67 ms 1612 KB Output is correct
8 Correct 53 ms 1612 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 296 KB Output is correct
2 Correct 0 ms 204 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Correct 0 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 204 KB Output is correct
8 Correct 1 ms 204 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 292 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 2 ms 204 KB Output is correct
4 Correct 1 ms 204 KB Output is correct
5 Correct 2 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 308 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 90 ms 1560 KB Output is correct
2 Correct 86 ms 2144 KB Output is correct
3 Correct 71 ms 2116 KB Output is correct
4 Correct 64 ms 1676 KB Output is correct
5 Correct 86 ms 2168 KB Output is correct
6 Correct 91 ms 2200 KB Output is correct
7 Correct 89 ms 2180 KB Output is correct
8 Correct 91 ms 2168 KB Output is correct