上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 19 下一页
摘要: 没有SPJ时显然是不需要输出方案的。不需要输出方案很好做,先把边扩展(因为会往下流),然后求最大独立集,最大独立集=n-最小点覆盖,因为其是最大独立集的补集。如何求最小点覆盖呢?毕竟我写过最大权闭合子图的:http://www.51nod.com/Challenge/Problem.html#!#p 阅读全文
posted @ 2019-06-08 17:06 hfctf0210 阅读(212) 评论(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 阅读(204) 评论(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 阅读(312) 评论(0) 推荐(0)
摘要: 温馨提示:本题十分卡常数,我手动开O2才过的。而数据范围不伦不类的n<=30000,常数小的O(n2)居然比O(n√nlogn)跑得快…… 考虑插进去一个元素对答案产生的影响。原本数列为Σa[i]f[i],其中1<=i<=n,然后考虑在k位置插入a[0],答案显然是a[1]f[1]+a[2]f[2] 阅读全文
posted @ 2019-06-07 10:17 hfctf0210 阅读(280) 评论(0) 推荐(0)
摘要: 要是有题目FST了就重新写 A 签到 #include<bits/stdc++.h> using namespace std; int T; long long n,k,ans; int main() { cin>>T; while(T--) { cin>>n>>k,ans=0; while(n) 阅读全文
posted @ 2019-06-06 09:58 hfctf0210 阅读(316) 评论(0) 推荐(0)
摘要: 一些NOIP难度的 exgcd excrt(今年考的可能性不大因为NOI2018考过了,不过还是复习万一能骗分呢?):https://www.luogu.org/problemnew/show/P4777 数论分块+莫比乌斯反演:https://www.lydsy.com/JudgeOnline/p 阅读全文
posted @ 2019-06-05 18:16 hfctf0210 阅读(295) 评论(0) 推荐(0)
摘要: FFT:https://www.lydsy.com/JudgeOnline/problem.php?id=2179 NTT与FFT类似就没了 分治NTT:https://www.luogu.org/problemnew/show/P4721 FWT:https://www.luogu.org/pro 阅读全文
posted @ 2019-06-05 10:22 hfctf0210 阅读(179) 评论(0) 推荐(0)
摘要: 题意:重新解释一下题意吧(题意晦涩难懂) 给定n个单词,你可以按照顺序学习,当学习这一单词时,这个单词是第x个要学习的单词,需要的代价分三类: 1、若存在其他单词是其后缀没被学习,则代价为n2 2、若不存在其他单词是其后缀,则代价是x 3、否则代价是x-y(y是最靠后的是其后缀的单词学习的位置) 题 阅读全文
posted @ 2019-06-05 10:04 hfctf0210 阅读(217) 评论(0) 推荐(0)
摘要: 网太卡只好做划水选手,只做EF。 E 很容易发现第一个数是2k或者是3*2k-1,因为消去因子次数要尽可能多,然后可以直接dp一发转移还剩几个2/3即可,写起来有些麻烦 #include<bits/stdc++.h> using namespace std; const int N=1e6+7,mo 阅读全文
posted @ 2019-06-05 09:47 hfctf0210 阅读(160) 评论(0) 推荐(0)
摘要: 老年选手需要多写一些思维题qwq。 通过打表很容易发现对于(i,j),值为(i-1)^(j-1)+1,然后本题就没了qwq。 矩阵差分还是很容易想到的,容斥成四个矩阵。 然后看到异或很容易想到三件事:数位DP、字典树、线性基。很容易发现后两种与本题不符,就是数位DP了,从高位到低位DP,f[i][0 阅读全文
posted @ 2019-06-04 20:03 hfctf0210 阅读(441) 评论(3) 推荐(0)
上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 19 下一页