前院凹进去的一块地里,种着一个人高的棕树,叶子摊的很开,但是因为两边基本靠着 墙,树只能歪着长,我很想把它移到开口的地方。这个事情自己doable吗? 另外一个,一个bathroom的toilet边上有个recessed open cabinet,放toilet paper 和杂志,有点点锈,想把它换掉,挖出来,墙上的坑是19.75in H * 14.25in W, 深4. 25in,找了半天没找到合适的柜子,有见过的类似的请帮忙推荐一个
c*t
4 楼
是二次方程还是高次的?
j*p
5 楼
第一个好像很便宜啊。才1年,就降了一半价格。 原价要6K吧
f*i
6 楼
树挪死,人挪活 一人高的树你估计搞不定
paper
【在 w******d 的大作中提到】 : 前院凹进去的一块地里,种着一个人高的棕树,叶子摊的很开,但是因为两边基本靠着 : 墙,树只能歪着长,我很想把它移到开口的地方。这个事情自己doable吗? : 另外一个,一个bathroom的toilet边上有个recessed open cabinet,放toilet paper : 和杂志,有点点锈,想把它换掉,挖出来,墙上的坑是19.75in H * 14.25in W, 深4. : 25in,找了半天没找到合适的柜子,有见过的类似的请帮忙推荐一个
// my solution using recursion + global variables int a[] = { 2, 3, 5, 7, 10 }; // sorted coin denominations int size = 5; // number of coin types int partial[MAX]; // store partial solutions (coins) - // sorted in descending order int partialSize=0; // partial solution size (# of coins) void print_current_solution() { for (int i=0; icout << endl; return; } // do a DFS with partial solution stored in partial[] void solve(int sum) { for (int i=0; iif ( a[i] > partial[partialSize] ) continue; if ( sum >= a[i] ) { partial[partialSize++] = a[i]; // extend the partial solution if ( sum == a[i] ) print_current_solution(); else solve(sum-a[i]); // recurse down partialSize--; // back up } } }
// my solution using recursion + global variables int a[] = { 2, 3, 5, 7, 10 }; // sorted coin denominations int size = 5; // number of coin types int partial[MAX]; // store partial solutions (coins) - // sorted in descending order int partialSize=0; // partial solution size (# of coins) void print_current_solution() { for (int i=0; icout << endl; return; } // do a DFS with partial solution stored in partial[] void solve(int sum) { for (int i=0; iif ( a[i] > partial[partialSize] ) continue; if ( sum >= a[i] ) { partial[partialSize++] = a[i]; // extend the partial solution if ( sum == a[i] ) print_current_solution(); else solve(sum-a[i]); // recurse down partialSize--; // back up } } }
【在 b*****e 的大作中提到】 : // my solution using recursion + global variables : int a[] = { 2, 3, 5, 7, 10 }; // sorted coin denominations : int size = 5; // number of coin types : int partial[MAX]; // store partial solutions (coins) - : // sorted in descending order : int partialSize=0; // partial solution size (# of coins) : void print_current_solution() { : for (int i=0; i: cout << endl; : return;
s*f
39 楼
//get all integer positive solution for math function like 5x + 6y + z = 88; //seems coefficient should be positive, otherwise, bruteforce? void GetAllCombine_(int in[], int len, int sum, std::vector > *out){ static std::vector v; if (len < 1){ if (sum == 0){ out->push_back(v); } return; } for (int i = 0; i * in[0] <= sum; ++i){ v.push_back(i); GetAllCombine_(in + 1, len - 1, sum - i * in[0], out); v.pop_back(); } } void GetAllCombine(int in[], int len, int sum, std::vector > *out){ if (!in || len < 1 || sum < 0 || !out) return; GetAllCombine_(in, len, sum, out); }
我有一个傻逼的idea for 5x + 6y + z = 88 void getSolution(int a, int b, int c, int sum) //a=5,b=6,c=1 { int numA = sum/a; int numB = sum/b; int numC = sum/c; for(int i=0;i<=numA;++i) for(int j =0;j<=numB;++j) for(int k=0;k<=numC;++k) if(x*i+y*j+z*k==88) cout<} 递归的方法还没想明白
c*e
41 楼
This one is better: Only two loops, and the inner loop is shorter than yours. void getSolution(int a, int b, int c, int sum) //a=5,b=6,c=1 { int numA = sum/a; for(int i=0;i<=numA;++i) { int numB = (sum-a*i)/b; for(int j=0;j<=numB;++j) if((sum-a*i-b*j) % c == 0) cout << i << j << (sum-a*i-b*j)/c << endl; } }
【在 f********e 的大作中提到】 : 我有一个傻逼的idea for 5x + 6y + z = 88 : void getSolution(int a, int b, int c, int sum) //a=5,b=6,c=1 : { : int numA = sum/a; : int numB = sum/b; : int numC = sum/c; : for(int i=0;i<=numA;++i) : for(int j =0;j<=numB;++j) : for(int k=0;k<=numC;++k) : if(x*i+y*j+z*k==88)
s*n
42 楼
bool findSolution (int coefficient[], int size, int rightside){//coefficient [i] for Xi. if (size<1) return false; int reviewed = new int[size]; int lreviewed = 0; return findPartialSolution (reviewed,lreviewed, coefficient, size, rightside); } bool findPartialSolution (int reviewed[], int lreviewed, int coefficient [], int size, int rightside){ if (lreviewed==size){ for (int i=0;ireturn; } bool found=false; for (int i=0; ilreviewed++; reviewed[lreviewed-1] = i; found ||= findPartialSolution (reviewed,lreviewed, coefficient, size, rightside-i*coefficient[i]); } return found; }