Search found 383 matches

by emotional blind
Sun Oct 19, 2008 8:12 am
Forum: Volume 114 (11400-11499)
Topic: 11486 - Finding Paths in Grid
Replies: 1
Views: 1635

Re: 11486 - Finding Paths in Grid

Number of possible states is less than 840.
by emotional blind
Sat Aug 23, 2008 9:49 pm
Forum: Volume 114 (11400-11499)
Topic: 11419 - SAM I AM
Replies: 21
Views: 10580

Re: 11419 - Sam I Am

My graph is same as yours.
by emotional blind
Fri Aug 22, 2008 10:49 am
Forum: Volume 114 (11400-11499)
Topic: 11419 - SAM I AM
Replies: 21
Views: 10580

Re: 11419 - Sam I Am

Number of nodes = number of row + number of column + 2

here I used 1 dummy source and one dummy sink.
by emotional blind
Fri Aug 22, 2008 10:47 am
Forum: Volume 114 (11400-11499)
Topic: 11462 - Age Sort
Replies: 49
Views: 18055

Re: 11462 - Ages Sort

And last integer of the sorted list should not be followed by a trailing space.
by emotional blind
Fri Aug 22, 2008 10:41 am
Forum: Volume 114 (11400-11499)
Topic: 11419 - SAM I AM
Replies: 21
Views: 10580

Re: 11419 - Sam I Am

No, I didn't have any problem related to time limit.
by emotional blind
Tue Aug 19, 2008 8:15 pm
Forum: Volume 111 (11100-11199)
Topic: 11151 - Longest Palindrome
Replies: 65
Views: 32810

Re: 11151 - Longest Palindrome

you mean, you got accepted?
by emotional blind
Tue Aug 19, 2008 8:13 pm
Forum: Volume 114 (11400-11499)
Topic: 11475 - Extend to Palindrome
Replies: 32
Views: 13786

Re: 11475 - Extend to Palindromes

I think that is not that hard. because the length of the string is only 1000. So O(N^2) solution will be enough.
by emotional blind
Tue Aug 19, 2008 8:03 pm
Forum: Volume 114 (11400-11499)
Topic: 11419 - SAM I AM
Replies: 21
Views: 10580

Re: 11419 - Sam I Am

I solved this problem using min-cut.
by emotional blind
Tue Aug 19, 2008 4:56 pm
Forum: Volume 111 (11100-11199)
Topic: 11151 - Longest Palindrome
Replies: 65
Views: 32810

Re: 11151 - Longest Palindrome

So, What do you mean by posting your code again?
Did you get accepted?
by emotional blind
Tue Aug 19, 2008 4:44 pm
Forum: Volume 111 (11100-11199)
Topic: 11151 - Longest Palindrome
Replies: 65
Views: 32810

Re: 11151 - Longest Palindrome

Code: Select all

       for(i=0; i<=m; i++)
       for(j=0; j<=n; j++)   
       {
          if(X[i]==Y[j]){c[i][j]=c[i-1][j-1]+1;}

Here is the problem
when i = 0 and j = 0, you are trying to access c[-1][-1] by c[i-1][j-1], isn't it?

I think your loop should start from 1 for each i and j.
by emotional blind
Tue Aug 19, 2008 4:16 pm
Forum: Volume 111 (11100-11199)
Topic: 11151 - Longest Palindrome
Replies: 65
Views: 32810

Re: 11151 - Longest Palindrome

instead of this

Code: Select all

      if(n>0)
      {cout<<endl;}

you should simply print new line

Code: Select all

cout<<endl;
by emotional blind
Fri Aug 08, 2008 4:14 am
Forum: Volume 114 (11400-11499)
Topic: 11473 - Campus Roads
Replies: 9
Views: 1598

Re: 11473 - Campus Roads

print a new line after each test case.
by emotional blind
Thu Aug 07, 2008 5:31 pm
Forum: Volume 114 (11400-11499)
Topic: 11473 - Campus Roads
Replies: 9
Views: 1598

Re: 11473 - Campus Roads

Correct Output.
by emotional blind
Wed Aug 06, 2008 8:39 am
Forum: Volume 114 (11400-11499)
Topic: 11480 - Jimmy's Balls
Replies: 12
Views: 5584

Re: 11480 - Jimmy's Balls

wahaha, There is O(1) solution. If it is hard for you, then you can try O(n) solution. Just iterate over number of red balls, for k red balls, try to find out kmax, and kmin, here kmax = maximum number of blue ball you can have when number of red ball is k and kmin = minimum number of blue ball you ...
by emotional blind
Tue Aug 05, 2008 7:04 am
Forum: Volume 114 (11400-11499)
Topic: 11473 - Campus Roads
Replies: 9
Views: 1598

Re: 11473 - Campus Roads

Output of Monsoon's input:

Code: Select all

Road #1:
0.00 0.00
1.00 0.00
4.00 0.00

Go to advanced search