Ghost Leg

From programming_contest
Revision as of 06:32, 14 February 2023 by Kmk21 (talk | contribs) (Created page with "This problem gives us a ladder (much akin to a mini-game from the original mario party!) and asks us what permutation it forms. We can simulate this quite easily. Generate an array of size n, where a[i]=i. Then for each rung m, swap the two corresponding elements. WHen we're done, print out the remaining array. Category:ICPC Problems Category:Naq2022 Category:Algorithm Easy Category:Implementation Easy Category:Simulation")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

This problem gives us a ladder (much akin to a mini-game from the original mario party!) and asks us what permutation it forms. We can simulate this quite easily. Generate an array of size n, where a[i]=i. Then for each rung m, swap the two corresponding elements. WHen we're done, print out the remaining array.