{
public int x,y;
}
public class Main
{
public static void main
(String[] args
) {
{
long start
= System.
nanoTime(); int[] v = new int[1 << 24];
System.
out.
println(v
[200]+" plain_array elapsed = "+(end
- start
)*1.0e
-9
); }
{
long start
= System.
nanoTime(); for(int i = 0; i != v.length; ++i)
System.
out.
println(v
[100].
x+" structured_array elapsed = "+(end
- start
)*1.0e
-9
); }
}
}
Y2xhc3MgUG9pbnQyRAp7CiAgICBwdWJsaWMgaW50IHgseTsKfQoKcHVibGljIGNsYXNzIE1haW4KewogICAgcHVibGljIHN0YXRpYyB2b2lkIG1haW4oU3RyaW5nW10gYXJncykKICAgIHsKICAgICAgICB7CiAgICAgICAgICAgIGxvbmcgc3RhcnQgPSBTeXN0ZW0ubmFub1RpbWUoKTsKICAgICAgICAgICAgaW50W10gdiA9IG5ldyBpbnRbMSA8PCAyNF07CiAgICAgICAgICAgIGxvbmcgZW5kID0gU3lzdGVtLm5hbm9UaW1lKCk7CiAgICAgICAgICAgIFN5c3RlbS5vdXQucHJpbnRsbih2WzIwMF0rIiBwbGFpbl9hcnJheSBlbGFwc2VkID0gIisoZW5kIC0gc3RhcnQpKjEuMGUtOSk7CiAgICAgICAgfQogICAgICAgIHsKICAgICAgICAgICAgbG9uZyBzdGFydCA9IFN5c3RlbS5uYW5vVGltZSgpOwogICAgICAgICAgICBQb2ludDJEW10gdiA9IG5ldyBQb2ludDJEWzEgPDwgMjNdOwogICAgICAgICAgICBmb3IoaW50IGkgPSAwOyBpICE9IHYubGVuZ3RoOyArK2kpCiAgICAgICAgICAgICAgICB2W2ldID0gbmV3IFBvaW50MkQoKTsKICAgICAgICAgICAgbG9uZyBlbmQgPSBTeXN0ZW0ubmFub1RpbWUoKTsKICAgICAgICAgICAgU3lzdGVtLm91dC5wcmludGxuKHZbMTAwXS54KyIgc3RydWN0dXJlZF9hcnJheSBlbGFwc2VkID0gIisoZW5kIC0gc3RhcnQpKjEuMGUtOSk7CiAgICAgICAgfQogICAgfQp9Cg==