HDU 4091 Zombie’s Treasure Chest (每日一题)

C#WPF常用的9种布局方式详解 本文介绍WPF中常用的九种布局,Grid、StackPanel、WrapPanel、DockPanel、UniformGrid、Canvas、ScrollViewer、ViewBox、Border。 阅读详情

大意是: 一些战士来到了一个村庄,发现了两种宝石和一个宝箱,每种宝石的个数是无限的,给出了宝箱的大小 N 和两种宝石的 size 和 value ,即 N s1 v1 s2 v2 ,已知这五个两,求利用这个宝箱,战士能够带走多大价值的宝石。 五个数的范围是 int 。 也就是 10^9。

如果范围比较小的话,就直接可以用多重背包的解法。 但是数据范围是 10^9 就没法用 多重背包来做了。。

在这给出一种数学的解法,非背包的解法。

解: 1 。求出 s1 ,s2 的最小公倍数。最小公倍数等于s1乘以s2 在除以s1和s2在最大公约数即lcm=(s1*s2)/gcd(s1,s2)。

                   为什么求最小公倍数呢?

                   会有这么一个性质存在。。a = lcm /s1 , b = lcm/s2 。 最小公倍数除以s1 s2 后的到 a,b  。 a 个宝石一 和 b 个宝石二 所占的空间是相同的。

                   于是对于最优解中,单位价值小的宝石取得个数应该小于最大公倍数除以这个宝石体积  。也就是说 如果宝石一的单位价值小的话, 那么num1 < a。

                   证明。设num1>a,那么对于这num1 个宝石 从中取出a个 ,把这a 个换成b个宝石二。由于a个宝石一 跟b个宝石二的所占的体积相同,但宝石二的单位价值更大。所以更换以后的总价值会更大,则num1 的个数应该小于a。

          2 。 因此我们可以把N 划分成两部分来求 1。int  vn =  N%lcm +2*lcm 。(其实N%lcm +lcm 就够了但不会证明就用了N%lcm+2*lcm了。最效率影响不大)  2。N - vn  这两部分。 对部分二 一定是lcm 的倍数 直接能够求出这部分的最优解。关键是部分一。 为什么划分出部分1呢?  我们可以单独考虑宝石一小于a 的部分和宝石二小于b的部分。vn 定能覆盖这两部分的体积。

对于vn 这暴力求解。   for from 0 to vn/(max(s1,s2))   循环大的值,是因为循环次数少,提高效率。这个循环最坏情况大致是10^4 到10^5  。

两部分总价值的就是解。。

(表达不好。。。。。。。。)

 

附上本人的代码:(注 代码不够优雅,正在努力改正)

 

#include <iostream>
#include <cstdio>
#include <cstring>
#define LL long long
using namespace std;
int t;
int n,s1,v1,s2,v2;
// 求最大公约数
int gcd(int da ,int xiao){
       int temp =0;
        while(xiao!=0){
            temp = da%xiao;
            da =xiao;
            xiao = temp;
        }
        return da;
}

int max(int a,int b){
 return  (a>b)?a:b;
}
// LL 在 define  是long long
LL max2(LL a,LL b){
    return (a>b)?a:b;
}
int min(int a,int b){
  return (a<b)?a:b;
}
LL cal (){
    LL sum = n;
    //answer 为 最大价值  最后返回这个answer
    LL answer = 0;
    //a 为 s1 s2 中的大值,va 为 a 的value
        int  a = max(s1,s2);
        int  b = min(s1,s2);
        int  va,vb;
     if(s1==a){
        va = v1;
        vb = v2;
     }else{
        va = v2;
        vb = v1;
     }
     // 求最小公倍数  。。 返回值 longlong 否则 wa 我一开始就wa 在这
       LL lcm = s2/gcd(a,b)*(LL)s1;
       if(sum>=2*lcm){
           int num = (sum-2*lcm)/lcm;
           answer += num*max2(lcm/s1*v1,lcm/s2*v2);
           sum =sum - num*lcm;
       }
       int  i_max = sum/a;
       LL maxn=0;
       //循环暴力求解
       for(int i=0 ;i<=i_max;i++){
            int j = (sum-i*a)/b;
            LL tmp = i*(LL)va+j*(LL)vb;
            maxn=max2(maxn,tmp);
       }
       answer += maxn;
       return  answer;
}
int main(){
     scanf("%d",&t);
     for(int i=1;i<=t;i++){
         scanf("%d%d%d%d%d",&n,&s1,&v1,&s2,&v2);
         printf("Case #%d: ",i);
         cout << cal()<<endl;
     }
}


 

