Submission #31644

# Submission time Handle Problem Language Result Execution time Memory
31644 2017-08-30T08:15:05 Z qwerty Baloni (COCI15_baloni) C++11
100 / 100
103 ms 9988 KB
#include <bits/stdc++.h>

using namespace std;

long long n, dd[1000005], cnt(0), a;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cin >> n;
    fill_n(dd, 1000005, 0);
    for (int i=1; i<=n; ++i)
    {
        cin >> a;
        dd[a]++;
        if (dd[a+1] > 0) dd[a+1]--;
        else cnt++;
    }
    cout << cnt;
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 9988 KB Output is correct
2 Correct 0 ms 9988 KB Output is correct
3 Correct 0 ms 9988 KB Output is correct
4 Correct 0 ms 9988 KB Output is correct
5 Correct 103 ms 9988 KB Output is correct
6 Correct 76 ms 9988 KB Output is correct
7 Correct 59 ms 9988 KB Output is correct
8 Correct 69 ms 9988 KB Output is correct
9 Correct 69 ms 9988 KB Output is correct
10 Correct 76 ms 9988 KB Output is correct