Search found 6 matches

by 7erry
Sun Sep 02, 2007 12:09 pm
Forum: Algorithms
Topic: arctan (1/u)
Replies: 2
Views: 2280

This problem is not a homework, it's from SPOJ. I don't know what you mention, k must be an integer (for this problem) and I think temper_3243 can easily solve this if k is not (without anything called Lagrange multipliers...). What he needs is that someone can help him to solve the problem.
by 7erry
Tue Jun 19, 2007 10:51 am
Forum: Algorithms
Topic: distinct substrings
Replies: 5
Views: 4962

This is my program which got WA in spoj, please help me... http://www.spoj.pl/problems/DISUBSTR/ const lowc=char(ord(32)); highc=char(ord(127)); maxs=1000; type trie=^trienode; trienode=array[lowc..highc] of trie; var s:array[1..maxs] of char; k,i,j,ss:integer; a:trie; res:longint; procedure readf; ...
by 7erry
Mon Jun 18, 2007 6:45 pm
Forum: Algorithms
Topic: distinct substrings
Replies: 5
Views: 4962

Please tell me how to do this in O(n^2)
I think inserting a substring costs O(n). With n^2 substrings we need O(n^3) to complete constructing trie, right?
by 7erry
Sat Jun 02, 2007 7:30 pm
Forum: Algorithms
Topic: Maximum Bipartite Matching
Replies: 1
Views: 1794

Maximum Bipartite Matching

I want to find an efficient algorithm to count the number of maximum bipartite matching, anyone could help me?...
by 7erry
Mon May 21, 2007 2:04 pm
Forum: Algorithms
Topic: a problem from spoj
Replies: 1
Views: 1879

a problem from spoj

Harry Potter has n mixtures in front of him, arranged in a row. Each mixture has one of 100 different colors (colors have numbers from 0 to 99). He wants to mix all these mixtures together. At each step, he is going to take two mixtures that stand next to each other and mix them together, and put th...
by 7erry
Thu Mar 08, 2007 3:51 pm
Forum: Algorithms
Topic: Challenge in a DP problem
Replies: 3
Views: 2681

Challenge in a DP problem

Let's come to this problem: there's a set A={x1,x2,...,xn}. Our goal is dividing the set into 2 groups in order to the difference between sum of all the elements in group 1 and sum of all elements in group 2 is smallest this is a typical problem using DP, the array's size for DP is |max{x1,x2,..,xn}...

Go to advanced search