Блог пользователя JasonMendoza2008

Автор JasonMendoza2008, история, 3 месяца назад, По-английски

This problem https://codeforces.me/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.

  • Проголосовать: нравится
  • +3
  • Проголосовать: не нравится

»
3 месяца назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

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

»
3 месяца назад, # |
  Проголосовать: нравится +3 Проголосовать: не нравится

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

  • »
    »
    3 месяца назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится

    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 месяца назад, # ^ |
        Проголосовать: нравится 0 Проголосовать: не нравится

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