Is it possible to get a few more examples (say f(1000) or f(10000)?)
I thought I'd gotten it and brute force counting seems to give the same results as my solution for smaller power of 10 (before it becomes unfeasible to do brute force in reasonable time) *but* I can't understand why f(10**18) seems to be wrong.
Problem 612
Forum rules
As your posts will be visible to the general public you are requested to be thoughtful in not posting anything that might explicitly give away how to solve a particular problem.
This forum is NOT meant to discuss solution methods for a problem.
See also the topics:
Don't post any spoilers
Comments, questions and clarifications about PE problems.
As your posts will be visible to the general public you are requested to be thoughtful in not posting anything that might explicitly give away how to solve a particular problem.
This forum is NOT meant to discuss solution methods for a problem.
In particular don't post any code fragments or results.
Don't start begging others to give partial answers to problems
Don't ask for hints how to solve a problem
Don't start a new topic for a problem if there already exists one
Don't start begging others to give partial answers to problems
Don't ask for hints how to solve a problem
Don't start a new topic for a problem if there already exists one
See also the topics:
Don't post any spoilers
Comments, questions and clarifications about PE problems.
-
MuthuVeerappanR
- Posts: 539
- Joined: Sun Mar 22, 2015 2:30 pm
- Location: India
- Contact:
Re: Problem 612
I too thought the number of test values given (that is 1) is very low..
I think the Dev team can come up with some sort of criteria for test values too... One that can be verified by brute force, one that is not, one that can help in eliminating tricking cases and things like that... Just a suggestion..
I think the Dev team can come up with some sort of criteria for test values too... One that can be verified by brute force, one that is not, one that can help in eliminating tricking cases and things like that... Just a suggestion..

It is not knowledge, but the act of learning, not possession but the act of getting there, which grants the greatest enjoyment.
-
v6ph1
- Posts: 134
- Joined: Mon Aug 25, 2014 7:14 pm
Re: Problem 612
The problem was released less than 16 hours ago.
And the problem description is clear.
You can easily check that f(10) = 0.
The next friend numbers are:
1, 10, 11, 12, ...
2, 12, 20, 21, ...
3, 13, 23, 30, ...
Take care about double counting!
The value for 1000 can be easily checked by brute force all possible pairs.
Each solution for 10^n has exactly 2n digits. (n>1)
@Ytsejam:
Take care about overflows.
The result for 10^10 exceeds the 64bit limit. (10^5 for 32bit)
And the problem description is clear.
You can easily check that f(10) = 0.
The next friend numbers are:
1, 10, 11, 12, ...
2, 12, 20, 21, ...
3, 13, 23, 30, ...
Take care about double counting!
The value for 1000 can be easily checked by brute force all possible pairs.
Each solution for 10^n has exactly 2n digits. (n>1)
@Ytsejam:
Take care about overflows.
The result for 10^10 exceeds the 64bit limit. (10^5 for 32bit)
