Блог пользователя mahmoud_arafa

Автор mahmoud_arafa, история, 10 лет назад, По-английски

Hi, I hope this blog entry finds you well and you are doing fine,

I was wondering if somebody can share with us a simple tutorial for the problem above. There doesn't exist a tutorial for this round.

  • Проголосовать: нравится
  • +2
  • Проголосовать: не нравится

»
10 лет назад, скрыть # |
 
Проголосовать: нравится +5 Проголосовать: не нравится
»
10 лет назад, скрыть # |
 
Проголосовать: нравится +5 Проголосовать: не нравится

Since the number of glasses <=10 , this turns out to be a simple simulation problem. Let G[i][j] be the the champagne in jth glass of ith row,when we have processed 1->i-1 rows(note that this quantity may be greater than 1 as we have still not considered the overflow). Now you can see that the overflowing wine can fall into 2 glasses G[i+1][j] and G[i+1][j+1] . Thus the simulation can be performed using a 2-D array. You can see my solution for implementation details.

http://codeforces.me/contest/676/submission/18157256