Cognition is sponsoring the IOI this year! ecnerwala, tourist, skittles1412, and walnutwaldo20 will all be there. We'll have a booth in the Fun Zone after both contest days, and we'll generally be hanging around throughout the week. Come by and say hi, we'd love to meet you!
Competitive programming runs deep at Cognition. Many of our engineers competed in high school olympiads, and our founders (scott_wu, stevenkplus, and walnutwaldo20) are all IOI gold medalists. One fun fact: every IOI from 2006 through 2025 had at least one Cognition employee competing in it.
Today, Cognition is one of the largest AI startups in the world. We're building the future of software engineering and working with Fortune 500 companies to transform how they build software.
We hope to see you in Tashkent. Until then, here's a fun warmup problem :)








tourist blog!
u never know what here is before
yup felt the same bro? is it correct
LGM blog! For the problem I think you would flatten the matrix into 1 dimension then a operations effectively changes the stride and number of rows, right?
tourist bhai blog likhse!
This solution uses $$$0$$$-indexing.
Store the grid in row-major order in an array $$$a$$$. Then, the element in row $$$i$$$ and col $$$j$$$ is equal to $$$a[im+j]$$$. Reshape operations do not affect $$$a$$$. After a transpose operation, the element in row $$$j$$$ and col $$$i$$$ becomes $$$a[jn+i]$$$. Observe that $$$n(im+j)=inm+jn\equiv i+jn\pmod{nm-1}$$$ is equal this new index.
Hence, a transpose operation is equivalent to updating $$$a$$$ to $$$a'$$$ where $$$a'[nx\mod{nm-1}]:=a[x]$$$ ($$$a[nm-1]$$$ never changes). Since this transformation is linear, we can store the product of $$$n$$$ over all transpositions and only do one linear transformation at the end, leading to an $$$O(nm+q)$$$ solution.
Code
after 2 whole years ,damn lol
As you said that Since 2006 up to 2025, Cognition has an employee who was competing in that year's IOI, I would like to be in the ones of 2026.
You solved a ton of problems and I looked at your problems solved graph and it looks very similar to my own but I feel like you don't have to solve that many 800 rated problems, I feel like solving problems at or slightly above your rating would be more beneficial.
Tourist blog?!
Please do this again next year because I won't forgive myself for not qualifying this year after misreading a problem :(
tourist blog!
tourist 67