# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1153491 | Aldk | Baloni (COCI15_baloni) | C++20 | 255 ms | 584 KiB |
#include <bits/stdc++.h>
#define ll long long
#define ff first
#define ss second
#define pb push_back
#define mp make_pair
#define sz size()
using namespace std;
int main() {
ll n;
cin>>n;
ll a,x=0;
map<ll,ll> m;
for(int i=0;i<n;i++){
cin>>a;
if(m[a+1]==0) x++;
else m[a+1]--;
m[a]++;
}
cout<<x;
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |