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 "elephants.h"
#include <bits/stdc++.h>
using namespace std;
const int k_N = 15e4 + 3;
int n, l;
int *x;
multiset<int> s;
void init(int N, int L, int X[]){
n = N;
l = L;
x = X;
}
int update(int idx, int y){
s.erase(x[idx]);
x[idx] = y;
s.insert(x[idx]);
int start = *s.begin(), ans = 1;
for(int u: s){
if(u - start > l){
start = u;
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... |