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.
# | User | Rating |
---|---|---|
1 | tourist | 3985 |
2 | jiangly | 3814 |
3 | jqdai0815 | 3682 |
4 | Benq | 3529 |
5 | orzdevinwang | 3526 |
6 | ksun48 | 3517 |
7 | Radewoosh | 3410 |
8 | hos.lyric | 3399 |
9 | ecnerwala | 3392 |
9 | Um_nik | 3392 |
# | User | Contrib. |
---|---|---|
1 | cry | 169 |
2 | maomao90 | 162 |
2 | Um_nik | 162 |
4 | atcoder_official | 161 |
5 | djm03178 | 158 |
6 | -is-this-fft- | 157 |
7 | adamant | 155 |
8 | awoo | 154 |
8 | Dominater069 | 154 |
10 | luogu_official | 150 |
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.
Name |
---|
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..
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.
For each test case print minimum $$$k>0$$$ such that $$$p^{k}$$$ has at least one infinite path.
the statement in your spoiler needed to be the statement during contest .
uummmmmmmmm......
You really don't get sarcasm .....I meant why it is in spoiler if it was in contest....
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.
Please help .I tried hard but could not understand . If some one explains any one of the example my problem will be solved .
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.
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.
Nope, that would take 6 days. After 5 days it is just trivial permutation, all paths in which are infinite
Oooh Ok I got it now I was calculating wrong. This teleportation land idea is all wrong my bad. Tnx