Coin-collecting by robot

算法——Coin-collecting by robot(硬币收集问题) 题目描述 Several coins are placed in cells of an n×m board. A robot, located in the upper left cell of the board, needs to collect as many of the coins as possible and bring them to the bottom right cell.... 阅读详情
Coin-collecting by robot
1000(ms)
65535(kb)
738 / 2013
Several coins are placed in cells of an n×m board. A robot, located in the upper left cell of the board, needs to collect as many of the coins as possible and bring them to the bottom right cell. On each step, the robot can move either one cell to the right or one cell down from its current location
输入
The fist line is n,m, which 1< = n,m <= 1000.
Then, have n row and m col, which has a coin in cell, the cell number is 1, otherwise is 0.
输出
The max number Coin-collecting by robot.
样例输入
5 6
0 0 0 0 1 0 
0 1 0 1 0 0 
0 0 0 1 0 1 
0 0 1 0 0 1 
1 0 0 0 1 0
样例输出
5

#include<iostream> 
#include<stdio.h> 
#include<malloc.h>
#include<string.h>
#include<string>
#include<stack>
#include<math.h>
#include<algorithm>
using namespace std;
#define INF 99999999

int a[1005][1005];

int main() {
	int m,n;
	cin>>m>>n;
	for(int i=1;i<=m;i++){
		for(int j=1;j<=n;j++){
			cin>>a[i][j];
		}
	}
	for(int i=1;i<=m;i++){
		for(int j=1;j<=n;j++){
			if(a[i-1][j]>a[i][j-1])
				a[i][j]+=a[i-1][j];
			else
				a[i][j]+=a[i][j-1];
		}
	}
	cout<<a[m][n]<<endl;
 	return 0;
}


SWUST OJ 之 1132 Coin-collecting by robot Several coins are placed in cells of an n×m board. A robot, located in the upper left cell of the board, needs to collect as many of the coins as possible and bring them to the bottom right cell. On ... 阅读详情

相关推荐

swust oj 1132--Coin-collecting by robot

Coin-collecting by robot(1132) Time limit(ms): 1000 Memory limit(kb): 65535 Submission: 47 Accepted: 16 Accepted Several coins are placed in cells of an n×m b

殇は筑梦 2367

SWUST OJ 1132: Coin-collecting by robot

Several coins are placed in cells of an n×m board. A robot, located in the upper left cell of the board, needs to collect as many of the coins as possible and bring them to the bottom right cell. On each step, the robot can move either one cell to the righ

无奈清风吹过的博客 272

视觉特征-自监督-掩码特征预测【2025-06】:V-JEPA-2【100万小时互联网视频,每样本:4秒×4➜16帧】【Stage1:表征学习⮕Stage2:V-JEPA2-AC(自回归下一帧预测)】

图14 展示了在实验室1中,使用杯子进行抓取操作任务的起始和目标框架示例。对于抓取和带物体到达任务,模型仅看到一个目标图像。对于拾取-放置任务,除了最终目标外,我们还向模型展示两个子目标图像。第一个目标图像显示物体被抓取,第二个目标图像显示物体在目标位置附近。模型首先针对第一个子目标优化动作4个时间步,然后自动切换到第二个子目标进行接下来的10个时间步,最后针对第三个目标进行最后4个时间步。

u013250861的博客 100

swustoj1132Coin-collecting by robot

Several coins are placed in cells of an n×m board. A robot, located in the upper left cell of the board, needs to collect as many of the coins as possible and bring them to the bottom right cell. On e...

Swust_ZzK的博客 1538

算法——Coin-row problem(币值最大化问题)

题目描述 There is a row of n coins whose values are some positive integers c₁, c₂,...,cn, not necessarily distinct. The goal is to pick up the maximum amount of money subject to the constraint that no tw...

刘小白的博客 5775

SV--对象拷贝、参数化的类

对象拷贝,参数化的类

创芯人--fly的博客 1571

swustoj 1132 Coin-collecting by robot

题目: Several coins are placed in cells of an n×m board. A robot, located in the upper left cell of the board, needs to collect as many of the coins as possible and bring them to the bottom right cell. On each step, the robot can move either one cell to the.

sakuraqwqqqqq的博客 2283

Intel AX系列网卡5G热点开启失败?Linux下3种修复方案实测(含Ubuntu/OpenWRT)

本文针对Intel AX系列网卡在Linux系统下无法开启5G热点的常见问题,深入剖析了其根源在于内核LAR机制与驱动的兼容性。文章提供了三种实测有效的修复方案:针对内核低于5.5的模块参数法、适用于高内核版本的hostapd补丁编译法以及高阶的驱动修改法,帮助用户在Ubuntu、OpenWRT等环境中成功启用5G热点功能。

weixin_29291863的博客 739

【dp】1132: Coin-collecting by robot

题目: http://acm.swust.edu.cn/#/problem/1132/490 题目描述 Several coins are placed in cells of an n×m board. A robot, located in the upper left cell of the board, needs to collect as many of the coins as possible and bring them to the bottom right cell. On each

tran_sient的博客 1095

LoRa模块选型指南:正点原子ATK-LORA-01与SX1278芯片深度评测(含实测距离/功耗数据)

本文深度评测了正点原子ATK-LORA-01与SX1278芯片的性能表现,通过实测数据展示其在复杂环境中的通信距离与功耗表现。特别适合智慧农业、工业监测等物联网应用场景,提供详细的配置指南和优化技巧,帮助开发者实现高效、低功耗的LoRa通信解决方案。

weixin_29191081的博客 292

INMP441麦克风与ESP32的I2S音频采集实战指南

