上一页 1 ··· 12 13 14 15 16 17 18 19 20 ··· 54 下一页
  2023年4月16日
摘要: 求 n×n 的环状方阵上的最大子矩阵和。 构造 2*n *( 2*n) 的正方形 求余的一个操作 x''= (x-1)%n+1 #include <iostream> #include <cstring> #include <algorithm> using namespace std; const 阅读全文
posted @ 2023-04-16 12:56 towboat 阅读(9) 评论(0) 推荐(0)
摘要: bug: 前缀和不要写错啊啊, 比如 s[r]-s[l-1] #include <iostream> #include <cstring> #include <algorithm> using namespace std; const int N=4202; int mod ; int f[N][N 阅读全文
posted @ 2023-04-16 02:40 towboat 阅读(12) 评论(0) 推荐(0)
  2023年4月15日
摘要: 给出平面上的n个点,找一个矩形,使得边界上包含的点尽可能地多。 先维护前缀和 col[i][j],row[i][j] ,表示i行前j个的和。。 枚举上下边界,右边界,考虑维护左边届 #include <iostream> #include <cstring> #include <algorithm> 阅读全文
posted @ 2023-04-15 22:25 towboat 阅读(16) 评论(0) 推荐(0)
摘要: 利用网格图上空白的方格上建一个矩形的建筑。问地区中建筑物的最大面积 递推(dp) #include <iostream> #include <cstring> #include <sstream> using namespace std; const int N=1e3+2; char a[N][N 阅读全文
posted @ 2023-04-15 20:54 towboat 阅读(17) 评论(0) 推荐(0)
摘要: https://www.luogu.com.cn/problem/UVA1652 阅读全文
posted @ 2023-04-15 16:01 towboat 阅读(8) 评论(0) 推荐(0)
摘要: 有两个1~n 的排列A,B, B是1,2,3...n, 给出A每个数位置变化(往后,往前,不变) 问A排列数? 观察以下发现是个二分图匹配的模型,考虑dp f[i ][ j] 考虑前i个,有j个未匹配 #include <iostream> #include <cstring> using name 阅读全文
posted @ 2023-04-15 02:01 towboat 阅读(29) 评论(0) 推荐(0)
  2023年4月14日
摘要: 对于任意一个只含数字1~n的有序数字串{a1,a2,……,an},比较数字串中所有相邻数字的大小,后者大于前者的用I表示,否则用D表示。例如,数字串{3,1,2,7,4,6,5},{2,1,3,7,4,6,5}和{3,1,2,7,5,6,4}就表示为'DIIDID'。"?"则表示两数的关系未知。例如 阅读全文
posted @ 2023-04-14 22:49 towboat 阅读(36) 评论(0) 推荐(0)
摘要: 多判断一个唯一性 only[ x] [0/1] #include <iostream> #include <cstring> #include <vector> #include <map> #include <algorithm> using namespace std; const int N= 阅读全文
posted @ 2023-04-14 16:53 towboat 阅读(17) 评论(0) 推荐(0)
摘要: #include <iostream> #include <cstring> #include <vector> #include <algorithm> using namespace std; const int N=1e5+3; int f[N],n,K; vector<int> g[N]; 阅读全文
posted @ 2023-04-14 15:18 towboat 阅读(8) 评论(0) 推荐(0)
  2023年4月13日
摘要: 在一条直线的同一个方向上有 nn 件珠宝,已知每件珠宝的位置,并且第 ii 件珠宝在 Ti时刻消失, 问将所有的珠宝收集起来最小耗时? 搜集不耗时,移动需要耗时 类似区间dp f[i ][ j ] [2] #pragma GCC optimize(2) #include <iostream> usi 阅读全文
posted @ 2023-04-13 22:46 towboat 阅读(16) 评论(0) 推荐(0)
上一页 1 ··· 12 13 14 15 16 17 18 19 20 ··· 54 下一页