Submission #153876

#TimeUsernameProblemLanguageResultExecution timeMemory
153876nicolaalexandraBaloni (COCI15_baloni)C++14
100 / 100
330 ms452 KiB
#include <iostream> using namespace std; int n,i,j,x,sol; int f[1000010]; int main (){ cin>>n; for (i=1;i<=n;i++){ cin>>x; if (f[x+1]){ f[x+1]--; f[x]++; } else { sol++; f[x]++; }} cout<<sol; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...