
阿柟的NOIP冲刺计划
阿柟的小星星
大学四年,归来一张白纸
展开
-
【NOIP模板】 线段树
#include <cstdio>#include <cstring>#include <algorithm>using namespace std;char s[10];int a[1000000], root, n, T;struct Node { int sum, flag;} t[1000000];void pushdown(int root, int L, int R)原创 2017-09-22 18:33:10 · 226 阅读 · 0 评论 -
NOIP历年题目分析
em……主要是对近几年来NOIP的考试真题的考点分析。 鉴于NOIP一直以来没有固定的考察范围,复习的时候一般是按照约定俗成的范围学习,然而CCF就是不按常理出牌(2016年因为两个dp吃键盘的人有多少??),出题难以捉摸。但是总体来说,过于困难的问题考察到的几率还是非常小的。模拟 NOIP 2016 DAY 1 T1 NOIP 2015 DAY 1 T1 NOIP 2014 DAY 1 T原创 2017-10-23 22:17:50 · 624 阅读 · 0 评论 -
阿柟的NOIP冲刺计划
/*本计划旨在通过励精图治发愤图强通过不懈努力最终拿到NOIP一等奖。*/基础篇·贪心·二分·模拟·暴力动态规划篇·普通dp·背包dp·期望dp图论篇·最短路·最小生成树·并查集·树链剖分·二分图·tarjan·拓扑排序·dfs序·点分数论篇·gc原创 2017-09-15 20:30:14 · 217 阅读 · 0 评论 -
【NOIP模板】 莫队(分块)
#include <cmath>#include <cstdio>#include <cstring>#include <algorithm>using namespace std;const int N = 100010;struct Node { int l, r, bl, id;} q[N];bool cmp(const Node &a, const Node &b) {原创 2017-09-28 16:13:01 · 294 阅读 · 0 评论 -
【NOIP模板】 堆-stl
#include <cstdio>#include <cstring>#include <iostream>#include <algorithm>using namespace std;long long ans = 0;int t, n, a[100010];int main() { scanf("%d", &n); for(int i = 1; i <= n; i +原创 2017-09-28 16:10:20 · 272 阅读 · 0 评论 -
【NOIP模板】KMP
#include <cstdio>#include <cstring>#include <algorithm>using namespace std;int T, nxt[1000050], lens, lent;char s[1000050], t[1000050]; void init() { int i = 0, j = -1; nxt[0] = -1; wh原创 2017-09-16 17:36:26 · 301 阅读 · 0 评论 -
【NOIP模板】 树链剖分 (求lca)
#include <cstdio>#include <cstring>#include <algorithm>using namespace std;struct Edge { int v, next;} edge[20050];int T, n, a, b, num, head[20050];int fa[10050], son[10050], siz[10050], vis[10原创 2017-09-15 22:05:34 · 217 阅读 · 0 评论 -
【NOIP模板】 tarjan
#include <cstdio>#include <cstring>#include <algorithm>using namespace std;struct Edge { int u, v, next;} edge[100010];int n, m, num = 0, in[100010], out[100010], head[100010];int top = 0, cnt原创 2017-09-15 21:28:47 · 197 阅读 · 0 评论 -
【NOIP模板】 并查集
#include <cstdio>#include <cstring>#include <algorithm>using namespace std;int n, m, p, r1, r2, fa[50010];int find(int x) { if(fa[x] == x) return x; return fa[x] = find(fa[x]);}int main() {原创 2017-09-15 20:51:16 · 309 阅读 · 0 评论 -
【NOIP模板】 最短路 spfa
#include <cstdio>#include <cstring>#include <algorithm>using namespace std;struct Edge { int w, v, next;} edge[20010];int t, c, s, e, num = 0, vis[20010], dis[20010], queue[20010], head[20010];原创 2017-09-15 20:50:13 · 214 阅读 · 0 评论 -
【NOIP模板】 最小生成树 kruskal
#include <cstdio>#include <cstring>#include <algorithm>using namespace std;int n, w, num = 0, head[100010], fa[1010];struct Edge { int u, v, w, next;} edge[100010];void add(int u, int v, int w)原创 2017-09-15 20:34:27 · 209 阅读 · 0 评论 -
【NOIP模板】 gcd & lcm
#include <cstdio>#include <cstring>#include <algorithm>using namespace std;int a, b;int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }int main() { scanf("%d %d", &a, &b); printf("%原创 2017-09-22 21:35:26 · 318 阅读 · 0 评论 -
【NOIP模板】 trie树
#include <cstdio>#include <cstring>#include <algorithm>using namespace std;struct Trie { int num; bool excit; Trie *child[26];} pool[100010], *tail = pool, *root;int ans, n, m, num = 0原创 2017-09-22 19:28:11 · 216 阅读 · 0 评论 -
高精度系列——反正高精除高精我不会
高精度小贴士: 除法/减法从最高位开始,乘法/加法从最低位开始; 高精度的实质是模拟,注意边界/进位/退位等等。#include <cstdio>#include <cstring>#include <algorithm>using namespace std;char s1[3010], s2[3010];int x, lenf, leng, f[3010], g[3010], tem原创 2017-11-02 19:36:17 · 353 阅读 · 1 评论