paulocezar's blog

By paulocezar, history, 10 months ago, In English

Hello, Codeforces!

The 2025-2026 ICPC Latin American Regional Programming Contest was held last weekend, and the full problem set is now available on Codeforces Gym for virtual participation and upsolving. Whether you want a team practice or a solo grind, you're invited to try it and discuss solutions here.

This contest is part of the ICPC 2025-2026 cycle for Latin America and serves to select the teams for the Latin America Championship (March 2026, Chile). This year's regional had 558 official teams from 18 countries, competing simultaneously across 16 sites throughout the region. You can check the official results here: https://scorelatam.naquadah.com.br/latam-2025/.

Huge thanks to the LATAM jury who prepared and tested the tasks, and to all the volunteers who helped run the onsite events. The problems were written and prepared by Alejandro Strejilevich de Loma, andremfq, brunomont, gpoesia, Inés Kereki, lsantire, mnaeraxr, MarcosK, martins, Rafael Armando Garcia Gomez, rafaelgo, Roberio, cabessa and me.

An editorial with solution sketches is in the works; this post will be updated with the link as soon as it's ready.

Use the comments to share hints, approaches, and editorials (please mark spoilers).

Hope you enjoy the problems and have fun!

The authors of each problem are:
  • Vote: I like it
  • +84
  • Vote: I do not like it

»
8 months ago, hide # |
Rev. 2  
Vote: I like it 0 Vote: I do not like it

.

»
8 months ago, hide # |
Rev. 2  
Vote: I like it 0 Vote: I do not like it

Problem I is cute, here's a brief solution sketch since there appears to be no official editorial.

Consider the following reduced version of the problem:

There are $$$n$$$ points in a line, numbered $$$0$$$ to $$$n - 1$$$ from left to right. There are two pointers, one colored red and initially on point $$$a$$$, and another colored green and initially on point $$$b$$$. There are also several edges, leading from a point with a smaller index to a point with a larger index. Each edge is colored red or green. The goal is to move the red pointer to point $$$A$$$ while only using red edges and the green pointer to point $$$B$$$ while using only green edges, while also ensuring that no point is ever visited by both the pointers (they cannot visit the same point even at different times).


Solution
Solution to the original problem
»
3 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

How to solve F ?

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

    Hi, one approach is to read the string and while the size of that string is bigger than 12-15 pop the last number, add to the count of 2 and 5 as we are simulating to divide it by 10. This is not the real number but with fit in that error. When you achieve that size you can do a normal prime decomposition.

    In java you can do a similar approach using BigInteger but dividing by 2 or 3 depnding on the number parity. Both solutions may get AC