# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
62060 | aome | Dancing Elephants (IOI11_elephants) | C++17 | 8025 ms | 119752 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;
const int N = 150005;
const int B = 500;
int n, L;
int a[N], in[N];
int jump[N], f[N];
int szVec;
vector<int> arr;
vector< pair<int, int> > vec[N];
void calc(vector< pair<int, int> > &vec) {
int ptr = 0, sz = vec.size();
for (int i = 0; i < sz; ++i) {
while (ptr < sz && vec[ptr].first <= vec[i].first + L) ptr++;
if (ptr == sz) jump[vec[i].second] = vec[i].second;
else jump[vec[i].second] = vec[ptr].second;
}
for (int i = sz - 1; i >= 0; --i) {
int j = vec[i].second;
int k = jump[j];
if (k == j) f[j] = 0;
else {
f[j] = f[k] + 1;
if (jump[k] != -1) jump[j] = jump[k];
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... |