摘要:
【最长子序列和】 问题定义:对于给定序列 a1,a2,a3……an 寻找它的某个连续子段,使得其和最大。 模板: 1 #include <bits/stdc++.h> 2 using namespace std; 3 typedef long long ll; 4 const int maxn = 阅读全文
posted @ 2020-01-29 16:28
swsyya
阅读(203)
评论(0)
推荐(0)
摘要:
https://www.cnblogs.com/wsy107316/p/11502628.html 导弹拦截 解题思路:用nlogn的方法求第一问:最长不上升序列:方法链接 用贪心法求第二问,遍历一遍 AC_Code: 1 #include <iostream> 2 #include <cstdio 阅读全文
posted @ 2020-01-29 12:54
swsyya
阅读(187)
评论(0)
推荐(0)
摘要:
登山(LIS变形) 注意读题:不连续两个相同海拔,所以要么严格递增,要么严格递减 AC_Code 1 #include <iostream> 2 #include <cstdio> 3 #include <cstring> 4 #include <string> 5 #include <cmath> 阅读全文
posted @ 2020-01-29 10:30
swsyya
阅读(169)
评论(0)
推荐(0)
摘要:
挖地雷(LIS变形) AC_Code: 1 #include <iostream> 2 #include <cstdio> 3 #include <cmath> 4 #include <cstring> 5 #include <cstdlib> 6 #include <string> 7 #incl 阅读全文
posted @ 2020-01-29 09:52
swsyya
阅读(187)
评论(0)
推荐(0)

浙公网安备 33010602011771号