Submission #104304

# Submission time Handle Problem Language Result Execution time Memory
104304 2019-04-05T02:42:20 Z tduong0806 Baloni (COCI15_baloni) C++14
100 / 100
227 ms 504 KB
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N=1e6+10;
int n,x,d[N],r;
int main()
{
    cin>>n;
    while(n--)
    {
        cin>>x;
        if(!d[x]) r++,d[x-1]++;
        else d[x]--,d[x-1]++;
    }
    cout<<r;
}
# Verdict Execution time Memory Grader output
1 Correct 3 ms 384 KB Output is correct
2 Correct 3 ms 384 KB Output is correct
3 Correct 3 ms 384 KB Output is correct
4 Correct 3 ms 384 KB Output is correct
5 Correct 227 ms 376 KB Output is correct
6 Correct 219 ms 376 KB Output is correct
7 Correct 182 ms 384 KB Output is correct
8 Correct 167 ms 376 KB Output is correct
9 Correct 200 ms 376 KB Output is correct
10 Correct 198 ms 504 KB Output is correct