自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

Yi_Qing_Z的博客

咸鱼中——

  • 博客(64)
  • 收藏
  • 关注

转载 HDU 2579 Dating with girls(2) BFS

题解:https://blog.csdn.net/hnust_xiehonghao/article/details/9018463 思路来源上一篇题解,除了变量名不同、多写了一个函数之外没有什么不同。 具体请见上面这篇题解  解题关键,visit[][][]三维判断是否可以走这个点。时间周期是k,那么到达该点会有k种不同的状态 以不同状态访问该点是不一样的,所以...

2019-02-13 11:38:28 233

转载 CodeForces 453C Little Pony and Summer Sun Celebration (dfs)

 题解:https://blog.csdn.net/keshuai19940722/article/details/38352623 看完上面这篇题解,写出来了这道搜索题,思路基本都来自上面这篇题解用answer[]数组来记录所要输出的路径(答案),visit[]标记该节点是否访问过 用condition[]记录每个节点的访问状态 定义一个record数组:访问该节点,把他的访...

2019-02-13 11:38:01 213

转载 Codeforces 83B Docter (二分)

https://blog.csdn.net/a540524095/article/details/51984698二分查找每个人最多看几次病后,时间结束通过二分法来获得最后每个人最多看?(middle)次即最后看完的那个人(lucky dog)的被看的次数当num[i]<middle时,那么第i个一定已经看完病了。lucky dog也不一定看完了病①如果lucky dog看完...

2019-02-13 11:37:30 199

原创 codeforces 448D Multiplication Table(二分法)

Bizon the Champion isn't just charming, he also is very smart.While some of us were learning the multiplication table, Bizon the Champion had fun in his own manner. Bizon the Champion painted an n ×...

2019-02-13 11:37:04 322

原创 POJ 3122 Pie(二分法)

My birthday is coming up and traditionally I'm serving pie. Not just one pie, no, I have a number N of them, of various tastes and of various sizes. F of my friends are coming to my party and each of ...

2019-02-13 11:36:42 233

转载 HihoCoder 1514 偶像的条件(二分法)

小Hi的学校正面临着废校的大危机。面对学校的危机,小Hi同学们决定从ABC三个班中各挑出一名同学成为偶像。  成为偶像团体的条件之一,就是3名团员之间的身高差越小越好。  已知ABC三个班同学的身高分别是A1..AN, B1..BM 和 C1..CL。请你从中选出3名同学Ai, Bj, Ck使得D=|Ai-Bj|+|Bj-Ck|+|Ck-Ai|最小。Input第一行包含3个整数,N...

2019-02-13 11:36:18 213

原创 HDU 5857 Median(归并排序)

题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=58把一个数组不断地合并,合成数组1<=i<=mid  mid+1<=j<=N在合并过程中会产生逆序数用i 来控制前一个序列,用j 来控制后一个序列①如果a[i]<=a[j]时,a[i]比后序列中的a[j]以后的数都小,同时小于前序列中的a[i]以后的数②如...

2019-02-13 11:35:34 277

原创 CodeForces 985D Sand Fortress(二分查找)

You are going to the beach with the idea to build the greatest sand castle ever in your head! The beach is not as three-dimensional as you could have imagined, it can be decribed as a line of spots to...

2019-02-13 11:22:49 363

转载 HDU 1043 Eight (八数码问题 康托展开 bfs)

题面The 15-puzzle has been around for over 100 years; even if you don't know it by that name, you've seen it. It is constructed with 15 sliding tiles, each with a number from 1 to 15 on it, and all pa...

2019-02-13 11:17:45 364

原创 Burrito King(贪心+结构体排序)

2014-2015 ACM-ICPC Northeastern European Regional Contest (NEERC 14)题意理解每种 Burrito有最大重量,每点一千克Albert会增加ai点开心,Barney会增加bi点不开心。最终,Albert的开心值必须大于等于A,Batney的不开心值必须小于等于B。如果有结果,就要输出最终的开心值和不开心值,以及每种...

2018-12-03 21:04:26 438

原创 POJ 3273 Monthly Expense(二分查找)

Farmer John is an astounding accounting wizard and has realized he might run out of money to run the farm. He has already calculated and recorded the exact amount of money (1 ≤ moneyi ≤ 10,000) that h...

2018-11-04 15:50:01 272

原创 PAT (Advanced Level) 1002 A+B for Polynomials

1002 A+B for Polynomials (25 分)This time, you are supposed to find A+B where A and B are two polynomials.Input Specification:Each input file contains one test case. Each case occupies 2 lines, a...

