摘要:
简单题View Code #include <iostream>#include <cstdlib>#include <cstring>#include <cstdio>using namespace std;#define maxn 100005int n, d;int f[maxn];int cal(int a){ int ret = 0; while (a > d) { ret += a / d; a = a / d + a % d; } return ret;}int main(){ //freopen("t.txt&qu 阅读全文
posted @ 2011-10-13 12:39
undefined2024
阅读(254)
评论(0)
推荐(0)
摘要:
dpView Code #include <iostream>#include <cstdlib>#include <cstring>#include <cstdio>using namespace std;#define maxn 10005int n, m;int value[maxn];int f[maxn];void input(){ scanf("%d%d", &m, &n); for (int i = 1; i <= n; i++) scanf("%d", &val 阅读全文
posted @ 2011-10-13 11:02
undefined2024
阅读(178)
评论(0)
推荐(0)
摘要:
二分+排序View Code #include <iostream>#include <cstdlib>#include <cstring>#include <cstdio>#include <algorithm>using namespace std;#define maxn 1005#define maxl 25struct Elem{ int id, quality, price;}elem[maxn];int n, budget;char name[maxn][maxl];int tot;bool vis[maxn];int 阅读全文
posted @ 2011-10-13 10:48
undefined2024
阅读(236)
评论(0)
推荐(0)