火车上没法写,来补题了…
链接:https://ac.nowcoder.com/acm/contest/11253/I
题目描述Lovely penguins is a tiny game in which the player controls two penguins.
The game holds in two 20 × 20 20×20 20×20 grids (the left one and the right one), and each has some blocked places.
We number the grid in x t h x^{th} xth row (starting from the up), y t h y^{th} yth column (starting from the left) ( x , y ) (x,y) (x,y)
The penguins move in four directions: up, down, left, right, exactly one step once. If its way is blocked, or it reaches the border, then this movement is omitted. The player also moves the penguins in four directions, but the behavior of the two penguins is mirrored:
- L : left penguin moves to left, right penguin moves to right.
- R : left penguin moves to right, right penguin moves to left.
- U : both move upwards.
- D : both move downwards.
An operation can be omitted on one penguin but works on another.
The left penguin starts from ( 20 , 20 ) (20,20) (20,20) and wants to move to ( 1 , 20 ) (1,20) (1,20).The right penguin starts from ( 20 , 1 ) (20,1) (20,1) and wants to move to ( 1 , 1 ) (1,1) (1,1).If both penguin reach there destination, thay win the game.
Find out the shortest way to win the game.If there are many shortest ways to win, find the one with minimum lexicographical order(D
最近更新
- 深拷贝和浅拷贝的区别(重点)
- 【Vue】走进Vue框架世界
- 【云服务器】项目部署—搭建网站—vue电商后台管理系统
- 【React介绍】 一文带你深入React
- 【React】React组件实例的三大属性之state,props,refs(你学废了吗)
- 【脚手架VueCLI】从零开始,创建一个VUE项目
- 【React】深入理解React组件生命周期----图文详解(含代码)
- 【React】DOM的Diffing算法是什么?以及DOM中key的作用----经典面试题
- 【React】1_使用React脚手架创建项目步骤--------详解(含项目结构说明)
- 【React】2_如何使用react脚手架写一个简单的页面?