We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
题目说把绳子剪成m段,每段绳子长度记为k[0],k[1],k[2]...k[m]。但是,从0~m共有m+1段
The text was updated successfully, but these errors were encountered:
对的,还有动态规划的代码也有问题,lenght为3时输出是3还是2
Sorry, something went wrong.
lenght为3输出的是2 这里的lenght是指绳子的长度,由于题目要求至少得剪一刀,所以输出的是2 。 至于代码下面的products[3] = 3 是指 若绳子大于3 ,把该绳子剪成n段,若其中一段为3 ,则这段的最优解为3(不需要再剪一段)
是的,我查了下leetcode 里的 剪绳子 问题 那里面改为了 k[0],k[1],k[2]....k[m-1]。
No branches or pull requests
题目说把绳子剪成m段,每段绳子长度记为k[0],k[1],k[2]...k[m]。但是,从0~m共有m+1段
The text was updated successfully, but these errors were encountered: