This post is post-marked to appear to-day, but was written 4 days ago: ^^ Can't that would create a paradox of both existence and not existence within a given time frame. ^ Lol
This post is post-marked to appear to-day, but was written 4 days ago: Stable time loop detected. ^ EXTERMINATE! EDIT: 321 posts
This post is post-marked to appear to-day, but was written 4 days ago: ^ Doesn't comprehend 4 dimension and matrices.
This post is post-marked to appear to-day, but was written 5 days ago: ^ Doesn't comprehend 4 dimension and matrices.
This post is post-marked to appear to-day, but was written 4 days ago: ^ Doesn't understand recursion. EDIT: (Oh, and your statement is false.)
This post is post-marked to appear to-day, but was written 4 days ago: ^Is jealous of the fact I get to see episode 4 released again!
This post is post-marked to appear to-day, but was written 4 days ago: ^ No, not really. Plus you still don't get recursion! ~Wheeee!
This post is post-marked to appear to-day, but was written 4 days ago: ^ Recursion in Java 1.4.2: Code: import java.io.*; import java.util.*; import java.lang.reflect.*; public class MatrixChainProduct { static long min = 2000000000, max, total; public static int getCurrentVal (ArrayList matrices, int index) { if (matrices.size () >= 3) return ((Integer) matrices.get (index)).intValue () * ((Integer) matrices.get (index + 1)).intValue () * ((Integer) matrices.get (index + 2)).intValue (); else // Error trap. return ((Integer) matrices.get (index)).intValue () * ((Integer) matrices.get (index + 1)).intValue (); } public static void findMin (ArrayList matrices, int index) { int curVal = getCurrentVal (matrices, index); if (curVal < min) { total += curVal; matrices.remove (index + 1); if (matrices.size () > 2) findMin (matrices, index); } min = total; } public static void findMax (ArrayList matrices, int index) { int curVal = getCurrentVal (matrices, index); if (max < curVal) { total += curVal; matrices.remove (index + 1); if (matrices.size () > 2) findMax (matrices, index); } max = total; } public static void main (String[] args) throws Exception { String[] temps; ArrayList matrices; BufferedReader in = new BufferedReader (new FileReader ("DATA41.txt")); PrintWriter out = new PrintWriter (new FileWriter ("OUT41.txt")); for (int i = 0 ; i < 5 ; i++) { temps = in.readLine ().split (" "); matrices = new ArrayList (); for (int n = 0 ; n < Array.getLength(temps) - 1 ; n++) matrices.add (Integer.valueOf (temps [n])); total = 0; findMin ((ArrayList) matrices.clone (), 0); Collections.reverse (matrices); total = 0; findMax ((ArrayList) matrices.clone (), 0); out.println (min + " " + max); min = 2000000000; max = 0; } in.close (); out.close (); } } Yay Code tags.