2012年8月8日

HDOJ 免费馅饼

摘要: 简单DP,记忆化会RE,递推即可。# include <cstdio># include <cstring># define N 100005int n, t, f[N][11], a[N][11];int Max(int x, int y){return x>y ? x:y;}/*int dp(int x, int y){ int &ans = f[x][y]; if (ans >= 0) return ans; if (x > t) return ans = 0; ans = 0; ans = Max(ans, dp(x+1, y)); i 阅读全文

posted @ 2012-08-08 15:36 getgoing 阅读(290) 评论(0) 推荐(0)

HDOJ 最少拦截系统

摘要: 最好还是用堆来维护吧,幸亏没超时。# include <stdio.h>int top, s[30005];int main(){ int n, h, i ,find, cur, mini; while (~scanf("%d", &n)) { top = 0; for (i = 1; i <= n; ++i) { scanf("%d", &h); find = 0; for (int i = 0; i < top; ++i) { ... 阅读全文

posted @ 2012-08-08 14:47 getgoing 阅读(177) 评论(0) 推荐(0)

导航