# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
104303 | tduong0806 | Baloni (COCI15_baloni) | C++14 | 242 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]) r++,d[x-1]=1;
else d[x]--,d[x-1]++;
}
cout<<r;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |