Repovive Starter Round 4 Participation Report
It’s me.
I participated in Repovive Starter Round 4. I solved 3 problems.
Problem C was quite interesting. As I expected, international contests tend to have many of these kinds of observation-based problems, which makes them fun.
Problem A Different Parity
To summarize, the problem asks to determine whether an integer interval contains both odd and even numbers.
If , the interval contains at least two consecutive integers, so it will always include both an odd and an even number.
Problem B Balanced Trio
The Yes/No part can be determined by whether (a + b + c) % 2 == 0 is satisfied. However, I spent quite a bit of time on the construction of the solution.
Without overthinking, you can construct it using the following steps:
-
Let be the target sum for each group.
-
Prepare an array to manage , and an array to manage .
-
Iterate through in order. Add the values to until the sum of reaches , and then add the remaining values to .
You just need to be careful to split a single value between and only if adding that value would cause the sum to exceed .
Problem C Corner Meeting
In summary, there is a grid with sides of cells, and pieces and are located at and , respectively.
- Piece : Moves up, down, left, right, or stays put.
- Piece : Moves in four diagonal directions or stays put.
The problem asks for the minimum number of moves for both pieces to reach the same cell.
After experimenting with cases up to about , I realized that meeting on the diagonal of the grid seems optimal.
Let the meeting point be . If we denote the minimum moves required to reach that point as for piece and for piece , then:
Therefore, you just need to use binary search to find the maximum that satisfies .
Problem D Distant Transfers
I didn’t really understand this one. I think you could determine if a solution exists by taking prefix sums and checking if any negative values appear, but to be honest, I was completely lost.
Repovive seems to be a small-scale competitive programming site with the number of participants still in the triple digits, but there are some interesting problems here and there.
So, for all you contest enthusiasts out there, why not give it a try?
See you later.