上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 22 下一页
  2014年4月30日
摘要: 思路:DP水,先排序,然后直接比较。#include#include#include#include#include#define MAX 1111using namespace std;class mouse{ public: int w, v, id; bool... 阅读全文
posted @ 2014-04-30 18:38 wangzhili 阅读(81) 评论(0) 推荐(0)
摘要: 思路:openclock[i]记录到i位置打开大写键时的最小按键次数,closeclock[i]记录到i位置时不打开大写键时最小按键次数,详见代码。#include#include#include#include#define MAX 111using namespace std;int close... 阅读全文
posted @ 2014-04-30 18:38 wangzhili 阅读(106) 评论(0) 推荐(0)
摘要: 思路:DP水题#include#include#include#define MAX 105using namespace std;int dp[MAX][MAX], a[MAX][MAX];int main(){ int c, n, maxn; /* freopen("in.c", "... 阅读全文
posted @ 2014-04-30 18:38 wangzhili 阅读(75) 评论(0) 推荐(0)
摘要: 思路:DP水,dp[i][j]表示第i分钟到第j棵树的种数,dp[i][j] = dp[i-1][j-1] + dp[i-1][j+1],再注意下边界就行。#include#include#include#define MAX 105using namespace std;int dp[MAX][M... 阅读全文
posted @ 2014-04-30 18:38 wangzhili 阅读(78) 评论(0) 推荐(0)
摘要: 思路:dp[i][j]表示i个苹果,j个盘子的放的方案数,则有dp[i][j] = dp[i][j-1] + dp[i-j][j],dp[i][j-1]表示不是所有的盘子都放有苹果,dp[i-j][j],表示所有的盘子中都放入了苹果,这个前提是i>=j。i#include#includeusing ... 阅读全文
posted @ 2014-04-30 18:38 wangzhili 阅读(92) 评论(0) 推荐(0)
摘要: 思路:贪心,每次都选结束位置小的,这样保证了最小程度的影响后面的串,所以一定是最优解。#include#include#include#include#define MAX 1111using namespace std;typedef struct Node{ int st, end, id... 阅读全文
posted @ 2014-04-30 18:38 wangzhili 阅读(186) 评论(0) 推荐(0)
摘要: 思路:通过位运算来枚举集合,由于集合的互补性只需要枚举2^(n-1)个集合。#include#include#includeusing namespace std;int map[30][30];int main(){ int N, temp, flow, ans; //freopen(... 阅读全文
posted @ 2014-04-30 18:38 wangzhili 阅读(104) 评论(0) 推荐(0)
摘要: 思路:求次短路,先spfa,再枚举各条边,次短路一定是最短路换一条边得到。#include#include#include#include#define MAX 100005#define INF 0xfffffffusing namespace std;typedef struct{ int... 阅读全文
posted @ 2014-04-30 18:38 wangzhili 阅读(102) 评论(0) 推荐(0)
摘要: 思路:dp[i]表示a[i]之前连续的比a[i]大的数的个数,rdp[i]表示a[i]之后连续的比a[i]大的数的个数。如果dp[st] + rdp[end] >= end - st + 1,则是Yes,否则No。#include#include#include#define MAX 100005u... 阅读全文
posted @ 2014-04-30 18:38 wangzhili 阅读(259) 评论(0) 推荐(0)
摘要: #include#include#includeusing namespace std;int map[105][105], sum[105][105];int main(){ int n, maxn; /* freopen("in.c", "r", stdin); */ whil... 阅读全文
posted @ 2014-04-30 18:38 wangzhili 阅读(95) 评论(0) 推荐(0)
上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 22 下一页