이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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... |