- 博客(117)
- 资源 (3)
- 收藏
- 关注
原创 一个条件运算符的使用规范
一个条件运算符的使用规范看下面这段代码 int a = 0; int b = a ? 1 : 2; cout << b << endl; b = (a ? 1 : 2); cout 我们的两次输出都是1 但是如果改为 int a = 0; int b =1+ a ? 1 : 2; cout << b << endl
2018-01-10 16:37:47
1230
1
原创 Edge-based 3D object traking(0)
开坑目前读了一些论文,再加上实验室本身的object-track的工程,逐渐有了一些自己的思路。: 其基本步骤如下:1. Edge-extract 2. Model-detection 3. Traking with SLAM 接下来主要是解析思路,阅读论文。 今天主要是分析Edge-extract模块。Dollár P, Zitnick C L. Fast edge detecti
2017-09-18 10:56:57
720
原创 一个动态数组越界bug
今天遇到了一个动态数组越界bug。感觉很有趣,需要记记录一下。 一开始,代码是这个的:#define LENGTH...int P[LENGTH];...memcpy(p,P,sizeof(P));能正常运行,后来,我将P改为了动态数组,就变成了这样:...int *P = new int[length];...memcpy(p,P,sizeof(P));然后运行过程中就崩溃了,一开
2017-07-24 14:30:18
837
1
翻译 GAN 入门
GAN入门 GAN的基本原理其实非常简单,这里以生成图片为例进行说明。假设我们有两个网络,G(Generator)和D(Discriminator)。正如它的名字所暗示的那样,它们的功能分别是: D是一个判别网络,判别一张图片是不是“真实的”。它的输入参数是x,x代表一张图片,输出D(x)代表x为真实图片的概率,如果为1,就代表100%是真实的图片,而输出为0,就代表不可能是真实的图片。他的
2017-07-16 20:18:58
439
转载 欢迎使用优快云-markdown编辑器
欢迎使用Markdown编辑器写博客本Markdown编辑器使用StackEdit修改而来,用它写博客,将会带来全新的体验哦:Markdown和扩展Markdown简洁的语法代码块高亮图片链接和图片上传LaTex数学公式UML序列图和流程图离线写博客导入导出Markdown文件丰富的快捷键快捷键加粗 Ctrl + B 斜体 Ctrl + I 引用 Ctrl
2017-07-15 09:58:59
184
原创 MLlib中K-means流程
MLlib的聚类算法有K均值算法,LDA算法,二分K均值算法,高斯混合模型等等。以K均值为例。 MLlib中K-means流程如下: 第一步,选择K个点作为初始聚类中心。 第二步,计算其余所有点到聚类中心的距离,并把每个点划分到离它最近的聚类中心所在的聚类中去。在这里,衡量距离一般有多个函数可以选择,最常用的是欧几里得距离(EuclideanDistance),也叫欧式距离。公式如下:其中C代
2017-02-22 19:24:12
848
原创 协同过滤算法与推荐系统
协同过滤算法被广泛运用到推荐系统中。协同是指根据以前的用户行为模型来获得推荐内容。算法的目标是将用户-项目的矩阵中空缺的部分尽可能填上。MLlib采用交替最小二乘法(alternatingleastsquares,ALS)来学习用户与项目间的潜在因子。 协同过滤算法被广泛运用到推荐系统中。协同是指根据以前的用户行为模型来获得推荐内容。算法的目标是将用户-项目的矩阵中空缺的部分尽可能填上。Mllib
2017-02-22 19:20:36
671
原创 探索大规模线程吞吐量处理器的内存一致性
今天的通用(CPU)多核处理器都精确地指定了它们的硬件内存一致性模型(例如x86,IBM Power,SPARC TSO等)。 这些内存一致性模型保证了核心读取和写入的指定顺序,一致性模型之间的差异会对可编程性,性能和硬件实现复杂性产生重大影响。 一致性模型的选择因此是相当重要的,并且在20世纪90年代,有一个重要的有影响力的研究深入研究在多个CPU核心的多处理器的硬件一致性模型之间的权衡。除了CP
2017-02-22 19:19:10
542
原创 异构无竞争内存模型学习
在介绍异构无竞争内存模型前,我们需要说明说明是异构系统,以此方能目标引入异构无竞争内存模型的必要性。异构数据库系统是相关的多个数据库系统的集合,可以实现数据的共享和透明访问,每个数据库系统在加入异构数据库系统之前本身就已经存在,拥有自己的DMBS。异构数据库的各个组成部分具有自身的自治性,实现数据共享的同时,每个数据库系统仍保有自己的应用特性、完整性控制和安全性控制。而计算机体系结构的异构则是指,各
2017-02-22 19:18:14
487
原创 android连接至夜神模拟器快捷方法
在使用夜神模拟器进行安卓开发时,需要cd 到对应目录,输入nox_adb.exe connect 127.0.0.1:62001 在开发过程中,发现如果长期没有操作,或者重新启动,连接就会失效。而重新cd 和输入比麻烦,可以写一个批处理一键解决。call E:\Users\QQH\AppData\Roaming\Nox\bin\nox_adb.exe connect 127.0.0.1:62001
2016-07-08 14:38:49
6494
1
原创 B1005. 继续(3n+1)猜想 (25)
卡拉兹(Callatz)猜想已经在1001中给出了描述。在这个题目里,情况稍微有些复杂。当我们验证卡拉兹猜想的时候,为了避免重复计算,可以记录下递推过程中遇到的每一个数。例如对n=3进行验证的时候,我们需要计算3、5、8、4、2、1,则当我们对n=5、8、4、2进行验证的时候,就可以直接判定卡拉兹猜想的真伪,而不需要重复计算,因为这4个数已经在验证3的时候遇到过了,我们称5、8、4、2是被3“覆盖”
2016-03-03 15:45:16
475
原创 组合数
1、关于n!的一个问题。 n!=1*2*3*…*n求,n!中有多少的质因子p 直观的方法为int ans=0;for(int i=2;i<=n;i++){ int temp=i; while(temp%p==0){ temp/=p; ans++; }}但是其时间复杂度过大,为O(nlog n) 由数学方法可知,n!中有(n/p+n/p
2016-03-02 17:18:44
277
原创 1059. Prime Factors (25)
时间限制 50 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 HE, QinmingGiven any positive integer N, you are supposed to find all of its prime factors, and write them in the format N = p1^k1 * p2
2016-03-02 11:17:32
251
原创 1026. Table Tennis (30)
时间限制 400 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, YueA table tennis club has N tables available to the public. The tables are numbered from 1 to N. For any pair of players, if th
2016-03-01 15:42:02
298
原创 1014. Waiting in Line (30)
Suppose a bank has N windows open for service. There is a yellow line in front of the windows which devides the waiting area into two parts. The rules for the customers to wait in line are:The space in
2016-02-29 09:23:55
291
原创 1016. Phone Bills (25)
A long-distance telephone company charges its customers by the following rules:Making a long-distance call costs a certain amount per minute, depending on the time of day when the call is made. When a
2016-02-28 19:23:42
466
原创 1010. Radix (25)
Given a pair of positive integers, for example, 6 and 110, can this equation 6 = 110 be true? The answer is “yes”, if 6 is a decimal number and 110 is a binary number.Now for any pair of positive integ
2016-02-28 19:03:01
256
原创 1099. Build A Binary Search Tree (30)
A Binary Search Tree (BST) is recursively defined as a binary tree which has the following properties: The left subtree of a node contains only nodes with keys less than the node’s key. The right sub
2016-02-28 15:33:35
352
原创 1028. List Sorting (25)
Excel can sort records according to any column. Now you are supposed to imitate this function.InputEach input file contains one test case. For each case, the first line contains two integers N (<=10000
2016-02-28 11:23:49
296
原创 1009. Product of Polynomials (25)
This time, you are supposed to find A*B where A and B are two polynomials.Input Specification:Each input file contains one test case. Each case occupies 2 lines, and each line contains the information
2016-02-28 11:10:09
307
原创 1017. Queueing at Bank (25)
Suppose a bank has K windows open for service. There is a yellow line in front of the windows which devides the waiting area into two parts. All the customers have to wait in line behind the yellow lin
2016-02-27 23:03:42
343
原创 1105. Spiral Matrix (25)
时间限制 150 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, YueThis time your job is to fill a sequence of N positive integers into a spiral matrix in non-increasing order. A spiral matrix
2016-02-27 21:43:23
509
原创 1040. Longest Symmetric String (25)
Given a string, you are supposed to output the length of the longest symmetric sub-string. For example, given “Is PAT&TAP symmetric?”, the longest symmetric sub-string is “s PAT&TAP s”, hence you must
2016-02-27 21:11:42
415
原创 1045. Favorite Color Stripe (30)
Eva is trying to make her own color stripe out of a given one. She would like to keep only her favorite colors in her favorite order by cutting off those unwanted pieces and sewing the remaining parts
2016-02-27 20:50:49
246
原创 1018. Public Bike Management (30)
时间限制 400 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, YueThere is a public bike service in Hangzhou City which provides great convenience to the tourists from all over the world. One
2016-02-27 16:06:14
292
原创 1087. All Roads Lead to Rome (30)
Indeed there are many different tourist routes from our city to Rome. You are supposed to find your clients the route with the least cost while gaining the most happiness.Input Specification:Each input
2016-02-27 15:24:10
492
原创 1021. Deepest Root (25)
A graph which is connected and acyclic can be considered a tree. The height of the tree depends on the selected root. Now you are supposed to find the root that results in a highest tree. Such a root i
2016-02-26 20:23:34
214
原创 1013. Battle Over Cities (25)
It is vitally important to have all the cities connected by highways in a war. If a city is occupied by the enemy, all the highways from/toward that city are closed. We must know immediately if we need
2016-02-26 19:37:43
195
原创 1098. Insertion or Heap Sort (25)
According to Wikipedia:Insertion sort iterates, consuming one input element each repetition, and growing a sorted output list. Each iteration, insertion sort removes one element from the input data, fi
2016-02-26 17:29:33
355
原创 1107. Social Clusters (30)
When register on a social network, you are always asked to specify your hobbies in order to find some potential friends with the same hobbies. A “social cluster” is a set of people who have some of the
2016-02-26 16:16:35
729
原创 1106. Lowest Price in Supply Chain (25)
Lowest Price in Supply Chain (25) 时间限制 200 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, YueA supply chain is a network of retailers(零售商), distributors(经销商), and suppliers(供应商)– eve
2016-02-26 09:32:32
378
原创 1102. Invert a Binary Tree (25)
The following is from Max Howell @twitter:Google: 90% of our engineers use the software you wrote (Homebrew), but you can’t invert a binary tree on a whiteboard so fuck off.Now it’s your turn to prove
2016-02-25 19:33:24
263
原创 1091. Acute Stroke (30)
One important factor to identify acute stroke (急性脑卒中) is the volume of the stroke core. Given the results of image analysis in which the core regions are identified in each MRI slice, your job is to ca
2016-02-25 16:55:25
547
原创 1086. Tree Traversals Again (25)
时间限制 200 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, YueAn inorder binary tree traversal can be implemented in a non-recursive way with a stack. For example, suppose that when a 6-n
2016-02-25 16:32:42
287
原创 1103. Integer Factorization (30)
The K-P factorization of a positive integer N is to write N as the sum of the P-th power of K positive integers. You are supposed to write a program to find the K-P factorization of N for any positive
2016-02-25 11:19:50
259
原创 1097. Deduplication on a Linked List (25)
Given a singly linked list L with integer keys, you are supposed to remove the nodes with duplicated absolute values of the keys. That is, for each value K, only the first node of which the value or ab
2016-02-24 12:45:06
220
原创 1074. Reversing Linked List (25)
Given a constant K and a singly linked list L, you are supposed to reverse the links of every K elements on L. For example, given L being 1→2→3→4→5→6, if K = 3, then you must output 3→2→1→6→5→4; if K =
2016-02-24 11:18:16
230
原创 1022. Digital Library (30)
A Digital Library contains millions of books, stored according to their titles, authors, key words of their abstracts, publishers, and published years. Each book is assigned an unique 7-digit number as
2016-02-24 09:37:32
330
原创 1100. Mars Numbers (20)
People on Mars count their numbers with base 13:Zero on Earth is called "tret" on Mars.The numbers 1 to 12 on Earch is called "jan, feb, mar, apr, may, jun, jly, aug, sep, oct, nov, dec" on Mars, resp
2016-02-24 08:57:28
214
小型自选商场商品管理系统
2015-07-06
单词及其释义的录入和读取
2015-07-06
八数码问题求解
2015-07-06
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人