# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
491997 | nemethm | Separator (CEOI19_separator) | C++17 | 1284 ms | 15208 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.
#pragma GCC target ("avx2")
#pragma GCC optimization ("O3")
#pragma GCC optimization ("unroll-loops")
#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;
}
}
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... |