Rating changes for last rounds are temporarily rolled back. They will be returned soon. ×

Comments

apologies for my rating_greed

Hi, i got accepted in main tests to all my submissions then all of it was skipped and i became out of competition , but i didn't cheat ; can anyone please explain in which cases that happens

thanks in advance

+1

take this case :

5 5 4 0 4

0 1 0

1 2 1

1 3 1

3 4 0

2 4 1

in this case : if the fourth edge is the first one u meet in ur dijkstra , u will assign 2 to it and assign 1 to the first one , then ur ans will be NO , because there still a path shorter than L;

take this case : 5 5 4 0 4

0 1 0

1 2 1

1 3 1

3 4 0

2 4 1

it's clearly wrong in this input either if you just assign 2 to the fourth edge and 1 to the first one,or if you assign 2 to the fourth edge and oo to the first one

5 5 4 0 4

0 1 0

1 2 1

1 3 1

3 4 0

2 4 1

it's clearly wrong in this input if you just assign 2 to the fourth edge , and 1 to the first one.

Hi everyone in the editorial of div2/d div1/b ,I didn't understand why this is true: "It is easy to see that we can repeat this process at most n times because we are only replacing the edges which are on the initial shortest path we found and there are less than n edges to replace ". I mean why there are at most n edges to replace in the shortest paths graph. could anyone explain that in details. thanks in advance;

nice problemset and well_written editorial hope to see your next round

Hi every one , for problem D I didn't hear about sliding window technique before , so i read about it and i got a shallow idea about it, but still not unerstood how we can use it here , i didn't understand anything about that, reading the editorial and the implementation .

can any one help me with details. thanks in advanse.

+3

for problem E : can anyone explain the details of the last part of the author's code — calculating and reducing the numerator — thanks in advance

supposing that ur dp parameters are :

1 : the index of the tree (ind)

2: how many different groups u have till now (diff)

3: and the previous color (prev)

of course when u reach ind=n(if u start enumerating the trees from 0 ,then u processed all the trees) and diff< k return oo ,

so at the end ,when u finish ur dp function , if the result >= oo ,then there is no way to get k different groups ,so print -1;

'cause we define the probability that no two ones have the same birth day as follow : k! *c[2^n][k] /((2^n)^k) now if u decompose c[2^n][k] in the numerator , u can find that we can delete the k! from both the numerator and denominator .

this is true when k<=2^n