UVa 11076

From Algorithmist
Jump to navigation Jump to search

11076 - Add Again[edit]

Summary[edit]

Summation of sequence of integers is always a common problem in Computer Science. Rather than computing blindly, some intelligent techniques make the task simpler. Here you have to find the summation of a sequence of integers. The sequence is an interesting one and it is the all possible permutations of a given set of digits. For example, if the digits are <1 2 3>, then six possible permutations are <123>, <132>, <213>, <231>, <312>, <321> and the sum of them is 1332.

Explanation[edit]

http://pavelsimo.blogspot.com/2012/11/uva-11076-add-again.html

Gotchas[edit]

Brute Force Approach will fail with TLE.

Notes[edit]

http://pavelsimo.blogspot.com/2012/11/uva-11076-add-again.html

Implementations[edit]

Notes/Hints on actual implementation here.

Optimizations[edit]

Optimizations here.

Input[edit]

3
1 2 3
3
1 1 2
0

Output[edit]

1332
444

References[edit]

  1. Reference 1

Categories here, use the form [[Category: Category Name]], see Categories for a list