Secret Permutation
Time limit1.5sMemory limit1024 MB
Recover a hidden permutation P of 1 to N using queries that return the sum of absolute differences of P along a chosen index order V.
- Level
Medium7 of 10
- Topics
- Math, Implementation
- Solved
- No attempts yet
Problem
The Scientific Committee has hidden a permutation of all integers from 1 to (3 ≤ ≤ 256). You need to find it. is fixed, and the grader is not adaptive.
You may ask queries with another permutation of the integers from 1 to as the parameter. The query returns
After a number of queries, find , or any other permutation that cannot be distinguished from . Two permutations are indistinguishable if every possible query returns the same answer for both.