这个题目一定要注意  long long 的范围 。。。。。

这个题目某些情况可以特判后提高效率  。比如正好整除的情况 。。。   

 

此题还有其他解法,稍后附上。

                        

          

      

 


 

基于Python的京东商品价格监控与降价提醒系统设计与实现 本文详细介绍了如何使用Python构建一个完整的京东商品价格监控与降价提醒系统。系统通过爬虫技术实时抓取京东商品价格信息,结合数据存储与分析,实现价格波动监控和智能降价提醒功能。文章涵盖了系统设计、技术选型、代码实现以及部署方案,为电子商务价格监控领域提供了一个实用的解决方案。关键词:Python爬虫、京东API、价格监控、降价提醒、自动化。 阅读详情

相关推荐

瑞芯微rk3568移植openbmc(一)----关于ob移植的优缺点

基于rock3a的单板,CPU为瑞芯微rk3568的环境,移植了openbmc

feixiang3839的专栏 5546

HDU 4091--Zombie’s Treasure Chest

来源:http://acm.hdu.edu.cn/showproblem.php?pid=4091 题意:给一个背包的容量n,两种物品的花费a,c和价值b,d,问最多能装多少价值。 分析:就是n/(a*c/gcd(a,c))-1个a,c的最小公倍数的背包容量肯定是装相对价值比较大的那个物品,剩下的对花费较大的那个物品进行枚举,求出剩下的能装的最大价值,最多也就sqrt(n)的复杂度。 代码比

Xcockroach的专栏 1079

在飞牛OS上部署WeKnora:NAS变身私有RAG知识库

RAG(检索增强生成)是当前让大模型落地私有知识库的主流架构,核心原理是把文档解析切片后向量化存储,用户提问时先检索相关片段再交给大模型生成回答。相比传统文档搜索,它能直接给出带引用来源的结论,既提升检索效率,也降低模型胡编乱造的风险。对拥有NAS、又重视数据不出本地的用户来说,将知识库部署在家中NAS上,意味着文档处理、向量检索、模型推理全链路可控。飞牛OS(fnOS)内置Docker Compose支持,是承载这一方案的实用底座。以开源的WeKnora为例,完整演示从环境准备、compose编排、模型接

weixin_29973493的博客 307

Zombie’s Treasure Chest

Zombie’s Treasure Chest 这道题一看就用了完全背包,结果毫无疑问的挂了,看了一些大佬的解析后,发现有两种做法,一种是直接列举,另一种是通过最小公倍数的方法。 题意 有一个体积为N的箱子和两种数量无限的宝物。 宝物1的体积为S1,价值为V1;宝物2的体积为S2,价值为V2。你的任务是计算最多能装多大价值的宝物。 思路 枚举一:当s1和s2的体积很小,N很大的时候,由题意可知:s...

Vincy_King 257

Delphi解决 openssl DLL 与 Indy 的SSL/TLS 连接问题

​ 使用 SSL 连接时出错。错误 1409442E:SSL 例程:ssl3_read_bytes:tlsv1 警报协议版本 由于我使用的是最新版本的Indy,根据Delphi Praxis 上的此线程,这种情况不应该发生。事实证明,不知何故,一个非常旧版本的 openssl DLLlibeay32.dll和ssleay32.dll已被放置在我计算机上的 sarch 路径中(版本 1.0.0e)。

Delphi开发局QQ群:32422310 2504

高通Camera AWB跳变问题实战:从夕阳场景到参数调优的完整避坑指南

