# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1163307 | HappyCapybara | Dancing Elephants (IOI11_elephants) | C++20 | 9093 ms | 1728 KiB |
#include "elephants.h"
#include<bits/stdc++.h>
using namespace std;
int n, l;
vector<int> v;
void init(int N, int L, int X[]){
n = N;
l = L;
for (int i=0; i<n; i++) v.push_back(X[i]);
}
int update(int i, int y){
v[i] = y;
vector<int> w = v;
sort(w.begin(), w.end());
int res = 0, prev = -2*pow(10, 9);
for (int i=0; i<n; i++){
if (prev + l < w[i]){
res++;
prev = w[i];
}
}
return res;
}
# | 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... |