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;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
const int maxn = 150010;
int n , l;
int x[maxn];
void init(int N , int L , int X[]){
n = N , l = L;
for(int i = 0 ; i < n ; i ++)
x[i] = X[i];
}
int update(int p , int v){
x[p] = v;
sort(x , x + n);
int ans = 0;
int L = x[0];
for(int i = 1 ; i < n ; i ++)
if(x[i] - L > l)
L = x[i] , ans ++;
return(ans);
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |