## Search found 136 matches

Sat Jan 15, 2011 5:03 pm
Forum: Volume 112 (11200-11299)
Topic: 11223 - O: dah dah dah!
Replies: 43
Views: 18677

### Re: 11223 - O: dah dah dah!

..
Sat Jan 15, 2011 4:50 pm
Forum: Volume 1 (100-199)
Topic: 147 - Dollars
Replies: 233
Views: 20398

Rather than doing-
m= (n* 100), do this:
m = (int) (n * 100 + 0.5) to avoid floating point error.
Fri Jan 14, 2011 11:02 am
Forum: Volume 5 (500-599)
Topic: 562 - Dividing coins
Replies: 73
Views: 29667

### Re: 562 - Dividing Coins

you should get memory limit exceed.How much memory you used- int mark[10000][10000]; int store[10000][10000]; Its a simple 1-dimentional DP problem.look at the sample input 4 1 2 4 6 Declare an array A[50000] because highest value may be 100*500=50000 and and fill it by 0. now add all element .Sum=1...
Thu Jan 13, 2011 7:39 pm
Forum: Volume 5 (500-599)
Topic: 575 - Skew Binary
Replies: 18
Views: 3644

### Re: Skew Binary: got WA

Your program even don't pass the sample input.
Sat Jan 08, 2011 9:33 pm
Forum: Volume 5 (500-599)
Topic: 507 - Jill Rides Again
Replies: 92
Views: 29643

### Re: 507 - Jill rides again

Correct output-

Code: Select all

``````The nicest part of route 1 is between stops 1 and 4
The nicest part of route 2 is between stops 4 and 7``````
Sat Jan 08, 2011 9:22 pm
Forum: Volume 3 (300-399)
Topic: 392 - Polynomial Showdown
Replies: 93
Views: 17672

### Re: 392 WA

First Ans-
There exist a thread for problem no. 392.So why you are creating a new thread.

And then try this-

Code: Select all

``-1 -1 2 3 4 5 0 0 0``

Code: Select all

``-x^8 - x^7 + x^6 + x^5 + x^4 + x^3``
Actual output:-

Code: Select all

``-x^8 - x^7 + 2x^6 + 3x^5 + 4x^4 + 5x^3``
Wed Dec 22, 2010 4:12 pm
Forum: Volume 5 (500-599)
Topic: 507 - Jill Rides Again
Replies: 92
Views: 29643

### Re: 507 - Jill rides again

Try this-

Code: Select all

``````1
7
1
2
3
-34
3
3
``````
The nicest part of route 1 is between stops 5 and 7

The nicest part of route 1 is between stops 1 and 4
Sun Nov 14, 2010 3:44 pm
Forum: Volume 111 (11100-11199)
Topic: 11148 - Moliu Fractions
Replies: 19
Views: 12201

### Re: 11148 - Moliu Fractions

@shafaet_du, Some of your input is wrong.Because the problem statement clearly says-
There is always a space (ASCII #32) immediately after each operand.
Wed Nov 03, 2010 7:45 pm
Forum: Volume 4 (400-499)
Topic: 494 - Kindergarten Counting Game
Replies: 119
Views: 21467

### Re: 494 WA

Ok,tell me what will be the output of

Code: Select all

``salim1233sazzad``
Wed Nov 03, 2010 7:29 pm
Forum: Volume 6 (600-699)
Topic: 673 - Parentheses Balance
Replies: 243
Views: 45015

### Re: 673 - Parentheses Balance

You have problem in reading input.When you have to consider empty string you need to use gets().So use gets.and when you use gets() keep one thing in mind you have to read a dummy string if you take input before for taking newline.Like : scanf("%d",&n); gets(text); //dummy input for(j=1;j<=n;j++) { ...
Sat Oct 23, 2010 9:11 pm
Forum: Volume 110 (11000-11099)
Topic: 11086 - Composite Prime
Replies: 33
Views: 17561

### 11086 - Composite Prime

what is the number of composite prime less than 2^20(1048556).Is it 227886??
Tue Oct 19, 2010 10:03 pm
Forum: Volume 8 (800-899)
Topic: 884 - Factorial Factors
Replies: 49
Views: 26564

### Re: 884 - Factorial Factors

No, I don't think so.Here is an efficient way-

Code: Select all

`````` code removed
``````
I have no time to explain my code.So its upto you to understand the code.Dont submit it without understanding.And let me know after copying so that i can remove it.
Fri Sep 24, 2010 8:46 pm
Forum: Volume 115 (11500-11599)
Topic: 11512 - GATTACA
Replies: 23
Views: 9284

### Re: 11512 - GATTACA

This problem can be solved in many ways.I have solved it in the following way:- 1.Create a suffix array. 2.Sort the suffix array using qsort(). 3.Find the longest match(pattern) from suffix array. 4.Then using Knuth-Moris-Pratt find the no. of occurrence of pattern in the given string. It takes 0.11...
Fri Sep 24, 2010 11:49 am
Forum: Volume 3 (300-399)
Topic: 315 - Network
Replies: 68
Views: 21074

### Re: 315 Network

nishith wrote- rifayat samee_du wrote:I think the given graph can be disconnected !! :D My code handled that and got AC. try this case : Code: Select all input: 7 1 2 3 2 3 5 6 6 7 0 0 output : 2 I don't think so. My accepted code gives the output 1. Because the the graph has two subgraph, in which ...
Sat Sep 18, 2010 7:43 pm
Forum: Volume 4 (400-499)
Topic: 483 - Word Scramble
Replies: 122
Views: 19363

### Re: 483 Word Scramble PE!!!!!!!!!!!!!

You are printing an extra space here:

Code: Select all

``````
s[j] = '\0';
reverse(s, s+j);
printf("%s(space)", s);

Here you printing extra space,replace space with another character,you will find the problem.

``````