摘要: 1. 前言 目前最常用的环境还是linux的服务器,所以最终选择的是nvim作为自己的首要编辑器,毕竟没有写一些比较大型的项目。在经过多次的摸索后,我还是选择了Neovim + Coc.nvim,放弃了 YCM。 在文章的最后,有完整的init.vim文件,这个文件是我目前正在使用的,相对于文中的部 阅读全文
posted @ 2020-07-09 11:39 zprhhs 阅读(56400) 评论(4) 推荐(5) 编辑
摘要: 问题和思路来源于:https://www.zhihu.com/question/51448931 1. 问题描述 有n个相同的球,m个盒子(编号为1,2,……m),将这n个球放入这m个盒子中,要求输出所有可能的放置方法。 2. 问题思路 那这个正常情况下是用递归进行计算的,递归的话可能要在程序运行时 阅读全文
posted @ 2020-06-20 23:10 zprhhs 阅读(335) 评论(0) 推荐(0) 编辑
摘要: 感谢 路人黑的纸巾, 理论部分来源于地址 FFT原理:将多项式的系数表示转换为点值表示,从而进行卷积运算,理论上从$O(n^2)$降低到$O(nlogn)$。 \[ f(x)= a_0 + a_1x + a_2x^2+\cdots+a_{n-1}x^{n-1} \\ g(x)= b_0+b_1x+b 阅读全文
posted @ 2019-12-04 20:12 zprhhs 阅读(4598) 评论(0) 推荐(0) 编辑
摘要: 1.vim配置 已经放弃该方法,coc.nvim NB! 1.1 插件YouCompleteMe安装 首先解决依赖环境,并且编辑好.vimrc,然后进入插件目录,使用git下载ycm 该命令可以补全依赖项 由于google无法访问有一个包要自行安装 此时可能还有一些依赖项没有安装,使用命令 然后进入 阅读全文
posted @ 2019-09-04 21:38 zprhhs 阅读(1027) 评论(0) 推荐(0) 编辑
摘要: 好久没有用c++写过代码了,最近没有什么事情,就像做做题。然后发现python用多了C++不会使了。。。。 "1. Longest Substring Without Repeating Characters" ​ Given a string, find the length of the lon 阅读全文
posted @ 2019-07-15 13:54 zprhhs 阅读(188) 评论(0) 推荐(0) 编辑
摘要: 我退坑很久了,这篇文章不是因为刷OJ而写的总结,毕竟菜鸡老年人, 23333 之前我学网络流看的是算法书和别人的博客然后就开始套板子,而这次因为考试不得已把课本上的定理都看了一遍,瞬间对最大流算法更加清楚了。 1.定义 在学习网络流算法前要了解的一些知识。 1.对于一个有向的网络$G=(N, A, 阅读全文
posted @ 2018-06-29 23:36 zprhhs 阅读(1394) 评论(0) 推荐(0) 编辑
摘要: 一开始用c++的运算符重载程序总是莫名其妙的崩掉,然后以为是运算符重载的问题就写了个class对矩阵重新封装,结果还是崩,然后好久才发现是我把空间开的太大导致程序崩掉,无语,这样就浪费了我一个上午。。。。 课本上的例题: $$\begin{equation}{\left[ \begin{array} 阅读全文
posted @ 2018-06-10 12:33 zprhhs 阅读(723) 评论(0) 推荐(0) 编辑
摘要: 理论部分不解释了, 就是粘个实验课的代码,按照书上的算法写的,仅仅是把课本上的样例过了,有bug可能难免,欢迎指出。 Sample 1. $$ \left\{\begin{aligned}min z = 5x_1+21x_3\\s.t.\,\,x_1-x_2+6x_3-x_4=2 \\x_1+x_2 阅读全文
posted @ 2018-06-06 11:09 zprhhs 阅读(899) 评论(0) 推荐(0) 编辑
摘要: Atlantis Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Problem Description There are several ancient Greek texts th 阅读全文
posted @ 2018-06-01 17:46 zprhhs 阅读(336) 评论(0) 推荐(0) 编辑
摘要: 实验课的作业,用LU分解矩阵A求解线性方程组。注:只是课程的设计,不可以当作ACM的模板,也是不是考虑的很周到,只是提供一个思路。#include "cstdio"#include "cstring"#include "cstdlib"#include "cmath"using namespace std;const double eps = 1e-8;const int maxr = 100;c... 阅读全文
posted @ 2018-04-19 22:29 zprhhs 阅读(777) 评论(0) 推荐(0) 编辑
摘要: 1143-Lowest Common Ancestor The lowest common ancestor (LCA) of two nodes U and V in a tree is the deepest node that has both U and V as descendants. 阅读全文
posted @ 2018-03-30 20:21 zprhhs 阅读(897) 评论(0) 推荐(0) 编辑
摘要: L2-006. 树的遍历给定一棵二叉树的后序遍历和中序遍历,请你输出其层序遍历的序列。这里假设键值都是互不相等的正整数。输入格式:输入第一行给出一个正整数N( R) return; res[idx] = pos[root]; int i = L; while (in[i] != pos[root]) i++; build(L, i-1, idx*2+1, root-1-R+... 阅读全文
posted @ 2018-03-24 11:32 zprhhs 阅读(307) 评论(0) 推荐(0) 编辑
摘要: How Many Answers Are Wrong Time Limit: 2000/1000 MS (Java/Others) Problem Description TT and FF are ... friends. Uh... very very good friends -_______ 阅读全文
posted @ 2018-02-07 19:25 zprhhs 阅读(195) 评论(0) 推荐(0) 编辑
摘要: Fence Repair Time Limit: 2000MS Description Farmer John wants to repair a small length of the fence around the pasture. He measures the fence and find 阅读全文
posted @ 2018-02-04 12:13 zprhhs 阅读(192) 评论(0) 推荐(0) 编辑
摘要: Contestants DivisionTime Limit: 2000MSDescriptionIn the new ACM-ICPC Regional Contest, a special monitoring and submitting system will be set up, and students will be able to compete at their own univ... 阅读全文
posted @ 2017-12-03 14:29 zprhhs 阅读(392) 评论(0) 推荐(0) 编辑
Power by awescnb