In mathematics, the nth harmonic number is the sum of the reciprocals of the first n natural numbers: In this problem, you are given n, you have to find Hn. Input Input starts with an integer T (≤ 10000), denoting the number of test cases. Each case
有一个a数组,里面有n个整数.现在要从中找到两个数字(可以是同一个) ai,aj ,使得 ai mod aj 最大并且 ai ≥ aj. Input 单组测试数据. 第一行包含一个整数n,表示数组a的大小.(1 ≤ n ≤ 2*10^5) 第二行有n个用空格分开的整数ai (1 ≤ ai ≤ 10^6). Output 输出一个整数代表最大的mod值. Input示例 3 3 4 5 Output示例 2 题解:首先考虑mod的真正定义a%b=a/b*b+c思考一下其实是kb+c的形式,画在数轴
安装redis以windows服务形式 安装redis以windows服务形式 redis windows windows 服务 以前跑redis,老是要开一个命令行窗口,一旦关闭,redis服务就挂了.这次终于以windows服务形式安装成功啦. 其实挺简单的,这里只是记录下过程. 1. 下载redis windows安装版本. github地址:https://github.com/MSOpenTech/redis/releases 截止到目前为止.我这边最新版本的redis windows
博客分类: ASP.NET 一. <%%>这种格式实际上就是和asp的用法一样的,只是asp中里面是vbscript或者javascript代码,而在asp.net中是.net平台下支持的语言.特别注意:服务器控件中不能有<%%>语法(这里我用C#代码) <% int a = 2; int b = 3; int c = a + b; Response.Write(c); %> 二. <%#%>如果是这种格式的话那就是asp.net下特有的,它是控件数据绑