hdu 3996 Gold Mine

2024年五大革新图像分割模型解析:架构创新与实战应用指南 本文深入解析2024年五大革新图像分割模型,包括SAM2、Mask2Former、DINOv2和Swin Transformer等,探讨其架构创新与实战应用。从多尺度处理、提示交互到自监督学习,这些模型在精度提升、效率优化和交互增强方面取得突破,广泛应用于医疗影像、工业质检和智慧城市等领域。 阅读详情

Gold Mine

Time Limit: 6000/2000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 1464    Accepted Submission(s): 335


Problem Description
Long long ago, there is a gold mine.The mine consist of many layout, so some area is easy to dig, but some is very hard to dig.To dig one gold, we should cost some value and then gain some value. There are many area that have gold, because of the layout, if one people want to dig one gold in some layout, he must dig some gold on some layout that above this gold's layout. A gold seeker come here to dig gold.The question is how much value the gold he can dig, suppose he have infinite money in the begin.
 

Input
First line the case number.(<=10)

Then for every case:
  one line for layout number.(<=100)
  for every layout
  first line gold number(<=25)
  then one line for the dig cost and the gold value(32bit integer), the related gold number that must be digged first(<=50)

then w lines descripte the related gold followed, each line two number, one layout num, one for the order in that layout
see sample for details
 

Output
Case #x: y.
x for case number, count from 1.
y for the answer.
 

Sample Input
  
1 2 1 10 100 0 2 10 100 1 1 1 10 100 1 1 1
 

Sample Output
  
Case #1: 270
 

Source

题目大意:本题描述比较模糊,我重新描述下Input:
                 第一行:T表示测试组数(T<=10),接下来T组测试数据,每组包括
                         第一行:n(n<=100),表示有n个金矿区(暂且称为金矿区,每个金矿区有若干个采矿点)
                         接下来有n组数据,每组描述每个金矿区情况:
                         对于第i组,第一行输入m(m<=25),表示第i(1=<i<=n)个金矿区有m个采矿点
                                             接下来又有m组数据,每组描述该金矿区的某个采矿点情况:
                                             对于第j组,输入cost(开采费用),val(开采后能获利),w(开采此采矿点前必须要开采其他m个采矿点)
                                                                 接下来w行,每行两个整数a,b,表示必须先开采第a个金矿区的第b个采矿点。
分析:比较明显的最大闭合权图。 
          建图: 
          如果某个金矿的开发利润为正值,就在源点和该点之间连一条容量为该利润的边 
          如果某个金矿的开发利润为负值,就在该点和汇点之间连一条容量为该利润绝对值的边 
          如果某个金矿收到另一个金矿的限制,就在两个金矿之间连一条容量为INF的边。 
          累计所有正值利润的和  sum,获得的最大利润为sum - ans 

