35分。。。 刚学OI 0.000000001秒的萌新 妹子问道

P1417 烹调方案

cooronx @ 2019-11-11 11:50:07

#include<iostream>
using namespace std;
struct node{
    long long a,b,c;
}e[1000005];
long long f[100005];
bool cmp(node i,node j){
    return i.b * j.c > i.c * j.b;
}
int main(){
    ios::sync_with_stdio(false);
    long long t,n;
    cin>>t>>n;
    for(register long long i = 1;i<=n;++i){
        cin>>e[i].a;
    }
    for(register long long i = 1;i<=n;++i){
        cin>>e[i].b;
    }

    for(register long long i = 1;i<=n;++i){
        cin>>e[i].c;
    }
    for(register long long i = 1;i<=n;++i){
        for(register long long j = t;j - e[i].c>=0;--j){
            f[j] = max(f[j],f[j-e[i].c]+e[i].a-j*e[i].b);
        }
    }
    long long maxx = 0;
    for(register long long i = 1;i<=t;++i){
        maxx = max(f[i],maxx);
    }
    cout<<maxx<<endl;
    return 0;
}

by OOmega @ 2019-11-11 12:07:30

0.000000001秒的红名萌新妹子%%%


by Aonynation @ 2019-11-15 22:26:45

me too


by Aonynation @ 2019-11-15 22:26:59

35分无法自拔


by 我就是天帝 @ 2020-01-18 15:01:03

我也是35分 无法自拔...


|