Submission #674885

#TimeUsernameProblemLanguageResultExecution timeMemory
674885QwertyPiLightning Rod (NOI18_lightningrod)C++14
14 / 100
1434 ms188172 KiB
#include <bits/stdc++.h> using namespace std; const int N = 1e7 + 11; int p[N][2], pi = 0; int main(){ cin.tie(0); cout.tie(0)->sync_with_stdio(false); int n; cin >> n; for(int i = 0; i < n; i++){ int x, y; cin >> x >> y; while(pi > 0 && abs(p[pi - 1][0] - x) <= y - p[pi - 1][1]) pi--; if(abs(p[pi - 1][0] - x) <= p[pi - 1][1] - y) continue; p[pi][0] = x, p[pi][1] = y; pi++; } cout << pi << endl; }
#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...