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 1209. 1, 10, 100, 1000...

Hint (simple)
Posted by Najmaddin Akhundov 16 Nov 2014 08:32
The order of 1's within the number is 1 2 4 7 11 16 ...You can find the n'th number in sequence is equal to 1+n*(n-1)/2. So for any given input a, it is sufficient to test whether or not (a-1)*2 is equal to multiplication of two consequence number. I hope it helps