上一页 1 ··· 16 17 18 19 20 21 22 23 24 ··· 54 下一页
  2023年4月5日
摘要: 树状数组 1. 求区间和 2. 单点赋值 还是单点改,通过维护一个a[ i ],来求改变值 #include <iostream> #include <cstring> #include <sstream> using namespace std; const int N=2e5+4; int n, 阅读全文
posted @ 2023-04-05 23:15 towboat 阅读(51) 评论(0) 推荐(0)
摘要: 求一个最短序列,使得输入的两个串的均为他的子序列,同时输出方案数。 n+m-LCS 方案数转移时求 #include <iostream> #include <cstring> using namespace std; #define int long long int n,m; char a[10 阅读全文
posted @ 2023-04-05 22:46 towboat 阅读(51) 评论(0) 推荐(0)
摘要: 求区间 [ l,r] 中 的最大子段和 即 Sum[r]-Sum[l] 阅读全文
posted @ 2023-04-05 18:14 towboat 阅读(20) 评论(0) 推荐(0)
摘要: 直角坐标系中,有 nn 个点。要求先从左往右走,再从右往左走,不重复的经过每一个点。 求出最短路径(距离为两点间直线距离)。 f [i ][j ] 表示点 1~max(i,j) 已走过,的路径长度 #include <iostream> #include <algorithm> #include < 阅读全文
posted @ 2023-04-05 16:15 towboat 阅读(29) 评论(0) 推荐(0)
  2023年4月4日
摘要: https://codeforces.com/contest/1807/problem/G1 easy -version 同《货币系统》 背包 f[ j ] 每个数字合成的次数 #include <iostream> #include <cstring> using namespace std ; 阅读全文
posted @ 2023-04-04 14:53 towboat 阅读(40) 评论(0) 推荐(0)
摘要: 你有两个 CPU,n个程序(m个类型)要运行。 在不同条件下程序运行的时间不同,但连续运行的时间满足小于等于在不连续状态下运行的时间。 #include <iostream> #include <cstring> #include <queue> using namespace std; const 阅读全文
posted @ 2023-04-04 14:15 towboat 阅读(70) 评论(0) 推荐(0)
  2023年4月3日
摘要: 一共有n 个飞行员,其中有 m 个外籍飞行员和 (n−m) 个英国飞行员,外籍飞行员从 1 到 m 编号,英国飞行员从 m+1 到 n 编号。 对于给定的外籍飞行员与英国飞行员的配合情况,设计一个算法找出最佳飞行员配对方案,使皇家空军一次能派出最多的飞机。 二分图板子题 用网络流输出时,判断w[i] 阅读全文
posted @ 2023-04-03 22:10 towboat 阅读(43) 评论(0) 推荐(0)
摘要: 酒店只有P间房间,一天只有固定的 q 道不同的菜,每个房间只能住一位客人,每道菜也只能给一位客人食用。 有一天来了 n个客人,每个客人说出了自己喜欢哪些房间,喜欢哪道菜。 怎么分配,能使最多顾客满意呢? 2 2 2 1 0 1 0 1 1 1 1 二分图, S, 房间,人,食物,T 连边即可 还有, 阅读全文
posted @ 2023-04-03 21:46 towboat 阅读(48) 评论(0) 推荐(0)
摘要: f[i ] += f[i-j] j<=100 ( j belong to S 构造的矩阵: 这种求和的柿子可以化为矩阵乘法,做法是 矩阵对应元素设置0/1 #include <iostream> #include <cstring> #include <map> using namespace st 阅读全文
posted @ 2023-04-03 18:31 towboat 阅读(71) 评论(0) 推荐(0)
摘要: dp &单调队列优化 这个题 : k<=i, 决策点k 可以等于i ,所以在 i 入队后递推 #include<iostream> #include<algorithm> #include<cstring> using namespace std; const int N =503,M =1e4+2 阅读全文
posted @ 2023-04-03 13:34 towboat 阅读(45) 评论(0) 推荐(0)
上一页 1 ··· 16 17 18 19 20 21 22 23 24 ··· 54 下一页