杭电-4500小Q系列故事——屌丝的逆袭

腾讯笔试——安排机器 【 题目描述】小 Q 的公司最近接到 m 个任务, 第 i 个任务需要 xi 的时间去完成, 难度等级为 yi。 小 Q 拥有 n 台机器, 每台机器最长工作时间 zi, 机器等 安排机器 【 题目描述】小 Q 的公司最近接到 m 个任务, 第 i 个任务需要 xi 的时间去完成, 难度等级为 yi。 小 Q 拥有 n 台机器, 每台机器最长工作时间 zi, 机器等级 wi。 对于一个任务,它只能交由一台机器来完成, 如果安排给它的机器的最长工作时间小于任务需要的时间, 则不能完成,如果完成这个任务将获得 200 * xi + 3 * yi 收益。 对于一台机器,... 阅读详情

小Q系列故事——屌丝的逆袭

Time Limit: 300/100 MS (Java/Others)    Memory Limit: 65535/32768 K (Java/Others)
Total Submission(s): 5685    Accepted Submission(s): 2109


Problem Description
  毕业于普通本科的小Q一直自称是资深屌丝,不仅学校不知名,甚至他自己在这个普通学校也是默默无闻——直到临近毕业的时候,班里5朵金花中的2位甚至从没和他说过话!
  谁又能想到,如此不起眼的小Q在历经重重面试环节后,竟然如愿以偿加入了心仪已久的腾讯公司!消息刚刚传开的那几天,这在他们班甚至整个学院都是讨论的热门话题,如果这时候你还表示不知道小Q是谁,你都会被大家当作怪物的。
  正所谓野百合也有春天,屌丝也有逆袭的那一天!
  
  刚到腾讯大厦上班的那几天,小Q眼中的一切都是那么新鲜,连每天见到的前台MM在他眼中都胖的那么可爱。小Q就这样在紧张与兴奋的情绪中度过了一天又一天,每天即勤奋认真又小心翼翼,很希望能给主管留下个好印象,以免失去这来之不易的工作机会。
  一段时间以后,随着对工作环境以及同事的熟悉,小Q逐渐放松下来,在工作间隙,他细细观察了自己的工作环境,发现整个工作室是一个N行M列的矩形布局,或者是因为屌丝的本性逐步暴露,他还暗自给每个同事在心里进行了魅力值评分(为区别男女,男生一律用负整数表示,女生一律用正整数表示)。
  现在,小Q把所有人的数据记录下来,并且这样定义一个位置的价值:
  1、一个位置的价值只和其上下左右四个邻居的魅力值有关(对于靠边的位置,只考虑其存在的邻居);
  2、如果某位置的邻居和该位置主人性别不同,则总分加上邻居魅力值的绝对值,否则减去;
  3、对周围所有邻居的数据处理后,最终的得分即为这个位置的最终得分,得分越高,则该位置越好;

  现在你能帮助小Q计算一下哪里才是最佳位置吗?
 

Input
输入包含多组测试数据;
每组测试数据的第一行包含2个整数N和M,表示工作室的布局是N行M列;
接下来的N行,每行有M个整数,分别表示对应位置员工的魅力值数据Ki,正整数表示女生的魅力值,负整数表示男生的魅力值;
N和M为0的时候表示输入数据结束。

[Technical Specification]
N<=20
M<=20
-100<=Ki<=100
 

Output
请计算并输出最佳位置的行列号以及对应的得分,如果得分最高的位置有多个,则请输出行号最小的那个,行号还相同的话,再比较列号,只输出列号最小的那个即可。
 

Sample Input
2 3 5 -4 3 -6 3 7 0 0
 

Sample Output
1 2 11


把每个节点信息存到结构体中,再排序即可!



代码:


#include<cstdio>
#include<cstring>
#include<algorithm>
#include<cmath>
using namespace std;
int map[22][22],mo[4][2]={1,0,-1,0,0,1,0,-1};
int m,n;
struct node{
	int x,y,val;
}t[500]; 
bool cmp(node x,node y)
{
	if(x.val!=y.val)
	return x.val>y.val;
	else if(x.x!=y.x)
	return x.x<y.x;
	else
	return x.y<y.y;
}
int main()
{
	int i,j;
	while(scanf("%d%d",&m,&n),m||n)
	{
		memset(map,0,sizeof(map));
		for(i=1;i<=m;i++)
			for(j=1;j<=n;j++)
				scanf("%d",&map[i][j]);

		for(i=0;i<m*n;i++)
		{
			t[i].x=i/n+1;
			t[i].y=i%n+1;
			t[i].val=0;
			for(j=0;j<4;j++)
			{
				int X=t[i].x+mo[j][0];
				int Y=t[i].y+mo[j][1];
				if(map[X][Y]*map[t[i].x][t[i].y]<0)
					t[i].val+=abs(map[X][Y]);
				else
					t[i].val-=abs(map[X][Y]);
			}
		}
		sort(t,t+n*m,cmp);
		printf("%d %d %d\n",t[0].x,t[0].y,t[0].val);
	}
	return 0;
}





