自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(36)
  • 收藏
  • 关注

转载 RDD操作

写了一个月spark,用了无数RDD操作,总结一下~RDD Transformmap(func) :数据集中的每个元素经过用户自定义的函数转换形成一个新的RDDval rdd = sc.parallelize(1 to 5)val result = rdd.map(x => x to 3)输出:Range(1, 2, 3)Ran...

2018-09-20 15:52:00 145

转载 Spark

学习笔记做在Onenote上,复制过来都是图片~~转载于:https://www.cnblogs.com/yZiii/p/9661292.html

2018-09-17 11:53:00 167

转载 单元测试---Mock

mock测试就是在测试过程中,对于某些不容易构造或者不容易获取的对象,用一个虚拟的对象来创建以便测试的测试方法. 1 using Moq; 2 3 // Assumptions: 4 5 public interface IFoo 6 { 7 Bar Bar { get; set; } 8 string Name { get; se...

2018-07-26 16:55:00 173

转载 HTTP简书

方法GET: 请求指定的页面信息,并返回实体主体。HEAD: 只请求页面的首部。POST: 请求服务器接受所指定的文档作为对所标识的URI的新的从属实体。PUT: 从客户端向服务器传送的数据取代指定的文档的内容。DELETE: 请求服务器删除指定的页面。OPTIONS: 允许客户端查看服务器的性能。TRACE: 请求服务器在响应中的实体主体部分返回所得到的...

2018-07-26 15:56:00 110

转载 scala

直接从onenote上复制过来的,是张图片~~转载于:https://www.cnblogs.com/yZiii/p/9372252.html

2018-07-26 15:54:00 55

转载 Cors(ross-origin resource sharing)

直接从onenote上复制过来的,是张图片~~转载于:https://www.cnblogs.com/yZiii/p/9372225.html

2018-07-26 15:50:00 117

转载 杭电多校第一场D题

闲来无事,看了下牛客多校的题目,嘴炮了几题,顺手用txt写了这题。先附上题面Problem DescriptionChiaki has an array ofnpositive integers. You are told some facts about the array: for every two elementsaiandajin the subarra...

2018-07-24 17:28:00 127

转载 git操作

Git是目前世界上最好的分布式版本控制系统,它有两个最主要的功能:版本控制,多人协同。使用Git分为本地和远程仓库。对于远程仓库,每个人都可以创建一个自己的工作分支,然后将内容clone到本地工作空间。本地又可以分为工作区和暂存区,工作区工作完了以后,可以将所有的修改add到暂存区,也可以将add到暂存区的修改撤销,通过commit可以将暂存区的修改 提交到本地分支,然后通过...

2018-06-21 11:57:00 79

转载 头条笔试总结

总得来说还行吧,运气比较好,就是时间太少了,多10min不知道能AK不由于没有存代码! 所以就不贴代码了,只有第四题存有代码,但是没AC...,比赛结束后才调试好的第一题:给n个数,求差值为k的数字对去重后的个数    很简单的题,看一眼就会,sort+hash_map瞎搞就行了,注意这里卡常....,笔试时用快读+unordered_set还是只过90%,最后i++改成++...

2018-03-24 21:54:00 87

转载 Day 1

文件结束符:windows:ctrl+z unix:ctrl+d文件重定向:程序名 < 输入文件名 > 输出文件名 如:add <input.txt> output.txt宽字符:wchar_t 可以存放机器最大扩展字符集中的任意一个字符Unicode字符:char16_t,char32_t 所有自然语言中的字符标准...

2018-03-12 21:28:00 65

转载 后缀自动机

