Блог пользователя bully....maguire

Автор bully....maguire, 5 лет назад, По-английски

I read problem D many times i could not figure out what it want's to say . Can someone explain the problem with second example case. Problem D is the only problem in my life time that i did not understood by myself so please help me.

LINK

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

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

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

    in third case for example we get B = [3,6,1,8,7,2,5,4] from array A = [7 4 5 6 1 8 3 2] because at 7th position of A we have 3 hence 7 gets replaced by 3 . At 4th position of A we have 6 and thus 4 is replaced by 6 and so on . Now in array B , p2[4] = 8 p2[8] = 4 and thus we get sequence 4,8,4,8 .... and in color array [5 3 6 4 7 5 8 4] at position 4 we have 4 and at position 8 we have 4 . Thus each color corresponding to position in sequence 4,8,4,8 .... has same value.

    Is my understanding correct or else please explain the problem using one of the given example..

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

      Yes that's right. What you've just described is the existence of an infinite path. That infinite path exists for the first time in $$$p^{2}$$$. Take a look at $$$p^{1}$$$, no infinite paths exists.

      The problem wants you to find that.

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

        the statement in your spoiler needed to be the statement during contest .

        • »
          »
          »
          »
          »
          5 лет назад, # ^ |
            Проголосовать: нравится +27 Проголосовать: не нравится

          uummmmmmmmm......

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

            You really don't get sarcasm .....I meant why it is in spoiler if it was in contest....

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

              I'm sorry, I didn't mean to be sarcastic. I just thought I'd put that clause in a spoiler because I snatched it from the problem statement. Maybe it should've been a blockquote instead.

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

Please help .I tried hard but could not understand . If some one explains any one of the example my problem will be solved .

  • »
    »
    5 лет назад, # ^ |
    Rev. 2   Проголосовать: нравится 0 Проголосовать: не нравится

    That is exactly what I mean by being specific. The sample testcases are already well explained in the problem statement, so you need to let people know which part that you don't understand.

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

The second test seems to be faulty because after 5 days it will end up same as the start.

As for the problem think of it as there is n land every land have color and portal which directs to the other land. Every night passes i th land steals the portal from the land which their portal used to direct to. Let's consider lucky infinite path as -> if a person goes through portals starting from ith land and every land he visits is in same color. After how many days will there be at least one infinite path.

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

    The second test seems to be faulty because after 5 days it will end up same as the start.

    Nope, that would take 6 days. After 5 days it is just trivial permutation, all paths in which are infinite

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

      Oooh Ok I got it now I was calculating wrong. This teleportation land idea is all wrong my bad. Tnx