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 1353. Milliard Vasya's Function

hint
Posted by Desserg 27 Dec 2019 10:44
Python 3
when counting by force I met TLE on the 45th test.
I printed out all the values of the function and saw that it is mirrored after 40 values.
f (40) = f (41)
f (39) = f (42)
...
f (2) = f (79)
therefore, counting only to 40, I got Accepted