![](https://img-blog.csdnimg.cn/20201014180756754.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
dfs
不知取什么昵称
这个作者很懒,什么都没留下…
展开
-
Poj2429 inverse of LCM&GCD
有一个比较简单的思路 定义N=l/g,所求x,y ; 将N素数分解得到N=p1^q1 * p2^q2 * ..... * pk^qk; 再定义数组a[k],其中a[i]=pi^qi; 定义x1=x/g y1=y/g 由数论知识知道 x1 和 y1 互素 而且 lcd(x,y)=l 所以 a[i] 只能属于x1 和 y1 中一个 再用 dfs() 找出和最小就ok了 代码很短哦 #原创 2015-08-31 12:34:04 · 406 阅读 · 0 评论 -
编程之美 3.2 TelPhone
#include #include #include using namespace std; const int TelLength=20; char c[10][5]={ "","","ABC","DEF","GHI","JKL","MNO","PQRS","TUV","WXYZ" }; int total[10]={0,0,3,3,3,3,3,4,3,4}; int num转载 2015-09-01 11:42:22 · 307 阅读 · 0 评论 -
Poj2488 A Knight's Journey
英文是硬伤 字典序输出 14653114 493238731 2488 Accepted 164K 32MS C++ 1364B #include //Poj2488 #include #include #include #include #include #include using namespace std;原创 2015-08-23 19:23:09 · 301 阅读 · 0 评论 -
华为oj 称砝码
我的代码 dfs #include #include #include using namespace std; const int MAX_W=10500; bool dp[MAX_W]; void dfs(int i,int n,int weight[],int nums[],int sum){ if(i==n) return; for(int k=0;k<=n原创 2015-09-11 14:54:44 · 456 阅读 · 0 评论