贪心
live4m
老菜逼了
展开
-
CodeForces 1294 E.Obtain a Permutation (贪心)
E.Obtain a PermutationYou are given a rectangular matrix of size n×m consisting of integers from 1 to 2⋅105.In one move, you can:choose any element of the matrix and change its value to any integer...原创 2020-01-23 14:58:53 · 414 阅读 · 0 评论 -
CodeForces478 C.Table Decorations (贪心)
C.Table DecorationsYou have r red, g green and b blue balloons. To decorate a single table for the banquet you need exactly three balloons. Three balloons attached to some table shouldn’t have the sa...原创 2019-10-31 18:38:26 · 236 阅读 · 0 评论 -
poj1456 Supermarket (贪心)(并查集优化)
题意先给n然后n个商品的价值和贩卖截止时间。一天只能卖一件问能卖出的最大价值是多少Sample Input4 50 2 10 1 20 2 30 17 20 1 2 1 10 3 100 2 8 25 20 50 10Sample Output80185分析:贪心。先把所有商品按价值排序,先卖价值最高的。卖出去之后如果下一件商品的截止时间...原创 2019-06-08 19:26:01 · 128 阅读 · 0 评论