摘要:
int dp[200050][20],a[200050];void rmq_st(int n){ int i,j; for(i=1;i#include #include #include #include #include using namespace std;const int MA... 阅读全文
摘要:
题意:给出两个数的gcd和lcm 求这两个数,要求为这两个数相加是所有满足条件的数的最小的那一对。做法:关于gcd和lcm有两个基本公式。1.a*b=gcd*lcm 2.a=k1*gcd,b=k2*gcd,c=lcm/gcd,得 k1*k2=c; 由公式2可得。对c进行拆分后所得所有因子,可任意分配... 阅读全文
摘要:
#include #include #include #include #include using namespace std;typedef long long int64;int64 gcd(int64 a,int64 b){ return b==0?a:gcd(b,a%b);}int6... 阅读全文