# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
541839 | Olympia | Baloni (COCI15_baloni) | C++17 | 53 ms | 7252 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 <vector>
#include <algorithm>
#include <iostream>
#include <set>
#include <cmath>
#include <map>
#include <random>
#include <cassert>
#include <ctime>
#include <cstdlib>
#include <limits.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int N;
cin >> N;
vector<int64_t> v(N); for (int i = 0; i < N; i++) cin >> v[i];
int cntr = 0;
for (int i = 1; i < N; i++) {
if (v[i] == v[i - 1] - 1) {
cntr++;
}
}
cout << cntr + 1;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |