上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 18 下一页
摘要: A 签到 #include<bits/stdc++.h> using namespace std; char s[200002]; int n,a[20]; int main() { scanf("%s",s+1); n=strlen(s+1); for(int i=1;i<=n;i++)a[s[i 阅读全文
posted @ 2019-06-15 11:30 hfctf0210 阅读(219) 评论(0) 推荐(0) 编辑
摘要: 首先可以转化问题,变为对每种颜色分别考虑不含该颜色的简单路径条数。然后把不是当前颜色的点视为白色,是当前颜色的点视为黑色,显然路径数量是每个白色连通块大小的平方和,然后题目变为:黑白两色的树,单点翻转颜色,维护白色连通块大小平方和,然后根据Auuan大佬的题解,我用了LCT。就是对每个点维护子树、儿 阅读全文
posted @ 2019-06-13 18:51 hfctf0210 阅读(441) 评论(0) 推荐(0) 编辑
摘要: AB 签到(A过水已隐藏) #include<bits/stdc++.h> using namespace std; const int N=505; int n,m,vis[N][N]; char mp[N][N]; int main() { scanf("%d%d",&n,&m); for(in 阅读全文
posted @ 2019-06-12 09:38 hfctf0210 阅读(251) 评论(0) 推荐(0) 编辑
摘要: 蒟蒻又发现自己还没写过LCT…… 首先显然按照权值a从小到大排序,维护b的最小生成树。然后直接扫,代价是加入b的最大值,然后动态加边,因为有边权,所以在lct中边应该理解为点。每次连接(u,v)时,若不连通则直接连起来,反之则需选择b最大的边断开。 #include<bits/stdc++.h> u 阅读全文
posted @ 2019-06-10 11:17 hfctf0210 阅读(177) 评论(0) 推荐(0) 编辑
摘要: ABCD 签到(A、B、C过水已隐藏) #include<bits/stdc++.h> using namespace std; const int N=2003; int n,m,ans,f1[N][N],f2[N][N],f3[N][N],f4[N][N]; char mp[N][N]; int 阅读全文
posted @ 2019-06-09 22:17 hfctf0210 阅读(392) 评论(0) 推荐(0) 编辑
摘要: 太难的比如三维凸包已过滤,估计NOI考不了毒瘤计算几何吧,不过还是背些简单的吧。 二维凸包:https://www.luogu.org/problemnew/show/P2742 旋转卡壳:https://www.lydsy.com/JudgeOnline/problem.php?id=1185 半 阅读全文
posted @ 2019-06-08 21:30 hfctf0210 阅读(186) 评论(0) 推荐(0) 编辑
摘要: 你永远不会相信一个快AFO的选手不会可持久化Trie。 其实异或粽子那题可以用可持久化Trie做,不过我还是没用,用的一般的Trie(其实可持久化是多此一举),于是到现在还是不会可持久化Trie。 这题首先可以发现要求的是最大值,所以很多区间是没必要的,l1[i]/r1[i]表示左/右边第1个比a[ 阅读全文
posted @ 2019-06-08 20:56 hfctf0210 阅读(196) 评论(0) 推荐(0) 编辑
摘要: 没有SPJ时显然是不需要输出方案的。不需要输出方案很好做,先把边扩展(因为会往下流),然后求最大独立集,最大独立集=n-最小点覆盖,因为其是最大独立集的补集。如何求最小点覆盖呢?毕竟我写过最大权闭合子图的:http://www.51nod.com/Challenge/Problem.html#!#p 阅读全文
posted @ 2019-06-08 17:06 hfctf0210 阅读(204) 评论(0) 推荐(0) 编辑
摘要: 挂链式hash:https://www.luogu.org/problemnew/show/P3823 最小表示法:https://www.luogu.org/problemnew/show/P1368 KMP:https://www.luogu.org/problemnew/show/P3375 阅读全文
posted @ 2019-06-08 11:15 hfctf0210 阅读(196) 评论(0) 推荐(0) 编辑
摘要: A 太难了,一半时间刚这题还没做出来,简直自闭了。实际上分两种情况,一种很简单直接放,另一种就是要0,0,…,0,1,2,…,n,然后直接贪心,显然我是把情况判断错误一直没调出来。 #include <bits/stdc++.h> using namespace std; const int N=2 阅读全文
posted @ 2019-06-08 10:39 hfctf0210 阅读(298) 评论(0) 推荐(0) 编辑
上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 18 下一页