This problem https://mirror.codeforces.com/contest/285/problem/B says "Consider all glasses are moving simultaneously during one shuffling operation.".
I don't understand how simultaneously makes sense, I solved the problem assuming one shuffling operation means moving the glasses in sequence* but I was just wondering if there is something I misunderstood.
* "if glass at position 1 goes from 1 to 2 and glass at position 2 goes from 2 to 3 then if marble was in glass at position 1 it ends up in glass at position 3" was my assumption.
Thank you for your help.
Auto comment: topic has been updated by JasonMendoza2008 (previous revision, new revision, compare).
No, this isn't wrong. It means all glasses move in one moment
But then if they all move in one moment and we take back my example the marble would end up at position 2 right? because we swap 1 and 2 at the same time we swap 2 and 3. Which would barely make sense because where would glass 2 end up, in 1 or in 3? I'm sorry if I still miss something.
You have array p that clearly says where glass sould go. Glass that was on 1 would go to p[1] and glass that was on 2 would go to p[2]...
So it's not simultaneous, it's sequential? because 1 goes to p[1] before p[1] goes to p[p[1]]?