当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。
****************************Let us assume that we want to get lines as long as the row of stars. Then, by simply inserting spaces, we would get
This is the example you are
actually considering.
****************************But this looks rather odd because of the big gap in the second line. By moving the word ``are'' from the first to the second line, we get a better result:
This is the example you are
actually considering.
****************************Of course, this has to be formalized. To do this, we assign a badness to each gap between words. The badness assigned to a gap of n spaces is (n - 1)^2. The goal of the program is to minimize the sum of all badnesses. For example, the badness of the first example is 1 + 7^2 = 50 whereas the badness of the second one is only 1 + 1 + 1 + 4 + 1 + 4 = 12.
This is the example you
are actually considering.
28 This is the example you are actually considering. 25 Writing e-mails is fun, and with this program, they even look nice. 0
This is the example you are actually considering. Writing e-mails is fun, and with this program, they even look nice.
时间上限 | 内存上限 |
1000 | 10000 |