摘要: Given an array A of N integers, we draw N discs in a 2D plane such that the I-th disc is centered on (0,I) and has a radius of A[I]. We say that the J-th disc and K-th disc intersect if J ≠ K and J-th... 阅读全文
posted @ 2015-01-19 09:34 sjtubear 阅读(177) 评论(0) 推荐(0) 编辑
摘要: 1 / you can write to stdout for debugging purposes, e.g. 2 // printf("this is a debug message\n"); 3 #include 4 5 int cmp(const void*p1,const void*... 阅读全文
posted @ 2015-01-19 00:04 sjtubear 阅读(225) 评论(0) 推荐(0) 编辑
摘要: 首先上题目:A DNA sequence can be represented as a string consisting of the letters A, C, G and T, which correspond to the types of successive nucleotides i... 阅读全文
posted @ 2015-01-18 23:26 sjtubear 阅读(650) 评论(0) 推荐(0) 编辑
摘要: A non-empty zero-indexed array A consisting of N integers is given. A pair of integers (P, Q), such that 0 ≤ P < Q < N, is called a slice of array A (notice that the slice contains at least two elemen... 阅读全文
posted @ 2015-01-18 20:22 sjtubear 阅读(230) 评论(0) 推荐(0) 编辑
摘要: No need for a double cycle: :You are given N counters, initially set to 0, and you have two possible operations on them:increase(X) − counter X is inc... 阅读全文
posted @ 2015-01-18 17:18 sjtubear 阅读(318) 评论(0) 推荐(0) 编辑
摘要: Saving James Bond - Hard VersionThis time let us consider the situation in the movie "Live and Let Die" in which James Bond, the world's most famous s... 阅读全文
posted @ 2015-01-09 00:35 sjtubear 阅读(329) 评论(0) 推荐(0) 编辑
摘要: 今天在实验delegate与thread在初步的实验结束后,因为原来的delegate只有一个函数会被调用,感觉没有达到delegate的极致,所以又重新自己定义了一个delegate,在另一个线程运行时调用这个delegate,其中有两个函数会被顺序调用。一开始写的很顺利,点击运行。生成第二个线程... 阅读全文
posted @ 2015-01-01 02:02 sjtubear 阅读(679) 评论(0) 推荐(0) 编辑
摘要: 数据结构习题集-4-2 集合的运用1.题目:We have a network of computers and a list of bi-directional connections. Each of these connections allows a file transfer from o... 阅读全文
posted @ 2014-12-30 23:58 sjtubear 阅读(253) 评论(0) 推荐(0) 编辑
摘要: 数据结构练习 4-1 AVL 树1. 题目:Input Specification:Each input file contains one test case. For each case, the first line contains a positive integer N (left(原为... 阅读全文
posted @ 2014-12-30 19:55 sjtubear 阅读(268) 评论(0) 推荐(0) 编辑
摘要: Let's begin our journey on CS. 阅读全文
posted @ 2014-12-29 10:45 sjtubear 阅读(97) 评论(0) 推荐(0) 编辑