Search found 44 matches

by Tomislav Novak
Fri Jan 20, 2006 7:01 pm
Forum: Volume 106 (10600-10699)
Topic: 10651 - Pebble Solitaire
Replies: 6
Views: 5745

mamun wrote:Here are some I/O for you
I've finally spotted the bug. It was the 'else if' part in my recursive function... :oops:
Thank you very much.
by Tomislav Novak
Thu Jan 19, 2006 3:13 pm
Forum: Volume 106 (10600-10699)
Topic: 10651 - Pebble Solitaire
Replies: 6
Views: 5745

mamun wrote:So don't wait fro EOF.
It makes no difference. Still wrong answer.
by Tomislav Novak
Wed Jan 18, 2006 9:06 pm
Forum: Volume 106 (10600-10699)
Topic: 10651 - Pebble Solitaire
Replies: 6
Views: 5745

10651 - Pebble Solitaire

Hi. I'm trying to solve problem 10651. I have a variable mask which denotes the state (1 if there is a pebble in a cavity, 0 otherwise), and I'm using a memoized recursive function to calculate the minimum number of pebbles left. I also wrote a routine to print the optimal process of removing the pe...
by Tomislav Novak
Tue Jan 10, 2006 7:44 pm
Forum: Volume 108 (10800-10899)
Topic: 10860 - Many a Little makes a Mickle
Replies: 7
Views: 3387

10860 Many a Little makes a Mickle - complexity

Hi.
What is the complexity of the DP algorithm for this problem? Only thing I can think of would be O(length(P)*N*length(Pi)), which seems too much for the given constrains. Is there something I haven't considered?
by Tomislav Novak
Tue Apr 12, 2005 6:21 pm
Forum: Other words
Topic: To the Admins of this site
Replies: 3
Views: 1782

neno_uci wrote:Yes, we have all that is needed for the judge..., computers..., servers, but only the Judge Software is missing..., thanx again,
Take a look at http://theory.snu.ac.kr/ioi/.
by Tomislav Novak
Wed Mar 30, 2005 9:25 pm
Forum: Volume 102 (10200-10299)
Topic: 10271 - Chopsticks
Replies: 20
Views: 13487

Solved it finally. :-)
Hint to the other solvers: the third stick doesn't have to be strictly longer that the other two sticks (for example {1, 1, 1} is the possible set with badness 0). This makes checking whether there are free sticks left extremely easy. :-)
Thanks to Observer.
by Tomislav Novak
Tue Mar 29, 2005 2:21 pm
Forum: Off topic (General chit-chat)
Topic: Memory Usage
Replies: 2
Views: 2073

by Tomislav Novak
Mon Mar 28, 2005 4:55 pm
Forum: Algorithms
Topic: DP - help please...
Replies: 5
Views: 2257

yaro wrote:http://www.topcoder.com/tc?module=Stati ... d2=dynProg

I think this may be interesting for you.
Is there anything that covers more advanced DP problems?
by Tomislav Novak
Mon Mar 28, 2005 4:29 pm
Forum: Off topic (General chit-chat)
Topic: Memory Usage
Replies: 2
Views: 2073

Re: Memory Usage

shamim wrote:How to find out how much memory a program has used, in linux.
You could read /proc/<pid>/status just before your program terminates (using atexit for example). If anyone knows a better way (the one that judge uses), I would also like to know. :-)
by Tomislav Novak
Sat Mar 26, 2005 6:00 pm
Forum: Volume 102 (10200-10299)
Topic: 10271 - Chopsticks
Replies: 20
Views: 13487

I was not speaking about the relative order of the two for-loops, but of the order in which you go through the chopsticks during dp. Think about which order does help for what you want to do (easy calculation how many bigger sticks are free). Note: editing this post, since I haven't still solved th...
by Tomislav Novak
Sat Mar 26, 2005 11:36 am
Forum: Volume 102 (10200-10299)
Topic: 10271 - Chopsticks
Replies: 20
Views: 13487

Do the DP in the right order. Then, it is easy to calculate how many sticks are free to be the biggest stick in a set (note that you don't really care about which one you assign to which set). I don't understand. :oops: Am I supposed to do it like this? for ( i = 0; i < n; ++i ) for ( j = 0; j < k;...
by Tomislav Novak
Thu Mar 24, 2005 2:55 pm
Forum: Volume 102 (10200-10299)
Topic: 10271 - Chopsticks
Replies: 20
Views: 13487

* For a set of chopsticks, the longest piece C is not important. Of course, we need to ensure that this piece actually exists. Hi! Can you explain this in little more detail (how to ensure that the longest piece exists). I managed to figure out the O(k*n) algorithm (I'm only checking two neighbour ...
by Tomislav Novak
Sun Mar 06, 2005 7:20 pm
Forum: Volume 7 (700-799)
Topic: 714 - Copying Books
Replies: 29
Views: 23780

714 (Copying books) - greedy approach?

Hi. Can this problem be solved using a greedy algorithm? I've so far devised a dynamic programming O(n^3) algorithm, but the judge gives me wrong answer (when there is more than one optimal solution, and I have to minimize the work assigned to the first scriber, second and so on - the particular cas...
by Tomislav Novak
Thu Aug 19, 2004 1:04 pm
Forum: Volume 100 (10000-10099)
Topic: 10032 - Tug of War
Replies: 91
Views: 42240

I finally managed to find out why I'm getting WA, but I still can't fix it (i get TLE or MLE). Consider this test data: 1 4 100 50 50 200 If one team has weight 100, then it can consist of only one man (the one with weight 100) or two men with weights 50. So, weight 100 can be achieved with 1 or 2 p...
by Tomislav Novak
Thu Aug 19, 2004 10:07 am
Forum: Volume 100 (10000-10099)
Topic: 10020 - Minimal coverage
Replies: 57
Views: 26479

All the points stated in this problem will be on the X axes, so all Y co-ordinates should be zero. I dont know what did u mean by X-Y coordinates? My algorithm was to get to the highest point possible from each current position. Hope this will help. Oops... :) What I ment actually by X was the left...

Go to advanced search