原题: 题意: 给你一个长度为N的正整数组A,对于这个数组的所有子区间,若长度小于k则不管它,若长度大于等于k则取第k大放入数组B 问你B中第M大的数是谁 一眼序列分治,然而没思路 数据结构?能想到从大到小排序,然后小于第i个数的都视为1,用数据结构维护第i个数在多少个区间是第k大 然后就没有然后了…… 序列分治和数据结构自闭了两个小时,最后才想起来试试别的思路 比如DP或二分什么的 终于灵稽一动 答案满足二分单调性 二分的答案m越大,[m+1,n]中的数作为第k大的区间的总数量就越大 那么二分…
A Simple Stone Game Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 262144/262144 K (Java/Others)Total Submission(s): 0    Accepted Submission(s): 0 Problem Description After he has learned how to play Nim game, Bob begins to try another ston…
Permutation Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 262144/262144 K (Java/Others)Total Submission(s): 0    Accepted Submission(s): 0Special Judge Problem Description A permutation p1,p2,...,pn of 1,2,...,n is called a lucky permutatio…
A Simple Stone Game Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 262144/262144 K (Java/Others)Total Submission(s): 0    Accepted Submission(s): 0 Problem Description After he has learned how to play Nim game, Bob begins to try another ston…
Permutation Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 262144/262144 K (Java/Others)Total Submission(s): 0    Accepted Submission(s): 0Special Judge Problem Description A permutation p1,p2,...,pn of 1,2,...,n is called a lucky permutatio…
A - Palindrome 题意:给出一个字符串,找出其中有多少个子串满足one-half-palindromic 的定义 思路:其实就是找一个i, j  使得 以i为中轴的回文串长度和以j为中轴的回文串长度都大于j - i + 1 先Manacher 预处理出以每个字符为中轴的最长回文串长度,然后用树状数组维护j ,枚举i #include<bits/stdc++.h> using namespace std; typedef long long ll; ; int l; ]; ]; in…
Palindrome Time Limit: 6000/3000 MS (Java/Others)    Memory Limit: 262144/262144 K (Java/Others)Total Submission(s): 426    Accepted Submission(s): 163 Problem Description Alice like strings, especially long strings. For each string, she has a specia…
A Simple Stone Game Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 262144/262144 K (Java/Others)Total Submission(s): 1526    Accepted Submission(s): 346 Problem Description After he has learned how to play Nim game, Bob begins to try another…
Super-palindrome 题面地址:http://acm.hdu.edu.cn/downloads/CCPC2018-Hangzhou-ProblemSet.pdf 这道题是差分数组的题目,线段树也可以写,但是代码太长没必要. 代码: #include<iostream> #include<cstdio> #include<cstring> #include<cstdlib> #include<algorithm> #include<…
Deleting Edges Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 567    Accepted Submission(s): 210 Problem Description Little Q is crazy about graph theory, and now he creates a game about grap…