The Person Above You

Discussion in 'Forum Games' started by Blu-Cup, Jun 11, 2011.

  1. Echoax

    Echoax Greed Probably
    Wizard

    Cutie Mark:
    Joined:
    Jul 5, 2011
    Messages:
    20,506
    Bro hoofs Received:
    2
    Location:
    Kenithson
    ^Should bring me stuff from the past.
     
  2. Miggy

    Miggy INFOX

    Joined:
    Aug 28, 2011
    Messages:
    2,929
    Bro hoofs Received:
    0
    Location:
    Russia
    ^ROFLskate
     
  3. greyOne

    greyOne Princess of the Forum
    Banned

    Joined:
    Oct 13, 2011
    Messages:
    3,922
    Bro hoofs Received:
    0
    Occupation:
    Code for Hire
    Location:
    Motherland
    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
     
  4. Double Rainbow "Dash"

    Double Rainbow "Dash" The Legendary TwiDash Shipper

    Cutie Mark:
    Joined:
    Jul 7, 2011
    Messages:
    8,534
    Bro hoofs Received:
    0
    Occupation:
    Flying, Weather
    Location:
    Anywhere but here.
    ^ ROFLskate.
     
  5. greyOne

    greyOne Princess of the Forum
    Banned

    Joined:
    Oct 13, 2011
    Messages:
    3,922
    Bro hoofs Received:
    0
    Occupation:
    Code for Hire
    Location:
    Motherland
    This post is post-marked to appear to-day, but was written 4 days ago:

    Stable time loop detected. ^
    EXTERMINATE!

    EDIT: 321 posts
     
  6. Double Rainbow "Dash"

    Double Rainbow "Dash" The Legendary TwiDash Shipper

    Cutie Mark:
    Joined:
    Jul 7, 2011
    Messages:
    8,534
    Bro hoofs Received:
    0
    Occupation:
    Flying, Weather
    Location:
    Anywhere but here.
    ^ Hacks time.
     
  7. Miggy

    Miggy INFOX

    Joined:
    Aug 28, 2011
    Messages:
    2,929
    Bro hoofs Received:
    0
    Location:
    Russia
    ^ Is quite clearly not time travelling
     
  8. Double Rainbow "Dash"

    Double Rainbow "Dash" The Legendary TwiDash Shipper

    Cutie Mark:
    Joined:
    Jul 7, 2011
    Messages:
    8,534
    Bro hoofs Received:
    0
    Occupation:
    Flying, Weather
    Location:
    Anywhere but here.
    ^ Needs to time travel.
     
  9. greyOne

    greyOne Princess of the Forum
    Banned

    Joined:
    Oct 13, 2011
    Messages:
    3,922
    Bro hoofs Received:
    0
    Occupation:
    Code for Hire
    Location:
    Motherland
    This post is post-marked to appear to-day, but was written 4 days ago:

    ^ Doesn't comprehend 4 dimension and matrices.
     
  10. Double Rainbow "Dash"

    Double Rainbow "Dash" The Legendary TwiDash Shipper

    Cutie Mark:
    Joined:
    Jul 7, 2011
    Messages:
    8,534
    Bro hoofs Received:
    0
    Occupation:
    Flying, Weather
    Location:
    Anywhere but here.
    This post is post-marked to appear to-day, but was written 5 days ago:

    ^ Doesn't comprehend 4 dimension and matrices.
     
  11. greyOne

    greyOne Princess of the Forum
    Banned

    Joined:
    Oct 13, 2011
    Messages:
    3,922
    Bro hoofs Received:
    0
    Occupation:
    Code for Hire
    Location:
    Motherland
    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.)
     
    #5551 greyOne, Oct 24, 2011
    Last edited: Oct 24, 2011
  12. Miggy

    Miggy INFOX

    Joined:
    Aug 28, 2011
    Messages:
    2,929
    Bro hoofs Received:
    0
    Location:
    Russia
    ^ is so jealous of the fact it's 24th October where I live.
     
  13. Double Rainbow "Dash"

    Double Rainbow "Dash" The Legendary TwiDash Shipper

    Cutie Mark:
    Joined:
    Jul 7, 2011
    Messages:
    8,534
    Bro hoofs Received:
    0
    Occupation:
    Flying, Weather
    Location:
    Anywhere but here.
    ^ Jealous that it's October 23rd here. :derpe:
     
  14. greyOne

    greyOne Princess of the Forum
    Banned

    Joined:
    Oct 13, 2011
    Messages:
    3,922
    Bro hoofs Received:
    0
    Occupation:
    Code for Hire
    Location:
    Motherland
    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!
     
  15. Double Rainbow "Dash"

    Double Rainbow "Dash" The Legendary TwiDash Shipper

    Cutie Mark:
    Joined:
    Jul 7, 2011
    Messages:
    8,534
    Bro hoofs Received:
    0
    Occupation:
    Flying, Weather
    Location:
    Anywhere but here.
    ^ Jealous of the fact that I've seen Episode 31/Season 2 Episode 5. :Trollestia:
     
  16. greyOne

    greyOne Princess of the Forum
    Banned

    Joined:
    Oct 13, 2011
    Messages:
    3,922
    Bro hoofs Received:
    0
    Occupation:
    Code for Hire
    Location:
    Motherland
    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!
     
  17. Miggy

    Miggy INFOX

    Joined:
    Aug 28, 2011
    Messages:
    2,929
    Bro hoofs Received:
    0
    Location:
    Russia
    ^You...are...not...Bleh I gives up :derpe:
     
  18. Double Rainbow "Dash"

    Double Rainbow "Dash" The Legendary TwiDash Shipper

    Cutie Mark:
    Joined:
    Jul 7, 2011
    Messages:
    8,534
    Bro hoofs Received:
    0
    Occupation:
    Flying, Weather
    Location:
    Anywhere but here.
    ^ Bored. :derpe:
     
  19. greyOne

    greyOne Princess of the Forum
    Banned

    Joined:
    Oct 13, 2011
    Messages:
    3,922
    Bro hoofs Received:
    0
    Occupation:
    Code for Hire
    Location:
    Motherland
    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.
     
  20. Miggy

    Miggy INFOX

    Joined:
    Aug 28, 2011
    Messages:
    2,929
    Bro hoofs Received:
    0
    Location:
    Russia
    ^ Java? bahahahaha

    Pascal ftw!

    @DRD : I am bored, yes. :derpe:
     

Share This Page