状压dp,设f[i][j][0/1]为前i个时间段换了j间教室的期望体力消耗,转移很好想(但是写起来好长= =) #include<iostream> #include<cstdio> using namespace std; const int N=2005; int n,m,v,e,c[N],d[N]; double k[N],f[N][N][2],ans=1e9,a[N][N],z; int read() { int r=0,f=1; char p=getchar(); wh…
先弗洛伊德,然后把状态拆分遗传 #include<iostream> #include<cstdio> #include<cstring> #include<cstdlib> #define f(a,b,c) g[a+10][b+10][c+1] #define N 2100 #define M 320 using namespace std; typedef double D; ]; D g[N][N][]; int n,m,v,e; D w[N]; in…