摘要:
#include <stdio.h>#define abs(a) ((a)<0?-(a):(a))__int64 gcd(__int64 a,__int64 b){ return !b?a:gcd(b,a%b);}void exgcd(__int64 i,__int64 j,__int64 &a,__int64 &b){ if(!j) a=1,b=0; else exgcd(j,i%j,b,a),b-=(a*(i/j));}int main(){ __int64 x,y,n,m,l; while(scanf("%I64d %I64d %I64d %I 阅读全文
摘要:
#include <stdio.h>#include <string.h>#define M 1000char b[M],c[M];int a[M][M];int main(){ int i,j,n,m; while(scanf("%s%s",b+1,c+1)!=EOF) { n=strlen(b+1); m=strlen(c+1); for(i=0;i<=n;i++) a[i][0]=0; for(i=0;i<=m;i++) a[0][i]=0... 阅读全文
摘要:
刚开始做时思路过于局限,只考虑局部的递推,没有全局观导致,越推越复杂,最后看到网上答案,精髓啊#include <iostream>#include <string.h>#include <stdio.h>using namespace std;int max3(int a,int b,int c){ a = a>b?a:b; a = a>c?a:c; return a;}int max2(int a,int b){ a = a>b?a:b; return a;}int t[100001][11];int main(){ int n,T,x 阅读全文