将每一个分解为六个两面的 简单地dp 回溯输出路径..... #include <cstdio> #include <cstring> #include <cmath> #include <algorithm> using namespace std; struct cc { int top,bom,fa,w; void f(int a, int b, int c, int d) { top = a; bom = b; fa = c; w = d; } };…
这题有点类似LIS,由于颜色最多100种,所以只需建立一个100的数组,按对立面的关系以某种颜色为向上面的最大值就可以了. #include <iostream> #include <cstdio> #include <cstring> using namespace std; ][]; ]; ]; struct{ int p; int wh; } pre[][]; struct c{ int p; int wh; }st_col[],tmp_st[]; int a…