CodingKnight's blog

By CodingKnight, 11 months ago, In English

Hello Codeforces,

The following three Kotlin lines:

import java.io.*
val cin = System.`in`.bufferedReader()
val cout = PrintWriter(System.out.bufferedWriter())

along with appropriate function calls were sufficient to achieve significant speed-up to the execution-time of the following problem:

1176D - Recover it!

Check the following accepted submissions:

  1. Without fast data input/output 237662785
  2. With fast data input/output 237662628

Feel free to use these lines in your Kotlin code, and make sure that cout.flush() is the last statement in your program, unless you are solving an interactive problem in which flushing the data output buffer is required more frequently to interact correctly with the automatic judge.

Best wishes

  • Vote: I like it
  • +9
  • Vote: I do not like it