01 2022 档案

摘要:https://www.acwing.com/problem/content/description/1211/ 全排列问题+如何利用全排列插入符号来计算 #include <bits/stdc++.h> using namespace std; const int N=10; int dist[N 阅读全文
posted @ 2022-01-30 12:27 秋月桐 阅读(60) 评论(0) 推荐(0)
摘要:树的直径是求一棵树最远的两点之间的距离。 套路:两次dfs,一次dfs求离根最远的结点A,再以A为根搜索离A最远的结点B,A到B就是树的直径(双向的树) #include<bits/stdc++.h> using namespace std; const int N=100010; int n; s 阅读全文
posted @ 2022-01-28 17:42 秋月桐 阅读(86) 评论(0) 推荐(0)
摘要:y总总结的常用stl用法,在这mark一下,以后不会过来查~ vector, 变长数组,倍增的思想 size() 返回元素个数 empty() 返回是否为空 clear() 清空 front()/back() push_back()/pop_back() begin()/end() [] 支持比较运 阅读全文
posted @ 2022-01-23 21:36 秋月桐 阅读(92) 评论(0) 推荐(0)
摘要:字符串哈希 作用:快速查询子串,极快地比较两个字符串,以及还有其他用途。(比kmp泛用性更广) 原理:1. 将字符串的前缀和字符串数组想办法转换成数字; ​ 2.前缀和字符串数组转换为数字的方式,p进制转化十进制(秦九邵),“1234” > 1p0+2p1+3p^2+..... ​ 在这里使用ASC 阅读全文
posted @ 2022-01-23 11:20 秋月桐 阅读(144) 评论(0) 推荐(0)
摘要:假如你的虚拟机某天用不了了并且报了类似标题的错误。 那么恭喜你大概率是因为vmware虚拟机和docker不兼容导致的,此问题直到现在都没有合适的办法解决,想要设置让两者共存是不可能的(有办法但相当复杂)。 在我探索了几天之后,发现还是通过管理员命令行来进行切换。 1,如果用docker, 第一步: 阅读全文
posted @ 2022-01-22 17:50 秋月桐 阅读(297) 评论(0) 推荐(0)
摘要:现代计算机图形学入门games101 2022年1月22日 14:06 https://www.bilibili.com/video/BV1X7411F744?p=3 线性代数入门知识: 1.二维向量,三维向量通常使用列向量表示,线性计算譬如缩放,旋转等操作依次左乘;平移是非线性变换 2.矩阵无交换 阅读全文
posted @ 2022-01-22 14:29 秋月桐 阅读(101) 评论(0) 推荐(0)
摘要:本人hubu在读大三,通信工程砖业菜鸟; 目前在做:算法训练,golang后端,以及考研准备。 目标是考上cg方向专业类硕士,更久远的目标是做一名渲染开发 or TA; 有需要扩友链的加发message往以下email 哦。 QQ-email:2547624379@qq.com 阅读全文
posted @ 2022-01-20 16:57 秋月桐 阅读(44) 评论(0) 推荐(0)
摘要:高精度加法 #include<iostream> #include<vector> using namespace std; vector<int> add(vector<int> &A,vector<int> &B){ vector<int> C; int t=0; for(int i=0;i<A 阅读全文
posted @ 2022-01-20 16:43 秋月桐 阅读(112) 评论(0) 推荐(0)
摘要:哈希表分为开放寻址法和拉链法。时间复杂度近似o(1),一般仅进行添加和查找,一般不删除(用数组标记)。 作用是使较大的定义域 映射到一个较小范围的集合 离散化是一种保持有序性的特殊哈希。 x mod 10^5(目标小集合长度,取质数冲突概率小) 冲突处理 拉链法:用邻接表存储,把e[N]拆成很多个链 阅读全文
posted @ 2022-01-20 16:35 秋月桐 阅读(183) 评论(0) 推荐(0)
摘要:一早被一条消息震惊了: 动视暴雪被微软以近700亿刀收购。 但冷静一想确实印证了我最近的一些想法。有关于游戏界的,但更多是关于技术上的。 现在是ai,深度学习占尽风头的时代,但是这些技术并没有渲染图那样的先进,或许在功能上可以实现,但是受限于不少的物理条件,并且在神经学和数学不能产生很大突破的情况下 阅读全文
posted @ 2022-01-19 15:32 秋月桐 阅读(150) 评论(0) 推荐(0)
摘要:https://www.acwing.com/problem/content/839/ #include<iostream> using namespace std; const int N=100010; int n,m; int p[N],cnt[N]; int find(int x){ if( 阅读全文
posted @ 2022-01-17 20:37 秋月桐 阅读(46) 评论(0) 推荐(0)
摘要:https://www.acwing.com/problem/content/242/ #include<iostream> using namespace std; const int N=100010; int n,m; int p[N],d[N]; int find(int x){ if(p[ 阅读全文
posted @ 2022-01-17 20:34 秋月桐 阅读(90) 评论(0) 推荐(0)
摘要:https://www.acwing.com/problem/content/833/ #include<iostream> using namespace std; const int N=100010,M=1000010; int n,m; int ne[N]; //next array cha 阅读全文
posted @ 2022-01-14 10:50 秋月桐 阅读(36) 评论(0) 推荐(0)
摘要:https://www.acwing.com/problem/content/832/ #include<iostream> using namespace std; const int N=100010; int stk[N],tt=0;//tt指向当前栈顶,数据区1开始 int main(){ 阅读全文
posted @ 2022-01-07 22:03 秋月桐 阅读(45) 评论(0) 推荐(0)
摘要:rt 实现任意 b 进制转换 10 进制 注意:b<=10 //秦九邵算法 //b 进制转10 进制 int get(string s,int b){ int res=0; for(auto c:s){ res=res*b+c-'0'; } return res; } 更新: 1-35任意进制 转换 阅读全文
posted @ 2022-01-02 20:57 秋月桐 阅读(240) 评论(0) 推荐(0)
摘要:#include<iostream> using namespace std; const int N=100010; int head,e[N],ne[N],idx; void init(){ head=-1; idx=0; } void add_to_head(int x){ e[idx]=x; 阅读全文
posted @ 2022-01-02 13:43 秋月桐 阅读(65) 评论(0) 推荐(0)
摘要:#include<iostream> using namespace std; const int N=100010; int n,m; int q[N]; int main(){ scanf("%d%d",&n,&m); for(int i=0;i<n;i++) scanf("%d",&q[i]) 阅读全文
posted @ 2022-01-02 13:42 秋月桐 阅读(38) 评论(0) 推荐(0)
摘要:序列和 #include<iostream> using namespace std; const int N=100010; int a[N],b[N]; int main(){ int n,m,l,r; cin>>n>>m; for(int i=1;i<=n;i++) cin>>b[i]; fo 阅读全文
posted @ 2022-01-02 13:41 秋月桐 阅读(82) 评论(0) 推荐(0)
摘要:#include<iostream> using namespace std; const int N=100010; int q[N],s[N]; int main(){ int n; cin>>n; for(int i=0;i<n;i++) cin>>q[i]; int res=0; for(i 阅读全文
posted @ 2022-01-02 13:40 秋月桐 阅读(46) 评论(0) 推荐(0)
摘要:#include<iostream> #include<algorithm> using namespace std; const int N=100010; int q[N],tmp[N]; long int res; void merge_sort(int q[],int l,int r){ i 阅读全文
posted @ 2022-01-02 13:39 秋月桐 阅读(34) 评论(0) 推荐(0)
摘要:#include<iostream> using namespace std; const int N=1e6+10; int n,q[N],tmp[N]; void quick_sort(int q[],int l,int r){ if(l>=r) return; int x=q[l+r>>1], 阅读全文
posted @ 2022-01-02 13:39 秋月桐 阅读(38) 评论(0) 推荐(0)