上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 35 下一页
摘要: ##题目链接:https://onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&category=0&problem=2023&mosmsg=Submission+received+with+ID+ 阅读全文
posted @ 2021-07-10 18:51 Tartarus_li 阅读(38) 评论(0) 推荐(0) 编辑
摘要: ##题目链接:https://onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=3466 \(dp[i][j]\) 表示时间 \(i\) 在站点 \(j\) 时最少需要等待的时间 每 阅读全文
posted @ 2021-07-10 00:01 Tartarus_li 阅读(21) 评论(0) 推荐(0) 编辑
摘要: 到达一个点后讨论是否需要等待即可,需要等待则加上等待的时间 #include<bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> pii; const int maxn = 50010; i 阅读全文
posted @ 2021-07-09 21:46 Tartarus_li 阅读(23) 评论(0) 推荐(0) 编辑
摘要: ##题目链接:https://onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&category=0&problem=694&mosmsg=Submission+received+with+ID+2 阅读全文
posted @ 2021-07-09 18:54 Tartarus_li 阅读(32) 评论(0) 推荐(0) 编辑
摘要: 题目链接:https://onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=183 求出传递闭包,知道两个人之间能否直接或间接互相联系,如果能互相联系则在一个电话圈里,建新图输出每个 阅读全文
posted @ 2021-07-08 22:47 Tartarus_li 阅读(21) 评论(0) 推荐(0) 编辑
摘要: ##题目链接 先求出不买套餐的最小生成树的边 然后枚举选择哪些套餐,将套餐中的边权置为 \(0\), 和原先最小生成树的边重新进行 \(kruscal\) 而原先选不到的边,权值大于套餐和最小生成树的边,后来一定也选不到 #include<bits/stdc++.h> using namespace 阅读全文
posted @ 2021-07-08 18:23 Tartarus_li 阅读(23) 评论(0) 推荐(0) 编辑
摘要: 题目链接 https://onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&category=0&problem=3371&mosmsg=Submission+received+with+ID+26 阅读全文
posted @ 2021-07-07 22:25 Tartarus_li 阅读(21) 评论(0) 推荐(0) 编辑
摘要: 出现次数最多的数字的次数即为最少的答案, 只需要依次将序列按顺序分隔开即可,每组 \(n/ans\) 的长度 #include<bits/stdc++.h> using namespace std; typedef long long ll; const int maxn = 10010; int 阅读全文
posted @ 2021-06-03 15:21 Tartarus_li 阅读(34) 评论(0) 推荐(0) 编辑
摘要: 注意到行列互不影响,所以将行列分开考虑 问题转化为:给定 \(n\) 条线段,填入 \(n\) 个格子,使得每个线段都被填入一个格子,且同一个格子只能填入一个线段 贪心,一个一个格子来看,所以将所有线段按左端点排序,该格子可以填入左端点在该格子左边的所有线段,为了保证最优, 再将这些线段按右端点排序 阅读全文
posted @ 2021-06-03 12:03 Tartarus_li 阅读(44) 评论(0) 推荐(0) 编辑
摘要: 二分没什么好说的,但 \(check\) 函数很难写 首先将所有任务按左端点排序,然后枚举时间,速度就是单位时间的工作量 在当前时间之前开始的所有任务中,贪心地先完成结束时间早的任务,使用优先队列来实现 (枚举任务查看时间的写法要处理浮点数,没有通过,不知道是哪里有问题) AC代码: #includ 阅读全文
posted @ 2021-06-03 00:32 Tartarus_li 阅读(40) 评论(0) 推荐(0) 编辑
上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 35 下一页