亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? judges' comments on the problems and their solutions.htm

?? Ulm大學2003-2004年競賽題
?? HTM
?? 第 1 頁 / 共 2 頁
字號:
remaining longer part has already been computed. For efficiency, the matching 
test for the two parts is accelerated by precomputation. 
<P>Judges' test data was the same as the test data for problem E: Edge. 
<P><U>Rating: Medium</U> 
<P><B>Problem G: Genetic Code</B> 
<P>While lake Vostok exists as described in the problem statement, the 
three-base genome construction is fiction. 
<P>Observe that any subsegment of a Thue-sequence is itself a Thue-sequence. 
Therefore, it suffices to calculate the longest required sequence once, and 
answer all queries by taking, e.g., prefixes of that sequence. Such a sequence 
can even be precalculated and stored in the submitted source code. 
<P>Thue proved the existence of an infinitely long Thue-sequence, so the case of 
no genomes never arises. There is even a linear time method to construct such a 
sequence by repeatedly, simultaneously replacing characters by certain strings. 
Such a solution is not required for <I>n&lt;=5000</I>, where a backtracking 
approach is adequate. Note, however, that the testing condition for backtracking 
must not be too inefficient. 
<P>If a sequence <I>s</I> is a Thue-sequence, then appending a character 
<I>c</I> gives a Thue-sequence <I>sc</I> iff there is no suffix of <I>sc</I> 
that is a square word. A square word is the concatenation of two identical 
words. Therefore, Thue-sequences are also called square-free sequences. Testing 
the suffixes requires quadratic time in the length of the sequence and is 
efficient enough. Asymptotically even more efficient testing in linear time in 
the sequence length can be performed by dynamically constructing and modifying 
suffix-trees. 
<P>Judges' test data consisted of 198 test cases including 
<I>1&lt;=n&lt;=100</I> and <I>n=100,200,300,...,5000</I>. 
<P><U>Rating: Medium</U> 
<P><U>Reference</U> 
<BLOCKQUOTE>Hehner, E.C.R <BR><I>The Logic of Programming</I> <BR>Chapter 9.3, 
  p. 256, Exercise 10, Prentice Hall International, Inc., 1984 <BR><I>ISBN 
  0-13-539966-1</I> </BLOCKQUOTE>
