![](https://img-blog.csdnimg.cn/20201014180756913.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
贪心算法
deebcjrb
这个作者很懒,什么都没留下…
展开
-
【每日一题】8月11日题目精讲—矩阵消除游戏
https://ac.nowcoder.com/acm/problem/200190作者:西西莉链接:https://ac.nowcoder.com/discuss/472302来源:牛客网首先,我们很容易得到,先选哪一行(列),后选哪一行(列),只要选的一样是不影响结果的,这个我相信大家都能看出来啦……第二,如果只按行选,或者只按列选,贪心妥妥的(把合最大的几行加起来就ok啦)。第三,也是本题第一个问题:如果只按列选或者只按行选没有交叉就一定是最大值吗?——没有交叉只能保证选的数字最.原创 2020-08-25 20:38:22 · 147 阅读 · 0 评论 -
【每日一题】8月10日题目精讲—排座椅(贪心)
https://ac.nowcoder.com/acm/problem/16618分开行与列分开计算,贪心即可,记得存一下位置并且输出顺序#include<iostream>#include<string>#include<math.h>#include<algorithm>#include<queue>#include<bits/stdc++.h>typedef long long ll;ll gcd(ll a原创 2020-08-11 18:48:43 · 94 阅读 · 0 评论 -
牛客寒假算法基础集训营3(D 处女座的训练)基础贪心
https://ac.nowcoder.com/acm/contest/329/D#include <iostream>#include <cstdio>#include <fstream>#include <algorithm>#include <cmath>#include <deque>#include...原创 2020-02-04 12:37:49 · 651 阅读 · 0 评论 -
Coffee Break(贪心+STL)
Recently Monocarp got a job. His working day lasts exactly mm minutes. During work, Monocarp wants to drink coffee at certain moments: there are nn minutes a1,a2,…,ana1,a2,…,an , when he is able and w...原创 2020-02-02 23:05:59 · 274 阅读 · 0 评论