会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
shuguangzw
博客园
首页
新随笔
联系
订阅
管理
上一页
1
···
14
15
16
17
18
19
20
21
22
···
30
下一页
2016年4月13日
LightOJ 1220 Mysterious Bacteria 水题
摘要: 暴力就行了,找出素因子,正的最多是30,然后负的最多是31(这一点wa了一次) #include <cstdio> #include <iostream> #include <ctime> #include <vector> #include <cmath> #include <map> #incl
阅读全文
posted @ 2016-04-13 10:39 shuguangzw
阅读(210)
评论(0)
推荐(0)
2016年4月12日
LightOJ 1236 Pairs Forming LCM 合数分解
摘要: 题意:求所有小于等于n的,x,y&&lcm(x,y)==n的个数 分析:因为n是最小公倍数,所以x,y都是n的因子,而且满足这样的因子必须保证互质,由于n=1e14,所以最多大概在2^13个因子 即8000多因子 所以每次可以递归暴力寻找一个因子,然后选好了以后,看唯一分解不同种素数还有哪种没有用,
阅读全文
posted @ 2016-04-12 22:33 shuguangzw
阅读(141)
评论(0)
推荐(0)
LightOJ 1245 Harmonic Number (II) 水题
摘要: 分析:一段区间的整数除法得到的结果肯定是相等的,然后找就行了,每次是循环一段区间,暴力 #include <cstdio> #include <iostream> #include <ctime> #include <vector> #include <cmath> #include <map> #
阅读全文
posted @ 2016-04-12 21:55 shuguangzw
阅读(110)
评论(0)
推荐(0)
LightOJ 1259 Goldbach`s Conjecture 水题
摘要: 不想说了 #include <cstdio> #include <iostream> #include <ctime> #include <vector> #include <cmath> #include <map> #include <queue> #include <algorithm> #i
阅读全文
posted @ 2016-04-12 21:13 shuguangzw
阅读(153)
评论(0)
推荐(0)
LightOJ 1341 Aladdin and the Flying Carpet 数学
摘要: 题意:给个矩形的面积a,和矩形的最小边长b,问有多少种矩形的方案(不能是正方形) 分析:a可以写成x,y,因为不能是正方形,所以设x<y,那么x<sqrt(a),y>sqrt(a) 所以找到所有小于sqrt(a)的因子,看有几个大于等于b的就是方案数 因子可以由数的唯一分解定理,求得 具体 : 先筛
阅读全文
posted @ 2016-04-12 13:05 shuguangzw
阅读(225)
评论(2)
推荐(0)
2016年4月11日
NOIP2013 花匠 DP 线段树优化
摘要: 网上一堆题解,我写的是N^2优化的那种,nlogn,O(n)的那种能看懂,但是让我自己在赛场写,肯定没戏了 #include <cstdio> #include <iostream> #include <ctime> #include <vector> #include <cmath> #inclu
阅读全文
posted @ 2016-04-11 14:06 shuguangzw
阅读(233)
评论(0)
推荐(0)
2016年4月10日
LightOJ 1370 Bi-shoe and Phi-shoe 欧拉函数+线段树
摘要: 分析:对于每个数,找到欧拉函数值大于它的,且标号最小的,预处理欧拉函数,然后按值建线段树就可以了 #include <iostream> #include <stdio.h> #include <string.h> #include <algorithm> #include <cmath> #inc
阅读全文
posted @ 2016-04-10 11:18 shuguangzw
阅读(209)
评论(0)
推荐(0)
2016年4月8日
BZOJ2818: Gcd 欧拉函数求前缀和
摘要: 给定整数N,求1<=x,y<=N且Gcd(x,y)为素数的数对(x,y)有多少对. 如果两个数的x,y最大公约数是z,那么x/z,y/z一定是互质的 然后找到所有的素数,然后用欧拉函数求一下前缀和就行 #include <iostream> #include <stdio.h> #include <
阅读全文
posted @ 2016-04-08 22:28 shuguangzw
阅读(200)
评论(0)
推荐(0)
2016年4月7日
SPOJ3267 D-query 离线+树状数组 在线主席树
摘要: 分析:这个题,离线的话就是水题,如果强制在线,其实和离线一个思路,然后硬上主席树就行了 离线的代码 #include <iostream> #include <stdio.h> #include <string.h> #include <algorithm> using namespace std;
阅读全文
posted @ 2016-04-07 14:24 shuguangzw
阅读(183)
评论(0)
推荐(0)
2016年4月6日
BZOJ 2588: Spoj 10628. Count on a tree 主席树+lca
摘要: 分析:树上第k小,然后我想说的是主席树并不局限于线性表 详细分析请看http://www.cnblogs.com/rausen/p/4006116.html,讲的很好, 然后因为这个熟悉了主席树,真是神器,强制在线,然后顺便学习了LCA倍增算法 LCA倍增算法是O(nlogn)预处理,然后O(log
阅读全文
posted @ 2016-04-06 15:51 shuguangzw
阅读(167)
评论(0)
推荐(0)
上一页
1
···
14
15
16
17
18
19
20
21
22
···
30
下一页
公告