本题解不包括个人觉得太水的题(J题本人偷懒没做). 个人觉得这场其实HDU-5116要比HDU-5118难,不过赛场情况似乎不是这样.怀疑是因为老司机带错了路. 这套题,个人感觉动态规划和数论是两个主要的考点. HDU 5113 Black And White HDU 5114 Collision HDU 5116 Everlasting L HDU 5117 Fluorescent HDU 5118 GRE Words Once More!…
A Curious Matt Time Limit: 2000/2000 MS (Java/Others) Memory Limit: 512000/512000 K (Java/Others)Total Submission(s): 3058 Accepted Submission(s): 1716 Problem Description There is a curious man called Matt. One day, Matt's best friend Ted is w…
题目传送门 设dp[i][j]为杀掉区间i到j之间的狼需要付出的最小代价,那么dp[i][j]=min{dp[i][k-1]+dp[k+1][j]+a[k]+b[i-1]+b[j+1]} Java代码 import java.io.*; import java.util.*; class MyInputStream extends InputStream { public BufferedInputStream bis = new BufferedInputStream(System.in);…
A http://acm.hdu.edu.cn/showproblem.php?pid=5112 输入n个时刻和位置,问那两个时刻间速度最快. 解法:按照时间排序,然后依次求相邻两个之间的速度,速度=ds/dt #include<cstdio> #include<algorithm> using namespace std; ; struct G{ int t,x; friend bool operator <(const G &a,const G &b){…
周六周末组队训练赛. Dogs' Candies Time Limit: 30000/30000 MS (Java/Others) Memory Limit: 512000/512000 K (Java/Others)Total Submission(s): 3920 Accepted Submission(s): 941 Problem Description Far far away, there live a lot of dogs in the forest. Unlike…
Little Zu Chongzhi's Triangles Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 512000/512000 K (Java/Others)Total Submission(s): 2515 Accepted Submission(s): 1427 Problem Description Zu Chongzhi (429–500) was a prominent Chinese mathematic…
Song Jiang's rank list Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 512000/512000 K (Java/Others)Total Submission(s): 2006 Accepted Submission(s): 1128 Problem Description <Shui Hu Zhuan>,also <Water Margin>was written by Shi Nai…
Detachment Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 570 Accepted Submission(s): 192 Problem Description In a highly developed alien society, the habitats are almost infinite dimensiona…
Convex Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 294 Accepted Submission(s): 220 Problem Description We have a special convex that all points have the same distance to origin point.As y…
整理代码... Little Boxes Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 262144/262144 K (Java/Others)Total Submission(s): 2304 Accepted Submission(s): 818 Problem Description Little boxes on the hillside.Little boxes made of ticky-tacky.Littl…
A http://acm.hdu.edu.cn/showproblem.php?pid=5070 先跳过. B http://acm.hdu.edu.cn/showproblem.php?pid=5071 维护一个聊天队列,有8种操作,每次操作完要打印对应的信息,认真读题,按题意模拟,一维数组模拟队列就可以,5000操作,交换删除等on暴力复杂度也不会超时. #include<cstdio> #include<cstring> #include<map> using n…
鞍山的签到题,求两点之间的距离除以时间的最大值.直接暴力过的. A - Osu! Time Limit:1000MS Memory Limit:262144KB 64bit IO Format:%I64d & %I64u Submit Status Practice HDU 5078 Appoint description: System Crawler (2014-10-22) Description Osu! is a very popular music game. B…
A Average Score http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=5373 a班有n个人,b班有m个人,bob在a班,现在知道除了bob以外的所有人的成绩,还知道bob如果从a班转到b班,两个班的平均成绩都会提高,问bob合法的成绩区间. 解法,求一下两个班的平均成绩,bob的成绩肯定要比a班的小,比b班的大. #include<cstdio> int main(){ int t,n,m,x,sa,sb; w…
欢迎参加——每周六晚的BestCoder(有米!) Song Jiang's rank list Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 512000/512000 K (Java/Others)Total Submission(s): 673 Accepted Submission(s): 333 Problem Description <Shui Hu Zhuan>,also <Water Margin&g…
题意:小球排成一排,从m种颜色中选取k种颜色给n个球上色,要求相邻的球的颜色不同,求可行的方案数,答案模1e9+7.T组数据,1<= n, m <= 1e9, 1 <= k <= 1e6, k <= n, m 分析: a(k)表示用不超过k种颜色染n个位置,两两相邻颜色不相同的总数,很简单a(k)=k(n-1)^(k-1) b(k)表示恰好用k种颜色 很显然a(k)=ΣC(k,i)b(i),我们知道a,想知道b,这里就用到二项式反演 那么b(k)=ΣC(k,i)*i*(-1)…
题目链接 2014北京区域赛 Problem A Problem B 直接DFS+剪枝 剪枝条件:当前剩余的方块数量cnt < 2 * max{a[i]} - 1,则停止往下搜. 因为这样搜下去接下来肯定会出现相邻方块颜色相同的情况. #include <bits/stdc++.h> using namespace std; #define rep(i, a, b) for (int i(a); i <= (b); ++i) #define dec(i, a, b) for (i…
题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=5113 Black And White Time Limit: 2000/2000 MS (Java/Others)Memory Limit: 512000/512000 K (Java/Others) 问题描述 In mathematics, the four color theorem, or the four color map theorem, states that, given any…
题目链接 http://acm.hdu.edu.cn/showproblem.php?pid=5558 Problem Description Alice wants to send a classified message to Bob. She tries to encrypt the message with her original encryption method. The message is a string S, which consists of Nlowercase let…
Recursive sequence Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 249 Accepted Submission(s): 140 Problem Description Farmer John likes to play mathematics games with his N cows. Recently, t…
Counting Cliques Time Limit: 8000/4000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 539 Accepted Submission(s): 204 Problem Description A clique is a complete graph, in which there is an edge between every pair…