线性回归其实就是寻找一条直线拟合数据点,使得损失函数最小。直线的表达式为:\[y_{j}=\omega_{1}x_{i,1}+\omega_{2}x_{i,2}+\dots+\omega_{j}x_{i,j}+\dots+b\]损失函数的表达式为:\[J=\frac{1}{2}\sum_{k=0}^ ...
分类:
其他好文 时间:
2017-03-27 13:11:36
阅读次数:
93
Description Give you a lot of positive integers, just to find out how many prime numbers there are. Input There are a lot of cases. In each case, ther ...
分类:
其他好文 时间:
2017-03-26 18:17:41
阅读次数:
196
map类型通常被称为关联数组,与正常数组类似,不同之处在于其下标不必是整数。我们通过一个关键字而不是位置来查找值(键值对)。 与之相对,set就是关键字的简单集合。当只是想知道一个值是否存在时,set是最有用的。 类似顺序容器,关联容器也是模板,为了定义一个map,我们必须指定关键字和值得类型。例: ...
分类:
其他好文 时间:
2017-03-25 13:01:05
阅读次数:
171
Description: Count the number of prime numbers less than a non-negative number, n. 找出小于n的素数个数。 1、用最淳朴的算法果然超时了。 2、埃拉托斯特尼筛法Sieve of Eratosthenes 我们从2开始遍 ...
分类:
编程语言 时间:
2017-03-24 19:05:11
阅读次数:
176
Twin Prime Conjecture Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 3280 Accepted Submission(s) ...
分类:
编程语言 时间:
2017-03-24 18:01:14
阅读次数:
156
2301: [HAOI2011]Problem b http://www.lydsy.com/JudgeOnline/problem.php?id=2301 Description 对于给出的n个询问,每次求有多少个数对(x,y),满足a≤x≤b,c≤y≤d,且gcd(x,y) = k,gcd(x, ...
分类:
其他好文 时间:
2017-03-24 14:05:02
阅读次数:
161
Description 今天的数学课上,Crash小朋友学习了最小公倍数(Least Common Multiple)。对于两个正整数a和b,LCM(a, b)表示能同时被a和b整除的最小正整数。例如,LCM(6, 8) = 24。回到家后,Crash还在想着课上学的东西,为了研究最小公倍数,他画了 ...
分类:
其他好文 时间:
2017-03-24 00:27:06
阅读次数:
220
#include<iostream>#include<cstdio>#include<cmath>using namespace std;int a[2];int main(){ int p,b=0,flag=1; scanf("%d",&p); for(int i=2;i<=p/2;i++) { ...
分类:
其他好文 时间:
2017-03-23 21:48:15
阅读次数:
159
Happy 2006 http://poj.org/problem?id=2773 Time Limit: 3000MS Memory Limit: 65536K Description Two positive integers are said to be relatively prime to ...
分类:
移动开发 时间:
2017-03-22 20:31:09
阅读次数:
263
A ring is compose of n circles as shown in diagram. Put natural number 1, 2, ..., n into each circle separately, and the sum of numbers in two adjacen ...
分类:
其他好文 时间:
2017-03-19 13:20:45
阅读次数:
194