代码:
dinic
#include<cstdio>
#include<cstring>
#define ll __int64
const int N=2505;
const int M=72600;
const ll INF=10000000000;
int tol,n,s,t;
ll ans;
int head[N],d[N];
struct node
{
	ll f;
    int y,nxt;
}edge[M];
ll min(ll a,ll b){return a<b?a:b;}
void add(int x,int y,ll f)
{
    edge[tol].y=y;
    edge[tol].f=f;
    edge[tol].nxt=head[x];
    head[x]=tol++;
    edge[tol].y=x;
    edge[tol].f=0;
    edge[tol].nxt=head[y];
    head[y]=tol++;
}
bool bfs()
{
	int front=0,rear=0,q[N],u,v,i;
	memset(d,-1,sizeof(d));
	d[s]=0;
	q[rear++]=s;
	while(front<rear)
	{
		u=q[front++];
		for(i=head[u];i!=-1;i=edge[i].nxt)
		{
			v=edge[i].y;
			if(edge[i].f&&d[v]==-1)
			{
				d[v]=d[u]+1;
				if(v==t)return 1;
				q[rear++]=v;
			}
		}
	}
	return 0;
}
ll dfs(int s,ll limit)
{
	if(s==t)return limit;
	int i,v;
	ll sum=0,tmp;
	for(i=head[s];i!=-1;i=edge[i].nxt)
	{
		v=edge[i].y;
		if(edge[i].f&&d[s]+1==d[v])
		{
			tmp=dfs(v,min(limit-sum,edge[i].f));
			edge[i].f-=tmp;
			edge[i^1].f+=tmp;
			sum+=tmp;
			if(limit==sum)return sum;
		}
	}
	if(sum==0)d[s]=-1;
	return sum;
}
void dinic(){while(bfs())ans+=dfs(s,INF);}
int main()
{
	int T,ca=1,i,j,a,b,m,w,val,cost;
	ll sum;
	scanf("%d",&T);
	while(T--)
	{
		memset(head,-1,sizeof(head));
		scanf("%d",&n);
		s=0,t=n*25+1;tol=0,ans=0;sum=0;
		for(i=0;i<n;i++)
		{
			scanf("%d",&m);
			for(j=1;j<=m;j++)
			{
				scanf("%d%d%d",&cost,&val,&w);
				val-=cost;
				if(val>0){add(s,i*25+j,val);sum+=val;}
				else add(i*25+j,t,-val);
				while(w--)
				{
					scanf("%d%d",&a,&b);
					add(i*25+j,(a-1)*25+b,INF);
				}
			}
		}
		dinic();
		printf("Case #%d: %I64d\n",ca++,sum-ans);
	}
	return 0;
}


sap
#include<cstdio>
#include<cstring>
#define ll __int64
const int N=2505;
const int M=72600;
const ll INF=10000000000;
int n,s,t,tol;
ll ans;
int head[N],arc[N],pre[N],dis[N],gap[N];
struct node
{
	ll f;
	int y,nxt;
}edge[M];
void add(int x,int y,ll f)
{
	edge[tol].y=y;
	edge[tol].f=f;
	edge[tol].nxt=head[x];
	head[x]=tol++;
	edge[tol].y=x;
	edge[tol].f=0;
	edge[tol].nxt=head[y];
	head[y]=tol++;
}
void sap()
{
	memset(dis,0,sizeof(dis));
	memset(gap,0,sizeof(gap));
	memcpy(arc,head,sizeof(head));
	gap[0]=n;
	ll arg=INF;
	int u=pre[s]=s;
	while(dis[s]<n)
	{
L:
		for(int& i=arc[u];i!=-1;i=edge[i].nxt)
		{
			int v=edge[i].y;
			if(edge[i].f&&dis[u]==dis[v]+1)
			{
				if(arg>edge[i].f)arg=edge[i].f;
				pre[v]=u;u=v;
				if(v==t)
				{
					ans+=arg;
					for(u=pre[u];v!=s;v=u,u=pre[u])
					{
						edge[arc[u]].f-=arg;
						edge[arc[u]^1].f+=arg;
					}
					arg=INF;
				}
				goto L;
			}
		}
		int min=n;
		for(int j=head[u];j!=-1;j=edge[j].nxt)
		{
			int v=edge[j].y;
			if(edge[j].f&&min>dis[v])
			{
				arc[u]=j;
				min=dis[v];
			}
		}
		if(--gap[dis[u]]==0)break;
		dis[u]=min+1;
		gap[dis[u]]++;
		u=pre[u];
	}
}
int main()
{
	int T,ca=1,i,j,a,b,m,w,cost,val;
	ll sum;
	scanf("%d",&T);
	while(T--)
	{
		memset(head,-1,sizeof(head));
		scanf("%d",&n);
		s=0,t=n*25+1;tol=0,ans=0;sum=0;
		for(i=0;i<n;i++)
		{
			scanf("%d",&m);
			for(j=1;j<=m;j++)
			{
				scanf("%d%d%d",&cost,&val,&w);
				val-=cost;
				if(val>0){add(s,i*25+j,val);sum+=val;}
				else add(i*25+j,t,-val);
				while(w--)
				{
					scanf("%d%d",&a,&b);
					add(i*25+j,(a-1)*25+b,INF);
				}
			}
		}
		n=t+1;
		sap();
		printf("Case #%d: %I64d\n",ca++,sum-ans);
	}
	return 0;
}
IP-guard发布新版本4.87.2241.0 IP-guard发布了新版本4.87.2241.0,用户可通过提供的下载地址获取完整安装包和升级包。下载后,用户需联系厂家申请测试序列号以进行安装和使用。IP-guard是一款专注于企业文件加密、文档加密系统、防泄密软件、数据安全的软件。 阅读详情

