suppose a set [1,5,7,10] we want to make any numbers using these element with these elements in the test,we want to make mnumbers with minimum number of operations for eg: 98=9*10+1*7+1*1 so total 10 opearation. [python,java,c,cpp]
| # | User | Rating |
|---|---|---|
| 1 | Kevin114514 | 3722 |
| 2 | Benq | 3676 |
| 3 | jiangly | 3640 |
| 4 | turmax | 3450 |
| 5 | tourist | 3408 |
| 6 | strapple | 3360 |
| 7 | Um_nik | 3354 |
| 8 | squareOf105 | 3348 |
| 9 | maroonrk | 3196 |
| 10 | idontwannadothis…e | 3191 |
| # | User | Contrib. |
|---|---|---|
| 1 | Qingyu | 153 |
| 2 | maroonrk | 152 |
| 3 | nik_exists | 151 |
| 4 | maspy | 149 |
| 5 | AmShZ | 147 |
| 6 | Um_nik | 144 |
| 7 | Errichto | 139 |
| 8 | adamant | 135 |
| 9 | BledDest | 134 |
| 10 | cry | 130 |
suppose a set [1,5,7,10] we want to make any numbers using these element with these elements in the test,we want to make mnumbers with minimum number of operations for eg: 98=9*10+1*7+1*1 so total 10 opearation. [python,java,c,cpp]
| Name |
|---|



I think you can do a BFS. Each number from set is a vertex, and for each number/vertex we can find out others ones with minimum operation, each number from set is an adjacent vertex of each vertex.
Can you provide me code/algorithm to do it?
it's better you to try to code it, isn't it?
ya..it's better. i had to apply that in some other problem,but i think you could say that how complex the problem is?
Take a look at:
http://ideone.com/Xec19L
where is the problem from?
this is from an ongoing competition .. www.tcscodevita.com .. (I can just copy paste this comment to atleast 4-5 recent blogs on cf. :\ )
Nice problem :)