Tubes
Public  11/06/14  20xp  Programming  47.1% 
Consider 6 tubes named A,B,C,D,E,F with capacities 10,10,7,7,7,7 respectively. In the first state they contain the following unit amounts of a certain liquid (A to F): 9, 7, 6, 5, 0, 0 And the goal state is as follows (A to F): 9, 2, 2, 2, 5, 7 Treat each state as a hex number (FEDCBA) and assign a 6digit number for them as in the following example: The first state=005679 The last state=752229 We need to reach to the goal state with the mimimum number of steps. Let A be the eventual array of size k with the states (from first to last) in it: A=[005679,...,752229] where A[i] is the state at the ith phase, i=1,..,k Let N be the hex number obtained by concatenating the hex digits of the above array: N=005679...752229 or N=A[1]*B^(k1)+A[2]*B^(k2)+...+A[k]*B^0 where B=16^6 Find the smallest N. (i.e. Find the lexicographically first, shortest path.) Answer format: N Mod 1000000007 Example: Capacities: 7,6,5,4,4,4 First: 7, 5, 0, 0, 0, 0 Last: 3, 2, 3, 4, 0, 0 1: 7, 5, 0, 0, 0, 0 s=000057 2: 3, 5, 0, 4, 0, 0 s=004053 3: 3, 5, 4, 0, 0, 0 s=000453 4: 3, 6, 3, 0, 0, 0 s=000363 5: 3, 2, 3, 4, 0, 0 s=004323 N = 000057004053000453000363004323 (hex) N Mod 1000000007 = 10356901 (decimal) [My timing: 25s]
New Members
 gunnez97 2d:20h
 CcGaviria 3w
 wuyingddg 3w
 curiosity_def 3w:1d
 skywalkert 3w:2d
Fresh Problems

Best Matrices Multiplication 2 2d:21h
solved by 7 
Central binomial coefficients 3d:21h
solved by 10 
Harmonic variations 6d:12h
solved by 7 
Special squarefree sum 1w:3d
solved by 5 
A Staggering Sequence 1w:6d
solved by 11