题目描述
T组数据,求ΣNi=1ΣMj=1d(ij)\Sigma_{i=1}^N\Sigma_{j=1}^Md(ij),d(x)d(x)代表x的约数个数。
1≤N,M,T≤1051\le N, M,T\le 10^5
题解
首先,膜拜一下PoPoQQQ大神及其题解
然后,有一个神奇的结论:ΣNi=1ΣMj=1d(ij)\Sigma_{i=1}^N\Sigma_{j=1}^Md(ij)=ΣNi=1ΣM...
分类:
其他好文 时间:
2015-08-20 17:02:42
阅读次数:
120
代码来自于《C与指针》关于指针的介绍知识点:指针数组越界 #define NULL (void*)0 代码量的积累很重要! 代码量的积累很重要! 代码量的积累很重要!#include//#include#includechar str[] = "ABCDEFG";size_t str_le...
分类:
其他好文 时间:
2015-08-20 15:15:26
阅读次数:
148
题目:http://www.lydsy.com/JudgeOnline/problem.php?id=3925题意:给定一个nn点mm边的无向图,没有重边和自环,每条边的权值为[0,1][0,1]之间的随机变量,求最小生成树中最大边的期望权值。
n≤10,m≤n?(n?1)2n\le10,m\le\frac{n*(n-1)}{2}。题解:根据期望的线性性,我们可以算出随机选前k小的那些边使图恰好...
分类:
其他好文 时间:
2015-08-20 01:34:14
阅读次数:
156
Given a binary tree, find its maximum depth.The maximum depth is the number of nodes along the longest path from the root node down to the farthest le...
分类:
其他好文 时间:
2015-08-19 13:14:00
阅读次数:
134
题目链接:http://poj.org/problem?id=4012
Problem B. Black Square
Input ?le: black.in
Output ?le: black.out
Time limit: 3 seconds
Memory limit: 256 megabytes
Inspired by Kazimir Malevic...
分类:
其他好文 时间:
2015-08-19 00:43:57
阅读次数:
150
Checkpoints are the foundation for restarting packages in SSIS, and they work by writing state information to a ?le after each task completes.This ?le...
分类:
其他好文 时间:
2015-08-18 15:31:06
阅读次数:
92
1、通信前必须具备东西:
(1) 蓝牙串口模块;
(2) 安卓系统并带有蓝牙的手机;
(3) 串口调试软件;
(4) 蓝牙测试软件;
配置蓝牙串口模块:
这里把蓝牙串口模块配置成从机模式,具体设置过程如下:
(1) 让蓝牙串口模块进入命令设置状态,具体操作是:按着模块上唯一的按键不放,用USB接口给模块上电,这时正确的情景是模块上的LE...
分类:
移动开发 时间:
2015-08-17 15:40:59
阅读次数:
209
Given a binary tree, find its maximum depth.The maximum depth is the number of nodes along the longest path from the root node down to the farthest le...
分类:
其他好文 时间:
2015-08-17 11:37:33
阅读次数:
123
1.对比两个对象,在2.x的时候我们使用cmp,但是在3.x的时候,我们使用的是operator模块里面的函数
import operator
operator.lt(a, b)
operator.le(a, b)
operator.eq(a, b)
operator.ne(a, b)
operator.ge(a, b)
operator.gt(a, b)
operator.__lt...
分类:
编程语言 时间:
2015-08-17 01:04:51
阅读次数:
133
今天在刷Multiply Strings一题时,一直出现runtime error,找了很久都没找到问题。找了一个小时,是在扛不住了,问师兄了,一眼看出问题是new int(len1)这儿出了问题,导致数组越界了。创建一个数组是int *array=new int[length],创建一个长度为le...
分类:
其他好文 时间:
2015-08-16 21:20:17
阅读次数:
126