摘要:
题目链接:http://poj.org/problem?id=3624题意:小偷光顾珠宝店,背了个包的容积为M,珠宝店有N种珠宝,每种珠宝的体积为W,价值为D,小偷用这个背包可以偷回去珠宝的最大价值是多少。代码:[cpp]view plaincopyprint?#includeint main(){... 阅读全文
摘要:
#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=... 阅读全文
摘要:
//这题是一简单的一个递归 算锻炼水体熟练度吧~~~Prime CryptarithmThe following cryptarithm is a multiplication problem that can be solved by substituting digits from a spec... 阅读全文
摘要:
经典的 最大回文子串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... 阅读全文
摘要:
//很水的一题,用一次结构体排序就过了..Mixing MilkSince milk packaging is such a low margin business, it is important to keep the price of the raw product (milk) as low... 阅读全文
摘要:
这题和上题基本一样,但是看翻译时被坑了...Dual PalindromesMario Cruz (Colombia) & Hugo Rickeboer (Argentina)A number that reads the same from right to left as when read f... 阅读全文
摘要:
简单的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进... 阅读全文
摘要:
//类型,贪心 此题思路:用一个数组储存牛棚有牛的编号,再用一个数组储存每个相邻的牛之间的距离.然后每次的最短距离便是减去最长的相邻牛之间的距离./*ID: jun41821PROG: barn1LANG: C++*/#include #include #include using namespac... 阅读全文
摘要:
//很水的一题,用一次结构体排序就过了..Mixing MilkSince milk packaging is such a low margin business, it is important to keep the price of the raw product (milk) as low... 阅读全文
摘要:
考点:水题?思路:计算从1900 1月1日开始计算天数,7天一周循环来记录13号星期几提交情况:1A收获:.....经验:读题读题读题...最后输出理所当然的想着是从星期一开始输出,结果想了2个小时....还有对循环范围的控制*************************************... 阅读全文