
基本算法--前缀和与差分
淼润淽涵
这个作者很懒,什么都没留下…
展开
-
CodeForces - 231C To Add or Not to Add(前缀和+贪心)
Problem DescriptionA piece of paper contains an array of n integers a1, a2, ..., an. Your task is to find a number that occurs the maximum number of times in this array.However, before looking fo...原创 2019-07-31 07:55:27 · 198 阅读 · 0 评论 -
CodeForce 961-B Lecture Sleep(前缀和)
Problem DescriptionYour friend Mishka and you attend a calculus lecture. Lecture lasts n minutes. Lecturer tells ai theorems during the i-th minute.Mishka is really interested in calculus, though...原创 2019-05-05 15:10:32 · 299 阅读 · 0 评论 -
POJ3263:Tallest Cow (前缀和,差分)
题目描述有 N头牛站成一行,被编队为1、2、3…N,每头牛的身高都为整数。当且仅当两头牛中间的牛身高都比它们矮时,两头牛方可看到对方。现在,我们只知道其中最高的牛是第 P头,它的身高是 H,剩余牛的身高未知。但是,我们还知道这群牛之中存在着 M对关系,每对关系都指明了某两头牛 A 和 B可以相互看见。求每头牛的身高的最大可能值是多少。输入格式第一行输入整数N,P,H,M,...原创 2019-07-25 09:25:47 · 419 阅读 · 0 评论