Created
December 6, 2014 11:09
-
-
Save arviman/6a01b00ebdf205d274de 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
package myPackage; | |
import myPackage.FastReader | |
{ | |
BufferedReader br; | |
StringTokenizer tokenizer; | |
public FastReader(InputStream stream) | |
{ | |
br = new BufferedReader(new InputStreamReader(stream)); | |
tokenizer = null; | |
} | |
public FastReader(File f) { | |
try { | |
br = new BufferedReader(new FileReader(f)); | |
tokenizer = null; | |
} | |
catch (FileNotFoundException e) { | |
e.printStackTrace(); | |
} | |
} | |
private String next() { | |
while (tokenizer == null || !tokenizer.hasMoreTokens()) | |
try { | |
tokenizer = new StringTokenizer(br.readLine()); | |
} | |
catch (IOException e) { | |
throw new RuntimeException(e); | |
} | |
return tokenizer.nextToken(); | |
} | |
public String nextLine() { | |
try { | |
return br.readLine(); | |
} | |
catch(Exception e) { | |
throw(new RuntimeException()); | |
} | |
} | |
int nextInt() { | |
return Integer.parseInt(next()); | |
} | |
long nextLong() { | |
return Long.parseLong(next()); | |
} | |
double nextDouble() { | |
return Double.parseDouble(next()); | |
} | |
BigInteger nextBigInteger() { | |
return new BigInteger(next()); | |
} | |
BigDecimal nextBigDecimal() { | |
return new BigDecimal(next()); | |
} | |
}; | |
import java.io.PrintWriter; | |
public class D { | |
public void solve(int testNumber, parseDouble(next()); | |
} | |
BigInteger nextBigInteger() { | |
return new BigInteger(next()); | |
} | |
BigDecimal nextBigDecimal() { | |
return new BigDecimal(next()); | |
} | |
} in, PrintWriter out) { | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment