Created
March 9, 2021 00:18
-
-
Save dharanad/4120b63f6c32199e9a51bcd30b43fc90 to your computer and use it in GitHub Desktop.
Java Fast IO
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static class FastReader { | |
BufferedReader br; | |
StringTokenizer st; | |
public FastReader() { | |
br = new BufferedReader(new | |
InputStreamReader(System.in)); | |
} | |
String next() { | |
while (st == null || !st.hasMoreElements()) { | |
try { | |
st = new StringTokenizer(br.readLine()); | |
} catch (IOException e) { | |
e.printStackTrace(); | |
} | |
} | |
return st.nextToken(); | |
} | |
int nextInt() { | |
return Integer.parseInt(next()); | |
} | |
long nextLong() { | |
return Long.parseLong(next()); | |
} | |
double nextDouble() { | |
return Double.parseDouble(next()); | |
} | |
String nextLine() { | |
String str = ""; | |
try { | |
str = br.readLine(); | |
} catch (IOException e) { | |
e.printStackTrace(); | |
} | |
return str; | |
} | |
} | |
public static void main(String[] args) { | |
FastReader fs = new FastReader(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment