上一页 1 ··· 16 17 18 19 20 21 22 23 24 ··· 54 下一页
  2023年4月5日
摘要: 求区间 [ l,r] 中 的最大子段和 即 Sum[r]-Sum[l] 阅读全文
posted @ 2023-04-05 18:14 towboat 阅读(7) 评论(0) 推荐(0)
摘要: 直角坐标系中,有 nn 个点。要求先从左往右走,再从右往左走,不重复的经过每一个点。 求出最短路径(距离为两点间直线距离)。 f [i ][j ] 表示点 1~max(i,j) 已走过,的路径长度 #include <iostream> #include <algorithm> #include < 阅读全文
posted @ 2023-04-05 16:15 towboat 阅读(16) 评论(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 阅读(20) 评论(0) 推荐(0)
摘要: 你有两个 CPU,n个程序(m个类型)要运行。 在不同条件下程序运行的时间不同,但连续运行的时间满足小于等于在不连续状态下运行的时间。 #include <iostream> #include <cstring> #include <queue> using namespace std; const 阅读全文
posted @ 2023-04-04 14:15 towboat 阅读(51) 评论(0) 推荐(0)
  2023年4月3日
摘要: 一共有n 个飞行员,其中有 m 个外籍飞行员和 (n−m) 个英国飞行员,外籍飞行员从 1 到 m 编号,英国飞行员从 m+1 到 n 编号。 对于给定的外籍飞行员与英国飞行员的配合情况,设计一个算法找出最佳飞行员配对方案,使皇家空军一次能派出最多的飞机。 二分图板子题 用网络流输出时,判断w[i] 阅读全文
posted @ 2023-04-03 22:10 towboat 阅读(24) 评论(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 阅读(21) 评论(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 阅读(44) 评论(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 阅读(22) 评论(0) 推荐(0)
  2023年4月1日
摘要: 对分数取模,对B求逆元 (费马小定理实现) #define int long long const int mod =1e9+7; int ksm(int x,int y){ if(y==0) return 1; int t= ksm(x,y/2) ; if(y&1) return ((t*t%mo 阅读全文
posted @ 2023-04-01 22:38 towboat 阅读(39) 评论(0) 推荐(0)
摘要: 换根dp, father -> son , 基本是加减 #include <bits/stdc++.h> using namespace std ; const int N=1e5+2,M=N*5; #define int long long int n,a[N],sz[N],g[N],f[N],S 阅读全文
posted @ 2023-04-01 17:31 towboat 阅读(18) 评论(0) 推荐(0)
上一页 1 ··· 16 17 18 19 20 21 22 23 24 ··· 54 下一页