随笔分类 -  模板库

摘要:题目链接: https://www.luogu.org/problem/P3975 题意: 求出所有字串的第k大子串 有两种,第一种对于出现在不同位置的相同子串算作一个子串 第二种,对于不同位置的子串算作是不相同子串 数据范围: $1\leq |S| \leq5000 00$ 分析: 对于第一种计算 阅读全文
posted @ 2019-10-08 16:08 czh~ 阅读(204) 评论(0) 推荐(0)
摘要:题目链接: https://codeforces.com/gym/101987 题意: 有长度为$n$的只包含$B,R$的字符串 有m种关系,每个关系说出三个位置的确切字符 这三个位置的字符最多有一个是错的 数据范围: $1\leq n \leq 5000$ $1\leq m \leq 10000$ 阅读全文
posted @ 2019-09-23 15:57 czh~ 阅读(399) 评论(0) 推荐(0)
摘要:void dfs(int x,int root){//预处理fa和dep数组 fa[x][0]=root; dep[x]=dep[root]+1; for(int i=1;(1dep[b])swap(a,b); for(int i=20;i>=0;i--){ if(dep[fa[b][i]]>=dep[a])b=fa[b][i]; ... 阅读全文
posted @ 2019-09-05 12:01 czh~ 阅读(154) 评论(0) 推荐(0)
摘要:参考博客:https://blog.csdn.net/litble/article/details/72804050 hdu1695 阅读全文
posted @ 2018-11-28 19:51 czh~ 阅读(209) 评论(0) 推荐(0)
摘要:void malache() { word3[0]='!'; int len=strlen(word1); for(int i=1;;i++) { if(i%2==0) { if(i/2-1==len) { word3[i]='~'; ... 阅读全文
posted @ 2018-11-28 14:41 czh~ 阅读(239) 评论(0) 推荐(0)
摘要:题目链接:http://codeforces.com/gym/101484/problem/E 凸包算法 1.先找到y坐标最小的点g,然后再让所有的点都减去g.x和g.y,再对它们进行极角排序 2.排序后的数组为,node[1],node[2],node[3],node[4]......node[n 阅读全文
posted @ 2018-10-25 15:55 czh~ 阅读(261) 评论(0) 推荐(0)
摘要:lis:最长递增子序列 复杂度:$O(nlgn)$ 1 #include<iostream> 2 #include<cstdio> 3 using namespace std; 4 int num[55],lis[55],res=0; 5 int solve(int x) 6 { 7 int a=1 阅读全文
posted @ 2018-05-02 14:40 czh~ 阅读(265) 评论(0) 推荐(0)