ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1525. Path

WA # 7 help me,plz!
Posted by Arthur 18 Feb 2007 18:11
Re: WA # 7 help me,plz!
Posted by Arthur 18 Feb 2007 19:47
anybody, who knows where can be error! help!
Re: WA # 7 help me,plz!
Posted by Fokysnik[LNU] 18 Feb 2007 20:13
I'm also getting WA#7... and don't know why :'(
Re: WA # 7 help me,plz!
Posted by Arthur 18 Feb 2007 21:05
if you will find you mistake, please, write it here! ok?
and if i'll find my, i'll write it here too.
Re: WA # 7 help me,plz!
Posted by Соболева Оля 18 Feb 2007 23:40
size of ansver is greatest longint.
Use int64.
Re: WA # 7 help me,plz!
Posted by Fokysnik[LNU] 19 Feb 2007 00:46
Thanks! After your post I managed to solve it.
But, actually I was using int64, but...

I've found out that if you write like this:

ans:=x*y*z;         where ans is int64 and x,y,z are integer

you get WA

After I wrote:

ans:=x;
ans:=ans*y;
ans:=ans*z;

I got Accepted.

I think it happens because of calculation x*y*z is performed in integer and then converted to int64.
Interesting... :-|
Should have written in C. I guess I wouldn't have faced this if written in C.

Edited by author 19.02.2007 00:56
Re: WA # 7 help me,plz!
Posted by Arthur 19 Feb 2007 13:51
Thank you very much!
Re: WA # 7 help me,plz!
Posted by Kit 19 Feb 2007 16:36
Fokysnik[LNU] wrote 19 February 2007 00:46
Should have written in C. I guess I wouldn't have faced this if written in C.
It's common feature of all compilers I know. I guess, C would not help you also :)
Re: WA # 7 help me,plz!
Posted by Index Tree 19 Feb 2007 21:12
Can anyone pls explain to me the sample output on test 3
Re: WA # 7 help me,plz!
Posted by Olly 23 Feb 2007 19:18
I had wa7 too. be carefull

printf("%lld\n",ans) IS WRONG!
printf("%I64d\n",ans) is OK

for MSVS2005 it's no matter, but not for Timus compiler
Re: WA # 7 help me,plz!
Posted by Petr Huggy (Pskov) 20 May 2010 17:44
In test #7 the second line (instructions' string) is empty!
Re: WA # 7 help me,plz!
Posted by gautamvs 16 Jul 2013 22:54
the problem could be reading the line with 10^5 characters.
Re: WA # 7 help me,plz!
Posted by huysgori 5 May 2022 14:47
How can we read a line of 10^5 chars in python and not get a runtime error?
Re: WA # 7 help me,plz!
Posted by Vladislave 6 May 2022 01:08
use sys.stdin instead of input()