Submission #154273

#TimeUsernameProblemLanguageResultExecution timeMemory
154273mihaicanBaloni (COCI15_baloni)C++14
0 / 100
343 ms6756 KiB
#include <iostream> #include <algorithm> using namespace std; int n,v[1000010],f[1000010],sum,of; int main(){ cin>>n; for(int i=1;i<=n;i++){ cin>>v[i]; } for(int i=1;i<=n;i++){ if(f[v[i]]>=0) of++; else f[v[i]]--; f[v[i]-1]++; } cout<<of; }
#Verdict Execution timeMemoryGrader output
Fetching results...