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>
#include "elephants.h"
//~ #include "grader.cpp"
using namespace std;
int n, l;
vector <int> a;
set <int> s;
void init(int N, int L, int X[]){
n = N;
l = L;
for(int i = 0 ; i < n ; i++){
a.push_back(X[i]);
s.insert(X[i]);
}
}
int update(int i, int y){
s.erase(a[i]);
a[i] = y;
s.insert(a[i]);
int cur = *s.begin();
int ans = 1;
for(auto &i : s){
if(cur + l < i){
cur = 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... |