News
Programming problems for the school stage of the "Robo-Coding" olympiad among 9th–11th grade students
Published:
Programming problems for the school stage of the "Robo-Coding" olympiad held among 9th–11th grade students in the system of the Agency for Specialized Educational Institutions
PROBLEMS
Problem 1: Splitting a number into digits and finding their product
Statement: Separate all digits of the entered integer and calculate their product. If the number is zero, the result must be "0".
Problem 2: Rearranging a string
Statement: Sort only the letters in the given string in alphabetical order; digits and other characters must stay in place.
For example:
Input: "a1c2b"
Output: "a1b2c"
Problem 3: Separating Fibonacci numbers into even and odd
Statement: Find the Fibonacci sequence up to the N-th element and separate the even and odd numbers. The Fibonacci sequence starts with 0 and 1, and each following number equals the sum of the previous two.
Problem 4: Special numbers
Statement: Among the numbers from 1 to N, identify only those whose sum of digits and product of digits are equal to each other.
Problem 5: Bringing the robot to the target point
Statement: The robot is located inside a square grid. The robot's starting point and the target point are given in the grid. The robot must reach the target point moving only up, down, left or right.
The following moves are available to move the robot:
- "U" - move up
- "D" - move down
- "L" - move left
- "R" - move right
Task: Find the minimal sequence of commands to bring the robot to the target point and move the robot using these commands.
Input:
- Grid size N×N.
- The coordinates of the robot's starting point (x1, y1) and the target point (x2, y2) are given.
Output:
- Print the sequence of commands that takes the robot to the target point with the minimum number of moves.
If the input is:
N = 5
Starting point: (0, 0)
Target point: (3, 3)
Output:
Moves: R R R D D D
