class A {
public static void main
(String[] args
) { int n = 8000;
int g[][] = new int[n][n];
long st, en;
// one
for(int i = 0; i < n; i++) {
for(int j = 0; j < n; j++) {
g[i][j] = i + j;
}
}
System.
out.
println("\nTwo time " + (en
- st
)/1000000.
d + " msc");
// two
for(int i = 0; i < n; i++) {
g[i][i] = i + i;
for(int j = 0; j < i; j++) {
g[j][i] = g[i][j] = i + j;
}
}
System.
out.
println("\nTwo time " + (en
- st
)/1000000.
d + " msc"); }
}
Y2xhc3MgQSB7CiAgcHVibGljIHN0YXRpYyB2b2lkIG1haW4oU3RyaW5nW10gYXJncykgewogICAgaW50IG4gPSA4MDAwOwoKICAgIGludCBnW11bXSA9IG5ldyBpbnRbbl1bbl07CiAgICBsb25nIHN0LCBlbjsKCiAgICAvLyBvbmUKICAgIHN0ID0gU3lzdGVtLm5hbm9UaW1lKCk7CiAgICBmb3IoaW50IGkgPSAwOyBpIDwgbjsgaSsrKSB7CiAgICAgIGZvcihpbnQgaiA9IDA7IGogPCBuOyBqKyspIHsKICAgICAgICBnW2ldW2pdID0gaSArIGo7IAogICAgICB9CiAgICB9CiAgICBlbiA9IFN5c3RlbS5uYW5vVGltZSgpOwogICAgU3lzdGVtLm91dC5wcmludGxuKCJcblR3byB0aW1lICIgKyAoZW4gLSBzdCkvMTAwMDAwMC5kICsgIiBtc2MiKTsKCiAgICAvLyB0d28KICAgIHN0ID0gU3lzdGVtLm5hbm9UaW1lKCk7CiAgICBmb3IoaW50IGkgPSAwOyBpIDwgbjsgaSsrKSB7CiAgICAgIGdbaV1baV0gPSAgaSArIGk7CiAgICAgIGZvcihpbnQgaiA9IDA7IGogPCBpOyBqKyspIHsKICAgICAgICBnW2pdW2ldID0gZ1tpXVtqXSA9IGkgKyBqOyAKICAgICAgfQogICAgfQogICAgZW4gPSBTeXN0ZW0ubmFub1RpbWUoKTsKICAgIFN5c3RlbS5vdXQucHJpbnRsbigiXG5Ud28gdGltZSAiICsgKGVuIC0gc3QpLzEwMDAwMDAuZCArICIgbXNjIik7CiAgfQp9