LightOJ1079---Just another Robbery (概率做01背包)

【DeepSeek R1构建本地RAG知识库】数据结构化清洗-知识图谱制作、使用、dify集成 本文探讨了在构建本地RAG(Retrieval-Augmented Generation)系统时,如何通过引入知识图谱来增强系统的知识理解能力。传统的向量数据库和嵌入模型虽然能处理语义匹配,但无法有效捕捉知识间的关联性。知识图谱通过“实体-关系-属性”的结构化表示,能够更好地支持推理、推荐和多跳问答等高级功能。文章详细介绍了知识图谱的基本概念、制作思路,以及如何使用Neo4j图数据库进行知识图谱的构建和查询。通过实例展示了从PDF文件解析到知识图谱入库的全过程,强调了知识图谱在提升RAG系统性能中的重要作用 阅读详情

As Harry Potter series is over, Harry has no job. Since he wants to make quick money, (he wants everything quick!) so he decided to rob banks. He wants to make a calculated risk, and grab as much money as possible. But his friends - Hermione and Ron have decided upon a tolerable probability P of getting caught. They feel that he is safe enough if the banks he robs together give a probability less than P.
Input

Input starts with an integer T (≤ 100), denoting the number of test cases.

Each case contains a real number P, the probability Harry needs to be below, and an integer N (0 < N ≤ 100), the number of banks he has plans for. Then follow N lines, where line j gives an integer Mj (0 < Mj ≤ 100) and a real number Pj . Bank j contains Mj millions, and the probability of getting caught from robbing it is Pj. A bank goes bankrupt if it is robbed, and you may assume that all probabilities are independent as the police have very low funds.
Output

For each case, print the case number and the maximum number of millions he can expect to get while the probability of getting caught is less than P.
Sample Input

Output for Sample Input

3

0.04 3

1 0.02

2 0.03

3 0.05

0.06 3

2 0.03

2 0.03

3 0.05

0.10 3

1 0.03

2 0.02

3 0.05

Case 1: 2

Case 2: 4

Case 3: 6
Note

For the first case, if he wants to rob bank 1 and 2, then the probability of getting caught is 0.02 + (1 - 0.02) * .03 = 0.0494 which is greater than the given probability (0.04). That’s why he has only option, just to rob rank 2.

概率做01背包
dp[i]表示抢到i元时不被抓到的最大概率

/*************************************************************************
    > File Name: d.cpp
    > Author: ALex
    > Mail: zchao1995@gmail.com 
    > Created Time: 2015年04月29日 星期三 20时07分38秒
 ************************************************************************/

#include <functional>
#include <algorithm>
#include <iostream>
#include <fstream>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <queue>
#include <stack>
#include <map>
#include <bitset>
#include <set>
#include <vector>

using namespace std;

const double pi = acos(-1.0);
const int inf = 0x3f3f3f3f;
const double eps = 1e-15;
typedef long long LL;
typedef pair <int, int> PLL;

static const int N = 10010;
double dp[N];
double p[N];
int w[N];

int main() {
    int t;
    int icase = 1;
    scanf("%d", &t);
    while (t--) {
        int sum = 0;
        double P;
        int n;
        scanf("%lf%d", &P, &n);
        for (int i = 1; i <= n; ++i) {
            scanf("%d%lf", &w[i], &p[i]);
            p[i] = 1.0 - p[i];
            sum += w[i];
        }
        for (int i = 0; i <= sum; ++i) {
            dp[i] = 0;
        }
        dp[0] = 1.0;
        for (int i = 1; i <= n; ++i) {
            for (int j = sum; j >= w[i]; --j) {
                if (dp[j - w[i]]) {
                    dp[j] = max(dp[j], dp[j - w[i]] * p[i]);
                }
            }
        }
        printf("Case %d: ", icase++);
        for (int i = sum; i >= 0; --i) {
            if (P >= 1 - dp[i]) {
                printf("%d\n", i);
                break;
            }
        }
    }
    return 0;
}
RK3588 Buildroot 新建板级DTS 在rk3588 linux开发过程中,新创建板型主要基于硬件差异化、软件适配与优化、项目定制化等多方面需求。 阅读详情

相关推荐

Windows服务器渗透必备:5款杀软在线识别平台实测对比(附避坑指南)

