Submission #154257

# Submission time Handle Problem Language Result Execution time Memory
154257 2019-09-19T16:23:54 Z Radugnn Baloni (COCI15_baloni) C++14
100 / 100
334 ms 3940 KB
#include <iostream>
#include <bitset>
using namespace std;
int n,i,x,f[1000010],sol;
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 3 ms 376 KB Output is correct
2 Correct 3 ms 376 KB Output is correct
3 Correct 4 ms 376 KB Output is correct
4 Correct 5 ms 376 KB Output is correct
5 Correct 330 ms 3940 KB Output is correct
6 Correct 334 ms 3832 KB Output is correct
7 Correct 274 ms 3192 KB Output is correct
8 Correct 282 ms 3160 KB Output is correct
9 Correct 302 ms 3548 KB Output is correct
10 Correct 296 ms 3420 KB Output is correct