上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 19 下一页
摘要: A 签到(code不贴了) PS:以后cf div2A(有时还有B)和atcoder <=200分(有时<=300)的题目不再贴code,不过可能也没几次比赛记录了。 B 高精度,枚举位数最短的可能,然后计算两个即可。 #include<bits/stdc++.h> using namespace 阅读全文
posted @ 2019-06-16 22:34 hfctf0210 阅读(250) 评论(0) 推荐(0)
摘要: A 签到(a-b problem不用贴了吧,以后atcoder小于300分题均不贴代码) B 发现选择的p,q一定是其中两点间的距离,于是可以O(n2)枚举两点,再O(n2)判断,其实可以做到O(n3)不过O(n4)就够了。 #include<bits/stdc++.h> using namespa 阅读全文
posted @ 2019-06-16 08:53 hfctf0210 阅读(171) 评论(0) 推荐(0)
摘要: 这题其实挺经典的,看到求异或最大,显然想到的是线性基,不过这怎么维护?当然区间有关的东西都可以上线段树,区间修改时记录每个点的修改量k,然后合并线性基时再加入线性基。因为线性基是求一组极大线性无关组,所以查询a[i]^k组成的线性基等价于查询k∪a[i]。 #include<bits/stdc++. 阅读全文
posted @ 2019-06-15 13:08 hfctf0210 阅读(231) 评论(0) 推荐(0)
摘要: 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 阅读(226) 评论(0) 推荐(0)
摘要: 首先可以转化问题,变为对每种颜色分别考虑不含该颜色的简单路径条数。然后把不是当前颜色的点视为白色,是当前颜色的点视为黑色,显然路径数量是每个白色连通块大小的平方和,然后题目变为:黑白两色的树,单点翻转颜色,维护白色连通块大小平方和,然后根据Auuan大佬的题解,我用了LCT。就是对每个点维护子树、儿 阅读全文
posted @ 2019-06-13 18:51 hfctf0210 阅读(462) 评论(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 阅读(260) 评论(0) 推荐(0)
摘要: 蒟蒻又发现自己还没写过LCT…… 首先显然按照权值a从小到大排序,维护b的最小生成树。然后直接扫,代价是加入b的最大值,然后动态加边,因为有边权,所以在lct中边应该理解为点。每次连接(u,v)时,若不连通则直接连起来,反之则需选择b最大的边断开。 #include<bits/stdc++.h> u 阅读全文
posted @ 2019-06-10 11:17 hfctf0210 阅读(196) 评论(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 阅读(398) 评论(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 阅读(194) 评论(0) 推荐(0)
摘要: 你永远不会相信一个快AFO的选手不会可持久化Trie。 其实异或粽子那题可以用可持久化Trie做,不过我还是没用,用的一般的Trie(其实可持久化是多此一举),于是到现在还是不会可持久化Trie。 这题首先可以发现要求的是最大值,所以很多区间是没必要的,l1[i]/r1[i]表示左/右边第1个比a[ 阅读全文
posted @ 2019-06-08 20:56 hfctf0210 阅读(206) 评论(0) 推荐(0)
上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 19 下一页