本文针对Windows服务器渗透测试中的关键环节,实测对比了五款主流的在线杀软识别平台。文章从实战场景出发,深入分析了各平台在识别准确率、响应速度、隐匿性及使用风险上的差异,并提供了详尽的避坑指南与高级隐匿技巧,旨在帮助安全人员快速、精准地识别目标环境安全防护,为后续行动奠定情报基础。

weixin_29322553的博客 439

LightOJ1079---Just another Robbery (概率牌01背包问题)

【题目来源】:https://cn.vjudge.net/problem/LightOJ-1079 【题意】 现在呢,哈利波特由于资金短缺将要去抢银行,给出n个银行的money值,他认为呢,只要概率不大于p就可以不被抓住,每一个银行各有一个概率值,问,最多可以抢多少money。 【思路】 看到这道题的时候,感觉是个01背包问题,但是好像dp数组的下标不能是小数(概率),不能表示某一个概率最多

Crazy 438

别再手动调参了!用Optuna+PyTorch搞定Transformer时序预测超参数(附完整代码)

本文详细介绍了如何利用Optuna和PyTorch实现Transformer时序预测模型的自动化超参数调优。通过贝叶斯优化技术,显著提升单变量时序预测的效率和准确性,并附有完整代码实现。文章涵盖模型架构设计、数据预处理、Optuna调参实战及生产环境部署建议,为开发者提供一站式解决方案。

weixin_33704234的博客 583

Just another Robbery(01背包)

题意:给定抢各个银行能抢到的钱和被抓的概率,问被抓概率小于p时最多能抢到多少钱。 看完题目第一感觉就是背包,然后开始考虑以什么作为"容器",什么作为"价值". 方案一:直观上以概率作为体积,能抢到的钱作为价值,但是概率之间前后抢不抢会造成影响,所以此时发现应该将概率作为价值 方案二:与方案一相反,以概率作为价值,抢到的钱作为体积。值得注意的是我们此时的概率指的是不抢此银行不被抓的概率,因为01背包第二重循环从体积最大值开始,如果概率为被抓的概率,那么强此银行的概率会受到前面体积更小是的决策影响。 #incl

donnameの博客 190

2025统计建模大赛完整论文

参赛队号:(参赛队无须填写,参赛队号由大赛官网自动生成)2025年(第十一届)全国大学生统计建模大赛参 赛 作 品参赛学校:XXXXXX大学论文题目:海洋叶绿素含量影响因素与预测——基于机器学习与大数据分析预测参赛队员:指导老师:国家知识产权局 统计分析成果 知识产权统计数据公开查询指引(2024版)随着全球气候变化的加剧,海洋碳汇的作用愈发受到重视,尤其是海洋生物通过光合作用吸收二氧化碳的过程,对于全球碳循环和温室气体减排具有重要意义。

2301_79579117的博客 9325

SAR成像系列:【3】合成孔径雷达(SAR)的二维回波信号与简单距离多普勒(RD)算法 (附matlab代码)

二维回波信号分析

zr2006_7的专栏 2万+

【LightOJ 1079】Just another Robbery(概率DP+背包)

【LightOJ 1079】Just another Robbery(概率DP+背包)题目大意:n个银行,每个银行有被抢劫的概率,当天可以选择一些银行营业,小偷只会选择这些银行中的某个进行抢劫,当被抢劫的概率 < p表示所选择的这些银行是安全的。问在保证安全情况下,能营业的营业额最多的银行很欣慰 想出正解了 给自己一朵小fa原本想的dp[i][j]dp[i][j]表示遍历到第i个银行,盈利j元的最小

ACMer' 1308

把 sy-* 带进 ABAP CDS:ABAP 7.50 里的环境信息新姿势($session 与 @Environment.systemField 实战)

摘要:ABAP 7.50在CDS视图中引入两种获取环境信息的方式:1)直接使用$session会话变量读取用户、客户端和系统语言;2)通过@Environment.systemField注解参数,由Open SQL自动注入系统字段。$session方式简单但依赖Open SQL访问路径,非ABAP环境下可能失效;注解参数方案更工程化,依赖关系明确且支持测试。建议ABAP体系内优先使用$session,对外接口采用参数化方案。两种方式各有适用场景,正确选择可避免潜在风险。(148字)

2007 年 ~ 2025 年,深耕 SAP 技术 18 年 164

