JasonMendoza2008's blog

By JasonMendoza2008, history, 3 months ago, In English

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.

  • Vote: I like it
  • +3
  • Vote: I do not like it

»
3 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Auto comment: topic has been updated by JasonMendoza2008 (previous revision, new revision, compare).

»
3 months ago, # |
  Vote: I like it +3 Vote: I do not like it

No, this isn't wrong. It means all glasses move in one moment

  • »
    »
    3 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    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.

    • »
      »
      »
      3 months ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      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]...

      • »
        »
        »
        »
        3 months ago, # ^ |
        Rev. 2   Vote: I like it 0 Vote: I do not like it

        So it's not simultaneous, it's sequential? because 1 goes to p[1] before p[1] goes to p[p[1]]?