![](https://img-blog.csdnimg.cn/20190918140213434.png?x-oss-process=image/resize,m_fixed,h_224,w_224)
未理解的题
未理解的题
Wonder-King
有好奇心,什么都想学一点。
展开
-
51Nod1092 回文字符串(LCS)
这道题我现在还很迷,只知道把字符串逆序,然后求两个字符串的LCS,最后字符串的长度减去公共子串长度,就是答案。但是为什么是这样呢?我很迷啊。。。。。。。。。。。。。。。who can tell me? #include<iostream> #include<algorithm> #include<cstring> #include<string>...原创 2018-12-02 10:13:13 · 211 阅读 · 0 评论 -
51Nod1138 连续整数的和(公式换算)
设长度为t,初始位置为a,有(2a-1+t)*t/2=n,a=(2n+t-t²)/2t。 这一题难在如何缩短遍历的长度。1到sqrt(2*n)。这一点我还没理解 #include<iostream> #include<cmath> using namespace std; int main() { int n,i; cin>>n; int flag...原创 2018-12-02 12:48:15 · 339 阅读 · 0 评论