# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
269160 | Plurm | Dancing Elephants (IOI11_elephants) | C++11 | 9079 ms | 1664 KiB |
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;
int n, l;
set<int> s;
int pos[150005];
void init(int N, int L, int X[])
{
n = N;
l = L;
for(int i = 0; i < N; i++){
s.insert(X[i]);
pos[i] = X[i];
}
}
int update(int i, int y)
{
s.erase(pos[i]);
pos[i] = y;
s.insert(pos[i]);
int last = -1;
int c = 0;
auto it = s.begin();
while(it != s.end()){
int x = *it;
it = s.upper_bound(x+l);
c++;
}
return c;
}
Compilation message (stderr)
# | 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... |