摘要: 1873: Power StringsResultTIME LimitMEMORY LimitRun TimesAC TimesJUDGE10s8192K650258StandardGiven two stringsaandbwe definea*bto be their concatenation. For example, ifa = "abc"andb = "def"thena*b = "abcdef". If we think of concatenation as multiplication, exponentiation 阅读全文
posted @ 2012-05-03 17:27 漂木 阅读(173) 评论(0) 推荐(0) 编辑
摘要: 2012.6.2更新,如果想安装最新的催化剂版本,看这里http://www.cnblogs.com/RootJie/archive/2012/06/02/2531550.html亲测,成功。 显卡驱动是各种菜鸟的硬伤...搞不好就挂,一挂就进不了图形界面,然后重装(其实完全没必要重装,只要卸载干净并且恢复一下xorg.conf就行)...而开源驱动虽然也可以满足日常使用,但是那个功耗方面实在是很奔放。 关于ATI的官方驱动是每个月出一个版本,但是近几个月的更新经我自己安装都有问题。 官方linux wiki在这里:http://wiki.cchtml.com/index.php/M... 阅读全文
posted @ 2012-04-28 22:13 漂木 阅读(4253) 评论(0) 推荐(0) 编辑
摘要: 矩阵连乘是经典的DP问题。n个矩阵连乘会因为乘的次序问题导致效率差异。这个问题中比较难想的是计算m[][]时的次序,必须保证计算m[i][j]查找m[i][k]和m[k+1][j]时这两个已经计算出来了。这里是根据王晓东的算法书里的想法写的,他用的是Java,必须提醒的就是在用C++时一个蛋疼的数组越界问题。int *p = new int[5];此时p[5] = 10; 就是越界的,但C++为了效率上的考虑华丽地无视了这个越界,编译器并没有义务指出它。更bt的是cout << p[5] << endl; 是正确的,能输出10。但这程序指不定什么时候就诡异得挂了。所以n 阅读全文
posted @ 2012-04-24 11:20 漂木 阅读(447) 评论(0) 推荐(0) 编辑
摘要: 1995: EnergyResultTIME LimitMEMORY LimitRun TimesAC TimesJUDGE3s10240K1366357StandardMr. Jojer is a very famous chemist. He is doing a research about behavior of a group of atoms. Atoms may have different energy and energy can be positive or negative or zero, e.g. 18 or -9. Absolute value of energy 阅读全文
posted @ 2012-04-21 23:23 漂木 阅读(211) 评论(0) 推荐(0) 编辑
摘要: 1611: Perfect CubesResultTIME LimitMEMORY LimitRun TimesAC TimesJUDGE3s8192K780320StandardFor hundreds of years Fermat's Last Theorem, which stated simply that forn> 2 there exist no integersa,b,c> 1 such that, has remained elusively unproven. (A recent proof is believed to be correct, tho 阅读全文
posted @ 2012-04-19 21:09 漂木 阅读(225) 评论(0) 推荐(0) 编辑
摘要: 1184: The Circumference of the CircleResultTIME LimitMEMORY LimitRun TimesAC TimesJUDGE1s8192K558338StandardTo calculate the circumference of a circle seems to be an easy task - provided you know its diameter. But what if you don't?You are given the cartesian coordinates of three non-collinear p 阅读全文
posted @ 2012-04-18 23:20 漂木 阅读(246) 评论(0) 推荐(0) 编辑
摘要: 1013: Polynomial MultiplicationResultTIME LimitMEMORY LimitRun TimesAC TimesJUDGE3s8192K4660807StandardA polynomial is a sum of terms, where each term is a coefficient multiplied by the variable x raised to some nonnegative integer power. The largest such power is referred to as the degree of the po 阅读全文
posted @ 2012-04-17 21:51 漂木 阅读(347) 评论(0) 推荐(0) 编辑
摘要: 2608: 石子ResultTIME LimitMEMORY LimitRun TimesAC TimesJUDGE1s65536K791210StandardXiao Tang和Xiao Jiang非常喜欢玩一种有趣的小游戏: 有N个石子,两人轮流从中取出1个, 3个或4个石子,当石子被取空时,游戏结束。 最后一个取石子的人获胜, 第一次总是Xiao Tang取. 当然,他们俩都足够聪明,总会采取最优的策略。Input每行会有一个正整数N(N<=100000), 代表石子的个数, N=0 代表输入结束Output输出获胜人的名字。Sample Input120Sample Output 阅读全文
posted @ 2012-04-17 20:04 漂木 阅读(184) 评论(0) 推荐(0) 编辑
摘要: 2535: Train TicketResultTIME LimitMEMORY LimitRun TimesAC TimesJUDGE3s65536K394136Standard每次出外比赛,火车票的问题就出现了。太多的火车路线使acm的教练Coach Li很迷惘,当然,他总是努力使得总起来的火车票价最少。你能帮助他一下吗?输入给出n和m,表示有n个城市。之后的m次查询。之后会跟随(n*n)的数字矩阵,a[i][j] 表示i车站到j车站需要a[i][j]的钱。注意a[i][j]与a[j][i]无必然联系。然后是m对整数。如果一对整数i,j。表示求城市i到城市j的最小花费n<=100; 阅读全文
posted @ 2012-04-17 19:32 漂木 阅读(251) 评论(0) 推荐(0) 编辑
摘要: 1474: Soundex IndexingResultTIME LimitMEMORY LimitRun TimesAC TimesJUDGE3s8192K246119StandardThe Soundex Index System was developed so that similar sounding names, or names with similar spelling could be encoded for easy retrieval. It has been used by the U.S. Bureau of the Census, and some States u 阅读全文
posted @ 2012-04-17 17:11 漂木 阅读(366) 评论(0) 推荐(0) 编辑