Submission #153881

#TimeUsernameProblemLanguageResultExecution timeMemory
153881vladciuperceanuBaloni (COCI15_baloni)C++14
0 / 100
338 ms7452 KiB
#include <iostream> using namespace std; int n,i,v[1000005],f[1000005]; int main() { cin >> n; for (i=1; i<=n; i++) cin >> v[i]; f[v[1]] = 1; int sol = 1; for (i=2; i<=n; i++) { if (f[v[i]+1] == 0) sol++; f[v[i]] = 1; } cout << sol; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...