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 N1 = 2e5+10;
int n,l;
set<int>st;
int val[N1];
void init(int N, int L, int X[])
{
n = N,l = L;
for(int i=0;i<n;i++)
st.insert(X[i]),val[i] = X[i];
}
int update(int i, int y)
{
st.erase(st.find(val[i]));
st.insert(y);
val[i] = y;
vector<int>vec;
for(auto x:st)
vec.push_back(x);
int ret = 0,cur = -1;
for(auto x:vec)
if(x>cur)ret++,cur = x+l;
return ret;
}
# | 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... |