Skip to content

planina

bradendubois edited this page Jun 9, 2021 · 6 revisions

Planina

ID: planina

Difficulty: 1.3

CPU Time: 1 second

Memory: 1024 MB

Solution

The task of finding all the points and manually inserting points and tracking all of this seems daunting. Since the points are put between two already-existing points, an iteration will take a row of n points to contain n + n-1 points. Since the question asks for the total points at the end, and it's a perfect square, one can just loop and increase the points in one row (starting at 2, before any iteration) by this relation for each "iteration", and when done, square it to represent the points present in the square.

Clone this wiki locally