## Search found 50 matches

Sun Apr 06, 2003 8:51 pm
Forum: Volume 103 (10300-10399)
Topic: 10397 - Connect the Campus
Replies: 75
Views: 25377

### 10397:WHY WA?

I used the prim algorithm for this problem. First, the numbers of connected buildings are taken... these values are inserted in the 'edge' list and near_node of the corresponding values are made -1. then prim() function determines the new nodes connected with the nodes already in the 'edge' and upd...
Tue Apr 01, 2003 7:56 am
Forum: Volume 100 (10000-10099)
Replies: 60
Views: 14148

### 10009: why WA?

This program is always getting WA... I can't understand where the problem is... I checked for multiple input..it didn't work... Does the position of Rome make sense to other cities? I think by default, Rome is the starting point, and input will be given as such... I made the list of cities first & t...
Sat Mar 15, 2003 8:16 pm
Forum: Volume 4 (400-499)
Topic: 495 - Fibonacci Freeze
Replies: 222
Views: 29743

### thanx man!

Hi, I got it accepted...

I pointed out this line and modified the code so that first 5000 fib numbers
are generated before the input...

This is surely faster than my previous coding..

Thanx again for ur time to see my code..

Razib
Sat Mar 01, 2003 8:32 pm
Forum: Volume 104 (10400-10499)
Topic: 10433 - Automorphic Numbers
Replies: 41
Views: 23072
Hi everybody, I got this problem AC... I first generated both the 2000-digit automorphic numbers in a seperate program because it took a lot of time...then I checked the digits from the last with the digits of input number,because an automorphic number contains all the smaller automorphic numbers......
Fri Feb 28, 2003 11:05 am
Forum: Volume 4 (400-499)
Topic: 492 - Pig-Latin
Replies: 213
Views: 25000
To Sajid:
Of course, it's ANSI standard...
in many problems, you will get RTE if you use smaller array

Razib
Thu Feb 27, 2003 6:13 am
Forum: Volume 4 (400-499)
Topic: 494 - Kindergarten Counting Game
Replies: 119
Views: 21470

### Increase ur array size

I think, you are new in this business...
Always try to use bigger arrays...that will use some extra memory, but your program will never get RTE...

in this case, you should use an array size of 1,000,000...
if it doesn't work, try decreasing a little....

Razib

Do or do not, there is no try.
Fri Feb 21, 2003 8:26 pm
Forum: Volume 103 (10300-10399)
Topic: 10323 - Factorial! You Must be Kidding!!!
Replies: 106
Views: 31898

### Give some explanation

I can't understand how to calculate factorial of negative numbers...if u put n=0 in the formula (n-1)!=n!/n, u get -1!=0!/0...how is this possible? pls give some explanation of the process how negative even numbers get Underflow! and odd numbers get Overflow!... ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ R...
Fri Feb 21, 2003 8:15 pm
Forum: Volume 101 (10100-10199)
Topic: 10183 - How Many Fibs?
Replies: 66
Views: 23274

### Thanx a lot

Thanx man for ur time to see my code...
I made a mistake in the typecasting where I forgot to give parentheses...Totally silly....

Then I got Accepted...495 & 10183...

thanx again...

Razib
Tue Feb 18, 2003 2:27 am
Forum: Volume 101 (10100-10199)
Topic: 10183 - How Many Fibs?
Replies: 66
Views: 23274

### 10183: why Compile error?

I generated first 500 Fibonacci numbers first, coz 500th fib. number has 105 digits,more than needed for this prog. then I tried to find the number of fibs between the range given as strings... but it gets CE always... What's the matter, guys? Pls help me out.. Here's my code: #include <stdio.h> #in...
Tue Feb 18, 2003 2:17 am
Forum: Volume 4 (400-499)
Topic: 465 - Overflow
Replies: 104
Views: 23697

### 465:why It's getting compile error?

hi, This is also getting CE as 495... what's the problem u think I have in my code.. here's my code: #include <stdio.h> #include <string.h> #include <stdlib.h> #include <math.h> #define MAX 1000 #define MAXSZ 500 #define MAXARRAY 10000 #define MAX_INT 32767 void str_add(char first[],char second[],lo...
Tue Feb 18, 2003 2:11 am
Forum: Volume 4 (400-499)
Topic: 495 - Fibonacci Freeze
Replies: 222
Views: 29743

### 495:WHY compile error?

My prog. always gets Compile error.. why this is happening, pls tell me someone... I thought 5000th fibonacci number as a string coz it has 1045 digits.. so I used string addition to calculate it.. Input & output seems OK to me.. But it's not compiling to them... What can I do? Here's my code: #incl...
Tue Feb 18, 2003 2:04 am
Forum: Volume 4 (400-499)
Topic: 444 - Encoder and Decoder
Replies: 155
Views: 21012

### Thanx a lot!!!

hi, thanx a lot for ur nice help..

I got it accepted...

I m really grateful to u coz u have given ur so precious time to look my code...

wish u good luck..
Razib
Tue Feb 18, 2003 1:55 am
Forum: Volume 4 (400-499)
Topic: 492 - Pig-Latin
Replies: 213
Views: 25000

### Define the WORDS

hi, I also came through lots of RTEs to get AC. u should first make the array size 1,000000... then separate the words & non-words... words r those which r made of only alpha characters... non-words mean space & other characters... then modify each word & print the non-words as they r... wish u good...
Sun Feb 02, 2003 7:51 pm
Forum: Volume 100 (10000-10099)
Topic: 10093 - An Easy Problem!
Replies: 52
Views: 14798

### thanx a lot

Thanx man for ur nice suggestion..
I checked for lower case letters & got it Accepted...

thanx again for ur valuable time on this problem

Razib
Fri Jan 31, 2003 8:27 pm
Forum: Volume 102 (10200-10299)
Topic: 10203 - Snow Clearing
Replies: 21
Views: 4515

### 10203

I thot this is very easy... just sum all the distances,double the distance and divide by 20... but this is getting WA.... can anybody help me with this... #include <stdio.h> #include <math.h> void main() { float sum,x_start,x_end,y_start,y_end; float x1,y1,x2,y2,dis,x_dif,y_dif,min_time,gap,dif; lon...