上一页 1 ··· 17 18 19 20 21 22 23 24 25 ··· 54 下一页
  2023年3月31日
摘要: 换根dp #include<iostream> #include<algorithm> #include<cstring> #include<queue> #define IOS std::ios::sync_with_stdio(0) using namespace std; #define in 阅读全文
posted @ 2023-03-31 21:05 towboat 阅读(17) 评论(0) 推荐(0)
摘要: 有 n 瓶水,第 ii 瓶水的水量为 ai,容量为 bi​。 将 1 单位水从一个瓶子转移到另一个瓶子所消耗时间为 1秒,且可以进行无限次转移。 求储存所有水所需最小瓶子数 k 以及该情况下所用最小时间 t。 第一问直接贪心 第二问 dp , 问题重要的的一个转化: 求不变的水瓶的最大值即可 f[i 阅读全文
posted @ 2023-03-31 15:26 towboat 阅读(45) 评论(0) 推荐(0)
  2023年3月30日
摘要: 给你一个长度为n的数列a和整数c 你需要把它任意分段 每一段假设长度为k,就去掉前[ k/c] ( 向下取整)小的数 最小化剩下的数的和 #include<iostream> #include<algorithm> #include<cstring> #include<queue> #define 阅读全文
posted @ 2023-03-30 23:29 towboat 阅读(27) 评论(0) 推荐(0)
摘要: 题目略,就是求最小割 (容量和最小的边集,使得图不联通,常用S-T割) 那么 最小割=最大流 这里要求点权和最小,可以通过拆点转化为边权 #include<iostream> #include<algorithm> #include<cstring> #include<queue> #define 阅读全文
posted @ 2023-03-30 22:13 towboat 阅读(20) 评论(0) 推荐(0)
摘要: 有一个 m 行 n列的方格图,每个方格中都有一个正整数。 现要从方格中取数,使任意两个数所在方格没有公共边,且取出的数的总和最大,请求出最大的和。 黑白染色, 相邻格子连边,S->黑点,白点->T, 形成一个二分图, 现在要删去一些边( 边权和最小) ,使得S-T不连通,即最小割 SUM - 最小割 阅读全文
posted @ 2023-03-30 21:14 towboat 阅读(28) 评论(0) 推荐(0)
  2023年3月29日
摘要: 同CF222E #include<iostream> #include<algorithm> #include<cstring> #include<vector> #define IOS std::ios::sync_with_stdio(0) using namespace std; const 阅读全文
posted @ 2023-03-29 22:20 towboat 阅读(26) 评论(0) 推荐(0)
摘要: W 公司有 mm 个仓库和 nn 个零售商店。第 ii 个仓库有 aiai​ 个单位的货物;第 jj 个零售商店需要 bjbj​ 个单位的货物。 货物供需平衡,sum{ai} =sum{bi} 从第 i 个仓库运送每单位货物到第 j 个零售商店的费用为 cij。 试设计一个将仓库中所有货物运送到零售 阅读全文
posted @ 2023-03-29 12:26 towboat 阅读(17) 评论(0) 推荐(0)
  2023年3月28日
摘要: 给出 N 条平行于坐标轴的线段,要你选出尽量多的线段使得这些线段两两没有交点(顶点也算)。 横的与横的,竖的与竖的线段之间保证没有交点,输出最多能选出多少条线段。 #include <iostream> #include <algorithm> #include <cstring> #include 阅读全文
posted @ 2023-03-28 22:58 towboat 阅读(18) 评论(0) 推荐(0)
摘要: https://ac.nowcoder.com/acm/contest/911/F 值域上维护右括号的个数,遇到左括号就查询前面有几个右括号 #include <iostream> #include <algorithm> #include <queue> using namespace std ; 阅读全文
posted @ 2023-03-28 21:19 towboat 阅读(19) 评论(0) 推荐(0)
摘要: 给出x和y,求一个长度为y的序列,其乘积为x,允许有负数,求这种序列的个数, x分解质因数,考虑每个 p^e, 把e分为y 份( 可以为0),个数为 C( e+y-1,e) 这题需要乘法逆元 来进行乘法 比如想组合数 n!/ (n-m)! * m! , 转化为 n!* fnv(n-m)! *fnv( 阅读全文
posted @ 2023-03-28 14:41 towboat 阅读(19) 评论(0) 推荐(0)
上一页 1 ··· 17 18 19 20 21 22 23 24 25 ··· 54 下一页