摘要: poj 1276Cash MachineTime Limit:1000MSMemory Limit:10000KTotal Submissions:18242Accepted:6364DescriptionA Bank plans to install a machine for cash with... 阅读全文
posted @ 2013-04-01 21:03 amourjun 阅读(180) 评论(0) 推荐(0) 编辑
摘要: #include#include#include#includeusing namespace std;const int maxn=500;const int maxdp=10010;int p[maxn],w[maxn];int dp[maxdp];int main(){//freopen("i... 阅读全文
posted @ 2013-04-01 21:02 amourjun 阅读(78) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://poj.org/problem?id=3624题意:小偷光顾珠宝店,背了个包的容积为M,珠宝店有N种珠宝,每种珠宝的体积为W,价值为D,小偷用这个背包可以偷回去珠宝的最大价值是多少。代码:[cpp]view plaincopyprint?#includeint main(){... 阅读全文
posted @ 2013-04-01 21:02 amourjun 阅读(132) 评论(0) 推荐(0) 编辑
摘要: #includeusing namespace std;#define MAXN 20000int map[105][105];int f[105][105];int x[]={0,0,1,-1};int y[]={1,-1,0,0};void dfs(int i,int j){for(int k=... 阅读全文
posted @ 2013-04-01 21:00 amourjun 阅读(141) 评论(0) 推荐(0) 编辑
摘要: //这题是一简单的一个递归 算锻炼水体熟练度吧~~~Prime CryptarithmThe following cryptarithm is a multiplication problem that can be solved by substituting digits from a spec... 阅读全文
posted @ 2013-04-01 20:59 amourjun 阅读(136) 评论(0) 推荐(0) 编辑
摘要: 经典的 最大回文子串Calf FlacIt is said that if you give an infinite number of cows an infinite number of heavy-duty laptops (with very large keys), that they w... 阅读全文
posted @ 2013-04-01 20:58 amourjun 阅读(108) 评论(0) 推荐(0) 编辑
摘要: //很水的一题,用一次结构体排序就过了..Mixing MilkSince milk packaging is such a low margin business, it is important to keep the price of the raw product (milk) as low... 阅读全文
posted @ 2013-04-01 20:58 amourjun 阅读(104) 评论(0) 推荐(0) 编辑
摘要: 这题和上题基本一样,但是看翻译时被坑了...Dual PalindromesMario Cruz (Colombia) & Hugo Rickeboer (Argentina)A number that reads the same from right to left as when read f... 阅读全文
posted @ 2013-04-01 20:57 amourjun 阅读(97) 评论(0) 推荐(0) 编辑
摘要: 简单的1-300递归搜索主要的2处代码/* 函数circle用于判断正整数n的d进制数表示形式是否是回文数 */int circle(int n, int d){int s=0,m=n;while(m){s=s*d+m%d;m/=d;}return s==n;}//函数printd将正整数n由10进... 阅读全文
posted @ 2013-04-01 20:57 amourjun 阅读(83) 评论(0) 推荐(0) 编辑
摘要: //类型,贪心 此题思路:用一个数组储存牛棚有牛的编号,再用一个数组储存每个相邻的牛之间的距离.然后每次的最短距离便是减去最长的相邻牛之间的距离./*ID: jun41821PROG: barn1LANG: C++*/#include #include #include using namespac... 阅读全文
posted @ 2013-04-01 20:56 amourjun 阅读(113) 评论(0) 推荐(0) 编辑
摘要: //很水的一题,用一次结构体排序就过了..Mixing MilkSince milk packaging is such a low margin business, it is important to keep the price of the raw product (milk) as low... 阅读全文
posted @ 2013-04-01 20:56 amourjun 阅读(161) 评论(0) 推荐(0) 编辑
摘要: 考点:水题?思路:计算从1900 1月1日开始计算天数,7天一周循环来记录13号星期几提交情况:1A收获:.....经验:读题读题读题...最后输出理所当然的想着是从星期一开始输出,结果想了2个小时....还有对循环范围的控制*************************************... 阅读全文
posted @ 2013-04-01 20:54 amourjun 阅读(139) 评论(0) 推荐(0) 编辑
摘要: Greedy Gift GiversA group of NP (2 ≤ NP ≤ 10) uniquely named friends has decided to exchange gifts of money. Each of these friends might or might not ... 阅读全文
posted @ 2013-04-01 20:54 amourjun 阅读(242) 评论(0) 推荐(0) 编辑
摘要: 思路:看了看像是动态规划中的最大子串,以前做过一个类似的,网上说是用模拟的水题,自己想用动态规划做一做,就试了一试....时间:用了3天...每天YY几个小时....提交情况:不谈了...心得:打代码的时候都把注释给加上,思路比较清晰,只是后来发现思路漏洞逐渐显露出来,太多情况没有注意,导致后面的程... 阅读全文
posted @ 2013-04-01 20:52 amourjun 阅读(172) 评论(0) 推荐(0) 编辑
摘要: Complete Search 枚举搜索译 by Lucky Crazy思想:写枚举搜索时应遵循KISS原则(Keep it simple stupid,译为“写最单纯愚蠢的程序”,意思是应把程序写得尽量简洁),竞赛时写程序的最终目标就是在限制时间内求出解,而不需太在意否还有更快的算法。枚举搜索具有... 阅读全文
posted @ 2013-04-01 20:50 amourjun 阅读(244) 评论(0) 推荐(0) 编辑
摘要: 类型:模拟.发现自己做模拟老是漏这漏那的,导致数据总是过不了!!!!!不给出中文了,一个求数列并集最长子串的模拟.很水 但是我很坑...思路:对挤奶时间结构体排序,然后递归求最大值;收获:学会用结构体的排序,qsort的使用;错误情况,模拟时的方法漏洞!!!!!!!!!!!!!!!!!!!!!!!!... 阅读全文
posted @ 2013-04-01 20:49 amourjun 阅读(320) 评论(0) 推荐(0) 编辑
摘要: 一题简单的模拟,第一次做这种旋转矩阵的,开始觉得有点难,其实后来仔细想想,慢慢的来也是挺简单的,提交两次通过,第一次错误是因为没有严格按照题目要求的顺序给出答案.TransformationsA square pattern of size N x N (1 #include #include #i... 阅读全文
posted @ 2013-04-01 20:48 amourjun 阅读(239) 评论(0) 推荐(0) 编辑
摘要: Name That NumberAmong the large Wisconsin cattle ranchers, it is customary to brand cows with serial numbers to please the Accounting Department. The ... 阅读全文
posted @ 2013-04-01 20:47 amourjun 阅读(235) 评论(0) 推荐(0) 编辑
摘要: 简单的1-300递归搜索主要的2处代码/* 函数circle用于判断正整数n的d进制数表示形式是否是回文数 */int circle(int n, int d){ int s=0,m=n; while(m) { s=s*d+m%d; m/=d; } return s==n;}//函数printd将正... 阅读全文
posted @ 2013-04-01 20:45 amourjun 阅读(92) 评论(0) 推荐(0) 编辑