Submission #154023

#TimeUsernameProblemLanguageResultExecution timeMemory
154023RaresRoscaBaloni (COCI15_baloni)C++14
100 / 100
342 ms7288 KiB
#include <iostream> using namespace std; int i,n,j,v[1000010],sageata,f[1000010]; int main(){ cin>>n; for(i=1;i<=n;i++) cin>>v[i]; for(i=1;i<=n;i++){ if(f[v[i]]==0) sageata++; if(f[v[i]]>0) f[v[i]]--; f[v[i]-1]++; } cout<<sageata; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...