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 celebrates 10 years! We are pleased to announce the crowdfunding-campaign. Congratulate us by the link https://codeforces.com/10years.
×

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

1 | MiFaFaOvO | 3681 |

2 | tourist | 3404 |

3 | TLE | 3356 |

4 | apiadu | 3351 |

5 | mnbvmar | 3281 |

6 | LHiC | 3276 |

7 | Um_nik | 3268 |

8 | 300iq | 3267 |

9 | yosupo | 3249 |

10 | ainta | 3226 |

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

1 | Errichto | 190 |

2 | antontrygubO_o | 186 |

3 | tourist | 182 |

4 | Radewoosh | 168 |

5 | vovuh | 167 |

6 | pikmike | 166 |

7 | ko_osaga | 161 |

8 | Um_nik | 160 |

9 | Petr | 154 |

10 | McDic | 153 |

Tutorial is loading...

Tutorial is loading...

Tutorial is loading...

Tutorial is loading...

Tutorial is loading...

Tutorial is loading...

Tutorial is loading...

Tutorial is loading...

Tutorial of Technocup 2017 - Elimination Round 2

Tutorial of W8 main contest

↑

↓

Codeforces (c) Copyright 2010-2020 Mike Mirzayanov

The only programming contests Web 2.0 platform

Server time: Feb/22/2020 14:04:28 (f2).

Desktop version, switch to mobile version.

Supported by

User lists

Name |
---|

"Will be translated soon": Waiting for translation...

should be inside the maximum function.

Similarly, for zhenya.

Sure, fixed. Thanks!

Any idea why my submission for 729C http://codeforces.com/contest/737/submission/22410492 is exceeding time limit (on test #9). Please help to check.

Have you tried fast I/O?

yup, that's indeed the problem. Keep forgetting about that :( Thanks )

Can someone please suggest some reading materials for learning graph matching? =)

Can someone give a good explanation for the problem Div2 D?

For problem C, I do not understand the following statement:

if x ≤ f, then it is possible to ride in the fast mode min(x, f - x) kilometers.

How did you obtain the expression min(x,f-x) kilometers?

Let the number of km in fast mode be k. Then the number of km in slow mode in x — k. So, we have the equation: Fuel used = 2*k + (x — k) <= f -> k + x <= f. Therefore, k <= f — x. Also, k <= x because we stop when we reach the next station. Therefore, k = min(x, f-x).

For problem E, why is 3 the answer for the following test case:

9 1 0 1 1 1 1 1 6 7 8

Clearly, workers at index 2 to 5 are wrong because they should have 2,3,4 and 5 superiors respectively. I must be misunderstanding something. Could anyone please help to clarify?

I had some trouble understanding Div2 D solution, so I'll explain it in more details.

The solution is actually an application of the pigeonhole principle.

Let

sbe the maximum number of positions where you can place a ship (of course, already considering thosekmisses of the input). The trick: reduce the problem to its complement! In other words: what is the maximum number of misses we can still make? The answer:m=s-a. If we shootmship slots once, an additional shot will hit some slot a second time (by the pigeonhole principle), or will hit a ship. So if we choosem+ 1 distinct ship slots to be shot once, at least one of the shots will hit a ship.In Financiers Game, shouldn't the "difference between the sum" mean the absolute value of the differences?