이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
//made by djsksbrbf
#include <bits/stdc++.h>
using namespace std;
typedef pair<int, int> pii;
typedef long long ll;
int main(){
ios_base::sync_with_stdio(0);
cin.tie(0);
int n; cin >> n;
vector <pair<int, int>> v;
for(int i = 0 ; i < n ; i++){
int x, y; cin >> x >> y;
v.push_back({x, y});
}
pii prev1 = {0, 0}, prev2 = {0, 0};
while(v.size() > 2){
prev1 = *v.begin();
prev2 = v.back();
v.erase(v.begin());
v.pop_back();
}
if(v.size() == 1)cout << v[0].first << ' ' << v[0].second << endl;
else{
if(prev1 == v[0])cout << v[0].first << ' ' << v[0].second << endl;
else if(prev2 == v[1])cout << v[1].first << ' ' << v[1].second << endl;
else cout << (v[0].first + v[1].first) / 2 << ' ' << (v[0].second + v[1].second) / 2 << endl;
}
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |