上一页 1 2 3 4 5 6 7 8 9 ··· 20 下一页
摘要: 链接 分析:经典DP题,最长不下降子序列的变种,同时需要记录路径,用pre[]数组记录当前结点的前一个结点的方法很妙 1 #include "iostream" 2 #include "cstdio" 3 #include "cstring" 4 #include "string" 5 #inclu 阅读全文
posted @ 2017-06-17 13:50 wolf940509 阅读(143) 评论(0) 推荐(0)
摘要: 链接 分析:当前点的情况仅由其左边和上边的点决定,然后马会走过的点标记一下即可 1 #include "iostream" 2 #include "cstdio" 3 #include "cstring" 4 #include "string" 5 using namespace std; 6 co 阅读全文
posted @ 2017-06-17 13:49 wolf940509 阅读(181) 评论(0) 推荐(0)
摘要: A题 分析:注意两个点之间的倍数差,若为偶数则为YES,否则为NO 1 #include "iostream" 2 #include "cstdio" 3 #include "cstring" 4 #include "string" 5 #include "cmath" 6 using namesp 阅读全文
posted @ 2017-06-17 10:48 wolf940509 阅读(154) 评论(0) 推荐(0)
摘要: 链接 分析:对前半部分求最长上升,对后半部分,求最长下降,二者的最大值即为所求,注意重复的部分 1 #include "iostream" 2 #include "cstdio" 3 #include "cstring" 4 #include "string" 5 using namespace s 阅读全文
posted @ 2017-06-15 00:55 wolf940509 阅读(167) 评论(0) 推荐(0)
摘要: 链接 分析:这题要求满足最长下降子序列的个数,我们设dp[i]为i位置的最长下降子序列长度,f[i]为i位置对应的个数。考虑j<i,若是满足a[i]==a[j]&&dp[i]==dp[j],我们应该进行去重,这时我们应取后一个位置,因为无论如何,后一个位置所取得的最长下降子序列的长度都不小于前一个位 阅读全文
posted @ 2017-06-14 21:44 wolf940509 阅读(99) 评论(0) 推荐(0)
摘要: 链接 分析:对于三位数我们限定为[100,999],两位数我们限定为[10,99],然后我们依次判断是否满足乘法式且各个数位是否在数列中,若都满足+1 1 /* 2 PROB:crypt1 3 ID:wanghan 4 LANG:C++ 5 */ 6 #include "iostream" 7 #i 阅读全文
posted @ 2017-06-13 21:47 wolf940509 阅读(154) 评论(0) 推荐(0)
摘要: 链接 分析:我们不断统计相邻两个元素之间的差值,按照差值从大到小排序,在进行贪心即可 1 /* 2 PROB:barn1 3 ID:wanghan 4 LANG:C++ 5 */ 6 #include "iostream" 7 #include "cstdio" 8 #include "cstrin 阅读全文
posted @ 2017-06-10 23:46 wolf940509 阅读(115) 评论(0) 推荐(0)
摘要: 链接 分析:水题,按照价格从小到大排序,在进行贪心即可 /* PROB:milk ID:wanghan LANG:C++ */ #include "iostream" #include "cstdio" #include "cstring" #include "string" #include "a 阅读全文
posted @ 2017-06-09 21:52 wolf940509 阅读(146) 评论(0) 推荐(0)
摘要: A Good Set 分析:水题,选奇数即可 1 #include "iostream" 2 #include "cstdio" 3 #include "cstring" 4 #include "cmath" 5 using namespace std; 6 //const int maxn=110 阅读全文
posted @ 2017-06-08 16:30 wolf940509 阅读(141) 评论(0) 推荐(0)
摘要: 链接 分析:直接暴力求解,傻逼题 1 /* 2 ID:wanghan 3 PROB:dualpal 4 LANG:C++ 5 */ 6 #include "iostream" 7 #include "cstdio" 8 #include "cstring" 9 #include "string" 1 阅读全文
posted @ 2017-05-31 10:33 wolf940509 阅读(110) 评论(0) 推荐(0)
上一页 1 2 3 4 5 6 7 8 9 ··· 20 下一页