Submission #153877

# Submission time Handle Problem Language Result Execution time Memory
153877 2019-09-17T07:38:19 Z Divia Baloni (COCI15_baloni) C++14
100 / 100
335 ms 476 KB
#include <iostream>
#include <algorithm>
using namespace std;
//ifstream cin("karte.in");
//ofstream cout("karte.out");
int n,i,j,f[1000010],x,sol;
long long total;
int main()
{
    cin>>n;
    for(i=1;i<=n;i++){
        cin>>x;
        if(f[x+1])
            f[x+1]--;
        else sol++;
        f[x]++;
    }
    cout<<sol;
    return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 2 ms 256 KB Output is correct
2 Correct 3 ms 256 KB Output is correct
3 Correct 4 ms 376 KB Output is correct
4 Correct 4 ms 380 KB Output is correct
5 Correct 326 ms 376 KB Output is correct
6 Correct 335 ms 376 KB Output is correct
7 Correct 272 ms 476 KB Output is correct
8 Correct 268 ms 396 KB Output is correct
9 Correct 298 ms 372 KB Output is correct
10 Correct 295 ms 376 KB Output is correct