(LightOJ - 1079)Just another Robbery(概率背包)

题目链接:Just another Robbery - LightOJ 1079 - Virtual Judge (vjudge.net) 题意:有N个银行,第i个银行里有mi元钱,抢劫第i个银行使得被抓的概率多pi。(两个银行之间是否被抓并不是完全独立的)给出一个危险率P,问使得被抓的概率小于等于P的情况下最多能抢多少钱。 分析:我刚看到这道题目的时候就感觉这道题目是01背包,我令dp[i]表示概率小于0.01*i的情况下最多能抢的钱数,这样我们需要对概率乘以100然后再作为数组下标,但由于精度损失导

AC__dream的博客 253

Open3D 使用RANSAC分割平面【2026最新版】

使用RANSAC从点云中分割平面,用segement_plane函数。博客长期更新,本文最新更新时间为:2026年2月28日。

点云侠的博客 37万+

数学向量空间的对偶空间解析

对偶空间是线性代数的"进阶语法",它不仅深化了我们对向量空间的理解,还为解决实际问题提供了强大工具。用生活类比解释对偶空间的核心概念,打破"抽象数学"的壁垒;建立对偶空间与原向量空间的直观联系,揭示"对偶"的本质;通过数学推导和代码实现,让读者掌握对偶空间的基本运算;展示对偶空间在科学和工程中的应用,体现其理论价值。范围:本文从有限维实向量空间入手(便于理解),逐步扩展到对偶基、双对偶空间,最后简要提及无限维空间的特殊性。

AI天才研究院 885

【概率+01背包】Just another Robbery

Think: 1知识点:【概率+01背包】 2题意:一个人去抢劫银行,当他的被捕概率小于P时才能行动,对于已存在的n个银行,每个银行含有属性w表示含有价值,属性p表示被捕概率,每个银行的被捕概率为独立的。询问在被捕概率小于P的前提,可以抢劫的最大价值。 3思路: 3.1:[将被捕概率转换为安全概率,即将被捕概率小于P的限制条件转换为安全概率不小于1-P] + [01背包体积:价值] vj...

BlessingXRY的博客 517

【GameFramework框架内置模块】6、实体(Entity)

实体Entity就是一个实体的基本单元,类似于Unity的GameObject对象本体,然后这个本体上面附加其他各种各样组件,才能实现各种各样的功能。一般需要在游戏运行时动态加载的游戏对象,比如怪物、武器、子弹、特效,都需要给这个物体挂载一个实体Entity,这样的话就可以方便的对实例出来的对象进行管理。下面就来看一下如何使用吧。

CSDN博客专家,Unity3D高级软件工程师,《Unity 3D从入门到实战》作者。 3142

【LightOJ-1079 Just another Robbery 】概率01背包

LightOJ-1079 Just another Robbery 题意 有n个银行,第i个银行有MiM_iMi​元,抢劫第i个银行被逮捕的概率为pip_ipi​,现在想知道被逮捕概率小于P的条件下,最多可以抢多少钱。 做法 首先这种dp,我们发现一个不能作为dp维度的实数要计算,就要把这个维度转换为dp值的定义,于是我们用dp[i][j]表示前i个银行抢劫j元不被逮捕的概率,dp的转移式很显然,...

lajiyuan的博客 247

深度学习工具包 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")

ET2012新版免狗免安装绿色软件

ET2012新版免狗免安祖昂绿色软件。,新界面,新视觉,

hdu 2955 Robberies + LightOJ 1079 Just another Robbery (01背包 概率)

题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2955 题意:有一个小偷要偷银行的钱,可是他偷没家银行总是有一定的概率被抓,现在给了你一个概率P,只要他被抓的概率乘积不大与P,他就是安全的。问你在他安全的情况下,他最多可以偷多少钱。 思路:01背包。所有银行的总资产为背包容量V。求最大的逃跑概率。 题目给出被抓的概率,要求最大的逃跑率,即1-p

whyorwhnt的专栏 1128

全球国家地区城市数据

MySQL全球国家地区城市数据报。。。。。。。。。。。。

LightOJ 1079 Just another Robbery 概率DP/01背包

