E-COM-NET
首页
在线工具
Layui镜像站
SUI文档
联系我们
推荐频道
Java
PHP
C++
C
C#
Python
Ruby
go语言
Scala
Servlet
Vue
MySQL
NoSQL
Redis
CSS
Oracle
SQL Server
DB2
HBase
Http
HTML5
Spring
Ajax
Jquery
JavaScript
Json
XML
NodeJs
mybatis
Hibernate
算法
设计模式
shell
数据结构
大数据
JS
消息中间件
正则表达式
Tomcat
SQL
Nginx
Shiro
Maven
Linux
FatMouse
HDU 1078
FatMouse
and Cheese(记忆化搜索,DP)
目录1.题目2.题意3.思路4.代码1.题目FatMousehasstoredsomecheeseinacity.Thecitycanbeconsideredasasquaregridofdimensionn:eachgridlocationislabelled(p,q)where0#include#include#includeusingnamespacestd;constintmaxn=100
林小鹿@
·
2024-01-10 16:19
算法
dfs
动态规划
杭电acm1009
FatMouse
'Trade
FatMouse
'TradeTimeLimit:2000/1000MS(Java/Others)MemoryLimit:65536/32768K(Java/Others)TotalSubmission(
cwhong
·
2024-01-05 03:56
HDU 1078
FatMouse
and Cheese
ProblemDescriptionFatMousehasstoredsomecheeseinacity.Thecitycanbeconsideredasasquaregridofdimensionn:eachgridlocationislabelled(p,q)where0#include#includeusingnamespacestd;intn,k;intdata[105][105],dp[
躺_
·
2023-02-03 13:18
DP&图论
dp
HDUOJ-1009
FatMouse
' Trade(贪心)
采用贪心的思考问题方法即“做出的是在某种意义上的局部最优解”,对于本题来说,局部最优解就是整体最优解,因此采用贪心法。解题结构·一个结构体来存储每个房间的状态以及性价比·调用C++的algorithm库的sort(LengthFirstAddress,LengthFirstAddress+Length,Compare)函数来进行排序,如果没有Compare则默认从小到大排序·Compare结构为b
叽翅
·
2023-01-30 19:29
HDU 1160
FatMouse
‘s Speed
链接
FatMouse
’sSpeed-http://acm.hdu.edu.cn/showproblem.php?
jpphy0
·
2021-05-21 08:17
算法入门
#
动态规划初步
部分背包_
FatMouse
' Trade
sourceDescriptionFatMousepreparedMpoundsofcatfood,readytotradewiththecatsguardingthewarehousecontaininghisfavoritefood,JavaBean.ThewarehousehasNrooms.Thei-throomcontainsJiipoundsofJavaBeansandrequires
Gitfan
·
2021-05-03 14:23
HDU 1078
FatMouse
and Cheese 解题报告
FatMouseandCheese题意以前写解题报告的时候很少涉及题意,但是这道题由于理解错了题意WA了三次!~~~在一个n阶方阵A中,Aij表示在第i行第j列的位置处所有的cheese数目。老鼠起始位置为(0,0),老鼠在方阵中移动的规则是:、每次最多沿着水平(或垂直)方向跳k格;、每次所跳至的格中cheese数目要比当前位置处得多。求老鼠所能得到的cheese的最大数目。/*dfs+dp,也可
Lur
·
2020-09-15 13:26
搜索
动态规划
kuangbin专题十二 HDU1078
FatMouse
and Cheese
传送门:http://acm.hdu.edu.cn/showproblem.php?pid=1078题目大意:和滑雪比较类似,只是多了一个最多k步的限制。dp+dfs即可记忆化搜索。dfs一个点,求k步之内的最大值。还是对搜索发怵!!!!AC代码:(见注释)#include#include#include#include#include#include#include#include#includ
ACMerszl
·
2020-09-14 20:41
【HDU】
【简单DP】
【暑假集训】
【kuangbin】
HDU 1009
FatMouse
' Trade(贪心)
1009
FatMouse
'TradeTimeLimit:2000/1000MS(Java/Others)MemoryLimit:65536/32768K(Java/Others)TotalSubmission
weixin_30376453
·
2020-09-12 07:57
HDU-1009(
FatMouse
' Trade)
ProblemDescriptionFatMousepreparedMpoundsofcatfood,readytotradewiththecatsguardingthewarehousecontaininghisfavoritefood,JavaBean.ThewarehousehasNrooms.Thei-throomcontainsJ[i]poundsofJavaBeansandrequir
名字在哪啊
·
2020-09-11 03:17
2019湖中大寒假训练(大一)
FatMouse
' Trade hdu1009 贪心算法
http://acm.hdu.edu.cn/showproblem.php?pid=1009开始贪心专题。题意:一共有n个房子,每个房子里有老鼠喜欢吃的javabeans,但是每个房间里的javabeans的价格不一样。老鼠用m元,问m元最多可以卖多少javabeans,其中每个房间里的javabeans可以被分割。先求单价,然后排个序就行了。#include#includeusingnamesp
花酱_
·
2020-09-11 02:49
贪心
HDU1009:
FatMouse
' Trade
ProblemDescriptionFatMousepreparedMpoundsofcatfood,readytotradewiththecatsguardingthewarehousecontaininghisfavoritefood,JavaBean.ThewarehousehasNrooms.Thei-throomcontainsJ[i]poundsofJavaBeansandrequir
键盘上的舞者
·
2020-09-11 01:31
贪心
hdu1009
FatMouse
' Trade
典型的贪心题意:老鼠想从猫守卫那里得到一些咖啡豆,他带了M的物品,贿赂猫守卫,输入M,N,N表示N组数据,每组输入为咖啡豆的量,需要贿赂猫的量,M可以按百分比分配,求怎么得到的咖啡豆最多#include#include#includeusingnamespacestd;structtrade{intjavabean;intcatfood;doublecost_performance;}fatmou
VNOpU2015
·
2020-09-10 22:41
hdu
贪心
部分背包问题
HDU-1009-
FatMouse
’Trade肥鼠准备了M磅的猫粮,准备和看管仓库的猫交易,仓库里装有他最喜爱的食物Java豆。仓库有N个房间。
night_dust
·
2020-08-25 03:35
部分背包
HDOJ 1009
FatMouse
' Trade
题目链接简单的贪心问题。用F[i]/J[i]的值来确定每一个值的优先级。所以必须开设一个double型数组来存储每个i对应的F[i]/J[i]值。然后用sort快排排列出优先级。这里有一个问题,我们排列好后,得到的值是F[i]/J[i],我们怎样得到J[i]来算出MAX呢?在这里我是考虑使用结构体数组代替单一的flag数组。设置结构体包括对应F[i]/J[i]取值VALUE,以及其对应的标号t=i
Johnny-Zhuang
·
2020-08-24 18:03
C -
FatMouse
' Trade
FatMouse
'TradeTimeLimit:2000/1000MS(Java/Others)MemoryLimit:65536/32768K(Java/Others)TotalSubmission(
weixin_30410119
·
2020-08-24 16:49
ACM--猫鼠交易--HDOJ 1009--
FatMouse
' Trade--贪心
HDOJ题目地址:传送门
FatMouse
'TradeTimeLimit:2000/1000MS(Java/Others)MemoryLimit:65536/32768K(Java/Others)TotalSubmission
学霸的一天
·
2020-08-24 15:14
ACM算法
ACM刷题录
1009
FatMouse
Trade
这道题是用贪心题目中还说要%a好像没用也能过importjava.util.Scanner;publicclassMain{publicstaticvoidmain(String[]args){Scannersc=newScanner(System.in);while(sc.hasNext()){intM=sc.nextInt();intN=sc.nextInt();//输入数据if(M!=-1&
aoduanrou3097
·
2020-08-24 13:03
FatMouse
's Trade(猫鼠交易)
1247:
FatMouse
'sTrade时间限制:1Sec内存限制:32MB提交:89解决:55您该题的状态:已完成[提交][状态][讨论版]题目描述FatMousepreparedMpoundsofcatfood
Strive_Y
·
2020-08-24 13:30
ACM
贪心
动态规划,寻找最长上升子序列问题
题目链接
FatMouse
'sSpeed题目大意:给定一些老鼠的体重和速度,要求找出一些序列,体重逐渐增加,速度逐渐减小。要求输出序列中老鼠的个数与编号,答案不唯一。
hhdmw
·
2020-08-23 17:36
暑假ACM
HDU-1009,
FatMouse
' Trade(贪心水题)
ProblemDescription:FatMousepreparedMpoundsofcatfood,readytotradewiththecatsguardingthewarehousecontaininghisfavoritefood,JavaBean.ThewarehousehasNrooms.Thei-throomcontainsJ[i]poundsofJavaBeansandrequi
Forever+Young
·
2020-08-22 14:01
#
贪心算法
FatMouse
' Trade
http://acm.hdu.edu.cn/diy/contest_showproblem.php?pid=1007&cid=22619ProblemDescriptionFatMousepreparedMpoundsofcatfood,readytotradewiththecatsguardingthewarehousecontaininghisfavoritefood,JavaBean.The
冷夏LX
·
2020-08-22 14:41
题目1433:
FatMouse
时间限制:1秒内存限制:128兆特殊判题:否提交:1345解决:604题目描述:FatMousepreparedMpoundsofcatfood,readytotradewiththecatsguardingthewarehousecontaininghisfavoritefood,JavaBean.ThewarehousehasNrooms.Thei-throomcontainsJ[i]poun
ranchothu
·
2020-08-22 13:22
九度ACM
九度解题报告
HDU 1009
FatMouse
' Trade题解
ProblemDescriptionFatMousepreparedMpoundsofcatfood,readytotradewiththecatsguardingthewarehousecontaininghisfavoritefood,JavaBean.ThewarehousehasNrooms.Thei-throomcontainsJ[i]poundsofJavaBeansandrequir
靖心
·
2020-08-22 12:05
Algorithm算法
FatMouse
' Trade(杭电1009)
FatMouse
'TradeTimeLimit:2000/1000ms(Java/Other)MemoryLimit:65536/32768K(Java/Other)TotalSubmission(s)
风儿继续吹
·
2020-08-22 12:12
贪心
FatMouse
' Trade(贪心算法)
FatMouse
'TradeTimeLimit:2000/1000MS(Java/Others)MemoryLimit:65536/32768K(Java/Others)TotalSubmission(
努力前行吧
·
2020-08-22 12:22
贪心算法
FatMouse
(贪心算法)
ProblemDescriptionFatMousepreparedMpoundsofcatfood,readytotradewiththecatsguardingthewarehousecontaininghisfavoritefood,JavaBean.ThewarehousehasNrooms.Thei-throomcontainsJ[i]poundsofJavaBeansandrequir
flamingobaby
·
2020-08-22 12:48
c++
蓝桥杯
SDJZU-
FatMouse
' Trade
http://sdjzu.acmclub.com/index.php?app=problem_title&assignment_id=1016&problem_id=2134题目描述FatMousepreparedMpoundsofcatfood,readytotradewiththecatsguardingthewarehousecontaininghisfavoritefood,JavaBea
WILL071
·
2020-08-22 11:29
贪心算法
hdu 1160 dp (二维最长上升子序列 记录路径
传送门
FatMouse
'sSpeedTimeLimit:2000/1000MS(Java/Others)MemoryLimit:65536/32768K(Java/Others)TotalSubmission
twh233
·
2020-08-20 03:51
DP
LIS最长递增子序列
HDU 1160
FatMouse
's Speed 最长上升子序列,重拾DP
最简单的DP。。。并且在被提示了考虑dp[i]为i结尾的子序列的最长子序列,各种姿势还是没做出来。。把体重降序排列,就变成了求速度的最长上升子序列,输出正是按次要求,也不用再倒序;n#include#include#include#include#include#include#include#include#include#include#include#includeusingnamespac
姜团长
·
2020-08-20 02:17
杭电OJ hdu1009
FatMouse
' Trade
仅作为水题学习记录,转载随意,欢迎大神们拍砖oj地址http://acm.hdu.edu.cn/showproblem.php?pid=1009ProblemDescriptionFatMousepreparedMpoundsofcatfood,readytotradewiththecatsguardingthewarehousecontaininghisfavoritefood,JavaBean
ZPengX
·
2020-08-15 13:37
算法
笔记
hdu1160
FatMouse
's Speed 【最长下降子序列+输出】
本来想写nlogn,想错了,一直过不了,只能上暴力的。//#include#include#include#include#includeusingnamespacestd;constintN=1024;intf[N],a[N],d[N];structnode{intw,s,id;}p[N];intcmp(nodea,nodeb){if(a.w==b.w)returna.s>b.s;elseret
永远热血沸腾
·
2020-08-13 23:07
hdu
动态规划
FatMouse
's Speed HDU - 1160(最长上升子序列及输出路径)
ProblemDescriptionFatMousebelievesthatthefatteramouseis,thefasteritruns.Todisprovethis,youwanttotakethedataonacollectionofmiceandputaslargeasubsetofthisdataaspossibleintoasequencesothattheweightsarein
欧莎
·
2020-08-13 23:51
dp
动态规划----
FatMouse
’s Speed(HDU 1160)
HDU1160——
FatMouse
’sSpeed给定n只老鼠,每只老鼠有体重和速度,求老鼠的一个最长序列,使得体重严格递增,速度严格递减。
wy19910326
·
2020-08-13 23:09
动态规划
算法
FatMouse
's Speed(HDU-1160)
一道经典的最长子序列题,不过该题需要维护两个量,体重和速度,所以需要先对一个量进行排序,然后剩下的那个量就可以像处理最长子序列那样做了。值得一提的是该题需要打印路径,最好的方法是用一个数组pre运用类似链表的结构,来记录路径。这恰恰就是紫书上数据结构那章例题14中所用的记录最短路路径的方法。其中的巧妙和实现细节请读者细细品味。针对这道题,由于dp是利用之前计算的结果进行递推得到的,因此,每一步的计
AC_Arthur
·
2020-08-13 22:26
动态规划
FatMouse
believes that the fatter a mouse is, the faster it runs.
这题用DP处理最长子序列然后在输出他的标号。#include//动态规划#include#include#include#includeconstintMAX=10010;//题目中给了最多1000只老鼠但是没说给几组测试数据所以尽量开大点,这里输出时是特殊输出:Ctrl+ZintDP[MAX];//最大子序列intrem[MAX];//记录符合条件的老鼠usingnamespacestd;typ
weixin_43898670
·
2020-08-13 22:37
code
HDU - 1160
FatMouse
's Speed
FatMouse
'sSpeedFatMousebelievesthatthefatteramouseis,thefasteritruns.Todisprovethis,youwanttotakethedataonacollectionofmiceandputaslargeasubsetofthisdataaspossibleintoasequencesothattheweightsareincre
什么样的小孩
·
2020-08-13 21:29
DP
HDU 1160
FatMouse
's Speed
ViewCode#include#include#includestructnode{intspeed;intweight;intid;}q[1001];intcmp(constvoid*p1,constvoid*p2){structnode*c=(structnode*)p1;structnode*d=(structnode*)p2;if(c->weight==d->weight)returnd
weixin_34184561
·
2020-08-13 21:49
最长上升子序列输出下标
FatMouse
'sSpeedTimeLimit:2000/1000MS(Java/Others)MemoryLimit:65536/32768K(Java/Others)TotalSubmission
weixin_34088583
·
2020-08-13 21:32
HDU
FatMouse
's Speed 基本DP
题意:要求找到的体重递增,速度递减的老鼠,并且输出最长的长度数,而且输出各自的序列数。SpecialJudge思路:先按体重由小到大排序,再找最长速度递减序列。转移方程:mou[i].w>mou[j].w&&mou[i].sdp[i]1#include2#include3#include4#include5#defineclc(a,b)sizeof(a,b,sizeof(a))6#defineLL
weixin_30383279
·
2020-08-13 20:55
hdu 1160
FatMouse
's Speed
FatMouse
'sSpeedTimeLimit:2000/1000MS(Java/Others)MemoryLimit:65536/32768K(Java/Others)TotalSubmission
范贰小青年
·
2020-08-13 20:43
(+﹏+)动规
▁初学
J -
FatMouse
's Speed HDU 1160 (动态规划,最长上升子序列+路径输出)
J-
FatMouse
'sSpeedTimeLimit:1000MSMemoryLimit:32768KB64bitIOFormat:%I64d&%I64uSubmitStatusPracticeHDU1160DescriptionFatMousebelievesthatthefatteramouseis
_pkm_
·
2020-08-13 20:09
dp
HDU1160
FatMouse
's Speed(DP,最长下降子序列)
题目链接
FatMouse
'sSpeedTimeLimit:2000/1000MS(Java/Others)MemoryLimit:65536/32768K(Java/Others)TotalSubmission
fcbruce
·
2020-08-13 19:28
DP
hdu 1160
FatMouse
's Speed(动态规划)
问题描述:FatMousebelievesthatthefatteramouseis,thefasteritruns.Todisprovethis,youwanttotakethedataonacollectionofmiceandputaslargeasubsetofthisdataaspossibleintoasequencesothattheweightsareincreasing,butt
泛友
·
2020-08-13 19:20
数据算法
动态规划
hdu 1160
FatMouse
's Speed (LIS)
FatMouse
'sSpeedTimeLimit:2000/1000MS(Java/Others)MemoryLimit:65536/32768K(Java/Others)TotalSubmission
1A_coder
·
2020-08-13 19:31
DP
递推
贪心——HDU题目1009
FatMouse
' Trade
FatMouse
'TradeTimeLimit:2000/1000MS(Java/Others)MemoryLimit:65536/32768K(Java/Others)TotalSubmission(
Hanks-zyh
·
2020-08-13 19:34
hdu
FatMouse
's Speed
点击打开链接FatMousebelievesthatthefatteramouseis,thefasteritruns.Todisprovethis,youwanttotakethedataonacollectionofmiceandputaslargeasubsetofthisdataaspossibleintoasequencesothattheweightsareincreasing,but
tianhaijun2013
·
2020-08-13 19:53
动态规划
杭电1160-
FatMouse
's Speed(超详细解释)
FatMouse
'sSpeedTimeLimit:2000/1000MS(Java/Others)MemoryLimit:65536/32768K(Java/Others)TotalSubmission
ECJTU_ACM_余伟伟
·
2020-08-13 19:21
杭电ACM_算法题_动态规划
HDU1160-
FatMouse
's Speed【最长单调子序列】
FatMousebelievesthatthefatteramouseis,thefasteritruns.Todisprovethis,youwanttotakethedataonacollectionofmiceandputaslargeasubsetofthisdataaspossibleintoasequencesothattheweightsareincreasing,butthespe
moomhxy
·
2020-08-13 17:35
动态规划
HDU
HDU - 1160 DP(路径)
FatMouse
’sSpeed题目大意:给你一个长度不超过1000的序列,然后每个元素包含两个数字wiwi和vivi,现在要你找出一个最长的子序列使得这个序列满足按w递增而按v递减,然后输出长度和所选子序列顺序
TRDD
·
2020-08-13 17:15
DP
上一页
1
2
3
4
5
6
7
8
下一页
按字母分类:
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Y
Z
其他