Skip to content

encodedmessage

bradendubois edited this page Jun 9, 2021 · 6 revisions

Encoded Message

ID: encodedmessage

Difficulty: 1.4

CPU Time: 1 second

Memory: 1024 MB

Solution

Invasion of privacy (and eccentricity of squared-length messages) aside, one can essentially see the pattern visualized in the Kattis example: we read the right-most column (top to bottom), then the next one to the left, and repeat for the entire message. A loop to start at the top of each column can go from i = 0 root (the square root of the size of the message - it is a square) to 0, and an inner loop going from j = 0 to root, where the position to output is (j * root) + i.

Clone this wiki locally