上一页 1 ··· 22 23 24 25 26 27 28 29 30 ··· 46 下一页
摘要: 传送门 这题我写了好几天终于懂了,果然还是太菜了。 由题目给的样例可以看出,这个相交线的对数就是数第一行里每个数右边(左右都数会重复)有多少个数,在第二行里在该数的左边出现了,然后这样就可以转化为用逆序对... 阅读全文
posted @ 2018-08-19 20:17 eason99 阅读(94) 评论(0) 推荐(0) 编辑
摘要: #include#include#includeusing namespace std;#define maxn 100int V,E,res,father[maxn];struct edge{ int u... 阅读全文
posted @ 2018-08-19 19:13 eason99 阅读(81) 评论(0) 推荐(0) 编辑
摘要: #include#include#includeusing namespace std;#define maxn 100int V,E,res,father[maxn];struct edge{ int u... 阅读全文
posted @ 2018-08-19 19:13 eason99 阅读(69) 评论(0) 推荐(0) 编辑
摘要: 先求出原序列,然后桶排序,直接查询即可,sort排序复杂度是n*logn会超时,桶排序是n。还有一秒是跑1e8#includeusing namespace std;const int maxn=3e7+10... 阅读全文
posted @ 2018-08-19 18:44 eason99 阅读(54) 评论(0) 推荐(0) 编辑
摘要: 先求出原序列,然后桶排序,直接查询即可,sort排序复杂度是n*logn会超时,桶排序是n。还有一秒是跑1e8#includeusing namespace std;const int maxn=3e7+10... 阅读全文
posted @ 2018-08-19 18:44 eason99 阅读(57) 评论(0) 推荐(0) 编辑
摘要: 题目意思是给你一个主串和一个子串,然后要求你在子串的所有前缀串里找到一个最长的串,满足在主串里至少出现了ti次。做法就是求出a串和b串的hash值,然后二分b串的长度就行了。#include//二分+hash... 阅读全文
posted @ 2018-08-19 17:26 eason99 阅读(74) 评论(0) 推荐(0) 编辑
摘要: 题目意思是给你一个主串和一个子串,然后要求你在子串的所有前缀串里找到一个最长的串,满足在主串里至少出现了ti次。做法就是求出a串和b串的hash值,然后二分b串的长度就行了。#include//二分+hash... 阅读全文
posted @ 2018-08-19 17:26 eason99 阅读(66) 评论(0) 推荐(0) 编辑
摘要: 板子题链接https://www.nowcoder.com/acm/contest/136/C#includeusing namespace std;struct edge{ int v,nxt;}e[20... 阅读全文
posted @ 2018-08-18 22:10 eason99 阅读(72) 评论(0) 推荐(0) 编辑
摘要: 板子题链接https://www.nowcoder.com/acm/contest/136/C#includeusing namespace std;struct edge{ int v,nxt;}e[20... 阅读全文
posted @ 2018-08-18 22:10 eason99 阅读(79) 评论(0) 推荐(0) 编辑
摘要: 这题和hdu1003很相似,都是求的是区间的最大值,以及对应的区间,只不过这里的区间的值由R的数量和B的数量的差的绝对值决定,我一开始用的是统计区间的abs(numr-numb)来维护一个区间的值,但是最后写出来... 阅读全文
posted @ 2018-08-18 16:51 eason99 阅读(85) 评论(0) 推荐(0) 编辑
上一页 1 ··· 22 23 24 25 26 27 28 29 30 ··· 46 下一页