模板 1 struct SAM{ 2 static const int MAXN = 100001<<1;//大小为字符串长度两倍 3 static const int LetterSize = 26; 4 5 int tot, last, ch[MAXN][LetterSize], fa[MAXN], len[MAXN];...

2017-10-16 17:34:00 79

转载 后缀数组(dc3) 时间 O(n) 空间 O(3n)

模板 1 #define F(x) ((x)/3+((x)%3==1?0:tb)) 2 #define G(x) ((x)<tb?(x)*3+1:((x)-tb)*3+2) 3 4 struct SuffixArray{ 5 int sa[maxn*3];//排名为i的后缀的起始下标 6 int Rank[maxn*3];//起始下标为...

2017-08-21 17:02:00 274

转载 后缀数组(倍增) 时间nlogn 空间n

模板 1 struct SuffixArray{ 2 int sa[maxn];//排名为i的后缀的起始下标 3 int Rank[maxn];//起始下标为i的后缀排名 4 int height[maxn];//排名为i和i-1的最长公共前缀 5 int wa[maxn],wb[maxn],wv[maxn],ws[maxn]...

2017-08-20 17:25:00 106

转载 线性递推式(外挂)

传入前几项,输出低n项的值 1 #include <cstdio> 2 #include <cstring> 3 #include <cmath> 4 #include <algorithm> 5 #include <vector> 6 #include <string> 7 #inc...

2017-08-19 19:59:00 105

转载 01,完全,多重,分组

模板 1 void zero(int weight){ 2 for(int i=1000;i>=weight;i--){ 3 if(dp[i-weight]) 4 dp[i] = 1; 5 } 6 } 7 8 void comp(int weight){ 9 for(int i...

2017-08-14 10:22:00 104

转载 树链剖分

1 #include <cstdio> 2 #include <algorithm> 3 #include <cstring> 4 using namespace std; 5 6 const int maxn = 1e5+7; 7 8 int siz[maxn],dep[maxn],top[maxn],tid[m...

2017-08-12 09:19:00 71

转载 平衡树(splay)

求区间最大值模板 1 struct node{ 2 int f[maxn];//父亲结点 3 int ch[maxn][2];//左右孩子 4 int key[maxn];//结点i代表的数字 5 int cnt[maxn];//结点i出现的次数,也可以为全值。平衡树没有相同值的结点,所以如果出现了相同值时,cnt[i]+...

2017-08-07 17:05:00 99

转载 主席树(可持久化线段树版)

求区间和模板 1 struct node{ 2 int l[maxn*20],r[maxn*20]; //区间大小 maxn = 1e5时为20倍,不够就开40 3 int li[maxn*20],ri[maxn*20];//左孩子和右孩子的位置 4 int sum[maxn*20],add[maxn*20]; //区间和,懒惰标记...

2017-08-06 17:46:00 74

转载 大组合数取膜(质数)

模板 1 #include <iostream> 2 #include <string.h> 3 #include <stdio.h> 4 5 using namespace std; 6 typedef long long LL; 7 8 LL n,m,p; 9 10 LL quick_mod(LL ...

2017-08-04 16:34:00 169

转载 大组合数取膜(非质数)

模板 1 #include <iostream> 2 #include <string.h> 3 #include <stdio.h> 4 5 using namespace std; 6 typedef long long LL; 7 const int N = 200005; 8 9 bool prime...

2017-08-04 16:33:00 196

转载 莫比乌斯

模板 1 void solve(){ 2 mu[1]=1; 3 for(i=2;i<maxn;i++) 4 { 5 if(!vis[i]) 6 { 7 prime[top++]=i; 8 mu[i]=-1; 9 }10 ...

2017-08-04 16:31:00 82

转载 欧拉函数

模板 1 #include<stdio.h> 2 const int MAXN=3000010; 3 bool vis[MAXN]; 4 int prime[MAXN/10]; 5 long long euler[MAXN]; 6 int main() 7 { 8 int i,j,temp,top; 9 int n;...

2017-08-04 16:30:00 64

转载 容斥

模板 1 int a[100006]; 2 int res[1000006]; 3 int fun(int a,int b) 4 { 5 return a*b; 6 } 7 int rongchi(int n,int a[]) 8 { 9 int i,k1=0,k2,j,sum;10 for(i=1;i<=n;i+...

2017-08-04 16:27:00 62

转载 线性筛法

模板 1 bool vis[MAXN]; 2 int prime[MAXN/10]; 3 4 void Prime(){ 5 int top=0; 6 for (int i=2; i<MAXN; i++){ 7 if (!vis[i]){ 8 prime[top++]=i; 9 ...

2017-08-04 16:26:00 82

转载 主席树

区间第k大,不修改模板 1 #include <cstdio> 2 #include <algorithm> 3 #include <cstring> 4 #include <vector> 5 using namespace std; 6 7 const int maxn = 1e5 + 7; 8 ...

2017-08-04 14:36:00 37

转载 AC自动机

数组版 1 struct Tire{ 2 int next[maxn][27],fail[maxn],dis[maxn]; 3 int root,L; 4 queue<int >q; 5 6 int newnode(){ 7 dis[L] = 0; 8 for(int i =...

2017-08-04 13:51:00 40

转载 马拉车

O(n)求字符串中的最长回文串的长度 1 char s[SIZE]; 2 int len[SIZE*2]; 3 char str[SIZE*2]; 4 int manacher(){//预处理字符串,将字符串隔开,且开头和结尾字符串要不同,防止越界,如aaa预处理为@#a#a#a$ 5 int l = strlen(s); 6 int l...

2017-08-04 13:48:00 44

转载 扩展kmp

拓展kmp是对KMP算法的扩展,它解决如下问题:定义母串S,和字串T,设S的长度为n,T的长度为m,求T与S的每一个后缀的最长公共前缀其中next数组表示T[i,m-1]和T的最长公共前缀 1 const int maxn=100010; //字符串长度最大值 2 int next[maxn],ex[maxn]; //ex数组即为extend数组 3 /...

2017-08-04 13:44:00 54

转载 KMP

模板 1 int Next[MAXN]; 2 char s1[MAXN],s2[MAXN]; 3 4 void getNext(char *s){ 5 int l = strlen(s); 6 Next[0] = -1;//很关键,漏了会死循环. 7 int k=-1,j=0; 8 while(j<l){ 9...

2017-08-04 13:43:00 45

转载 字典树

1 const int maxn = 1e5 + 7; 2 const int SIZE = 10;// 字符数量,如小写字母改为26,记得修改getid 3 4 struct Dictionary_tree{ 5 int cnt; 6 int next[maxn][SIZE]; 7 int val[maxn]; 8 9 ...

2017-08-04 12:51:00 37

转载 二维树状数组

模板 1 int c[1010][1010]; 2 int n,t; 3 4 int lowbit(int x){ 5 return x&(-x); 6 } 7 8 void updata(int x,int y){ 9 for(int i=x;i<=n;i+=lowbit(i)){10 for...

2017-08-04 12:14:00 49

转载 线段树(带lazy)

带lazy主要为了节省不必要的时间多用于修改一段区间值 1 struct Segment_tree{ 2 int L[maxn*4],R[maxn*4],val[maxn*4],add[maxn*4]; 3 4 void lazy(int pos){ //懒惰标记 5 val[pos<<1] = add[pos]*...

2017-08-04 12:07:00 88

转载 线段树(不带lazy)

多用于修改一个点的值给一个求最大值模板 1 const int maxn = 2e5+5;//数据大小 2 3 struct Segment_tree{ 4 int L[maxn*4],R[maxn*4],val[maxn*4]; //4倍保证足够大 5 6 void build(int pos,int l,int r,int *a){...

2017-08-04 11:04:00 95

转载 树状数组

1 int c[MAXN]; 2 int n; 3 4 int lowbit(int x){ 5 return (x&(-x)); 6 } 7 8 void updata(int x,int v){ 9 while(x<=n){//从小到大更新10 c[i] += v;11 x...

2017-08-04 10:39:00 48

转载 输出优化

1 void Out(int a) //输出一个整型 2 { 3 if(a<0) 4 { 5 putchar('-'); 6 a=-a; 7 } 8 if(a>9) 9 Out(a/10);10 putchar(a%10+'0');11 ...

2017-08-04 10:32:00 119

转载 读入优化

void nextInt(int &x) {//读取一个整型 char c; do c=getchar(); while (c<'0'||c>'9'); x=c-'0'; while ('0'<=(c=getchar())&&c<='9') x=x*10+c-'0';}转载于...

2017-08-04 10:31:00 44

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除