自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(6)
  • 收藏
  • 关注

原创 【ybtoj】【KMP】【例题1】子串查找

【例题1】子串查找Link解题思路CodeLink传送门题目解题思路kmp模板题kmpCode#include <iostream>#include <cstring>#include <cstdio>using namespace std;char a[1000100], b[1000100];int p[1000100], ans, lena, lenb;int main() { scanf("%s%s", a + 1, b

2021-03-18 15:49:21 277

原创 【ybtoj】【hash】【例题5】子正方形

【例题5】子正方形Link解题思路CodeLink传送门题目解题思路mother,Hash真的好难o(╥﹏╥)o依旧感谢TJH大佬的博客先对行和列进行前缀的hash处理然后突然发现n≤50n\leq 50n≤50,用O(n4)O(n^4)O(n4)枚举答案矩阵的右下角,再二分答案矩阵的边长Code#include <iostream>#include <cstdio>#define ull unsigned long long#define t1 61

2021-03-11 15:40:26 205 1

原创 【ybtoj】【hash】【例题4】单词背诵

先将要背的单词排序,于是每个单词都有了一个编号;二分寻找文章里的单词的编号,如果这个单词第一次出现,ans_1+1;尺取法:枚举左边界l,每次右移右边界r,直到找到所有要背的单词,ans_2=min(ans_2,r-l+1)

2021-03-10 16:34:36 164

原创 【ybtoj】【hash】【例题1】字符串哈希

【例题1】字符串哈希Link解题思路CodeLink传送门题目解题思路突然发现欠了几题博客没打,贱……挺模板,看程序注释叭⬇Code#include <iostream>#include <cstdio>#include <string>#define P 13331using namespace std;string s, hash[P + 10];int n, ans;bool demo(string s) { int su

2021-03-06 12:01:16 218

原创 【ybtoj】【hash】【例题2】回文子串

【例题2】回文子串Link解题思路CodeLink传送门题目解题思路Code#include <iostream>#include <cstring>#include <cstdio>#define ull unsigned long longusing namespace std;char s[10401000];ull n, number, ans, l, r, mid;ull zheng[1010100], fan[1010100

2021-03-05 20:16:43 437 1

原创 【ybtoj】【字符串】【例题5】生日相同

【例题5】生日相同Link解题思路CodeLink传送门题目解题思路救命我写的好暴力按日期排序,相同日期按名字排序如果一个日期有多个名字,就输出Code#include <algorithm>#include <iostream>#include <cstdio>#include <string>using namespace std;struct DT { string name; int mon, day;}no

2021-03-04 20:05:01 168

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除