题解及证明:http://www.cnblogs.com/StupidBoy/p/5241258.html
#include#include using namespace std;int n,m,a[100100],b[100100];int main(){ //freopen("h.in","r",stdin); scanf("%d%d",&n,&m); for(int i=1;i<=n;++i) scanf("%d",&a[i]); for(int i=1;i<=m;++i) scanf("%d",&b[i]); int ans=0; for(int i=2;i