<P><B>Problem H: Largest Rectangle in a Histogram</B> 
<P>Note that the area of the largest rectangle may exceed the largest 32-bit 
integer. Due to the large numbers of rectangles, the naive 
<I>O(n<SUP>2</SUP>)</I> solution is too slow. Even though <I>O(n*log(n))</I> or 
<I>O(n)</I> is required, there are several kinds of solutions to this problem. 
In the following, we will identify a histogram with the sequence of the heights 
of its rectangles. 
<P>
<OL>
  <LI>Divide-and-conquer using order-statistic trees. <BR>Initially, build a 
  binary, node- and leaf-labeled tree that contains the histogram as its 
  frontier, i.e., as its leaves from left to right. Mark each inner node with 
  the minimum of the labels of its subtree. Note that such a tree is most 
  efficiently stored in an array using the heap data structure, where the 
  children of node <I>i</I> are located at positions <I>i*2</I> and 
  <I>i*2+1</I>, respectively. With such an order-statistic tree, the minimum 
  element in a subhistogram (i.e., a subsegment of the sequence of heights) can 
  be found in <I>O(log(n))</I> steps by using the additional information in the 
  inner nodes to avoid searching all leaves. <BR>To calculate the maximum 
  rectangle unter a subhistogram, we thus find the minimum height in that 
  subhistogram, and divide it at just that place into two smaller histograms. 
  The maximum rectangle is either completely in the left part, or completely in 
  the right part, or it contains the rectangle with minimum height. The first 
  two cases are solved recursively, while in the third case we know that the 
  width of the maximum rectangle is the width of the whole subhistogram, since 
  we chose the minimum height. Because every element serves exactly once as a 
  place to divide, and we spend <I>O(log(n))</I> for every division, the 
  complexity of this algorithm is <I>O(n*log(n))</I>. 
  <LI>Linear search using order-statistic trees. <BR>Initially, construct an 
  order-statistic tree as just described. For every element, we find the largest 
  rectangle that includes that element. The height of the rectangle is, of 
  course, the value of the element. Use the order-statistic tree to efficiently 
  find the nearest elements that have smaller heights, both to the left and to 
  the right. The width, and therefore the area of the rectangle can thus be 
  calculated in <I>O(log(n))</I> steps, giving a total runtime of 
  <I>O(n*log(n))</I>. 
  <LI>Sweeping line maintaining intervals. <BR>Initially, sort the heights so 
  they can be processed in non-increasing order. We sweep a horizontal line 
  downwards through the histogram, maintaining a list of those intervals, where 
  the line intersects the histogram. Actually, the intervals are maintained in 
  an array with one entry for every element of the histogram in the following 
  manner. At the element corresponding to the left end of an interval we store a 
  pointer to the right end, and vice versa. <BR>As a new element arrives during 
  the sweeping process, this element forms a new interval, and, if there are 
  adjacent intervals, these can be merged in constant time using our 
  representation. The largest rectangle including this element, just as 
  described in the previous algorithm, is available without further expense, 
  since we can read its width from our representation. Actually, it is not quite 
  the largest rectangle, because there may be further elements with equal 
  heights adjacent to the current interval. Performing the sweep in a 
  non-increasing order, however, guarantees that the largest rectangle will have 
  been considered by the time the last element of a group having equal heights 
  is examined. The complexity is dominated by the sorting phase, thus 
  <I>O(n*log(n))</I>, although a radix sort is possible if the heights are 
  bounded. 
  <LI>Linear search using a stack of incomplete subproblems <BR>We process the 
  elements in left-to-right order and maintain a stack of information about 
  started but yet unfinished subhistograms. Whenever a new element arrives it is 
  subjected to the following rules. If the stack is empty we open a new 
  subproblem by pushing the element onto the stack. Otherwise we compare it to 
  the element on top of the stack. If the new one is greater we again push it. 
  If the new one is equal we skip it. In all these cases, we continue with the 
  next new element. <BR>If the new one is less, we finish the topmost subproblem 
  by updating the maximum area w.r.t. the element at the top of the stack. Then, 
  we discard the element at the top, and repeat the procedure keeping the 
  current new element. This way, all subproblems are finished until the stack 
  becomes empty, or its top element is less than or equal to the new element, 
  leading to the actions described above. If all elements have been processed, 
  and the stack is not yet empty, we finish the remaining subproblems by 
  updating the maximum area w.r.t. to the elements at the top. <BR>For the 
  update w.r.t. an element, we find the largest rectangle that includes that 
  element. Observe that an update of the maximum area is carried out for all 
  elements except for those skipped. If an element is skipped, however, it has 
  the same largest rectangle as the element on top of the stack at that time 
  that will be updated later. <BR>The height of the largest rectangle is, of 
  course, the value of the element. At the time of the update, we know how far 
  the largest rectangle extends to the right of the element, because then, for 
  the first time, a new element with smaller height arrived. The information, 
  how far the largest rectangle extends to the left of the element, is available 
  if we store it on the stack, too. <BR>We therefore revise the procedure 
  described above. If a new element is pushed immediately, either because the 
  stack is empty or it is greater than the top element of the stack, the largest 
  rectangle containing it extends to the left no farther than the current 
  element. If it is pushed after several elements have been popped off the 
  stack, because it is less than these elements, the largest rectangle 
  containing it extends to the left as far as that of the most recently popped 
  element. <BR>Every element is pushed and popped at most once and in every step 
  of the procedure at least one element is pushed or popped. Since the amount of 
  work for the decisions and the update is constant, the complexity of the 
  algorithm is <I>O(n)</I> by amortized analysis. 
  <LI>Recursive search <BR>For a recursive version of the algorithm just 
  described, see the reference below. Indeed, if the recursion is eliminated the 
  necessary stack is analogous to the explicit stack in the iterative version. 
  <LI>Rewrite System <BR>The problem may be generalized by allowing histograms 
  to be composed of rectangles with varying widths. Then, the stack used in the 
  just described algorithms can be concatenated with the yet unprocessed part of 
  the histogram into one list. <BR>A three element window is moved over this 
  list, starting at the left end. In every step, different actions are performed 
  according to the relative heights of the three elements under inspection. The 
  actions include updating the maximum, merging two of the three elements by 
  taking the minimum of their heights and the sum of their widths, and sliding 
  the window one element to the left or to the right. Rules are provided that 
  specify the actions for each configuration. <BR>Actually, the behaviour of the 
  stack-based algorithm is simulated. The correctness of the rewrite system can 
  be shown by proving an invariant about the maximum area of the histogram, 
  observing that every configuration is matched by some rule, and giving a 
  termination proof using a variant expression. Additionally, it can be proved 
  that <I>O(n)</I> rewrite steps (each with a constant amount of work) are 
  performed. </LI></OL>
