![](https://img-blog.csdnimg.cn/20201014180756930.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
模板
chaojidage
我只是想多赚点币子,然后好下资源。
展开
-
字典树模板
这个,某人经常用qq查询系统的字典树来查我的号,。。。。。也是醉了。。。。。真的有点无聊#include <cstdio> #include <cstdlib> #include <cstring> #include <cmath> #include <algorithm> using namespace std;const int MaxN = 1e5; struct TRIE { int原创 2016-09-14 22:00:40 · 175 阅读 · 0 评论 -
最小生成树模板
我之前的那个用邻接矩阵的那个。。。就是会爆数据,1e5就爆了数据了。 感谢YG_PP给我的模板。。。#include <cstdio> #include <cmath> #include <cstring> #include <algorithm> using namespace std; const int MaxN = 1e5; int ans, m, n, q, father[MaxN +原创 2016-11-07 20:59:46 · 58 阅读 · 0 评论 -
gcd模板
现想费时间,其实很简单,但是自己做的老是有漏洞,存下吧 这个x,y谁大谁小都行long long gcd(long long x , long long y) { if(y == 0) return x; else return gcd(y , x % y); }原创 2016-10-07 20:53:28 · 488 阅读 · 0 评论 -
字典序的下一个排列
先上模板//数组a的下一个字典序排列。stl貌似会超时。手写还是快 #include<cstdio> #include<cstring> #include<algorithm> using namespace std; int a[1025];void next(int N) { int index = 0; bool flag = false; for(int i = N原创 2016-11-01 09:58:40 · 565 阅读 · 0 评论 -
bfs模板
这个。。。。我突然发现了这么回事,数据结构老师讲的bfs和我学的bfs是一个东西吗????。。。以前的是邻接矩阵的模板。。。现在存一个邻接表的吧。那个。校选终于结束了,我终于有时间写博客,写五子棋,写数据结构大作业了。#include<cstdio> #include<algorithm> #include<cstring> using namespace std;int other[MaxN +原创 2016-11-22 16:38:56 · 301 阅读 · 0 评论 -
字典树模板
这个字典树的模板就是#include<cstdio> #include<cstring> #include<algorithm> #include<cmath> using namespace std;const int N = 2e5 + 10;int lmax = 35 , tail = 0; int trie[32 * N][2] , s[40] , number[32 * N] , d[40原创 2017-03-09 14:33:04 · 193 阅读 · 0 评论 -
kmp模板
串都是从1开始的void Kmp(int a[] , int b[] , int n , int m)//a目的串数目,b匹配串,n目的串数目,m匹配串数目 { if(m > n) return ; int pos = 0 ; nxt[1] = 0; for(int i = 2 ; i <= m ; i++){ while(pos > 0 && b[pos +原创 2016-10-12 20:17:47 · 165 阅读 · 0 评论 -
二分图
简单二分图板子#include <cstdio> #include <cstring> #include <queue> #include <algorithm> #include <cmath>using namespace std; typedef long long LL; const int MaxN = 1000;using namespace std;struct node{ i原创 2017-09-30 21:49:15 · 167 阅读 · 0 评论 -
强连通分量缩点
//有向图强连通分量:分量中任何两点均可通过路径互达,缩点后成为一个DAG #include <cstdio> #include <cstdlib> #include <cmath> #include <cstring> #include <stack> #include <vector> #include <map> #include <algorithm> using namespace std原创 2017-09-30 21:51:56 · 351 阅读 · 0 评论 -
vim命令大全
命令历史 以:和/开头的命令都有历史纪录,可以首先键入:或/然后按上下箭头来选择某个历史命令。启动vim 在命令行窗口中输入以下命令即可vim 直接启动vimvim filename 打开vim并创建名为filename的文件文件命令 打开单个文件vim file同时打开多个文件vim file1 file2 file3 …在vim窗口中打开一个新文件:open file在新窗口中打开文件:s转载 2016-10-01 22:35:35 · 163 阅读 · 0 评论 -
set用法
#include<set> set<LL>s;//定义集合 s.insert(1);//插入 !s.count(x2);//看有还是没有这个集合原创 2016-09-28 22:28:07 · 233 阅读 · 0 评论 -
spfa模板
#include<cstdio> #include<cstring> #include<algorithm> using namespace std; const int MaxN = 1e6; int dis[MaxN + 5] , m , n , a[MaxN + 5] , Inque[MaxN + 5] ,seq[MaxN + 5]; int all , pre[MaxN + 5] , oth原创 2016-09-15 22:42:14 · 338 阅读 · 0 评论 -
二分模板
自己的二分模板,以后写二分就用这个模板,再也不换了#include<cstdio> #include<algorithm> #include<cstring> #include<cmath> using namespace std;typedef long long LL; LL ans = -1 , m; bool check(LL mid) int main() { scanf("%I6原创 2016-09-16 09:51:20 · 193 阅读 · 0 评论 -
分数二分模板
分数二分。。。。。#include<cstdio> #include<algorithm> #include<cstring> #include<cmath> using namespace std;bool ok(double area) {} int main() { int t; scanf("%d", &t); while(t--){ double l原创 2016-09-16 14:12:20 · 305 阅读 · 0 评论 -
线段树模板
线段树模板原创 2016-08-13 15:05:44 · 218 阅读 · 0 评论 -
大素数模板
如果不会,沈阳网络赛基本就gg了,但是那个论文题,我其实还是没有读懂,那是个codeforces的f题,但是,,,,,,真的还是没有读懂。。。我看网络上也没有人读懂。还是留着珍藏吧 题意 求区间[1,N]的质数的个数(1≤N≤1e11)第一个哈 复杂度大概O(n^(3/4))#include<iostream> #include<algorithm> #include<cstdio> #de转载 2016-09-22 22:26:33 · 325 阅读 · 0 评论 -
拓展欧几里得模板
求出A,B的最大公因数,且求出X,Y满足AX+BY= GCD(A,B) 输入:a,b两个整数 &x,&y 输出:a和b的最大公约数 调用后的x,y满足ax+by=GCD(a,b)int ex_gcd(int a , int b , int &x , int &y) { if(b == 0){ x = 1;y = 0; return原创 2016-09-21 22:28:24 · 197 阅读 · 0 评论 -
优先队列基本用法
优先队列:顾名思义,首先它是一个队列,但是它强调了“优先”二字,所以,已经不能算是一般意义上的队列了,它的“优先”意指取队首元素时,有一定的选择性,即根据元素的属性选择某一项值最优的出队~ 百度百科上这样描述的: 优先级队列 是不同于先进先出队列的另一种队列。每次从队列中取出的是具有最高优先权的元素 优先队列的类定义 优先队列是0个或多个元素的集合,每个元素都有一个优先权或值,对优先转载 2016-09-28 18:42:04 · 848 阅读 · 0 评论 -
java大整数模板
importjava.math.BigInteger; publicclassabc { publicstaticvoidmain(String[] args) { BigInteger bigInteger1=newBigInteger("123456789012345689123413241234109999321413253426256");原创 2017-11-23 18:23:16 · 297 阅读 · 0 评论