03 2016 档案
摘要:1、查询表结构 desc 表名 2、显示当前连接用户 show user 3、查看系统拥有哪些用户 select * from all_users; 4、查询当前用户下所有对象 select * from tab; 5、回滚事务 roll; rollback; 6、提交事务 commit; 1. 创
阅读全文
摘要:题意: 给n(1 #include #include using namespace std; typedef long long LL; const int mod=1e9+7,N=1e5+5; char a[N]; LL quick_mod(LL a,LL p) //快速幂 (快速幂利用了二分思想和秦九昭算法) { LL ans=1; while(p) ...
阅读全文
摘要:RGCDQ 题意:F(x)表示x的质因子的种数。给区间[L,R],求max(GCD(F(i),F(j)) (L≤i 10 ^ 6,即在1~1e6的范围内最多有7个素数相乘。so F(x)最大为7,即j #include #include #include using namespace std; typedef long long LL; const int N=1e6+5; int f[N],...
阅读全文
摘要:GCD 题意:输入N,M(2=M的X的个数。 (文末有题) 知识点: 欧拉函数。http://www.cnblogs.com/shentr/p/5317442.html 题解一: 当M==1时,显然答案为N。 当M!=1。 X是N的因子的倍数是 gcd(X,N)>1 && X=N的p的欧拉函数值之和了。 如果dfs不是用的很溜的看解法二。 //解法1: #include #...
阅读全文
摘要:Farey Sequence 题意:给定一个数n,求在[1,n]这个范围内两两互质的数的个数。(转化为给定一个数n,比n小且与n互质的数的个数) 知识点: 欧拉函数: 普通求法:int Euler(int n) { int ans=n; for(int i=0;i1) return ans-ans/n; } 筛选法:(基于素数筛,跟着代码模拟一遍就懂)voi...
阅读全文
摘要:Biorhythms 题意:读入p,e,i,d 4个整数,已知(n+d)%23=p; (n+d)%28=e; (n+d)%33=i ,求n 。 (题在文末) 知识点:中国剩余定理。 /*解释*/ 题解:已知(n+d)%23=p; (n+d)%28=e; (n+d)%33=i 33×28×a模23的逆元为8, 则33×28×8=5544; ...
阅读全文
摘要:Happy 2004 题意:s为2004^x的因子和,求s%29. (题于文末) 知识点: 素因子分解:n = p1 ^ e1 * p2 ^ e2 *..........*pn ^ en 因子和: Sum=(p1^0+p1^1….p1^e1)*(p2^0+p2^1…p2^e2)……(pn^0+…pn^en) =; 积性函数:s(xy)...
阅读全文
摘要:Help Hanzo 题意:求a~b间素数个数(1 ≤ a ≤ b < 231, b - a ≤ 100000). (全题在文末) 题解: a~b枚举必定TLE,普通打表MLE,真是头疼。。 b - a ≤ 100000 是关键。 类似素数筛的方法: 1.初始化vis[]=0 ; 2.素数的倍数vi
阅读全文
摘要:题意:求f(n)=1/1+1/2+1/3+1/4…1/n (1 ≤ n ≤ 108).,精确到10-8 (原题在文末) 知识点: 调和级数(即f(n))至今没有一个完全正确的公式,但欧拉给出过一个近似公式:(n很大时) f(n)≈ln(n)+C+1/2*n 欧拉常数值:C≈0.57721566490153286060651209 c...
阅读全文
摘要:http://acm.hust.edu.cn/vjudge/contest/view.action?cid=109329#problem/B 全题在文末。 题意:在a,b中(a,b #include #include using namespace std; typedef long long LL; const int N=1e7+5; const int NN=1e6; unsigne...
阅读全文
摘要:http://acm.hust.edu.cn/vjudge/contest/view.action?cid=109329#problem/C 题目在文末 题意:1~n (n:1~1012)中,因子和为偶数的有几个。题解: 因子和 Sum=(p1^0+p1^1….p1^e1)*(p2^0+p2^1…p
阅读全文
摘要:1. 秦九昭算法:<多项式> || \/ 求n次多项式f(x)的值就转化为求n个一次多项式的值。 HDU 1111 处理 :减ai后,除B,直到0为止 复数的模 |Z|=|a+bi|=sqrt(a*a+b*b) , 除法 (a+bi)/(c+di)=(ac+bd)/(c*c+d*d)+(bc-ad)
阅读全文
摘要: HDU1573 /*中国剩余定理*/ 10. 公式 1. ab(mod m) (a mod m) b (mod m) (化简); HDU1395 (2^x 1(mod n) 2^x%n 1(mod n) ) 2. xa(mod m) x*ka*k(mod m); 3. xn-a(mod m)
阅读全文

浙公网安备 33010602011771号