摘要: http://community.topcoder.com/stat?c=problem_statement&pm=12967计算一个字符串里Palindrome的数量。我的DP方法需要n^2的空间。#include #include using namespace std;class Palind... 阅读全文
posted @ 2014-08-09 21:05 阿牧遥 阅读(143) 评论(0) 推荐(0)
摘要: http://community.topcoder.com/stat?c=problem_statement&pm=12995简单题class PackingBallsDiv2 {public: int minPacks(int R, int G, int B) { int sum = 0; s... 阅读全文
posted @ 2014-08-09 20:33 阿牧遥 阅读(158) 评论(0) 推荐(0)
摘要: http://community.topcoder.com/stat?c=problem_statement&pm=13035矩阵棋盘的题,比较典型。可以定两条column夹住,然后上下扫,上下扫过程中有一点DP的东西,这样负责度是o(n^3)#include #include #include u... 阅读全文
posted @ 2014-08-09 12:59 阿牧遥 阅读(203) 评论(0) 推荐(0)