07 2012 档案
Hdu 1286 找新朋友
摘要:开始题目看错了,以为是求老朋友的个数,后来发现题目要求求新朋友的个数。筛选法。。。CODE:#include<stdio.h>#include<stdlib.h>#include<math.h>#include<string.h>usingnamespacestd;constintmaxn=32769;intvis[maxn]={0};intN,cnt;voidinit(intn,int&cnt){inti,j;cnt=0;memset(vis,0,sizeof(vis));for(i=2;i<n;i++)if(!vis[i]){i
阅读全文
Hdu 1312 Red and Black
摘要:简单DFS。CODE:#include<stdio.h>#include<stdlib.h>#include<string.h>usingnamespacestd;intx,y;inttot;intn,m;charmaze[21][21];voiddfs(intx,inty,int&tot){if(x>=0&&y>=0&&x<n&&y<m&&maze[x][y]=='.'||maze[x][y]=='@'){tot++;maze[x
阅读全文
Hdu 1164 Eddy's research I
摘要:简单模拟。注意数组别越界!CODE:#include<stdio.h>#include<stdlib.h>#include<string.h>usingnamespacestd;constintmaxn=65534;__int64prime[maxn];__int64save[maxn];intvis[maxn]={0};intcnt=0;voidinit(){__int64i,j;for(i=2;i<maxn;i++)if(!vis[i]){prime[cnt++]=i;for(j=i*i;j<maxn;j+=i)vis[j]=1;}retur
阅读全文
Hdu 1052 Tian Ji -- The Horse Racing
摘要:贪心算法。贪心策略:假设田忌的马为A,齐威王的马为B。要使价值最大化的话,则有如下几种情况:1、使A中速度最次的马与B中速度最好的马比赛,使得B的价值损失最大。2、使A中速度最好的马与B中速度最好的马比赛,使得B中价值损失最大。3、如果A中速度最次的马与B中速度最次的马速度相等,则比较A中速度最大的马与B中速度最大的马的速度,有如下情况:(1)若大于,根据2知须A中速度最大的马与B中速度最大的马比赛。(2)若小于,则根据1知须A中最次的马与B中最好的马比赛。接下来根据上面的贪心策略就得到了具体的方案:1、A最快 > B最快:即A的最快能打败B的所有队员,为了后面着想,必然跟B的最快比。2
阅读全文
Hdu 1257 最小拦截系统
摘要:简单题。用一个数组存放每个拦截系统的导弹能达到的最大高度,如果后继导弹超过所有拦截系统的最大高度,那么数组就增加。只要小于某一拦截系统的话,那么就更新最大高度。CODE:#include<stdio.h>#include<stdlib.h>#include<string.h>#include<math.h>usingnamespacestd;#defineINF30001constintSIZE=1001;intsave[SIZE];intmain(){intN;intn;while(~scanf("%d",&N)){
阅读全文
Hdu 2669 Romantic
摘要:一道扩展欧几里得模板的题,这几天刚好练习一下简单数论的知识。思路:由于X*A + Y*B = 1,所以一定有gcd(A,B) = 1;CODE:#include<stdio.h>#include<stdlib.h>#include<string.h>usingnamespacestd;voidex_gcd(__int64a,__int64b,__int64&d,__int64&x,__int64&y){if(!b){d=a;x=1;y=0;}else{ex_gcd(b,a%b,d,y,x);y-=x*(a/b);}}//ex_gcdi
阅读全文
Hdu 1576 A/B
摘要:放假后回来第2天在网吧AC的第一道题。这是一道变形的扩展欧几里得算法题。由题知:n = A%9973 。设9973*y = n;设A/B = x,则A = B*x; 则题目可以转换为: B*x-9973*y = n;对于扩展欧几里得算法的使用还不熟练,要加强联系啦!~CODE:#include<stdio.h>#include<stdlib.h>#include<string.h>usingnamespacestd;intn,b;intex_gcd(inta,intb,int&x,int&y){if(!b){x=1;y=0;returna;}
阅读全文
Hdu 1233 还是畅通工程
摘要:最小生成树与并查集的使用。第一次写最小生成树哦,还是Kruskal算法高效、简洁。CODE:#include<stdio.h>#include<stdlib.h>#include<string.h>#include<algorithm>usingnamespacestd;constintmaxn=5100;intv[maxn],u[maxn],w[maxn];//u,线段起始点。v,线段终点。w,权值。intr[maxn];//保存边序号,便于间接排序intp[maxn];//并查集intcmp(constinti,constintj)//间接排
阅读全文
Hdu 1232 畅通工程
摘要:这是一个全裸的并查集,其实就是求有多少个不同的连通分量。第一次用并查集,理解的差不多了,接下来就是应用啦。CODE:#include<stdio.h>#include<stdlib.h>#include<stdlib.h>#include<string.h>usingnamespacestd;constintmaxn=1002;intp[maxn];//p用来记录父节点intrank[maxn];//rank用来记录节点数intfind(intx){returnp[x]==x?x:p[x]=find(p[x]);}voidUnion(intx,i
阅读全文
Hdu 1029 Ignatius and the Princess IV
摘要:卡特兰数的模拟。CODE:#include<stdio.h>#include<stdlib.h>#include<string.h>#include<math.h>usingnamespacestd;#defineMAX101#defineBASE10000inta[101][MAX];voidmultiple(inta[],intsize,intb){inti,j;intcarry=0;for(i=size-1;i>=0;i--){carry+=a[i]*b;a[i]=carry%BASE;carry=carry/BASE;}return
阅读全文
Hdu 1014 Uniform Generator
摘要:数学题,用hash记录元素出现次数,有重复那么马上退出。循环次数最多为mod次就可以判断是否重复。CODE:#include<stdio.h>#include<stdlib.h>#include<string.h>usingnamespacestd;constintmaxn=100001;inthash[maxn];intmain(){intstep,mod;while(~scanf("%d%d",&step,&mod)){inti;intflag=0;intans=0;memset(hash,0,sizeof(hash)
阅读全文
Hdu 1283 最简单的计算器
摘要:简单模拟题。CODE:#include<stdio.h>#include<stdlib.h>#include<string.h>#include<ctype.h>usingnamespacestd;constintmaxn=201;intM1,M2,R1,R2,R3;chars[maxn];intmain(){while(~scanf("%d%d",&M1,&M2)){inti,j;R1=R2=R3=0;scanf("%s",s);intl=strlen(s);for(i=0;i<l;
阅读全文
Hdu 1250 Hat's Fibonacci
摘要:模拟高精度。第一天由于输入的时候判断是否为0,结果果断超时。额。。。结果第二天重新写的时候马上AC了。泪奔!CODE:#include<cstdio>#include<cstdlib>#include<cstring>usingnamespacestd;constintmaxn=535;intfibo1[maxn];intfibo2[maxn];intfibo3[maxn];intfibo4[maxn];intresult[maxn];voidoutput()//输出{inti;for(i=maxn-1;i>=0&&result[i]=
阅读全文
Hdu 2564 词组缩写
摘要:简单模拟题。CODE:#include"stdio.h"#include"string.h"#include"stdlib.h"#include"math.h"#include"ctype.h"usingnamespacestd;chara[101],str[101];intmain(){inti,j;intt;scanf("%d",&t);getchar();while(t--){gets(a);intlen=strlen(a);i=0;j=0;while(a[i]
阅读全文
Hdu 1262 寻找素数对
摘要:简单模拟题。CODE:#include<stdio.h>#include<stdlib.h>#include<string.h>usingnamespacestd;constintmaxn=10001;intprime[maxn];intvis[maxn]={0};inttot;voidinit(){inti,j;for(i=2,tot=0;i<maxn;i++)if(!vis[i]){prime[tot++]=i;for(j=i*i;j<maxn;j+=i)vis[j]=1;}return;}intis_prime(intv){intl=0,h
阅读全文
Hdu 1237 简单计算器
摘要:思路:一开始我也不会写,最主要的就是不好分辨运算符的优先级。最后我去网上参考了别人的代码,然后自己顺着别人的思路想了想,就有了一下的代码!CODE:#include<stdio.h>#include<stdlib.h>#include<string.h>#include<ctype.h>usingnamespacestd;constintmaxn=201;chars[maxn];intp,l;doubleget()//先算a*b或者a/b的值. {doublea,b;charopt;a=0.0;while(isdigit(s[p])){a*=10
阅读全文
Hdu 1239 Calling Extraterrestrial Intelligence Again
摘要:简单模拟题。只要理解了题意,基本上都写得出的。思路1:首先知道求的是素数,那么通过筛选法打表。由于p/q<=1 --> p <= sqrt(m); a/b <= p/q --> a*q <= b*p;p*q的值要最大,那么就枚举所有的值那么就可以求出正确的数字啦。(优化过的代码,顺便复习下最基础的东西,其实直接枚举也可以过的~)CODE:#include<stdio.h>#include<stdlib.h>#include<string.h>#include<math.h>usingnamespacestd;c
阅读全文
斐波那契数列(记忆化搜索)
摘要:第一个记忆化搜索,理解得差不多啦。贴下代码咯~CODE:1#include<stdio.h>2#include<stdlib.h>3#include<string.h>4usingnamespacestd;56intFIB[1001];78intfib(intn)9{10inti;11if(n>2)returnFIB[n]==-1?FIB[n]=fib(n-1)+fib(n-2):FIB[n];12elsereturn1;1314}151617intmain()18{19intn;20memset(FIB,-1,sizeof(FIB));21FIB[0
阅读全文
Hdu 1279 验证角谷猜想
摘要:开始以为好难,会无限循环。后来发现题目中有一定会得到1这句话,那么就轻易AC了。好开心呐!~CODE:#include<stdio.h>#include<stdlib.h>#include<string.h>usingnamespacestd;constintmaxn=300001;__int64odd[maxn];inttot;voidprint(intn){tot=0;if(n==0){printf("Nonumbercanbeoutput!\n");return;}while(n!=1){if(n&1){odd[tot++]
阅读全文
Hdu 1236 排名
摘要:简单模拟。注意结构体的二级排序以及字符串的排序。由于排序函数中间的n与N混淆,贡献了many WA。CODE:#include<stdio.h>#include<stdlib.h>#include<string.h>#include<algorithm>usingnamespacestd;intscore[15];constintSIZE=1010;structstu{chars[21];intgrade;}a[SIZE];intcmp(constvoid*a,constvoid*b){stu*p1=(stu*)a;stu*p2=(stu*)b;
阅读全文
Hdu 1235 统计同成绩学生人数
摘要:第一次只直接枚举写的,效率比较低。由于知道网上一定有更好的方法,所以去参考了别人的代码。所以第二次是用hash写的。CODE:#include<stdio.h>#include<stdlib.h>#include<string.h>usingnamespacestd;constintmaxn=1001;inta[1001];intsearch(int*a,intn,intv){inttot=0;for(inti=0;i<n;i++){if(a[i]==v)tot++;}returntot;}intmain(){intn;while(~scanf(&qu
阅读全文
Hdu 1234 开门人和关门人
摘要:简单字符串排序问题。CODE:#include<stdio.h>#include<stdlib.h>#include<string.h>#include<algorithm>usingnamespacestd;constintSIZE=101;structindex{charstr[16];intbeg,end;}a[SIZE];intcmp1(constvoid*a,constvoid*b){index*p1=(index*)a;index*p2=(index*)b;returnp1->beg>p2->beg?1:-1;}in
阅读全文
Hdu 1231 最大连续子序列
摘要:基础DP。CODE:#include<stdio.h>#include<stdlib.h>#include<string.h>usingnamespacestd;constintmaxn=10001;inta[maxn];intbeg,end;//开始,结束intget_max(int*a,intn)//算法复杂度为O(n){inti,j;beg=end=0;intMaxSum=0,ThisSum=0,index=0;intcnt=0,pos=0;for(i=0;i<n;i++){ThisSum+=a[i];if(a[i]<0)cnt++;//记
阅读全文
Hdu 1128 A+B
摘要:简单模拟题。代码有点乱,感觉自己实现起来也有点麻烦。要加大力度练习啦!~CODE:#include<stdio.h>#include<stdlib.h>#include<string.h>usingnamespacestd;constintmaxn=101;charstr[11][20]={"zero","one","two","three","four","five","six","seven",&
阅读全文
Hdu 1170 Balloon Comes!
摘要:简单模拟题。CODE:#include<stdio.h>#include<stdlib.h>#include<string.h>#include<ctype.h>usingnamespacestd;constintmaxn=101;chars[maxn];inta[maxn];intget(char*s,int*a){intl=strlen(s);inttot=0,i=0,num=0;while(i<l){for(;i<l&&isdigit(s[i]);i++){num=num*10+s[i]-'0';
阅读全文
Hdu 1161 Eddy's mistakes
摘要:简单模拟题,主要是库函数的使用。fets(s, maxn, stdin);它使用时是一行一行的读入,且读取最大的字符数为maxn-1;最后补'\0',一旦遇到回车符'\n‘读取工作就会停止。这'\n'是该数组最后一个有效字符,再往后就是'\0'了。CODE:#include<stdio.h>#include<stdlib.h>#include<ctype.h>#include<string.h>usingnamespacestd;constintmaxn=1001;chars[maxn];i
阅读全文
Hdu 1157 Who's in the Middle
摘要:简单模拟题。求中位数CODE:#include<stdio.h>#include<stdlib.h>#include<string.h>#include<algorithm>usingnamespacestd;constintmaxn=10001;inta[maxn];intcmp(inta,intb){returna<b;}intmain(){intn;while(~scanf("%d",&n)){inti;for(i=0;i<n;i++)scanf("%d",&a[i]);s
阅读全文
Hdu 1229 又是A+B
摘要:简单模拟题。CODE:#include<stdio.h>#include<stdlib.h>#include<string.h>usingnamespacestd;intcheck(inta,intb,intk){inti,j;intsum1=0,sum2=0;for(i=0;i<k;i++){intx=a%10;inty=b%10;if(x!=y){return0;}else{sum1+=x;sum2+=y;a/=10;b/=10;}}if(sum1==sum2)return1;}intmain(){inta,b,k;while(~scanf(&qu
阅读全文
Hdu 1205 吃糖果
摘要:简单模拟题。找规律,只要最大的那个数max-(s-max)<=1即可全部吃完。CODE:#include<stdio.h>#include<stdlib.h>#include<string.h>#include<math.h>usingnamespacestd;constintmaxn=1000001;inta[maxn];intmain(){intT;intn;__int64s;//定义为__int64,要不会WAscanf("%d",&T);while(T--){inti;s=0;__int64max=-1;
阅读全文
Hdu 1197 Specialized Four-Digit Numbers
摘要:简单模拟:CODE:#include<stdio.h>#include<stdlib.h>#include<string.h>#include<algorithm>#include<stack>#include<ctype.h>#definemin2000#definemax10000usingnamespacestd;constintmaxn=101;chars1[maxn],s2[maxn];inttot1,tot2;intinit(intx)//计算一个数的树根之和{intsum=0;while(x){sum+=x%
阅读全文
Hdu 1200 To and Fro
摘要:简单模拟。CODE:#include<stdio.h>#include<string.h>#include<stdlib.h>usingnamespacestd;constintmaxn=101;chars[maxn][maxn];intmain(){intc;intcnt;charstr[201];while(~scanf("%d",&c),c){inti,j;scanf("%s",str);intl=strlen(str)/c;cnt=0;for(i=0;i<l;i++){if(i%2==0){for
阅读全文
Hdu 1303 Doubles
摘要:简单模拟。CODE:#include<stdio.h>#include<stdlib.h>#include<string.h>usingnamespacestd;inta[16];intcmp(constvoid*a,constvoid*b){return*(int*)a-*(int*)b;}intmain(){intn;inttot=0,sum=0;while(scanf("%d",&n)){inti,j;if(n==-1)break;if(n){a[tot++]=n;}else{qsort(a,tot,sizeof(int),
阅读全文
Hdu 1287 破译密码
摘要:思路:异或运算的运用,破译密码时一定存在一个大写字母使得所有的原文在'A'~'Z'之内。异或运算法则: 1. a ^ b = b ^ a 2. a ^ b ^ c = a ^ (b ^ c) = (a ^ b) ^ c; 3. d = a ^ b ^ c 可以推出 a = d ^ b ^ c. 4. a ^ b ^ a = b. 相关链接(http://acm.hdu.edu.cn/showproblem.php?pid=1287)CODE:#include<stdio.h>#include<stdlib.h>#include<st
阅读全文
Hdu 1283 钱币兑换问题
摘要:思路:首先看能兑换多少个三分硬币的,然后当三分硬币分别为1,2,3,.... n时有多少个2分硬币的,为什么要这样确定了?因为只要还可以兑换出三分硬币和二分硬币的那么剩下的价值一定可以让价值为1的硬币塞满。开头为什么s为N/3+1呢?因为可以这样想,假设N=7,那么只包含3分硬币和1分硬币的组合方式为:3,3,1; 3,1,1,1,1;所以N/3是实际上可以容纳三分硬币的个数。而增加1是因为可以全部换成1分的硬币。有人会疑问,那么t = (N-3*i)/2不是会重复吗?这是不可能的,因为硬币的价值是递增的,只有当i的值为N/3时,t的值可以为0或者1。所以不会重复。CODE:#include&
阅读全文
Hdu 1282 回文数猜想
摘要:简单模拟。CODE:#include<stdio.h>#include<stdlib.h>#include<string.h>usingnamespacestd;constintmaxn=101;chars[maxn];intnum[2000],cnt;intis_hw(intx)//是否是回文数{inti;sprintf(s,"%d",x);intl=strlen(s);intok=1;for(i=0;i<l;i++){if(s[i]!=s[l-i-1]){ok=0;break;}}if(ok)return1;return0;}i
阅读全文
Hdu 1128 Self-number
摘要:先前的思路是观察1-10的数,可以用纯暴力从2,6,10一直循环到1000000从而找出自身数,但是会超时。于是我就想,从一个数算出下一个数,如132->138,通过138->150这样由一个数得到另一个数。这样类似于筛选法,而且只要循环一边就可以得到答案了。CODE:#include<stdio.h>#include<stdlib.h>#include<string.h>#defineMAX_1000001usingnamespacestd;constintSIZE=1000001;intvis[SIZE]={0};voidinit(intn)
阅读全文
Hdu 1106 排序
摘要:题意要理解好。分割后的整数有若干零,则输出零。CODE:#include<stdio.h>#include<stdlib.h>#include<string.h>usingnamespacestd;constintmaxn=1001;chars[maxn],save[maxn];inta[maxn];intcmp(constvoid*a,constvoid*b){return*(int*)a-*(int*)b;}intmain(){inti,j;while(~scanf("%s",s)){intl=strlen(s);inttot1=0;
阅读全文
Hdu 1088 Write a simple HTML Browser
摘要:简单模拟:CODE:#include<stdio.h>#include<stdlib.h>#include<string.h>usingnamespacestd;chars[81];intmain(){intfirst=1;//判断是否是在行首intcnt=0;while(~scanf("%s",s)){inti,j;if(!strcmp(s,"<br>")){printf("\n");cnt=0;first=1;//每次换行后下一行必定在行首,所以first=1;continue;}i
阅读全文
Hdu 1212 Big Number
摘要:同余定理的运用:(a+b)%c=(a%c+b%c)%c;(a*b)%c=(a%c*b%c)%c;CODE:#include<stdio.h>#include<stdlib.h>#include<string.h>usingnamespacestd;constintmaxn=1001;chars[maxn];intmain(){intm;while(~scanf("%s%d",s,&m)){intl=strlen(s);intans=0;for(inti=0;i<l;i++){ans=(ans*10%m+(s[i]-'
阅读全文
Hdu 1070 Milk
摘要:结构体二级排序,注意保质期只有5天就行。CODE:结构体二级排序(快速)#include<stdio.h>#include<stdlib.h>#include<string.h>#include<math.h>#include<algorithm>usingnamespacestd;constintSIZE=101+10;structnode{charstr[110];intp,v;doubler;}a[SIZE];intcmp(constvoid*a,constvoid*b){node*p1=(node*)a;node*p2=(no
阅读全文
Hdu 1063 Exponentiation
摘要:模拟高精度题。这题也真是。。。无语了。CODE:#include<stdio.h>#include<stdlib.h>#include<string.h>usingnamespacestd;#defineEND-1constintmaxn=1001;intBigNumber[maxn]={0};voidmultiple(inta[],intn)//大整数相乘{inti,j;intc=0;//进位for(i=1;i<=a[0];i++){a[i]=a[i]*n+c;c=a[i]/10;a[i]%=10;}while(c){a[i++]=c%10;c/=1
阅读全文
POJ图论
摘要:一、最短路POJ 2449 Remmarguts' Date(中等)http://acm.pku.edu.cn/JudgeOnline/problem?id=2449题意:经典问题:K短路解法:dijkstra+A*(rec),方法很多相关:http://acm.pku.edu.cn/JudgeOnline/showcontest?contest_id=1144该题亦放在搜索推荐题中POJ 3013 - Big Christmas Tree(基础)http://acm.pku.edu.cn/JudgeOnline/problem?id=3013题意:最简单最短路,但此题要过,需要较好的
阅读全文
【转】一位Acmer过来人的经验
摘要:很多ACMer入门的时候,都被告知:要多做题,做个500多道就变牛了。其实,这既不是充分条件、也不会是必要条件。我觉得一般情况下,对于我们普通学校的大学生,各方面能力的差距不会太大,在这种情况下,训练和学习的方法尤为重要。其实,500题仅仅是一个标志,而且仅仅表示你做ACM-ICPC有一定的时间,我们训练的目的是什么?我觉得有四点1、提高编程能力2、学习算法,(读书,读论文,包括做一些题目验证)3、准备好面临将到来的挑战(熟悉题型,调整心态)4、启发思维。这里四个目的,从训练的角度上,重要性逐次递减;为什么呢?因为前面的因素是后面的基础。而是后面的目的,想达成越为不易。我觉得前3者能保证你ac
阅读全文
Hdu 2068 RPG的错排
摘要:开始我的思路是:固定一半,另一半用组合公式cn1+cn2+cn3+cn4+.....+cni;最后用全排列减去它们即可。最后发现思路完全不对,必须用错排公式进行计算。即Cnm*a[N-m]; 从N个人中选出m个正确的,用错排公式算出(N-m)没在对应位置的个数。根据分步计数原理,可以得到结果。CODE:#include<stdio.h>#include<stdlib.h>#include<string.h>#include<math.h>usingnamespacestd;inta[21];doublePaC(intn,intm)//Permut
阅读全文
Hdu 1049 Climbing Worm
摘要:CODE:#include<stdio.h>#include<stdlib.h>#include<string.h>#include<algorithm>usingnamespacestd;intn,u,d;intget_time(){inti;intx=u-d;intcur=0;for(i=1;i<=n/x;i++){cur=i*x;if(cur>=n-u&&cur<n)//还差一步到顶点{break;}}cur=2*i+1;//包括上升和下降的时间,所以乘以2returncur;}intmain(){whil
阅读全文
MST(Minimum Spannirng Tree)性质的证明
摘要:什么是MST?MST就是Most Small Tree,应该就是最小生成树的意思吧,具体不是很清楚,MST性质就是最小生成树性质(以下简称MST性质),我们在看最小生成树的算法的时候,很多情况下都有关于这条性质的说明,比如,历史上最经典的Prim算法和Kruskal算法就是根据这个性质演算出来的Algorithm,MST性质的声明如下:最小生成树性质:设G=(V,E)是一个连通网络,U是顶点集V的一个真子集。若(u,v)是G中一条“一个端点在U中(例如:u∈U),另一个端点不在U中的边(例如:v∈V-U),且(u,v)具有最小权值,则一定存在G的一棵最小生成树包括此边(u,v)。关于这个性质的
阅读全文
Hdu 1022 Train Problem I
摘要:思路不清楚。以为要把所有的出栈,进栈的可能都列举出来。正确思路:这个是栈的应用,我们用一个栈s来存放列车的入栈序列, 用一个数组flag存放进出站顺序,如果栈顶和O2的队首是相同的,那么执行出站,且O2指向下一个要出站的坐标,flag标记进站,如果不相同,那么肯定是列车继续进站,s进行push就可以了,flag标记出站,最后如果s的元素已经超过了n,说明n个列车都已经进站了,下一个还是进站肯定不正确。CODE:#include<stdio.h>#include<stdlib.h>#include<string.h>#include<math.h>
阅读全文
扩展欧几里德算法
摘要:首先扩展欧几里德主要是用来与求解线性方程相关的问题,所以我们从一个线性方程开始分析。现在假设这个线性方程为a*x+b*y=m,如果这个线性方程有解,那么一定有gcd(a,b) | m,即a,b的最大公约数能够整除m(m%gcd(a,b)==0)。证明很简单,由于a%gcd(a,b)==b%gcd(a,b)==0,所以a*x+b*y肯定能够整除gcd(a,b),如果线性方程成立,那么就可以用m代替a*x+b*y,从而得到上面的结论,利用上面的结论就可以用来判断一个线性方程是否有解。 那么在a*x+b*y=m这个线性方程成立的情况下,如何来求解x和y呢? 1.令a1=a/gcd(a,b),b1=.
阅读全文
浙公网安备 33010602011771号