#implementation
CF 1949J - Amanda the Amoeba
CF 1949J - Amanda the Amoeba Rating: 2600 Tags: graphs, implementation, trees, two pointers Solve time: 1m 3s Verified: no Solution Problem Understanding We are asked to guide Amanda the Amoeba from an initial configuration to a target configuration on a rectangular grid. Each configuration marks Amanda's body with * , free pixels with . , and blocked pixels with X . Her body is connected and contains at least...
CF 241C - Mirror Box
CF 241C - Mirror Box Rating: 2000 Tags: geometry, implementation Solve time: 1m 27s Verified: no Solution Problem Understanding The system describes a rectangular box where a laser beam enters through one small hole on the left wall and must exit through another hole on the right wall. Inside the box, there are horizontal mirror segments placed either on the floor or on the ceiling. Each mirror covers a segment...
CF 241F - Race
CF 241F - Race Rating: 2300 Tags: brute force, implementation Solve time: 2m 26s Verified: yes Solution Problem Understanding The city is represented by a grid. Every cell is either a building, a street tile with a traversal cost from 1 to 9 , or a junction labeled by a lowercase letter. Movement rules are unusual. You can move only between adjacent cells that share an edge, but: moving from...
CF 46B - T-shirts from Sponsor
CF 46B - T-shirts from Sponsor Rating: 1100 Tags: implementation Solve time: 1m 13s Verified: yes Solution Problem Understanding We are given a limited stock of T-shirts in five sizes: S, M, L, XL, and XXL. Each participant in the contest has a preferred size. Participants arrive in a fixed order and try to pick the T-shirt closest to their preferred size. If their preferred size is available, they take...
CF 38A - Army
CF 38A - Army Rating: 800 Tags: implementation Solve time: 1m 18s Verified: yes Solution Problem Understanding Vasya currently holds rank a in the army and wants to eventually reach rank b . Moving from rank i to rank i + 1 requires a fixed number of years, stored in the array d . The array has length n - 1 because there are exactly n - 1 transitions between...
CF 38B - Chess
CF 38B - Chess Rating: 1200 Tags: brute force, implementation, math Solve time: 2m Verified: no Solution Problem Understanding We are given the positions of two chess pieces on a standard 8 × 8 board, one rook and one knight. Their starting positions are guaranteed to be safe, meaning the rook does not attack the knight and the knight does not attack the rook. We must place one more knight...
CF 38D - Vasya the Architect
CF 38D - Vasya the Architect Rating: 1900 Tags: implementation Solve time: 1m 38s Verified: yes Solution Problem Understanding We stack cubes one by one. Every cube is axis-aligned, and its projection on the ground is a square. Since the cubes are actual cubes, the side length is determined by the square base. Cube i is placed directly on top of cube i-1 . Their projections overlap with positive area,...
CF 46A - Ball Game
CF 46A - Ball Game Rating: 800 Tags: brute force, implementation Solve time: 1m 23s Verified: yes Solution Problem Understanding The children stand in a circle numbered from 1 to n . Child 1 starts with the ball. The first throw moves the ball forward by 1 position, the second throw moves it forward by 2 positions, the third throw by 3 positions, and so on. After exactly n -...
CF 46D - Parking Lot
CF 46D - Parking Lot Rating: 1800 Tags: data structures, implementation Solve time: 1m 54s Verified: yes Solution Problem Understanding We have a parking segment represented by the interval [0, L] . Cars arrive one at a time, always driving from left to right, and each driver wants to park at the earliest possible position. If a car of length x parks with its back at coordinate p , then...
CF 48B - Land Lot
CF 48B - Land Lot Rating: 1200 Tags: brute force, implementation Solve time: 1m 47s Verified: yes Solution Problem Understanding The garden is represented as an n × m grid. Each cell contains either 0 or 1 . A 1 means there is a tree in that square, while 0 means the square is empty. We want to place a rectangular house plot somewhere inside the grid. The rectangle must...