本文深入解析高通Camera AWB跳变问题,特别是在夕阳场景下的色温突变现象。通过分析灰区统计失效、光源混合干扰等成因,提供从参数调优到诊断工具链的完整解决方案,包括动态灰区扩展算法、色温平滑过渡方案及高通平台特定优化技巧,帮助工程师有效解决AWB跳变问题。

sre5engineer的博客 868

Uva 12325 Zombie's Treasure Chest (贪心,分类讨论)

题意: 你有一个体积为N的箱子和两种数量无限的宝物。宝物1的体积为S1,价值为V1;宝物2的体积为S2,价值为V2。输入均为32位带符号的整数。你的任务是最多能装多少价值的宝物? 分析: 分类枚举, 取两者体积的最小公倍数, 看看在同体积不同数量的两种物品哪个价值大, 价值小的一定不会拿超过这个数目。 #include<cstdio> #include<i...

dixianqi2609的博客 178

Confluence安装Drawio插件

记录confluence安装drawio插件步骤

devotedwife的博客 7393

Zombie‘s Treasure Chest(枚举)

Zombie's Treasure Chest(枚举)

zjsru_Beginner的博客 279

汽车ECU诊断刷写和OTA升级中的验签和校验

汽车ECU诊断刷写和OTA升级中的验签和校验

天赐好车的博客 627

使用Qt在FreeRTOS上构建MCU应用程序

如果我们想要在FreeRTOS上运行该应用程序,我们需要选择适用于我们处理器架构的交叉编译工具链,并将目标设备设置为我们的开发板。在该代码中,我们使用xTaskCreate()函数创建了一个名为“qt_task”的任务,并将其启动。首先,我们需要安装Qt for MCU开发环境。Qt for MCU是基于Qt 5开发的针对MCU的特殊版本,它可以生成最小体积的代码,从而适用于资源有限的嵌入式系统。如果我们想要在FreeRTOS上运行这个程序,我们需要将其包装在一个任务中,并在任务创建后启动Qt的事件循环。

ByteWhizX的博客 1825

12325 - Zombie's Treasure Chest.

简单枚举+巧妙躲避大枚举量 #include using namespace std; long long n,s1,v1,s2,v2,total; int main() { ios::sync_with_stdio(false); long long T,maxn=0; cin>>T; while(T--) { cin>>n>>s1>>v1>>s

AC_Arthur的专栏 930

DDR5 的 PI: DIMM 上 PMIC,正在制造一批“新型 EMI 问题”

DDR5 的 PI,不再只是“供电设计”,而是一次“噪声管理设计”。电压稳定本地调节高频噪声EMI 风险系统不确定性DDR5 真正难的地方,不是跑起来,而是——在最差条件下,它还能不能一直跑。而 DIMM 上那颗 PMIC,正是你绕不开的关键角色。

weixin_43199439的博客 196

hdu4091 Zombie’s Treasure Chest

Zombie’s Treasure Chest Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1708Accepted Submission(s): 357 Problem Description Some b...

angtongyou1893的博客 172

廖雪峰Python教程[完整版]

廖雪峰的python教程整理的,已经排好版了,而且还是完整的,适合小白

OV9734 DATASHEET,完整规格书

OV9734完整规格书,包括电气参数,尺寸规格,寄存器配置表等

HDU 4091 - Zombie’s Treasure Chest

地址: http://acm.hdu.edu.cn/showproblem.php?pid=4091   先除去最小公倍数。   然后暴力枚举。   需要注意这种数据: 13   2  5  3  7   #include #include #include #include #include using namespace std; long long gcd

诳人居 953

jdk-8u144-linux-x64.tar.gz.

该资源为搭建Linux系统Java环境用,资源的后缀为tar.gz格式的压缩包

hdu 4091 Zombie’s Treasure Chest

需要仔细体会s1和s2都很小的时候,其枚举量为什么是s1+s2 #include #include #include using namespace std; int t,kase; int main() {     scanf("%d",&t);     kase=1;     while(t--)     {         long long n,s1,v1,s2,v

h123120的专栏 421

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

HDU 4091 Zombie’s Treasure Chest 【杂题】%

Problem Description Some brave warriors come to a lost village. They are very lucky and find a lot of treasures and a big treasure chest, but with angry zombies. The warriors are so brave that...

