Submission #154266

#TimeUsernameProblemLanguageResultExecution timeMemory
154266mirceaishereBaloni (COCI15_baloni)C++14
100 / 100
354 ms27436 KiB
#include <iostream> #include <vector> using namespace std; int n, i, j, x, f[1000005], sol, nrcrt, h, ant; vector<int>a[1000005]; int main(){ cin>>n; for(i=1; i<=n; i++){ cin>>x; f[x]++; if(f[x+1]==0){ sol++; }else{ f[x+1]--; } } cout<<sol; }
#Verdict Execution timeMemoryGrader output
Fetching results...