# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
839112 | Bula | Baloni (COCI15_baloni) | C++14 | 259 ms | 4044 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;
#define ll long long
#define pb push_back
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(),x.rend()
#define ff first
#define sc second
#define int ll
const ll mod = 1e9 + 7, N = 1e5 + 1;
main(){
int n;
cin >> n;
map<int, int> mp;
int ans = 0;
for(int i = 1; i <= n; i++){
int x;
cin >> x;
mp[x]++;
if(mp[x + 1] > 0) mp[x + 1] --;
else ans ++;
}
cout << ans << endl;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |