Skip to content

Instantly share code, notes, and snippets.

@codekansas
Created July 17, 2016 00:19
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save codekansas/998da051fba0005111d43b0d11246478 to your computer and use it in GitHub Desktop.
Save codekansas/998da051fba0005111d43b0d11246478 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());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment