Submission #491994

#TimeUsernameProblemLanguageResultExecution timeMemory
491994nemethmSeparator (CEOI19_separator)C++17
90 / 100
1212 ms17460 KiB
#include <cstdint> #include <cstdio> #include <cstdlib> #include <iostream> #include <vector> #include <deque> #include <set> #include <map> #include <stack> #include <string> #include <limits> #include <assert.h> #include <cmath> #include <algorithm> using namespace std; using ll = long long int; const ll mod = 1e9; int main(){ cin.tie(0); ios_base::sync_with_stdio(false); int n; cin >> n; stack<ll> sep; ll max_e = 0; for(int i = 0; i < n; ++i){ ll b; cin >> b; b = (b + sep.size()) % mod; max_e = max(max_e, b); while(!sep.empty() && sep.top() >= b){ sep.pop(); } if(max_e == b) sep.push(b); cout << sep.size() << endl; } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...