Lruihao's Note

不怕萬人阻擋,只怕自己投降

hexo 个性化 - next 主题动态显示 subtitle

本文适合我这种纯小白。 目前为止,全网也就只有一个博主写到过这样动态显示 subtitle 的文章。传送门(关键词:js, 后加载)
但是嘞,该博写的不怎么详细,17 年底写的。当然更大的可能是 next 更新了一些文件结构,所以不适合现在使用了。以前我按原博的流程配置了一下没成功就搁在那里了,今天突然心血来潮。翻了翻原博主博客的源码,再与自己的对比了一下,发现了一些端倪。稍作调整后如下:

git index.lock

在 git 没有运行完成之前强制关闭,下次提交的时候会产以下生错误,或者类似的。 1 2 3 4 5 fatal: Unable to create '/xxx/xx/.git/index.lock': File exists. If no other git process is currently running, this probably means a git process crashed in this repository earlier. Make sure no other git process is running and remove the file manually to continue. 原因是在你进行某些比较费时的 git 操作时自动生成,操作结束后自动删除,相当于一个锁定文件,目的在于防止对一个目录同时进行多个操作。 有时强制关

在 Android 上搭建 hexo 博客

暑假刚开始的时候放假回家没带电脑,只能玩手机,想折腾一下博客都没有条件,在一个发现一个 app, 卧槽 😱,termux 真的强大!(初始化需要科学上网)安卓手机上的 linux 简直了,在手机就可以搭了一个 hexo 博客,只要在 github 上实现分支管理就可以多终端同步更新了。恕我学疏才浅,还只想到这些!一开始想回校后,折腾一下 hexo-admin 实现类似动态博客一样的多终端管理(手动滑稽),现在发现 termux 这样子的操作也不错嘛,挺装哔 hhhhhh**部署后的效果**

石子阵列(组合数学)

链接:https://www.nowcoder.com/acm/contest/157/A 来源:牛客网 题目描述 xb 有 m 种石子,每种无限个,Ta 想从这些石子中取出 n 个,并按顺序排列起来,为了好看,相邻的石子不能相同。xb 想知道有多少种排列的方法。 输入描述: 第一行有两个正整数 n,m。 输出描述: 第一行一个整

Dreamoon and Stairs

题目链接 Dreamoon wants to climb up a stair of n steps. He can climb 1 or 2 steps at each move. Dreamoon wants the number of moves to be a multiple of an integer m. What is the minimal number of moves making him climb to the top of the stairs that satisfies his condition? Input The single line contains two space separated integers n, m (0 < n ≤ 10000, 1 < m ≤ 10). Output Print a single integer — the minimal number of moves being a multiple of m. If there is no way he can climb satisfying condition print - 1 instead. Examples input 10 2 output 6 input 3 5 output -1 Note For the first sample, Dreamoon could climb in 6 moves with following sequence of steps: {2, 2, 2, 2, 1, 1}. For the second sample, there are only three

The equation-SGU106(扩展欧几里得)

题意: 给出 a,b,c,x1,x2,y1,y2,求满足 ax+by+c=0,且 x∈[x1,x2],y∈[y1,y2] 的整数解个数。 分析: 对于解二元一次不定方程,容易想到利用扩展欧几里得求出一组可行解后找到通解,下面来介绍一下欧几里得以及扩展欧几里得。 欧几里得: 又名辗转相除法,是用来计算两个数的最大公约数

Leading and Trailing-lightoj1282(快速幂+对数运算)

题目链接

题目大意:

给定两个数 n,k 求 n^k 的前三位和最后三位。

分析

求后三位的话:直接快速幂,对 1000 取模就好了。
求前三位,对于给定的一个数 n, 它可以写成 n=10^a, 其中这个 a 为浮点数,则t=n^k=(10^a)^k=10^a*k=(10^x)*(10^y);其中 x,y 分别是a*k的整数部分和小数部分,对于 t=n^k 这个数,它的位数由 (10^x) 决定,它的位数上的值则有 (10^y) 决定,因此我们要求 t 的前三位,只需要将 10^y 求出,在乘以 100,就得到了它的前三位。
分析完,我们再整体看,设 n^k=10^z; 那么z=k*log10(n)
fmod(z,1)可以求出 x 的小数部分。

0%