<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-644431032334836430</id><updated>2011-07-08T16:11:56.768+02:00</updated><category term='geek'/><title type='text'>Geek's blog</title><subtitle type='html'>lost in algorithms</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://rafal-jozefowicz.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/644431032334836430/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://rafal-jozefowicz.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Rafal Jozefowicz</name><uri>http://www.blogger.com/profile/15036348397219692182</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>7</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-644431032334836430.post-1035733972770487586</id><published>2010-05-21T21:36:00.007+02:00</published><updated>2010-05-21T22:54:49.219+02:00</updated><title type='text'>On DP and graphs</title><summary type='text'>Many DP problems can be presented in the graph theory language. It is good to see a relation between those two worlds. Very often it helps to come up with the solution faster and in a more structured way.
Let's solve a simple problem:
Simple ProblemYou are given two dimensional array NxM, which is a map of the forest. Each cell contains the information about the number of blueberries in that </summary><link rel='replies' type='application/atom+xml' href='http://rafal-jozefowicz.blogspot.com/feeds/1035733972770487586/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rafal-jozefowicz.blogspot.com/2010/05/on-dp-and-graphs.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/644431032334836430/posts/default/1035733972770487586'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/644431032334836430/posts/default/1035733972770487586'/><link rel='alternate' type='text/html' href='http://rafal-jozefowicz.blogspot.com/2010/05/on-dp-and-graphs.html' title='On DP and graphs'/><author><name>Rafal Jozefowicz</name><uri>http://www.blogger.com/profile/15036348397219692182</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_9EJ9jnoEp7I/S_bds_bNDkI/AAAAAAAAAj0/UHeVbnE5xYc/s72-c/map.png' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-644431032334836430.post-2700758314044361629</id><published>2010-04-08T23:40:00.002+02:00</published><updated>2010-04-09T09:57:14.538+02:00</updated><title type='text'>On finding majority</title><summary type='text'>I have recently given a thought to a following problem:
You are given an array (size N) of some numbers. Find out if there exists a number that appears at least N/2 – 4 times in it. Print out any of them or “Not exists” if there isn’t any.
Expected solution: linear time, constant additional memory.
Sounds silly and very unpractical, I know, but it’s still a quite interesting problem :) Try to </summary><link rel='replies' type='application/atom+xml' href='http://rafal-jozefowicz.blogspot.com/feeds/2700758314044361629/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rafal-jozefowicz.blogspot.com/2010/04/on-finding-majority.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/644431032334836430/posts/default/2700758314044361629'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/644431032334836430/posts/default/2700758314044361629'/><link rel='alternate' type='text/html' href='http://rafal-jozefowicz.blogspot.com/2010/04/on-finding-majority.html' title='On finding majority'/><author><name>Rafal Jozefowicz</name><uri>http://www.blogger.com/profile/15036348397219692182</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-644431032334836430.post-7456356667942771913</id><published>2009-12-23T02:08:00.006+01:00</published><updated>2010-04-17T23:31:24.594+02:00</updated><title type='text'>Dynamic Programming - more action</title><summary type='text'>Let's look at some more problems to exercise our brains during Christmas time.
Problem IIIYou are given an N element array filled with integers. Find the non-empty interval in this array with maximal possible sum.Example:T = [1, -2, 3, 1, -3, 2, 2, -7, 4, -2, 1]Here the best solution is interval [2, 6] (indexing from 0) with sum equal to 3 + 1 + (-3) + 2 + 2 = 5.
This is a much different problem </summary><link rel='replies' type='application/atom+xml' href='http://rafal-jozefowicz.blogspot.com/feeds/7456356667942771913/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rafal-jozefowicz.blogspot.com/2009/12/dynamic-programming-more-action.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/644431032334836430/posts/default/7456356667942771913'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/644431032334836430/posts/default/7456356667942771913'/><link rel='alternate' type='text/html' href='http://rafal-jozefowicz.blogspot.com/2009/12/dynamic-programming-more-action.html' title='Dynamic Programming - more action'/><author><name>Rafal Jozefowicz</name><uri>http://www.blogger.com/profile/15036348397219692182</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-644431032334836430.post-7096108168421830873</id><published>2009-12-15T23:06:00.002+01:00</published><updated>2009-12-23T11:08:16.633+01:00</updated><title type='text'>Dynamic Programming - the basics</title><summary type='text'>
Have you ever had bad dreams because of not being able to solve any dynamic programming problems?
Yeah, me neither.

