Пожалуйста, прочтите новое правило об ограничении использования AI-инструментов. ×

Help modelling Max Flow solution

Правка en1, от Goldsmith94, 2019-05-04 14:51:31

Hi Codeforces community!

I'm just reaching out to see if anyone could help me model a max flow solution. I'm preparing for Code Jam Round 2, and was looking at Round 2 2017 problem B (https://code.google.com/codejam/contest/5314486/dashboard#s=p1). And while I'm aware that it's not the large test case solution, for educational purposes it caught my eye in the editorial that this problem could be modelled and solved with max flow for the small test case bounds. I've been struggling with it for a while, max flow is also pretty new to me, I can easily model a graph that would implement the restriction of each ticket only being used once, or each customer only taking a single seat on each ride, but I can't seem to model a graph that takes both into account.

Also I'm assuming the solution would use binary search right? Or is there a way to maybe assign costs to the solution so that a max flow min cost algorithm could also minimize the amount of rides needed?

Thank you in advance!

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский Goldsmith94 2019-05-04 14:51:31 1030 Initial revision (published)