#include "elephants.h"
#include <bits/stdc++.h>
using namespace std;
const int nx=150005;
int n, l, v[nx];
multiset<int> ms;
void init(int N, int L, int X[])
{
n=N; l=L;
for (int i=0; i<N; i++) v[i]=X[i], ms.emplace(X[i]);
}
int update(int i, int y)
{
ms.erase(ms.find(v[i]));
v[i]=y;
ms.insert(v[i]);
int tmp=INT_MIN, cnt=0;
for (auto x:ms) if (x>tmp) cnt++, tmp=x+l;
return cnt;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
8540 KB |
Output is correct |
2 |
Correct |
1 ms |
8636 KB |
Output is correct |
3 |
Correct |
1 ms |
8540 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
8540 KB |
Output is correct |
2 |
Correct |
1 ms |
8636 KB |
Output is correct |
3 |
Correct |
1 ms |
8540 KB |
Output is correct |
4 |
Correct |
2 ms |
8540 KB |
Output is correct |
5 |
Correct |
1 ms |
8540 KB |
Output is correct |
6 |
Correct |
1 ms |
8540 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
8540 KB |
Output is correct |
2 |
Correct |
1 ms |
8636 KB |
Output is correct |
3 |
Correct |
1 ms |
8540 KB |
Output is correct |
4 |
Correct |
2 ms |
8540 KB |
Output is correct |
5 |
Correct |
1 ms |
8540 KB |
Output is correct |
6 |
Correct |
1 ms |
8540 KB |
Output is correct |
7 |
Correct |
3962 ms |
10172 KB |
Output is correct |
8 |
Correct |
5950 ms |
10520 KB |
Output is correct |
9 |
Execution timed out |
9023 ms |
14588 KB |
Time limit exceeded |
10 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
8540 KB |
Output is correct |
2 |
Correct |
1 ms |
8636 KB |
Output is correct |
3 |
Correct |
1 ms |
8540 KB |
Output is correct |
4 |
Correct |
2 ms |
8540 KB |
Output is correct |
5 |
Correct |
1 ms |
8540 KB |
Output is correct |
6 |
Correct |
1 ms |
8540 KB |
Output is correct |
7 |
Correct |
3962 ms |
10172 KB |
Output is correct |
8 |
Correct |
5950 ms |
10520 KB |
Output is correct |
9 |
Execution timed out |
9023 ms |
14588 KB |
Time limit exceeded |
10 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
8540 KB |
Output is correct |
2 |
Correct |
1 ms |
8636 KB |
Output is correct |
3 |
Correct |
1 ms |
8540 KB |
Output is correct |
4 |
Correct |
2 ms |
8540 KB |
Output is correct |
5 |
Correct |
1 ms |
8540 KB |
Output is correct |
6 |
Correct |
1 ms |
8540 KB |
Output is correct |
7 |
Correct |
3962 ms |
10172 KB |
Output is correct |
8 |
Correct |
5950 ms |
10520 KB |
Output is correct |
9 |
Execution timed out |
9023 ms |
14588 KB |
Time limit exceeded |
10 |
Halted |
0 ms |
0 KB |
- |