Many of my friends hate this technique. Why is that?
Let's see the typical process of learning DP:
1. Encounter hard enough DP problem on some competition / book
2. After not solving it, ask someone how to do it correctly
3. “They’re crazy. How the ?#$% should I be able to come up</summary><link rel='replies' type='application/atom+xml' href='http://rafal-jozefowicz.blogspot.com/feeds/7096108168421830873/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rafal-jozefowicz.blogspot.com/2009/12/dynamic-programing-basics.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/644431032334836430/posts/default/7096108168421830873'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/644431032334836430/posts/default/7096108168421830873'/><link rel='alternate' type='text/html' href='http://rafal-jozefowicz.blogspot.com/2009/12/dynamic-programing-basics.html' title='Dynamic Programming - the basics'/><author><name>Rafal Jozefowicz</name><uri>http://www.blogger.com/profile/15036348397219692182</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_9EJ9jnoEp7I/Syao0kajD6I/AAAAAAAAAdw/CdiFBTvhGao/s72-c/1893_Edvard_Munch_The_Scream-WR400.jpg' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-644431032334836430.post-2909921228450692466</id><published>2009-12-12T00:17:00.010+01:00</published><updated>2009-12-20T21:34:15.692+01:00</updated><title type='text'>Brutal coding</title><summary type='text'>No matter how good you are, there will be problems that you are unable to solve, even after long hours spent on thinking. What can you do with them?
Very often it is possible write a solution that looks at every candidate for the result and chooses the best. This is a brute force approach. I want to talk about it a bit today, because from my and others experience I know that it is easy to say: "</summary><link rel='replies' type='application/atom+xml' href='http://rafal-jozefowicz.blogspot.com/feeds/2909921228450692466/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rafal-jozefowicz.blogspot.com/2009/12/brutal-coding.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/644431032334836430/posts/default/2909921228450692466'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/644431032334836430/posts/default/2909921228450692466'/><link rel='alternate' type='text/html' href='http://rafal-jozefowicz.blogspot.com/2009/12/brutal-coding.html' title='Brutal coding'/><author><name>Rafal Jozefowicz</name><uri>http://www.blogger.com/profile/15036348397219692182</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-644431032334836430.post-7768633631627891647</id><published>2009-12-09T01:27:00.011+01:00</published><updated>2009-12-10T20:56:06.435+01:00</updated><title type='text'>Too long to read</title><summary type='text'>I've always liked thinking about mathematical problems but never proving their solutions.
This is one of the reasons I got interested in the algorithm competitions. Solutions don't have to be perfect, sometimes they don't even have to be correct. It's just enough that they're working on test cases provided by authors. It makes you creative. You can try different approaches based on your intuition</summary><link rel='replies' type='application/atom+xml' href='http://rafal-jozefowicz.blogspot.com/feeds/7768633631627891647/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rafal-jozefowicz.blogspot.com/2009/12/too-long-to-read.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/644431032334836430/posts/default/7768633631627891647'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/644431032334836430/posts/default/7768633631627891647'/><link rel='alternate' type='text/html' href='http://rafal-jozefowicz.blogspot.com/2009/12/too-long-to-read.html' title='Too long to read'/><author><name>Rafal Jozefowicz</name><uri>http://www.blogger.com/profile/15036348397219692182</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_9EJ9jnoEp7I/Sx7oSshzJkI/AAAAAAAAAdo/1omo8vU0Hwk/s72-c/3841437676_f7851f740d.jpg' height='72' width='72'/><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-644431032334836430.post-3233756394461115474</id><published>2009-12-08T03:04:00.002+01:00</published><updated>2009-12-09T00:27:34.915+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='geek'/><title type='text'>Hello World!</title><summary type='text'>My name is Rafal and I am a geek. I devoted about 5 years of my life to algorithms and  participated in a lot of competitions. Some with successes, some with failures, but since I am apparently getting too old for this I decided to share some thoughts/experience before I die.</summary><link rel='replies' type='application/atom+xml' href='http://rafal-jozefowicz.blogspot.com/feeds/3233756394461115474/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rafal-jozefowicz.blogspot.com/2009/12/hello-world.html#comment-form' title='7 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/644431032334836430/posts/default/3233756394461115474'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/644431032334836430/posts/default/3233756394461115474'/><link rel='alternate' type='text/html' href='http://rafal-jozefowicz.blogspot.com/2009/12/hello-world.html' title='Hello World!'/><author><name>Rafal Jozefowicz</name><uri>http://www.blogger.com/profile/15036348397219692182</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>7</thr:total></entry></feed>