相关推荐

自适应IIR格型滤波器的Matlab实现

概述 在现有的众多抑制窄带干扰的信号处理手段中,时域自适应陷波干扰抑制技术具有实现简单、抗干扰性能好等优点。IIR陷波器按照结构可以分为直接型和格型两种。相比自适应直接型IIR陷波器,自适应格型IIR陷波器不仅可以准确地控制滤波器的陷波频率,也可以准确地调整陷波器的带宽。 传递函数 二阶自适应IIR格型陷波器的传递函数H(z)为: 其中α与陷波带宽有关,β与陷波频率有关;对应的结构如下图所示: Matlab算法实现 ...

剑藏锋的博客 2806

HDU 3996 Gold Mine(最大权闭合图)

题目地址 题意:题意还是蛮复杂的,但是好好分析起来就好了,先告诉你有T组样例,然后每个样例里面有n个区域(n<=100),然后呢?每个区域里面都有m个金矿(m<=25)(其实我觉得直接看金矿就好了,标号就设为 i*26+j),然后告诉你每个金矿要花掉的钱以及能赚到的钱,以及与多少个金矿有关系,然后c行就是有关系金矿的区域号以及区域里面第几个金矿了(按之前的公式算就好了)。问最大的收益是多少?

不要錯過才珍惜 476

CS5212芯片实战:手把手教你设计DP转VGA转换电路(附完整原理图)

本文详细介绍了CS5212芯片在DP转VGA转换电路设计中的实战应用,包括芯片架构解析、核心电路设计要点、PCB布局与电磁兼容设计、调试技巧及进阶应用开发。通过完整的原理图和实用设计指南,帮助工程师快速掌握高可靠转换器的设计方法,特别适合需要国产化替代方案的场景。

weixin_30576827的博客 399

hdoj 3996 Gold Mine 【最小割 之 最大权闭合图】

Gold Mine Time Limit: 6000/2000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 2415    Accepted Submission(s): 525 Problem Description Long long ago, th

世界很大 579

分级 API Key 的使用案例

分级 API Key 的使用案例 1. 背景介绍 1.1 问题由来 随着网络服务的普及,API(Application Programming Interface,应用程序编程接口)成为了连接不同系统和应用的关键桥梁。API Key(API密钥)

欢迎来到我的CSDN空间!这里聚焦AI大模型应用实战,分享前沿技术、实战案例与开发经验。 1025

IDCNBSAIS-财务报表功能范围取值管理费用、销售费用、研发费用排除指定科目的实现

研究了很多方法,没有办法实现,只在营业费用增加一个冲抵项解决,也咨询了外部顾问说要建立自建表。限于需要马上修正后面只能用了最最low的办法处理了一下。公司遇到的一个问题,目前报表有些项目是按照功能范围取值的,发现取多了。IDCNBSAIS-财务报表功能范围取值管理费用、销售费用、研发费用排除指定科目的实现。最后结果是正确的,但是总觉得有更好的办法,不知道有没有高人可以指点一下?建立一个调整项的目录,在每个节点做了调整。除了研发费用做了冲抵在以下每个节点都做了冲抵。为财务报表定义表格结构。

nopicture的博客 1499

HDU3996 Gold Mine最大权闭合图 2011 Multi-University Training Contest 16 - Host by TJU

