Skip to content

Instantly share code, notes, and snippets.

Last active January 23, 2023 21:42
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
Java Competitive Programming template with fast IO
import java.util.*;
public class Main {
static BufferedReader br = new BufferedReader(new InputStreamReader(;
static StringTokenizer in;
public static void main(String[] args) throws IOException {
static String next() throws IOException {
while (in == null || !in.hasMoreTokens())
in = new StringTokenizer(br.readLine());
return in.nextToken();
static long readLong() throws IOException {
return Long.parseLong(next());
static int readInt() throws IOException {
return Integer.parseInt(next());
static double readDouble() throws IOException {
return Double.parseDouble(next());
static char readChar() throws IOException {
return next().charAt(0);
static String readLine() throws IOException {
return br.readLine();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment