Submission #154279

#TimeUsernameProblemLanguageResultExecution timeMemory
154279denmirceaBaloni (COCI15_baloni)C++14
100 / 100
402 ms636 KiB
#include <iostream> #include <unordered_map> using namespace std; int i,n,ok,x,nr,d,y,j,k,v[1001]; short fr[200][30]; int sum[200]; unordered_map <int, int> m; int main(){ cin>>n; for(i=1;i<=n;i++){ cin>>x; if(m[x+1]==0){ nr++; m[x]++; } else { m[x+1]--; m[x]++; } } cout<<nr; }
#Verdict Execution timeMemoryGrader output
Fetching results...