# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
541716 | mihaisabou | Baloni (COCI15_baloni) | C++11 | 198 ms | 6324 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 <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
vector<int> v(n + 1);
for (int i{}; i < n; ++i) {
cin >> v[i];
}
int nr = 1;
for (int i{}; i < n; ++i) {
if (v[i - 1] <= v[i] or v[i - 1] - 1 != v[i]) {
++nr;
}
}
cout << nr;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |