#include <bits/stdc++.h>
#include "elephants.h"
using namespace std;
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define all(x) x.begin(), x.end()
#define allr(x) x.rbegin(), x.rend()
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const int MAXN = 15e4+10;
const int INF = 0x3f3f3f3f;
const ll LINF = 0x3f3f3f3f3f3f3f3f;
const int MOD = 1e9+7;
mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
vector<int> arr;
int l;
void init(int N, int L, int X[])
{
arr.resize(N);
for(int i=0;i<N;i++) arr[i]=X[i];
l=L;
}
int update(int i, int y)
{
arr[i]=y;
vector<int> proc=arr;
sort(all(proc));
int curr=-l-1, ans=0;
for(auto u : proc){
if(u<=curr+l) continue;
curr=u;
ans++;
}
return ans;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
6488 KB |
Output is correct |
2 |
Correct |
1 ms |
6492 KB |
Output is correct |
3 |
Correct |
1 ms |
6488 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
6488 KB |
Output is correct |
2 |
Correct |
1 ms |
6492 KB |
Output is correct |
3 |
Correct |
1 ms |
6488 KB |
Output is correct |
4 |
Correct |
1 ms |
6488 KB |
Output is correct |
5 |
Correct |
1 ms |
6488 KB |
Output is correct |
6 |
Correct |
2 ms |
6492 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
6488 KB |
Output is correct |
2 |
Correct |
1 ms |
6492 KB |
Output is correct |
3 |
Correct |
1 ms |
6488 KB |
Output is correct |
4 |
Correct |
1 ms |
6488 KB |
Output is correct |
5 |
Correct |
1 ms |
6488 KB |
Output is correct |
6 |
Correct |
2 ms |
6492 KB |
Output is correct |
7 |
Correct |
7165 ms |
8900 KB |
Output is correct |
8 |
Execution timed out |
9091 ms |
9820 KB |
Time limit exceeded |
9 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
6488 KB |
Output is correct |
2 |
Correct |
1 ms |
6492 KB |
Output is correct |
3 |
Correct |
1 ms |
6488 KB |
Output is correct |
4 |
Correct |
1 ms |
6488 KB |
Output is correct |
5 |
Correct |
1 ms |
6488 KB |
Output is correct |
6 |
Correct |
2 ms |
6492 KB |
Output is correct |
7 |
Correct |
7165 ms |
8900 KB |
Output is correct |
8 |
Execution timed out |
9091 ms |
9820 KB |
Time limit exceeded |
9 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
6488 KB |
Output is correct |
2 |
Correct |
1 ms |
6492 KB |
Output is correct |
3 |
Correct |
1 ms |
6488 KB |
Output is correct |
4 |
Correct |
1 ms |
6488 KB |
Output is correct |
5 |
Correct |
1 ms |
6488 KB |
Output is correct |
6 |
Correct |
2 ms |
6492 KB |
Output is correct |
7 |
Correct |
7165 ms |
8900 KB |
Output is correct |
8 |
Execution timed out |
9091 ms |
9820 KB |
Time limit exceeded |
9 |
Halted |
0 ms |
0 KB |
- |