AI协议助手:法律文本解析与智能问答技术解析 自然语言处理(NLP)技术在法律文本解析中展现出巨大潜力,通过BERT等预训练模型实现条款分类与语义理解。结合OCR与知识图谱技术,AI协议助手能快速提取合同核心条款,并以问答形式解释法律术语,显著提升商务场景的决策效率。测试数据显示,该系统对NDA协议的识别准确率达92%,响应时间仅1.2秒,特别适用于人力资源竞业协议、云服务SLA评估等场景。随着RAG架构与法律术语向量库的应用,AI+法律正推动合同审核成本下降67%,未来将在跨境合规、智能谈判等方向持续演进。 阅读详情

相关推荐

别再死磕DH参数了!用MATLAB Robotics Toolbox + SOLIDWORKS搞定六轴机械臂仿真(附避坑指南)

本文详细介绍了如何利用MATLAB Robotics Toolbox和SOLIDWORKS进行六轴机械臂仿真,避免常见的DH参数错误和模型导出问题。通过实战指南和避坑技巧,帮助工程师实现从三维建模到运动学仿真的无缝衔接,提升仿真效率和准确性。

weixin_27066963的博客 394

腾讯马拉松20号第一题

小Q系列故事——屌丝的逆袭Time Limit: 300/100 MS (Java/Others) Memory Limit: 65535/32768 K (Java/Others) Total Submission(s): 1319 Accepted Submission(s): 383 Problem Description   毕业于普通本科的小Q一直自称是资深屌丝,不仅学校不知名,甚

一只奋斗的菜鸟的专栏 722

stackelberg博弈_博弈论、多智能体、强化学习(随便记点东西)

多智能体应用场景:已实现:游戏AI。正在努力:UAV,物资运输,快递分发,交通系统。未来:社会学,预测群体行为,城市区域合作,国际关系。博弈论基本定义:玩家集合: 策略集合: 收益函数: 囚徒困境:两智能体矩阵博弈坦白抵赖坦白1,13,0抵赖0,32,2占优策略与最佳应对:上表中两者均具有占优策略,即无论如何都应该选坦白。那么构造下表。坦白抵赖坦白1,13,0抵赖0,12,2对于玩家一来说,坦白...

weixin_39611722的博客 2997

HDU 4380 预处理枚举

题意:给出n个房子m个矿问从n个房子选三个组成的三角形内部矿数为奇数有多少种选法。 先预处理一下每条线段正上方有多少个点,然后在枚举三条线段就可以了。 #include #include #include #include #include using namespace std; struct point { long long x,y; }; int cmp(point a,po

韩小侠的专栏 已迁移至lssea.com 1088

高频面试题-项目介绍篇

聊聊如何介绍项目经历。

m0_73359763的博客 1908

哈工大OS实验四——进程运行轨迹的跟踪与统计

