-
Notifications
You must be signed in to change notification settings - Fork 2
/
Template.java
53 lines (39 loc) · 1.17 KB
/
Template.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
import java.io.*;
import java.util.StringTokenizer;
public class Template implements Runnable {
void solve() {
}
BufferedReader br;
StringTokenizer st = null;
PrintWriter out;
@Override
public void run() {
try {
br = new BufferedReader(new InputStreamReader(new FileInputStream("file.txt")));
// or
br = new BufferedReader(new InputStreamReader(System.in));
out = new PrintWriter(System.out);
solve();
out.flush();
} catch (FileNotFoundException e) {
e.printStackTrace();
System.exit(1);
}
}
String nextString() throws IOException{
while (st == null || !st.hasMoreTokens()) {
String s = br.readLine();
st = new StringTokenizer(s);
}
return st.nextToken();
}
int nextInt() throws IOException {
return Integer.parseInt(nextString());
}
double nextDouble() throws IOException {
return Double.parseDouble(nextString());
}
public static void main(String[] args) {
new Thread(null, new Template(), "", 1<<26).start(); //64MB
}
}