2018-11-04 15:47:20 179

原创 PAT (Advanced Level)1001 A+B Format

1001 A+B Format (20 分)Calculate a+b and output the sum in standard format -- that is, the digits must be separated into groups of three by commas (unless there are less than four digits).Input Spe...

2018-11-04 15:12:41 171

原创 HDU 5857 Median(找中位数)

Description 给出一个长度为n的有序序列Ai,m次查询,每次查询输入两个区间[l1,r1],[l2,r2],输出将这两个区间的数放在一起后的中位数 Input 第一行一整数T表示用例组数,每组用例首先输入两整数n和m表示序列长度和查询数,之后n个整数Ai表示该序列,之后每次输入四个整数l1,r1,l2,r2表示一次查询 (T<=200,n,m<=100000,Ai最多是32位...

2018-10-13 21:41:49 265

原创 HDU 1429 胜利大逃亡(续) (BFS)

题解:https://blog.csdn.net/u014303647/article/details/38658991  思路来自上面这篇大佬的题解,解题思路源自上面这篇题解  解题关键在于:如何表示是否带了钥匙 一共有10把钥匙,共有1024种状态,用二进制表示   j i h g f e d c b ...

2018-10-13 21:39:48 265

原创 CodeForces - 1027C(贪心)

You have nn sticks of the given lengths.Your task is to choose exactly four of them in such a way that they can form a rectangle. No sticks can be cut to pieces, each side of the rectangle must be f...

2018-10-13 21:27:17 348

原创 ACM-ICPC 2018 徐州赛区网络预赛 Trace

There's a beach in the first quadrant. And from time to time, there are sea waves. A wave ( xxx , yyy ) means the wave is a rectangle whose vertexes are ( 000 , 000 ), ( xxx , 000 ), ( 000 , yyy ), ( ...

2018-09-13 18:00:57 304

原创 HDU - 1506 Largest Rectangle in a Histogram(DP)

 A histogram is a polygon composed of a sequence of rectangles aligned at a common base line. The rectangles have equal widths but may have different heights. For example, the figure on the left shows...

2018-09-07 10:49:12 225

转载 AtCoder - 4240 Candy Distribution

Problem StatementThere are N boxes arranged in a row from left to right. The i-th box from the left contains Ai candies.You will take out the candies from some consecutive boxes and distribute the...

2018-09-06 20:48:44 496

原创 ACM-ICPC 2018 南京赛区网络预赛 AC Challenge (dp+状态压缩)

Dlsj is competing in a contest with n(0<n≤20)n (0 < n \le 20)n(0<n≤20) problems. And he knows the answer of all of these problems.However, he can submit iii-th problem if and only if he has...

2018-09-06 20:17:51 231

原创 动态规划经典问题总结

子串和子序列子串:母串中连续的一段字符串子序列:所有元素都属于母串,并保留原来的顺序,但是元素在母串中不一定相邻子串一定是子序列,但子序列不一定是子串最大连续子串和求母串中最大的区间和,用dp[i]表示以i结尾的连续子串的最大和,若dp[i-1]<=0,dp[i]=a[i]   若dp[i-1]>0,dp[i]=dp[i-1]+a[i];即,以上一个元素...

2018-08-15 10:25:36 1391 1

原创 背包问题总结

N件物品,V容量,每件物品的代价v[i],价值w[i]01背包每种物品只能取一个,for i: 1 to N for j : V to v[i] f[j] = f[j-v[i]] + w[i];完全背包每种物品可以取无限个,但是体积不能超过V,for i: 1 to N for j = v[i] to V f[j] = f[j-v[i]] + w[i...

2018-08-14 21:28:59 221

原创 LightOJ 1145 Dice (I) (动态规划+递推)

a[]数组:记录当前放了i个骰子后,可以到达的值对应的方法种数s[]数组:记录每放一个骰子后的前缀和以6个面的骰子为例,k=6  1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 i=1 1 1 1 1 1 1     ...

2018-08-10 16:47:05 260

原创 Codeforces 837E Vasya's Function(数论、gcd)

题目原网页->   Codeforces 837E Vasya's Function写这道题参考了->https://blog.csdn.net/calabash_boy/article/details/76652792这道题不存在多组样例输入。一开始以为会有多组样例输入,打算预处理出1~1e6所有数的因数,非常非常麻烦。 当输入的x和y不互质的时候,需要先计算出gc=gc...

2018-08-07 20:27:42 456

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除