# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
144040 | model_code | Separator (CEOI19_separator) | C++17 | 302 ms | 11412 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.
#include <cstdio>
#include <vector>
using namespace std;
int main() {
int N;
scanf("%d",&N);
vector<int> separators;
int mx = -1, s = 0;
while (N--) {
int b;
scanf("%d",&b);
int a = (b + s) % 1000000000;
if (a > mx) {
separators.push_back(a);
mx = a;
} else {
while (!separators.empty() && separators.back() > a) separators.pop_back();
}
printf("%d\n",s = separators.size());
}
}
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... |