# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
100107 | shenxy | Roller Coaster Railroad (IOI16_railroad) | C++11 | 86 ms | 8960 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 "railroad.h"
#include <vector>
#include <algorithm>
#include <utility>
#include <cstring>
#define INF 1000000000000000000LL
using namespace std;
int n;
vector< pair<int, int> > speeddat;
long long int dptable[17][(1 << 16) - 1];
int LSOne(int i) {
return i & (-i);
}
int logtwo(int i) {
int ans = 0;
while (i) {
ans += 1;
i >>= 1;
}
return ans;
}
long long int speeddp(int sp, int mask) {
if (mask == 0) return 0;
if (dptable[sp][mask] != -1) return dptable[sp][mask];
long long int ans = INF;
int temp = mask;
while (temp) {
int X = LSOne(temp);
if (sp == 0) {
ans = min(ans, speeddp(logtwo(X), mask & (~X)));
# | 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... |