# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
607424 | gonzakia29 | Dancing Elephants (IOI11_elephants) | C++17 | 0 ms | 0 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;
long long n;
long long l, mini, maxi;
vector <int> x;
void init(int N, int L, int X[]){
n = N;
l = L;
mini = min(X[0],X[1]);
maxi = max(X[0],X[1]);
x.push_back(mini);
x.push_back(maxi);
}
int update(int i, int y){
x[i] = y;
mini = min(x[0],x[1]);
maxi = max(x[0],x[1]);
return 1+(maxi-mini>l);
}
#include "elephants.h"
#include <bits/stdc++.h>
using namespace std;
long long n;
long long l, mini, maxi;
vector <int> x;
void init(int N, int L, int X[]){
n = N;
l = L;
mini = min(X[0],X[1]);
maxi = max(X[0],X[1]);
x.push_back(mini);
x.push_back(maxi);
}
int update(int i, int y){
x[i] = y;
mini = min(x[0],x[1]);
maxi = max(x[0],x[1]);
return 1+(maxi-mini>l);
}