-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcpjava.json
More file actions
107 lines (107 loc) · 3.23 KB
/
cpjava.json
File metadata and controls
107 lines (107 loc) · 3.23 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
{
"Java Initial CP template": {
"prefix": "cpjava",
"body": [
"import static java.lang.System.exit;",
"import java.io.*;",
"import java.util.*;",
"",
"/**",
" * @author mayurvpatil",
" *",
" * Date: ${CURRENT_YEAR} ${CURRENT_MONTH_NAME} ${CURRENT_DATE} | [ ${CURRENT_DAY_NAME} ]",
" * Time: ${CURRENT_HOUR} : ${CURRENT_MINUTE} : ${CURRENT_SECOND} ",
" */",
"",
"/**",
" * Public - CodeForces",
" * No modifier - CodeChef",
" */",
"",
"${1|public, |} class ${TM_FILENAME_BASE} {",
"",
" public void solve() throws Exception {",
" $3",
" } // End",
"",
" public ${TM_FILENAME_BASE}() throws Exception {",
" boolean isMultipleTestCases = ${2|true,false|};",
" in = new InputReader(System.in);",
" out = new PrintWriter(System.out);",
"",
" if (isMultipleTestCases) {",
" int t = in.getInt();",
" for (int i = 1; i <= t; ++i) {",
" solve();",
" }",
" } else {",
" solve();",
" }",
" out.close();",
" }",
"",
" public static void main(String[] args) {",
" try {",
" new ${TM_FILENAME_BASE}();",
" } catch (Throwable e) {",
" e.printStackTrace();",
" exit(1);",
" }",
" }",
"",
" private InputReader in = null;",
" private PrintWriter out = null;",
"",
" // FastIO reader",
" static class InputReader {",
" public BufferedReader reader;",
" public StringTokenizer tokenizer;",
"",
" public InputReader(InputStream stream) {",
" reader = new BufferedReader(new InputStreamReader(stream), 32768);",
" tokenizer = null;",
" }",
"",
" public String getLine() throws Exception {",
" return reader.readLine();",
" }",
"",
" public String getString() {",
" while (tokenizer == null || !tokenizer.hasMoreTokens()) {",
" try {",
" tokenizer = new StringTokenizer(reader.readLine());",
" } catch (IOException e) {",
" throw new RuntimeException(e);",
" }",
" }",
" return tokenizer.nextToken();",
" }",
"",
" public int getInt() {",
" return Integer.parseInt(getString());",
" }",
"",
" public long getLong() {",
" return Long.parseLong(getString());",
" }",
"",
" public int[] getIntArray(int n) {",
" int[] temp = new int[n];",
" for (int i = 0; i < n; i++)",
" temp[i] = getInt();",
" return temp;",
" }",
"",
" public long[] getLongArray(int n) {",
" long[] temp = new long[n];",
" for (int i = 0; i < n; i++)",
" temp[i] = getLong();",
" return temp;",
" }",
" }",
"}",
""
],
"description": "Java Initial CP template"
}
}