摘要: https://blog.csdn.net/BillCYJ/article/details/78985895 阅读全文
posted @ 2021-01-31 17:13 _Famiglistimo 阅读(66) 评论(0) 推荐(0) 编辑
摘要: ### 1.「POJ2549」Sumsets 题意:给出一个整数集合s,找到集合中最大的d,让等式a+b+c=d成立。(四者互异) 思路:预处理 a+b ,查询 d-c 查询方式:1.尺取法 O(n) 2.二分查找 O(logn) 3.Hash O(1) ### 2.第k短路 题意:RT 思路:(1 阅读全文
posted @ 2021-01-30 21:16 _Famiglistimo 阅读(67) 评论(0) 推荐(0) 编辑
摘要: #include<bits/stdc++.h> using namespace std; //试除法 bool is_prime(int n){ if(n<2)return false; int temp=sqrt(n); for(int i=2;i<=temp;i++){ if(n%i==0)re 阅读全文
posted @ 2021-01-11 13:17 _Famiglistimo 阅读(234) 评论(0) 推荐(0) 编辑
摘要: 普通平衡树: #include<bits/stdc++.h> using namespace std; const int maxn = 1e5+5; const int INF = 1e9; class Splay{ #define root t[0].son[1] private: struct 阅读全文
posted @ 2020-12-28 19:57 _Famiglistimo 阅读(124) 评论(0) 推荐(0) 编辑
该文被密码保护。 阅读全文
posted @ 2020-12-20 14:23 _Famiglistimo 阅读(33) 评论(0) 推荐(0) 编辑
摘要: 我们知道johnson最常见的做法是 spfa+dijkstra 我们先有spfa板子: bool spfa(int st){ queue<int>q; memset(h,63,sizeof h); h[st]=0; vis[st]=1; q.push(st); while(!q.empty()){ 阅读全文
posted @ 2020-12-19 23:02 _Famiglistimo 阅读(90) 评论(0) 推荐(0) 编辑
摘要: 普通平衡树: #include<bits/stdc++.h> using namespace std; const int maxn=1e5+5; struct FHQ_Treap{ protected: struct node{ node *ch[2]; int siz,val,key; node 阅读全文
posted @ 2020-12-19 13:07 _Famiglistimo 阅读(78) 评论(0) 推荐(0) 编辑
摘要: #include<vector> using namespace std; namespace Scapegoat_Tree{ #define MAXN (100000 + 10) const double alpha = 0.75; struct Node{ Node * ch[2]; int k 阅读全文
posted @ 2020-12-12 12:36 _Famiglistimo 阅读(115) 评论(0) 推荐(0) 编辑
摘要: 在 c++ 中,名称可以是变量、函数、结构、枚举、类以及类和结构的成员 假设这样一种情况,当一个班上有两个名叫 WYB 的学生时,为了明确区分它们,我们在使用名字之外,不得不使用一些额外的信息,比如他们的家庭住址,或者他们的其他身份等等。 同样,当随着项目的增大,名称相互冲突的可能性也将增加。使用多 阅读全文
posted @ 2020-12-06 13:31 _Famiglistimo 阅读(184) 评论(0) 推荐(0) 编辑
摘要: https://wenku.baidu.com/view/43ce85c7aa00b52acfc7ca04.html?rec_flag=default 阅读全文
posted @ 2020-11-29 10:54 _Famiglistimo 阅读(419) 评论(0) 推荐(0) 编辑