摘要:
#include using namespace std; const int maxn = 5e3 + 7; const int maxm = 1e5 + 7; int T, n, m; char str1[maxm], str2[maxn]; int main(){ scanf("%d",&T); while(T --){ scanf("%d%d%s%s"... 阅读全文
摘要:
#include using namespace std; int main(){ int T, n, a;scanf("%d",&T); while(T --){ scanf("%d",&n); int odd = 0, even = 0; for(int i = 0; i < n; i ++){ sca... 阅读全文
摘要:
一道暴力搜索的恶心剪枝题目。 先处理好某个点确定之后其他点的也确定的是谁,还有分别为什么情况,分别用vis,sta来记录。当然可以直接使用一个3进制数来表示,但是这里需要额外写一个三进制数求值的函数较为麻烦。然后写完就是搜索的问题了,搜索方向就是给点为0,1一直下去,如果没有剪枝,时间复杂度应该是O 阅读全文