上一页 1 2 3 4 5 6 7 8 9 ··· 19 下一页
摘要: 题意查询给定[L, R]区间内 逆序对数 ==k的子区间的个数。我们只需要求出 子区间小于等于k的个数和小于等于k-1的个数,然后相减就得出答案了。对于i(1≤i≤n),我们计算ri表示[i,ri]的逆序对数小于等于K,且ri的值最大。(ri对应代码中的cnt数组)显然ri单调不降,我们可以通过用两... 阅读全文
posted @ 2015-04-01 17:57 PlasticSpirit 阅读(199) 评论(0) 推荐(0) 编辑
摘要: 上周末打了一场训练赛,题目是13年南京区域赛的这场题目有好几个本来应该是我擅长的,但是可能是太久没做比赛了各种小错误代码写的也丑各种warusn trush搞得人很不爽全场题之一的1002也没有想出来,最终只出了三题连铜牌线都没有达到,心好累赛后又补了三道题,还是写一下题解毕竟好久都没写了1001:... 阅读全文
posted @ 2015-03-24 14:44 PlasticSpirit 阅读(564) 评论(0) 推荐(0) 编辑
摘要: TreeTime Limit:1000MSMemory Limit:30000KTotal Submissions:12276Accepted:3886DescriptionGive a tree with n vertices,each edge has a length(positive int... 阅读全文
posted @ 2015-03-23 13:46 PlasticSpirit 阅读(704) 评论(0) 推荐(0) 编辑
摘要: DISUBSTR - Distinct SubstringsGiven a string, we need to find the total number of its distinct substrings.InputT- number of test cases. T 2 #include ... 阅读全文
posted @ 2015-03-18 16:14 PlasticSpirit 阅读(288) 评论(0) 推荐(0) 编辑
摘要: 题意 :求最长不相交重复子串的长度。。可以先求出LCP,,对于长度 二分出答案。。(竟然不会写二分) 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 #incl... 阅读全文
posted @ 2015-03-16 20:47 PlasticSpirit 阅读(208) 评论(0) 推荐(0) 编辑
摘要: Facer’s stringTime Limit:3000MSMemory Limit:65536KTotal Submissions:1783Accepted:537DescriptionMinifa... 阅读全文
posted @ 2015-03-14 16:04 PlasticSpirit 阅读(752) 评论(0) 推荐(0) 编辑
摘要: 题意:n个数字组成的序列,第一个数字最大,,把序列分成3部分,每个部分分别翻转,输出翻转后字典序最小的序列。。后缀数组变一下,,先求出 第一个分割的位置,,然后再求一次后缀数组,,求出第二个位置。。输出就好了。此题要采用单组输入。。。 1 #include 2 #include 3 #inclu... 阅读全文
posted @ 2015-03-12 22:43 PlasticSpirit 阅读(359) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=3726题意:n个点m条边的一张无向图,每个点有一个权值, 有3中操作。D X 删除第X条边Q X K 计算与X点相连所有点中第k大的权值C X V把X的权值改为 V输出 Q次询问的平均值大白上的例题, 离... 阅读全文
posted @ 2015-03-11 19:21 PlasticSpirit 阅读(267) 评论(0) 推荐(0) 编辑
摘要: 题意 就是求区间第k大,区间 不互相包含。尝试用treap解决一下 第k大的问题。 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 #include 9 #... 阅读全文
posted @ 2015-03-09 22:49 PlasticSpirit 阅读(357) 评论(0) 推荐(0) 编辑
摘要: D. Looking for OwlsEmperor Palpatine loves owls very much. The emperor has some blueprints with the new Death Star, the blueprints contain n distinct ... 阅读全文
posted @ 2015-02-20 23:04 PlasticSpirit 阅读(347) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 9 ··· 19 下一页