【codeforces 111C】 Petya and Spiders

Petya在n×m的棋盘上训练蜘蛛,每格都有蜘蛛。在一秒钟内,他给每个蜘蛛发出指令,包括留在原地或向四个相邻格子移动。Petya的目标是找出最多能有多少个格子没有蜘蛛。题目要求计算最大可能的无蜘蛛格子数。输入包含棋盘的尺寸n和m,输出为无蜘蛛的格子的最大数量。
摘要由CSDN通过智能技术生成

H - Petya and Spiders
Time Limit:2000MS Memory Limit:262144KB 64bit IO Format:%I64d & %I64u
Submit

Status
Description
Little Petya loves training spiders. Petya has a board n × m in size. Each cell of the board initially has a spider sitting on it. After one second Petya chooses a certain action for each spider, and all of them humbly perform its commands. There are 5 possible commands: to stay idle or to move from current cell to some of the four side-neighboring cells (that is, one command for each of the four possible directions). Petya gives the commands so that no spider leaves the field. It is allowed for spiders to pass through each other when they crawl towards each other in opposite directions. All spiders crawl simultaneously and several spiders may end up in one cell. Petya wants to know the maximum possible number of spider-free cells after one second.

Input
The first line contains two space-separated integers n and

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值