ghttp://www.z-trening.com/new/www/html/submit.php?submit=7100046000&subm_code=1
This is my code and I fail only on 8,9,10 & 20 test case. Where I am wrong ?
DProbably the checking if the rectangle is possible try with this if's
if (x2<sx1 or x1>sx2 or y2<sy1 or y1>sy2) then Tf:=False
gLook the code now... this is what you were talking about ?
Now I got 8,9 & 10 correct, but all the rest are wrong.
DThe If Must be in For Loop
gIt goes through all, but the last one :SS
Can the admin give me the last test case or someone see what's the problem ?
pInstead of Longint, use Int64, for sx1 and sy1
gIt's the same again :S
I try with int64 for sx2 and sy2 too, but It gives me a wrong result for the last test :S
pTry doing
x:=sx1*sy1;
then writeln(x);
X should be int64. Or change other variables to int64, I'm not sure.
hGigac, I think there no need for variable TF, becouse you change his value in every step and you don't check it. I will correct your code:
...
For i:=1 to N-1 Do
Begin
ReadLn(x1,y1,x2,y2);
If (x1>sx1) Then sx1:=x1;
If (y1>sy1) Then sy1:=y1;
If (x2<sx2) Then sx2:=x2;
If (y2<sy2) Then sy2:=y2;
End;
sx1:=sx2-sx1;
sy1:=sy2-sy1;
X:=Sx1 * sy1;
If (sx1 > 0) and (sy1 > 0) Then WriteLn(x) Else WriteLn('0');
Try.
AI need help, I changed Area to Int64, but I still get WA :( What should I do now ?
http://www.z-trening.com/new/www/html/submit.php?submit=7100046642&subm_code=1
hAl3kSaNdaR,
...
If ( ( Dx < 0 ) And ( Dy < 0 ) ) Then WriteLn ( 0 )
...
I think it should be OR:
...
If ( ( Dx <= 0 ) or ( Dy <= 0 ) ) Then WriteLn ( 0 )
...
gThank ya ma friend halil :)
I got all correct :)
AOh yes. What a silly mistake. :(
AHalil: What is wrong now ?
http://www.z-trening.com/new/www/html/submit.php?submit=7100046664&subm_code=1
I put If inside For - Loop to speed up my code.
AOk. I have put <= but I still get WA on 20 test case. What is wrong ?
[
Ubacio sam <= ali i dalje dobijam netacan rezultat na 20 primeru :( Sta nije u redu ? Ne vidim gresku nigde.
]
AYeah :D It passed. Thank you!