Skip to content

Instantly share code, notes, and snippets.

@oneshadab
Last active January 14, 2021 10:36
Show Gist options
  • Save oneshadab/dc546713c9ec67273fae0676891ac5d5 to your computer and use it in GitHub Desktop.
Save oneshadab/dc546713c9ec67273fae0676891ac5d5 to your computer and use it in GitHub Desktop.
class FastScanner {
BufferedReader br;
StringTokenizer st;
public FastScanner() {
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());
}
BigInteger nextBigInteger(){
return new BigInteger(next());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment