Submission #1063854

#TimeUsernameProblemLanguageResultExecution timeMemory
1063854LuvidiLightning Rod (NOI18_lightningrod)C++17
21 / 100
937 ms432 KiB
#include <bits/stdc++.h> using namespace std; #define ll long long #define pll pair<ll, ll> #define pii pair<int, int> #define fs first #define sc second #define pb push_back void solve() { int n; cin>>n; int ans=0,x1,x2; while(n--){ int x,y; cin>>x>>y; if(!ans){ ans++; x1=x+y; x2=y-x; continue; } if(x+y<=x1)continue; if(y-x<x2){ ans++; } x1=max(x1,x+y); x2=min(x2,y-x); } cout<<ans; } int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); solve(); }
#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...