sieve of Eratosthenes 找质素 由于一个合数总是可以分解成若干个质数的乘积,那么如果把质数(最初只知道2是质数)的倍数都去掉,那么剩下的就是质数了。例如要查找100以内的质数,首先2是质数,把2的倍数去掉;此时3没有被去掉,可认为是质数,所以把3的倍数去掉;再到5,再到7,7之后呢,因为8,9,10刚才都被去掉了,而100以内的任意合数肯定都有一个因子小于10(100的开方),所以,去掉,2,3,5,7的倍数后剩下的都是质数
Probabilistic Graphical Models Week1:贝叶斯网络: Bayesian Networks 更多介绍请点这里A Bayesian network is : a Directed Acyclic(No cycle) Graph(DAG) G whose nodes represent the random variables X1,...Xn for each node Xi a C
Algorithm Practice for 1548 RobotsTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 3531 Accepted: 1603DescriptionYour company provides robots that can be used to pick up litter from
Data Center TCP(DCTCP) Link: http://www.cmlab.csie.ntu.edu.tw/~kenneth/cloud2013/papers/dctcp-sigcomm2010.pdfSummary: This paper provide us a alternative Transport layer protocol used in data center instead of TCP proto
概率论基础 先验概率: 指根据历史的资料或主观判断所确定的各事件发生的概率,该类概率没能经过试验证实,属于见眼前的概率。后验概率: 一般指利用贝叶斯公式,结合调查等方式获取了新的附加信息,对先验概率进行修正后得到的更符合实际的概率条件概率: P(A|B) = P(AB)/P(B) interp: 在B已经发生的情况下,再发生A的概率是 AB同时发生的概率除以B发生的概率贝叶斯公式,也叫后验概率
Web Intelligence and Big Data 笔记 Week1: private search VS enterprise search: different from web search, since no hyper links, you can not rank page the way web searching does.
Algorithm Practice for 1574 The Triangle GameTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 542 Accepted: 315DescriptionIn the triangle game you start off with six triangles n
Algorithm Practice for 1575 Easier Done Than Said?Time Limit: 1000MS Memory Limit: 10000KTotal Submissions: 3906 Accepted: 2167DescriptionPassword security is a tricky thing. Users prefer si
CUDA - Heterogeneous Parallel Processing 笔记 Class 2.2 CUDA Device Memory Management API functions cudaMalloc() -- Allocates object in the device global memory -- Two parameters Address of a pointer to the allocated object
Algorithm Practice for 1576 ColorvilleTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 283 Accepted: 162DescriptionA simple matching game for children uses a board that is a sequenc
Algorithm Practice for 1577 Falling LeavesTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 3367 Accepted: 1866Description Figure 1Figure 1 shows a graphical representation of
LinuxCast笔记 1: 用crontab 创建定时任务, 进入/etc 输入 ls -ld cron*/ 运行cron -e 编写自己的定时程序, *: 表示任何时刻,: 表示分割-:表示一个段,如第二端里: 1-5,就表示1到5点 /n : 表示每个n的单位执行一次,如第二段里,*/1, 就表示每隔1个小时执行一次命令。也可以写成1-23/12: 查看CPU信息
Algorithm Practice for 1583 Choose Your Words CarefullyTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 1707 Accepted: 513DescriptionLet's face it, most students who do a good job o
Algorithm Practice for 1582 Which Way Do I Go?Time Limit: 1000MS Memory Limit: 10000KTotal Submissions: 394 Accepted: 66DescriptionYou've decided that the time is right for the next Internet
Algorithm Practice for 1581 A Contesting DecisionTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 2065 Accepted: 1508DescriptionJudging a programming contest is hard work, with dema
tcp-sim Fast Re-transmit :当收到三个重复的ack时 不必等到Retransmit Timeout(RTO) 会认为包丢失并且马上重传Fast Recovery: 当收到三个重复的ack或是超过了RTO且未收到某个数据包的ack, Reno会认为有数据包丢失了。 Reno 会把ssthresh设为目前congestion window的一半,之后的congestionwindow 则维
Algorithm Practice for 1580 String MatchingTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 3266 Accepted: 1691DescriptionIt's easy to tell if two words are identical - just check t
Algorithm Practice for 1578 Instruens FabulamTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 598 Accepted: 288DescriptionInstruens Fabulam means drawing a chart (or table) in Latin
Dijkstra解单源最大路径 问题三、单源最大路径给定带权有向图G =(V,E),其中每条边的权是非负实数。另外,还给定V中的一个顶点,称为源。现在要计算从源到所有其它各顶点的最短路长度。这里路的长度是指路上各边权之和。这个问题通常称为单源最短路径问题。1、算法基本思想Dijkstra算法是解单源最短路径问题的贪心算法。其基本思想是,设置顶点集合S并不断地作贪心选择来扩充这个集合。一个顶点属于集
Algorithm Practice for 2002 SquaresTime Limit: 3500MS Memory Limit: 65536KTotal Submissions: 13089 Accepted: 4840DescriptionA square is a 4-sided polygon whose sides have equal length and ad