
二分、贪心
二分、贪心
G_Meteor
AKK
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
18北邮计算机院-D.最长平衡子串 //哈希+贪心
题目描述给定只含01的字符串,找出最长平衡子串的长度(平衡串:包含0和1的个数相同),串长最大10^6输入一个字符串,只包含01,长度不超过1000000输出一行一个整数,最长的0与1的个数相等的子串的长度。示例输入3101111111010示例输出204思路:将0看做-1,求前i项和,当前i项和为0时,以此元素为结尾的最长长度为当前下...原创 2020-02-10 18:19:52 · 676 阅读 · 0 评论 -
18北邮网研院-D.最大价值 //贪心
题目描述对于每一个零件都有一个适宜温度区间,[Ri,Ji],当温度t<Ri,零件价值为x,当t>Ji,零件价值为z;当温度适宜,价值为y。且y>x,y>z。此刻,有一恒温箱,可确定温度t。输入第一行按顺序分别为 n,x,y,z。0<n<20000接下来n行为 每一个零件的适宜温度区间0<Ri<Ji<10^9输出确定一个温度值t,...原创 2020-02-07 18:22:52 · 549 阅读 · 0 评论 -
二分贪心 B - 02
DescriptionYou have just moved from Waterloo to a big city. The people here speak an incomprehensible dialect of a foreign language. Fortunately, you have a dictionary to help you understand the原创 2017-04-21 09:44:44 · 479 阅读 · 0 评论 -
二分贪心 E - 05
DescriptionFarmer John has built a new long barn, with N (2 His C (2 <= C <= N) cows don't like this barn layout and become aggressive towards each other once put into a stall. To prevent th原创 2017-04-21 09:55:08 · 396 阅读 · 0 评论 -
二分贪心 U - 21
DescriptionLittle Bob likes playing with his box of bricks. He puts the bricks one upon another and builds stacks of different height. "Look, I've built a wall!", he tells his older sister Alice原创 2017-04-29 20:25:42 · 331 阅读 · 0 评论 -
二分贪心 T - 20
DescriptionA factory produces products packed in square packets of the same height h and of the sizes 1*1, 2*2, 3*3, 4*4, 5*5, 6*6. These products are always delivered to customers in the square原创 2017-04-29 20:42:08 · 308 阅读 · 0 评论 -
二分贪心 X - 24
DescriptionThe whole family was excited by the news. Everyone knew grandpa had been an extremely good bridge player for decades, but when it was announced he would be in the Guinness Book of Wor原创 2017-04-30 20:05:03 · 287 阅读 · 0 评论 -
二分贪心 F - 06
DescriptionInhabitants of the Wonderland have decided to hold a regional programming contest. The Judging Committee has volunteered and has promised to organize the most honest contest ever. It原创 2017-04-30 20:16:12 · 281 阅读 · 0 评论 -
二分贪心 D - 04
DescriptionThe SUM problem can be formulated as follows: given four lists A, B, C, D of integer values, compute how many quadruplet (a, b, c, d ) ∈ A x B x C x D are such that a + b + c + d = 0原创 2017-04-30 21:43:10 · 355 阅读 · 0 评论 -
二分贪心 G - 07
DescriptionWhen a thin rod of length L is heated n degrees, it expands to a new length L'=(1+n*C)*L, where C is the coefficient of heat expansion. When a thin rod is mounted on two solid walls原创 2017-05-01 20:27:13 · 304 阅读 · 0 评论