上一页 1 ··· 12 13 14 15 16 17 18 19 20 ··· 54 下一页
  2023年4月16日
摘要: 二分平均值x,每个数减去x , 找区间 S[ r ]- S[l]>=0 ,r-l>=m #include <iostream> #include <vector> #include <algorithm> using namespace std; const int N=1e5+5; #define 阅读全文
posted @ 2023-04-16 17:35 towboat 阅读(29) 评论(0) 推荐(0)
摘要: 一个集合中需要找到 a,b,c,d ,使得 a+b+c=d 枚举a,b ,计算a+b,存在map里 再枚举d,c ,计算d-c 是否 存在 d-c==a+b #include <iostream> #include <map> #include <algorithm> #include <vecto 阅读全文
posted @ 2023-04-16 15:53 towboat 阅读(41) 评论(0) 推荐(0)
摘要: 求 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 阅读(36) 评论(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 阅读(37) 评论(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 阅读(44) 评论(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 阅读(39) 评论(0) 推荐(0)
摘要: https://www.luogu.com.cn/problem/UVA1652 阅读全文
posted @ 2023-04-15 16:01 towboat 阅读(20) 评论(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 阅读(69) 评论(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 阅读(61) 评论(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 阅读(46) 评论(0) 推荐(0)
上一页 1 ··· 12 13 14 15 16 17 18 19 20 ··· 54 下一页