![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
acm
文章平均质量分 61
aa11415
这个作者很懒,什么都没留下…
展开
-
n*n最后一位数
#include long long power(long long a,long long N,int M) { long long tmp=a%M,ans=1; while(N) { if(N%2==1) { ans=ans*tmp%M; } tmp=tmp*tmp%M; N=N/2; } return ans; } int m原创 2016-01-26 20:01:12 · 297 阅读 · 0 评论 -
dp最长公共子序列
#include #include #include int main() { char a[1000]={0},b[1000]={0}; int dp[1000][1000]={0}; while(scanf("%s%s",a,b)!=EOF) { int a1=strlen(a); int b1=strlen(b); for(int i=1;i原创 2016-01-27 20:25:27 · 154 阅读 · 0 评论 -
动态规划
#include #include #include #include using namespace std; #define N 1010 int max(int a, int b ) { if ( a > b ) return a; else return b; }; char s1[N],s2[N]; int dp[N][N]; int main() {原创 2016-07-31 14:40:23 · 165 阅读 · 0 评论