摘要:
#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... 阅读全文
摘要:
#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... 阅读全文
摘要:
//很水的一题,用一次结构体排序就过了..Mixing MilkSince milk packaging is such a low margin business, it is important to keep the price of the raw product (milk) as low... 阅读全文
摘要:
经典的 最大回文子串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... 阅读全文
摘要:
简单的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进... 阅读全文
摘要:
这题和上题基本一样,但是看翻译时被坑了...Dual PalindromesMario Cruz (Colombia) & Hugo Rickeboer (Argentina)A number that reads the same from right to left as when read f... 阅读全文
摘要:
//类型,贪心 此题思路:用一个数组储存牛棚有牛的编号,再用一个数组储存每个相邻的牛之间的距离.然后每次的最短距离便是减去最长的相邻牛之间的距离./*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... 阅读全文
摘要:
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 ... 阅读全文