Submission #146974

#TimeUsernameProblemLanguageResultExecution timeMemory
146974dongwon0427Lightning Rod (NOI18_lightningrod)C++14
0 / 100
2043 ms79780 KiB
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int,int> pii; int n; pii A[10000005]; int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); cin>>n; for(int i=0;i<n;i++) cin>>A[i].first>>A[i].second; int m1=0, m2=0; for(int i=1;i<n;i++) { if(A[i].first + A[i].second > A[m1].first + A[m1].second) m1 = i; if(A[i].second - A[i].first > A[m2].second - A[m2].first) m2 = i; } if(m1 == m2) cout<<1; else cout<<2; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...