Submission #708990

# Submission time Handle Problem Language Result Execution time Memory
708990 2023-03-13T03:38:54 Z vjudge1 Baloni (COCI15_baloni) C++17
100 / 100
292 ms 548 KB
#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
1 Correct 1 ms 340 KB Output is correct
2 Correct 1 ms 340 KB Output is correct
3 Correct 2 ms 340 KB Output is correct
4 Correct 2 ms 340 KB Output is correct
5 Correct 288 ms 548 KB Output is correct
6 Correct 292 ms 488 KB Output is correct
7 Correct 219 ms 344 KB Output is correct
8 Correct 227 ms 352 KB Output is correct
9 Correct 256 ms 384 KB Output is correct
10 Correct 255 ms 460 KB Output is correct