Lruihao

Lruihao's Note

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

Lruihao's Github chart

B.Higher h-index

1 B. Higher h-index

The h-index of an author is the largest h where he has at least h papers with citations not less than h.
Bobo has no papers and he is going to publish some subsequently. If he works on a paper for x hours, the
paper will get (a·x) citations, where a is a known constant. It’s clear that x should be a positive integer.
There is also a trick – one can cite his own papers published earlier.

Given Bobo has n working hours, find the maximum h-index of him.

A.Easy h-index

1 A. Easy h-index

The h-index of an author is the largest h where he has at least h papers with citations not less than h.
Bobo has published many papers. Given a0,a1,a2,…,an which means Bobo has published ai papers with
itations exactly i, find the h-index of Bobo.

sort 排序

sort 使用#include<algorithm>头文件, sort(开始地址,结束地址,排序方式),其中第三参数可以没有,则默认为升序排序。 或者简单的用 less<参数类型>()表示升序 greater<参数类型>()表示降序 也可以用一个 bool 型函数,比如: 1 2 3 4 5 bool cmp(int a,int b){ return

C++ with STL

1 1.swap(交换两元素值,在 algorithm 下,用法:swap(a,b);)交换两元素的值在 C 语言课上作为指针讲解的典例。 int a=1,b=2; swap(a,b); //此时 a=2,b=1 (可以是其他类型) 2 2.sort(,,)sort 排序是不稳定的,stl 中的 stable_sort 才是稳定的 1 2 3 4 5 6 7 inta[10]={1,6,2,3,5,4,3,8,9,7}; stable_sort(a,a+10,greater<int>()); for(int i=0;i<10;i++) cout<<a[i]<<" "; 3 3.reverse(翻转序列,在 algorithm 下)//常用在字符串上 int a[5]={1,2,3,4,5}; reverse(a,a+5); //序列现在是 5 4 3 2

位运算

1 1. &运算&运算通常用于二进制取位操作,例如一个数 & 1 的结果就是取二进制的最末位。这可以用来判断一个整数的奇偶,二进制的最末位为 0 表示该数为偶数,最末位为 1 表示该数为奇数。 2 2. |运算|运算通常用于二进制特定位上的无条件赋值,例如一个数 or 1 的结果就是把二进制最末位强行变成 1。如果需要把

各种 Links 汇总与分享

2021/10/1 更新
使用 Chrome 等浏览器管理书签是更好更方便的方式,登陆 google 账号,或者导出 html 书签文件都挺方便。

我们在平时学习生活总会遇到很多很多有用的网站,也许我们收藏在了浏览器书签里,可过久了,不做说明,这些链接的价值就被时间淹没了,我们自己都记不起来了,所以这篇文章因此而生。对自己收藏的链接做些简单的说明(第一次编写用了我一个下午);也相当于我的链接收藏夹,分享一些有趣的网站,

hexo+github 搭建个人博客及美化

更多关于 hexo 1 首先官方文档 是我们的第一手资料,也是最好的。 安装 Hexo 相当简单。然而在安装前,你必须检查电脑中是否已安装下列应用程序: Node.js Git 2 hexo 安装如果你的电脑中已经安装上述必备程序,那么恭喜你!接下来只需要使用 npm 即可完成 Hexo 的安装。 1 npm install -g hexo-cli 3 建站安装 Hexo 完成后,请执行下列命令,Hexo 将会在指定文件夹中新建所
0%