随笔分类 - 天梯赛
摘要:####小字辈 比赛的时候心烦意乱,没有净下心来好好看题,导致没有看懂。遂考后又做了一遍,觉得方法很好 用的是并查集+路径优化 #include <iostream> using namespace std; const int N = 1e5 + 10; int p[N], c[N]; int f
阅读全文
摘要:####7-1 吃火锅 这道题考查stl中的find函数,不嫌麻烦的话可以手写kmp 如果在主串中没有子串,则返回-1,否则返回第一个子串的位置 #include <iostream> #include <string> using namespace std; int main() { strin
阅读全文