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.
№ | Пользователь | Рейтинг |
---|---|---|
1 | tourist | 3993 |
2 | jiangly | 3743 |
3 | orzdevinwang | 3707 |
4 | Radewoosh | 3627 |
5 | jqdai0815 | 3620 |
6 | Benq | 3564 |
7 | Kevin114514 | 3443 |
8 | ksun48 | 3434 |
9 | Rewinding | 3397 |
10 | Um_nik | 3396 |
Страны | Города | Организации | Всё → |
№ | Пользователь | Вклад |
---|---|---|
1 | cry | 167 |
2 | Um_nik | 163 |
3 | maomao90 | 162 |
3 | atcoder_official | 162 |
5 | adamant | 159 |
6 | -is-this-fft- | 158 |
7 | awoo | 155 |
8 | TheScrasse | 154 |
9 | Dominater069 | 153 |
10 | nor | 152 |
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.
Название |
---|
Click
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
While reading, I just caught this: "Since the number of glasses <=10 , this turns out to be a simple simulation problem".
So if N is pretty large, can't we use this simulation method?
well the simulation method takes a minimum of O(N*(N+1)/2) which is actually a good time if N doesn't exceed 4*10^4 approximately so No a simulation won't be preferred in the kind of a N=10^5 situation