
Algorithm
文章平均质量分 82
lllcfr1
这个作者很懒,什么都没留下…
展开
-
Computational Geometry
PrerequisitesGraph Theory Shortest PathToolsThis module discusses several algorithms that calculate various geometric properties, mostly based on only two operations described below: cross product and arctangent.Cross ProductThe cross product of.原创 2022-05-15 08:57:09 · 407 阅读 · 0 评论 -
Eulerian Tour
Eulerian Tour Sample Problem: Riding The FencesFarmer John owns a large number of fences, which he must periodically check for integrity. Farmer John keeps track of his fences by maintaining a list of their intersection points, along...原创 2022-04-25 01:52:32 · 4972 阅读 · 0 评论 -
编程之美 微软技术面试心得
1.1 让CPU占用率曲线听你指挥GetTickCount(), Sleep(), QueryPerformanceCounter()1.3 一摞烙饼的顺序Search with pruning.Paper by Bill Gates: "Bounds for Sorting by Prefix Reversal", 19791.4 买书问题,1.6 饮料供货Greedy, Dynamic programming1.7 光影切割问题逆序对1.8 电梯调度算法O(N):原创 2022-04-11 09:17:51 · 599 阅读 · 0 评论 -
Programming Collective Intelligence
user-based collaborative filteringitem-based collaborative filtering: The general technique is to precompute the most similar items for each item. Then, when you wish to make recommendations to a us转载 2014-01-29 20:23:51 · 703 阅读 · 0 评论 -
矩形切割
Previous related blog: http://blog.youkuaiyun.com/lllcfr/article/details/7567045先判断是否重叠,然后切割.注意答案要求的是哪一部分.1. 二维矩形 USACO 5-3-window#include #include #include #include #include #include #i原创 2014-01-11 21:01:39 · 1570 阅读 · 0 评论 -
k-th Smallest Element of Two Sorted Arrays
http://nriverwang.blogspot.hk/2013/04/k-th-smallest-element-of-two-sorted.htmlProblem Description:Given two sorted arrays A and B of size m and n, respectively. Find the k-th (1 smalle转载 2014-01-10 19:45:54 · 1252 阅读 · 0 评论 -
Longest Repeated Substring
http://nriverwang.blogspot.hk/This problem is from codeeval.com.Problem Description:You are to find the longest repeated substring in a given text. Repeated substrings may not overla转载 2014-01-10 14:51:42 · 1085 阅读 · 0 评论 -
Beauty of Programming [Essentials]
编程之美 Beauty of Programming[Essentials]3.1 String Rotation ==> Concatenation3.2 Loop Recursive3.3 Levenshtein distance (Edit distance), computing: DP ***3.4 Singly linked list3.5 How t原创 2013-02-13 00:17:29 · 654 阅读 · 0 评论 -
判断是否为二分图
Google CodeJam China Campus Test 2014Practice Round Problem A: https://code.google.com/codejam/contest/2933486/dashboard#s=p0Solution:References:http://blog.163.com/kevinlee_2010/b转载 2013-09-16 23:54:18 · 838 阅读 · 0 评论 -
2014编程之美挑战赛资格赛
大赛得分及排名规则详见:http://programming2014.cstnet.cn/rules.html原创 2014-04-11 16:37:12 · 904 阅读 · 0 评论 -
TopCoder Algorithm Tutorials
AuthorTitlelbackstromThe Importance of AlgorithmsantimatterHow To Dissect a TopCoder Problem StatementDumitruHow to Find a Solutionleadhyena_inranPl转载 2013-06-12 22:45:51 · 1401 阅读 · 0 评论 -
TopCoder SRM205 Div1 1000pt LongPipes
Problem: http://community.topcoder.com/stat?c=problem_statement&pm=2226Analysis:转载 2014-04-09 14:32:47 · 1156 阅读 · 0 评论 -
Google CodeJam Qualification Round 2014
Problems: https://code.google.com/codejam/contest/2974486/dashboard原创 2014-04-13 10:53:25 · 879 阅读 · 0 评论 -
POJ 2186 -- Popular Cows (Strongly Connected Components)
强连通分量缩点Problem: http://poj.org/problem?id=2186Popular CowsTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 22027 Accepted: 8993Descriptio原创 2014-04-09 21:36:03 · 899 阅读 · 0 评论 -
Search a Young Tableau
http://codinggeeks.blogspot.hk/2010/04/young-tableau.html转载 2014-08-11 10:24:20 · 1262 阅读 · 0 评论 -
Principles of parallel programming
Book: http://book.douban.com/subject/3564286/Authors: Calvin Lin, Lawrence Snyder转载 2014-03-07 19:38:45 · 2512 阅读 · 0 评论 -
Search Techniques
Search TechniquesSample Problem: n Queens [Traditional]Place n queens on an n x n chess board so that no queen is attacked by another queen.Depth First Search (DFS) Th转载 2014-12-24 03:23:19 · 631 阅读 · 0 评论 -
Codeforces Problem 332B: Backward Linear Scan
http://codeforces.com/problemset/problem/332/BMaximum Absurditytime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutput原创 2013-07-25 19:14:24 · 757 阅读 · 0 评论 -
[4_4_shuttle] Search? Analyze?
Shuttle PuzzleTraditionalThe Shuttle Puzzle of size 3 consists of 3 white marbles, 3 black marbles, and a strip of wood with 7 holes. The marbles of the same color are placed in the holes at the o原创 2013-06-07 02:29:48 · 2517 阅读 · 0 评论 -
[4_3_buylow] Non-duplicate longest decreasing sequences
Buy Low, Buy LowerThe advice to "buy low" is half the formula to success in the stock market. But to be considered a great investor you must also follow this problems' advice:"Buy low, buy lower转载 2013-06-04 14:58:49 · 760 阅读 · 0 评论 -
codeforces 166?
?D: incremental (not re-compute from scratch), Rabin-Karp rolling hash!转载 2013-02-12 02:14:42 · 422 阅读 · 0 评论 -
Baidu Astar Contest 2013-03-23 Regional (Wuhan)
2013年3月23号竞赛题目一主办方: 百度公司开始时间:2013-03-23 20:00结束时间:2013-03-23 22:00已结束 平衡负载Du熊正在负责一个大型的项目,目前有K台服务器,有N个任务需要用这K台服务器来完成,所以要把这些任务分成K个部分来完成,在同上台服务转载 2013-03-24 13:41:17 · 1311 阅读 · 0 评论 -
codeforces #176 div.2
http://codeforces.com/contest/287B: 二分 求最大的小于某数之和http://en.wikipedia.org/wiki/Binary_search_algorithmhttp://community.topcoder.com/tc?module=Static&d1=tutorials&d2=binarySearch转载 2013-03-23 18:12:56 · 788 阅读 · 0 评论 -
Baidu Astar Contest 2013-04-13 Regional (Guangzhou)
2013年4月13日竞赛题目一du熊的机器人Descriptiondu熊正在玩一个别人刚送给它的机器人。这个机器人只能在一个棋盘中行走,棋盘的左上角格子为(0, 0),右下角格子为(X, Y)。du熊控制这个机器人从棋盘的左上角,走到右下角,再从右下角回到左上角。当机器人从左上角走到右下角的过程中,如果它当前所在格子为(x, y),则它只能走到(x+1, y)或(x转载 2013-04-13 21:52:26 · 1524 阅读 · 0 评论 -
Edge Detection: Sobel operator
Excerpts from the Book: Python Programming in Contexthttp://en.wikipedia.org/wiki/Sobel_operatorIn order to find an edge, it is necessary to evaluate each pixel in relation to those that a转载 2013-04-16 21:47:37 · 1335 阅读 · 0 评论 -
[4_1_cryptcow] Search + Pruning (Unfinished)
CryptcowgraphyBrian DeanThe cows of Farmer Brown and Farmer John are planning a coordinated escape from their respective farms and have devised a method of encryption to protect their written comm转载 2013-04-26 15:37:51 · 863 阅读 · 0 评论 -
[4_1_fence8] Search problem: Optimizations
Fence RailsBurch, Kolstad, and SchrijversFarmer John is trying to erect a fence around part of his field.He has decided on the shape of the fence and has even already installed the posts, but he's原创 2013-04-14 16:58:28 · 939 阅读 · 0 评论 -
[TopCoder Algorithm Tutorial] Binary Search
http://community.topcoder.com/tc?module=Static&d1=tutorials&d2=binarySearchBinary SearchWhat we can call the main theorem states that binary search can be used if and only if for all x in转载 2013-04-12 18:39:24 · 1693 阅读 · 0 评论 -
Baidu Astar 130427
to be done原创 2013-04-27 20:58:33 · 716 阅读 · 1 评论 -
Lucas' theorem
http://acm.tju.edu.cn/toj/showp3914.htmlhttp://blog.youkuaiyun.com/wmn_wmn/article/details/7840539http://blog.ac521.org/?p=512http://en.wikipedia.org/wiki/Lucas'_theoremhttp://blog.youkuaiyun.com/wu转载 2013-05-25 14:18:46 · 1529 阅读 · 0 评论 -
Topological sorting
http://baike.baidu.com/view/288212.htmhttp://en.wikipedia.org/wiki/Topological_sorting转载 2013-06-09 18:40:47 · 718 阅读 · 0 评论 -
Convex hull: Graham scan
http://cerberus.delos.com:791/usacotext2?a=AbaQgb9KD6b&S=chtexthttp://en.wikipedia.org/wiki/Graham_scan转载 2013-06-09 18:46:19 · 831 阅读 · 0 评论 -
[4_4_milk6] Network flow
Pollutant ControlHal BurchIt's your first day in Quality Control at Merry Milk Makers, and already there's been a catastrophe: a shipment of bad milk has been sent out. Unfortunately, you didn't d转载 2013-06-09 15:55:27 · 3680 阅读 · 0 评论 -
[5_1_theme] DP?
Musical ThemesBrian DeanA musical melody is represented as a sequence of N (1 <= N <= 5000) notes that are integers in the range 1..88, each representing a key on the piano. It is unfortunate but转载 2013-06-12 19:05:00 · 813 阅读 · 0 评论 -
Google CodeJam Round 1A 2013
Official Analysis: https://code.google.com/codejam/contest/2418487/dashboard#s=aC++ code for Problem A:#include #include using namespace std;const int MAXLEN = 10000;class BigInteger原创 2013-04-27 11:59:15 · 824 阅读 · 0 评论 -
Google CodeJam Round 1C 2013
Official analysis: https://code.google.com/codejam/contest/2437488/dashboard#s=aC++ codesProblem A (small)#include #include #include using namespace std;inline bool is_constant(cha原创 2013-05-12 19:44:08 · 806 阅读 · 0 评论 -
Single-source shortest path problem: SPFA vs. Dijkstra
Use USACO [3_2_butter] as an exampleSPFA is an improvement of the Bellman-Ford algorithm, check the corresponding wikipedia page1. worst case: same complexity as Bellman-Ford O(VE)average perf原创 2012-09-02 18:04:30 · 962 阅读 · 0 评论