Submission #541716

#TimeUsernameProblemLanguageResultExecution timeMemory
541716mihaisabouBaloni (COCI15_baloni)C++11
0 / 100
198 ms6324 KiB
#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 timeMemoryGrader output
Fetching results...