本文提供了INMP441数字麦克风与ESP32开发板通过I2S接口进行高质量音频采集的完整实战指南。详细讲解了硬件连接、软件配置、数据读取及基础处理,并分享了常见的避坑技巧与性能优化建议,帮助开发者快速构建物联网音频应用。

weixin_28396629的博客 599

swust oj 1132: Coin-collecting by robot 题解

swust oj 1132题解

m0_62466431的博客 394

5V转±12V无变压器双boost电路

最近有个新项目,需要±10V范围的模拟量输出(非隔离),对于5V以下供电的控制板而言单端输出绝对没问题,可现在需要有正负输出,是少不了正负电源的,因此准备设计一个5V转±12V的电源,然后选择一个双向供电的运放,来实现单端模拟量信号向双向模拟量信号转换。 本文就来分享一下5V转±12V电源的设计。对于有类似双向电源需求的场合,大多使用变压器通过增加多个绕组来实现,而对于体积空间有要求的场合来讲,变压器实在是太大了,另外对于一些成熟的项目,变压器如果是已经设计好的,再额外增加绕组需要重新设计,费时费力。于是,

qq_30388337的博客 1万+

[Swust OJ 1132]-Coin-collecting by robot

题目链接: http://acm.swust.edu.cn/problem/1132/ Time limit(ms): 1000    Memory limit(kb): 65535 Several coins are placed in cells of an n×m board. A robot, located in ...

weixin_33898876的博客 556

深度解析:LPDDR5 采样 Mask 背后的秘密 —— 从 Jitter 到 BER 全面剖析

在 LPDDR5 中,CK/DQS 信号相当于“指挥棒”,而数据(DQ)要在时钟节拍里被准确采样。Crosspoint Mask 区域横轴:时间 (Time)纵轴:电压 (Vref)👉 只要采样点落在这个区域内,数据就是正确的。否则就会出错。BERPBERPMask 就像高速公路的收费站口,如果车(采样点🚗)在车道内,顺利通过;一旦跑偏,就撞护栏。LPDDR5 的速率极高,UI 非常短,Mask 区域成为核心指标各种 Jitter、Noise 会不断压缩 Mask。

weixin_43199439的博客 354

Oracle EBS与SAP数据数据切换至迁移华为MetaERP分析

Oracle EBS到华为MetaERP的数据迁移可采用“表对表复制”思路,因其模块化设计下数据模型标准化、边界清晰。核心业务对象存储在结构明确的主表中,与MetaERP模型兼容度高,便于直接映射。而SAP到MetaERP的迁移则因SAP高度优化的复杂表结构(如簇表/池表)、数据分散冗余、深度依赖配置等特点,无法简单复制,必须采用基于业务对象的迁移方法,通过视图/BAPI提取数据并进行深度转换。两种迁移的本质差异源于源系统的数据模型设计理念不同。

金牌架构师 1379

Coin Test

描述 As is known to all,if you throw a coin up and let it droped on the desk there are usually three results. Yes,just believe what I say ~it can be the right side or the other side or standing on th

Jingle的博客 323

关于DEJA_VU3D - Cesium功能集专栏说明

专栏主要目的是对工作中基于Cesium实现过的功能进行整合,暂时打算一周2-3更的样子来更新,每一篇都会奉上完整源代码(尽可能把代码简洁一些)。功能实现大多数是自己琢磨实现的,也有参考其他大神后整理实现的,初步算了算现在有差不多实现小130个左右的功能,后续也会不断的更新。..........................................

总得学点什么的博客 2万+

SWUST OJ1132: 机器人收集硬币

题目描述 几枚硬币被放置在n×m板的单元格中。位于棋盘左上角的机器人需要收集尽可能多的硬币,并将它们带到右下角的牢房。在每一步中,机器人可以将一个单元向右移动,或者从其当前位置向下移动一个单元。 输入 The fist line is n,m, which 1< = n,m <= 1000. Then, have n row and m col, which has a coin in cell, the cell number is 1, otherwise is 0. 输出 .

weixin_63587703的博客 1311

假人有限元模型

假人模型,车辆碰撞假人有限元模型,适合做乘员安全的研究者利用

OV9734 DATASHEET,完整规格书

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

[Swust OJ 1139]--Coin-row problem

题目链接: http://acm.swust.edu.cn/contest/0226/problem/1139/ There is a row of n coins whose values are some positive integers c₁, c₂,...,cn, not necessarily distinct. The goal is to pick up the ...

weixin_34358365的博客 1124

visio安装包

Microsoft Office Visio 是一款专业的制图软件。利用经过更新的形状、协作工具和数据链接图表,创建专业级图表以简化复杂的信息。

[Swust OJ 1026]--Egg pain's hzf

题目链接:http://acm.swust.edu.cn/problem/1026/ Time limit(ms): 3000    Memory limit(kb): 65535 hzf is crazy about reading math recently,and he is thinking about a boring proble...

weixin_33884611的博客 150

VC中sqlite的使用

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

light oj 1132 Summing up Powers

点击打开light oj 1132 思路: 构造矩阵+矩阵快速幂 分析: 1 题目给定n和k要求(1K + 2K + 3K+ ... + NK) % 232 2 具体的思路见下图 3 对于求组合数,我们可以利用公式C(n , k+1) = C(n , k)*(n-k)/(k+1) ,那么我们可以先打表求出50之内的所有的组合数 代码: /****************...

我是传奇 199
上一篇: Coin-row problem
下一篇: 跑跑卡丁车
CGD_ProgramLife
博客等级 码龄9年 11粉丝 64原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值