# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1114626 | expert007 | Lightning Rod (NOI18_lightningrod) | C++14 | 0 ms | 0 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "bits/stdc++.h"
using namespace std;
#define ull unsigned long long
#define int long long
const int MOD = 1e9 + 7;
void setIO() {
cin.tie(0)->sync_with_stdio(0);
}
void solve() {
int n;
cin >> n;
vector<pair<int, int>> a(n);
for (int i = 0; i < n; i++) {
cin >> a[i].first >> a[i].second;
}
sort(a.begin(), a.end());
int ct = 0;
if(a[0].second < a[1].second){
if(a[1].first - a[0].first <= a[1].second - a[0].second]){
ct = 1;
}
else{
ct = 2;
}
}
else if(a[0].second > a[1].second){
if(a[0].first - a[1].first <= a[0].second - a[1].second]){
ct = 1;
}
else{ct = 2;}
}
else{
ct = 2;
}
cout << ct << endl;
}
int32_t main() {
setIO();
solve();
return 0;
}