danx's blog

By danx, history, 13 months ago, In English

Hello everyone!

Below is the editorial for the informatics division of CAMA along with the solution code to every problem. We have also uploaded PDFs with the editorial both in Spanish and English on our website. The contest can be found on this gym.

The problems were prepared by Esomer, danx, Hectorungo_18, javiergm06 and Rigobertus. We would also like to thank our VIP tester BernatP for his dedication towards the contest.

A. Saving the cinema

Solution
Code

B. Operation

Solution
Code

C. Maximum profit

Solution
Code

D. jbum

Solution
Code

E. Looking for palindromes

Solution
Code

F. Harry Potter in CMS

Solution
Code

G. XOR + Constructive = Love

First of all, we would like to apologize for misjudging the difficulty of this problem. It turned out to be much harder than what we expected.

Solution
Code

H. Menorca's ants

Solution
Code

I. Fake bills

Solution
Code

J. Force Perturbation

Solution
Code

K. Óscar and his battle

Solution
Code

L. Random intervals

Solution
Code

M. The battle of Helm's Deep

Solution
Code

N. The Omer's orange tree

Solution
Code

O. Bea the maximizer

Solution
Code

P. Ski resort

Solution
Code
Tutorial of CAMA 2023
  • Vote: I like it
  • +30
  • Vote: I do not like it

»
13 months ago, # |
  Vote: I like it +9 Vote: I do not like it

We have put a lot of effort into preparing the contest and we believe that the problems are interesting.

We hope you enjoy them!

»
13 months ago, # |
  Vote: I like it +3 Vote: I do not like it

Problems are good. Nice contest!

  • »
    »
    13 months ago, # ^ |
      Vote: I like it +5 Vote: I do not like it

    Thanks, we are glad you like the problems. Hope to see you participating in the next edition :)

»
13 months ago, # |
  Vote: I like it +9 Vote: I do not like it

K can be solved by without trees or compression, just by nuancing the two pointers approach. The idea is that when considering characters in non-increasing order of $$$a_i$$$, there is no point considering a character with a smaller $$$b_i$$$ than one we've seen already. Thus, we can impose both that $$$a_i$$$ is non-increasing and that $$$b_i$$$ is non-decreasing over the monsters that we consider, allowing us to use two pointers over $$$c$$$ and $$$d$$$ to maintain the number of coins as we go.

Code
»
12 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Is there a typo in the problem statement for problem E? Bounds claim N=5000 but test data goes above that

  • »
    »
    12 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Yes, sorry. It was meant to be $$$50000$$$, it seems we missed a $$$0$$$... It is now fixed.