Ec(2100000000www.111cn.nethtml0054500_itemid_29653.html is a six-digit number. When we multiply it by 2, 3, 4, 5, and 6 respectively, the five products we get are a six-digit number, in addition, the five numbers are composed of the original six numbers, but the order has changed! Please help me solve this problem! --------------- It seems that everyone has a default phenomenon: www.111cn. netview script ec (2); script
Http://www.111cn.net/html/00/54500_itemid_29653.html
A six-digit number. When we multiply it by 2, 3, 4, 5, and 6, the five products are a six-digit number, and the five numbers are composed of the first six digits, the order is changed!
Please help me solve this problem!
---------------
It seems that everyone has a default phenomenon.
Http://www.111cn.net/viewthread.php? Tid = 54377 & page = 5 # pid394850
The previous assumption seems that we do not consider this situation when making algorithms. If any one has demonstrated that this assumption is not true, or the author's question itself does not consider this assumption by default. let's explain
If there is no argument or the question is not clear, it means that if you do not consider this hypothetical algorithm design, it is not suitable for the ineffective algorithm.
------------------------
Two algorithms are written:
The first idea is to judge whether the sum of the bits of the multiplied number is equal, but the efficiency is not very good.
The second algorithm is used for reverse character verification, because the forward will have a part of high-level unnecessary operations. The code is concise and efficient. The code is attached:
The first algorithm is used to determine the sum of individual digits:
========================================================== ==============================
The second algorithm is used for reverse character query:
The first algorithm needed 440 ms on my PE2140@2.66GHz, and the second took 180 ms.
---------------------------------
I mentioned this before, http://www.111cn.net/bbs/thread-54377-2-1.html.
The solution is as follows:
Obtain each bit and exclude it one by one.
If the two digits are the same, the two digits are deleted or modified at the same time.
For example:
''000000'' and ''000000''
If you delete or change the value one by one, the remaining one will not be supported.
----------------------------------
For ($ I = 100000; $ I <166667; $ I ++) // number range
{
....
For ($ ii = 2; $ ii <7; $ ii ++) // a multiple of 2-6
{
.....
For ($ j = 0; $ j <6; $ j ++) // Number of numbers
{
If (strpos ($ I, substr ($ I * $ ii, $ j,