# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
654269 | Hanksburger | Baloni (COCI15_baloni) | C++17 | 210 ms | 3932 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>
using namespace std;
multiset<int> s;
int main()
{
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int n, cnt=0;
cin >> n;
for (int i=1; i<=n; i++)
{
int x;
cin >> x;
auto itr=s.lower_bound(x);
if (itr!=s.end() && (*itr)==x)
s.erase(itr);
else
cnt++;
s.insert(x-1);
}
cout << cnt;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |