dccharacter » 20 мар 2013, 22:09
А вот и депф-лимит
>>> ================================ RESTART ================================
>>>
Resistance is: 56743257543.1
Next resistor is 56.0 *10^ 9
Path: [56000000000L]
Resistance is: 743257543.07
Next resistor is 68.0 *10^ 7
Path: [56000000000L, 680000000]
Resistance is: 63257543.07
Next resistor is 62.0 *10^ 6
Path: [56000000000L, 680000000, 62000000]
Resistance is: 1257543.07
Next resistor is 12.0 *10^ 5
Path: [56000000000L, 680000000, 62000000, 1200000]
Resistance is: 57543.0699997
Next resistor is 56.0 *10^ 3
Path: [56000000000L, 680000000, 62000000, 1200000, 56000]
Resistance is: 1543.06999969
Small resistance left, using search to solve for 1543.06999969
Max depth reached 6 [56000000000L, 680000000, 62000000, 1200000, 56000]
Solution: [56000000000L, 680000000, 62000000, 1200000, 56000, 1500.0] (6 elements, sum = 56743257500.000000, dif = 43.070000)
>>> ================================ RESTART ================================
>>>
Resistance is: 56743257543.1
Next resistor is 56.0 *10^ 9
Path: [56000000000L]
Resistance is: 743257543.07
Next resistor is 68.0 *10^ 7
Path: [56000000000L, 680000000]
Resistance is: 63257543.07
Next resistor is 62.0 *10^ 6
Path: [56000000000L, 680000000, 62000000]
Resistance is: 1257543.07
Next resistor is 12.0 *10^ 5
Path: [56000000000L, 680000000, 62000000, 1200000]
Resistance is: 57543.0699997
Next resistor is 56.0 *10^ 3
Path: [56000000000L, 680000000, 62000000, 1200000, 56000]
Max depth reached 5 [56000000000L, 680000000, 62000000, 1200000, 56000]
Solution: [56000000000L, 680000000, 62000000, 1200000, 56000] (5 elements, sum = 56743256000.000000, dif = 1543.070000)
>>> ================================ RESTART ================================
>>>
Resistance is: 56743257543.1
Next resistor is 56.0 *10^ 9
Path: [56000000000L]
Resistance is: 743257543.07
Next resistor is 68.0 *10^ 7
Path: [56000000000L, 680000000]
Resistance is: 63257543.07
Next resistor is 62.0 *10^ 6
Path: [56000000000L, 680000000, 62000000]
Resistance is: 1257543.07
Next resistor is 12.0 *10^ 5
Path: [56000000000L, 680000000, 62000000, 1200000]
Max depth reached 4 [56000000000L, 680000000, 62000000, 1200000]
Solution: [56000000000L, 680000000, 62000000, 1200000] (4 elements, sum = 56743200000.000000, dif = 57543.070000)
>>> ================================ RESTART ================================
>>>
Resistance is: 56743257543.1
Next resistor is 56.0 *10^ 9
Path: [56000000000L]
Resistance is: 743257543.07
Next resistor is 68.0 *10^ 7
Path: [56000000000L, 680000000]
Resistance is: 63257543.07
Next resistor is 62.0 *10^ 6
Path: [56000000000L, 680000000, 62000000]
Resistance is: 1257543.07
Next resistor is 12.0 *10^ 5
Path: [56000000000L, 680000000, 62000000, 1200000]
Resistance is: 57543.0699997
Next resistor is 56.0 *10^ 3
Path: [56000000000L, 680000000, 62000000, 1200000, 56000]
Resistance is: 1543.06999969
Small resistance left, using search to solve for 1543.06999969
Solution: [56000000000L, 680000000, 62000000, 1200000, 56000, 43.0, 1500.0] (7 elements, sum = 56743257543.000000, dif = 0.070000)
>>>
Добавлено спустя 1 минуту 35 секунд:
Хотя и его можно допилить - сейчас только недолет возможен, а, может быть, перелет даст меньшую ошибку.
Добавлено спустя 28 минут 19 секунд:
Во, решает мгновенно :-р
Resistance is: 5.67432557568e+15
Next resistor is 56.0 *10^ 14
Path: [5600000000000000L]
Resistance is: 7.43255756775e+13
Next resistor is 68.0 *10^ 12
Path: [5600000000000000L, 68000000000000L]
Resistance is: 6.32557567754e+12
Next resistor is 62.0 *10^ 11
Path: [5600000000000000L, 68000000000000L, 6200000000000L]
Resistance is: 1.25575677543e+11
Next resistor is 12.0 *10^ 10
Path: [5600000000000000L, 68000000000000L, 6200000000000L, 120000000000L]
Resistance is: 5575677543.0
Next resistor is 51.0 *10^ 8
Path: [5600000000000000L, 68000000000000L, 6200000000000L, 120000000000L, 5100000000L]
Resistance is: 475677543.0
Next resistor is 47.0 *10^ 7
Path: [5600000000000000L, 68000000000000L, 6200000000000L, 120000000000L, 5100000000L, 470000000]
Resistance is: 5677543.0
Next resistor is 56.0 *10^ 5
Path: [5600000000000000L, 68000000000000L, 6200000000000L, 120000000000L, 5100000000L, 470000000, 5600000]
Resistance is: 77543.0
Next resistor is 75.0 *10^ 3
Path: [5600000000000000L, 68000000000000L, 6200000000000L, 120000000000L, 5100000000L, 470000000, 5600000, 75000]
Resistance is: 2543.0
Small resistance left, using search to solve for 2543.0
Max depth reached 10 [5600000000000000L, 68000000000000L, 6200000000000L, 120000000000L, 5100000000L, 470000000, 5600000, 75000]
Solution: [5600000000000000L, 68000000000000L, 6200000000000L, 120000000000L, 5100000000L, 470000000, 5600000, 75000, 150.0, 2400.0] (10 elements, sum = 5674325575677550.000000, dif = -7.000000)
Мой волшебник это я сам. Всю архитектуру программы придумал лично, а ребята помогли воплотить её. Я бы и сам мог написать, но лень учить язык и его конструкции.