Gold Mine Time Limit: 6000/2000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 225 Accepted Submission(s)

魔神翼 1277

【AI智能体】Codex + Obsidian 打造专业知识库实战详解

Codex + Obsidian 搭建并操作知识库实战详解

congge 3154

HDU 3996 Gold Mine(最小割---最大权闭合)

题目地址:HDU 3996 很简单的最大权闭合题,只不过有个小小的坑点。。那就是需要用int64。。。。但是为什么我交上去返回的TLE。。。。 建图思路:分别对每一层的金矿都编号。方便处理。然后源点连接正权点,汇点连接负权点,每个点连接它所依赖的。 用正权之和减去最大流即为答案。 代码如下:#include #include #include #include #include

scf0920 1130

YOLO11涨点优化:卷积魔改 | 可变形条带卷积(DSCN),魔改轻量DCNv3二次创新

如何跟YOLO11结合:1)和C3k2创新性结合

①答疑群聊服务;②YOLO大模型知识问答系统;③计算机视觉论文生成智能体; 993

【银河麒麟服务器操作系统】安装英伟达4090D显卡驱动操作指南

本文详细介绍了在银河麒麟高级服务器操作系统V10SP3-2403-X86版本上安装NVIDIA RTX4090D显卡驱动的完整流程。主要内容包括:准备工作检查、开源驱动禁用、运行级别切换、依赖包安装以及交互式安装过程中的关键选项选择(32位库选Yes、X配置选No)。通过禁用nouveau驱动、重建内核引导等步骤确保驱动安装成功,最后通过nvidia-smi命令验证驱动安装情况。文档提供了操作检查表和安装流程图,帮助用户在银河麒麟系统上顺利完成显卡驱动部署。

信创运维工程师 · 银河麒麟 & 容器实战 | 金融生产环境迁移·等保加固 | 142篇原创·17万+阅读 3124

HDU 3996 Gold Mine 最大权闭合图

Gold Mine Time Limit: 6000/2000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 2341    Accepted Submission(s): 503 Problem Description Long long ago, th

Aosaki 671

在 SAP BTP ABAP 环境里直连 ABAP On-Premise OData

摘要 SAP BTP ABAP Environment 2311版本后,OData集成链路迎来重大改进:Service Consumption Model升级为v2版本,通过压缩模型到单一类减少对象数量;通信管理推荐采用Communication Arrangement替代传统Destination,提供更清晰的治理边界。新版支持同时生成OData v2/v4消费模型,并通过标准工厂类创建代理。配置需关注四层对象:Outbound Service声明协议入口,Scenario定义认证方式,System描述通

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

hdu3996Gold Mine 最小割

//给出每个点的权值, //从中选出一些点,使得这些点的权值和最大 //其中选择该点一定要选择在它前面的点,问最终的最大权值是多少 //对于所有正权的点与源点相连,权值为该点权值 //所有负权点与汇点相连,权值为该点权值的绝对值 //每一点与其前面的点相连,权值为无穷大 //这样求出这个图的最小割,用所有正权之和减去这个最小割即为结果 //减去最小割后剩下的点所有正权点集到负权的点集没有边相连,

ijbuhv的专栏 1266

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

WINCC7.3破解文件

WINCC7.3硬件够破解文件,有需要的下载!WINCC7.3硬件够破解文件,有需要的下载!

HDU 3996 Gold Mine

Gold Mine Time Limit: 6000/2000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 1361 Accepted Submission(s): 312 Problem Description Long long ago, there

蛤蛤~ 712

华为的C语言编程规范.pdf

华为技术有限公司内部技术规范。本规范制定了编写C语言程序的基本原则、规则和建议。从代码的清晰、简洁、可测试、安全、程序效率、可移植各个方面对C语言编程作出了具体指导。

HDU 3996 Gold Mine