<P>Judges' test data consisted of 32 hand-crafted test cases, 33 randomly 
generated test cases, and one test case with a histogram of width 99998. 
<P><U>Rating: Hard</U> 
<P><U>Reference</U> 
<BLOCKQUOTE>Morgan, C. <BR><I>Programming from Specifications</I> <BR>Chapter 
  21, pages 209-216, Prentice Hall International (UK) Limited, second edition, 
  1994 <BR><I>ISBN 0-13-123274-6</I> </BLOCKQUOTE></BODY></HTML>

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久影院午夜论| 欧美电影免费观看高清完整版在| 久久疯狂做爰流白浆xx| 一区二区三区电影在线播| 综合网在线视频| 亚洲欧美日韩一区| 亚洲欧美综合在线精品| 中文字幕永久在线不卡| 亚洲三级在线观看| 亚洲成av人片一区二区| 日日摸夜夜添夜夜添国产精品| 亚洲成人免费看| 免费不卡在线观看| 国产毛片一区二区| 99精品视频在线观看| 99久久婷婷国产综合精品电影| 91免费看片在线观看| 91精品1区2区| 在线成人av网站| 精品国产一区二区三区不卡| www国产精品av| 亚洲视频小说图片| 亚洲va国产va欧美va观看| 奇米在线7777在线精品| 国产91丝袜在线播放九色| 99re这里都是精品| 欧美老肥妇做.爰bbww| 欧美www视频| 中文字幕综合网| 美国十次了思思久久精品导航| 国产成人免费网站| 欧美日韩国产大片| 国产欧美日韩在线看| 一区二区三区在线免费视频| 久久成人免费网| 色又黄又爽网站www久久| 6080国产精品一区二区| 欧美国产精品一区二区三区| 亚洲综合在线视频| 国产一区二区三区综合| 欧美图区在线视频| 国产精品伦一区二区三级视频| 亚洲国产另类av| 成年人网站91| 日韩精品中文字幕一区二区三区 | 日本久久一区二区| 日韩欧美一区二区久久婷婷| 亚洲精品第1页| 国产成人丝袜美腿| 日韩欧美国产小视频| 亚洲乱码国产乱码精品精98午夜| 蜜臀va亚洲va欧美va天堂| 91在线porny国产在线看| 亚洲精品在线三区| 丝袜诱惑亚洲看片| 91免费看`日韩一区二区| 精品少妇一区二区三区日产乱码| 亚洲图片自拍偷拍| 91视频.com| 国产精品久久久一区麻豆最新章节| 日韩不卡手机在线v区| 日本精品视频一区二区三区| 欧美激情一区二区三区| 国产一区二区三区免费看| 日韩视频免费观看高清完整版在线观看 | 免费在线观看不卡| 欧美性xxxxxx少妇| 亚洲精品免费在线播放| 不卡影院免费观看| 国产精品久久看| av在线一区二区| 中日韩av电影| 丁香天五香天堂综合| 久久久久久久久久看片| 韩国欧美国产1区| 欧美成人一区二区三区片免费| 图片区日韩欧美亚洲| 欧美理论电影在线| 久久精品久久99精品久久| 欧美日韩国产精选| 免费精品99久久国产综合精品| 日韩美女在线视频| 久久精品国产在热久久| 精品久久久久av影院| 国产一区二区伦理| 欧美国产日产图区| 99这里都是精品| 亚洲福利视频一区二区| 日韩一级二级三级精品视频| 亚洲va中文字幕| 欧美另类videos死尸| 美女一区二区视频| 国产精品天美传媒沈樵| 99精品视频一区| 亚洲va天堂va国产va久| 精品久久一区二区三区| 成人97人人超碰人人99| 亚洲综合在线视频| 精品少妇一区二区三区视频免付费 | 亚洲无人区一区| 日韩片之四级片| 成人午夜大片免费观看| 亚洲欧洲制服丝袜| 日韩欧美国产三级| av在线不卡观看免费观看| 一区二区三区四区蜜桃| 欧美一区午夜视频在线观看| 国产成人午夜精品影院观看视频| 中文字幕中文字幕一区二区| 欧美精品在线一区二区三区| 国产在线视视频有精品| 亚洲人精品午夜| 精品国产免费久久| 欧洲一区在线观看| 国产麻豆一精品一av一免费| 亚洲男女毛片无遮挡| 日韩一级黄色片| 91黄色免费看| 韩国视频一区二区| 亚洲成人一区二区在线观看| 国产欧美精品一区二区色综合| 欧美亚洲日本国产| 成人一级视频在线观看| 日韩国产欧美三级| 一区二区三区欧美亚洲| 26uuu色噜噜精品一区二区| 91福利视频久久久久| 粉嫩在线一区二区三区视频| 日本一不卡视频| 一级特黄大欧美久久久| 中文字幕在线观看一区二区| 久久亚洲精品国产精品紫薇| 久久天天做天天爱综合色| 欧美美女一区二区三区| 精品999在线播放| 一区二区三区高清不卡| 国产拍欧美日韩视频二区| 国产高清精品网站| 男女男精品视频| 国产69精品久久99不卡| 99视频有精品| 欧美精选一区二区| 久久久国产一区二区三区四区小说| 国产日韩精品一区二区三区| 国产精品理伦片| 亚洲国产精品尤物yw在线观看| 免费国产亚洲视频| 99久久99久久精品免费观看| 欧美无砖专区一中文字| 久久欧美一区二区| 亚洲人快播电影网| 激情小说欧美图片| 一本大道久久a久久精二百| 91精品国产综合久久久久久漫画| 国产午夜精品美女毛片视频| 一区二区三区不卡视频| 国产精品综合久久| 欧美日韩免费电影| 欧美韩国日本不卡| 日韩黄色在线观看| 97精品超碰一区二区三区| 日韩一区二区三区观看| 亚洲欧美偷拍另类a∨色屁股| 青青青爽久久午夜综合久久午夜| 成人在线视频首页| 5月丁香婷婷综合| 亚洲色图.com| 国产精品影视在线观看| 91精品国产高清一区二区三区蜜臀| 国产欧美久久久精品影院| 免费成人在线网站| 欧美日韩色一区| 亚洲欧美在线高清| 国产高清不卡一区二区| 91精品国产入口| 亚洲综合激情另类小说区| 99视频在线精品| 欧美激情一区二区三区蜜桃视频| 麻豆精品在线视频| 欧美日韩久久不卡| 一区二区三区在线观看国产| 国产成人鲁色资源国产91色综| 欧美大片一区二区三区| 午夜免费欧美电影| 色欧美88888久久久久久影院| 国产喷白浆一区二区三区| 精品亚洲欧美一区| 91精品国产aⅴ一区二区| 亚洲最新在线观看| 在线观看国产91| 亚洲地区一二三色| 欧美影视一区二区三区| 亚洲午夜国产一区99re久久| 色天天综合色天天久久| 亚洲乱码日产精品bd| 91天堂素人约啪| 一区二区三区自拍| 欧美日韩一区二区在线观看| 亚洲成人免费av| 91精品国产综合久久国产大片|