Tutorial is loading...

Tutorial is loading...

Tutorial is loading...

Tutorial is loading...

Tutorial is loading...

Tutorial is loading...

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

1 | tourist | 3509 |

2 | OO0OOO00O0OOO0O0…O | 3327 |

3 | Um_nik | 3297 |

4 | Syloviaely | 3274 |

5 | LHiC | 3216 |

6 | Petr | 3161 |

7 | Benq | 3130 |

8 | ko_osaga | 3124 |

9 | Swistakk | 3089 |

10 | dotorya | 3060 |

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

1 | Radewoosh | 185 |

2 | rng_58 | 161 |

3 | tourist | 158 |

4 | Petr | 152 |

5 | Swistakk | 150 |

5 | Vovuh | 150 |

7 | csacademy | 147 |

8 | PikMike | 146 |

9 | Errichto | 145 |

9 | Um_nik | 145 |

Tutorial is loading...

Tutorial is loading...

Tutorial is loading...

Tutorial is loading...

Tutorial is loading...

Tutorial is loading...

Tutorial of Codeforces Round #377 (Div. 2)

↑

↓

Codeforces (c) Copyright 2010-2018 Mike Mirzayanov

The only programming contests Web 2.0 platform

Server time: Sep/21/2018 09:59:36 (f1).

Desktop version, switch to mobile version.

User lists

Name |
---|

Auto comment: topic has been translated by dans (original revision, translated revision, compare)I think I used a simpler method for C, this is the observation:

Let M be the maximum of {b, d, s}; then the other 2 would be in the best case M — 1. So if b is the maximum, then (d >= b — 1 and s >= b — 1) always holds true.

This is the code: http://codeforces.com/contest/732/submission/21550209

"So if b is the maximum, then (d >= b — 1 and s >= b — 1)

alwaysholds true."In case {

b= 6,d= 3,s= 3} your statement is wrong. In that casebis maximum, butd<b- 1 ands<b- 1. Or did I miss something?No, I'm talking about the ideal situation.

Lets say b = 6, d = 3 and s = 3. Then Vasiliy has 6 breakfasts, and the minimum number of dinners and lunches he would have had is either 5 or 6. In no situation can it be lesser. We want to find the minimum, so our answer would be (5 — 3) + (5 — 3). (Where 5 is the minimum d we could have, and 3 is the d given to us in the problem statement)

managed to do a-e but, i need to read tutorials on problem F , im still a bit confused, can someone explain , what is :

thanks for your help :)

just google it

can someone explain last line for f. with example? why orient (v,to) to (to,v)?

Just think about it, if you are pointing from v→to, you are leaving the largest cycle pointing outwards.

ok understood it. That really made the whole question. Thanks bro.

Hi, I'm not understanding why my submission is getting TLE for Div2 F. can anyone please check it? Here's my submission, 21830666 I have implemented it exactly as given in the tutorial.

In Problem B, test-10:

Obviously my answer is better?

"

Write a program that will find the minumum number of additional walks"I am pretty sure it is not obvious that 4 < 3.

Oh no, I am very sorry. I mixed up

`Answer`

and`Output`

.Div2D Exams

Consider the following test case

The following AC submission gives the answer as 9. I would like to know how is the answer 9 correct. Since subject 3 requires 4 days of preparation, which clearly isn't possible, shouldn't the answer be -1 ?

It was mentioned that the test cases are flawed and some wrong solutions managed to get an AC.

Why is complexity for Problem D O(mlogn)? For each guess, we want to take the subject at the latest possible day right? So we will need to perform a linear scan on the exam days so that we can find the latest day for each subject. So that should be O(nlogn) right? Is anyone able to confirm this?

Did you find an answer for this?

can someone provide an explanation on why is the mentioned strategy of orienting edges in problem F optimal? i.e. why does it allow us to traverse from any vertex to any other vertex in an 'edge' connected component?

Test cases for D are very trivial. All of them pass through wrong solution also.

Can anyone provide proof of correctness for problem F ? I am not sure whether the solution in tutorial is correct