随笔分类 - LN算法
摘要:View Code #include<iostream>using namespace std;char a[1001] ;char x_a[1001] , y_b[1001] ;char xx[1001] , yy[1001];char x1[1001] , y1[1001];int Lx , Ly ;int sum[1001] ;int num ;int sign=0;int mark_x , mark_y ;int x[1001],y[1001];void Init_A() //将字符转化为数字{ int i; for ( i = 0 ; i < Lx ; i++ )
阅读全文
摘要:View Code #include"iostream"#include"iostream"using namespace std;int n;int mark=0;char a[50] , b[50];int c[50] , d[50];int f[50] , e[50];int La, Lb;int marka, markb;int s,t;int i,j;int _max;int Max(int x, int y){ return x>y?x:y;}void Add(){ memset(e,0,sizeof(e)); int m=0,flag
阅读全文
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=1753有时间优化一下,写的好长啊!View Code #include"iostream"using namespace std;int main(){ char a[1001],b[1001]; int c[1001] , d[1001]; int e[1001]; int i,j; while(cin>>a>>b) { int L1=strlen(a); int L2=strlen(b); int start_a=L1-1,start_b=L2-1; for(i
阅读全文
摘要:就当是练习了(各种高精度)!综合很强!View Code #include"iostream"#define M 1010using namespace std;char ch1[M],ch2[M];int a[M],b[M];int c[M],d[M];int num[M];int sum[M];int W[M];int H[M];int t,k,g,v;int i,j;int La,Lb;int sign=0;int s;int L;void _ADD(){ La=0; W[La++]=(sum[L-1]+1)%10; int flag=(sum[L-1]+1)/10;
阅读全文
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=1402我的代码,由于时间的问题,以后找机会优化了!(超时)View Code #include"iostream"#define M 100010using namespace std;char ch1[M],ch2[M];int a[M],b[M];int c[M],d[M];int num[M];int H[M];int t,k,g,v;int i,j;int La,Lb;int sign=0;void Add(int x ,int y){ sign=0; t=0; int p,q,f
阅读全文