Just another Robbery LightOJ - 1079 抢 nnn 个银行,每个银行被抓的概率分别是 p[i]p[i]p[i],每个银行各有 m[i]m[i]m[i] 块钱,能承受的最大被抓概率是 PPP,问最多能抢多少钱? 转化一下,相当于要保证安全的概率不低于 1−P1-P1−P,抢各个银行对应的安全概率为 1−p[i]1-p[i]1−p[i],要保证抢的银行的安全概率连乘起来...

wineandchord 153

win10 跳过U8环境检测的IE WebControls.rar

win10 安装u8的时候 提示IE WebControls 不通过,这个工具可以欺骗u8的检查。 跳过U8环境检测的IE WebControls。提示导入失败后,重新检测通过。

Just another Robbery LightOJ - 1079 (概率dp,01背包)

As Harry Potter series is over, Harry has no job. Since he wants to make quick money, (he wants everything quick!) so he decided to rob banks. He wants to make a calculated risk, and grab as much money

退役的铜牌狗 301

lightoj Just another Robbery 1079 (01背包转换&概率)

LightOJ - 1079 Just another Robbery Time Limit: 4000MS Memory Limit: 32768KB 64bit IO Format: %lld & %llu Submit Status Description As Harry Potter series is over, Harry has

yanghui07216的博客 409

[概率01背包] D - Just another Robbery LightOJ - 1079

As Harry Potter series is over, Harry has no job. Since he wants to make quick money, (he wants everything quick!) so he decided to rob banks. He wants to make a calculated risk, and grab as much mone...

博客 268

LightOJ1079 Just another Robbery 01背包、概率

题意:给出银行的个数和被抓概率上限P。在给出每个银行的钱和抢劫这个银行被抓的概率。 求不超过被抓概率上线能抢劫到最多的钱。 两种方法 方法一:dp[j]为抢劫了j元钱不被抓到概率,状态转移方程dp[j] = max(dp[j], dp[j - w[i]] * p[i]) #include #include #include #include #include #incl

QiHang的博客 363

(概率 01背包) Just another Robbery -- LightOJ -- 1079

http://lightoj.com/volume_showproblem.php?problem=1079 Just another Robbery As Harry Potter series is over, Harry has no job. Since he wants to make quick money, (he wants everything quick!...

weixin_33802505的博客 119

LightOJ - 1079 Just another Robbery( 概率+动规(01背包) )

题目链接 给出银行数n,和被抓到的概率P,在已知每个银行被抓的概率下,求在不被抓到的情况下,他最多能够抢多少钱。 求最优问题,看样例第一想到的就是动态规划的01背包,就去找了模板。 dp[j] 代表抢劫到 j元钱不被抓的概率,dp[j] = max( dp[j],  dp[j - b[i].m] )* b[i].p),再和P判断即可,详见代码。 那个排序操作可有可无,一开始dp大小只开了1...

M_Lter的博客 214

LightOJ 1079 Just another Robbery(概率DP)

Just another Robbery As Harry Potter series is over, Harry has no job. Since he wants to make quick money, (he wants everything quick!) so he decided to rob banks. He wants to make a calculated risk, ...

Tan_JX 193

LightOJ 1079 Just another Robbery (概率dp+背包)

题意:有n家银行,每家银行都有一定数量的钱和被抓概率,给出自己被抓概率的上限,求能获得最多的钱。 题解:概率dp+背包 用dp[]dp[]dp[]表示获得这么多钱被抓的概率。获得同等钱的概率要尽可能小。 设去A银行被抓概率为P(A),B银行为P(B),那么P(A∪B)=P(A) + P(B) - P(A)P(B)。 然后跟01背包差不多,去求获得iii钱的最小概率就可以。 double类型mems...

gongyuandaye的博客 275

Just another Robbery(LightOJ-1079)

Problem Description As Harry Potter series is over, Harry has no job. Since he wants to make quick money, (he wants everything quick!) so he decided to rob banks. He wants to make a calculated risk,...

Alex_McAvoy的博客 619

Just another Robbery LightOJ - 1079 (概率DP)

As Harry Potter series is over, Harry has no job. Since he wants to make quick money, (he wants everything quick!) so he decided to rob banks. He wants to make a calculated risk, and grab as much mon...

Top_Spirit的博客 186
上一篇: LIghtOJ1038---Race to 1 Again(概率dp)
下一篇: LightOJ1248---Dice (III)(概率dp)
tokers
博客等级 码龄12年 71粉丝 700原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值