Submission #100107

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
1001072019-03-09 09:46:38shenxyRoller Coaster Railroad (IOI16_railroad)C++11
0 / 100
86 ms8960 KiB
//#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)));
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...