Search found 70 matches

by Raj Ariyan
Tue Mar 08, 2005 5:34 pm
Forum: Volume 6 (600-699)
Topic: 674 - Coin Change
Replies: 77
Views: 25884

About CLRS

Hi, I'm surprising to know that u still not understand abt CLRS. Actually CLRS are the first charachter of the each writer of the world famous algorithm book is "Introduction to Algorithm". C = Cormen L = Leiserson R = Rivest S = Stein Try to read this book when u will free. It will help you much. G...
by Raj Ariyan
Tue Mar 08, 2005 3:33 pm
Forum: Volume 6 (600-699)
Topic: 674 - Coin Change
Replies: 77
Views: 25884

674

Hi 58050zz, I cant understand why u implement queue or long code for this easy problem. Actually there are 3 problems exactly like this. My code is just 10 lines. The problem is actullay Knap-sack problem. In the book CLRS, you can find the algorithm. Just implement it for those coin. At first preca...
by Raj Ariyan
Tue Mar 08, 2005 3:25 pm
Forum: Volume 7 (700-799)
Topic: 755 - 487--3279
Replies: 115
Views: 28520

755

Hi Tamal, There are two mistake. 1. You print your output like this printf("%3d-%4d",temp/10000,temp%10000); printf(" %ld\n",count); But what abt this case ---> ** when temp/10000 returns 1 digit then u print only 1 not 001 output will be 001-0002 2, but ur output will be 1- 2 2 so use this :- print...
by Raj Ariyan
Tue Mar 08, 2005 2:55 pm
Forum: Volume 7 (700-799)
Topic: 755 - 487--3279
Replies: 115
Views: 28520

Sorry

Hi Kenneth.
I'm extreamly sorry. Actually when i copy my input file at that time something was missing. Now i edited my input and output. Sorry again.
by Raj Ariyan
Tue Mar 08, 2005 2:16 pm
Forum: Volume 103 (10300-10399)
Topic: 10324 - Zeros and Ones
Replies: 179
Views: 43324

??

Hi Ibrahim,

Think abt it....

Suppose one input will be:-
10111001
make a array in such a way(its upto u to implement) such that it holds :-
12333445 << your array for those input

Now if u ask for
1 3 --> then just check arr[1]==arr[3] if true then print yes else no

Do u get any idea ?
by Raj Ariyan
Fri Mar 04, 2005 12:00 pm
Forum: Volume 7 (700-799)
Topic: 755 - 487--3279
Replies: 115
Views: 28520

Hi, You can check this input. Hope it helps. Good luck Input :- 4 5 -0-0-0-0-1-0-1 IYSDS-1-1- MMDPS-22 0000A--AA -----AMSAM--AA 6 3-10-10-1A 6464642 ASACCS5 -1111115 F101010 888-1200 5 -5-5-9-7-4-9-2 2947955 GO-HOME-1 HOME-123 12344-AA 9 -123-5657 12----12121 ABBCSS1 12112-A--B ABBC-123 -1-2----3AAB...
by Raj Ariyan
Fri Mar 04, 2005 11:32 am
Forum: Volume 8 (800-899)
Topic: 855 - Lunch in Grid City
Replies: 41
Views: 19203

Help

Hi Yaron,

I think your median function does not always give right answer for all cases. You can sort street and avenue and then just print out the median (Simple Median Knowledge n/2 or n/2-1). Bye.
by Raj Ariyan
Fri Mar 04, 2005 11:27 am
Forum: Volume 8 (800-899)
Topic: 884 - Factorial Factors
Replies: 49
Views: 26841

Input/Output

Hi,

You can check this input.

Input :-
2
10
100
1000
10000
100000
1000000
999999
9999
123487
32227
888888
123121
121312
12121
5657
1231
5
5655
Output :-
1
15
239
2877
31985
343614
3626619
3626607
31977
426671
107204
3215736
425376
418966
39033
17699
3581
5
17693
Hope it helps. Bye
by Raj Ariyan
Wed Feb 16, 2005 3:52 pm
Forum: Volume 108 (10800-10899)
Topic: 10813 - Traditional BINGO
Replies: 28
Views: 9680

About 10813

Hi ibrahim, I think there is no critical input. The problem is very easy. I got wa at the contest time for some silly mistake, so u can check ur code for the array bound. I did.. 1. At first i take all card. 2. Then take one after one upto 75 bingo numbers, if the bingo number is match with the card...
by Raj Ariyan
Tue Feb 08, 2005 3:21 pm
Forum: Volume 103 (10300-10399)
Topic: 10310 - Dog and Gopher
Replies: 47
Views: 17325

Reply

The main problems with this type of problem is precission error. You used double,in my accepted code i used long double. But there are some other reason which led you wrong answer. Those are .... 1. Why u print two new lines every times ? You write.. if (k==0) printf("The gopher cannot escape.\n\n")...

Go to advanced search