归类

JAVA大数速成

std::ios::sync_with_stdio(false);

加了这句cin cout就能和scanf差不多速度,但是加了这句就不能用scanf和printf

  1. #pragma comment(linker, "/STACK:1024000000,1024000000")    

读写外挂:

  1. inline bool rd(int &n){    
  2.     int x = 0, tmp = 1;    
  3.     char c = getchar();    
  4.     while((c < '0' || c > '9') && c != '-' && c != EOF) c = getchar();    
  5.     if(c == EOF) return false;    
  6.     if(c == '-') c = getchar(), tmp = -1;    
  7.     while(c >= '0' && c <= '9') x *= 10, x += (c - '0'),c = getchar();    
  8.     n = x*tmp;    
  9.     return true;  
  10. }    
  11. inline void pt(int n){    
  12.     if(n < 0)  
  13.         putchar('-'), n = -n;    
  14.     int len = 0,data[20];    
  15.     while(n)    
  16.         data[len++] = n%10, n /= 10;     
  17.     if(!len) data[len++] = 0;    
  18.     while(len--) putchar(data[len]+48);    
  19. }  




归并排序(AC),货郎担问题(AC),黑白染色(已解),最小树形图http://blog.youkuaiyun.com/wsniyufang/article/details/6747392(有向图的最小生成树)(AC) , 模拟退火,差分约束,旋转卡壳,种类并查集http://blog.youkuaiyun.com/shahdza/article/details/7779230 计算几何(已解) RMQ(AC),扫描线(AC)

http://cpp.zjut.edu.cn/ShowProblem.aspx?ShowID=1872 面积并http://blog.youkuaiyun.com/jasonzhu8/article/details/6010980 http://www.cnblogs.com/ch3656468/archive/2011/03/28/1997443.html

网络流典题http://acm.sgu.ru/problem.php?contest=0&problem=438(AC

上下界网络流http://hi.baidu.com/newfarking/item/b9780317201c9651f0090e64?qq-pf-to=pcqq.c2c(AC)

可持续化treapgithub.com/9974/DataStructures/blob/master/treap/%E5%8F%AF%E6%8C%81%E4%B9%85%E5%8C%96treap.cpp

最大权闭合图(AC)

自适应simpson 求积分 && 变步长积分法
树重心:找到一个节点u作为root,使得root的所有孩子的节点数的最大值最小。那么这个点就是重心 http://www.docin.com/p-589701802.html#documentinfo 例题:POJ1655(AC)
 
博弈树
后缀数组
哈夫曼树
 最小支配集问题
中国邮递员问题:一般图中国邮递员问题算法是 (用状压DP+floyd,AC) 求一般图最小权匹配, 完全图直接公式
最小权匹配算法(KM,AC)
上下界的最大流 (AC)
莫队算法

treap(树堆) (AC)

vector<ll>G;
sort(G.begin(),G.end());
G.resize(unique(G.begin(),G.end())-G.begin);

斐波那契数列 前n项和 Sum(n) = f(n+2)-1 (AC)

 二次剩余 
环状树形dp
双调队列(AC)
------------------------
(以下来自BIT神牛所授。。
把以1为根的树:
5
1 2
1 3
3 4
3 5
dfs得到欧拉序列是 1 2 1 3 4 3 5 3 1
那么以1为根,欧拉序列就是 1 2 1 3 4 3 5 3 1
复制一下自己 ,得到:
1 2 1 3 4 3 5 3 1  2 1 3 4 3 5 3 1

此时。如果将根变换为2,则欧拉序列就是
2 1 3 4 3 5 3 1 2 1 3 4 3 5 3 1
即,如果是以i点为根,则欧拉序列就是i点第一次出现的位置到后面9个。则用树状数组维护一下这个序列就能解决HDU4836了

-------------------------
  1. #include<functional>  
  2.   
  3. #include<queue>  
  4. using namespace std;  
  5.   
  6. priority_queue<int, vector<int>, greater<int> > q; 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值