About two days ago Java 8 has been released! It is a great update with many interesting improvements and features. If you do not plan to use new language syntax, probably Java 8 will please you with performance improvements.
I've added Java 8 with options like for other versions of Java: java.exe -Xmx512M -Xss64M -DONLINE_JUDGE=true -Duser.language=en -Duser.region=US -Duser.variant=US -jar %s
.
Right now, Java 8 supported in testing mode. Let's try it together on problemset problems.
You may see new features in this code — it sorts lines in non-increasing lexicographical order:
import java.util.*;
public class Main {
public static void main(String[] args) {
try (Scanner scanner = new Scanner(System.in)) {
List<String> lines = new ArrayList<>();
while (scanner.hasNextLine()) {
lines.add(scanner.nextLine());
}
lines.stream().sorted((a, b) -> b.compareTo(a)).forEach(System.out::println);
}
}
}
Thanks, BTW Why don't you add C++11 in languages?
C++0x is already added
http://mirror.codeforces.com/contest/404/submission/6174479 In the above submission I used Arrays.setAll(lists, ArrayList::new), and it caused a MLE. But it was accepted once I replaced setAll with a loop.
because
Arrays.setAll(lists, ArrayList::new)
equals toCorrect call:
Which new features of JAVA 8 are very useful for our sport programming?
At Java 8 there is new implementation of HashSet (HashMap) for resisting of attack on they buckets. In some cases it mutate to "table of trees" and from this state it can mutate to "table of linked lists" back :-)
New string-hashing implementation, improved collision performance for string-valued containers.