제출 #733820

#제출 시각아이디문제언어결과실행 시간메모리
733820vjudge1Lightning Rod (NOI18_lightningrod)C++17
21 / 100
1500 ms304 KiB
#include<bits/stdc++.h> using namespace std; int n, x, y, sx, sy, ans = 1; void sol() { if(sx + sy >= x + y) { return; } if(sx - sy < x - y) { ans++; } sx = x; sy = y; return; } int 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...