Tutorial is loading...

Tutorial is loading...

Tutorial is loading...

Tutorial is loading...

Tutorial is loading...

Tutorial is loading...

Tutorial is loading...

Tutorial is loading...

# | User | Rating |
---|---|---|

1 | tourist | 3534 |

2 | moejy0viiiiiv | 3272 |

3 | ainta | 3174 |

4 | Petr | 3135 |

5 | LHiC | 3100 |

6 | Merkurev | 3055 |

7 | V--o_o--V | 3050 |

8 | Zlobober | 3026 |

8 | mnbvmar | 3026 |

10 | -XraY- | 3018 |

# | User | Contrib. |
---|---|---|

1 | Errichto | 175 |

2 | rng_58 | 170 |

3 | Petr | 162 |

4 | Swistakk | 153 |

5 | csacademy | 152 |

6 | GlebsHP | 147 |

7 | Zlobober | 146 |

8 | zscoder | 143 |

8 | Um_nik | 143 |

10 | PrinceOfPersia | 135 |

Tutorial is loading...

Tutorial is loading...

Tutorial is loading...

Tutorial is loading...

Tutorial is loading...

Tutorial is loading...

Tutorial is loading...

Tutorial is loading...

↑

↓

Codeforces (c) Copyright 2010-2017 Mike Mirzayanov

The only programming contests Web 2.0 platform

Server time: Mar/28/2017 22:43:36 (p1).

Desktop version, switch to mobile version.
User lists

Name |
---|

Auto comment: topic has been translated by Endagorion (original revision, translated revision, compare)Why it shows

Tutorial is not available?UPD: It's available now :)

because it's not available yet

Can anyone explain how Div2 B can be solved using Ternary Search

I have done this.

We analyze total time in relation to position, I will call it

pselected. Time of each pointxwith speedvisabs(x-p) /v. If we make p vary, asvandxare fixed we'll see an abs functionWhich is the total time? The worst of all those times. formally

max(v1,v2, ..vn). If we make drawings we can see that if we plot the total time in function to the position selected, that graphic has no local maximum, and the left and right sides tend to positive infinite. So we observe that as the function is continuous we need to have a unique local minimum somewhere in the center of the graphic (otherwise the sides can't tend both to infinity). There can't be more than one minimum, because otherwise we would need a maximum to exist and we accepted it didn't exist. The left side of the minimum must be strictly decreasing (as it comes from positive infinity), and the right side strictly increasing (as it goes to positive infinitive), and so, the graphic is something like thisNote that the left derivative is negative and the right one is positive. Which means we can make a ternary search on the point when it changes, from negative, to positive, that will be a local minimum, as the only one, the global one, hence the solution of the problem.

Evaluating the function will be

O(n), so total complexity the product ofO(n) and your number of ternary search iterations (of logarithmic behavior)25253744

for Div.2 D (Div.1 B)

get the output: NO but isn't a solution?somebody says try all ai, if there is the conflict then try all bi. if these two cases both have conflict then the answer is NO.

like submission 25322923 and try the input:

Here we don't try all b_i when there is some conflicts for a_i. But only those b_i whose corresponding a_i conflict with each other.

I know but the somebody's code doesn't seems like that.

Can someone please help me understand the editorial of problem 782B — The Meeting Place Cannot Be Changed. how to iterate for all t's and how to apply binary search.

782B can be solved without binary search. Working time is much better comparing to binary search solutions. heuristic with enumeration all pairs & O(n*log(n)) sorting + O(n) scan

in div2 E, why is it guaranteed that the tour exists? and even if it doesn't which, why is writing the nodes in that way is guaranteed to generate the answer?

edit: i understood the solution, but why is it called euler tour?

and is it me, or mentioning that traversing an edge twice is fine had to be mentioned in the statement?

would someone tell me if we can visit the same edge twice? and if so, why is it called "euler tour" in the editorial?

Yeah, we can visit the same edge twice. Suppose in the dfs ordering of nodes, we backtrack all edges (in the dfs tree) once.

-> Total edges traversed = 2*(n-1) -> If we divide into k parts, we get [2*(n-1)/k] <= [2n/k] -> We can always assign dfs (preorder) accordingly.

I have no idea why it's called Euler tour, since that means we should be visiting each edge once, and end up on the beginning node.

You should code simple recursive algorithm for Euler tour. But write vertice twice first time on visiting and another time after recursive return (on each return to the vertice). This will produce required sequence.

In div1D, what is meant by "optimizing boolean multiplication with bitsets" and how do we achieve this optimization?

Can you figure out what is wrong with my code in problem 781B (wrong in test 16)? 25333425

Same problem, can't find the mistake.

what meaning "The route is a closed polygon line in the place, with all segments parallel to one of the axes" in Intranet of Buses? help on Intranet of Buses!

I'm getting 'Tutorial is not available'.

And tutorials for some other rounds are also not available currently see this

KAN MikeMirzayanov please fix this.

Same here,what's the matter?

watch this legendary chess match while you wait

Woah

In Div1 B (football league problem) what is the mistake in my algorithm? I really don't see the bug. http://codeforces.com/contest/780/submission/25485848

can someone please find why am I getting runtime error in python2.7 in problem C div 2?

Here is my code, a big thanks in advance

in task d(div 2) test 5 aaa b aaa c aaq z aab z aab o craches lots of solutions. The result is probably YES aab,aac,aaq,aaz,aao but it isn't)