Submission #888343

# Submission time Handle Problem Language Result Execution time Memory
888343 2023-12-17T03:13:19 Z vjudge1 Baloni (COCI15_baloni) C++17
100 / 100
173 ms 4060 KB
#include <bits/stdc++.h>

#define ll long long
#define ios ios::sync_with_stdio(0);cin.tie(0);
#define endl "\n"

using namespace std;

int main(){
    ios
    int n; cin>>n;
    int a, f=0;
    map <int,int> number;
    while (n--){
        cin>>a;
        number[a]++;
        if (number[a+1]!=0) number[a+1]--;
        else f++;
    }
    cout<<f;
    
    return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 1 ms 348 KB Output is correct
5 Correct 173 ms 3920 KB Output is correct
6 Correct 152 ms 4060 KB Output is correct
7 Correct 116 ms 3288 KB Output is correct
8 Correct 131 ms 3272 KB Output is correct
9 Correct 142 ms 3692 KB Output is correct
10 Correct 137 ms 3412 KB Output is correct