NOIP模板】的更多相关文章

NOIP模板总结 进考场先打一份缺省源: # include <cstdio> # include <iostream> # include <cstring> # include <string> # include <algorithm> # include <cmath> # define R register int # define ll long long using namespace std; int main() {…
先占个坑 [update]noip结束了,弃了 一.图论 1.单源最短路 洛谷P3371 (1)spfa 已加SLF优化 #include <iostream> #include <cstdio> #include <algorithm> #include <cstring> using namespace std; ,M=5e5+,INF=; inline int read(){ ,f=; ;c=getchar();} +c-';c=getchar();}…
图论 数据结构 数学 其他: 洛谷模板:a,b两个字符串,求b串在a串中出现的位置 #include<iostream> #include<cstdio> #include<cstring> using namespace std; ],s2[]; ]; int main(){ scanf(,s2+); len1=strlen(s1+);len2=strlen(s2+); ,k=;i<=len2;i++){ ]&&k>;k=Next[k]);…
自己敲模板还是有很多容易错的地方 写在注释里面了 LCA #include<bits/stdc++.h> #define REP(i, a, b) for(register int i = (a); i < (b); i++) #define _for(i, a, b) for(register int i = (a); i <= (b); i++) using namespace std; ; //以后MAXN改成N.因为MAXM和MAXN不容易区分 ; ]; int head[…
快排 procedure qsort(l,r:longint); var i,j,t,m:longint; begin i:=l; j:=r; m:=a[(i+j) ]; repeat while a[i]<m do inc(i); while m<a[j] do dec(j); if i<=j then begin t:=a[i]; a[i]:=a[j]; a[j]:=t; inc(i); dec(j); end; until i>j; if i<r then qsort(…
date: 20180820 spj: 距离NOIP还有81天 目录 STL模板: priority_queue 的用法:重载<,struct cmpqueue 的用法 stack 的用法vector的用法map和set的用法* 遍历容器中得所有元素dequeue双端队列的用法 基础数论模板: gcdex_gcd求phi():筛选法.定义法筛选法求质数判断质数的一般方法快速幂矩阵快速幂求逆元的方法(递推式.快速幂.ex_gcd)卢卡斯定理的实现组合数朴素公式组合数递推式(杨辉三角)组合数取模二项…
Preface 这篇博客记录的是我联赛前虽然只有两天了的打板子记录. 只求真的能给我起到些作用吧,一般按照难度排序. 而且从这篇博客开始我会用H3的标题代替H4 为了节约篇幅,以下的代码一般均以class的形式给出,模板题均来自Luogu. 快读快输(文件操作) 这是基础中的基础吧,这个感觉敲出来还是没什么问题的(默认不读/输负数) class FileInputOutput { private: #define S 1<<21 #define tc() (A==B&&(B=(…
联赛除去今天刚好只有一个星期了,最后一个星期也很关键,要吃好睡好保持心情愉悦.当然也免不了最后的复习计划. 首先是模板,之前还有很多模板没有复习到,这些东西是一定要落实到位的. 每天往后面写一点...一定要写完...都是很基础的板子了... [x] 11.3 [模板]KMP字符串匹配 [ ] 11.3 [模板]左偏树(可并堆) [x] 11.3 [模板]最近公共祖先(LCA) [x] 11.3 [模板]最长公共子序列 [x] 11.4 [模板]网络最大流 [x] 11.4 [模板]最小费用最大流…
距离NOIP还有25天 可以去放弃一些巨难得题目去搞一些模板了 -------在校老师的原话 一·快排 虽然可以手打,最好用STL,里面有很多优化,会快很多 #include<iostream> #include<algorithm> using namespace std; struct node { int x,y; }a[maxn]; bool cmp(node a,node b) { return a.x<b.x; } int main() { sort(a+,a++…
2300. [noip普及组第一题]模板题 (File IO): input:template.in output:template.out 时间限制: 1000 ms  空间限制: 262144 KB  具体限制 题目描述 输入 输出 样例输入 样例输出 数据范围限制 朴素算法 考试开始的前一个小时我一直在折腾朴素算法 -> 对拍 #pragma GCC optimize(2) #include<bits/stdc++.h> #define IL inline using namesp…