-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTemplate.java
More file actions
63 lines (53 loc) · 1.69 KB
/
Copy pathTemplate.java
File metadata and controls
63 lines (53 loc) · 1.69 KB
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
54
55
56
57
58
59
60
61
62
63
/**
* Universal Competitive Programming Boilerplate in Java
* Author: Pratham Kashyap
*/
import java.io.*;
import java.util.*;
public class Template {
static class FastScanner {
private final BufferedReader reader;
private StringTokenizer tokenizer;
public FastScanner(InputStream stream) {
reader = new BufferedReader(new InputStreamReader(stream));
tokenizer = null;
}
public String next() {
while (tokenizer == null || !tokenizer.hasMoreTokens()) {
try {
String line = reader.readLine();
if (line == null) return null;
tokenizer = new StringTokenizer(line);
} catch (IOException e) {
throw new RuntimeException(e);
}
}
return tokenizer.nextToken();
}
public int nextInt() {
return Integer.parseInt(next());
}
public long nextLong() {
return Long.parseLong(next());
}
public double nextDouble() {
return Double.parseDouble(next());
}
}
public static void solve(FastScanner in, PrintWriter out) {
// Solution implementation here
}
public static void main(String[] args) {
FastScanner in = new FastScanner(System.in);
PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out));
String firstToken = in.next();
if (firstToken != null) {
int t = Integer.parseInt(firstToken);
while (t-- > 0) {
solve(in, out);
}
}
out.flush();
out.close();
}
}