题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=6058 题目意思:给你一个排列,求所有区间长度大于等于k的区间第k大的数的和…… 思路:一开始看到区间k大?结果是所有区间,没那么简单,队友拿一个划分树的模板直接TLE,最后也没有做出来.思路是算出每个点在多少个区间内是第k大的,转换一下问题,找一个区间有k-1个比这个数大的,剩下的数都比他小,这样区间的个数乘以这个数就是这个数的贡献,所以关键在于找那些比这个数大的数都在哪些位置上关键,最好还是从小到…
[Link]:http://acm.hdu.edu.cn/showproblem.php?pid=6058 [Description] 给你n个数; 它们是由(1..n)组成的排列; 然后给你一个数字k; 让你求这个序列的所有长度大于等于k的区间的第k大值的和; [Solution] 数组模拟链表; 我们从小到大枚举数字x,寻找以x为第k大的数字的区间有多少个; 数组中只保留了了大于等于x的数字的信息 (即每次做完数字x为第k大的区间之后,把x删掉); 每次在做x的时候; 在x的左半部分找最近的…
FFF at Valentine Time Limit: 6000/3000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 1060    Accepted Submission(s): 506 Problem Description At Valentine's eve, Shylock and Lucar were enjoying their time as any oth…
Dying Light Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 513    Accepted Submission(s): 122 Problem Description LsF is visiting a local amusement park with his friends, and a mirror room su…
CSGO Time Limit: 20000/10000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 127    Accepted Submission(s): 20 Problem Description Senior Pan is crazy about CSGO and she is so skilled. She can kill every enemy she sp…
Ch’s gift Time Limit: 6000/3000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 1354    Accepted Submission(s): 496 Problem Description Mr. Cui is working off-campus and he misses his girl friend very much. After a w…
Big binary tree Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 597    Accepted Submission(s): 207 Problem Description You are given a complete binary tree with n nodes. The root node is numbere…
Colorful Tree Time Limit: 6000/3000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 1539    Accepted Submission(s): 616 Sample Input 3 1 2 1 1 2 2 3 6 1 2 1 3 2 1 1 2 1 3 2 4 2 5 3 6 Sample Output Case #1: 6 Case #…
Function Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 652    Accepted Submission(s): 267 Sample Input 3 2 1 0 2 0 1 3 4 2 0 1 0 2 3 1 Sample Output Case #1: 4 Case #2: 4 Source 2017 Multi-U…
Balala Power! Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 2668    Accepted Submission(s): 562 Problem Description Sample Input 1 a 2 aa bb 3 a ba abc Sample Output Case #1: 25 Case #2: 132…