Submission #153883

#TimeUsernameProblemLanguageResultExecution timeMemory
153883mihnea_anghelBaloni (COCI15_baloni)C++17
100 / 100
341 ms504 KiB
#include <iostream> using namespace std; int fr[1100000], n, i, x, sol; int main() { cin>>n; for ( i=1; i <= n; i++ ){ cin>>x; if ( !fr[x] ){ sol++; fr[x-1]++; } else { fr[x]--; fr[x-1]++; } } cout<<sol; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...