Tutorial is loading...

Tutorial is loading...

Tutorial is loading...

Tutorial is loading...

Tutorial is loading...

Tutorial is loading...

Before contest

Codeforces Round #680 (Div. 1, based on Moscow Team Olympiad)

21:42:54

Register now »

Codeforces Round #680 (Div. 1, based on Moscow Team Olympiad)

21:42:54

Register now »

*has extra registration

Before contest

Codeforces Round #680 (Div. 2, based on Moscow Team Olympiad)

21:42:54

Register now »

Codeforces Round #680 (Div. 2, based on Moscow Team Olympiad)

21:42:54

Register now »

*has extra registration

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

1 | tourist | 3619 |

2 | Um_nik | 3493 |

3 | ecnerwala | 3446 |

4 | Radewoosh | 3383 |

5 | ksun48 | 3357 |

6 | yosupo | 3324 |

7 | Benq | 3299 |

8 | maroonrk | 3243 |

9 | apiadu | 3238 |

10 | Petr | 3217 |

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

1 | Errichto | 207 |

2 | Monogon | 196 |

3 | SecondThread | 195 |

4 | vovuh | 188 |

5 | pikmike | 186 |

6 | Um_nik | 185 |

6 | antontrygubO_o | 185 |

8 | Ashishgup | 182 |

9 | pashka | 169 |

10 | Radewoosh | 167 |

Tutorial is loading...

Tutorial is loading...

Tutorial is loading...

Tutorial is loading...

Tutorial is loading...

Tutorial is loading...

↑

↓

Codeforces (c) Copyright 2010-2020 Mike Mirzayanov

The only programming contests Web 2.0 platform

Server time: Oct/31/2020 16:22:06 (h3).

Desktop version, switch to mobile version.

Supported by

User lists

Name |
---|

First of all, I didn't even come to know when this editorial came.

In D, there was the constraint "Each person needs S or M, M or L, L or XL" and so on.

I was wondering how to solve D

if this constraint is removed. I was trying to maintain what all people are left with just a SINGLE choice, so I have no option but to give them the t-shirt of their choice, and on doing so, find new people that are left with single choice.Ofcourse, this can stop mid-way, and we would be left with people having exactly two choices. But I couldn't analyse how to proceed ahead. My failed attempt

You can just build a network and run max flow on it and it will pass since the graph is special.

That's cool. Then I guess this problem from last contest is also basically the same but with cost assigned to each edge.(MinCostMaxFLow) I am new to the concept of max flow, but let me know whether I am thinking correct or not. Also can you share some AC codes on CF/CC where you used MaxFlow and MinCostMaxFlow because I am not able to find a good template for them.

Try this.My solution 17710740.

Your implementation is not the fastest right? So instead of adjacency matrix, i should implement it with vectors and that would be the best code in terms of time complexity?

Can you please explain what do u mean by the graph is special and how will it pass using max flow algorithms?

How to solve Problem E using rolling Hash for strings.

Link