dianxuanzhi1019的博客 154

HDU-4091 Zombie’s Treasure Chest

HDU-4091 题意:T次输入,每次输入背包容量n,绿宝石体积s1,价值v1,蓝宝石体积s2,价值v2,宝石无限,问背包的最大价值。

remember_your_dream的博客 334

HDU4091 Zombie’s Treasure Chest

http://acm.hdu.edu.cn/showproblem.php?pid=4091 2011上海赛区最水一题。题意:一些战士来到了一个村庄,发现了两种宝石和一个宝箱,每种宝石的个数是无限的,给出了宝箱的大小 N 和两种宝石的 size 和 value ,即 N s1 v1 s2 v2 ,已知这五个两,求利用这个宝箱,战士能够带走多大价值的宝石。 五个数的范围是 int 。 也就

Chromer_cn的专栏 1274

hdu 4091 Zombie’s Treasure Chest 贪心+枚举

题意: 输入背包体积n,绿宝石体积s1,价值v1,蓝宝石体积s2,价值v2,宝石数目无限,问背包里能放下的最大价值? 题解: 看过去很像完全背包,可数据很大(虽然没给出,也能猜到,不然太水了),所以不能用背包求。又只有两种物品,想到了贪心,将价值与体积比大(称为价值比)的优先放入。但体积限制,这样还不可以,还需要枚举减少价值比大的宝石个数,是否可以增大所求价值。又我们可以知道对于体积是m=l

冷月之殇 2048

HDU—— 4091 Zombie’s Treasure Chest

题意:有两种宝石,已知一个大小quedi

u014086857的专栏 467

HDU 4091 【2011上海现场赛 A】 Zombie’s Treasure Chest

题意给容量为NN的背包,有体积为SiS_i,价值为ViV_i的两种物品,问最大价值。题解直观上肯定是拿性价比高的,但直接贪心肯定是不对的。 那么可以思考回退的想法。 不妨设11号物品性价比高,那么以下分两种情况讨论: 1. S2>=TS_2 >= T时,直接枚举S2S_2放几个算答案,这样这部分复杂度是O(N/T)O(N/T) 2. S2<TS_2 < T时,易知,如果回退总体积超过了S1×

yeziqing10的博客 498

HDU4091 Zombie’s Treasure Chest 好数论一道

这题目很好,给你一个容量为n的容器,然后两种宝物,一种体积s1,价值v1,还有一种s2,v2,问最多能装的宝物总价值,就是用两种宝物去填充,由于我语文水平太差,无法表达,还是直接贴代码把,一看代码保证就懂啊,语文真心差,本来想转别人题解的,可是一看差不多 大家语文都差 还是这道题目分析不好表示呢 #include #include #include #include #include #

shaonianguai 1177

HDU 4091Zombie’s Treasure Chest(贪心+枚举)

Zombie’s Treasure Chest Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 3587    Accepted Submission(s): 726 Problem Description   S

布生气 1486

hdu 4091 Zombie’s Treasure Chest(数学规律+枚举)

题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4091 /** 这题的一种思路就是枚举了: 基于这样一个事实:求出lcm = lcm(s1,s2), num1 = lcm/s1, num2 = lcm/s2; 则价值与体积比小的那个宝藏个数一定大于lcm/size;这个用反证法就可证明。 然后就是只需要枚举N%lcm + lcm...

weixin_30511039的博客 108

HDU 4091 Zombie’s Treasure Chest (不错的数论题)

题意: 给你一个体积V,第一种物品的体积价值s1,v1,第二种物品的体积价值s2,v2,物品都是任意个,问把两种物品放入V体积中最大的价值是多少。 解题思路: 设L = lcm(s1, s2),a = L/s1表示L体积下物品一的个数,b = L/s2表示L体积下物品二的个数,则最佳情况性价比低的那个物品个数必然不大它与L体积下的个数。所以可以由这个公式,设最佳情况体积为k*L +

JayYe的专栏 1127
下一篇: SGU 259 单机调度问题 +贪心 及此题解法的证明
OceanLight
博客等级 码龄14年 21粉丝 70原创
评论 2
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值
⌂ 换网址