thanks,but none of them can proove my code is wrong.it's so weird
"Learning without thought is useless;thought without learning is dangerous."
"Hold what you really know and tell what you do not know -this will lead to knowledge."-Confucius
May be there are numbers like 10^1000 or so. I used two strings of length 1000 to store the input numbers. I can't code in JAVA, so could not understand wheather you took care of that or not. Did you
I think there's been a rejudgement yesterday, because my program
had already been accepted and now it's missing from the list of
accepted programs. Submitting it again led to a WA, so I guess
I was just lucky too.
I know its really stupid but the new input set contains numbers as big as 10^100 or larger, so, you must use string arithmetic to get through.
Hope it helps.
The most horrible thing is that the problem description never had any range for input so most of the old AC solutions didn't take that into account and getting WA after rejudgement.
Not all of our dreams can be made to come true. But still we live with the hope to turn them into reality someday.
"Learning without thought is useless;thought without learning is dangerous."
"Hold what you really know and tell what you do not know -this will lead to knowledge."-Confucius
No, I think that Sohel has problem in other way ( in my program I used array [1 .. 500] and get AC).
Sohel, maybe your program write zeros at the begin of line or at the end of it.
if(temp[loop]+1<10) ifAdd=0;
loop++;
}
if(ifAdd!=0 && loop==strlen(a))
{
temp[loop]=49;
temp[loop+1]='\0';
}
}
for(loop=strlen(temp)-1;loop>0;loop--)
{
if(temp[loop]=='0')
{
temp[loop]='\0';
}
else break;
}
for(loop=0;loop<strlen(temp);loop++)
if(temp[loop]!='0') break;
for(;loop<strlen(temp);loop++) cout<<temp[loop];
cout<<endl;
}
}
return 0;
}
[/cpp]
at first i defined my array as large as 100;and got RE,then i changed it into 10000,then got WA.who can tell me where's the problem?:(
Last edited by Morning on Fri Jan 30, 2004 9:31 pm, edited 1 time in total.
"Learning without thought is useless;thought without learning is dangerous."
"Hold what you really know and tell what you do not know -this will lead to knowledge."-Confucius
"Learning without thought is useless;thought without learning is dangerous."
"Hold what you really know and tell what you do not know -this will lead to knowledge."-Confucius
first of all,thanks for ur help indeed.
i think there will be 0 0 because of ur sample input.:)
and i got the right answer to the input 0010 9,it's 1 right?
so there must be any other problem:(
"Learning without thought is useless;thought without learning is dangerous."
"Hold what you really know and tell what you do not know -this will lead to knowledge."-Confucius
In the problem destcription it has been said that there will be no trailing zero(s). So I removed all the trailing zero(s). It has been also said that all the leading zeros are omitted while reversing. But the judge usually does strange things, specially after rejudgement. So I thaught there might be input with leading zero(s). That's why I care about that --- 00010 9 --- case. I know, it is not a valid input. But, there is no line in the problem description saying that there will be no invalid input.
By the way, my AC code gives 9001 as out put for that case.