Saturday, December 7, 2024

Absurd Problems


C. Fillomino 2 
Problem - C - Codeforces

Not easy to construct the solution, but there is a nice way to solve it. 

Construction 2: Construct the region for (1,1),(2,2),,(n,n) in order. When starting at (i,i), we walk from (i,i) for x steps, where x is the number written on (i,i). For each step, if the cell to the left of your current cell is empty, we go to that cell and write x on it. Otherwise we go down and write x there.


C. Row GCD

Problem - C - Codeforces

 GCD(a1+bj,…,an+bj)=GCD(a1+bj,a2−a1,…,an−a1)
 .

.

No comments:

Post a Comment