HBC16636car题解

上官魅 算法基础篇 60 0
全网最全C++题库,助您快速提升编程技能!题库丰富多样,涵盖各个领域,让您在练习中不断成长!
White Cloud has a square of n*n from (1,1) to (n,n). White Rabbit wants to put in several cars. Each car will start moving at the same time and move from one side of one row or one line to the other. All cars have the same speed. If two cars arrive at the same time and the same position in a grid or meet in a straight line, both cars will be damaged. White Cloud will destroy the square m times. In each step White Cloud will destroy one grid of the square.Any car will break when it enters a damaged grid. White Rabbit wants to know the maximum number of cars that can be put into to ensure that there is a way that allows all cars to perform their entire journey without damage. For example, in a 5*5 square legal illegal illegal

White Cloud has a square of n*n from (1,1) to (n,n). White Rabbit wants to put in several cars. Each car will start moving at the same time and move from one side of one row or one line to the other. All cars have the same speed. If two cars arrive at the same time and the same position in a grid or meet in a straight line, both cars will be damaged. White Cloud will destroy the square m times. In each step White Cloud will destroy one grid of the square(It will break all m grids before cars start).Any car will break when it enters a damaged grid. White Rabbit wants to know the maximum number of cars that can be put into to ensure that there is a way that allows all cars to perform their entire journey without damage. (update: all cars should start at the edge of the square and go towards another side, cars which start at the corner can choose either of the two directions) For example, in a 5*5 square legal illegal(These two cars will collide at (4,4)) illegal (One car will go into a damaged grid)

HBC16636car题解
-第1张图片-东莞河马信息技术
(图片来源网络,侵删)

标签: HBC16636car题解