Submission #550921

#TimeUsernameProblemLanguageResultExecution timeMemory
550921BelguteiLightning Rod (NOI18_lightningrod)C++17
4 / 100
1436 ms39920 KiB
#include<bits/stdc++.h> using namespace std; #define ll long long #define ff first #define ss second #define pb push_back #define mk make_pair #define IOS ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); int n; int a,b; map<int,int> mp; int mx = -1; int ans; stack<int> s; int main(){ IOS cin >> n; for(int i = 0; i < n; i++){ cin >> a >> b; int val = a - b; while(s.size()>0){ if(s.top() >= val){ s.pop(); } else break; } s.push(val); } cout << s.size(); }
#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...