﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>IT博客-我爱南瓜</title><link>http://www.cnitblog.com/pumpkin/</link><description>I love my little pumpkin</description><language>zh-cn</language><lastBuildDate>Mon, 04 May 2026 22:26:11 GMT</lastBuildDate><pubDate>Mon, 04 May 2026 22:26:11 GMT</pubDate><ttl>60</ttl><item><title>UML学习笔记（2）</title><link>http://www.cnitblog.com/pumpkin/archive/2005/08/05/1324.html</link><dc:creator>pumpkin</dc:creator><author>pumpkin</author><pubDate>Fri, 05 Aug 2005 03:26:00 GMT</pubDate><guid>http://www.cnitblog.com/pumpkin/archive/2005/08/05/1324.html</guid><wfw:comment>http://www.cnitblog.com/pumpkin/comments/1324.html</wfw:comment><comments>http://www.cnitblog.com/pumpkin/archive/2005/08/05/1324.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/pumpkin/comments/commentRss/1324.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/pumpkin/services/trackbacks/1324.html</trackback:ping><description><![CDATA[<FONT size=2><STRONG>过程分类</STRONG><BR>软件过程模型总体上分为迭代模型和瀑布模型。<BR><BR><STRONG>敏捷过程模型（Agile Process）</STRONG><BR><BR><BR><BR></FONT><FONT size=2><STRONG>Rational Unified Process<BR><BR><BR><BR>UML在软件过程中的应用</STRONG><BR><EM><U>需求分析</U></EM><BR><BR><EM>用例</EM>，描述人和系统的交互过程。<BR><EM>概念视图的类图</EM>，建立严格的词汇表。<BR><EM>活动图</EM>，用来显示组织的工作流程以及人和系统的交互。活动图还可用以表示用例的上下文以及复杂用例的细节情况。<BR><EM>状态图，</EM>描述某一概念的生命周期内的状态转换。</FONT><BR><BR><FONT size=2><EM><U>设计</U></EM><BR><EM>软件视图的类图</EM>，描述软件中的类以及类之间的关系。<BR><EM>描述公共场景的序列图</EM>，最有价值的做法是从用例中挑选出最重要的的场景，用CRC Cards或者序列图发生的事件。</FONT><img src ="http://www.cnitblog.com/pumpkin/aggbug/1324.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/pumpkin/" target="_blank">pumpkin</a> 2005-08-05 11:26 <a href="http://www.cnitblog.com/pumpkin/archive/2005/08/05/1324.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>UML学习笔记（1）</title><link>http://www.cnitblog.com/pumpkin/archive/2005/08/05/1323.html</link><dc:creator>pumpkin</dc:creator><author>pumpkin</author><pubDate>Fri, 05 Aug 2005 02:35:00 GMT</pubDate><guid>http://www.cnitblog.com/pumpkin/archive/2005/08/05/1323.html</guid><wfw:comment>http://www.cnitblog.com/pumpkin/comments/1323.html</wfw:comment><comments>http://www.cnitblog.com/pumpkin/archive/2005/08/05/1323.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/pumpkin/comments/commentRss/1323.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/pumpkin/services/trackbacks/1323.html</trackback:ping><description><![CDATA[<FONT size=2><STRONG>什么是UML</STRONG><BR>UML是Unified Modeling Language的缩写，中文名为统一建模语言，它由一系列的图形符号构成，依靠单一元模型的支持，帮助人们描述和设计软件系统，尤其是面向对象风格的软件系统。虽然定义简单，UML在不同人眼里有着不同的用途。<BR><BR><STRONG>UML用途</STRONG><BR>人们使用UML的三个模型分别是：草图（Sketch），蓝图（Blueprint），编程语言（Programming Language）。在以上任何一个模型中，又分为在正向工程（Forward Engineering）和反向工程（Reverse Engineering）中使用。<BR><BR><STRONG>符号和元模型</STRONG><BR>符号（Notation）即我们在模型中看到的图形标记，它是建模语言的图形语法。元模型则定义了语言的语义。<BR><BR>
<DIV style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 0.5pt solid; PADDING-LEFT: 5.4pt; BACKGROUND: #e6e6e6; PADDING-BOTTOM: 4px; BORDER-LEFT: windowtext 0.5pt solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: windowtext 0.5pt solid">
<DIV><IMG src="http://www.cnitblog.com/images/OutliningIndicators/None.gif" align=top><SPAN style="COLOR: #000000">　　<FONT size=1>作为一种建模语言，UML的定义包括UML语义和UML表示法两个部分。&nbsp;<BR><IMG src="http://www.cnitblog.com/images/OutliningIndicators/None.gif" align=top><BR><IMG src="http://www.cnitblog.com/images/OutliningIndicators/None.gif" align=top>　　(</FONT></SPAN><SPAN style="COLOR: #000000"><FONT size=1>1</FONT></SPAN><FONT size=1><SPAN style="COLOR: #000000">)&nbsp;UML语义&nbsp;描述基于UML的精确元模型定义。元模型为UML的所有元素在语法和语义上提供了简单、一致、通用的定义性说明，使开发者能在语义上取得一致，消除了因人而异的最佳表达方法所造成的影响。此外UML还支持对元模型的扩展定义。&nbsp;<BR><IMG src="http://www.cnitblog.com/images/OutliningIndicators/None.gif" align=top><BR><IMG src="http://www.cnitblog.com/images/OutliningIndicators/None.gif" align=top>　　(</SPAN><SPAN style="COLOR: #000000">2</SPAN><SPAN style="COLOR: #000000">)&nbsp;UML表示法&nbsp;定义UML符号的表示法，为开发者或开发工具使用这些图形符号和文本语法为系统建模提供了标准。这些图形符号和文字所表达的是应用级的模型，在语义上它是UML元模型的实例。&nbsp;</SPAN></FONT></DIV></DIV></FONT><BR><FONT size=2><STRONG>UML图的分类<BR></STRONG>UML图可分为结构图和行为图两大类。结构图如类图、组建图、对象图、组织结构图、<SPAN style="FONT-FAMILY: 宋体">分布图</SPAN>、包图。行为图如活动图、用例图、状态机图和交互图。交互图又分为序列图、交互总揽图、交流图和定时图。</FONT><BR><img src ="http://www.cnitblog.com/pumpkin/aggbug/1323.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/pumpkin/" target="_blank">pumpkin</a> 2005-08-05 10:35 <a href="http://www.cnitblog.com/pumpkin/archive/2005/08/05/1323.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>zoj-1319-Black box</title><link>http://www.cnitblog.com/pumpkin/archive/2005/08/03/1283.html</link><dc:creator>pumpkin</dc:creator><author>pumpkin</author><pubDate>Wed, 03 Aug 2005 12:51:00 GMT</pubDate><guid>http://www.cnitblog.com/pumpkin/archive/2005/08/03/1283.html</guid><wfw:comment>http://www.cnitblog.com/pumpkin/comments/1283.html</wfw:comment><comments>http://www.cnitblog.com/pumpkin/archive/2005/08/03/1283.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/pumpkin/comments/commentRss/1283.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/pumpkin/services/trackbacks/1283.html</trackback:ping><description><![CDATA[<FONT size=2>
<P>唉，没有《金牌之路》就是不爽，这道题目又说是那本书上有的，好像要用到max heap和min heap。<BR>Any way, I can use my own way now.<BR>把box的内容按照输入的顺序存放到array中。我们看到u(N)就是GET操作，相当于在array的前u(N) 个元素中找i-minimum元素。如果array的前u(N)个元素按递增排序好了，那么只要取array[i]就行了。<BR>现在的关键是提高排序的速度。假设u(k)的时候，array[0] .... array[u(k)-1]已经排好序，那么只要先对array[u(k)] ... array[u(k+1)-1]排序，再把二者合并起来就行了。C++ STL提供了所有的功能，sort和merge函数可以直接拿来用。</FONT></P><img src ="http://www.cnitblog.com/pumpkin/aggbug/1283.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/pumpkin/" target="_blank">pumpkin</a> 2005-08-03 20:51 <a href="http://www.cnitblog.com/pumpkin/archive/2005/08/03/1283.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>zoj-1990-Subway Tree Systems</title><link>http://www.cnitblog.com/pumpkin/archive/2005/08/03/1267.html</link><dc:creator>pumpkin</dc:creator><author>pumpkin</author><pubDate>Tue, 02 Aug 2005 16:29:00 GMT</pubDate><guid>http://www.cnitblog.com/pumpkin/archive/2005/08/03/1267.html</guid><wfw:comment>http://www.cnitblog.com/pumpkin/comments/1267.html</wfw:comment><comments>http://www.cnitblog.com/pumpkin/archive/2005/08/03/1267.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/pumpkin/comments/commentRss/1267.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/pumpkin/services/trackbacks/1267.html</trackback:ping><description><![CDATA[<DIV><FONT size=2>哎，郁闷的是自己的方法行不通，现在还不知道为什么。</FONT></DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2>我是根据0，1输入建造两颗树，然后对两个树比较。 </FONT></DIV>
<OL>
<LI><FONT size=2>建造过程中，对每个节点拥有的子节点排序，排序的根据是每个子节点的子节点个数。 </FONT>
<LI><FONT size=2>在比较两棵树时，我递规地比较他们的子树能否相同，也就是从上到下递规的遍历两颗树。 </FONT>
<OL>
<LI><FONT size=2>对于每个节点，我将他的字节点分组，也是根据该子节点拥有的字节点树，由于先前已经对字节点排序过了，所以分组也很容易。只要两边的组里面出现可以相同的匹配，就算该组是相同的。再接下去比较下一组。 </FONT>
<LI><FONT size=2>所谓组之间地相同匹配，我的想法是，对于第一组的任一节点，从第二组中找相同的节点（以及他们的孩子），如果找到了，就做标记，并继续为第一组的下一个节点找，如果找不到，就说明不可能有相同匹配。</FONT></LI></OL></LI></OL>
<P><FONT size=2>后来是看了Lee.Mars的算法，大概思想如下：</FONT></P>
<OL>
<LI><FONT size=2>输入序列是对一颗树的遍历生成的，该题目即是树的同构判断。 </FONT>
<LI><FONT size=2>因为遍历的规则未确定，所以生成的序列不同。 </FONT>
<LI><FONT size=2>制定一种遍历规则，对输入的序列规则化，判断最终的序列是否相同。</FONT></LI></OL>
<P><FONT size=2>规则化的方法如下：</FONT></P>
<OL>
<LI><FONT size=2>将序列分解为几个子序列，代表不同的子树。 </FONT>
<LI><FONT size=2>对子序列递规地规则化。 </FONT>
<LI><FONT size=2>对规则化后地子序列排序，并合成后返回。<BR></FONT></LI></OL><img src ="http://www.cnitblog.com/pumpkin/aggbug/1267.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/pumpkin/" target="_blank">pumpkin</a> 2005-08-03 00:29 <a href="http://www.cnitblog.com/pumpkin/archive/2005/08/03/1267.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>zoj-1167-Trees on the Level</title><link>http://www.cnitblog.com/pumpkin/archive/2005/08/03/1266.html</link><dc:creator>pumpkin</dc:creator><author>pumpkin</author><pubDate>Tue, 02 Aug 2005 16:27:00 GMT</pubDate><guid>http://www.cnitblog.com/pumpkin/archive/2005/08/03/1266.html</guid><wfw:comment>http://www.cnitblog.com/pumpkin/comments/1266.html</wfw:comment><comments>http://www.cnitblog.com/pumpkin/archive/2005/08/03/1266.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.cnitblog.com/pumpkin/comments/commentRss/1266.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/pumpkin/services/trackbacks/1266.html</trackback:ping><description><![CDATA[<DIV><A href="http://acm.zju.edu.cn/show_problem.php?pid=1167"><FONT color=#004377 size=1>http://acm.zju.edu.cn/show_problem.php?pid=1167</FONT></A></DIV>
<DIV><FONT size=1>这道题目挺简单，根据输入模拟建造一颗树就行了，如果建不起来说明不完整。</FONT></DIV>
<OL>
<LI><FONT size=1>首先，对一个节点的路径，可以用二进制表示，而不需要用char表示，这样一方面在后面排序时有好处，另一方面节省内存。</FONT> 
<LI><FONT size=1>输入所有的节点后，对节点排序，先对路径长度排（即对level），在对节点在同level的左右关系排。这样排好以后，一方面对最后的打印有好处，另一方面也方便建树。</FONT> 
<LI><FONT size=1>开始建树，由于上面已经按level排好序，所以只要依次按照路径把节点插入到树中的相应位置就可以了。如果在按路径查找插入点的时候发现路径有空位（即不能走下去了），则说明不完整。</FONT> 
<LI><FONT size=1>按照level打印树，只要依次打印排好序的节点就行了。</FONT></LI></OL><img src ="http://www.cnitblog.com/pumpkin/aggbug/1266.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/pumpkin/" target="_blank">pumpkin</a> 2005-08-03 00:27 <a href="http://www.cnitblog.com/pumpkin/archive/2005/08/03/1266.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>zoj-2234-Binary Search Heap Construction</title><link>http://www.cnitblog.com/pumpkin/archive/2005/08/03/1265.html</link><dc:creator>pumpkin</dc:creator><author>pumpkin</author><pubDate>Tue, 02 Aug 2005 16:20:00 GMT</pubDate><guid>http://www.cnitblog.com/pumpkin/archive/2005/08/03/1265.html</guid><wfw:comment>http://www.cnitblog.com/pumpkin/comments/1265.html</wfw:comment><comments>http://www.cnitblog.com/pumpkin/archive/2005/08/03/1265.html#Feedback</comments><slash:comments>4</slash:comments><wfw:commentRss>http://www.cnitblog.com/pumpkin/comments/commentRss/1265.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/pumpkin/services/trackbacks/1265.html</trackback:ping><description><![CDATA[<P><FONT size=1>&nbsp;&nbsp;&nbsp; 我是从zoj的promlem classification里面找到这个题目的，开始时想不到什么好方法，企图从零开始一步一步建树。最后还是没想到建树的算法。<BR>&nbsp;&nbsp; 后来查zoj forum，有人提到cartesian tree，于是google到了这方面的算法和数据结构。cartesian tree又叫randomized binary search tree，它是节点带权的二叉树，在插入新节点时，并非像平衡树那样做rebalance，而是维持父节点和子节点之间的权的大小关系(heap order)，即要么父节点的权总是大于子节点的权，要么反之。NIST的网站还介绍了cartesian tree节点的插入和删除算法。大致如下：<BR>&nbsp;&nbsp;&nbsp; 插入：<BR></P>
<DIV style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 0.5pt solid; PADDING-LEFT: 5.4pt; BACKGROUND: #e6e6e6; PADDING-BOTTOM: 4px; BORDER-LEFT: windowtext 0.5pt solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: windowtext 0.5pt solid">
<DIV><IMG src="http://www.cnitblog.com/images/OutliningIndicators/None.gif" align=top><SPAN style="COLOR: #000000">InsertNode(Node&nbsp;</SPAN><SPAN style="COLOR: #000000">*</SPAN><SPAN style="COLOR: #000000">&nbsp;newNode,&nbsp;Node&nbsp;</SPAN><SPAN style="COLOR: #000000">*</SPAN><SPAN style="COLOR: #000000">&nbsp;tree)<BR><IMG id=Codehighlighter1_40_318_Open_Image onclick="this.style.display='none'; Codehighlighter1_40_318_Open_Text.style.display='none'; Codehighlighter1_40_318_Closed_Image.style.display='inline'; Codehighlighter1_40_318_Closed_Text.style.display='inline';" src="http://www.cnitblog.com/images/OutliningIndicators/ExpandedBlockStart.gif" align=top><IMG id=Codehighlighter1_40_318_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_40_318_Closed_Text.style.display='none'; Codehighlighter1_40_318_Open_Image.style.display='inline'; Codehighlighter1_40_318_Open_Text.style.display='inline';" src="http://www.cnitblog.com/images/OutliningIndicators/ContractedBlock.gif" align=top></SPAN><SPAN id=Codehighlighter1_40_318_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.cnitblog.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_40_318_Open_Text><SPAN style="COLOR: #000000">{<BR><IMG src="http://www.cnitblog.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">if</SPAN><SPAN style="COLOR: #000000">&nbsp;(newNode</SPAN><SPAN style="COLOR: #000000">-&gt;</SPAN><SPAN style="COLOR: #000000">key&nbsp;</SPAN><SPAN style="COLOR: #000000">&lt;</SPAN><SPAN style="COLOR: #000000">&nbsp;tree</SPAN><SPAN style="COLOR: #000000">-&gt;</SPAN><SPAN style="COLOR: #000000">key)<BR><IMG id=Codehighlighter1_82_256_Open_Image onclick="this.style.display='none'; Codehighlighter1_82_256_Open_Text.style.display='none'; Codehighlighter1_82_256_Closed_Image.style.display='inline'; Codehighlighter1_82_256_Closed_Text.style.display='inline';" src="http://www.cnitblog.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_82_256_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_82_256_Closed_Text.style.display='none'; Codehighlighter1_82_256_Open_Image.style.display='inline'; Codehighlighter1_82_256_Open_Text.style.display='inline';" src="http://www.cnitblog.com/images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN id=Codehighlighter1_82_256_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.cnitblog.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_82_256_Open_Text><SPAN style="COLOR: #000000">{<BR><IMG src="http://www.cnitblog.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;tree</SPAN><SPAN style="COLOR: #000000">-&gt;</SPAN><SPAN style="COLOR: #000000">left&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;InsertNode(newNode,&nbsp;tree</SPAN><SPAN style="COLOR: #000000">-&gt;</SPAN><SPAN style="COLOR: #000000">left);<BR><IMG src="http://www.cnitblog.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">if</SPAN><SPAN style="COLOR: #000000">&nbsp;(tree</SPAN><SPAN style="COLOR: #000000">-&gt;</SPAN><SPAN style="COLOR: #000000">left</SPAN><SPAN style="COLOR: #000000">-&gt;</SPAN><SPAN style="COLOR: #000000">priority&nbsp;</SPAN><SPAN style="COLOR: #000000">&gt;</SPAN><SPAN style="COLOR: #000000">&nbsp;tree</SPAN><SPAN style="COLOR: #000000">-&gt;</SPAN><SPAN style="COLOR: #000000">priority)&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">&nbsp;假定父节点的权大</SPAN><SPAN style="COLOR: #008000"><BR><IMG src="http://www.cnitblog.com/images/OutliningIndicators/InBlock.gif" align=top></SPAN><SPAN style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;tree&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;TurnRight(tree);<BR><IMG src="http://www.cnitblog.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</SPAN></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnitblog.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">else</SPAN><SPAN style="COLOR: #000000">&nbsp;<BR><IMG id=Codehighlighter1_276_314_Open_Image onclick="this.style.display='none'; Codehighlighter1_276_314_Open_Text.style.display='none'; Codehighlighter1_276_314_Closed_Image.style.display='inline'; Codehighlighter1_276_314_Closed_Text.style.display='inline';" src="http://www.cnitblog.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_276_314_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_276_314_Closed_Text.style.display='none'; Codehighlighter1_276_314_Open_Image.style.display='inline'; Codehighlighter1_276_314_Open_Text.style.display='inline';" src="http://www.cnitblog.com/images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN id=Codehighlighter1_276_314_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.cnitblog.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_276_314_Open_Text><SPAN style="COLOR: #000000">{<BR><IMG src="http://www.cnitblog.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">&nbsp;omited<IMG src="http://www.cnitblog.com/images/dot.gif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #008000"><BR><IMG src="http://www.cnitblog.com/images/OutliningIndicators/InBlock.gif" align=top></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnitblog.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</SPAN></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnitblog.com/images/OutliningIndicators/InBlock.gif" align=top><BR><IMG src="http://www.cnitblog.com/images/OutliningIndicators/InBlock.gif" align=top><BR><IMG src="http://www.cnitblog.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>}</SPAN></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnitblog.com/images/OutliningIndicators/None.gif" align=top><BR><IMG src="http://www.cnitblog.com/images/OutliningIndicators/None.gif" align=top></SPAN></DIV></DIV>
<P>&nbsp;&nbsp;&nbsp; 删除：</P>
<DIV style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 0.5pt solid; PADDING-LEFT: 5.4pt; BACKGROUND: #e6e6e6; PADDING-BOTTOM: 4px; BORDER-LEFT: windowtext 0.5pt solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: windowtext 0.5pt solid">
<DIV><IMG src="http://www.cnitblog.com/images/OutliningIndicators/None.gif" align=top><SPAN style="COLOR: #000000">DeleteNode(Key&nbsp;key,&nbsp;Node&nbsp;</SPAN><SPAN style="COLOR: #000000">*</SPAN><SPAN style="COLOR: #000000">&nbsp;tree)<BR><IMG id=Codehighlighter1_33_141_Open_Image onclick="this.style.display='none'; Codehighlighter1_33_141_Open_Text.style.display='none'; Codehighlighter1_33_141_Closed_Image.style.display='inline'; Codehighlighter1_33_141_Closed_Text.style.display='inline';" src="http://www.cnitblog.com/images/OutliningIndicators/ExpandedBlockStart.gif" align=top><IMG id=Codehighlighter1_33_141_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_33_141_Closed_Text.style.display='none'; Codehighlighter1_33_141_Open_Image.style.display='inline'; Codehighlighter1_33_141_Open_Text.style.display='inline';" src="http://www.cnitblog.com/images/OutliningIndicators/ContractedBlock.gif" align=top></SPAN><SPAN id=Codehighlighter1_33_141_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.cnitblog.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_33_141_Open_Text><SPAN style="COLOR: #000000">{<BR><IMG src="http://www.cnitblog.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">if</SPAN><SPAN style="COLOR: #000000">(key&nbsp;</SPAN><SPAN style="COLOR: #000000">&lt;</SPAN><SPAN style="COLOR: #000000">&nbsp;tree</SPAN><SPAN style="COLOR: #000000">-&gt;</SPAN><SPAN style="COLOR: #000000">key)<BR><IMG id=Codehighlighter1_67_119_Open_Image onclick="this.style.display='none'; Codehighlighter1_67_119_Open_Text.style.display='none'; Codehighlighter1_67_119_Closed_Image.style.display='inline'; Codehighlighter1_67_119_Closed_Text.style.display='inline';" src="http://www.cnitblog.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_67_119_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_67_119_Closed_Text.style.display='none'; Codehighlighter1_67_119_Open_Image.style.display='inline'; Codehighlighter1_67_119_Open_Text.style.display='inline';" src="http://www.cnitblog.com/images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN id=Codehighlighter1_67_119_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.cnitblog.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_67_119_Open_Text><SPAN style="COLOR: #000000">{<BR><IMG src="http://www.cnitblog.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;tree</SPAN><SPAN style="COLOR: #000000">-&gt;</SPAN><SPAN style="COLOR: #000000">left&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;delete(key,&nbsp;tree)&nbsp;<BR><IMG src="http://www.cnitblog.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</SPAN></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnitblog.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">omited&nbsp;&nbsp;<IMG src="http://www.cnitblog.com/images/dot.gif"></SPAN><SPAN style="COLOR: #008000"><BR><IMG src="http://www.cnitblog.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align=top></SPAN><SPAN style="COLOR: #000000">}</SPAN></SPAN></DIV></DIV>
<P></FONT><FONT size=1>&nbsp;&nbsp;&nbsp;&nbsp; 然而直接的建立cartesian tree会导致超时，假设最终的树的所有节点都只有右孩子，并且插入时，总是插入最右节点，那复制度将会是O(n!)。 </FONT></P>
<P><FONT size=1>--------------------------------------------------------------------------------<BR></FONT><BR><FONT size=1>&nbsp;&nbsp;&nbsp; 后来又经过查阅资料，发现可以用qsort＋RMQ的方法。首先，对所有的节点，以key值排序，这样得到的结果为最终cartesian tree的中序遍历。再根据priority值，从上到下找到根节点，以及根节点的左右子树的根节点。。。<BR>&nbsp;&nbsp;&nbsp; 其中时间的消耗是：排序时间＋找所有子树的根的时间。快速排序的平均复杂度为O(nlog2(n))，而利用RMQ可以在O(nlog2(n))内建立RMQ的矩阵，并在O(1)时间内查找任意范围内的最大priority节点对应的索引。<BR>&nbsp;&nbsp;&nbsp; RMQ算法主要分两部分：（1）建立RMQ的matrix，（2）查找<BR>&nbsp;&nbsp;&nbsp; （1）需要计算matrix[i][j]其中1&lt;=i&lt;=n, 0&lt;=j&lt;=[log2(n)]（上去整）<BR>&nbsp;&nbsp;&nbsp; matrix[i][j]的含义为从i开始的宽度为2^j的范围内，priority最大的节点的位置<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {&nbsp; matrix[i][j-1]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; priority(matrix[i][j-1]) &gt; priority(matrix[i+2^(j-1)][j-1])<BR>&nbsp;&nbsp;&nbsp; matrix[i][j] ={<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; { matrix[i+2^(j-1)][j-1]&nbsp;&nbsp; 否则<BR>&nbsp;&nbsp;&nbsp; （2）查找RMQ(i, j)，RMQ(i, j)的含义为从i开始到j为止的范围内，priority最大的节点的位置<BR>&nbsp;&nbsp;&nbsp; 计算k=max{r|2^r &lt; j-i+1}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {&nbsp; matrix[i][r]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; priority(matirx[i][r]) &gt; priority(matrix[j-2^r+1][r]<BR>&nbsp;&nbsp;&nbsp; RMQ(i, j) =&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; { matrix[j-2^r+1][r]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 否则 <BR><BR>--------------------------------------------------------------------------------<BR><BR>&nbsp; 此问题还有一种最快的方法。考虑到对所有的输入节点做针对key的排序后，得到的数组为cartesian tree的中序遍历。</FONT></P>
<OL>
<LI><FONT size=1>&nbsp;现在我们从左到右，一边顺序遍历数组，一边建立cartesian tree。 </FONT>
<LI><FONT size=1>假设我们已经遍历到数组的第i个元素，并相应建立了有i个节点组成的cartesian tree，那么第i+1个节点必定在由i+1个节点组成的cartesian tree的最右路径的最右端点。 </FONT>
<LI><FONT size=1>我们原i几点的cartesian tree的最右路径的最右端点出发往上查找第一个priority比i+1节点大的节点，如果找到了，就把i+1节点的左子树设为那个节点的右子树，把那个节点的右子树设为i+1节点。如果找不到，则把i+1节点的左子树设为原树的根，并把i+1节点设为新根。</FONT> 
<LI><FONT size=1>需要主意的是，必须从下到上搜索最右路径，而不是从上到下。因为从上到下会出现O(n!)的复杂度，而从下到上的过程中，没个几点最多被走过一次，因为被走过的节点必被设为某个点的左子树，不再可能出现在最右路径中，所有有O(n)的复杂度。</FONT></LI></OL>
<P><BR><FONT size=1>--------------------------------------------------------------------------------</FONT></P>
<P><BR><FONT size=1>&nbsp;最后给一下结果：第一种方法超时，RMQ为0.95秒，最后一种方法为0.51秒.<BR></FONT></P><img src ="http://www.cnitblog.com/pumpkin/aggbug/1265.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/pumpkin/" target="_blank">pumpkin</a> 2005-08-03 00:20 <a href="http://www.cnitblog.com/pumpkin/archive/2005/08/03/1265.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Complicated Declarations</title><link>http://www.cnitblog.com/pumpkin/archive/2005/08/03/1262.html</link><dc:creator>pumpkin</dc:creator><author>pumpkin</author><pubDate>Tue, 02 Aug 2005 16:07:00 GMT</pubDate><guid>http://www.cnitblog.com/pumpkin/archive/2005/08/03/1262.html</guid><wfw:comment>http://www.cnitblog.com/pumpkin/comments/1262.html</wfw:comment><comments>http://www.cnitblog.com/pumpkin/archive/2005/08/03/1262.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/pumpkin/comments/commentRss/1262.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/pumpkin/services/trackbacks/1262.html</trackback:ping><description><![CDATA[<DIV><FONT size=1>    对识别C/C++中复杂的声明，Thinking in C++中介绍了一种简单的方法，right-left-right，即以变量为中心，向右走，一直到碰到右括号或不能再往右走，再往左走步，碰到左括号，再向右走。。。</FONT></DIV>
<DIV><FONT size=1>    如对于void * fun(void)，可以翻译为fun is a function that requires no argument and returns pointer to void。而void (* fun)(int)，则可以理解为fun is a pointer to function that requires int argument and returns void。</FONT></DIV>
<DIV><FONT size=1>    值得注意的是，对于像function这样的情况，必须先说argument，再说return value，两者都不可缺。例如，<BR>
<DIV style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 0.5pt solid; PADDING-LEFT: 5.4pt; BACKGROUND: #e6e6e6; PADDING-BOTTOM: 4px; BORDER-LEFT: windowtext 0.5pt solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: windowtext 0.5pt solid">
<DIV><IMG src="http://www.cnitblog.com/images/OutliningIndicators/None.gif" align=top><SPAN style="COLOR: #0000ff">void</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #000000">*</SPAN><SPAN style="COLOR: #000000"> (</SPAN><SPAN style="COLOR: #000000">*</SPAN><SPAN style="COLOR: #000000">set_handler（</SPAN><SPAN style="COLOR: #0000ff">void</SPAN><SPAN style="COLOR: #000000"> (</SPAN><SPAN style="COLOR: #000000">*</SPAN><SPAN style="COLOR: #000000">f)))();</SPAN></DIV></DIV>理解为，set_handler is a function that requires ... argument and returns pointer to function that requires no argument and returns pointer to void。<BR>碰到具体的符号的读法如下：<BR>
<DIV style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 0.5pt solid; PADDING-LEFT: 5.4pt; BACKGROUND: #e6e6e6; PADDING-BOTTOM: 4px; BORDER-LEFT: windowtext 0.5pt solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: windowtext 0.5pt solid">
<DIV><IMG src="http://www.cnitblog.com/images/OutliningIndicators/None.gif" align=top><SPAN style="COLOR: #000000">id     </SPAN><SPAN style="COLOR: #000000">'</SPAN><SPAN style="COLOR: #000000">id</SPAN><SPAN style="COLOR: #000000">'</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #0000ff">is</SPAN><SPAN style="COLOR: #000000"> a <BR><IMG src="http://www.cnitblog.com/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #000000">*</SPAN><SPAN style="COLOR: #000000">      pointer to<BR><IMG src="http://www.cnitblog.com/images/OutliningIndicators/None.gif" align=top>(</SPAN><SPAN style="COLOR: #000000">---</SPAN><SPAN style="COLOR: #000000">)   funciont that requires</SPAN><SPAN style="COLOR: #000000">---</SPAN><SPAN style="COLOR: #000000">argument(s) and returns<BR><IMG src="http://www.cnitblog.com/images/OutliningIndicators/None.gif" align=top>[</SPAN><SPAN style="COLOR: #000000">---</SPAN><SPAN style="COLOR: #000000">]   array of <BR><IMG src="http://www.cnitblog.com/images/OutliningIndicators/None.gif" align=top>type    type</SPAN></DIV></DIV><BR></FONT></DIV>
<DIV><FONT size=1>    Thinking in C++中也提到，这种方法对大部分声明有效，里面没有提到无效的声明（我也想不到），可能是其他一些比较变态的声明。而The C programming language则从C的语法角度解释了复杂表达式的解读方法。</FONT></DIV>
<DIV><FONT size=1>
<DIV style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 0.5pt solid; PADDING-LEFT: 5.4pt; BACKGROUND: #e6e6e6; PADDING-BOTTOM: 4px; BORDER-LEFT: windowtext 0.5pt solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: windowtext 0.5pt solid">
<DIV><IMG src="http://www.cnitblog.com/images/OutliningIndicators/None.gif" align=top><SPAN style="COLOR: #000000">    dcl:           optional </SPAN><SPAN style="COLOR: #000000">*</SPAN><SPAN style="COLOR: #000000">'</SPAN><SPAN style="COLOR: #000000">s direct-dcl</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnitblog.com/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #000000">    direct</SPAN><SPAN style="COLOR: #000000">-</SPAN><SPAN style="COLOR: #000000">dcl:  name<BR><IMG src="http://www.cnitblog.com/images/OutliningIndicators/None.gif" align=top>                   (dcl)<BR><IMG src="http://www.cnitblog.com/images/OutliningIndicators/None.gif" align=top>                   direct</SPAN><SPAN style="COLOR: #000000">-</SPAN><SPAN style="COLOR: #000000">dcl()<BR><IMG src="http://www.cnitblog.com/images/OutliningIndicators/None.gif" align=top>                   direct</SPAN><SPAN style="COLOR: #000000">-</SPAN><SPAN style="COLOR: #000000">dcl[optional size]</SPAN></DIV></DIV></FONT></DIV>
<DIV><FONT size=1>    用top down的方法，即可很容易的出上面的结论了。具体请看相关章节The C Programming Language 5.12</FONT></DIV><img src ="http://www.cnitblog.com/pumpkin/aggbug/1262.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/pumpkin/" target="_blank">pumpkin</a> 2005-08-03 00:07 <a href="http://www.cnitblog.com/pumpkin/archive/2005/08/03/1262.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>zoj-1010-Area</title><link>http://www.cnitblog.com/pumpkin/archive/2005/08/02/1261.html</link><dc:creator>pumpkin</dc:creator><author>pumpkin</author><pubDate>Tue, 02 Aug 2005 15:47:00 GMT</pubDate><guid>http://www.cnitblog.com/pumpkin/archive/2005/08/02/1261.html</guid><wfw:comment>http://www.cnitblog.com/pumpkin/comments/1261.html</wfw:comment><comments>http://www.cnitblog.com/pumpkin/archive/2005/08/02/1261.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/pumpkin/comments/commentRss/1261.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/pumpkin/services/trackbacks/1261.html</trackback:ping><description><![CDATA[<DIV><FONT size=1>解该题分为两步：</FONT></DIV>
<OL>
<LI><FONT size=1>确定多边行的有效性 </FONT>
<LI><FONT size=1>计算面积</FONT></LI></OL>
<P><FONT size=1>确定多边形的有效性算法如下：</FONT></P>
<UL>
<LI><FONT size=1>如果该多边形的边数小于3，则视为无效 </FONT>
<LI><FONT size=1>如果该多边形的变数等于3，视为有效 </FONT>
<LI><FONT size=1>如果变数大于3，则对于没一条边，确保与它相邻的边不与它重合，与它不相邻的边，不与它相交。</FONT></LI></UL>
<P><FONT size=1>为检查线段(i, k)和(k, j)重合，只需：</FONT></P>
<UL>
<LI><FONT size=1>(i, k)和(k, j)平行，即(i, k)×(k, j)=0 </FONT>
<LI><FONT size=1>j在以i, k为对角的矩形内，或i在以j, k为对角的矩形内。</FONT></LI></UL>
<P><FONT size=1>为检查线段(i, j)与线段(m, n)是否相交，只需：</FONT></P>
<UL>
<LI><FONT size=1>(i, m)×(m, n)与(j, m)×(m, n)异号，则线段(i, j)与直线(m, n)相交 </FONT>
<LI><FONT size=1>(m, i)×(i, j)与(n, i)×(i, j)异号，则线段(m, n)与直线(i, j)相交 </FONT>
<LI><FONT size=1>如果以上两点同时成立，则可得出线段(m, n)与线段(i, j)相交 </FONT>
<LI><FONT size=1>如果以上叉乘有任何一个为0，如(i, m)×(m, n)==0，则如果i在线段(m, n)上，则相交</FONT></LI></UL>
<P><FONT size=1>最后一步要计算面积，可以用测量师公式(A Surveryor's formula)：</FONT></P>
<BLOCKQUOTE dir=ltr>
<P><FONT size=1>一个n边形A1，A2，A3，...，An，其顶点按逆时针方向配置，且坐标分别为</FONT></P>
<BLOCKQUOTE dir=ltr>
<P><FONT size=1>Ak = (xk, yk)，k=1, 2, 3,...,n</FONT></P></BLOCKQUOTE>
<P><FONT size=1>则面积为：</FONT></P>
<BLOCKQUOTE dir=ltr>
<P><FONT size=1>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; n<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; ----&nbsp; &nbsp;| Xk&nbsp;&nbsp; X(k+1) |<BR>&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; \&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|<BR>1/2* /&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ---- &nbsp; | Yk&nbsp;&nbsp; Y(k+1) |<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;k=1<BR>其中，X(k+1) = X1， Y(k+1)=Y1</FONT></P></BLOCKQUOTE></BLOCKQUOTE><img src ="http://www.cnitblog.com/pumpkin/aggbug/1261.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/pumpkin/" target="_blank">pumpkin</a> 2005-08-02 23:47 <a href="http://www.cnitblog.com/pumpkin/archive/2005/08/02/1261.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>