摘要: #include<iostream> #include<cstdio> #include<algorithm> #include<vector> #include<cmath> #define alpha (0.75) using namespace std; const int N = 6e5 + 阅读全文
posted @ 2020-05-04 16:23 Faker_fan 阅读(141) 评论(0) 推荐(0) 编辑
摘要: 题目大意: 给你一堆三维的点,每个点之间的距离是xy轴的欧式距离,代价是高度,问一颗最优比例生成树。这题是我很早之前做过的了,当初还非常非常菜,给大家看一下我的情况。 当初可真是年少无知啊,这个prim因为是稠密图,所以n方才能求生成树,很神奇啊,稠密图的最小生成树算法居然是o(e)的,不过还是很慢 阅读全文
posted @ 2020-05-04 13:33 Faker_fan 阅读(127) 评论(0) 推荐(0) 编辑
摘要: //网络流s const int INF = 0x3f3f3f3f, maxn = 210; struct E { int u, v, flow; E(int u = 0, int v = 0, int flow = 0): u(u), v(v), flow(flow) {} } edg[maxn 阅读全文
posted @ 2020-05-04 00:04 Faker_fan 阅读(86) 评论(0) 推荐(0) 编辑
摘要: //线性筛m莫比乌斯函数s int miu[maxn+10],vis[maxn+10]; void mobius() { for(int i=1;i<=maxn;++i) miu[i]=1; for(int i=2;i<=maxn;++i) { if(!vis[i]) { miu[i]=-1; fo 阅读全文
posted @ 2020-05-03 16:33 Faker_fan 阅读(128) 评论(0) 推荐(0) 编辑
摘要: int nxt[maxn],ex[maxn]; void ex_kmp(char *s1,const char *s2) { int len1=strlen(s1),len2=strlen(s2); nxt[0]=len1;nxt[1]=0; while (1+nxt[1]<len1 && s2[n 阅读全文
posted @ 2020-04-19 17:36 Faker_fan 阅读(96) 评论(0) 推荐(0) 编辑
摘要: #include <iostream> #include <string.h> #include <queue> #include <stdio.h> #include <algorithm> #include <math.h> typedef long long ll; using namespa 阅读全文
posted @ 2020-04-03 21:00 Faker_fan 阅读(158) 评论(0) 推荐(0) 编辑
摘要: 递推打表和log求单一 #include<iostream> const int maxn=1e3+10; const int mod=1e9+7; typedef long long ll; using namespace std; ll C[maxn][maxn]; void zuhe_nn() 阅读全文
posted @ 2020-03-31 20:54 Faker_fan 阅读(146) 评论(0) 推荐(0) 编辑
摘要: 因为最近有一门课要求读一篇论文,我在这里记录一下自己学到的东西,希望能更加深刻的理解我学到的东西,内容应该是对原论文中的一些扩展。 前置技能: 关于密钥共享,主要参考了这篇博客 https://blog.csdn.net/shangsongwww/article/details/90266937 ( 阅读全文
posted @ 2020-03-29 21:15 Faker_fan 阅读(889) 评论(0) 推荐(0) 编辑
摘要: command+option+esc 阅读全文
posted @ 2020-03-23 21:37 Faker_fan 阅读(1033) 评论(0) 推荐(0) 编辑
摘要: #include<iostream> #include<cstdio> #include<cstring> #define inv inline void #define ini inline int #define maxn 1000050 using namespace std; char s[ 阅读全文
posted @ 2020-03-23 17:27 Faker_fan 阅读(116) 评论(0) 推荐(0) 编辑