What's the goal? Do you want the number of distinct operation sequences
that are valid, or do you want to find all the distinct results? Are the
operations always performed left to right, or using order of operations
with multiplication and division first?

You also need to avoid dividing by zero. (2 / 0 + 1 = wrong)

You can model the concatenation of two or more digits into a multi-digit
number as a fifth operator.


On Thu, Nov 15, 2012 at 10:36 AM, Amir Hossein Sharifzadeh <
[email protected]> wrote:

> Hi,
>
> Suppose we have a number and some operators(*,-,+,/). We would like to
> represent and compute operators along operands during a number.
> For example:
>
> N = 201
> Operators: +,-,* and /
>
> Results should be represented as following down: (I represented just + and
> - operators)
> 2 + 0 + 1
> 2 + 01 (wrong)
> 20 + 1
>
> 2 + 0 - 1
> 2 - 01 (wrong)
> 20 - 1
>
> 2 - 0  + 1
> 2 - 0  - 1
>
> We would not change the numbers and should insert operators between
> operands and compute the possibility values. (For example 2 + 01 may not be
> calculated)
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Code Jam" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Code Jam" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to