Created
July 17, 2016 00:19
-
-
Save codekansas/998da051fba0005111d43b0d11246478 to your computer and use it in GitHub Desktop.
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
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