Last active
January 14, 2021 10:36
-
-
Save oneshadab/dc546713c9ec67273fae0676891ac5d5 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()); | |
} | |
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