/* package whatever; // don't place package name! */
import java.util.*;
import java.lang.*;
import java.io.*;
/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
{
long[] longArray = new long[5000000];
for (int i = 0; i < 5000000; i++) {
longArray[i] = random.nextLong();
}
long time
= System.
currentTimeMillis(); System.
out.
println("For long array " + (System.
currentTimeMillis() - time
));
double[] objArray = new double[5000000];
for (int i = 0; i < 5000000; i++) {
objArray[i] = random.nextDouble() * 5000000;
}
time
= System.
currentTimeMillis(); System.
out.
println("For dbl array " + (System.
currentTimeMillis() - time
));
int[] intArray = new int[5000000];
for (int i = 0; i < 5000000; i++) {
intArray[i] = random.nextInt(5000000);
}
time
= System.
currentTimeMillis(); System.
out.
println("For int array " + (System.
currentTimeMillis() - time
)); }
}
LyogcGFja2FnZSB3aGF0ZXZlcjsgLy8gZG9uJ3QgcGxhY2UgcGFja2FnZSBuYW1lISAqLwoKaW1wb3J0IGphdmEudXRpbC4qOwppbXBvcnQgamF2YS5sYW5nLio7CmltcG9ydCBqYXZhLmlvLio7CgovKiBOYW1lIG9mIHRoZSBjbGFzcyBoYXMgdG8gYmUgIk1haW4iIG9ubHkgaWYgdGhlIGNsYXNzIGlzIHB1YmxpYy4gKi8KY2xhc3MgSWRlb25lCnsKCXB1YmxpYyBzdGF0aWMgdm9pZCBtYWluIChTdHJpbmdbXSBhcmdzKSB0aHJvd3MgamF2YS5sYW5nLkV4Y2VwdGlvbgoJewoJCVJhbmRvbSByYW5kb20gPSBuZXcgUmFuZG9tKCk7CgkJbG9uZ1tdIGxvbmdBcnJheSA9IG5ldyBsb25nWzUwMDAwMDBdOwoJCWZvciAoaW50IGkgPSAwOyBpIDwgNTAwMDAwMDsgaSsrKSB7CgkJCWxvbmdBcnJheVtpXSA9IHJhbmRvbS5uZXh0TG9uZygpOwoJCX0KCQlsb25nIHRpbWUgPSBTeXN0ZW0uY3VycmVudFRpbWVNaWxsaXMoKTsKCQlBcnJheXMuc29ydChsb25nQXJyYXkpOwoJCVN5c3RlbS5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