题解

67 条题解

  • 0
    @ 2008-08-08 07:57:18

    居然要加上原来的体积。。。。。。。。。。。。。。。。。。。。发现被题目耍了

    本来400分的,就这个地方。。。。。。。。。。。。。。。。。。。。。。。

    这次考试被这题毁了

  • 0
    @ 2008-08-08 07:51:00

    原来还要加上原来的体积................

    本来可以拿100分............

  • 0
    @ 2008-08-08 06:43:48

    看不懂!

  • 0
    @ 2008-08-08 00:45:42

    不知道为什么wa

  • -1
    @ 2017-03-12 21:00:04

    这是我的解题报告,大家看一下
    http://blog.csdn.net/qq_35904657/article/details/61614230

  • -1
    @ 2016-09-17 18:14:22

    #include<iostream>
    #include<map>
    #include<cstdio>
    using namespace std;
    map<int,int>a;
    map<int,int>b;
    long long c[110],w[110],f[9000];
    int main()
    {
    int N,M; cin>>N>>M;
    for(int i=1;i<=3;i++)
    {
    int num; cin>>num;

    cin>>a[num]>>b[num];
    }

    for(int i=1;i<=N;i++)
    {
    int y; cin>>c[i]>>y;
    w[i]=c[i]*a[y];
    c[i]+=b[y]*c[i];
    }
    for(int i=1;i<=N;i++)

    for(int v=M;v>=c[i];v--)
    f[v]=max(f[v],f[v-c[i]]+w[i]);

    cout<<f[M];

    return 0;
    }

    总价值=布体积*花纹价值
    总体积=布体积+花纹体积*布体积

    坑!坑!坑!

  • -1
    @ 2016-01-03 11:06:08

    program p1407;
    var c,v,b,z,f:array[-1000..340000] of int64;
    i,j,k,m,n,o,p,q,s,js,cc,vv,vt:longint;
    begin
    assign(input,'p1407.in');
    assign(output,'p1407.out');
    reset(input);
    rewrite(output);
    readln(n,m);
    for i:= 1 to 3 do
    begin
    read(o,p,q);
    c[o]:=p;
    v[o]:=q;
    readln;
    end;
    for i:=1 to n do readln(b[i],z[i]);
    for i:=1 to n do
    begin
    cc:=b[i]*c[z[i]];vv:=b[i]+b[i]*v[z[i]];
    for vt:=m downto vv do
    begin
    if f[vt]<f[vt-vv]+cc then f[vt]:=f[vt-vv]+cc;
    end;
    end;
    write(f[m]);
    close(input);
    close(output);
    end.
    题题题题题题题题题题题题题题题题题题题题题题题题题题题题题题题题题题题题题
    题题题题题题题题题题题题题题题题题题题题题题题题题题题题水水水水题题题题题
    题题题题题题题题题题题题题题题题题题题题题题题题水水水水水水水水水题题题题
    题题题题题题题题题题题题题题题题题题水水水水水水水水水水水水水水水题题题题
    题题题题题题题题题题题题题题题题水水水水水水水水水水水水水水水题题题题题题
    题题题题题题题题题题题水水水水题水水水水水水水水水水水题题题题题题题题题题
    题题题题题题题题水水水水水水水题水水水题题水水水水水题题题题题题题题题题题
    题题题水水水水水水水水水水水水题题题题题题水水水水题题题题题题题题题题题题
    题水水水水水水水水水水水水水水题题题题题题水水水水题题题题题题题题题题题题
    题水水水水水水水水水水水水题题题题题题题水水水水水水水水水水水题题题题题题
    题水水水水水水水水水水水水题题题题题题水水水水水水水水水水水水水水题题题题
    题题水水水水水水水水水水题题题题题水水水水水水题题题水水水水水水水题题题题
    题题题题题题题题水水水水题题题题题水水水水题题题题题题水水水水水题题题题题
    题题题题题题题题水水水水题题题题水水水水题题水水题题题水水水水水题题题题题
    题题题题题题题题水水水水题题题题水水水水题题水水水水题水水水水水题题题题题
    题题题题题题题题水水水水题题题题水水水水题题水水水水题水水水水水题题题题题
    题题题题题题题题水水水水题题题题水水水水题题水水水题题水水水水水题题题题题
    题题题题题题题题水水水水题题题题水水水水题题水水水题题水水水水水题题题题题
    题题题题题题题题水水水水题题题题水水水水题水水水水题题水水水水水题题题题题
    题题题题题题题题水水水水题题题题水水水水题水水水水题题水水水水水题题题题题
    题题题题题题题题水水水水题题题题水水水水题水水水水题题水水水水水题题题题题
    题题题题题题题题水水水水题题题题水水水水题水水水水题题水水水水水题题题题题
    题题题题题题题题水水水水题题题题水水水题题水水水水题题水水水水水题题题题题
    题题水水题题题水水水水水题题题题水水水题题水水水题题题水水水水水题题题题题
    题题水水水水水水水水水水题题题题题水水题题水水题题题题水水水水水题题题题题
    题题题水水水水水水水水水题题题题题题题题水水水题题题题水水水水题题题题题题
    题题题题题水水水水水水水题题题题题题题题水水水题水水水水题题题题题题题题题
    题题题题题题水水水水水水题题题题题题题水水水水题题水水水水题题题题题题题题
    题题题题题题题题题水水水题题题题题题水水水水水题题题水水水水水水水题题题题
    题题题题题题题题题题题题题题题题水水水水水水题题题题题水水水水水水题题题题
    题题题题题题题题题题题题题题题水水水水水水题题题题题题水水水水水水水题题题
    题题题题题题题题题题题题题题水水水水水题题题题题题题题题水水水水水水题题题
    题题题题题题题题题题题题题水水水水水题题题题题题题题题题题水水水水题题题题
    题题题题题题题题题题题题水水水题题题题题题题题题题题题题题题水水水题题题题
    题题题题题题题题题题题题题题题题题题题题题题题题题题题题题题题题题题题题题

信息

ID
1407
难度
3
分类
动态规划 | 背包 点击显示
标签
(无)
递交数
1468
已通过
749
通过率
51%
被复制
2
上传者