【算法分析】裸的dp。时间复杂度 O(mn)。空间复杂度 O(m+n)。
【其它】今天有人问我。。。于是就做了。= =,我还恶趣味地把代码压短了。。。搞到434B。大家不要鄙视我。。。起码还是有层次感的。。。不是恶意压行那种。。。
【CODE】
#include
using namespace std;
int m,n,T,k,i,j,r,p,a[505],b[505],F[505];
int main(){
cin>>T;
for (k=1;k<=T;k++){
for (cin>>m,i=0;i
for (cin>>n,i=0;i
for (r=p=0,i=0;i
for (j=0;j
p>?=b[j]
F[j]>?=a[i]==b[j]?p+1:0;
}
cout<
k!=T?puts(""):0;
}
}
恶趣味
回复ad饕饕不绝:囧= =
汗……
裸写还好 这明显是锦上添花
I truly love your site.. Pleasant colors & theme.
Did you make this web site yourself? Please reply
back as I’m wanting to create my own personal blog and would like to know where you got this from or just what the theme is called. Thank you!
ah, in fact it is the default theme of wordpress —— “Twenty Eleven”. I just modify the header picture and the background picture. You can get more details here: http://codex.wordpress.org/Installing_WordPress