![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
小知识
双之城
额外去惹人王企鹅
展开
-
线性筛选素数法(O(n)复杂度)
昨天有个SB给我讲了一个线性筛选素数法O(n)的复杂度,感觉很神奇,自己看了看, 确实牛b的样子。其实它不像一般的筛选素数法会重复操作标记非素数,此方法不会重复 之行操作,遍历只需一次就行。 void get_prime() { int num = 0 ; memset(vis,false,sizeof(vis)); for(int i = 2 ; i < n ; i原创 2013-12-09 21:08:37 · 1432 阅读 · 0 评论 -
鞍山邀请赛 部分题
http://acm.hdu.edu.cn/showproblem.php?pid=5073原创 2014-10-22 18:43:51 · 445 阅读 · 0 评论 -
hdu-1556 Color the ball && nyoj -123 士兵杀敌(四)----------》树状数组
#include #include int m[1000001],i,N,n; int lowbit(int x) { return x&(-x); } int GetSum(int pos) { int res=0; while(pos>0) { res+=m[pos]; pos-=lowbit(pos); } re原创 2014-04-04 16:16:03 · 539 阅读 · 0 评论 -
C语言位运算符
1 、&(按位与) 运算规则:0&原创 2014-04-21 17:06:13 · 478 阅读 · 0 评论 -
hdu-Frosh Week(树状数组)
求逆序数 ----》 离散化 #include #include #include #include using namespace std; #define M 1000005 typedef __int64 LL; LL a[M]; int n; struct node { LL x,y; }s[M]; bool cmp(node p,node q) { return p.原创 2014-04-06 19:12:48 · 697 阅读 · 0 评论 -
hdu- 2642 Stars 二维树状数组
注意树状数组下标原创 2014-04-06 08:49:54 · 517 阅读 · 0 评论 -
hdu-1541 Stars-----> 树状数组
此题由于有可能出现坐标为 0原创 2014-04-05 13:33:14 · 482 阅读 · 0 评论 -
hdu-Cube(三位树状数组)
本题主要考察空间想象能力,同样原创 2014-04-06 17:14:52 · 558 阅读 · 0 评论 -
hdu-2838(Cow Sorting)----》树状数组
#include #include typedef __int64 LL; const LL M = 100005; LL a[M],c[M]; LL n; LL lowbit(LL x) { return x&(-x); } void add(LL pos,LL x) { LL num = pos; while(pos <= n) { a[p原创 2014-04-05 08:42:55 · 586 阅读 · 0 评论 -
nyoj- 117 求逆序数 && hdu-sort it----> 树状数组
nyoj-117 hdu-sort it原创 2014-04-05 08:14:24 · 493 阅读 · 0 评论 -
nyoj-228(士兵杀敌五)&& hdu-1556 Color the ball
巧用数组,貌似很牛逼,还需多多体会才能原创 2014-04-04 20:21:01 · 520 阅读 · 0 评论 -
hdu-1166敌兵布阵(树状数组)
此处的树状数组讲解请点击:here~~~原创 2014-04-04 13:39:47 · 458 阅读 · 0 评论 -
nyoj-222 整数中的1
题目链接:http://acm.nyist.net/JudgeOnline/problem.php?pid=222 整数中的1 时间限制:3000 ms | 内存限制:1000 KB 难度:4 描述给出两个非负32位整型范围内的数a,b,请输出闭区间[a,b]内所有数二进制中各个位的1的总个数。 输入一行,给出两个整形数a,b(0 输出一行,原创 2013-12-11 20:31:35 · 776 阅读 · 0 评论 -
hdu-5063 Operation the Sequence
题意:给你三种操作 1、原创 2014-10-12 21:12:53 · 463 阅读 · 0 评论