摘要:
此题的策略是选取可用范围最右边的点,一般来说该点辐射两边,左侧辐射,右侧辐射,所以用两个循环,第一个循环找出该点,第二个循环求出最右边的点 源代码: #include<iostream>#include<algorithm>using namespace std;#define maxn 1100i 阅读全文
posted @ 2020-05-29 20:40
Joelin12
阅读(169)
评论(0)
推荐(0)
摘要:
方法:将S逆序与S正序相比较,谁小加哪个 源代码 #include<iostream>#include<iomanip>#include<cstdio>#include<cmath>#include<vector>#include<cstdlib>#include<algorithm>using n 阅读全文
posted @ 2020-05-29 18:14
Joelin12
阅读(114)
评论(0)
推荐(0)
摘要:
本题的关键是从可选择方法中选择哪一类最优化 答案是结束时间最早的一类 源代码 #include<iostream>#include<algorithm>#include<cstdio>#define maxn 100100using namespace std;struct w{ int endd, 阅读全文
posted @ 2020-05-29 13:16
Joelin12
阅读(135)
评论(0)
推荐(0)
摘要:
贪心法遵从某种规则,不断贪心优化过程,此题规则就是优先选择面值大的硬币 源代码 #include<iostream>#include<cstdio>using namespace std;int main(){ int V[]={1,5,10,50,100,500}; int num=0,money 阅读全文
posted @ 2020-05-29 11:50
Joelin12
阅读(180)
评论(0)
推荐(0)
摘要:
宽度优先搜索运用了队列(queue)在unility头文件中 源代码 #include<iostream>#include<cstdio>#include<queue>#include<algorithm>#include<utility>using namespace std;typedef pa 阅读全文
posted @ 2020-05-29 11:27
Joelin12
阅读(256)
评论(0)
推荐(0)
浙公网安备 33010602011771号