This is a question. “Given an array of numbers and another number, find out if you can manipulate an array of numbers using standard mathematical methods to equal the number of other numbers, for example, given 5 and 10, can you make 50 × 5 * 10 = 50, so yes” . (Let only arithmetic operations be allowed for simplicity).
I would suggest using brute force search (with some branch and border). Does it make sense?
Haskell Programming, Chapter 11: The Countdown Problem
. - ... , , .
, , . , . , , A *.
: .
Numbers
standard mathematical techniques
..
, .
. a * b = b * a.
. , .
S - , . |S - Value(E[i])|, Value(E[i]) - i - .
S
|S - Value(E[i])|
Value(E[i])
i
, , , .
, , , , , .
(- S, ), , . , , , , , , , .
: - ? , x -x, 1/x, x! sqrt (x) ""?
, , . , .
, : BNF .
< a > :: = 5 | 10
, , , 20 . . " " , .
Source: https://habr.com/ru/post/1773927/More articles:In Oracle, what is the difference between a hash join and a sort-merge join? - joinI created the worst soup soup of all time (ASP.NET MVC 2) - asp.netExecuting a scalar in T-SQL - sql-serverScript Library for Windows Phone 7 - c #ActiveRecord query for detailed and summary data - sqlИспользуйте утилиту mongofiles для доступа к данным, вставленным в Java GridFS API - javaIs it possible to use MS VS Database Project as a complete solution for database version control? - version-controlPL / SQL - check for memory leaks? - oracleWindows Azure - Blob Storage Initialization - Authorization Error - authenticationПоддерживает ли XNA OpenGL - xnaAll Articles