Invitation to CodeChef July Long Challenge 2018!

Arbitrary order

1 Like

nice man :smiley:

its not allowed acc to discuss rules…

Real numbers. Refer to @mgch comment above.

Including zero?(that’s my main concern)

Non-negative includes 0 by default rules.

1 Like

cout << endl;
works for c++… use it whenever u wanna flush…

1 Like

Finally passed all test cases! Weird thing one of the first thing I tried days ago helped me. At that I didn’t use it because it was taking forever in my local pc, but here codechef dealed with quickly:)

strange…

remove your duplicate answers now… as u got attention and reply…

Didn’t have time to implement it, but I guess you can model it it as a graph. If a odd-length cycle exists in a component, then the whole component is “blocked”. Otherwise, for any two gears X and Y, you can find the speed of Y given X… the intermediate gears are quite irrelevant.

Gears? Its a straightforwad DSU - refer here https://cp-algorithms.com/data_structures/disjoint_set_union.html#toc-tgt-11

1 Like

Thanks a lot ! I never solved many problems with DSU…just basic ones, i was not aware of it, will have a look at it.

HERE is my code…
Its neat…
DSU (without path compression (u ll understand why if u go with my logic of bool invert))
Hint: assign 0 or 1 sign to each node (for detecting cycle and for detecting sign of rotating)…

Thank you!! will refer it :slight_smile:

yes it is possible to solve in python, I passed mine in just 0.24 seconds.
You can have a look at it from searching my name on the leaderboard

Thats coz they arent uploaded yet. Editorialist is still writing them.

long challenge lasts for 10 days… do codechef hide solutions from editorialist till contest gets ended ? If no , why not still editorialist was able to complete them !!!

Ask that from editorialist himself @l_returns xD. No, he gets all solutions and setter’s explanation.

Sorry guys! It was my fault, Didn’t read the question properly.