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 MAXN = 150000;
int n, l, x[MAXN];
multiset<int> s;
void init(int nn, int ll, int xx[]) {
n = nn, l = ll;
for (int i = 0; i < n; ++i) {
x[i] = xx[i];
s.insert(x[i]);
}
}
int update(int i, int y) {
s.erase(s.find(x[i]));
x[i] = y;
s.insert(x[i]);;
int ans = 0;
auto it = s.begin();
while (it != s.end()) {
it = s.upper_bound(*it + l);
++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... |