Created
October 29, 2009 12:58
-
-
Save jraregris/221425 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.ArrayList; | |
import java.util.Collections; | |
class Juks{ | |
static final int MAX = 1000000; | |
static ArrayList<Integer> a = new ArrayList<Integer>(MAX); | |
public static void main(String args[]){ | |
lagList(); | |
int teller = 0; | |
int min = a.get(0); | |
for(Integer i: a){ | |
if(i<min){ | |
min = i; | |
teller++; | |
} | |
} | |
System.out.println(teller); | |
} | |
private static void lagList(){ | |
for(int i = 0;i<MAX;i++) | |
a.add(i); | |
Collections.shuffle(a); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment