#include "bits/stdc++.h"
#include "elephants.h"
using namespace std;
int n, l;
int *x;
void init(int N, int L, int X[])
{
n = N;
l = L;
x = X;
}
int solve()
{
int len = x[0];
len+=l;
int res = 1;
for(int j = 1; j<n; j++)
{
if(x[j]>len)
{
res++;
len+=l;
}
}
return res;
}
int update(int i, int y)
{
x[i] = y;
int j = i;
while(j<n-1)
{
if(x[i]>x[i+1])
swap(x[i], x[i+1]);
else
break;
j++;
}
j = i;
while(j>0)
{
if(x[i]<x[i-1])
swap(x[i], x[i-1]);
else
break;
j--;
}
int res = solve();
return res;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
332 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
332 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
332 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
332 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
332 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |