![](https://img-blog.csdnimg.cn/20201014180756919.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
算法题目
菜鸟起飞闯天涯1233445
专注IT
展开
-
两个序列求最长非连续最长子公共子序列
两个数组想,与y。if(x[i]==y[j]) dp[i][j]=dp[i-1][j-1] else max(dp[i-1][j],dp[i][j-1])原创 2016-08-21 16:17:53 · 729 阅读 · 0 评论 -
HDU 1232 超内存
某省调查城镇交通状况,得到现有城镇道路统计表,表中列出了每条道路直接连通的城镇。省政府“畅通工程”的目标是使全省任何两个城镇间都可以实现交通(但不一定有直接的道路相连,只要互相间接通过道路可达即可)。问最少还需要建设多少条道路?Input测试输入包含若干测试用例。每个测试用例的第1行给出两个正整数,分别是城镇数目N ( < 1000 )和道路数目M;随后的M行对应M条道路,每行给出一对原创 2017-07-28 15:02:02 · 229 阅读 · 0 评论 -
Regular polygon HDU 6055
Problem DescriptionOn a two-dimensional plane, give you n integer points. Your task is to figure out how many different regular polygon these points can make. InputThe input file consists of原创 2017-07-27 22:57:18 · 266 阅读 · 0 评论 -
HDU6069多校第四场 Counting Divisors
Problem DescriptionIn mathematics, the function d(n) denotes the number of divisors of positive integer n.For example, d(12)=6 because 1,2,3,4,6,12 are all 12's divisors.In this原创 2017-08-03 23:27:23 · 459 阅读 · 0 评论 -
玲珑杯 Round 19 1152 - Expected value of the expression (dp)
1152 - Expected value of the expressioYou are given an expression: A0O1A1O2A2⋯OnAnA0O1A1O2A2⋯OnAn, where Ai(0≤i≤n)Ai(0≤i≤n) represents number, Oi(1≤i≤n)Oi(1≤i≤n) represents operator.原创 2017-07-29 20:54:10 · 301 阅读 · 0 评论 -
HDU_6017_Girls love 233_(dp)(记忆化搜索)
Girls Love 233 Accepts: 30 Submissions: 218 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)问题描述除了翘课以外,结识新的妹子也是呃喵重要的日程安排之一。这不,呃喵又混进了一个叫做ACgirls的女原创 2017-07-12 20:49:59 · 321 阅读 · 0 评论 -
B - Assignment HDU - 5289
AssignmentTime Limit: 4000/2000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 4187 Accepted Submission(s): 1927Problem DescriptionTom owns a company原创 2017-07-10 21:52:54 · 272 阅读 · 0 评论 -
Soldiers(0696)
Soldiers(0696)Time limit(ms): 1000Memory limit(kb): 65535Submission: 1077Accepted: 432Accepted在一个划分成网格的操场上,n个士兵散乱地站在网格点上。网格点由整数坐标(x,y)表示。士兵们可以沿网格边上、下、左、原创 2017-05-12 20:03:23 · 588 阅读 · 0 评论 -
HDU5289 Assignment
本题为一个单调队列题目,复杂度接近O(n); 及在一遍for循环的时候用两个deque记录最大值,和最小值,借鉴:(我们设立两个指针i、j,从头开始往右移动,力求在O(n)的复杂度扫描一遍解决问题。单调队列的作用是什么呢,它是以很小的时间代价动态更新当前序列中的最大最小值。(此处如果有不懂请自行学习单调队列,此处只需要知道它动态更新最大最小值即可)。[j,i-1]表示当前关注的序列,我们将i原创 2017-03-16 20:49:35 · 654 阅读 · 0 评论 -
Jessica's Reading Problem POJ - 3320
a problem. The final exam is coming, yet she has spent little time on it. If she wants to pass it, she has to master all ideas included in a very thick text book. The author of that text book, like ot原创 2017-03-14 22:12:04 · 257 阅读 · 0 评论 -
解题报告 之 HDU5328 Problem Killer
You are a "Problem Killer", you want to solve many problems. Now you have nn problems, the ii-th problem's difficulty is represented by an integer aiai (1≤ai≤1091≤ai≤109). For some strange rea原创 2017-03-13 21:07:29 · 192 阅读 · 0 评论 -
CodeForces 337C. Quiz
C. Quiztime limit per test 1 secondmemory limit per test 256 megabytesinput standard inputoutput standard outputManao is taking part in a quiz. The quiz consist原创 2017-03-09 18:59:00 · 222 阅读 · 0 评论 -
dp Mzx0821月赛系列之情书(1084)
一次班上做活动,班上同学被安排坐成m行n列的矩阵,Mzx0821坐在坐标(x1,y1)的位置,Zzx坐在坐标(x2,y2)的位置。活动过程中,Mzx0821写了一张纸条想给Zzx,但是Mzx0821又不想班上其他人看到他写的内容,于是Mzx0821给班上每个人定义了一个保密程度值(就是这个人不偷看纸条内容的可能),每个人传递纸条只能给前后左右的人。 Mzx0821还考虑到万一Zzx给Mz原创 2016-08-15 13:36:11 · 299 阅读 · 0 评论 -
蓝桥杯模拟题A
【题目描述】:给你一个 n×n 的矩阵,里面填充 1到 n x n。例如当 n 等于 3 的时候,填充的矩阵如下。1 2 34 5 67 8 9现在我们把矩阵中的每条边的中点连起来,这样形成了一个新的矩形,请你计算一下这个新的矩形的覆盖的数字的和。比如,n = 3 的时候矩形覆盖的数字如下。 24 5 6 8那么当 n...原创 2018-03-28 22:26:59 · 391 阅读 · 0 评论