Codeforces Round 877 (Div. 2)

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
1838 Codeforces Round 877 (Div. 2) FINISHED False 7200 51376463 June 4, 2023, 2:45 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 327 ) F Stuck Conveyor PROGRAMMING binary search interactive

B"This is an interactive problem. There is an n by n grid of conveyor belts, in positions (1, 1) through (n, n) of a coordinate plane. Every other square in the plane is empty. Each conveyor belt can be configured to move boxes up ('^'), down ('v'), left ('<'), or right ('>'). If a box moves onto an empty square, it stops moving. However, one of the n^2 belts is stuck, and will always move boxes in the same direction, no matter how it is configured. Your goal is to perform a series of tests to determine which conveyor belt is stuck, and the direction in which it sends items. To achieve this, you can perform up to 25 tests. In each test, you assign a direction to all n^2 belts, place a box on top of one of them, and then turn all of the conveyors on. The conveyors move the box around too quickly for you to see, so the only information you receive from a test is whether the box eventually stopped moving, and if so, the coordinates of its final position. You begin the interaction by reading a single integer n ( 2 <= n <= 100 ) -- the number of rows and columns in the grid. Then, you can make at most 25 queries. Each query should begin with a line of the form ? r c, where r and c are the initial row and column of the box, respectively. The next n lines of the query should contain n characters each. The j th character of the i th row should be one of '^', 'v', '<', or '>', indicating the direction of conveyor (i, j) for this query. After each query, you will receive two integers x and y . If x = y = -1 , then the box entered an infinite loop. Otherwise, its final position was (x, y) . If you make too many queries or make an invalid query, you will receive the Wrong Answer verdict. After you have found the stuck conveyor and its direction, print a single line ! r c dir, where r and c are the row and column of the stuck conveyor, respectively, and dir is o"...

Tutorials

Codeforces Round #877 (Div. 2) Editorial

Submissions

No solutions yet.