上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 18 下一页
摘要: 温馨提示:本题十分卡常数,我手动开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 阅读(274) 评论(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 阅读(308) 评论(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 阅读(286) 评论(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 阅读(172) 评论(0) 推荐(0) 编辑
摘要: 题意:重新解释一下题意吧(题意晦涩难懂) 给定n个单词,你可以按照顺序学习,当学习这一单词时,这个单词是第x个要学习的单词,需要的代价分三类: 1、若存在其他单词是其后缀没被学习,则代价为n2 2、若不存在其他单词是其后缀,则代价是x 3、否则代价是x-y(y是最靠后的是其后缀的单词学习的位置) 题 阅读全文
posted @ 2019-06-05 10:04 hfctf0210 阅读(212) 评论(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 阅读(157) 评论(0) 推荐(0) 编辑
摘要: 老年选手需要多写一些思维题qwq。 通过打表很容易发现对于(i,j),值为(i-1)^(j-1)+1,然后本题就没了qwq。 矩阵差分还是很容易想到的,容斥成四个矩阵。 然后看到异或很容易想到三件事:数位DP、字典树、线性基。很容易发现后两种与本题不符,就是数位DP了,从高位到低位DP,f[i][0 阅读全文
posted @ 2019-06-04 20:03 hfctf0210 阅读(423) 评论(3) 推荐(0) 编辑
摘要: A 签到,开long long(不开也pp不了) #include<bits/stdc++.h> using namespace std; long long a,b,ans; int main() { cin>>a>>b>>ans;ans*=2; if(a==b)ans+=a*2; else an 阅读全文
posted @ 2019-06-02 09:07 hfctf0210 阅读(301) 评论(2) 推荐(0) 编辑
摘要: AB 签到(A就是ans=180(n-2)所以不放code了) #include<bits/stdc++.h> using namespace std; int n,ans; char s[100001]; int main() { scanf("%s",s+1); n=strlen(s+1),an 阅读全文
posted @ 2019-06-02 08:54 hfctf0210 阅读(206) 评论(0) 推荐(0) 编辑
摘要: 非常抱歉,这篇文章鸽了。 阅读全文
posted @ 2019-06-01 18:30 hfctf0210 阅读(415) 评论(0) 推荐(0) 编辑
上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 18 下一页