Hola Codeforces!
The 2024 Argentinian Programming Tournament (TAP) was held last weekend. This is a 2024-2025 ICPC subregional contest for teams from Argentina to qualify to the South America/South Regional contest. You can send your solutions or do a virtual participation in the Codeforces gym. I invite you all to solve the problems.
The problems were written and prepared by elsantodel90, fredy10, Guty, lsantire, MarcosK, pablobce, reedef and me (MateoCV)
I would like to thank CodigoL, FedeNQ, JPrime, Marckess, MrNachoX and visho33 for solving and reviewing the problems and providing valuable feedback.
Feel free to use this blog to discuss about the problems :)
Happy coding!
These were the authors of each problem:
Thanks to the authors for producing such a great GYM!!
Hint J,K?
For J
If you sort the numbers, what are the different possibilities for adjacent numbers to add up to X?
What's the max number of $$$x / 2$$$ you can have in the list?
There is more to it than these hints, but IMO the problem is mostly annoying to implement rather than difficult to get to the answer.
I did this but it still gives me wrong on test 7?!
What about numbers that are contiguous and add up to X, just think about all the edge cases.
Isn't it simply a question of calculating x combinations and seeing if there are enough elements (x-1) to intercede between them?
I didn't get what you meant.
I don't think I ended up solving that one so I don't get what I mean either haha All good!
could someone please give me a hint for L
Try and think if agustin and juan share any numbers
yeah i think about that and augustin will take such a number because he is playing first but still have a wrong answer in test case 8
Are you sure the first player will always pick that number? I'd suggest you handle that case separately. Also, keep in mind that, if the amount of times said number appears on the range is odd, one of them will pick it more often.
hint B?
First of all, it is clear that the usefull segments can be like $$$(1, d)$$$ where $$$d$$$ is a divisor of the number $$$K$$$. Think in cases with a lot of divisors like $$$K = 12$$$, can $$$(1, 2)$$$ or $$$(1, 3)$$$ be minimal or there is another segment that makes them unncesary?
where can I find the editorial?
Hit C? Plaese
Check if the intersection point of the line between the sun and the ape and the z=0 plane lies inside the polygon base of the pyramid.
What if the base is like a peanut (2 circles connected via a curved path, don't know a better way to explain the image I'm thinking about). In that case you could have the projection of the apex inside the base but you would wrongly say that there is no shadow region, there is one between the circles.
What happens if a face doesn't get the sun light? What's the condition for that (or the opposite) to happen?
Another hint?
Sure
If a face is shadowed then it casts a shadow.
To check if a face is shadowed you can check if the sun is "behind" the plane that the face lies in.
Just use the normal of the face defined by the points it contains and see the condition it must satisfy with a vector from the apex to the sun.
Can someone give me a hint for E please?
It's a classical DP problem.
You have N weapons, and each of them has an associated cost and profit. Each weapon can only be picked at most once. You want to pick the weapons in such a way that the sum of their "profits" is maximal.
Division can be expensive and imprecise, especially if you're working with floats. Use cross multiplication to sort the weapons by their costs.
Could you give me a case for hint 2, I don't really get it. Thanks
Hint For Problem L? Please.
You'll be given three types of numbers: the ones A can chose, the ones B can chose, the ones both can choose and the ones neither one can chose. Do you care about all of them?
Since the game only ends when neither player can choose a number and a player's score is the sum of all the numbers they picked, we can conclude the score of each player is the sum of all the numbers they can pick in that range. Can you think of an efficient way of calculating the answer?
There is one number both players can pick. Since they're playing optimally, they'll always pick it in order to maximize their score. What happens if the amount of times this number appears in the range is even? And what if it's odd?
Thanks
I thinks we can we store the count of powers of 2 and count of odd numbers and then ee just compare the sum.
You're close.
One is a power of two because 2 ^ 0 = 1.
Use prefix sums to efficiently calculate the answer.
Yah I have used but It gives me wrong answer on test case 4 and this is the code i have used
I see what the problem is. Try running your code with the following test case:
Your code will probably output E, since you're counting the number one twice, but the answer should be A.
I suggest you count the ones separately by storing them on another prefix sum array.
hint for I pls ><
There is a classical problem to pass through every edge of a graph.
Hello need hit H?
Hint M? is this Convex Hull?