Page 6 of 12

Posted: Mon Jul 24, 2006 9:12 pm
by Carunty
thank you.

I change the code, just do the absolute value by coding.

10055 - WA

Posted: Sun Oct 22, 2006 5:16 pm
by ajoker

Code: Select all

#include <stdio.h>
long long int a, b;
int main(){
    while(scanf("%lld%lld", &a, &b)==2)
        if(a>b)printf("%lld\n", a - b);
        else printf("%lld\n", b - a);
}
This program got WA, why?

Posted: Mon Oct 30, 2006 8:12 pm
by Jan
First thing is dont open a new thread if one (at least) already exists.
And second thing is there is no error in the code (1 warning). So, it should get accepted. Make sure that you are submitting it correctly.

Posted: Sat Nov 11, 2006 6:49 am
by newton

Code: Select all


   deleted


Posted: Sat Nov 11, 2006 3:07 pm
by Jan
newton wrote:hey man that is your 1st submission. nothing to worry about it.
try to change the condition to

Code: Select all

while(scanf(%lld %lld,&a,&b)==2)
to

Code: Select all

while(scanf(%ld %ld ,&a ,&b)!=EOF)

Code: Select all

while(scanf(%lld %lld,&a,&b)==2)
is enough. And just submit the code in C++. There is no error in the code.

10055 in Pascal WA

Posted: Sat Nov 11, 2006 5:13 pm
by hf_1992
Would anyone tell me that what's wrong with my code?

Code: Select all

program VolumeC_10055;
var n1,n2:longword;
begin
readln(n1,n2);
writeln(abs(n1-n2));
eof(input)
end.

Posted: Sat Nov 18, 2006 3:32 am
by seulkiro
I had to use long long for input in C++. I had a wrong answer when I used int. The problem might be data type you are using. BTW, I'm not familiar with Pascal.

10055

Posted: Sat Dec 30, 2006 9:01 am
by hasibul_DIU
/*10055*/
#include<stdio.h>

void main(){
long h,o;
while(scanf("%ld %ld",&h,&o)!=EOF){
printf("%ld\n",o-h);}
}


I do not find my mistake.
please help me

e-mail: hasibul2363@yahoo.com

Posted: Sat Dec 30, 2006 12:20 pm
by shamim
Two mistakes:

1) you assume that the second number will always be higher, this is always not the case.
2) long data type will not do, use double.

double?

Posted: Wed Jan 03, 2007 7:30 pm
by MAK
I think I solved it with long long (C++) instead of double. But double works too I guess.

10055

Posted: Sun Jan 21, 2007 6:09 pm
by atm
how come we can't use the fixed manipulator from the iomanip library, to avoid getting the output in scientific notation??
any clue about solving this problem?

Posted: Sun Jan 21, 2007 10:44 pm
by Jan
Search your peoblem first. Dont open a new thread if one already exists.

HELP !I STILL GOT A WA!

Posted: Mon Mar 05, 2007 4:42 pm
by starrynight
int main()
{
long long int num1 ,num2,answer;


while(scanf("%lld %lld",&num1,&num2) != EOF)
{
if(num1 > num2)
{
answer = num1 - num2;
printf("%lld\n",answer);
}
else
{
answer = num2 - num1;
printf("%lld\n",answer);
}

}


return 0;
}

I wrote this in C!
why I still got a WA~?
thx! :o

Posted: Tue Mar 06, 2007 10:34 pm
by Debashis Maitra
starrynight
i cannt find anything wrong with your code

its same to my code

but i submitted my code in C++

you can try this

that may help you

best of luck :lol:

10055 how can i!

Posted: Fri Mar 09, 2007 8:46 am
by sv90
how can i lessen my run time and use of memory. in this problem it use 1.146..