Right!

El jue., 18 abr. 2019 a las 6:25, Andy (<[email protected]>) escribió:

> On Tue, Apr 16, 2019 at 11:22 PM Marcel Ubach <[email protected]>
> wrote:
>
>> El martes, 16 de abril de 2019, 2:54:26 (UTC+2), [email protected]
>> escribió:
>> > I wrote a code that. When i tested it it did not work because of a
>> runtime error. But by removing a modulo M the code works well. I don't
>> really understand why. Does someone have an idea ?
>> >
>> >               /********* ERROR HERE *********/
>> >               // This works
>> >               cout << res << "\n" << flush;
>> >               // This doesn't work ===> Runtime Error
>> >               //cout << res % M << "\n" << flush;
>> >               /*****************************/
>> >               int ans;
>> >               cin >> ans;
>> >               if(ans == -1) {
>> >                       cerr << "Bad answer !" << endl;
>> >                       return 1;
>> >               }
>> >       }
>> >
>> >       return 0;
>> > }
>> >
>> =============================================================================
>>
>> If there ara exactly M gophers, after applying the modulo the answer will
>> be 0, which is incorrect. We could expect the verdict to be "Wrong answer"
>> but maybe it's RE because 0 is out of range.
>>
>
> return 1; causes RE, right?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Code Jam" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/google-code/CAELs3CkJvpi4SRrazrkpdWq6HXAtKwkpkhb-Ku4WMb966%3D8ZAw%40mail.gmail.com
> <https://groups.google.com/d/msgid/google-code/CAELs3CkJvpi4SRrazrkpdWq6HXAtKwkpkhb-Ku4WMb966%3D8ZAw%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Code Jam" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-code/CADRLSB-zsu-wK-ZOmsOMQ_kWJe6wi%3Dq626xuw6tkinBat%2BiLjg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to