
贪心
sigh_
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
Gym_102823A Array Merge(贪心)
Array Merge time limit per test:1 seconds memory limit per test:256 megabytes Problem Description Given two arrays AAA, BBB of length n and m separately, you have to merge them into only one array CCC (of length n+mn+mn+m) obeying the rule that the relativ原创 2020-12-19 19:48:32 · 684 阅读 · 2 评论 -
CodeForces_1461E Water Level(数论 + 贪心)
Water Level time limit per test:1 seconds memory limit per test:256 megabytes Problem Description In recent years John has very successfully settled at his new job at the office. But John doesn’t like to idly sit around while his code is compiling, so he i原创 2020-12-12 16:07:34 · 506 阅读 · 1 评论 -
CodeForces_1456C New Game Plus!(贪心)
New Game Plus! time limit per test:2 seconds memory limit per test:256 megabytes Problem Description Wabbit is playing a game with n bosses numbered from 1 to n. The bosses can be fought in any order. Each boss needs to be defeated exactly once. There is a原创 2020-11-30 11:29:42 · 390 阅读 · 0 评论 -
Gym_102028B Ultraman vs. Aodzilla and Bodzilla(贪心)
Ultraman vs. Aodzilla and Bodzilla time limit per test:2 seconds memory limit per test:1024 megabytes Problem Description Six months ago our hero, formerly known as Huriyyah, was beating all monsters in the land. Now he changed his name to Ultraman and le原创 2020-10-22 13:35:36 · 318 阅读 · 0 评论 -
CodeForces_1419D Sage‘s Birthday(构造 + 贪心)
Sage’s Birthday time limit per test:1 seconds memory limit per test:256 megabytes Problem Description Today is Sage’s birthday, and she will go shopping to buy ice spheres. All nnn ice spheres are placed in a row and they are numbered from 111 to nnn from原创 2020-09-20 10:08:47 · 374 阅读 · 0 评论 -
CodeForces_1400E Clear the Multiset(分治)
Clear the Multiset time limit per test:2 seconds memory limit per test:256 megabytes Problem Description You have a multiset containing several integers. Initially, it contains a1a_1a1 elements equal to 1, a2a_2a2 elements equal to 2, …, ana_nan element原创 2020-08-28 16:17:41 · 205 阅读 · 0 评论 -
CodeForces_1379C Choosing flowers(贪心)
Choosing flowers time limit per test:1 seconds memory limit per test:512 megabytes Problem Description Vladimir would like to prepare a present for his wife: they have an anniversary! He decided to buy her exactly nnn flowers. Vladimir went to a flower sho原创 2020-07-21 18:08:38 · 483 阅读 · 0 评论 -
CodeForces_1385F Removing Leaves(贪心)
Removing Leaves time limit per test:2 seconds memory limit per test:256 megabytes Problem Description You are given a tree (connected graph without cycles) consisting of nnn vertices. The tree is unrooted — it is just a connected undirected graph without c原创 2020-07-19 10:20:33 · 207 阅读 · 0 评论 -
CodeForces_1375E Sum of Digits(暴力+贪心)
Sum of Digits time limit per test:2 seconds memory limit per test:512 megabytes Problem Description Let f(x)f(x)f(x) be the sum of digits of a decimal number x. Find the smallest non-negative integer xxx such that f(x)+f(x+1)+⋯+f(x+k)=nf(x)+f(x+1)+⋯+f(x+k)原创 2020-07-06 21:44:48 · 422 阅读 · 0 评论 -
洛谷_1686 挑战(贪心)
挑战 题目链接:https://www.luogu.com.cn/problem/P1686 题解: 将起始点作为原点(0,0)(0,0)(0,0),每次移动后,坐标记为(xi,yi)(x_i,y_i)(xi,yi)。共n+1个点,因为捷径是直线,所以每个点只需要找到x相等或y相等的点。 暂时只考虑x相等的状态,设当前共有k个点的x相等,y分别为y1,y2,...,yky_1,y_2,...,y_ky1,y2,...,yk。将y顺序排列,捷径一定是y1−>y2y_1->y_2y1−&原创 2020-06-25 14:13:59 · 248 阅读 · 0 评论 -
CodeForces_1370E Binary Subsequence Rotationv(贪心)
Binary Subsequence Rotation time limit per test:2 seconds memory limit per test:256 megabytes Problem Description Naman has two binary strings sss and ttt of length nnn (a binary string is a string which only consists of the characters “0” and “1”). He wan原创 2020-06-21 13:52:36 · 504 阅读 · 0 评论 -
洛谷_1084 疫情控制(贪心+倍增+二分)
疫情控制 题目链接:https://www.luogu.com.cn/problem/P1084 题解: 对答案进行二分,然后check在时限内,能否满足题目条件。(若军队数目小于1号节点的子节点数,则无解) check:显然在规定时间内,军队的移动越靠近根节点更好。所以可以先求出时限内,每支军队能移动到的最靠近根节点的位置,可以利用倍增快速计算。 将所有能移动至根节点的军队标记为未驻扎状态,单独记录其到根节点已花费的时间,以及来自根节点的哪个子树。 DFS判断根节点每个子节点所在子树是否满足要求,若不满足原创 2020-06-11 23:52:18 · 646 阅读 · 0 评论 -
POJ_2433 Landscaping(贪心)
Landscaping Time Limit: 1000MS Memory Limit: 65536K Problem Description Farmer John is making the difficult transition from raising mountain goats to raising cows. His farm, while ideal for mountain...原创 2020-05-06 17:23:11 · 275 阅读 · 0 评论 -
ZOJ_3627 Treasure Hunt II(贪心)
Treasure Hunt II Time Limit: 2000 ms Memory Limit: 65536 KB Problem Description There are n cities(1, 2, … ,n) forming a line on the wonderland. city i and city i+1 are adjacent and their distance is ...原创 2020-05-04 21:30:59 · 217 阅读 · 0 评论 -
CodeForces_1201D Treasure Hunting(贪心)
Treasure Hunting time limit per test:3 seconds memory limit per test:256 megabytes Problem Description You are on the island which can be represented as a n×mn×mn×m table. The rows are numbered from 1...原创 2020-04-11 10:45:12 · 184 阅读 · 0 评论