import java.util.*;
import java.lang.*;
import java.io.*;
class A {
int n = 100000;
int rep = 100;
int g[] = new int[n], k, s = 0;
long st, en;
// warm
for(int l = 0; l < rep; l++) {
for(int i = 1; i < g.length; i++) {
k
= (int)(g.
length * Math.
random()); // not used this s += k;
g[i] = 1;
}
}
// one
for(int l = 0; l < rep; l++) {
for(int i = 1; i < g.length; i++) {
k
= (int)(g.
length * Math.
random()); // not used this s += k;
g[i] = 1;
}
}
System.
out.
println("One time " + (en
- st
)/1000000.
d / (double)rep
+ " msc"); // two
for(int l = 0; l < rep; l++) {
for(int i = 1; i < g.length; i++) {
k
= (int)(g.
length * Math.
random()); s += k;
g[k] = 1;
}
}
System.
out.
println("Two time " + (en
- st
)/1000000.
d / (double)rep
+ " msc"); }
}
aW1wb3J0IGphdmEudXRpbC4qOwppbXBvcnQgamF2YS5sYW5nLio7CmltcG9ydCBqYXZhLmlvLio7CgpjbGFzcyBBIHsKCXB1YmxpYyBzdGF0aWMgdm9pZCBtYWluIChTdHJpbmdbXSBhcmdzKSB0aHJvd3MgamF2YS5sYW5nLkV4Y2VwdGlvbiB7CgkJaW50IG4gPSAxMDAwMDA7CgkJaW50IHJlcCA9IDEwMDsgCgkJaW50IGdbXSA9IG5ldyBpbnRbbl0sIGssIHMgPSAwOwoJCWxvbmcgc3QsIGVuOwoJCS8vIHdhcm0KCQlmb3IoaW50IGwgPSAwOyBsIDwgcmVwOyBsKyspIHsKCQkJZm9yKGludCBpID0gMTsgaSA8IGcubGVuZ3RoOyBpKyspIHsKCQkJCWsgPSAoaW50KShnLmxlbmd0aCAqIE1hdGgucmFuZG9tKCkpOyAvLyBub3QgdXNlZCB0aGlzCgkJCQlzICs9IGs7CgkJCQlnW2ldID0gMTsKCQkJfQoJCX0KCQkvLyBvbmUKCQlzdCA9IFN5c3RlbS5uYW5vVGltZSgpOyAKCQlmb3IoaW50IGwgPSAwOyBsIDwgcmVwOyBsKyspIHsKCQkJZm9yKGludCBpID0gMTsgaSA8IGcubGVuZ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