# Guess Prime

what is the meaning of wrong answer verdict given in the interaction of guess prime problem??

1 Like
13 Likes

Love those links given by you

2 Likes

It might mean several things, two of them are:

1. You guessed the wrong prime.
2. The problem statement says this at many places - " immediately terminate your program to receive the Wrong Answer verdict", if your program does one of those things, you get WA; if it doesnâ€™t, you can get any verdict including WA.
1 Like

Actually I tried both, terminating if input is -1 and also by not terminating. Turns out both were accepted. And also the input yes/no doesnâ€™t matter.

how can a solution getting input -1 get AC ??
Itâ€™s not guaranteed that you wonâ€™t receive WA if you donâ€™t terminate.
Itâ€™s just a precaution to make sure that you recieve WA in case you are giving wrong output instead of other non AC verdicts like TLE,RE etc.
Cuz judge stops reading and printing anything once it detects that you gave wrong answer( after printing -1 obv). Now if you still try to interact ( read answers from judge) then you may read garbage or some error might occur (effect differs from language to language and maybe code to code as well).
For example java gives runtime error if it canâ€™t find relevant input ( if you try to scan int even though its not provided in input etc).

I meant to say, if the solution is correct then it would never get -1 or no as the input from the judge, so it doesnâ€™t matter. right?

doesnâ€™t matter if its AC. I mean we donâ€™t need to check if its -1 or not OR if its yes or no.
Simple because it will be Yes and not -1.

1 Like