# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
104302 | tduong0806 | Baloni (COCI15_baloni) | C++14 | 286 ms | 504 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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+1]) r++,d[x]=1;
else d[x+1]--,d[x]++;
}
cout<<r;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |