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…
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 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…
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…
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…
Happy Necklace Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 1146 Accepted Submission(s): 491 Problem Description Little Q wants to buy a necklace for his girlfriend. Necklaces are single…
Graph Theory Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 1796 Accepted Submission(s): 750 Problem Description Little Q loves playing with different kinds of graphs very much. One day he…
Building Shops Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others) Total Submission(s): 701 Accepted Submission(s): 265 Problem Description HDU’s n classrooms are on a line ,which can be considered as a number line. Eac…
Problem Description "You shall not pass!"After shouted out that,the Force Staff appered in CaoHaha's hand.As we all know,the Force Staff is a staff with infinity power.If you can use it skillful,it may help you to do whatever you want.But now,hi…
题目传送:http://acm.hdu.edu.cn/showproblem.php?pid=6152 Problem Description It is well known that small groups are not conducive of the development of a team. Therefore, there shouldn’t be any small groups in a good team.In a team with n members,if there…
题目链接 Problem Description Today is the birthday of SF,so VS gives two strings S1,S2 to SF as a present,which have a big secret.SF is interested in this secret and ask VS how to get it.There are the things that VS tell: Suffix(S2,i) = S2[i...len].Ni is…
题目链接 Problem Description "You shall not pass!" After shouted out that,the Force Staff appered in CaoHaha's hand. As we all know,the Force Staff is a staff with infinity power.If you can use it skillful,it may help you to do whatever you want. Bu…
A - Buy and Resell 题意:给出n个交易点,每次能够选择买或者卖,求获得最大利润 思路:维护两个优先队列,一个是卖,一个是替换,当价格差相同时,优先替换,因为次数要最少 #include <bits/stdc++.h> using namespace std; #define ll long long #define N 100010 int t, n; ll arr[N]; priority_queue <ll, vector <ll>, greater &…
Building Shops Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 0 Accepted Submission(s): 0 Problem Description HDU’s n classrooms are on a line ,which can be considered as a number line. Ea…
题目链接 Problem Description It is well known that small groups are not conducive of the development of a team. Therefore, there shouldn't be any small groups in a good team. In a team with n members,if there are three or more members are not friends wit…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=6152 题意:判定一个无向图是否有三个点的团或者三个点的独立集. 解法:Ramsey theorem,n >= 6 直接输出 Bad 否则暴力.我是直接暴力,加个break优化就好了. #include <bits/stdc++.h> using namespace std; typedef long long LL; const int maxn = 3e3+3; bool w[maxn][…