Java for programming contests

Правка en4, от dev_il, 2015-06-24 12:07:44

There is a lot of information about programming in C++ for competitions as well as almost all algorithm implementations are written in C++ language (e.g. e-maxx site, Topcoder tutorials etc.). So from there we can take some best practices of what to use or not to use when writing problem solutions.

For Java there is no such resources as I know. If not I would be really thankful to obtain links to them.

It's good to read codes in Java of target coders like Petr or Egor but it would be better to have it in one place (like e-maxx site).

Additionally I want to ask some questions interesting for me.

  1. How do you know that some problem need to be written in C++ instead of Java? For example 524F - And Yet Another Bracket Sequence that Petr wrote in C++ not Java. I don't see any specific data structure like std::bitset that Java don't have.

  2. Which tricks are not recommended to use in Java (like you need to pay attention to autoboxing, that may do your solution more slow unexpectedly) ?

  3. I like very much C++'s std::pair<T1, T2> and it seems that it's much more efficient that self-written Java analog (e.g. https://github.com/EgorKulikov/yaal/blob/master/lib/main/net/egork/collections/Pair.java). Is it true or not? I think so because of creation of Object for each element of Pair (that need to be done because generics in Java cannot be declared as Pair<int, int> but must be Pair<Integer, Integer>). So would be the implementation of Pair for each case int first, second, int first; long second; etc more efficient than such of Egor?

Теги java, best practices

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en4 Английский dev_il 2015-06-24 12:07:44 98
en3 Английский dev_il 2015-06-24 12:05:44 4 Tiny change: '-06-24] written in C++ no' -> '-06-24] wrote in C++ no'
en2 Английский dev_il 2015-06-24 12:05:01 4
en1 Английский dev_il 2015-06-24 12:03:42 1635 Initial revision (published)