摘要:
还是挺难的一个题,看了书上的解析以后还是不会写,后来翻了代码仓库,发现lrj又用了一些玄学的优化技巧。 include include include using namespace std; typedef long long LL; const int maxn = 100 + 5; const 阅读全文
摘要:
我们通过观察可以发现,当n为偶数时,一定可以转化为一种先手必胜态,即棋盘可以被骨牌所覆盖, 如果n是奇数,那么去掉一格后一定能被1 2的骨牌覆盖,但是先手从左上角走,就进入了这个S态(必胜态),那么和上边的分析一样了,因此先手必败。 include using namespace std; int 阅读全文
摘要:
``` include using namespace std; const int maxn = 1000010; struct node { int num; int pos; }; int main() { // freopen("input", "r", stdin); int n; int 阅读全文
摘要:
bzoj第一题,ctsc2001. 黑书上的递归例题,我们定义time()函数,递归求解即可。 这个题用到了一个小技巧:可以使用枚举来搞算法。 include include include using namespace std; int n, m; int p(int a, int b) { i 阅读全文
摘要:
``` include using namespace std; int d[100], w[100], s, n; int dp[100][100][3]; int main() { scanf("%d%d", &n, &s); for (int i = 1; i = 1; i ) for (in 阅读全文
摘要:
``` include using namespace std; const int maxn = 301; std::vector son[maxn]; vector G[maxn]; int deep[maxn], size[maxn]; vector dep[maxn]; int vis[ma 阅读全文