# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
56440 | aquablitz11 | Dancing Elephants (IOI11_elephants) | C++14 | 8405 ms | 125152 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 <bits/stdc++.h>
#include "elephants.h"
using namespace std;
const int N = 150010;
const int SN = 390;
int n, sn, l, X[N];
vector<int> elep[SN], cnt[N], rbnd[N];
int find_bucket(int x)
{
for (int i = 0; i < sn; ++i) {
if (!elep[i].empty() && x <= elep[i].back())
return i;
}
return sn-1;
}
void process_bucket(int p)
{
//fprintf(stderr, "process_bucket(%d):\n", p);
int n = elep[p].size();
cnt[p].resize(n);
rbnd[p].resize(n);
for (int i = n-1, j = n-1; i >= 0; --i) {
while (elep[p][j]-elep[p][i] > l)
--j;
cnt[p][i] = j == n-1 ? 1 : (1 + cnt[p][j+1]);
rbnd[p][i] = j == n-1 ? (elep[p][i]+l) : rbnd[p][j+1];
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... |