# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
733832 | vjudge1 | Lightning Rod (NOI18_lightningrod) | C++17 | 1740 ms | 276 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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() {
cin >> n;
cin >> x >> y;
sx = x;
sy = y;
for(int i = 1; i < n; i++) {
scanf("%d", &x);
scanf("%d", &y);
sol();
}
cout << ans;
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |