Search found 62 matches

by DP
Sun Sep 09, 2007 9:22 pm
Forum: Volume 2 (200-299)
Topic: 216 - Getting in Line
Replies: 57
Views: 24582

Re: I used brute force for this problem, but always have get

zid_adrenalyns wrote:Usually I don't paste my code in forums, but ...whatelse...I try to solved it using brute force. This is my code. Someone can find the error?
:-?
Try Sample I/O.
Did you code yourself?
by DP
Mon Sep 03, 2007 8:30 pm
Forum: Volume 100 (10000-10099)
Topic: 10092 - The Problem with the Problem Setter
Replies: 31
Views: 12537

here I tried it with DFS ...but still WA :cry: ...... counter case plzzzzzzzzz...... No. Why are you crying? Check this code(bpm part) with http://acm.uva.es/p/v100/10080.html If correct then generate some random Test Cases by yourself. Then post the I/O here, it'll be easier to find out bug for ot...
by DP
Mon Sep 03, 2007 3:11 pm
Forum: Volume 112 (11200-11299)
Topic: 11269 - Setting Problems
Replies: 26
Views: 10864

Re: use optimal sorting for O(n) instead of O(nlogn).

baodog wrote:Use optimal sorting to get O(n) solution.
Or use backet sort... DP is a crime here ... since that would
be exponential.
DP is intuitive. ;)
by DP
Sat Aug 04, 2007 5:24 pm
Forum: Volume 112 (11200-11299)
Topic: 11254 - Consecutive Integers
Replies: 24
Views: 11697

Can someone please check my Output. Input: 152 3265 159 6512 65120 4875 48750 4561 1654 987 988 999 1235 230 650 390 9871 98710 4590 4599 65480 6580 981120 98110 651123 11100 111000 2321 78451 784510 7845100 78451000 6451 7465 74650 740 790 990 3265 4590 -1 My Output: 152 = 2 + ... + 17 3265 = 3265 ...
by DP
Mon Jul 30, 2007 6:48 pm
Forum: Algorithms
Topic: MinCost MaxFlow code
Replies: 20
Views: 15176

Follow this link, you'll get everything.
http://www.topcoder.com/tc?module=Stati ... d2=maxFlow
by DP
Sun Jun 10, 2007 9:10 am
Forum: Volume 112 (11200-11299)
Topic: 11226 - Reaching the fix-point.
Replies: 23
Views: 10269

What is the output for the following inputs?

Code: Select all

4560 90000
94561 489000
I got

Code: Select all

12
14
Just say is it wrong or correct? ;)
by DP
Thu Jun 07, 2007 12:17 pm
Forum: Algorithms
Topic: Algorithm based help? Needed,plz..........
Replies: 4
Views: 2527

Try to learn Breadth First Search(BFS) & Depth First Search(DFS) clearly with time complexity. After that try to research ;)

Then i think you will get your answer.
Otherwise Google is best to learn.

bye
by DP
Mon May 21, 2007 10:25 am
Forum: Volume 112 (11200-11299)
Topic: 11203 - Can you decide it for ME?
Replies: 21
Views: 10867

There can be M & E more than 1.
by DP
Tue May 08, 2007 5:41 pm
Forum: Volume 106 (10600-10699)
Topic: 10653 - Bombs! NO they are Mines!!
Replies: 36
Views: 18093

Yes, it is a plain BFS. Make input yourself. Then post it for correctness.
by DP
Sat Apr 28, 2007 10:43 am
Forum: Volume 111 (11100-11199)
Topic: 11115 - Uncle Jack
Replies: 25
Views: 15752

This is primary level. ;) Think like: Let, you have 3 marbles. Now, i tell you place those 3 marbles into 3 places. Repetition is always allowable . Then, what will be the answer? 27, right? Set={m1,m2,m3} position={p1,p2,p3} Now, you can place m1,m2,m3 marbles into p1,p2,p3 places. So, compare CDs ...
by DP
Sun Mar 04, 2007 4:45 pm
Forum: Volume 111 (11100-11199)
Topic: 11186 - Circum Triangle
Replies: 18
Views: 7262

Hi rio,
Would you kindly give me some hints about O(n)?
Or you can PM me.

thnx
by DP
Sat Feb 03, 2007 11:14 am
Forum: Volume 111 (11100-11199)
Topic: 11158 - Elegant Permuted Sum
Replies: 23
Views: 15014

Hi Everyone,
I want to solve it by DP. But couldn't find the right sequence. How can i distinctly make the
tree edge for caching?

Please help me or some hints from someone who solved!!!
thanks

DP
by DP
Sat Feb 03, 2007 11:10 am
Forum: Algorithms
Topic: Equation
Replies: 7
Views: 2856

Hm....:D
We can change the base also. So we will get x. But dont know, is it faster way!!!

Code: Select all

log 'a' base 'x' = log 'b' base 'x'/log 'b' base 'a'
Sorry for bad representation of log. I couldn't picturize it. ;)

DP
by DP
Tue Jan 30, 2007 2:42 pm
Forum: Algorithms
Topic: Equation
Replies: 7
Views: 2856

OK.
Let,

Code: Select all

x^y=A.............(1)
(x+1)^y=B.......(2)
Then, take logarithm in both sides of eqn. (1), so we got,

Code: Select all

ylog(x)=log(A)
y=log(A)/log(x).......(3)
Similarly,

Code: Select all

ylog(x+1)=log(B)......(4)
Finally replace y in eqn.(4). You will get x. After that y.
:)

DP
by DP
Mon Jan 29, 2007 3:43 pm
Forum: Algorithms
Topic: Equation
Replies: 7
Views: 2856

If remainder is always 1 then i think the sequence will be :

Code: Select all

1, (N+1), (2N+1), (3N+1), (4N+1), ................etc
So, try to think now about logarithm.

Let, c={0,1,2,3,4,.....m}
Then, we got the following thing:

Code: Select all

(cN+1)%N=A^x%N
Hope this will help you!!! :)

DP

Go to advanced search