文件名称:yingwenpaiban

  • 所属分类:
  • Windows编程
  • 资源属性:
  • 上传时间:
  • 2015-07-09
  • 文件大小:
  • 22kb
  • 下载次数:
  • 0次
  • 提 供 者:
  • we***
  • 相关连接:
  • 下载说明:
  • 别用迅雷下载,失败请重下,重下不扣分!

介绍说明--下载内容均来自于网络,请自行研究使用

给定一篇包含 N 个单词的诗,每个单词的物理长度依次为 a[0],a[1],...,a[N-1]。欲将诗分成两个段落,每个段落至少有一个单词,每个段落的排版应遵循以下规则:



每行可容纳的总字符数为 M;

每个单词必须在同一行,不得断开换行;

同一行的每两个单词之间有且仅有一个空格,不考虑其他标点符号;

采用左对齐的方式排版,即每行的第一个单词排在该行最左侧;

假设排版之后共有 m 行,每行末端没有英文单词的空档长度记作 s[0],s[1],...,s[m-1]。

不考虑最后一行的空挡大小 s[m-1],设计尽可能高效的算法给文章排版,使得P=s[0]*s[0]+s[1]*s[1]+...+s[m-2]*s[m-2]最小。当 m=1 时, P 等于 0。



假设第一段的最优的 P 值为 P1,第二段的最优的 P 值为 P2,要求令 P1+P2 最小。-Poetry given an N-word contains the physical length of each word in the order of a [0], a [1], ..., a [N-1]. Wishing poem divided into two paragraphs, each have at least one word, each paragraph layout should follow the following rules:



The total number of characters per line that can be accommodated M

Each word must be on the same line, not disconnect wrap

There is only one space, without considering other punctuation between each word the same line

Left-aligned fashion layout, which is the first word of each line in the left-most row of the line

After publishing assume there are m rows, each end of the gap length no English word denoted as s [0], s [1], ..., s [m-1].

The last line is not considered neutral size s [m-1], the design as efficient algorithms to article layout, so P = s [0]* s [0]+ s [1]* s [1]+ ...+ s [m-2]* s [m-2] is minimized. When m = 1, P-equal to zero.



Assume that the first paragraph of the best P value of P1, the second paragraph of the best P value
(系统自动生成,下载前可以参看下载内容)

下载文件列表





英文排版.docx

相关说明

  • 本站资源为会员上传分享交流与学习,如有侵犯您的权益,请联系我们删除.
  • 本站是交换下载平台,提供交流渠道,下载内容来自于网络,除下载问题外,其它问题请自行百度更多...
  • 请直接用浏览器下载本站内容,不要使用迅雷之类的下载软件,用WinRAR最新版进行解压.
  • 如果您发现内容无法下载,请稍后再次尝试;或者到消费记录里找到下载记录反馈给我们.
  • 下载后发现下载的内容跟说明不相乎,请到消费记录里找到下载记录反馈给我们,经确认后退回积分.
  • 如下载前有疑问,可以通过点击"提供者"的名字,查看对方的联系方式,联系对方咨询.

相关评论

暂无评论内容.

发表评论

*主  题:
*内  容:
*验 证 码:

源码中国 www.ymcn.org