Search found 78 matches

by mido
Fri Sep 20, 2002 10:14 pm
Forum: Volume 103 (10300-10399)
Topic: 10306 - e-Coins
Replies: 9
Views: 5989

10306 - e-Coins

Any problems with this(other than it got WA): [cpp] #include <iostream.h> #include <math.h> #include <stdio.h> struct coin { int con; int it; }; coin arr[50]; long num,m,x,y,e,i,index; double temp,min; void play(long x,long y,long index,long count) { if (index>m) return; temp=sqrt(x*x+y*y); if (temp...
by mido
Wed Sep 18, 2002 11:42 am
Forum: Volume 103 (10300-10399)
Topic: 10338 - Mischievous Children
Replies: 56
Views: 20607

Found a silly error in the selection sort portion of the code- [str[j]<str[index]] not [str[j]<min]-...still WA,though, with double and long long used for the variable num and the factorial function.
by mido
Wed Sep 18, 2002 11:16 am
Forum: Volume 103 (10300-10399)
Topic: 10338 - Mischievous Children
Replies: 56
Views: 20607

No such luck..I replaced all doubles with long long and still nothing but WA.. :-?
by mido
Tue Sep 17, 2002 1:55 pm
Forum: Volume 103 (10300-10399)
Topic: 10338 - Mischievous Children
Replies: 56
Views: 20607

10338 help!!

Whenever a string comes in, I take its length,factorise it and store the result. Then I divide the result by the factorial of number of times any character is repeated. I also sort by selection sort the string to help me do this. For hhppp for example, the answer is 5!/(2!*3!*) as h is repeated twic...
by mido
Thu Jun 27, 2002 7:03 pm
Forum: Volume 103 (10300-10399)
Topic: 10302 - Summation of Polynomials
Replies: 29
Views: 15311

Well a friend just mentioned that any number type can only be accurate upto some length after which there will be some zeroes inputted automatically. Oh well.
by mido
Thu Jun 27, 2002 6:08 pm
Forum: Volume 103 (10300-10399)
Topic: 10302 - Summation of Polynomials
Replies: 29
Views: 15311

10302 - Summation of Polynomials

I get WA with this code...any tips :
[cpp]
#include <iostream.h>
#include <stdio.h>
#include <math.h>

int
num,
i;

float sum;

void main()
{
while (!cin.eof() && cin>>num)
{
sum=0;
for (i=0;i<=num;i++)
sum+=pow(i,3);
printf("%.0lf\n",sum);
}
}
[/cpp]
by mido
Mon Jun 24, 2002 11:57 pm
Forum: Volume 4 (400-499)
Topic: 490 - Rotating Sentences
Replies: 212
Views: 21325

Looks like I just had to extend the arrays somewhat.. oh well :)
by mido
Mon Jun 24, 2002 11:35 pm
Forum: Volume 4 (400-499)
Topic: 490 - Rotating Sentences
Replies: 212
Views: 21325

490 runtime error

I get a runtime error with this...this almost always happens if I use string functions..anyways, here's my code if you wanna look : [cpp] #include <iostream.h> #include <string.h> char *str2[100]; int i=0, j=0, max=0, count=0; void Rem_Tab(char*& x) { for (int i=0;i<strlen(x);i++) { while (x ==9) { ...
by mido
Mon Jun 24, 2002 2:49 pm
Forum: Volume 4 (400-499)
Topic: 402 - M*A*S*H
Replies: 56
Views: 13757

left=remaining
right=correct
by mido
Mon Jun 24, 2002 12:40 am
Forum: Volume 3 (300-399)
Topic: 343 - What Base Is This?
Replies: 72
Views: 21772

343 - What Base Is This?

This gets me a WA...any tips :-? : [Note that pow(x,y) returns x to the power y] [cpp] #include <iostream.h> #include <string.h> #include <math.h> char* str,*str2; char max; int base_1,base_2,i,j,k,num_1,num_2; void main() { str=new char[100]; str2=new char[100]; while (cin>>str>>str2) { max=0; for ...
by mido
Sun Jun 23, 2002 11:14 pm
Forum: Volume 4 (400-499)
Topic: 402 - M*A*S*H
Replies: 56
Views: 13757

402 - M*A*S*H

I'm not sure I understand the problem...I need a simple example to understand it...my question is this:

if we have this :
3 2 3

then 1 & 2 should be left, right?
by mido
Sun Jun 23, 2002 11:02 pm
Forum: Volume 4 (400-499)
Topic: 444 - Encoder and Decoder
Replies: 155
Views: 22526

Yikes..found a nasty bug..there's a line saying
if (num<=100)
Should have been [if num < 100]..in other words the letter 'd'(ascii 100) would mess up the thing..harsh world, I guess.

Oh look I got accepted. Thanks 10153EN.
by mido
Sun Jun 23, 2002 10:44 pm
Forum: Volume 4 (400-499)
Topic: 444 - Encoder and Decoder
Replies: 155
Views: 22526

Hmmm...well I tried to enlarge the arrays to tens of thousands...still WA...try again, I guess..thanks in advance
by mido
Sun Jun 23, 2002 8:32 pm
Forum: Volume 4 (400-499)
Topic: 444 - Encoder and Decoder
Replies: 155
Views: 22526

Problem 444(Encoder and Decoder) again if you please

What's wrong with this...I get a wrong answer :-? : [cpp] #include <iostream.h> #include <string.h> char *str,*res,*res2,temp; int i,j,num,ones,tens,hundreds; void main() { str=new char[85]; res=new char[85]; res2=new char[270]; while (cin.getline(str,85,'\n')) { if (str[0]>='0' && str[0]<='9') { j=...
by mido
Sun Jun 23, 2002 3:27 pm
Forum: Volume 4 (400-499)
Topic: 401 - Palindromes
Replies: 196
Views: 32652

Bull's eye, amigo. Thanks a lot. :wink:

Go to advanced search