All pastes #1829750 Raw Edit

Stuff

public text v1 · immutable
#1829750 ·published 2010-03-09 10:34 UTC
rendered paste body
 87         /** 88          * Do a bunch of stuff, most likely involving a for loop of some sort. 89          * Note: there are exactly 211 characters in this function 90          * @param a An array of integer values 91          * @param n Another integer value 92          * @return A whole number between -2 147,483,648 and 2,147,483,648, inclusive 93          * @throws you into a bottomless pit 94          */ 95         private static int madness(int[] a, int n) 96         { 97                 int i,s;i=((n+n)&~( 98                 n+n));for(s=(i^i);! 99                 (s>n);s-=(~((s&(~(i100                 ^i))-(s|((n^i)&~(i^101                 n))))))){i=(a[s]>i)102                 ?a[s]:i;}return(i>>103                 (((~(s^i))&(i^s))-(104                 ~((s&i)^(i&s))))<<(105                 ~((~s)|s)-(~(n&(~n)106                 ))))+(i&((s^s)-((((i107                 &s)|(s^i))|(~i)))));108         }109 110         /**111          * Finds a list of Boxes that, stacked in order, are as tall as possible.112          * This method is for extra credit.113          * 114          * @param boxes115          *            The set of boxes eligible to be stacked. This is sorted in116          *            descending order of base area and contains all distinct117          *            orientations.118          * @return A maximal height list of boxes in order from bottom to top.119          * @throws NullPointerException120          *             if boxes is null121          */122         public static List<Box> getStack(List<Box> boxes)123         {124                 throw new RuntimeException ("You need to implement this method");125         }