<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Would You share! &#187; xmu</title>
	<atom:link href="http://www.5ushare.com/tag/xmu/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.5ushare.com</link>
	<description>Charlie Wu&#039;s blog</description>
	<lastBuildDate>Wed, 01 Sep 2010 09:28:18 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>厦大OJ 1051</title>
		<link>http://www.5ushare.com/xmu_oj-1051/</link>
		<comments>http://www.5ushare.com/xmu_oj-1051/#comments</comments>
		<pubDate>Tue, 05 Aug 2008 14:12:20 +0000</pubDate>
		<dc:creator>Charlie</dc:creator>
				<category><![CDATA[ACM Life]]></category>
		<category><![CDATA[ACM]]></category>
		<category><![CDATA[xmu]]></category>

		<guid isPermaLink="false">http://www.5ushare.com/?p=40</guid>
		<description><![CDATA[原文见 原题http://acm.xmu.edu.cn/JudgeOnline/problem.php?id=1051 题目大意：输入一个数N，求出N的组合，用它的公因数的次方表示出来。例如输入为5，起组合为5*4*3*2*1，输出应为2^3*3*5。这题主要难点在于N的取值最大可为1000000。而时间只有1s。 对于这题，我的想法是对于每一个数都分解成它的因数的乘积形式，并将每个因数的个数记录起来。由上可知，N的取值能到1000000，而对于每个数的因数的求解也将耗费大量时间，明显，1s必然不够我们花销。 于是，我便做了些优化。如对a运算时，假如a%2==0，则，我们便将a / 2标记，这样就可以不用处理a / 2。分析可知，它的截掉一半的枝，效果相当可观了。 另外还有些优化，在对每个数的因数求解方面，都是些常用的优化，不多作解释。 现在的问题是超时，测过，跑完1000000需要3.43s。暂时未有更好优化，希望大家能说说大家的想法。。。 Incoming search terms for the article:??ojOJ ????xmu acm ????]]></description>
			<content:encoded><![CDATA[<address><a href="http://www.5ushare.com/bbs/redirect.php?tid=74&amp;goto=lastpost#lastpost">原文见</a></address>
<address>
</address>
<div id="postmessage_123" class="t_msgfont">原题<a href="http://acm.xmu.edu.cn/JudgeOnline/problem.php?id=1051" target="_blank">http://acm.xmu.edu.cn/JudgeOnline/problem.php?id=1051</a><br />
题目大意：输入一个数N，求出N的组合，用它的公因数的次方表示出来。例如输入为5，起组合为5*4*3*2*1，输出应为2^3*3*5。这题主要难点在于N的取值最大可为1000000。而时间只有1s。<br />
对于这题，我的想法是对于每一个数都分解成它的因数的乘积形式，并将每个因数的个数记录起来。由上可知，N的取值能到1000000，而对于每个数的因数的求解也将耗费大量时间，明显，1s必然不够我们花销。<br />
于是，我便做了些优化。如对a运算时，假如a%2==0，则，我们便将a / 2标记，这样就可以不用处理a / 2。分析可知，它的截掉一半的枝，效果相当可观了。<br />
另外还有些优化，在对每个数的因数求解方面，都是些常用的优化，不多作解释。<br />
现在的问题是超时，测过，跑完1000000需要3.43s。暂时未有更好优化，希望大家能说说大家的想法。。。</div>
<h4>Incoming search terms for the article:</h4><ul><li><a href="http://www.5ushare.com/xmu_oj-1051/" title="??oj">??oj</a></li><li><a href="http://www.5ushare.com/xmu_oj-1051/" title="OJ ????">OJ ????</a></li><li><a href="http://www.5ushare.com/xmu_oj-1051/" title="xmu acm ????">xmu acm ????</a></li></ul><!-- SEO SearchTerms Tagging 2 plugin took 0.397 ms -->]]></content:encoded>
			<wfw:commentRss>http://www.5ushare.com/xmu_oj-1051/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
