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 1438. Time Limit Exceeded

Show all messages Hide all messages

Sample output #2
0
Program terminated. Variables state:
Value: 2     <-один из остатков должен быть отрицательным
ValueA: 2    <-т.к. делимое - отрицательное
value: -25000000  <- не может быть. значение может быть 2 500 000, т.к. ограничение на кол-во исполняемых команд 10 000 000.
Это не конест, а ботва какая-то :((
Наверное, кол-во исполняемых команд должно быть 100 000 000. Но все равно второй тест неверный!
Test is correct. There was a misprint in number of commands to be executed (fixed now, see problem statement).

The second sample is also quite correct. Just try to look at it and understand how remainder must be calculated (yes, it differs from usual implementation so popular in programming languages)
Can you explain more clearly you definition of your mod function? I cann't understand why

Value :   -25000000 mod 6 = 2
ValueA:   -24999999 mod -6 = 2

May be you should check judge data one more time?
I suppose (1E8 + 1) commands must be executed
Yes, Dmitry, you are right. Shame on me: wrong order of conditions in while loop. :)

Ayway, test is correct, assuming, that program was terminated after 1e8+1 commands have been executed (it will allow to understand how % works).

I will update sample and tests soon.