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 |
---|---|---|---|---|---|---|
1201 | Codeforces Round 577 (Div. 2) | FINISHED | False | 7200 | 172502687 | Aug. 4, 2019, 4:35 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 148 ) | E2 | Knightmare (hard) | PROGRAMMING | graphs interactive shortest paths | 3000 |
B"This is an interactive problem. Alice and Bob are playing a game on the chessboard of size n x m where n and m are even. The rows are numbered from 1 to n and the columns are numbered from 1 to m . There are two knights on the chessboard. A white one initially is on the position (x_1, y_1) , while the black one is on the position (x_2, y_2) . Alice will choose one of the knights to play with, and Bob will use the other one. The Alice and Bob will play in turns and whoever controls the white knight starts the game. During a turn, the player must move their knight adhering the chess rules. That is, if the knight is currently on the position (x, y) , it can be moved to any of those positions (as long as they are inside the chessboard): (x+2, y+1) , (x+2, y-1) , (x-2, y+1) , (x-2, y-1) . We all know that knights are strongest in the middle of the board. Both knight have a single position they want to reach: Formally, the player who captures the other knight wins. The player who is at its target square ( (n/2, m/2) for white, (n/2+1, m/2) for black) and this position is not under opponent's attack, also wins. A position is under attack of a knight if it can move into this position. Capturing a knight means that a player moves their knight to the cell where the opponent's knight is. If Alice made 350 moves and nobody won, the game is a draw. Alice is unsure in her chess skills, so she asks you for a help. Choose a knight and win the game for her. It can be shown, that Alice always has a winning strategy. The interaction starts with two integers n and m ( 6 <= n,m <= 1000 , n and m are even) -- the dimensions of the chessboard. The second line contains four integers x_1, y_1, x_2, y_2 ( 1 <= x_1, x_2 <= n , 1 <= y_1, y_2 <= m ) -- the positions of the white and the black knight. It is guaranteed that the two knigh"... |
Codeforces Round #577 (Div 2) Editorial |
No solutions yet.