进程运行轨迹的跟踪与统计 进程从创建(Linux 下调用 fork())到结束的整个过程就是进程的生命期,进程在其生命期中的运行轨迹实际上就表现为进程状态的多次切换,如进程创建以后会成为就绪态;当该进程被调度以后会切换到运行态;在运行的过程中如果启动了一个文件读写操作,操作系统会将该进程切换到阻塞态(等待态)从而让出 CPU;当文件读写完毕以后,操作系统会在将其切换成就绪态,等待进程调度算法来调度该进程执行…… process.c解读 void cpuio_bound(int last, int cpu_

优快云-ych 1001

【简单枚举】HDU-1196 Lowest Bit

注解 1、简单枚举,把100以内的2的次方数都列举出来,只要找到相等的就输出,如果大于,就减去。 代码 #include <iostream> using namespace std; int main() { int a[] = {64, 32, 16, 8, 4, 2, 1}; int n; cin>>n; while...

zhanggirlzhangboy的博客 166

无人机+消防车:高楼灭火系统技术详解

传统的消防设备,如登高车、车载水枪、水炮和高喷车,在50米以上高度的火源面前往往力不从心,100米以上高层火灾则更加依赖消防员“爬楼”灭火,效率低下且风险极高。消防水带:采用聚乙烯丝材质,超轻、耐腐蚀、强度高,能够携带大量水或灭火泡沫进行高空喷水灭火作业。“无人机+消防车”高楼灭火系统主要由消防车和无人机两部分组成,通过机车联动实现高效灭火。高效灭火:无人机能够快速到达高层建筑顶部或指定位置进行灭火作业,大大提高了灭火效率。空压泡沫系统:配备超大水箱,支持长时间供应灭火泡沫,满足无人机灭火剂的需求。

专注多旋翼、复合翼无人机技术研究,从事低空经济行业。 1670

Qt代码-软件商店

ui->statusBar->showMessage(QString("%1 已卸载").arg(app["name"].toString()));ui->statusBar->showMessage(QString("开始下载 %1...").arg(app["name"].toString()));QString("%1 已下载完成,是否立即安装?ui->statusBar->showMessage(QString("%1 下载完成").arg(app["name"].toString()));

寒寒豆豆软件公司的博客 111

【毕设实战】基于YOLOv8的HRSC2016船舶智能检测系统开发全指南(含可视化UI界面,打造海事领域高分毕设)

亲爱的同学,通过这篇教程,你已经掌握了“基于YOLOv8的HRSC2016微小船只检测系统”从数据集处理、模型训练到Tkinter界面开发的全流程。这个课题既贴合“海事智能化”的产业战略,又涵盖了“目标检测、深度学习、界面开发”等多个毕设评分点,非常适合作为计算机或海事工程专业的毕业设计。在实践中,你可能会遇到“海面背景复杂导致船只漏检”“微小船只识别精度不足”“UI与模型推理同步卡顿”等挑战——别担心,这些都是技术成长的必经之路。

know_F0727的博客 127

腾讯笔试题——安排机器

安排机器 1.问题描述 小 Q 的公司最近接到 m 个任务, 第 i 个任务需要 xi 的时间去完成, 难度等级为 yi。 小 Q 拥有 n 台机器, 每台机器最长工作时间 zi, 机器等级 wi。 对于一个任务,它只能交由一台机器来完成, 如果安排给它的机器的最长工作时间小于任务需要的时间, 则不能完成,如果完成这个任务将获得 200 * xi + 3 * yi 收益。 对于一台机器,它一天...

Wz_still_shuai的博客 467

MOS五类漏电流与优化策略

分析了五种主要漏电流机制:1)反偏结泄漏,由PN结热激发和隧

硬核科技 442

杭电4500小Q系列故事——屌丝的逆袭

小Q系列故事——屌丝的逆袭 Time Limit: 300/100 MS (Java/Others)    Memory Limit: 65535/32768 K (Java/Others) Total Submission(s): 5664    Accepted Submission(s): 2098 Problem Description   毕业于普通本科的小Q一直

hpuzsk的博客 465

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...

VC中sqlite的使用

在VC中对sqlite的使用,实现数据库大批数据的快速插入,读取数据库中的数据在ListCtrl中显示

杭电 4500 小Q系列故事——屌丝的逆袭

小Q系列故事——屌丝的逆袭 Time Limit : 300/100ms (Java/Other)   Memory Limit : 65535/32768K (Java/Other) Total Submission(s) : 16   Accepted Submission(s) : 5 Problem Description   毕业于普通本科的小Q一直自称是资深屌丝,不仅学校不知名

墨守空城与钟楼 818

lwip-2.0.3

lwip是瑞典计算机科学院(SICS)的Adam Dunkels 开发的一个小型开源的TCP/IP协议栈。实现的重点是在保持TCP协议主要功能的基础上减少对RAM 的占用。

杭电4500 小Q系列故事——屌丝的逆袭

Problem Description   毕业于普通本科的小Q一直自称是资深屌丝,不仅学校不知名,甚至他自己在这个普通学校也是默默无闻——直到临近毕业的时候,班里5朵金花中的2位甚至从没和他说过话!   谁又能想到,如此不起眼的小Q在历经重重面试环节后,竟然如愿以偿加入了心仪已久的腾讯公司!消息刚刚传开的那几天,这在他们班甚至整个学院都是讨论的热门话题,如果这时候你还表示不知道小Q是谁,你都

Determined&Diligent的专栏 427

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

【杭电】[4500]小Q系列故事——屌丝的逆袭

首先把各个位置人的魅力值记录 然后分别计算就好了 因为只需要求最大值 所以在计算的时候只需要记录最大值就好了

BoilTask Talk Show 487

小Q系列故事-屌丝的逆袭(杭电4500)

小Q系列故事——屌丝的逆袭 Time Limit: 300/100 MS (Java/Others)    Memory Limit: 65535/32768 K (Java/Others) Total Submission(s): 5327    Accepted Submission(s): 1957 Problem Description   毕业于普通本科的小Q一直自称是资

My Castle 801

【杭电oj】4500 - 小Q系列故事——屌丝的逆袭(水)

小Q系列故事——屌丝的逆袭 Time Limit: 300/100 MS (Java/Others)    Memory Limit: 65535/32768 K (Java/Others) Total Submission(s): 6098    Accepted Submission(s): 2277 Problem Description   毕业于普通本科的小Q一直

wyg1997 1076

杭电acm 4500小Q系列故事——屌丝的逆袭

#include #include int main() { int m,n,a[30][30],i,j,b[30][30],max,k,t; while(scanf("%d%d",&n,&m)!=EOF) { if(n==0&&m==0)break; if((m==0&&n!=0)||(m!=0&&n==0))continue;

梦玉的专栏 570

HDU 4500 小Q系列故事——屌丝的逆袭(水题)

题目地址:http://acm.hdu.edu.cn/showproblem.php?pid=4500 思路:简单模拟 AC代码: #include #include #include #include #include #include #include #include #include #include #include const int inf = 0x3f3

Java识堂,一个有干货的微信公众号 451

2013腾讯编程马拉松初赛第0场(3月20)(HDU 4500 HDU4501 HDU4502 HDU4503 HDU4504)

这次比赛共5题,其实都不难,如果我状态很好,运气很好的话,做3个不是问题,这次比赛各种dp,真惊了。。 比赛完了看看rank,被各种大一的给虐的不成样了,我们学校齐心协力最后居然才出了第一题和第三题。。。 时常被大一虐虐总是好的。。 1、HDU 小Q系列故事——屌丝的逆袭 1001 小Q系列故事——屌丝的逆袭 Time Limit: 0.1 Seconds

671coder的专栏 8755

hdu 4500 (小Q系列故事——屌丝的逆袭)

水题,读题要仔细。。。 #include #include #include using namespace std; const int N=25; const int minn=-99999999; int map[N][N],dp[N][N]; int main() { int n,m; while(~scanf("%d%d",&n,&m)) {

hndu__lz的博客 557

HDU 4500 小Q系列故事——屌丝的逆袭(简单题)

http://acm.hdu.edu.cn/showproblem.php?pid=4500 AC代码: 1 #include<math.h> 2 #include<stdio.h> 3 4 #define MAXN 21 5 6 int n, m, ki[MAXN][MAXN]; 7 int wi[4]={0, 1, 0, ...

172

HDU4500 小Q系列故事——屌丝的逆袭【模拟】

题目大意: 工作室的布局是N*M的矩形,每个单位上有一名员工。每个位置由一个价值。每一个位置的 价值和其上、下、左、右四个邻居的魅力值有关。如果一个位置的邻居与这个位置的员工性别 不同,则该位置的价值总分加上这个邻居的魅力值,性别相同的话就下去邻居的魅力值。最终 得分就是这个位置的价值。(输入的时候,男生魅力值用负数表示,女生魅力值用正数表示) 那么问题来了:问哪个位置的魅力值最大,计算并输出最佳位置的行列号和序列号即相应的价 值。 思路: 就是直接的模拟,遍历每个位置,判断一下上下左右和自身的正负情况,

程序员充电站(itcharge) 1641

HDU 4500 小Q系列故事——屌丝的逆袭

腾讯的题目,一条简单的搜索题目,适合初学者练习代码能力,或者是高手休息脑子的题,呵呵,不需要动脑了,只动手打代码就过了。 不过腾讯这故事有点坏啊,给人透露了两个信息: 1 腾讯不拘一格降人才 2 进入腾讯就可以屌丝逆袭了 腾讯是不是还想说腾讯的mm特别多? 呵呵,出题不忘给自己宣传一下。 #include #include const int MAX_NM = 20; i

靖空间 1194
上一篇: 杭电2473-Junk-Mail Filter
下一篇: 杭电-4505小Q系列故事——电梯里的爱情
Eric_keke
博客等级 码龄12年 37粉丝 221原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值