Submission #733803

#TimeUsernameProblemLanguageResultExecution timeMemory
733803vjudge1Lightning Rod (NOI18_lightningrod)C++17
14 / 100
1600 ms112648 KiB
#include<bits/stdc++.h> using namespace std; #define int long long int n, x, y, sx, sy, ans = 1; void sol() { if(sx + sy >= x + y) { return; } if(max(sx, sy) - min(sx, sy) < max(x, y) - min(x, y)) { ans++; } sx = x; sy = y; return; } signed main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); cin >> n; cin >> x >> y; sx = x; sy = y; for(int i = 1; i < n; i++) { cin >> x >> y; sol(); } cout << ans; 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...