摘要: https://www.luogu.com.cn/problem/P2347动态规划DP橙色题 #include<bits/stdc++.h> using namespace std; int f[10000000]={}; int c[10000000]={}; int main() { int 阅读全文 »
posted @ 2022-08-09 14:08 -イレイナ 阅读(33) 评论(0) 推荐(0) 编辑
摘要: https://www.luogu.com.cn/problem/P1250 贪心,排序,差分约束黄色题 思路一: 区间选点问题 贪心,要种树种得少,就要使一棵树给多个区间使用,这样,尽量在重叠区间种树即可,而重叠位置一定是区间尾部。处理问题时,先按所有区间的结束位置从小到大排序,若结束位置相同,则 阅读全文 »
posted @ 2022-08-09 14:05 -イレイナ 阅读(68) 评论(0) 推荐(0) 编辑
摘要: https://www.luogu.com.cn/problem/P1167模拟,贪心,排序黄色题 思路: 1.计算出时间差 2.最后特别简单的贪心 读入: scanf("%d-%d-%d-%d:%d",&start[1],&start[2],&start[3],&start[4],&start[5 阅读全文 »
posted @ 2022-08-09 10:29 -イレイナ 阅读(82) 评论(0) 推荐(0) 编辑
摘要: https://www.luogu.com.cn/problem/P2370动态规划背包,排序,二分黄色题 思路一:01背包+排序 #include<cstdio> #include<algorithm> using namespace std; int n,p,s; int dp[1005];// 阅读全文 »
posted @ 2022-08-09 09:50 -イレイナ 阅读(27) 评论(0) 推荐(0) 编辑
摘要: https://www.luogu.com.cn/problem/P1090贪心,二叉堆,优先队列黄色题 思路:大致思路也就是,先找到两个最小的,取出来,相加再放进去,但如果每次取之前都进行一次排序的话就会超时,所以不排序直接找到最小的和次小的。 #include<bits/stdc++.h> us 阅读全文 »
posted @ 2022-08-09 08:53 -イレイナ 阅读(30) 评论(0) 推荐(0) 编辑
摘要: https://www.luogu.com.cn/problem/P1056贪心,排序黄色题 思路一:找出划分哪些相邻的两行和相邻的两列可以隔开的同学最多 #include<iostream> #include<cstdio> #include<cstring> #include<algorithm 阅读全文 »
posted @ 2022-08-09 08:05 -イレイナ 阅读(57) 评论(0) 推荐(0) 编辑
点击右上角即可分享
微信分享提示