/* 最大权闭包经典 对于一个点连汇点,边权为花费值,连源点,边权为赚的的值 两个点有约束关系a->b,连单项边b->a; 赚的值的和减去最大流就是解 */ #include #include #include #include #include #include #inc

Join Hands 1230

Data-Structures-and-Algorithm-Analysis-in-Java.pdf

作者: Weiss, Mark A. 出版社: Addison Wesley Data Structures and Algorithm Analysis in Java is an “advanced algorithms” book that fits between traditional CS2 and Algorithms Analysis courses. In the old ACM Curriculum Guidelines, this course was known as CS7. This text is for readers who want to learn good programming and algorithm analysis skills simultaneously so that they can develop such programs with the maximum amo...

HDU-3996 Gold Mine 最大闭合权

  题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=3996   很无语加蛋碎的题目!题意描述不清,然后还有超int(这里wa,果断被坑)= =!方法很简单,很容易看出是最大闭合权。 1 //STATUS:G++_AC_109MS_2068KB 2 #include<stdio.h> 3 #include<st...

weixin_30265171的博客 118

【HDU】3996 Gold Mine 最大权闭合子图

传送门:【HDU】3996 Gold Mine 题目分析:zui da quan bi

poursoul 1133

hdu 3996 Gold Mine (最大权闭合图)

这题卡数据!!!没意义: 题目大意:本题描述比较模糊,我重新描述下Input:                  第一行:T表示测试组数(T                          第一行:n(n                          接下来有n组数据,每组描述每个金矿区情况:                          对于第i组,第一行输入m(m    

LSS 738

hdu 3996 Gold Mine 最大权闭合图

Problem Description Long long ago, there is a gold mine.The mine consist of many layout, so some area is easy to dig, but some is very hard

kongming_acm的专栏 579

HDU3996 Gold Mine(最大权闭合子图)

1 #include<cstdio> 2 #include<cstring> 3 #include<queue> 4 #include<algorithm> 5 using namespace std; 6 #define INF (1LL<<60) 7 #define MA...

dengliugong3918的博客 154

HDU 3996 Gold Mine【最大闭合权图】

题意: 有n 个金矿,每个金矿开发需要一定的价值,开发之后可以获得一定的价值,而且一些金矿受到另一些金矿的限制,即开采这个金矿之前要开采 限制它的金矿,问最多可以获得多少价值。 分析: 比较明显的最大闭合权图。 建图: 如果某个金矿的开发利润为正值,就在源点和该点之间连一条容量为该利润的边 如果某个金矿的...

weixin_33672400的博客 132

hdu 3996 Gold Mine (最大权闭合子图)

Gold Mine Time Limit: 6000/2000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 3017Accepted Submission(s): 691 Problem Description Long long ago, th...

咸鱼有梦想 303

多校第16场 HDU3996 Gold Mine (最大权闭合图)

被数据范围坑了。。。 构图方法这里讲的很详细 http://apps.hi.baidu.com/share/detail/18295127 和之前的一道题类似, 用总的正值和减去最小割,   #include #include using namespace std; typedef long long ll; const int N=3550; const int M=900

jxy859的专栏 1381

hdu 3996 Gold Mine 最大权闭合子图

Gold Mine Time Limit: 6000/2000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2374Accepted Submission(s): 514 Problem Description Long long ago, there is a g...

weixin_30666943的博客 162

hdu 3996 Gold Mine ( 最大权闭合图 )

http://acm.hdu.edu.cn/showproblem.php?pid=3996题意 :题意:有n个金矿,每个金矿开发需要一定的价值,开发之后可以获得一定的价值,而且一些金矿受到另一些金矿的限制,即开采这个金矿之前要开采限制它的金矿,问最多可以获得多少价值。 题解: 很明显的 最大权闭合图 金矿 ,有 开采的 花费 和价值 ,那么 ...

weixin_30764771的博客 81
上一篇: 匈牙利算法
下一篇: hdu 4417 Super Mario
libing923
博客等级 码龄15年 12粉丝 71原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值