摘要: 【题解】 二重循环枚举起始列和终止列,竖着往下加,转化为一个最大子段和问题,逐行累加即可。 1 #include<cstdio> 2 #include<cstring> 3 #include<algorithm> 4 #define LL long long 5 #define N 1000 6 # 阅读全文
posted @ 2018-09-01 23:00 Driver_Lao 阅读(200) 评论(0) 推荐(0) 编辑
摘要: 【题解】 先把数字两两组合,问题转化为求a+b=0. 这个问题显然可以排序后two pointer做。需要注意选出来的两个数必须由4个不同位置的数组成,不能重复。 1 #include<cstdio> 2 #include<cstring> 3 #include<algorithm> 4 #defi 阅读全文
posted @ 2018-09-01 22:37 Driver_Lao 阅读(156) 评论(0) 推荐(0) 编辑
摘要: 【题解】 dp转移的时候记录一下,然后倒着推出答案即可。 1 #include<cstdio> 2 #include<cstring> 3 #include<algorithm> 4 #define LL long long 5 #define rg register 6 #define N 200 阅读全文
posted @ 2018-09-01 20:57 Driver_Lao 阅读(174) 评论(0) 推荐(0) 编辑