Submission #267197

#TimeUsernameProblemLanguageResultExecution timeMemory
267197taulantSeparator (CEOI19_separator)C++17
90 / 100
1242 ms6908 KiB
#include<bits/stdc++.h> using namespace std; int main(){ int n; cin >> n; int maxval = 0; stack<int> s; for(int i=0; i<n; ++i){ int x; cin >> x; x = (x + s.size()) % 1000000000; if(x >= maxval) s.push(maxval = x); else while(s.size() && s.top() > x) s.pop(); cout << s.size() << "\n"; } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...