Submission #604183

#TimeUsernameProblemLanguageResultExecution timeMemory
604183Hussein3600Baloni (COCI15_baloni)C++14
100 / 100
383 ms3960 KiB
#include<bits/stdc++.h> using namespace std ; typedef long long ll ; const int N=1e6 ; int n , a ,ans=0 ; int main() { cin>>n; multiset<ll>s; for(int i=0;i<n;i++) { cin >> a ; if(s.find(a)==s.end())ans++,s.insert(a-1); else { s.erase(s.find(a)) ; s.insert(a-1) ; } } cout<<ans<<endl; }
#Verdict Execution timeMemoryGrader output
Fetching results...