Submission #240832

#TimeUsernameProblemLanguageResultExecution timeMemory
240832bananamathsBaloni (COCI15_baloni)C++17
0 / 100
296 ms8312 KiB
#include<bits/stdc++.h> using namespace std; int main() { int N; cin>>N; int V[N]; for(int i = 0 ;i<N;i++) { cin>>V[i]; } bool H[1000002]; int conta = 0; for(int i = 1;i<=1000001;i++) { H[i] = false; } for(int i = 0;i<N;i++) { int a = V[i]; if(H[a+1]) { H[a+1] = false; H[a] = true; } else { conta++; H[a] = true; } } cout<<conta; }
#Verdict Execution timeMemoryGrader output
Fetching results...