Submission #154268

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