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 &…
题目传送门:http://acm.hdu.edu.cn/showproblem.php?pid=6438 Buy and Resell Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 1233 Accepted Submission(s): 407 Problem Description The Power Cube is used…
题目传送门:http://acm.hdu.edu.cn/showproblem.php?pid=6447 YJJ's Salesman Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 919 Accepted Submission(s): 290 Problem Description YJJ is a salesman who h…
Tree and Permutation Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 619 Accepted Submission(s): 214 Problem Description There are N vertices connected by N−1 edges, each edge has its own len…
Dream Time Limit: 12000/6000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 1014 Accepted Submission(s): 200Special Judge Problem Description Freshmen frequently make an error in computing the power of a sum of r…
http://acm.hdu.edu.cn/showproblem.php?pid=6440 题意:让你重新定义任意一对数的乘法和加法结果(输出乘法口诀表和加法口诀表),使得m^p+n^p==(m+n)^p(p为质数),并且存在一个0<q<p使得 q^k(0<k<p)取遍1~p-1的所有值,并且该运算是封闭的(exists an integer q(0<q<p) to make the set {qk|0<k<p,k∈Z} equal to {k|0<…
Neko's loop Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 1386 Accepted Submission(s): 316 Problem Description Neko has a loop of size n. The loop has a happy value ai on the i−th(0≤i≤n−1) grid.…
Find Integer Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 6597 Accepted Submission(s): 1852Special Judge Problem Description people in USSS love math very much, and there is a famous math…
Buy and Resell Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 1126 Accepted Submission(s): 359 Problem Description The Power Cube is used as a stash of Exotic Power. There are n cities numbe…
Tree and Permutation Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 0 Accepted Submission(s): 0 Problem Description There are N vertices connected by N−1 edges, each edge has its own length.…
Find Integer Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 0 Accepted Submission(s): 0Special Judge Problem Description people in USSS love math very much, and there is a famous math proble…
Find Integer Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 0 Accepted Submission(s): 0Special Judge Problem Description people in USSS love math very much, and there is a famous math probl…
问题传送门:https://vjudge.net/contest/320779#problem/D 介绍一个名词:奇偶数列法则 Key part: #include<iostream> #include<cstdio> #include<algorithm> #include<cstring> using namespace std; #define ll long long int main() { int t; ll a,b,c,n; scanf(&qu…
Magic boy Bi Luo with his excited tree Problem Description Bi Luo is a magic boy, he also has a migic tree, the tree has N nodes , in each node , there is a treasure, it's value is V[i], and for each edge, there is a cost C[i], which means every time…
Alice and Bob Time Limit: 10000/5000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 147 Accepted Submission(s): 22 Problem Description As you know, Alice and Bob always play game together, and today they get a…
This world need more Zhu Time Limit: 12000/6000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 262 Accepted Submission(s): 49 Problem Description As we all know, Zhu is the most powerful man. He has the infinite…
Problem Description Chisa Yukizome works as a teacher in the school. She prepares many gifts, which consist of n kinds with a[i] quantities of each kind, for her students and wants to hold a class meeting. Because of the busy work, she gives her gift…
Problem Description Lweb has a string S. Oneday, he decided to transform this string to a new sequence. You need help him determine this transformation to get a sequence which has the longest LIS(Strictly Increasing). You need transform every letter…
Problem Descripton Two planets named Haha and Xixi in the universe and they were created with the universe beginning. There is 73 days in Xixi a year and 137 days in Haha a year. Now you know the days N after Big Bang, you need to answer whether it i…
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…