有毒的粽子

2019年9月15日

CF1209B Koala and Lights

摘要: It is a holiday season, and Koala is decorating his house with cool lights! He owns n lights, all of which flash periodically. After taking a quick gl 阅读全文

posted @ 2019-09-15 21:26 有毒的粽子 阅读(250) 评论(0) 推荐(0) 编辑
CF1209A Paint the Numbers

摘要: You are given a sequence of integers a1,a2,…,an. You need to paint elements in colors, so that: If we consider any color, all elements of this color m 阅读全文

posted @ 2019-09-15 21:12 有毒的粽子 阅读(263) 评论(0) 推荐(0) 编辑

2019年9月12日

CF1217B Zmei Gorynich

摘要: You are fighting with Zmei Gorynich — a ferocious monster from Slavic myths, a huge dragon-like reptile with multiple heads! Initially Zmei Gorynich h 阅读全文

posted @ 2019-09-12 00:22 有毒的粽子 阅读(296) 评论(0) 推荐(0) 编辑

2019年9月11日

CF1217A Creating a Character

摘要: You play your favourite game yet another time. You chose the character you didn't play before. It has str points of strength and int points of intelli 阅读全文

posted @ 2019-09-11 23:31 有毒的粽子 阅读(369) 评论(0) 推荐(0) 编辑

2019年8月17日

各种模板

摘要: 最短路 #include <bits/stdc++.h> using namespace std; const int maxn=1e5+5; const int maxm=2e6+5; const int inf=0x7fffffff; int h[maxn],vis[maxn],dis[maxn 阅读全文

posted @ 2019-08-17 14:12 有毒的粽子 阅读(259) 评论(0) 推荐(0) 编辑

2019年8月6日

字符串专题之KMP算法

摘要: 写点自己对KMP的理解,我们有两个字符串A和B,求A中B出现了多少次。 这种问题就可以用KMP来求解。 朴素的匹配最坏情况是O(n^2)的。KMP是个高效的算法,效率是O(n)的。 KMP算法的思想是先将B串与自己匹配,预处理出一个kmp(next)数组,在失配的时候回跳,这样就大大提升了效率。 定 阅读全文

posted @ 2019-08-06 20:02 有毒的粽子 阅读(132) 评论(0) 推荐(0) 编辑