Submission #154131

#TimeUsernameProblemLanguageResultExecution timeMemory
154131Linca_RobertBaloni (COCI15_baloni)C++14
100 / 100
656 ms3916 KiB
#include<bits/stdc++.h> using namespace std; int N, arr[1000005]; multiset<int> S; int main(){ cin >> N; for( int i = 1; i <= N; i++ ) cin >> arr[i]; for( int i = 1; i <= N; i++ ){ if( S.find( arr[i] ) != S.end() ){ S.erase( S.find( arr[i] ) ); } S.insert( arr[i] - 1 ); } cout << (int)(S.size()) << endl; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...