上一页 1 ··· 23 24 25 26 27 28 29 30 31 ··· 54 下一页
  2023年3月10日
摘要: #include <bits/stdc++.h> using namespace std ; const int N=5003,M=2e5+2; int f[N],n,m; struct E{ int x,y,z; }e[M]; int find(int x){ return x==f[x]?x:f 阅读全文
posted @ 2023-03-10 13:21 towboat 阅读(43) 评论(0) 推荐(0)
摘要: https://www.luogu.com.cn/problem/P1038 #include <iostream> #include<queue> #include <vector> #include <cstring> using namespace std; const int N=104, 阅读全文
posted @ 2023-03-10 13:10 towboat 阅读(45) 评论(0) 推荐(0)
  2023年3月8日
摘要: 给定一棵 nn 个点的带权树,结点下标从 11 开始到 nn。寻找树中找两个结点,求最长的异或路径。 异或路径指的是指两个结点之间唯一路径上的所有边权的异或。 处理出每个点的树上异或前缀 这些异或值按照二进制数插入Trie 经典问题了 #include <iostream> #include <cs 阅读全文
posted @ 2023-03-08 20:20 towboat 阅读(54) 评论(0) 推荐(0)
摘要: 查找单词个数 样例: 3 9 you are a good boy ha ha o yeah 13 o my god you like bleach naruto one piece and so do i 11 but i do not think you will get all the poi 阅读全文
posted @ 2023-03-08 19:49 towboat 阅读(39) 评论(0) 推荐(0)
摘要: 求num[i] ,表示1~i前缀 的合法子串个数( 满足前后缀相等,且不重合 #include <iostream> #include <cstring> using namespace std; const int N =1e6+3 ,mod= 1e9+7; #define int long lo 阅读全文
posted @ 2023-03-08 16:37 towboat 阅读(62) 评论(0) 推荐(0)
摘要: 希望在Str 中删掉 1个屏蔽词(一个屏蔽词可能出现多次) 求最后的串 栈+hash #include <iostream> #include <cstring> using namespace std; const int N =1e6+3; #define int long long int b 阅读全文
posted @ 2023-03-08 15:23 towboat 阅读(40) 评论(0) 推荐(0)
摘要: 对于给定串的每个前缀i,求最长的,使 这个字符串重复两边能覆盖原前缀i的前缀(就是前缀i的一个前缀),求所有的这些“前缀的前缀”的长度和 一张图秒懂 求next[] , 对于前缀i ,设 j =next[i] , 他有一个周期 i- j #include <bits/stdc++.h> using 阅读全文
posted @ 2023-03-08 14:55 towboat 阅读(55) 评论(0) 推荐(0)
  2023年3月7日
摘要: [HNOI2008]玩具装箱 f[i] =max( f[j]+ (s[i]-s[j] + i-j+1 )^2 设 a[i] =fi + si ,b[i] =s[i]+i+1 f[i] =max( f[j] + (a[i]-b[j])^2 =max{ f[j]+a[j]^2+b[j]^2 -2*a[j 阅读全文
posted @ 2023-03-07 21:08 towboat 阅读(25) 评论(0) 推荐(0)
摘要: yyf要抽卡 第 i 张卡的欧气值为 a[i],而在连抽时,欧气值等于第一张卡的欧气值。 每次抽卡的欧气之和”指每次单抽的欧气之和加上每次连抽的欧气之和. yyf想 C 连抽(连续抽 C 张卡) n 次,单抽 m 次, 但不想连续单抽超过 d次(可以连续单抽恰好 d 次)。 共有 c∗n+m张卡,抽 阅读全文
posted @ 2023-03-07 20:30 towboat 阅读(44) 评论(0) 推荐(0)
摘要: 36分代码 f[i][j] =min(f[j-1][k]+ pow(s[i]-s[j]) ) #include <iostream> #include <cstring> #include <algorithm> using namespace std; const int N=403; #defi 阅读全文
posted @ 2023-03-07 17:36 towboat 阅读(46) 评论(0) 推荐(0)
上一页 1 ··· 23 24 25 26 27 28 29 30 31 ··· 54 下一页