
贪心
_Daredevil_
纸上得来终觉浅,
绝知此事要躬行。
展开
-
2020 牛客多校 第五场 D-Drop Voicing(贪心 + LIS)
题目链接: D-Drop VoicingDescription题意:给出一个序列,求通过两种操作用最少的操作次数可以把序列有序Inaka composes music. Today’s arrangement includes a chord of n notes that are pairwise distinct, represented by a permutation p1…pn of integers from 1 to n (inclusive) denoting the notes fr原创 2020-09-04 10:44:33 · 264 阅读 · 0 评论 -
2020 牛客多校 第四场 H-Harder Gcd Problem(贪心 + 思维)
题目链接: H-Harder Gcd ProblemDescription题意:给出1~n的序列,求gcd>1的最大组数并输出任意一种方案After solving the Basic Gcd Problem, ZYB gives you a more difficult one:Given an integer n, find two subset A and B of {1,2,…,n} such that:∣A∣=∣B∣=m and A∩B=∅ Let A={a1,a2,…,am} a原创 2020-09-04 10:43:41 · 228 阅读 · 0 评论 -
2020 HDU多校 第四场 02-Blow up the Enemy(贪心 + Map)
题目链接: 02-Blow up the EnemyDescription题意:给出n把武器的伤害值和使用间隔,求选中互相攻击必胜的概率Zhang3 is playing a shooting game with Father. In the game there are two players trying to kill each other to win the game.The game provides n weapons, each has two properties: Damage原创 2020-08-24 09:45:03 · 229 阅读 · 0 评论 -
2020 HDU多校 第三场 04-Tokitsukaze and Multiple(贪心 + 前缀和)
题目链接: 04-Tokitsukaze and MultipleDescription题意:给出n个数和p,求最多可以有多少个不相交的连续子序列和可以整除pTokitsukaze has a sequence of length n, denoted by a.Tokitsukaze can merge two consecutive elements of a as many times as she wants. After each operation, a new element that原创 2020-08-04 11:25:32 · 500 阅读 · 0 评论 -
2020牛客多校 第三场 A-Clam and Fish (贪心 + 模拟)
题目链接: A-Clam and FishDescription题意:给出四种状态,可以执行四种操作,求获取的最大鱼的数量。There is a fishing game as following:The game contains nn stages, numbered from 1 to n.There are four types of stages (numbered from 0 to 3):type 0: There are no fish and no clam in this原创 2020-07-21 23:49:11 · 500 阅读 · 0 评论