# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1112453 | vjudge1 | Baloni (COCI15_baloni) | C++14 | 210 ms | 7524 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
#define int long long
using namespace std;
int32_t main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
int n;
cin>>n;
int a[n];
multiset<int> st;
int cnt=0;
for(int i=0;i<n;i++){
cin>>a[i];
if(st.find(a[i]+1)!=st.end())st.erase(st.find(a[i]+1));
else cnt++;
st.insert(a[i]);
}
cout<<cnt;
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |