# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
40109 | funcsr | Dancing Elephants (IOI11_elephants) | C++14 | 7042 ms | 28376 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 <iostream>
#include <vector>
#include <queue>
#include <algorithm>
#include <cassert>
#include "elephants.h"
using namespace std;
#define INF 1145141919
#define rep(i, n) for (int i=0; i<(n); i++)
#define pb push_back
#define all(x) x.begin(), x.end()
#define _1 first
#define _2 second
typedef pair<int, int> P;
const int B = 1500;
const int MAX_S = (150000/B)+10;
int N, L, S;
int A[150000], ord[150000];
vector<int> G[MAX_S];
P dp[MAX_S][3*B];
void recalc(int b) {
int n = G[b].size();
if (n == 0) return;
int h = n-1;
for (int i=n-1; i>=0; i--) {
int pos = G[b][i];
while (h > i && G[b][h-1]-pos > L) h--;
if (G[b][h]-pos <= L) {
dp[b][i] = P(pos, 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... |