算法
iteye_20100
这个作者很懒,什么都没留下…
展开
-
(zz)topcoder指南
开博第一篇,转个topcoder指南,算法这东西还是要多练习,争取一星期练一题回来写体会1.基本规则2.运行环境3.注册与登陆4.界面简介5.练习6.比赛7.注意事项8.代码编写TopCoder(以下简写tc) URL: http://www.topcoder.com1.基本规则 tc的比赛规则归结起来就是一句话:75分钟做完3道难度递增的题。 tc的每个用户(handle)都有自己...2009-06-13 23:10:00 · 138 阅读 · 0 评论 -
填图游戏
SRM444DIV1 550分 大概意思是给定一个一定长宽的表,现在手中有两种卡片一种是2*2的“4”字卡片(16分),另一种是1*1的“1”字卡片(1分),卡片数不限,计算可以将其填入表中得到的最大分,图表中可能已有卡片存在。*Problem StatementNOTE: This problem statement contains images that may not di...2009-07-21 18:58:00 · 206 阅读 · 0 评论 -
长整数的因子分解
练习题做多了就发现有好多整数相关的题目都要用到因子分解(或是其变种,如整除之类),比如有一个题:给定整数N,若N可以分解为四个整数乘积,我们称其级别为1,如果上述分解的因子每个都能进行同样的分解,我们称N级别为2,依次类推,求任意N的级别 我的思路是设立一个全局变量count 通过递归函数进行N的逐步整除,每次整除count都要加1,通过count控制在4以内结束递归,然后对N的每个因子...2009-07-14 14:25:00 · 109 阅读 · 0 评论 -
用递归解决的一道550分题
Problem StatementThe prime factorization of a number X is the list of prime numbers that multiply together to form X. For example,the prime factorization of 12 is 2 * 2 * 3. Note that 1 is not a prim...2009-07-07 19:10:00 · 160 阅读 · 0 评论 -
数字组合(未完成)
给定一组数字,求其中任意K个数的组合并将各种组合存储返回来自一道1100分的topcoder习题,该死的递归快把人搞死了,从网上查到了解决方案但还是理解的不很透彻,最大问题是返回的String值不能对原数据进行区分,尝试用ArrayList也不行,现在脑子一团糟,在博客上记录一下,以后有更好的方法再过来改如果路过的高手有什么好的建议,敬请指教public class Polygons...2009-07-04 14:50:00 · 85 阅读 · 0 评论 -
topcoder1100分题(DIV2)
Problem Statement????Note that in the following problem statement, all quotes and angle brackets are for clarityA certain vending machine delves out its goods from a rotating cylinder, which can rota...2009-07-01 18:26:00 · 128 阅读 · 0 评论 -
堰塞湖模型研究
今天有幸听朱老师讲课,笔记整理如下: 2008年研究生数模竞赛A题:汶川地震中唐家山堰塞湖泄洪问题 共有四个子问题:1. 研究并建立库容与水位关系2. 溃坝情况下的泄洪规律3. 假设1/3洪水下泄,建立淹没区域模型,并确立人员疏散方案4. 讨论决策正确性及可改进性1. 库容与水位的模型谷歌三维地形图的使用,方法是用Matlab将其转换为矩阵以...2009-06-28 18:56:00 · 408 阅读 · 0 评论 -
递归(SRM144D2)
Problem Statement You work for an electric company, and the power goes out in a rather large apartment complex with a lot of irate tenants. You isolate the problem to a network of sewers underneath t...2009-06-27 20:31:00 · 106 阅读 · 0 评论 -
字符串与数字转换(续)
(SRM 144 DIV2) 550分题: Problem Statement Let's say you have a binary string such as the following:011100011One way to encrypt this string is to add to each digit the sum of its a...2009-06-23 15:34:00 · 119 阅读 · 0 评论 -
关于字符串与数字转换
Problem Statement ***Note: Please keep programs under 7000 characters in length. Thank you Class Name: SquareDigits Method Name: smallestResult Parameters: int Returns: intDefine the function S(x...2009-06-19 18:43:00 · 113 阅读 · 0 评论 -
topcoder practice1
Problem Statement:TopCoder has decided to automate the process of assigning problem difficultylevels to problems. TopCoder developers have concluded that problem difficultyis related onl...2009-06-18 21:40:00 · 131 阅读 · 0 评论 -
贪婪法,计数排序
研究生期间的第一个暑假,只有20多天,不过已经算是老板开恩了,实验室其他组最少的只放一个星期,不过人家是有项目做唉,羡慕中……,废话少说了。放假前参加了大老板请的一位在美国搞算法的老师上的高级算法课,总体感觉一般般,八节课里有的简单到不想听,有的难到听不懂,不过老师还算认真,当做一次算法复习还是好的,现将总结写在这儿,也算是对这十几天有个交代。这次算法课主要集中在几个常用算法:贪婪法,排序,...2009-08-12 13:50:00 · 213 阅读 · 0 评论