题目链接:HDOJ - 5160 题目分析 第一眼看上去,要求统计所有不同排列对答案的贡献.嗯...完全没有想法. 但是,如果我们对每个数字单独考虑,计算这个数字在总答案中的贡献,就容易多了. 对于一个数字 ai ,有 ni 个 .比它大的数字有 p 个,比它小的数字有 q 个.所有的数字一共有 N 个. 首先,比它小的数字对它不会造成影响,所以我们只要考虑它和比它大的数字.那么我们就在 N 个位置中,选 (ni + p) 个位置,给它和比它大的数字. 然后比它大的数字有 x1 种排列,比它小的…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4908 BestCoder Sequence Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 618    Accepted Submission(s): 214 Problem Description Mr Potato is a code…
Harry And Physical Teacher Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 38    Accepted Submission(s): 34 Problem Description As we all know, Harry Porter learns magic at Hogwarts School. How…
LCP Array  Accepts: 131  Submissions: 1352  Time Limit: 4000/2000 MS (Java/Others)  Memory Limit: 131072/131072 K (Java/Others) 问题描述 Peter有一个字符串s=s_{1}s_{2}...s_{n}s=s​1​​s​2​​...s​n​​, 令\text{suff}_i =s_{i}s_{i+1}...s_{n}suff​i​​=s​i​​s​i+1​​...s​n​…
题目链接:BestCoder Round #81 (div.2) 1003 String 题意 中文题,上有链接.就不贴了. 思路 枚举起点i,计算能够达到k个不同字母的最小下标j,则此时有子串len-j个. 将全部起点的值加起来即是结果. 代码 #include<iostream> #include<algorithm> #include<vector> using namespace std; #define LL long long const int MOD =…
BestCoder Sequence Problem Description Mr Potato is a coder. Mr Potato is the BestCoder. One night, an amazing sequence appeared in his dream. Length of this sequence is odd, the median number is M, and he named this sequence as Bestcoder Sequence. A…
1.BestCoder Round #89 2.总结:4个题,只能做A.B,全都靠hack上分.. 01  HDU 5944   水 1.题意:一个字符串,求有多少组字符y,r,x的下标能组成等比数列. 2.总结:有个坑,y,r,x顺序组公比q>1,也可反着来x,r,y顺序组. #include<iostream> #include<cstring> #include<cmath> #include<queue> #include<algorit…
BestCoder Round #90 本次至少暴露出三个知识点爆炸.... A. zz题 按题意copy  Init函数 然后统计就ok B. 博弈 题  不懂  推了半天的SG.....  结果这个题.... C 数据结构题   我写了半个小时分块   然后发现     改的是颜色.... 我的天  炸炸炸 D. 没看懂题目要干啥.....  官方题解要搞死小圆…
BestCoder Round #7 Start Time : 2014-08-31 19:00:00    End Time : 2014-08-31 21:00:00Contest Type : Register Public   Contest Status : Ended Current Server Time : 2014-08-31 21:12:12 Solved Pro.ID Title Ratio(Accepted / Submitted)   1001 Little Pony…
Time Limit: 3000/1500 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 354    Accepted Submission(s): 100 Problem Description ZYB has a tree with N nodes,now he wants you to solve the numbers of nodes distanced no m…