校赛热身 Problem C. Sometimes Naive (状压dp)

    题解:   列举每一种3的倍数的组合,开始先求出3条边的可行解,则   六条边的可行解可以由两个三条边得来。  详见代码解析 #include<bits/stdc++.h> using namespace std; int a[22],n,cnt,ant,is[500007],dp[1050007]; struct node { int num,id; }a
相关文章
相关标签/搜索