Solutions are presented as using the least memory and the fastest execution time. It also takes the top 10 most recent solutions from each language. If you want to limit to a specific index, click the "Solved" button and go to that problem.
ContestId |
Name |
Phase |
Frozen |
Duration (Seconds) |
Relative Time |
Start Time |
|---|---|---|---|---|---|---|
| 921 | AIM Tech Mini Marathon 1 | FINISHED | False | 10800 | 259336802 | Feb. 1, 2018, 4 p.m. |
Solved |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
|---|---|---|---|---|---|---|
| ( 0 ) | 01 | Labyrinth-1 | PROGRAMMING | 3200 |
You have a robot in a two-dimensional labyrinth which consists of N × M cells. Some pairs of cells adjacent by side are separated by a wall or a door. The labyrinth itself is separated from the outside with walls around it. Some labyrinth cells are the exits. In order to leave the labyrinth the robot should reach any exit. There are keys in some cells. Any key can open any door but after the door is opened the key stays in the lock. Thus every key can be used only once. There are no labyrinth cells that contain both a key and an exit. Also there can not be both a wall and a door between the pair of adjacent cells. Your need to write a program in abc language (see the language description below) that will lead the robot to one of the exits. Lets numerate the labyrinth rows from 0 to N - 1 top to bottom and the columns – from 0 to M - 1 left to right. In abc language the following primary commands are available: move-DIR – move to the adjacent cell in the direction. down increases the number of the row by 1, right increases the number of the column by 1. In case there’s a wall or a closed door in this direction, nothing’s happening. open-DIR – open the door between the current cell and the adjacent one in DIR direction. In case there isn’t any door in this direction or it’s already been opened or the robot doesn’t have a key, nothing’s happening. take – take the key in the current cell. In case there isn’t any key or the robot has already picked it up, nothing’s happening. The robot is able to carry any number of keys. terminate – terminate the program. This command is not obligatory to use. In case it’s absent the command is added at the end of the program automatically. Also, there are the following control commands in abc language: for-N OPS end – repeat the sequence of the OPS commands N times, 0 < N ≤ 100000 . Each loop counter check counts as a command fulfilled by the robot. if-ok OPS1 else OPS2 endif – carries out the sequence of the OPS 1 commands, |
No solutions yet.