摘要:
题目大意: 单词接龙,找出最长的长度的单词。 题解: 由于数据量较小,单词可多次使用,使用后可回溯,考虑dfs。 代码: #include<bits/stdc++.h> using namespace std; typedef long long LL; const int N = 1e3 + 10 阅读全文
摘要:
解法: 从底往上dp,每次取下一行相邻两个数最大的即可。 代码: #include<bits/stdc++.h> using namespace std; typedef long long LL; const int N = 1e3 + 10; int n; int f[N][N]; void s 阅读全文
摘要:
P1219 [USACO1.5] 八皇后 Checker Challenge #include <bits/stdc++.h> using namespace std; typedef long long ll; int n, l[50], r[50], vis[50], a[50]; int an 阅读全文