This repository contains sample code for IOI contestants, that shows how to perform basic operations in C++, Java and C#.
- In C++, use
sync_with_stdio(false)for fastcin/cout. - In Java,
BufferedReaderseems to be faster thanScanner. - In Java and C#, printing seems to have expensive overhead. In Java we can use
BufferedWriter(remember toflush()before exiting!), and in C# we can useStringBuilder. - Java and C# seem to read very long lines slower than C++. Best to avoid long lines if possible.
- Java's
ArrayListis sometimes slower than normal arrays.