node_ids
sequencelengths 4
1.4k
| edge_index
sequencelengths 1
2.22k
| text
sequencelengths 4
1.4k
| source
stringlengths 14
427k
|
---|---|---|---|
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
20,
4,
18,
18,
13,
13,
4,
18,
13,
23,
13,
6,
13,
41,
13,
41,
13,
20,
17,
41,
13,
17,
41,
13,
41,
13,
41,
13,
41,
13,
12,
13,
30,
0,
18,
36,
13,
13,
23,
13,
12,
13,
30,
0,
18,
13,
13,
13,
40,
13,
23,
13,
12,
13,
30,
40,
13,
29,
18,
13,
13,
12,
13,
30,
41,
13,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
30,
0,
13,
18,
13,
13,
14,
4,
18,
13,
17,
30,
0,
13,
4,
13,
0,
13,
4,
13,
0,
13,
2,
13,
13,
4,
13,
13,
14,
4,
18,
13,
17,
30,
0,
13,
4,
13,
0,
13,
4,
13,
0,
13,
2,
13,
13,
4,
13,
13,
14,
4,
18,
13,
17,
30,
0,
13,
4,
13,
0,
13,
4,
13,
0,
13,
2,
13,
13,
4,
13,
13,
30,
0,
13,
4,
18,
13,
18,
13,
13,
4,
13,
13,
29,
4,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
188,
11
],
[
188,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
15,
17
],
[
14,
18
],
[
18,
19
],
[
18,
20
],
[
14,
21
],
[
21,
22
],
[
22,
23
],
[
23,
24
],
[
23,
25
],
[
21,
26
],
[
26,
27
],
[
27,
28
],
[
12,
29
],
[
29,
30
],
[
0,
31
],
[
31,
32
],
[
31,
33
],
[
33,
34
],
[
31,
35
],
[
35,
36
],
[
35,
37
],
[
31,
39
],
[
39,
40
],
[
39,
41
],
[
31,
42
],
[
42,
43
],
[
31,
44
],
[
44,
45
],
[
31,
46
],
[
46,
47
],
[
31,
48
],
[
48,
49
],
[
31,
50
],
[
50,
51
],
[
50,
52
],
[
52,
53
],
[
53,
54
],
[
54,
55
],
[
54,
56
],
[
53,
57
],
[
50,
58
],
[
58,
59
],
[
31,
60
],
[
60,
61
],
[
60,
62
],
[
62,
63
],
[
63,
64
],
[
64,
65
],
[
64,
66
],
[
63,
67
],
[
62,
68
],
[
68,
69
],
[
60,
70
],
[
70,
71
],
[
31,
72
],
[
72,
73
],
[
72,
74
],
[
74,
75
],
[
75,
76
],
[
74,
77
],
[
77,
78
],
[
78,
79
],
[
78,
80
],
[
31,
81
],
[
81,
82
],
[
81,
83
],
[
83,
84
],
[
84,
85
],
[
83,
86
],
[
86,
87
],
[
87,
88
],
[
88,
89
],
[
88,
90
],
[
86,
91
],
[
91,
92
],
[
91,
93
],
[
93,
94
],
[
93,
95
],
[
86,
96
],
[
96,
97
],
[
97,
98
],
[
86,
99
],
[
100,
100
],
[
100,
101
],
[
101,
102
],
[
101,
103
],
[
103,
104
],
[
103,
105
],
[
100,
106
],
[
106,
107
],
[
107,
108
],
[
108,
109
],
[
107,
110
],
[
106,
111
],
[
111,
112
],
[
112,
113
],
[
112,
114
],
[
114,
115
],
[
111,
116
],
[
116,
117
],
[
116,
118
],
[
118,
119
],
[
111,
120
],
[
120,
121
],
[
120,
122
],
[
122,
123
],
[
122,
124
],
[
111,
125
],
[
125,
126
],
[
125,
127
],
[
106,
128
],
[
128,
129
],
[
129,
130
],
[
130,
131
],
[
129,
132
],
[
128,
133
],
[
133,
134
],
[
134,
135
],
[
134,
136
],
[
136,
137
],
[
133,
138
],
[
138,
139
],
[
138,
140
],
[
140,
141
],
[
133,
142
],
[
142,
143
],
[
142,
144
],
[
144,
145
],
[
144,
146
],
[
133,
147
],
[
147,
148
],
[
147,
149
],
[
128,
150
],
[
150,
151
],
[
151,
152
],
[
152,
153
],
[
151,
154
],
[
150,
155
],
[
155,
156
],
[
156,
157
],
[
156,
158
],
[
158,
159
],
[
155,
160
],
[
160,
161
],
[
160,
162
],
[
162,
163
],
[
155,
164
],
[
164,
165
],
[
164,
166
],
[
166,
167
],
[
166,
168
],
[
155,
169
],
[
169,
170
],
[
169,
171
],
[
150,
172
],
[
172,
173
],
[
173,
174
],
[
173,
175
],
[
175,
176
],
[
176,
177
],
[
175,
178
],
[
178,
179
],
[
178,
180
],
[
172,
181
],
[
181,
182
],
[
181,
183
],
[
83,
184
],
[
184,
185
],
[
185,
186
],
[
0,
187
],
[
187,
188
],
[
187,
189
]
] | [
"import java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\n\npublic class Main {\n\tpublic static void main(String[] args) throws IOException {\n\t\tBufferedReader in = new BufferedReader(new InputStreamReader(System.in));\n\t\tStackSub readDataArr = new StackSub(in.readLine().split(\" \"));\n\t\tSystem.out.println(readDataArr.calcData());\n\t}\n}\n\nclass StackSub {\n\tprivate String[] readData;\n\tprivate int[] stack = new int[100];\n\tprivate int pointer = 0, result, operand2, operand1,\n\t\t\tstrToIntData;\n\n\tStackSub(String[] readData) {\n\t\tthis.readData = readData;\n\t}\n\n\tpublic void push(int data) {\n\t\tstack[pointer] = data;\n\t\tpointer++;\n\t}\n\n\tpublic int pop() {\n\t\tpointer--;\n\t\treturn stack[pointer];\n\t}\n\n\tpublic int calcData() {\n\t\tString tempStrData;\n\t\tfor (int i = 0; i < readData.length; i++) {\n\t\t\ttempStrData = readData[i];\n\n\t\t\tif (tempStrData.equals(\"+\")) {\n\t\t\t\toperand1 = pop();\n\t\t\t\toperand2 = pop();\n\t\t\t\tresult = operand2 + operand1;\n\t\t\t\tpush(result);\n\t\t\t} else if (tempStrData.equals(\"-\")) {\n\t\t\t\toperand1 = pop();\n\t\t\t\toperand2 = pop();\n\t\t\t\tresult = operand2 - operand1;\n\t\t\t\tpush(result);\n\t\t\t} else if (tempStrData.equals(\"*\")) {\n\t\t\t\toperand1 = pop();\n\t\t\t\toperand2 = pop();\n\t\t\t\tresult = operand2 * operand1;\n\t\t\t\tpush(result);\n\t\t\t} else {\n\t\t\t\tstrToIntData = Integer.parseInt(readData[i]);\n\t\t\t\tpush(strToIntData);\n\t\t\t}\n\t\t}\n\t\treturn pop();\n\t}\n}",
"import java.io.BufferedReader;",
"BufferedReader",
"java.io",
"import java.io.IOException;",
"IOException",
"java.io",
"import java.io.InputStreamReader;",
"InputStreamReader",
"java.io",
"public class Main {\n\tpublic static void main(String[] args) throws IOException {\n\t\tBufferedReader in = new BufferedReader(new InputStreamReader(System.in));\n\t\tStackSub readDataArr = new StackSub(in.readLine().split(\" \"));\n\t\tSystem.out.println(readDataArr.calcData());\n\t}\n}",
"Main",
"public static void main(String[] args) throws IOException {\n\t\tBufferedReader in = new BufferedReader(new InputStreamReader(System.in));\n\t\tStackSub readDataArr = new StackSub(in.readLine().split(\" \"));\n\t\tSystem.out.println(readDataArr.calcData());\n\t}",
"main",
"{\n\t\tBufferedReader in = new BufferedReader(new InputStreamReader(System.in));\n\t\tStackSub readDataArr = new StackSub(in.readLine().split(\" \"));\n\t\tSystem.out.println(readDataArr.calcData());\n\t}",
"BufferedReader in = new BufferedReader(new InputStreamReader(System.in));",
"in",
"new BufferedReader(new InputStreamReader(System.in))",
"StackSub readDataArr = new StackSub(in.readLine().split(\" \"));",
"readDataArr",
"new StackSub(in.readLine().split(\" \"))",
"System.out.println(readDataArr.calcData())",
"System.out.println",
"System.out",
"System",
"System.out",
"readDataArr.calcData()",
"readDataArr.calcData",
"readDataArr",
"String[] args",
"args",
"class StackSub {\n\tprivate String[] readData;\n\tprivate int[] stack = new int[100];\n\tprivate int pointer = 0, result, operand2, operand1,\n\t\t\tstrToIntData;\n\n\tStackSub(String[] readData) {\n\t\tthis.readData = readData;\n\t}\n\n\tpublic void push(int data) {\n\t\tstack[pointer] = data;\n\t\tpointer++;\n\t}\n\n\tpublic int pop() {\n\t\tpointer--;\n\t\treturn stack[pointer];\n\t}\n\n\tpublic int calcData() {\n\t\tString tempStrData;\n\t\tfor (int i = 0; i < readData.length; i++) {\n\t\t\ttempStrData = readData[i];\n\n\t\t\tif (tempStrData.equals(\"+\")) {\n\t\t\t\toperand1 = pop();\n\t\t\t\toperand2 = pop();\n\t\t\t\tresult = operand2 + operand1;\n\t\t\t\tpush(result);\n\t\t\t} else if (tempStrData.equals(\"-\")) {\n\t\t\t\toperand1 = pop();\n\t\t\t\toperand2 = pop();\n\t\t\t\tresult = operand2 - operand1;\n\t\t\t\tpush(result);\n\t\t\t} else if (tempStrData.equals(\"*\")) {\n\t\t\t\toperand1 = pop();\n\t\t\t\toperand2 = pop();\n\t\t\t\tresult = operand2 * operand1;\n\t\t\t\tpush(result);\n\t\t\t} else {\n\t\t\t\tstrToIntData = Integer.parseInt(readData[i]);\n\t\t\t\tpush(strToIntData);\n\t\t\t}\n\t\t}\n\t\treturn pop();\n\t}\n}",
"StackSub",
"private String[] readData;",
"readData",
"private int[] stack = new int[100];",
"stack",
"new int[100]",
"100",
"private int pointer = 0",
"pointer",
"0",
"result",
"result",
"operand2",
"operand2",
"operand1",
"operand1",
"strToIntData;",
"strToIntData",
"StackSub(String[] readData) {\n\t\tthis.readData = readData;\n\t}",
"StackSub",
"{\n\t\tthis.readData = readData;\n\t}",
"this.readData = readData",
"this.readData",
"this",
"this.readData",
"readData",
"String[] readData",
"readData",
"public void push(int data) {\n\t\tstack[pointer] = data;\n\t\tpointer++;\n\t}",
"push",
"{\n\t\tstack[pointer] = data;\n\t\tpointer++;\n\t}",
"stack[pointer] = data",
"stack[pointer]",
"stack",
"pointer",
"data",
"pointer++",
"pointer",
"int data",
"data",
"public int pop() {\n\t\tpointer--;\n\t\treturn stack[pointer];\n\t}",
"pop",
"{\n\t\tpointer--;\n\t\treturn stack[pointer];\n\t}",
"pointer--",
"pointer",
"return stack[pointer];",
"stack[pointer]",
"stack",
"pointer",
"public int calcData() {\n\t\tString tempStrData;\n\t\tfor (int i = 0; i < readData.length; i++) {\n\t\t\ttempStrData = readData[i];\n\n\t\t\tif (tempStrData.equals(\"+\")) {\n\t\t\t\toperand1 = pop();\n\t\t\t\toperand2 = pop();\n\t\t\t\tresult = operand2 + operand1;\n\t\t\t\tpush(result);\n\t\t\t} else if (tempStrData.equals(\"-\")) {\n\t\t\t\toperand1 = pop();\n\t\t\t\toperand2 = pop();\n\t\t\t\tresult = operand2 - operand1;\n\t\t\t\tpush(result);\n\t\t\t} else if (tempStrData.equals(\"*\")) {\n\t\t\t\toperand1 = pop();\n\t\t\t\toperand2 = pop();\n\t\t\t\tresult = operand2 * operand1;\n\t\t\t\tpush(result);\n\t\t\t} else {\n\t\t\t\tstrToIntData = Integer.parseInt(readData[i]);\n\t\t\t\tpush(strToIntData);\n\t\t\t}\n\t\t}\n\t\treturn pop();\n\t}",
"calcData",
"{\n\t\tString tempStrData;\n\t\tfor (int i = 0; i < readData.length; i++) {\n\t\t\ttempStrData = readData[i];\n\n\t\t\tif (tempStrData.equals(\"+\")) {\n\t\t\t\toperand1 = pop();\n\t\t\t\toperand2 = pop();\n\t\t\t\tresult = operand2 + operand1;\n\t\t\t\tpush(result);\n\t\t\t} else if (tempStrData.equals(\"-\")) {\n\t\t\t\toperand1 = pop();\n\t\t\t\toperand2 = pop();\n\t\t\t\tresult = operand2 - operand1;\n\t\t\t\tpush(result);\n\t\t\t} else if (tempStrData.equals(\"*\")) {\n\t\t\t\toperand1 = pop();\n\t\t\t\toperand2 = pop();\n\t\t\t\tresult = operand2 * operand1;\n\t\t\t\tpush(result);\n\t\t\t} else {\n\t\t\t\tstrToIntData = Integer.parseInt(readData[i]);\n\t\t\t\tpush(strToIntData);\n\t\t\t}\n\t\t}\n\t\treturn pop();\n\t}",
"String tempStrData;",
"tempStrData",
"for (int i = 0; i < readData.length; i++) {\n\t\t\ttempStrData = readData[i];\n\n\t\t\tif (tempStrData.equals(\"+\")) {\n\t\t\t\toperand1 = pop();\n\t\t\t\toperand2 = pop();\n\t\t\t\tresult = operand2 + operand1;\n\t\t\t\tpush(result);\n\t\t\t} else if (tempStrData.equals(\"-\")) {\n\t\t\t\toperand1 = pop();\n\t\t\t\toperand2 = pop();\n\t\t\t\tresult = operand2 - operand1;\n\t\t\t\tpush(result);\n\t\t\t} else if (tempStrData.equals(\"*\")) {\n\t\t\t\toperand1 = pop();\n\t\t\t\toperand2 = pop();\n\t\t\t\tresult = operand2 * operand1;\n\t\t\t\tpush(result);\n\t\t\t} else {\n\t\t\t\tstrToIntData = Integer.parseInt(readData[i]);\n\t\t\t\tpush(strToIntData);\n\t\t\t}\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < readData.length",
"i",
"readData.length",
"readData",
"readData.length",
"i++",
"i++",
"i",
"{\n\t\t\ttempStrData = readData[i];\n\n\t\t\tif (tempStrData.equals(\"+\")) {\n\t\t\t\toperand1 = pop();\n\t\t\t\toperand2 = pop();\n\t\t\t\tresult = operand2 + operand1;\n\t\t\t\tpush(result);\n\t\t\t} else if (tempStrData.equals(\"-\")) {\n\t\t\t\toperand1 = pop();\n\t\t\t\toperand2 = pop();\n\t\t\t\tresult = operand2 - operand1;\n\t\t\t\tpush(result);\n\t\t\t} else if (tempStrData.equals(\"*\")) {\n\t\t\t\toperand1 = pop();\n\t\t\t\toperand2 = pop();\n\t\t\t\tresult = operand2 * operand1;\n\t\t\t\tpush(result);\n\t\t\t} else {\n\t\t\t\tstrToIntData = Integer.parseInt(readData[i]);\n\t\t\t\tpush(strToIntData);\n\t\t\t}\n\t\t}",
"{\n\t\t\ttempStrData = readData[i];\n\n\t\t\tif (tempStrData.equals(\"+\")) {\n\t\t\t\toperand1 = pop();\n\t\t\t\toperand2 = pop();\n\t\t\t\tresult = operand2 + operand1;\n\t\t\t\tpush(result);\n\t\t\t} else if (tempStrData.equals(\"-\")) {\n\t\t\t\toperand1 = pop();\n\t\t\t\toperand2 = pop();\n\t\t\t\tresult = operand2 - operand1;\n\t\t\t\tpush(result);\n\t\t\t} else if (tempStrData.equals(\"*\")) {\n\t\t\t\toperand1 = pop();\n\t\t\t\toperand2 = pop();\n\t\t\t\tresult = operand2 * operand1;\n\t\t\t\tpush(result);\n\t\t\t} else {\n\t\t\t\tstrToIntData = Integer.parseInt(readData[i]);\n\t\t\t\tpush(strToIntData);\n\t\t\t}\n\t\t}",
"tempStrData = readData[i]",
"tempStrData",
"readData[i]",
"readData",
"i",
"if (tempStrData.equals(\"+\")) {\n\t\t\t\toperand1 = pop();\n\t\t\t\toperand2 = pop();\n\t\t\t\tresult = operand2 + operand1;\n\t\t\t\tpush(result);\n\t\t\t} else if (tempStrData.equals(\"-\")) {\n\t\t\t\toperand1 = pop();\n\t\t\t\toperand2 = pop();\n\t\t\t\tresult = operand2 - operand1;\n\t\t\t\tpush(result);\n\t\t\t} else if (tempStrData.equals(\"*\")) {\n\t\t\t\toperand1 = pop();\n\t\t\t\toperand2 = pop();\n\t\t\t\tresult = operand2 * operand1;\n\t\t\t\tpush(result);\n\t\t\t} else {\n\t\t\t\tstrToIntData = Integer.parseInt(readData[i]);\n\t\t\t\tpush(strToIntData);\n\t\t\t}",
"tempStrData.equals(\"+\")",
"tempStrData.equals",
"tempStrData",
"\"+\"",
"{\n\t\t\t\toperand1 = pop();\n\t\t\t\toperand2 = pop();\n\t\t\t\tresult = operand2 + operand1;\n\t\t\t\tpush(result);\n\t\t\t}",
"operand1 = pop()",
"operand1",
"pop()",
"pop",
"operand2 = pop()",
"operand2",
"pop()",
"pop",
"result = operand2 + operand1",
"result",
"operand2 + operand1",
"operand2",
"operand1",
"push(result)",
"push",
"result",
"if (tempStrData.equals(\"-\")) {\n\t\t\t\toperand1 = pop();\n\t\t\t\toperand2 = pop();\n\t\t\t\tresult = operand2 - operand1;\n\t\t\t\tpush(result);\n\t\t\t} else if (tempStrData.equals(\"*\")) {\n\t\t\t\toperand1 = pop();\n\t\t\t\toperand2 = pop();\n\t\t\t\tresult = operand2 * operand1;\n\t\t\t\tpush(result);\n\t\t\t} else {\n\t\t\t\tstrToIntData = Integer.parseInt(readData[i]);\n\t\t\t\tpush(strToIntData);\n\t\t\t}",
"tempStrData.equals(\"-\")",
"tempStrData.equals",
"tempStrData",
"\"-\"",
"{\n\t\t\t\toperand1 = pop();\n\t\t\t\toperand2 = pop();\n\t\t\t\tresult = operand2 - operand1;\n\t\t\t\tpush(result);\n\t\t\t}",
"operand1 = pop()",
"operand1",
"pop()",
"pop",
"operand2 = pop()",
"operand2",
"pop()",
"pop",
"result = operand2 - operand1",
"result",
"operand2 - operand1",
"operand2",
"operand1",
"push(result)",
"push",
"result",
"if (tempStrData.equals(\"*\")) {\n\t\t\t\toperand1 = pop();\n\t\t\t\toperand2 = pop();\n\t\t\t\tresult = operand2 * operand1;\n\t\t\t\tpush(result);\n\t\t\t} else {\n\t\t\t\tstrToIntData = Integer.parseInt(readData[i]);\n\t\t\t\tpush(strToIntData);\n\t\t\t}",
"tempStrData.equals(\"*\")",
"tempStrData.equals",
"tempStrData",
"\"*\"",
"{\n\t\t\t\toperand1 = pop();\n\t\t\t\toperand2 = pop();\n\t\t\t\tresult = operand2 * operand1;\n\t\t\t\tpush(result);\n\t\t\t}",
"operand1 = pop()",
"operand1",
"pop()",
"pop",
"operand2 = pop()",
"operand2",
"pop()",
"pop",
"result = operand2 * operand1",
"result",
"operand2 * operand1",
"operand2",
"operand1",
"push(result)",
"push",
"result",
"{\n\t\t\t\tstrToIntData = Integer.parseInt(readData[i]);\n\t\t\t\tpush(strToIntData);\n\t\t\t}",
"strToIntData = Integer.parseInt(readData[i])",
"strToIntData",
"Integer.parseInt(readData[i])",
"Integer.parseInt",
"Integer",
"readData[i]",
"readData",
"i",
"push(strToIntData)",
"push",
"strToIntData",
"return pop();",
"pop()",
"pop",
"public class Main {\n\tpublic static void main(String[] args) throws IOException {\n\t\tBufferedReader in = new BufferedReader(new InputStreamReader(System.in));\n\t\tStackSub readDataArr = new StackSub(in.readLine().split(\" \"));\n\t\tSystem.out.println(readDataArr.calcData());\n\t}\n}",
"public class Main {\n\tpublic static void main(String[] args) throws IOException {\n\t\tBufferedReader in = new BufferedReader(new InputStreamReader(System.in));\n\t\tStackSub readDataArr = new StackSub(in.readLine().split(\" \"));\n\t\tSystem.out.println(readDataArr.calcData());\n\t}\n}",
"Main"
] | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
StackSub readDataArr = new StackSub(in.readLine().split(" "));
System.out.println(readDataArr.calcData());
}
}
class StackSub {
private String[] readData;
private int[] stack = new int[100];
private int pointer = 0, result, operand2, operand1,
strToIntData;
StackSub(String[] readData) {
this.readData = readData;
}
public void push(int data) {
stack[pointer] = data;
pointer++;
}
public int pop() {
pointer--;
return stack[pointer];
}
public int calcData() {
String tempStrData;
for (int i = 0; i < readData.length; i++) {
tempStrData = readData[i];
if (tempStrData.equals("+")) {
operand1 = pop();
operand2 = pop();
result = operand2 + operand1;
push(result);
} else if (tempStrData.equals("-")) {
operand1 = pop();
operand2 = pop();
result = operand2 - operand1;
push(result);
} else if (tempStrData.equals("*")) {
operand1 = pop();
operand2 = pop();
result = operand2 * operand1;
push(result);
} else {
strToIntData = Integer.parseInt(readData[i]);
push(strToIntData);
}
}
return pop();
}
} |
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
20,
42,
4,
18,
13,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
17,
41,
13,
4,
18,
13,
13,
14,
4,
18,
13,
30,
4,
18,
13,
4,
18,
13,
13,
30,
14,
4,
18,
13,
17,
30,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
17,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
4,
18,
13,
4,
18,
13,
13,
14,
4,
18,
13,
17,
30,
41,
13,
4,
18,
13,
4,
18,
13,
0,
13,
2,
4,
18,
13,
13,
4,
18,
13,
4,
18,
13,
13,
14,
4,
18,
13,
17,
30,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
17,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
4,
18,
13,
4,
18,
13,
13,
4,
18,
18,
13,
13,
4,
18,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
163,
11
],
[
163,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
15,
17
],
[
14,
18
],
[
18,
19
],
[
18,
20
],
[
14,
21
],
[
21,
22
],
[
22,
23
],
[
23,
24
],
[
21,
25
],
[
25,
26
],
[
26,
27
],
[
26,
28
],
[
28,
29
],
[
29,
30
],
[
25,
31
],
[
31,
32
],
[
31,
33
],
[
33,
34
],
[
34,
35
],
[
33,
36
],
[
25,
37
],
[
37,
38
],
[
37,
39
],
[
39,
40
],
[
40,
41
],
[
39,
42
],
[
25,
43
],
[
43,
44
],
[
44,
45
],
[
45,
46
],
[
43,
47
],
[
47,
48
],
[
48,
49
],
[
49,
50
],
[
48,
51
],
[
51,
52
],
[
52,
53
],
[
51,
54
],
[
43,
55
],
[
55,
56
],
[
56,
57
],
[
57,
58
],
[
58,
59
],
[
57,
60
],
[
56,
61
],
[
61,
62
],
[
62,
63
],
[
62,
64
],
[
61,
65
],
[
65,
66
],
[
66,
67
],
[
67,
68
],
[
67,
69
],
[
65,
70
],
[
70,
71
],
[
70,
72
],
[
65,
73
],
[
73,
74
],
[
74,
75
],
[
65,
76
],
[
77,
77
],
[
77,
78
],
[
78,
79
],
[
78,
80
],
[
80,
81
],
[
81,
82
],
[
77,
83
],
[
83,
84
],
[
84,
85
],
[
61,
86
],
[
86,
87
],
[
87,
88
],
[
86,
89
],
[
56,
90
],
[
90,
91
],
[
91,
92
],
[
92,
93
],
[
91,
94
],
[
90,
95
],
[
95,
96
],
[
96,
97
],
[
96,
98
],
[
98,
99
],
[
99,
100
],
[
95,
101
],
[
101,
102
],
[
102,
103
],
[
95,
104
],
[
104,
105
],
[
104,
106
],
[
106,
107
],
[
107,
108
],
[
108,
109
],
[
106,
110
],
[
95,
111
],
[
111,
112
],
[
112,
113
],
[
95,
114
],
[
114,
115
],
[
115,
116
],
[
114,
117
],
[
90,
118
],
[
118,
119
],
[
119,
120
],
[
120,
121
],
[
119,
122
],
[
118,
123
],
[
123,
124
],
[
124,
125
],
[
124,
126
],
[
123,
127
],
[
127,
128
],
[
128,
129
],
[
129,
130
],
[
129,
131
],
[
127,
132
],
[
132,
133
],
[
132,
134
],
[
127,
135
],
[
135,
136
],
[
136,
137
],
[
127,
138
],
[
139,
139
],
[
139,
140
],
[
140,
141
],
[
140,
142
],
[
142,
143
],
[
143,
144
],
[
139,
145
],
[
145,
146
],
[
146,
147
],
[
123,
148
],
[
148,
149
],
[
149,
150
],
[
148,
151
],
[
14,
152
],
[
152,
153
],
[
153,
154
],
[
154,
155
],
[
154,
156
],
[
152,
157
],
[
157,
158
],
[
158,
159
],
[
12,
160
],
[
160,
161
],
[
0,
162
],
[
162,
163
],
[
162,
164
]
] | [
"import java.util.*;\nimport java.util.regex.Matcher;\nimport java.util.regex.Pattern;\npublic class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner cin=new Scanner(System.in);\n\t\tStack<Integer>stk=new Stack<>();\n\t\t\n\t\twhile(cin.hasNext()) {\n\t\t\tString obj=cin.next();\n\t\t\t\n\t\t\tPattern p=Pattern.compile(\"^[0-9]*$\");\n\t\t\tMatcher m=p.matcher(obj);\n\t\t\tif(m.find()) {\n\t\t\t\tstk.push(Integer.valueOf(obj));\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif(obj.equals(\"+\")) {\n\t\t\t\t\tint sum=0;\n\t\t\t\t\tfor(int i=0;i<2;i++) {\n\t\t\t\t\t\tsum+=stk.peek();\n\t\t\t\t\t\tstk.pop();\n\t\t\t\t\t}\n\t\t\t\t\tstk.push(sum);\n\t\t\t\t}\n\t\t\t\telse if(obj.equals(\"-\")) {\n\t\t\t\t\tint sum=stk.peek();stk.pop();\n\t\t\t\t\tsum=stk.peek()-sum;stk.pop();\n\t\t\t\t\tstk.push(sum);\n\t\t\t\t}\n\t\t\t\telse if(obj.equals(\"*\")) {\n\t\t\t\t\tint sum=1;\n\t\t\t\t\tfor(int i=0;i<2;i++) {\n\t\t\t\t\t\tsum*=stk.peek();\n\t\t\t\t\t\tstk.pop();\n\t\t\t\t\t}\n\t\t\t\t\tstk.push(sum);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t}\n\t\tSystem.out.println(stk.peek());\n\t\t\n\t}\n\n}\n",
"import java.util.*;",
"util.*",
"java",
"import java.util.regex.Matcher;",
"Matcher",
"java.util.regex",
"import java.util.regex.Pattern;",
"Pattern",
"java.util.regex",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner cin=new Scanner(System.in);\n\t\tStack<Integer>stk=new Stack<>();\n\t\t\n\t\twhile(cin.hasNext()) {\n\t\t\tString obj=cin.next();\n\t\t\t\n\t\t\tPattern p=Pattern.compile(\"^[0-9]*$\");\n\t\t\tMatcher m=p.matcher(obj);\n\t\t\tif(m.find()) {\n\t\t\t\tstk.push(Integer.valueOf(obj));\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif(obj.equals(\"+\")) {\n\t\t\t\t\tint sum=0;\n\t\t\t\t\tfor(int i=0;i<2;i++) {\n\t\t\t\t\t\tsum+=stk.peek();\n\t\t\t\t\t\tstk.pop();\n\t\t\t\t\t}\n\t\t\t\t\tstk.push(sum);\n\t\t\t\t}\n\t\t\t\telse if(obj.equals(\"-\")) {\n\t\t\t\t\tint sum=stk.peek();stk.pop();\n\t\t\t\t\tsum=stk.peek()-sum;stk.pop();\n\t\t\t\t\tstk.push(sum);\n\t\t\t\t}\n\t\t\t\telse if(obj.equals(\"*\")) {\n\t\t\t\t\tint sum=1;\n\t\t\t\t\tfor(int i=0;i<2;i++) {\n\t\t\t\t\t\tsum*=stk.peek();\n\t\t\t\t\t\tstk.pop();\n\t\t\t\t\t}\n\t\t\t\t\tstk.push(sum);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t}\n\t\tSystem.out.println(stk.peek());\n\t\t\n\t}\n\n}",
"Main",
"public static void main(String[] args) {\n\t\tScanner cin=new Scanner(System.in);\n\t\tStack<Integer>stk=new Stack<>();\n\t\t\n\t\twhile(cin.hasNext()) {\n\t\t\tString obj=cin.next();\n\t\t\t\n\t\t\tPattern p=Pattern.compile(\"^[0-9]*$\");\n\t\t\tMatcher m=p.matcher(obj);\n\t\t\tif(m.find()) {\n\t\t\t\tstk.push(Integer.valueOf(obj));\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif(obj.equals(\"+\")) {\n\t\t\t\t\tint sum=0;\n\t\t\t\t\tfor(int i=0;i<2;i++) {\n\t\t\t\t\t\tsum+=stk.peek();\n\t\t\t\t\t\tstk.pop();\n\t\t\t\t\t}\n\t\t\t\t\tstk.push(sum);\n\t\t\t\t}\n\t\t\t\telse if(obj.equals(\"-\")) {\n\t\t\t\t\tint sum=stk.peek();stk.pop();\n\t\t\t\t\tsum=stk.peek()-sum;stk.pop();\n\t\t\t\t\tstk.push(sum);\n\t\t\t\t}\n\t\t\t\telse if(obj.equals(\"*\")) {\n\t\t\t\t\tint sum=1;\n\t\t\t\t\tfor(int i=0;i<2;i++) {\n\t\t\t\t\t\tsum*=stk.peek();\n\t\t\t\t\t\tstk.pop();\n\t\t\t\t\t}\n\t\t\t\t\tstk.push(sum);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t}\n\t\tSystem.out.println(stk.peek());\n\t\t\n\t}",
"main",
"{\n\t\tScanner cin=new Scanner(System.in);\n\t\tStack<Integer>stk=new Stack<>();\n\t\t\n\t\twhile(cin.hasNext()) {\n\t\t\tString obj=cin.next();\n\t\t\t\n\t\t\tPattern p=Pattern.compile(\"^[0-9]*$\");\n\t\t\tMatcher m=p.matcher(obj);\n\t\t\tif(m.find()) {\n\t\t\t\tstk.push(Integer.valueOf(obj));\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif(obj.equals(\"+\")) {\n\t\t\t\t\tint sum=0;\n\t\t\t\t\tfor(int i=0;i<2;i++) {\n\t\t\t\t\t\tsum+=stk.peek();\n\t\t\t\t\t\tstk.pop();\n\t\t\t\t\t}\n\t\t\t\t\tstk.push(sum);\n\t\t\t\t}\n\t\t\t\telse if(obj.equals(\"-\")) {\n\t\t\t\t\tint sum=stk.peek();stk.pop();\n\t\t\t\t\tsum=stk.peek()-sum;stk.pop();\n\t\t\t\t\tstk.push(sum);\n\t\t\t\t}\n\t\t\t\telse if(obj.equals(\"*\")) {\n\t\t\t\t\tint sum=1;\n\t\t\t\t\tfor(int i=0;i<2;i++) {\n\t\t\t\t\t\tsum*=stk.peek();\n\t\t\t\t\t\tstk.pop();\n\t\t\t\t\t}\n\t\t\t\t\tstk.push(sum);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t}\n\t\tSystem.out.println(stk.peek());\n\t\t\n\t}",
"Scanner cin=new Scanner(System.in);",
"cin",
"new Scanner(System.in)",
"Stack<Integer>stk=new Stack<>();",
"stk",
"new Stack<>()",
"while(cin.hasNext()) {\n\t\t\tString obj=cin.next();\n\t\t\t\n\t\t\tPattern p=Pattern.compile(\"^[0-9]*$\");\n\t\t\tMatcher m=p.matcher(obj);\n\t\t\tif(m.find()) {\n\t\t\t\tstk.push(Integer.valueOf(obj));\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif(obj.equals(\"+\")) {\n\t\t\t\t\tint sum=0;\n\t\t\t\t\tfor(int i=0;i<2;i++) {\n\t\t\t\t\t\tsum+=stk.peek();\n\t\t\t\t\t\tstk.pop();\n\t\t\t\t\t}\n\t\t\t\t\tstk.push(sum);\n\t\t\t\t}\n\t\t\t\telse if(obj.equals(\"-\")) {\n\t\t\t\t\tint sum=stk.peek();stk.pop();\n\t\t\t\t\tsum=stk.peek()-sum;stk.pop();\n\t\t\t\t\tstk.push(sum);\n\t\t\t\t}\n\t\t\t\telse if(obj.equals(\"*\")) {\n\t\t\t\t\tint sum=1;\n\t\t\t\t\tfor(int i=0;i<2;i++) {\n\t\t\t\t\t\tsum*=stk.peek();\n\t\t\t\t\t\tstk.pop();\n\t\t\t\t\t}\n\t\t\t\t\tstk.push(sum);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t}",
"cin.hasNext()",
"cin.hasNext",
"cin",
"{\n\t\t\tString obj=cin.next();\n\t\t\t\n\t\t\tPattern p=Pattern.compile(\"^[0-9]*$\");\n\t\t\tMatcher m=p.matcher(obj);\n\t\t\tif(m.find()) {\n\t\t\t\tstk.push(Integer.valueOf(obj));\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif(obj.equals(\"+\")) {\n\t\t\t\t\tint sum=0;\n\t\t\t\t\tfor(int i=0;i<2;i++) {\n\t\t\t\t\t\tsum+=stk.peek();\n\t\t\t\t\t\tstk.pop();\n\t\t\t\t\t}\n\t\t\t\t\tstk.push(sum);\n\t\t\t\t}\n\t\t\t\telse if(obj.equals(\"-\")) {\n\t\t\t\t\tint sum=stk.peek();stk.pop();\n\t\t\t\t\tsum=stk.peek()-sum;stk.pop();\n\t\t\t\t\tstk.push(sum);\n\t\t\t\t}\n\t\t\t\telse if(obj.equals(\"*\")) {\n\t\t\t\t\tint sum=1;\n\t\t\t\t\tfor(int i=0;i<2;i++) {\n\t\t\t\t\t\tsum*=stk.peek();\n\t\t\t\t\t\tstk.pop();\n\t\t\t\t\t}\n\t\t\t\t\tstk.push(sum);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t}",
"String obj=cin.next();",
"obj",
"cin.next()",
"cin.next",
"cin",
"Pattern p=Pattern.compile(\"^[0-9]*$\");",
"p",
"Pattern.compile(\"^[0-9]*$\")",
"Pattern.compile",
"Pattern",
"\"^[0-9]*$\"",
"Matcher m=p.matcher(obj);",
"m",
"p.matcher(obj)",
"p.matcher",
"p",
"obj",
"if(m.find()) {\n\t\t\t\tstk.push(Integer.valueOf(obj));\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif(obj.equals(\"+\")) {\n\t\t\t\t\tint sum=0;\n\t\t\t\t\tfor(int i=0;i<2;i++) {\n\t\t\t\t\t\tsum+=stk.peek();\n\t\t\t\t\t\tstk.pop();\n\t\t\t\t\t}\n\t\t\t\t\tstk.push(sum);\n\t\t\t\t}\n\t\t\t\telse if(obj.equals(\"-\")) {\n\t\t\t\t\tint sum=stk.peek();stk.pop();\n\t\t\t\t\tsum=stk.peek()-sum;stk.pop();\n\t\t\t\t\tstk.push(sum);\n\t\t\t\t}\n\t\t\t\telse if(obj.equals(\"*\")) {\n\t\t\t\t\tint sum=1;\n\t\t\t\t\tfor(int i=0;i<2;i++) {\n\t\t\t\t\t\tsum*=stk.peek();\n\t\t\t\t\t\tstk.pop();\n\t\t\t\t\t}\n\t\t\t\t\tstk.push(sum);\n\t\t\t\t}\n\t\t\t}",
"m.find()",
"m.find",
"m",
"{\n\t\t\t\tstk.push(Integer.valueOf(obj));\n\t\t\t}",
"stk.push(Integer.valueOf(obj))",
"stk.push",
"stk",
"Integer.valueOf(obj)",
"Integer.valueOf",
"Integer",
"obj",
"{\n\t\t\t\tif(obj.equals(\"+\")) {\n\t\t\t\t\tint sum=0;\n\t\t\t\t\tfor(int i=0;i<2;i++) {\n\t\t\t\t\t\tsum+=stk.peek();\n\t\t\t\t\t\tstk.pop();\n\t\t\t\t\t}\n\t\t\t\t\tstk.push(sum);\n\t\t\t\t}\n\t\t\t\telse if(obj.equals(\"-\")) {\n\t\t\t\t\tint sum=stk.peek();stk.pop();\n\t\t\t\t\tsum=stk.peek()-sum;stk.pop();\n\t\t\t\t\tstk.push(sum);\n\t\t\t\t}\n\t\t\t\telse if(obj.equals(\"*\")) {\n\t\t\t\t\tint sum=1;\n\t\t\t\t\tfor(int i=0;i<2;i++) {\n\t\t\t\t\t\tsum*=stk.peek();\n\t\t\t\t\t\tstk.pop();\n\t\t\t\t\t}\n\t\t\t\t\tstk.push(sum);\n\t\t\t\t}\n\t\t\t}",
"if(obj.equals(\"+\")) {\n\t\t\t\t\tint sum=0;\n\t\t\t\t\tfor(int i=0;i<2;i++) {\n\t\t\t\t\t\tsum+=stk.peek();\n\t\t\t\t\t\tstk.pop();\n\t\t\t\t\t}\n\t\t\t\t\tstk.push(sum);\n\t\t\t\t}\n\t\t\t\telse if(obj.equals(\"-\")) {\n\t\t\t\t\tint sum=stk.peek();stk.pop();\n\t\t\t\t\tsum=stk.peek()-sum;stk.pop();\n\t\t\t\t\tstk.push(sum);\n\t\t\t\t}\n\t\t\t\telse if(obj.equals(\"*\")) {\n\t\t\t\t\tint sum=1;\n\t\t\t\t\tfor(int i=0;i<2;i++) {\n\t\t\t\t\t\tsum*=stk.peek();\n\t\t\t\t\t\tstk.pop();\n\t\t\t\t\t}\n\t\t\t\t\tstk.push(sum);\n\t\t\t\t}",
"obj.equals(\"+\")",
"obj.equals",
"obj",
"\"+\"",
"{\n\t\t\t\t\tint sum=0;\n\t\t\t\t\tfor(int i=0;i<2;i++) {\n\t\t\t\t\t\tsum+=stk.peek();\n\t\t\t\t\t\tstk.pop();\n\t\t\t\t\t}\n\t\t\t\t\tstk.push(sum);\n\t\t\t\t}",
"int sum=0;",
"sum",
"0",
"for(int i=0;i<2;i++) {\n\t\t\t\t\t\tsum+=stk.peek();\n\t\t\t\t\t\tstk.pop();\n\t\t\t\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<2",
"i",
"2",
"i++",
"i++",
"i",
"{\n\t\t\t\t\t\tsum+=stk.peek();\n\t\t\t\t\t\tstk.pop();\n\t\t\t\t\t}",
"{\n\t\t\t\t\t\tsum+=stk.peek();\n\t\t\t\t\t\tstk.pop();\n\t\t\t\t\t}",
"sum+=stk.peek()",
"sum",
"stk.peek()",
"stk.peek",
"stk",
"stk.pop()",
"stk.pop",
"stk",
"stk.push(sum)",
"stk.push",
"stk",
"sum",
"if(obj.equals(\"-\")) {\n\t\t\t\t\tint sum=stk.peek();stk.pop();\n\t\t\t\t\tsum=stk.peek()-sum;stk.pop();\n\t\t\t\t\tstk.push(sum);\n\t\t\t\t}\n\t\t\t\telse if(obj.equals(\"*\")) {\n\t\t\t\t\tint sum=1;\n\t\t\t\t\tfor(int i=0;i<2;i++) {\n\t\t\t\t\t\tsum*=stk.peek();\n\t\t\t\t\t\tstk.pop();\n\t\t\t\t\t}\n\t\t\t\t\tstk.push(sum);\n\t\t\t\t}",
"obj.equals(\"-\")",
"obj.equals",
"obj",
"\"-\"",
"{\n\t\t\t\t\tint sum=stk.peek();stk.pop();\n\t\t\t\t\tsum=stk.peek()-sum;stk.pop();\n\t\t\t\t\tstk.push(sum);\n\t\t\t\t}",
"int sum=stk.peek();",
"sum",
"stk.peek()",
"stk.peek",
"stk",
"stk.pop()",
"stk.pop",
"stk",
"sum=stk.peek()-sum",
"sum",
"stk.peek()-sum",
"stk.peek()",
"stk.peek",
"stk",
"sum",
"stk.pop()",
"stk.pop",
"stk",
"stk.push(sum)",
"stk.push",
"stk",
"sum",
"if(obj.equals(\"*\")) {\n\t\t\t\t\tint sum=1;\n\t\t\t\t\tfor(int i=0;i<2;i++) {\n\t\t\t\t\t\tsum*=stk.peek();\n\t\t\t\t\t\tstk.pop();\n\t\t\t\t\t}\n\t\t\t\t\tstk.push(sum);\n\t\t\t\t}",
"obj.equals(\"*\")",
"obj.equals",
"obj",
"\"*\"",
"{\n\t\t\t\t\tint sum=1;\n\t\t\t\t\tfor(int i=0;i<2;i++) {\n\t\t\t\t\t\tsum*=stk.peek();\n\t\t\t\t\t\tstk.pop();\n\t\t\t\t\t}\n\t\t\t\t\tstk.push(sum);\n\t\t\t\t}",
"int sum=1;",
"sum",
"1",
"for(int i=0;i<2;i++) {\n\t\t\t\t\t\tsum*=stk.peek();\n\t\t\t\t\t\tstk.pop();\n\t\t\t\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<2",
"i",
"2",
"i++",
"i++",
"i",
"{\n\t\t\t\t\t\tsum*=stk.peek();\n\t\t\t\t\t\tstk.pop();\n\t\t\t\t\t}",
"{\n\t\t\t\t\t\tsum*=stk.peek();\n\t\t\t\t\t\tstk.pop();\n\t\t\t\t\t}",
"sum*=stk.peek()",
"sum",
"stk.peek()",
"stk.peek",
"stk",
"stk.pop()",
"stk.pop",
"stk",
"stk.push(sum)",
"stk.push",
"stk",
"sum",
"System.out.println(stk.peek())",
"System.out.println",
"System.out",
"System",
"System.out",
"stk.peek()",
"stk.peek",
"stk",
"String[] args",
"args",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner cin=new Scanner(System.in);\n\t\tStack<Integer>stk=new Stack<>();\n\t\t\n\t\twhile(cin.hasNext()) {\n\t\t\tString obj=cin.next();\n\t\t\t\n\t\t\tPattern p=Pattern.compile(\"^[0-9]*$\");\n\t\t\tMatcher m=p.matcher(obj);\n\t\t\tif(m.find()) {\n\t\t\t\tstk.push(Integer.valueOf(obj));\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif(obj.equals(\"+\")) {\n\t\t\t\t\tint sum=0;\n\t\t\t\t\tfor(int i=0;i<2;i++) {\n\t\t\t\t\t\tsum+=stk.peek();\n\t\t\t\t\t\tstk.pop();\n\t\t\t\t\t}\n\t\t\t\t\tstk.push(sum);\n\t\t\t\t}\n\t\t\t\telse if(obj.equals(\"-\")) {\n\t\t\t\t\tint sum=stk.peek();stk.pop();\n\t\t\t\t\tsum=stk.peek()-sum;stk.pop();\n\t\t\t\t\tstk.push(sum);\n\t\t\t\t}\n\t\t\t\telse if(obj.equals(\"*\")) {\n\t\t\t\t\tint sum=1;\n\t\t\t\t\tfor(int i=0;i<2;i++) {\n\t\t\t\t\t\tsum*=stk.peek();\n\t\t\t\t\t\tstk.pop();\n\t\t\t\t\t}\n\t\t\t\t\tstk.push(sum);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t}\n\t\tSystem.out.println(stk.peek());\n\t\t\n\t}\n\n}",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner cin=new Scanner(System.in);\n\t\tStack<Integer>stk=new Stack<>();\n\t\t\n\t\twhile(cin.hasNext()) {\n\t\t\tString obj=cin.next();\n\t\t\t\n\t\t\tPattern p=Pattern.compile(\"^[0-9]*$\");\n\t\t\tMatcher m=p.matcher(obj);\n\t\t\tif(m.find()) {\n\t\t\t\tstk.push(Integer.valueOf(obj));\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif(obj.equals(\"+\")) {\n\t\t\t\t\tint sum=0;\n\t\t\t\t\tfor(int i=0;i<2;i++) {\n\t\t\t\t\t\tsum+=stk.peek();\n\t\t\t\t\t\tstk.pop();\n\t\t\t\t\t}\n\t\t\t\t\tstk.push(sum);\n\t\t\t\t}\n\t\t\t\telse if(obj.equals(\"-\")) {\n\t\t\t\t\tint sum=stk.peek();stk.pop();\n\t\t\t\t\tsum=stk.peek()-sum;stk.pop();\n\t\t\t\t\tstk.push(sum);\n\t\t\t\t}\n\t\t\t\telse if(obj.equals(\"*\")) {\n\t\t\t\t\tint sum=1;\n\t\t\t\t\tfor(int i=0;i<2;i++) {\n\t\t\t\t\t\tsum*=stk.peek();\n\t\t\t\t\t\tstk.pop();\n\t\t\t\t\t}\n\t\t\t\t\tstk.push(sum);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t}\n\t\tSystem.out.println(stk.peek());\n\t\t\n\t}\n\n}",
"Main"
] | import java.util.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class Main {
public static void main(String[] args) {
Scanner cin=new Scanner(System.in);
Stack<Integer>stk=new Stack<>();
while(cin.hasNext()) {
String obj=cin.next();
Pattern p=Pattern.compile("^[0-9]*$");
Matcher m=p.matcher(obj);
if(m.find()) {
stk.push(Integer.valueOf(obj));
}
else {
if(obj.equals("+")) {
int sum=0;
for(int i=0;i<2;i++) {
sum+=stk.peek();
stk.pop();
}
stk.push(sum);
}
else if(obj.equals("-")) {
int sum=stk.peek();stk.pop();
sum=stk.peek()-sum;stk.pop();
stk.push(sum);
}
else if(obj.equals("*")) {
int sum=1;
for(int i=0;i<2;i++) {
sum*=stk.peek();
stk.pop();
}
stk.push(sum);
}
}
}
System.out.println(stk.peek());
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
41,
13,
17,
41,
13,
20,
12,
13,
30,
4,
18,
13,
13,
40,
13,
23,
13,
12,
13,
30,
40,
13,
29,
4,
18,
13,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
4,
18,
13,
17,
28,
13,
13,
30,
30,
14,
4,
18,
13,
17,
30,
4,
13,
4,
18,
13,
13,
30,
41,
13,
4,
13,
41,
13,
4,
13,
14,
4,
18,
17,
13,
4,
13,
2,
13,
13,
14,
4,
18,
17,
13,
4,
13,
2,
13,
13,
14,
4,
18,
17,
13,
4,
13,
2,
13,
13,
4,
18,
13,
4,
18,
18,
13,
13,
4,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
122,
11
],
[
122,
12
],
[
12,
13
],
[
12,
14
],
[
122,
15
],
[
15,
16
],
[
15,
17
],
[
122,
18
],
[
18,
19
],
[
18,
20
],
[
20,
21
],
[
21,
22
],
[
22,
23
],
[
21,
24
],
[
20,
25
],
[
25,
26
],
[
18,
27
],
[
27,
28
],
[
122,
29
],
[
29,
30
],
[
29,
31
],
[
31,
32
],
[
32,
33
],
[
31,
34
],
[
34,
35
],
[
35,
36
],
[
36,
37
],
[
35,
38
],
[
122,
39
],
[
39,
40
],
[
39,
41
],
[
41,
42
],
[
42,
43
],
[
42,
44
],
[
41,
45
],
[
45,
46
],
[
45,
47
],
[
47,
48
],
[
48,
49
],
[
49,
50
],
[
50,
51
],
[
47,
52
],
[
41,
53
],
[
53,
54
],
[
53,
55
],
[
53,
56
],
[
57,
57
],
[
57,
58
],
[
58,
59
],
[
59,
60
],
[
60,
61
],
[
59,
62
],
[
58,
63
],
[
63,
64
],
[
64,
65
],
[
64,
66
],
[
66,
67
],
[
67,
68
],
[
66,
69
],
[
58,
70
],
[
70,
71
],
[
71,
72
],
[
71,
73
],
[
73,
74
],
[
70,
75
],
[
75,
76
],
[
75,
77
],
[
77,
78
],
[
70,
79
],
[
79,
80
],
[
80,
81
],
[
81,
82
],
[
80,
83
],
[
79,
84
],
[
84,
85
],
[
84,
86
],
[
86,
87
],
[
86,
88
],
[
79,
89
],
[
89,
90
],
[
90,
91
],
[
91,
92
],
[
90,
93
],
[
89,
94
],
[
94,
95
],
[
94,
96
],
[
96,
97
],
[
96,
98
],
[
89,
99
],
[
99,
100
],
[
100,
101
],
[
101,
102
],
[
100,
103
],
[
99,
104
],
[
104,
105
],
[
104,
106
],
[
106,
107
],
[
106,
108
],
[
41,
109
],
[
109,
110
],
[
110,
111
],
[
41,
112
],
[
112,
113
],
[
113,
114
],
[
114,
115
],
[
114,
116
],
[
112,
117
],
[
117,
118
],
[
39,
119
],
[
119,
120
],
[
0,
121
],
[
121,
122
],
[
121,
123
]
] | [
"\n\nimport java.util.ArrayList;\nimport java.util.List;\nimport java.util.Scanner;\n\npublic class Main {\n\t\n\tpublic static int top = 0;\n\tpublic static List<Integer> stack = new ArrayList<Integer>();\n\n\tpublic static void push(int x) {\n\t\tstack.add(x);\n\t\ttop ++;\n\t}\n\t\n\tpublic static int pop() {\n\t\ttop --;\n\t\treturn stack.remove(top);\n\t}\n\t\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tString[] inputs = sc.nextLine().split(\" \");\n\t\tfor (String in : inputs) {\n\t\t\tif (in.matches(\"[0-9]+\")) {\n\t\t\t\tpush(Integer.parseInt(in));\n\t\t\t} else {\n\t\t\t\tint b = pop();\n\t\t\t\tint a = pop();\n\t\t\t\tif (\"+\".equals(in)) \n\t\t\t\t\tpush(a+b);\n\t\t\t\telse if (\"-\".equals(in)) \n\t\t\t\t\tpush(a-b);\n\t\t\t\telse if (\"*\".equals(in)) \n\t\t\t\t\tpush(a*b);\n\t\t\t}\n\t\t}\n\t\tsc.close();\n\t\t\n\t\tSystem.out.println(pop());\n\t}\n\n}\n",
"import java.util.ArrayList;",
"ArrayList",
"java.util",
"import java.util.List;",
"List",
"java.util",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\t\n\tpublic static int top = 0;\n\tpublic static List<Integer> stack = new ArrayList<Integer>();\n\n\tpublic static void push(int x) {\n\t\tstack.add(x);\n\t\ttop ++;\n\t}\n\t\n\tpublic static int pop() {\n\t\ttop --;\n\t\treturn stack.remove(top);\n\t}\n\t\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tString[] inputs = sc.nextLine().split(\" \");\n\t\tfor (String in : inputs) {\n\t\t\tif (in.matches(\"[0-9]+\")) {\n\t\t\t\tpush(Integer.parseInt(in));\n\t\t\t} else {\n\t\t\t\tint b = pop();\n\t\t\t\tint a = pop();\n\t\t\t\tif (\"+\".equals(in)) \n\t\t\t\t\tpush(a+b);\n\t\t\t\telse if (\"-\".equals(in)) \n\t\t\t\t\tpush(a-b);\n\t\t\t\telse if (\"*\".equals(in)) \n\t\t\t\t\tpush(a*b);\n\t\t\t}\n\t\t}\n\t\tsc.close();\n\t\t\n\t\tSystem.out.println(pop());\n\t}\n\n}",
"Main",
"public static int top = 0;",
"top",
"0",
"public static List<Integer> stack = new ArrayList<Integer>();",
"stack",
"new ArrayList<Integer>()",
"public static void push(int x) {\n\t\tstack.add(x);\n\t\ttop ++;\n\t}",
"push",
"{\n\t\tstack.add(x);\n\t\ttop ++;\n\t}",
"stack.add(x)",
"stack.add",
"stack",
"x",
"top ++",
"top",
"int x",
"x",
"public static int pop() {\n\t\ttop --;\n\t\treturn stack.remove(top);\n\t}",
"pop",
"{\n\t\ttop --;\n\t\treturn stack.remove(top);\n\t}",
"top --",
"top",
"return stack.remove(top);",
"stack.remove(top)",
"stack.remove",
"stack",
"top",
"public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tString[] inputs = sc.nextLine().split(\" \");\n\t\tfor (String in : inputs) {\n\t\t\tif (in.matches(\"[0-9]+\")) {\n\t\t\t\tpush(Integer.parseInt(in));\n\t\t\t} else {\n\t\t\t\tint b = pop();\n\t\t\t\tint a = pop();\n\t\t\t\tif (\"+\".equals(in)) \n\t\t\t\t\tpush(a+b);\n\t\t\t\telse if (\"-\".equals(in)) \n\t\t\t\t\tpush(a-b);\n\t\t\t\telse if (\"*\".equals(in)) \n\t\t\t\t\tpush(a*b);\n\t\t\t}\n\t\t}\n\t\tsc.close();\n\t\t\n\t\tSystem.out.println(pop());\n\t}",
"main",
"{\n\t\tScanner sc = new Scanner(System.in);\n\t\tString[] inputs = sc.nextLine().split(\" \");\n\t\tfor (String in : inputs) {\n\t\t\tif (in.matches(\"[0-9]+\")) {\n\t\t\t\tpush(Integer.parseInt(in));\n\t\t\t} else {\n\t\t\t\tint b = pop();\n\t\t\t\tint a = pop();\n\t\t\t\tif (\"+\".equals(in)) \n\t\t\t\t\tpush(a+b);\n\t\t\t\telse if (\"-\".equals(in)) \n\t\t\t\t\tpush(a-b);\n\t\t\t\telse if (\"*\".equals(in)) \n\t\t\t\t\tpush(a*b);\n\t\t\t}\n\t\t}\n\t\tsc.close();\n\t\t\n\t\tSystem.out.println(pop());\n\t}",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"String[] inputs = sc.nextLine().split(\" \");",
"inputs",
"sc.nextLine().split(\" \")",
"sc.nextLine().split",
"sc.nextLine()",
"sc.nextLine",
"sc",
"\" \"",
"for (String in : inputs) {\n\t\t\tif (in.matches(\"[0-9]+\")) {\n\t\t\t\tpush(Integer.parseInt(in));\n\t\t\t} else {\n\t\t\t\tint b = pop();\n\t\t\t\tint a = pop();\n\t\t\t\tif (\"+\".equals(in)) \n\t\t\t\t\tpush(a+b);\n\t\t\t\telse if (\"-\".equals(in)) \n\t\t\t\t\tpush(a-b);\n\t\t\t\telse if (\"*\".equals(in)) \n\t\t\t\t\tpush(a*b);\n\t\t\t}\n\t\t}",
"String in",
"inputs",
"{\n\t\t\tif (in.matches(\"[0-9]+\")) {\n\t\t\t\tpush(Integer.parseInt(in));\n\t\t\t} else {\n\t\t\t\tint b = pop();\n\t\t\t\tint a = pop();\n\t\t\t\tif (\"+\".equals(in)) \n\t\t\t\t\tpush(a+b);\n\t\t\t\telse if (\"-\".equals(in)) \n\t\t\t\t\tpush(a-b);\n\t\t\t\telse if (\"*\".equals(in)) \n\t\t\t\t\tpush(a*b);\n\t\t\t}\n\t\t}",
"{\n\t\t\tif (in.matches(\"[0-9]+\")) {\n\t\t\t\tpush(Integer.parseInt(in));\n\t\t\t} else {\n\t\t\t\tint b = pop();\n\t\t\t\tint a = pop();\n\t\t\t\tif (\"+\".equals(in)) \n\t\t\t\t\tpush(a+b);\n\t\t\t\telse if (\"-\".equals(in)) \n\t\t\t\t\tpush(a-b);\n\t\t\t\telse if (\"*\".equals(in)) \n\t\t\t\t\tpush(a*b);\n\t\t\t}\n\t\t}",
"if (in.matches(\"[0-9]+\")) {\n\t\t\t\tpush(Integer.parseInt(in));\n\t\t\t} else {\n\t\t\t\tint b = pop();\n\t\t\t\tint a = pop();\n\t\t\t\tif (\"+\".equals(in)) \n\t\t\t\t\tpush(a+b);\n\t\t\t\telse if (\"-\".equals(in)) \n\t\t\t\t\tpush(a-b);\n\t\t\t\telse if (\"*\".equals(in)) \n\t\t\t\t\tpush(a*b);\n\t\t\t}",
"in.matches(\"[0-9]+\")",
"in.matches",
"in",
"\"[0-9]+\"",
"{\n\t\t\t\tpush(Integer.parseInt(in));\n\t\t\t}",
"push(Integer.parseInt(in))",
"push",
"Integer.parseInt(in)",
"Integer.parseInt",
"Integer",
"in",
"{\n\t\t\t\tint b = pop();\n\t\t\t\tint a = pop();\n\t\t\t\tif (\"+\".equals(in)) \n\t\t\t\t\tpush(a+b);\n\t\t\t\telse if (\"-\".equals(in)) \n\t\t\t\t\tpush(a-b);\n\t\t\t\telse if (\"*\".equals(in)) \n\t\t\t\t\tpush(a*b);\n\t\t\t}",
"int b = pop();",
"b",
"pop()",
"pop",
"int a = pop();",
"a",
"pop()",
"pop",
"if (\"+\".equals(in)) \n\t\t\t\t\tpush(a+b);\n\t\t\t\telse if (\"-\".equals(in)) \n\t\t\t\t\tpush(a-b);\n\t\t\t\telse if (\"*\".equals(in)) \n\t\t\t\t\tpush(a*b);",
"\"+\".equals(in)",
"\"+\".equals",
"\"+\"",
"in",
"push(a+b)",
"push",
"a+b",
"a",
"b",
"if (\"-\".equals(in)) \n\t\t\t\t\tpush(a-b);\n\t\t\t\telse if (\"*\".equals(in)) \n\t\t\t\t\tpush(a*b);",
"\"-\".equals(in)",
"\"-\".equals",
"\"-\"",
"in",
"push(a-b)",
"push",
"a-b",
"a",
"b",
"if (\"*\".equals(in)) \n\t\t\t\t\tpush(a*b);",
"\"*\".equals(in)",
"\"*\".equals",
"\"*\"",
"in",
"push(a*b)",
"push",
"a*b",
"a",
"b",
"sc.close()",
"sc.close",
"sc",
"System.out.println(pop())",
"System.out.println",
"System.out",
"System",
"System.out",
"pop()",
"pop",
"String[] args",
"args",
"public class Main {\n\t\n\tpublic static int top = 0;\n\tpublic static List<Integer> stack = new ArrayList<Integer>();\n\n\tpublic static void push(int x) {\n\t\tstack.add(x);\n\t\ttop ++;\n\t}\n\t\n\tpublic static int pop() {\n\t\ttop --;\n\t\treturn stack.remove(top);\n\t}\n\t\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tString[] inputs = sc.nextLine().split(\" \");\n\t\tfor (String in : inputs) {\n\t\t\tif (in.matches(\"[0-9]+\")) {\n\t\t\t\tpush(Integer.parseInt(in));\n\t\t\t} else {\n\t\t\t\tint b = pop();\n\t\t\t\tint a = pop();\n\t\t\t\tif (\"+\".equals(in)) \n\t\t\t\t\tpush(a+b);\n\t\t\t\telse if (\"-\".equals(in)) \n\t\t\t\t\tpush(a-b);\n\t\t\t\telse if (\"*\".equals(in)) \n\t\t\t\t\tpush(a*b);\n\t\t\t}\n\t\t}\n\t\tsc.close();\n\t\t\n\t\tSystem.out.println(pop());\n\t}\n\n}",
"public class Main {\n\t\n\tpublic static int top = 0;\n\tpublic static List<Integer> stack = new ArrayList<Integer>();\n\n\tpublic static void push(int x) {\n\t\tstack.add(x);\n\t\ttop ++;\n\t}\n\t\n\tpublic static int pop() {\n\t\ttop --;\n\t\treturn stack.remove(top);\n\t}\n\t\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tString[] inputs = sc.nextLine().split(\" \");\n\t\tfor (String in : inputs) {\n\t\t\tif (in.matches(\"[0-9]+\")) {\n\t\t\t\tpush(Integer.parseInt(in));\n\t\t\t} else {\n\t\t\t\tint b = pop();\n\t\t\t\tint a = pop();\n\t\t\t\tif (\"+\".equals(in)) \n\t\t\t\t\tpush(a+b);\n\t\t\t\telse if (\"-\".equals(in)) \n\t\t\t\t\tpush(a-b);\n\t\t\t\telse if (\"*\".equals(in)) \n\t\t\t\t\tpush(a*b);\n\t\t\t}\n\t\t}\n\t\tsc.close();\n\t\t\n\t\tSystem.out.println(pop());\n\t}\n\n}",
"Main"
] |
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
public class Main {
public static int top = 0;
public static List<Integer> stack = new ArrayList<Integer>();
public static void push(int x) {
stack.add(x);
top ++;
}
public static int pop() {
top --;
return stack.remove(top);
}
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String[] inputs = sc.nextLine().split(" ");
for (String in : inputs) {
if (in.matches("[0-9]+")) {
push(Integer.parseInt(in));
} else {
int b = pop();
int a = pop();
if ("+".equals(in))
push(a+b);
else if ("-".equals(in))
push(a-b);
else if ("*".equals(in))
push(a*b);
}
}
sc.close();
System.out.println(pop());
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
4,
18,
20,
23,
13,
6,
13,
41,
13,
12,
13,
30,
0,
18,
36,
13,
13,
23,
13,
12,
13,
30,
41,
13,
20,
18,
13,
13,
11,
1,
41,
13,
17,
41,
13,
18,
13,
13,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
18,
13,
13,
14,
4,
18,
13,
17,
30,
0,
18,
13,
13,
20,
14,
4,
18,
13,
17,
30,
0,
18,
13,
13,
20,
14,
4,
18,
13,
17,
30,
0,
18,
13,
13,
20,
14,
4,
18,
13,
17,
30,
0,
18,
13,
13,
20,
30,
0,
18,
13,
13,
20,
41,
13,
20,
17,
41,
13,
40,
17,
28,
13,
13,
30,
30,
14,
2,
13,
13,
30,
41,
13,
18,
13,
40,
13,
41,
13,
18,
13,
40,
13,
0,
18,
13,
40,
13,
20,
30,
0,
18,
13,
40,
13,
13,
4,
18,
18,
13,
13,
4,
18,
18,
13,
13,
6,
13,
6,
13,
41,
13,
12,
13,
30,
0,
13,
13,
23,
13,
12,
13,
30,
29,
13,
13,
6,
13,
12,
13,
23,
13,
23,
13,
6,
13,
13,
13,
6,
13,
12,
13,
30,
29,
2,
4,
18,
13,
4,
18,
13,
23,
13,
23,
13,
13,
6,
13,
12,
13,
30,
29,
2,
4,
18,
13,
4,
18,
13,
23,
13,
23,
13,
13,
6,
13,
12,
13,
30,
29,
2,
4,
18,
13,
4,
18,
13,
23,
13,
23,
13,
13,
6,
13,
12,
13,
30,
29,
2,
4,
18,
13,
4,
18,
13,
23,
13,
23,
13,
13,
6,
13,
41,
13,
41,
13,
41,
13,
12,
13,
30,
0,
13,
20,
12,
13,
30,
0,
13,
20,
23,
13,
12,
13,
30,
14,
2,
2,
13,
17,
2,
13,
18,
13,
13,
30,
0,
13,
4,
18,
4,
18,
4,
18,
13,
17,
0,
13,
17,
29,
18,
13,
40,
13,
12,
13,
30,
29,
4,
13,
12,
13,
30,
0,
13,
17,
0,
13,
17,
29,
4,
18,
13,
12,
13,
30,
29,
4,
18,
13,
4,
13,
12,
13,
30,
29,
4,
18,
13,
4,
13,
12,
13,
30,
29,
4,
18,
13,
4,
13,
12,
13,
30,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
0,
18,
13,
13,
4,
13,
29,
13,
23,
13,
12,
13,
30,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
0,
18,
13,
13,
4,
13,
29,
13,
23,
13,
12,
13,
30,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
0,
18,
13,
13,
4,
13,
29,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
10,
11
],
[
10,
12
],
[
0,
13
],
[
13,
14
],
[
13,
15
],
[
0,
16
],
[
16,
17
],
[
16,
18
],
[
0,
19
],
[
19,
20
],
[
19,
21
],
[
0,
22
],
[
22,
23
],
[
22,
24
],
[
0,
25
],
[
25,
26
],
[
25,
27
],
[
0,
28
],
[
482,
29
],
[
482,
30
],
[
30,
31
],
[
30,
32
],
[
32,
33
],
[
33,
34
],
[
33,
35
],
[
32,
36
],
[
36,
37
],
[
37,
38
],
[
30,
39
],
[
39,
40
],
[
0,
41
],
[
41,
42
],
[
41,
43
],
[
43,
44
],
[
41,
45
],
[
45,
46
],
[
45,
47
],
[
47,
48
],
[
48,
49
],
[
49,
50
],
[
49,
51
],
[
48,
52
],
[
45,
53
],
[
53,
54
],
[
41,
55
],
[
55,
56
],
[
55,
57
],
[
57,
58
],
[
58,
59
],
[
58,
60
],
[
61,
62
],
[
61,
63
],
[
57,
64
],
[
64,
65
],
[
65,
66
],
[
66,
67
],
[
66,
68
],
[
65,
69
],
[
69,
70
],
[
69,
71
],
[
71,
72
],
[
71,
73
],
[
64,
74
],
[
74,
75
],
[
74,
76
],
[
64,
77
],
[
77,
78
],
[
78,
79
],
[
64,
80
],
[
81,
81
],
[
81,
82
],
[
82,
83
],
[
82,
84
],
[
84,
85
],
[
84,
86
],
[
81,
87
],
[
87,
88
],
[
88,
89
],
[
89,
90
],
[
88,
91
],
[
87,
92
],
[
92,
93
],
[
93,
94
],
[
94,
95
],
[
94,
96
],
[
93,
97
],
[
87,
98
],
[
98,
99
],
[
99,
100
],
[
100,
101
],
[
99,
102
],
[
98,
103
],
[
103,
104
],
[
104,
105
],
[
105,
106
],
[
105,
107
],
[
104,
108
],
[
98,
109
],
[
109,
110
],
[
110,
111
],
[
111,
112
],
[
110,
113
],
[
109,
114
],
[
114,
115
],
[
115,
116
],
[
116,
117
],
[
116,
118
],
[
115,
119
],
[
109,
120
],
[
120,
121
],
[
121,
122
],
[
122,
123
],
[
121,
124
],
[
120,
125
],
[
125,
126
],
[
126,
127
],
[
127,
128
],
[
127,
129
],
[
126,
130
],
[
120,
131
],
[
131,
132
],
[
132,
133
],
[
133,
134
],
[
133,
135
],
[
132,
136
],
[
57,
137
],
[
137,
138
],
[
137,
139
],
[
57,
141
],
[
141,
142
],
[
141,
143
],
[
143,
144
],
[
57,
145
],
[
145,
146
],
[
145,
147
],
[
145,
148
],
[
149,
149
],
[
149,
150
],
[
150,
151
],
[
151,
152
],
[
151,
153
],
[
150,
154
],
[
154,
155
],
[
155,
156
],
[
155,
157
],
[
157,
158
],
[
157,
159
],
[
159,
160
],
[
154,
161
],
[
161,
162
],
[
161,
163
],
[
163,
164
],
[
163,
165
],
[
165,
166
],
[
154,
167
],
[
167,
168
],
[
168,
169
],
[
168,
170
],
[
170,
171
],
[
167,
172
],
[
150,
173
],
[
173,
174
],
[
174,
175
],
[
175,
176
],
[
175,
177
],
[
177,
178
],
[
174,
179
],
[
57,
180
],
[
180,
181
],
[
181,
182
],
[
182,
183
],
[
182,
184
],
[
180,
185
],
[
185,
186
],
[
186,
187
],
[
187,
188
],
[
187,
189
],
[
0,
190
],
[
190,
191
],
[
0,
192
],
[
192,
193
],
[
192,
194
],
[
194,
195
],
[
192,
196
],
[
196,
197
],
[
196,
198
],
[
198,
199
],
[
199,
200
],
[
199,
201
],
[
196,
202
],
[
202,
203
],
[
192,
204
],
[
204,
205
],
[
204,
206
],
[
206,
207
],
[
207,
208
],
[
192,
209
],
[
0,
210
],
[
210,
211
],
[
210,
212
],
[
212,
213
],
[
212,
214
],
[
214,
215
],
[
212,
216
],
[
216,
217
],
[
0,
218
],
[
218,
219
],
[
218,
220
],
[
218,
221
],
[
0,
222
],
[
222,
223
],
[
222,
224
],
[
224,
225
],
[
224,
226
],
[
226,
227
],
[
227,
228
],
[
228,
229
],
[
229,
230
],
[
230,
231
],
[
228,
232
],
[
232,
233
],
[
233,
234
],
[
224,
235
],
[
235,
236
],
[
224,
237
],
[
237,
238
],
[
222,
239
],
[
0,
240
],
[
240,
241
],
[
240,
242
],
[
242,
243
],
[
242,
244
],
[
244,
245
],
[
245,
246
],
[
246,
247
],
[
247,
248
],
[
248,
249
],
[
246,
250
],
[
250,
251
],
[
251,
252
],
[
242,
253
],
[
253,
254
],
[
242,
255
],
[
255,
256
],
[
240,
257
],
[
0,
258
],
[
258,
259
],
[
258,
260
],
[
260,
261
],
[
260,
262
],
[
262,
263
],
[
263,
264
],
[
264,
265
],
[
265,
266
],
[
266,
267
],
[
264,
268
],
[
268,
269
],
[
269,
270
],
[
260,
271
],
[
271,
272
],
[
260,
273
],
[
273,
274
],
[
258,
275
],
[
0,
276
],
[
276,
277
],
[
276,
278
],
[
278,
279
],
[
278,
280
],
[
280,
281
],
[
281,
282
],
[
282,
283
],
[
283,
284
],
[
284,
285
],
[
282,
286
],
[
286,
287
],
[
287,
288
],
[
278,
289
],
[
289,
290
],
[
278,
291
],
[
291,
292
],
[
276,
293
],
[
0,
294
],
[
294,
295
],
[
294,
296
],
[
296,
297
],
[
294,
298
],
[
298,
299
],
[
294,
300
],
[
300,
301
],
[
294,
302
],
[
302,
303
],
[
302,
304
],
[
304,
305
],
[
305,
306
],
[
305,
307
],
[
294,
308
],
[
308,
309
],
[
308,
310
],
[
310,
311
],
[
311,
312
],
[
311,
313
],
[
308,
314
],
[
314,
315
],
[
294,
316
],
[
316,
317
],
[
316,
318
],
[
318,
319
],
[
319,
320
],
[
320,
321
],
[
321,
322
],
[
321,
323
],
[
320,
324
],
[
324,
325
],
[
324,
326
],
[
326,
327
],
[
326,
328
],
[
319,
329
],
[
329,
330
],
[
330,
331
],
[
330,
332
],
[
332,
333
],
[
333,
334
],
[
334,
335
],
[
335,
336
],
[
336,
337
],
[
337,
338
],
[
332,
339
],
[
329,
340
],
[
340,
341
],
[
340,
342
],
[
318,
343
],
[
343,
344
],
[
344,
345
],
[
344,
346
],
[
346,
347
],
[
294,
348
],
[
348,
349
],
[
348,
350
],
[
350,
351
],
[
351,
352
],
[
352,
353
],
[
294,
354
],
[
354,
355
],
[
354,
356
],
[
356,
357
],
[
357,
358
],
[
357,
359
],
[
356,
360
],
[
360,
361
],
[
360,
362
],
[
356,
363
],
[
363,
364
],
[
364,
365
],
[
365,
366
],
[
294,
367
],
[
367,
368
],
[
367,
369
],
[
369,
370
],
[
370,
371
],
[
371,
372
],
[
372,
373
],
[
371,
374
],
[
374,
375
],
[
294,
376
],
[
376,
377
],
[
376,
378
],
[
378,
379
],
[
379,
380
],
[
380,
381
],
[
381,
382
],
[
380,
383
],
[
383,
384
],
[
294,
385
],
[
385,
386
],
[
385,
387
],
[
387,
388
],
[
388,
389
],
[
389,
390
],
[
390,
391
],
[
389,
392
],
[
392,
393
],
[
294,
394
],
[
394,
395
],
[
394,
396
],
[
396,
397
],
[
397,
398
],
[
397,
399
],
[
396,
401
],
[
401,
402
],
[
402,
403
],
[
403,
404
],
[
403,
405
],
[
401,
406
],
[
406,
407
],
[
406,
408
],
[
401,
409
],
[
409,
410
],
[
410,
411
],
[
401,
412
],
[
412,
413
],
[
413,
414
],
[
414,
415
],
[
414,
416
],
[
413,
417
],
[
417,
418
],
[
396,
419
],
[
419,
420
],
[
394,
421
],
[
421,
422
],
[
294,
423
],
[
423,
424
],
[
423,
425
],
[
425,
426
],
[
426,
427
],
[
426,
428
],
[
425,
430
],
[
430,
431
],
[
431,
432
],
[
432,
433
],
[
432,
434
],
[
430,
435
],
[
435,
436
],
[
435,
437
],
[
430,
438
],
[
438,
439
],
[
439,
440
],
[
430,
441
],
[
441,
442
],
[
442,
443
],
[
443,
444
],
[
443,
445
],
[
442,
446
],
[
446,
447
],
[
425,
448
],
[
448,
449
],
[
423,
450
],
[
450,
451
],
[
294,
452
],
[
452,
453
],
[
452,
454
],
[
454,
455
],
[
455,
456
],
[
455,
457
],
[
454,
459
],
[
459,
460
],
[
460,
461
],
[
461,
462
],
[
461,
463
],
[
459,
464
],
[
464,
465
],
[
464,
466
],
[
459,
467
],
[
467,
468
],
[
468,
469
],
[
459,
470
],
[
470,
471
],
[
471,
472
],
[
472,
473
],
[
472,
474
],
[
471,
475
],
[
475,
476
],
[
454,
477
],
[
477,
478
],
[
452,
479
],
[
479,
480
],
[
0,
481
],
[
481,
482
],
[
481,
483
]
] | [
"import java.io.BufferedReader;\nimport java.io.FileInputStream;\nimport java.io.FileNotFoundException;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\nimport java.util.ArrayList;\nimport java.util.Arrays;\nimport java.util.regex.Matcher;\nimport java.util.regex.Pattern;\n\npublic class Main {\n\tpublic static void main(String[] args) throws IOException {\n\t\tContestScanner scan = new ContestScanner();\n\n\t\t(new Solve(scan.readLine().split(\" \"))).solve();\n\t}\n}\nclass Solve {\n\tprivate final String[] tokens;\n\n\tpublic Solve(String[] tokens)\n\t{\n\t\tthis.tokens = tokens;\n\t}\n\n\tpublic void solve()\n\t{\n\t\tToken[] compiledTokens = new Token[tokens.length];\n\n\t\tfor(int i=0, l=tokens.length; i < l; i++)\n\t\t{\n\t\t\tString token = tokens[i];\n\n\t\t\tif(token.equals(\"+\"))\n\t\t\t{\n\t\t\t\tcompiledTokens[i] = new AddOperator();\n\t\t\t}\n\t\t\telse if(token.equals(\"-\"))\n\t\t\t{\n\t\t\t\tcompiledTokens[i] = new SubtractOperator();\n\t\t\t}\n\t\t\telse if(token.equals(\"*\"))\n\t\t\t{\n\t\t\t\tcompiledTokens[i] = new MultiplyOperator();\n\t\t\t}\n\t\t\telse if(token.equals(\"/\"))\n\t\t\t{\n\t\t\t\tcompiledTokens[i] = new DivideOperator();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tcompiledTokens[i] = new OperandToken(Integer.parseInt(token));\n\t\t\t}\n\t\t}\n\t\tToken[] stack = new Token[100];\n\n\t\tint stackTop = -1;\n\n\t\tfor(Token t: compiledTokens)\n\t\t{\n\t\t\tif(t instanceof IOperator)\n\t\t\t{\n\t\t\t\tOperandToken b = (OperandToken)stack[stackTop--];\n\t\t\t\tOperandToken a = (OperandToken)stack[stackTop--];\n\n\t\t\t\tstack[++stackTop] = new OperandToken(((IOperator)t).apply(a, b));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tstack[++stackTop] = t;\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.println(((OperandToken)stack[stackTop]).value());\n\t}\n}\nabstract class Token {\n\n}\nclass OperandToken extends Token {\n\tprivate final int operand;\n\n\tpublic OperandToken(int v)\n\t{\n\t\toperand = v;\n\t}\n\n\tpublic int value()\n\t{\n\t\treturn operand;\n\t}\n}\ninterface IOperator {\n\tpublic int apply(OperandToken a, OperandToken b);\n}\nabstract class OperatorToken extends Token implements IOperator {\n}\nclass AddOperator extends OperatorToken {\n\tpublic int apply(OperandToken a, OperandToken b)\n\t{\n\t\treturn a.value() + b.value();\n\t}\n}\nclass SubtractOperator extends OperatorToken {\n\tpublic int apply(OperandToken a, OperandToken b)\n\t{\n\t\treturn a.value() - b.value();\n\t}\n}\nclass MultiplyOperator extends OperatorToken {\n\tpublic int apply(OperandToken a, OperandToken b)\n\t{\n\t\treturn a.value() * b.value();\n\t}\n}\nclass DivideOperator extends OperatorToken {\n\tpublic int apply(OperandToken a, OperandToken b)\n\t{\n\t\treturn a.value() / b.value();\n\t}\n}\nclass ContestScanner {\n\tBufferedReader reader;\n\tString[] line;\n\tint index;\n\tpublic ContestScanner() {\n\t\treader = new BufferedReader(new InputStreamReader(System.in));\n\t}\n\n\tpublic ContestScanner(String filename) throws FileNotFoundException {\n\t\treader = new BufferedReader(new InputStreamReader(new FileInputStream(filename)));\n\t}\n\n\tpublic String nextToken() throws IOException {\n\t\tif(line == null || index >= line.length)\n\t\t{\n\t\t\tline = reader.readLine().trim().split(\" \");\n\t\t\tindex = 0;\n\t\t}\n\n\t\treturn line[index++];\n\t}\n\n\tpublic String next() throws IOException {\n\t\treturn nextToken();\n\t}\n\n\tpublic String readLine() throws IOException {\n\t\tline = null;\n\t\tindex = 0;\n\n\t\treturn reader.readLine();\n\t}\n\n\tpublic int nextInt() throws IOException, NumberFormatException {\n\t\treturn Integer.parseInt(nextToken());\n\t}\n\n\tpublic long nextLong() throws IOException, NumberFormatException {\n\t\treturn Long.parseLong(nextToken());\n\t}\n\n\tpublic double nextDouble() throws IOException, NumberFormatException {\n\t\treturn Double.parseDouble(nextToken());\n\t}\n\n\tpublic int[] nextIntArray(int N) throws IOException, NumberFormatException {\n\t\tint[] result = new int[N];\n\n\t\tfor(int i=0; i < N; i++) result[i] = nextInt();\n\n\t\treturn result;\n\t}\n\n\tpublic long[] nextLongArray(int N) throws IOException, NumberFormatException {\n\t\tlong[] result = new long[N];\n\n\t\tfor(int i=0; i < N; i++) result[i] = nextLong();\n\n\t\treturn result;\n\t}\n\n\tpublic double[] nexDoubleArray(int N) throws IOException, NumberFormatException {\n\t\tdouble[] result = new double[N];\n\n\t\tfor(int i=0; i < N; i++) result[i] = nextDouble();\n\n\t\treturn result;\n\t}\n}",
"import java.io.BufferedReader;",
"BufferedReader",
"java.io",
"import java.io.FileInputStream;",
"FileInputStream",
"java.io",
"import java.io.FileNotFoundException;",
"FileNotFoundException",
"java.io",
"import java.io.IOException;",
"IOException",
"java.io",
"import java.io.InputStreamReader;",
"InputStreamReader",
"java.io",
"import java.util.ArrayList;",
"ArrayList",
"java.util",
"import java.util.Arrays;",
"Arrays",
"java.util",
"import java.util.regex.Matcher;",
"Matcher",
"java.util.regex",
"import java.util.regex.Pattern;",
"Pattern",
"java.util.regex",
"public class Main {\n\tpublic static void main(String[] args) throws IOException {\n\t\tContestScanner scan = new ContestScanner();\n\n\t\t(new Solve(scan.readLine().split(\" \"))).solve();\n\t}\n}",
"Main",
"public static void main(String[] args) throws IOException {\n\t\tContestScanner scan = new ContestScanner();\n\n\t\t(new Solve(scan.readLine().split(\" \"))).solve();\n\t}",
"main",
"{\n\t\tContestScanner scan = new ContestScanner();\n\n\t\t(new Solve(scan.readLine().split(\" \"))).solve();\n\t}",
"ContestScanner scan = new ContestScanner();",
"scan",
"new ContestScanner()",
"(new Solve(scan.readLine().split(\" \"))).solve()",
"(new Solve(scan.readLine().split(\" \"))).solve",
"(new Solve(scan.readLine().split(\" \")))",
"String[] args",
"args",
"class Solve {\n\tprivate final String[] tokens;\n\n\tpublic Solve(String[] tokens)\n\t{\n\t\tthis.tokens = tokens;\n\t}\n\n\tpublic void solve()\n\t{\n\t\tToken[] compiledTokens = new Token[tokens.length];\n\n\t\tfor(int i=0, l=tokens.length; i < l; i++)\n\t\t{\n\t\t\tString token = tokens[i];\n\n\t\t\tif(token.equals(\"+\"))\n\t\t\t{\n\t\t\t\tcompiledTokens[i] = new AddOperator();\n\t\t\t}\n\t\t\telse if(token.equals(\"-\"))\n\t\t\t{\n\t\t\t\tcompiledTokens[i] = new SubtractOperator();\n\t\t\t}\n\t\t\telse if(token.equals(\"*\"))\n\t\t\t{\n\t\t\t\tcompiledTokens[i] = new MultiplyOperator();\n\t\t\t}\n\t\t\telse if(token.equals(\"/\"))\n\t\t\t{\n\t\t\t\tcompiledTokens[i] = new DivideOperator();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tcompiledTokens[i] = new OperandToken(Integer.parseInt(token));\n\t\t\t}\n\t\t}\n\t\tToken[] stack = new Token[100];\n\n\t\tint stackTop = -1;\n\n\t\tfor(Token t: compiledTokens)\n\t\t{\n\t\t\tif(t instanceof IOperator)\n\t\t\t{\n\t\t\t\tOperandToken b = (OperandToken)stack[stackTop--];\n\t\t\t\tOperandToken a = (OperandToken)stack[stackTop--];\n\n\t\t\t\tstack[++stackTop] = new OperandToken(((IOperator)t).apply(a, b));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tstack[++stackTop] = t;\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.println(((OperandToken)stack[stackTop]).value());\n\t}\n}",
"Solve",
"private final String[] tokens;",
"tokens",
"public Solve(String[] tokens)\n\t{\n\t\tthis.tokens = tokens;\n\t}",
"Solve",
"{\n\t\tthis.tokens = tokens;\n\t}",
"this.tokens = tokens",
"this.tokens",
"this",
"this.tokens",
"tokens",
"String[] tokens",
"tokens",
"public void solve()\n\t{\n\t\tToken[] compiledTokens = new Token[tokens.length];\n\n\t\tfor(int i=0, l=tokens.length; i < l; i++)\n\t\t{\n\t\t\tString token = tokens[i];\n\n\t\t\tif(token.equals(\"+\"))\n\t\t\t{\n\t\t\t\tcompiledTokens[i] = new AddOperator();\n\t\t\t}\n\t\t\telse if(token.equals(\"-\"))\n\t\t\t{\n\t\t\t\tcompiledTokens[i] = new SubtractOperator();\n\t\t\t}\n\t\t\telse if(token.equals(\"*\"))\n\t\t\t{\n\t\t\t\tcompiledTokens[i] = new MultiplyOperator();\n\t\t\t}\n\t\t\telse if(token.equals(\"/\"))\n\t\t\t{\n\t\t\t\tcompiledTokens[i] = new DivideOperator();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tcompiledTokens[i] = new OperandToken(Integer.parseInt(token));\n\t\t\t}\n\t\t}\n\t\tToken[] stack = new Token[100];\n\n\t\tint stackTop = -1;\n\n\t\tfor(Token t: compiledTokens)\n\t\t{\n\t\t\tif(t instanceof IOperator)\n\t\t\t{\n\t\t\t\tOperandToken b = (OperandToken)stack[stackTop--];\n\t\t\t\tOperandToken a = (OperandToken)stack[stackTop--];\n\n\t\t\t\tstack[++stackTop] = new OperandToken(((IOperator)t).apply(a, b));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tstack[++stackTop] = t;\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.println(((OperandToken)stack[stackTop]).value());\n\t}",
"solve",
"{\n\t\tToken[] compiledTokens = new Token[tokens.length];\n\n\t\tfor(int i=0, l=tokens.length; i < l; i++)\n\t\t{\n\t\t\tString token = tokens[i];\n\n\t\t\tif(token.equals(\"+\"))\n\t\t\t{\n\t\t\t\tcompiledTokens[i] = new AddOperator();\n\t\t\t}\n\t\t\telse if(token.equals(\"-\"))\n\t\t\t{\n\t\t\t\tcompiledTokens[i] = new SubtractOperator();\n\t\t\t}\n\t\t\telse if(token.equals(\"*\"))\n\t\t\t{\n\t\t\t\tcompiledTokens[i] = new MultiplyOperator();\n\t\t\t}\n\t\t\telse if(token.equals(\"/\"))\n\t\t\t{\n\t\t\t\tcompiledTokens[i] = new DivideOperator();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tcompiledTokens[i] = new OperandToken(Integer.parseInt(token));\n\t\t\t}\n\t\t}\n\t\tToken[] stack = new Token[100];\n\n\t\tint stackTop = -1;\n\n\t\tfor(Token t: compiledTokens)\n\t\t{\n\t\t\tif(t instanceof IOperator)\n\t\t\t{\n\t\t\t\tOperandToken b = (OperandToken)stack[stackTop--];\n\t\t\t\tOperandToken a = (OperandToken)stack[stackTop--];\n\n\t\t\t\tstack[++stackTop] = new OperandToken(((IOperator)t).apply(a, b));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tstack[++stackTop] = t;\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.println(((OperandToken)stack[stackTop]).value());\n\t}",
"Token[] compiledTokens = new Token[tokens.length];",
"compiledTokens",
"new Token[tokens.length]",
"tokens.length",
"tokens",
"tokens.length",
"for(int i=0, l=tokens.length; i < l; i++)\n\t\t{\n\t\t\tString token = tokens[i];\n\n\t\t\tif(token.equals(\"+\"))\n\t\t\t{\n\t\t\t\tcompiledTokens[i] = new AddOperator();\n\t\t\t}\n\t\t\telse if(token.equals(\"-\"))\n\t\t\t{\n\t\t\t\tcompiledTokens[i] = new SubtractOperator();\n\t\t\t}\n\t\t\telse if(token.equals(\"*\"))\n\t\t\t{\n\t\t\t\tcompiledTokens[i] = new MultiplyOperator();\n\t\t\t}\n\t\t\telse if(token.equals(\"/\"))\n\t\t\t{\n\t\t\t\tcompiledTokens[i] = new DivideOperator();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tcompiledTokens[i] = new OperandToken(Integer.parseInt(token));\n\t\t\t}\n\t\t}",
"int i=0, l=tokens.length;",
"int i=0",
"i",
"0",
"l=tokens.length;",
"l",
"tokens.length",
"tokens",
"tokens.length",
"i < l",
"i",
"l",
"i++",
"i++",
"i",
"{\n\t\t\tString token = tokens[i];\n\n\t\t\tif(token.equals(\"+\"))\n\t\t\t{\n\t\t\t\tcompiledTokens[i] = new AddOperator();\n\t\t\t}\n\t\t\telse if(token.equals(\"-\"))\n\t\t\t{\n\t\t\t\tcompiledTokens[i] = new SubtractOperator();\n\t\t\t}\n\t\t\telse if(token.equals(\"*\"))\n\t\t\t{\n\t\t\t\tcompiledTokens[i] = new MultiplyOperator();\n\t\t\t}\n\t\t\telse if(token.equals(\"/\"))\n\t\t\t{\n\t\t\t\tcompiledTokens[i] = new DivideOperator();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tcompiledTokens[i] = new OperandToken(Integer.parseInt(token));\n\t\t\t}\n\t\t}",
"{\n\t\t\tString token = tokens[i];\n\n\t\t\tif(token.equals(\"+\"))\n\t\t\t{\n\t\t\t\tcompiledTokens[i] = new AddOperator();\n\t\t\t}\n\t\t\telse if(token.equals(\"-\"))\n\t\t\t{\n\t\t\t\tcompiledTokens[i] = new SubtractOperator();\n\t\t\t}\n\t\t\telse if(token.equals(\"*\"))\n\t\t\t{\n\t\t\t\tcompiledTokens[i] = new MultiplyOperator();\n\t\t\t}\n\t\t\telse if(token.equals(\"/\"))\n\t\t\t{\n\t\t\t\tcompiledTokens[i] = new DivideOperator();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tcompiledTokens[i] = new OperandToken(Integer.parseInt(token));\n\t\t\t}\n\t\t}",
"String token = tokens[i];",
"token",
"tokens[i]",
"tokens",
"i",
"if(token.equals(\"+\"))\n\t\t\t{\n\t\t\t\tcompiledTokens[i] = new AddOperator();\n\t\t\t}\n\t\t\telse if(token.equals(\"-\"))\n\t\t\t{\n\t\t\t\tcompiledTokens[i] = new SubtractOperator();\n\t\t\t}\n\t\t\telse if(token.equals(\"*\"))\n\t\t\t{\n\t\t\t\tcompiledTokens[i] = new MultiplyOperator();\n\t\t\t}\n\t\t\telse if(token.equals(\"/\"))\n\t\t\t{\n\t\t\t\tcompiledTokens[i] = new DivideOperator();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tcompiledTokens[i] = new OperandToken(Integer.parseInt(token));\n\t\t\t}",
"token.equals(\"+\")",
"token.equals",
"token",
"\"+\"",
"{\n\t\t\t\tcompiledTokens[i] = new AddOperator();\n\t\t\t}",
"compiledTokens[i] = new AddOperator()",
"compiledTokens[i]",
"compiledTokens",
"i",
"new AddOperator()",
"if(token.equals(\"-\"))\n\t\t\t{\n\t\t\t\tcompiledTokens[i] = new SubtractOperator();\n\t\t\t}\n\t\t\telse if(token.equals(\"*\"))\n\t\t\t{\n\t\t\t\tcompiledTokens[i] = new MultiplyOperator();\n\t\t\t}\n\t\t\telse if(token.equals(\"/\"))\n\t\t\t{\n\t\t\t\tcompiledTokens[i] = new DivideOperator();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tcompiledTokens[i] = new OperandToken(Integer.parseInt(token));\n\t\t\t}",
"token.equals(\"-\")",
"token.equals",
"token",
"\"-\"",
"{\n\t\t\t\tcompiledTokens[i] = new SubtractOperator();\n\t\t\t}",
"compiledTokens[i] = new SubtractOperator()",
"compiledTokens[i]",
"compiledTokens",
"i",
"new SubtractOperator()",
"if(token.equals(\"*\"))\n\t\t\t{\n\t\t\t\tcompiledTokens[i] = new MultiplyOperator();\n\t\t\t}\n\t\t\telse if(token.equals(\"/\"))\n\t\t\t{\n\t\t\t\tcompiledTokens[i] = new DivideOperator();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tcompiledTokens[i] = new OperandToken(Integer.parseInt(token));\n\t\t\t}",
"token.equals(\"*\")",
"token.equals",
"token",
"\"*\"",
"{\n\t\t\t\tcompiledTokens[i] = new MultiplyOperator();\n\t\t\t}",
"compiledTokens[i] = new MultiplyOperator()",
"compiledTokens[i]",
"compiledTokens",
"i",
"new MultiplyOperator()",
"if(token.equals(\"/\"))\n\t\t\t{\n\t\t\t\tcompiledTokens[i] = new DivideOperator();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tcompiledTokens[i] = new OperandToken(Integer.parseInt(token));\n\t\t\t}",
"token.equals(\"/\")",
"token.equals",
"token",
"\"/\"",
"{\n\t\t\t\tcompiledTokens[i] = new DivideOperator();\n\t\t\t}",
"compiledTokens[i] = new DivideOperator()",
"compiledTokens[i]",
"compiledTokens",
"i",
"new DivideOperator()",
"{\n\t\t\t\tcompiledTokens[i] = new OperandToken(Integer.parseInt(token));\n\t\t\t}",
"compiledTokens[i] = new OperandToken(Integer.parseInt(token))",
"compiledTokens[i]",
"compiledTokens",
"i",
"new OperandToken(Integer.parseInt(token))",
"Token[] stack = new Token[100];",
"stack",
"new Token[100]",
"100",
"int stackTop = -1;",
"stackTop",
"-1",
"1",
"for(Token t: compiledTokens)\n\t\t{\n\t\t\tif(t instanceof IOperator)\n\t\t\t{\n\t\t\t\tOperandToken b = (OperandToken)stack[stackTop--];\n\t\t\t\tOperandToken a = (OperandToken)stack[stackTop--];\n\n\t\t\t\tstack[++stackTop] = new OperandToken(((IOperator)t).apply(a, b));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tstack[++stackTop] = t;\n\t\t\t}\n\t\t}",
"Token t",
"compiledTokens",
"{\n\t\t\tif(t instanceof IOperator)\n\t\t\t{\n\t\t\t\tOperandToken b = (OperandToken)stack[stackTop--];\n\t\t\t\tOperandToken a = (OperandToken)stack[stackTop--];\n\n\t\t\t\tstack[++stackTop] = new OperandToken(((IOperator)t).apply(a, b));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tstack[++stackTop] = t;\n\t\t\t}\n\t\t}",
"{\n\t\t\tif(t instanceof IOperator)\n\t\t\t{\n\t\t\t\tOperandToken b = (OperandToken)stack[stackTop--];\n\t\t\t\tOperandToken a = (OperandToken)stack[stackTop--];\n\n\t\t\t\tstack[++stackTop] = new OperandToken(((IOperator)t).apply(a, b));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tstack[++stackTop] = t;\n\t\t\t}\n\t\t}",
"if(t instanceof IOperator)\n\t\t\t{\n\t\t\t\tOperandToken b = (OperandToken)stack[stackTop--];\n\t\t\t\tOperandToken a = (OperandToken)stack[stackTop--];\n\n\t\t\t\tstack[++stackTop] = new OperandToken(((IOperator)t).apply(a, b));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tstack[++stackTop] = t;\n\t\t\t}",
"t instanceof IOperator",
"t",
"IOperator",
"{\n\t\t\t\tOperandToken b = (OperandToken)stack[stackTop--];\n\t\t\t\tOperandToken a = (OperandToken)stack[stackTop--];\n\n\t\t\t\tstack[++stackTop] = new OperandToken(((IOperator)t).apply(a, b));\n\t\t\t}",
"OperandToken b = (OperandToken)stack[stackTop--];",
"b",
"(OperandToken)stack[stackTop--]",
"stack",
"stackTop--",
"stackTop",
"OperandToken a = (OperandToken)stack[stackTop--];",
"a",
"(OperandToken)stack[stackTop--]",
"stack",
"stackTop--",
"stackTop",
"stack[++stackTop] = new OperandToken(((IOperator)t).apply(a, b))",
"stack[++stackTop]",
"stack",
"++stackTop",
"stackTop",
"new OperandToken(((IOperator)t).apply(a, b))",
"{\n\t\t\t\tstack[++stackTop] = t;\n\t\t\t}",
"stack[++stackTop] = t",
"stack[++stackTop]",
"stack",
"++stackTop",
"stackTop",
"t",
"System.out.println(((OperandToken)stack[stackTop]).value())",
"System.out.println",
"System.out",
"System",
"System.out",
"((OperandToken)stack[stackTop]).value()",
"((OperandToken)stack[stackTop]).value",
"((OperandToken)stack[stackTop])",
"stack",
"stackTop",
"abstract class Token {\n\n}",
"Token",
"class OperandToken extends Token {\n\tprivate final int operand;\n\n\tpublic OperandToken(int v)\n\t{\n\t\toperand = v;\n\t}\n\n\tpublic int value()\n\t{\n\t\treturn operand;\n\t}\n}",
"OperandToken",
"private final int operand;",
"operand",
"public OperandToken(int v)\n\t{\n\t\toperand = v;\n\t}",
"OperandToken",
"{\n\t\toperand = v;\n\t}",
"operand = v",
"operand",
"v",
"int v",
"v",
"public int value()\n\t{\n\t\treturn operand;\n\t}",
"value",
"{\n\t\treturn operand;\n\t}",
"return operand;",
"operand",
"Token",
"interface IOperator {\n\tpublic int apply(OperandToken a, OperandToken b);\n}",
"IOperator",
"public int apply(OperandToken a, OperandToken b);",
"apply",
"OperandToken a",
"a",
"OperandToken b",
"b",
"abstract class OperatorToken extends Token implements IOperator {\n}",
"OperatorToken",
"Token",
"IOperator",
"class AddOperator extends OperatorToken {\n\tpublic int apply(OperandToken a, OperandToken b)\n\t{\n\t\treturn a.value() + b.value();\n\t}\n}",
"AddOperator",
"public int apply(OperandToken a, OperandToken b)\n\t{\n\t\treturn a.value() + b.value();\n\t}",
"apply",
"{\n\t\treturn a.value() + b.value();\n\t}",
"return a.value() + b.value();",
"a.value() + b.value()",
"a.value()",
"a.value",
"a",
"b.value()",
"b.value",
"b",
"OperandToken a",
"a",
"OperandToken b",
"b",
"OperatorToken",
"class SubtractOperator extends OperatorToken {\n\tpublic int apply(OperandToken a, OperandToken b)\n\t{\n\t\treturn a.value() - b.value();\n\t}\n}",
"SubtractOperator",
"public int apply(OperandToken a, OperandToken b)\n\t{\n\t\treturn a.value() - b.value();\n\t}",
"apply",
"{\n\t\treturn a.value() - b.value();\n\t}",
"return a.value() - b.value();",
"a.value() - b.value()",
"a.value()",
"a.value",
"a",
"b.value()",
"b.value",
"b",
"OperandToken a",
"a",
"OperandToken b",
"b",
"OperatorToken",
"class MultiplyOperator extends OperatorToken {\n\tpublic int apply(OperandToken a, OperandToken b)\n\t{\n\t\treturn a.value() * b.value();\n\t}\n}",
"MultiplyOperator",
"public int apply(OperandToken a, OperandToken b)\n\t{\n\t\treturn a.value() * b.value();\n\t}",
"apply",
"{\n\t\treturn a.value() * b.value();\n\t}",
"return a.value() * b.value();",
"a.value() * b.value()",
"a.value()",
"a.value",
"a",
"b.value()",
"b.value",
"b",
"OperandToken a",
"a",
"OperandToken b",
"b",
"OperatorToken",
"class DivideOperator extends OperatorToken {\n\tpublic int apply(OperandToken a, OperandToken b)\n\t{\n\t\treturn a.value() / b.value();\n\t}\n}",
"DivideOperator",
"public int apply(OperandToken a, OperandToken b)\n\t{\n\t\treturn a.value() / b.value();\n\t}",
"apply",
"{\n\t\treturn a.value() / b.value();\n\t}",
"return a.value() / b.value();",
"a.value() / b.value()",
"a.value()",
"a.value",
"a",
"b.value()",
"b.value",
"b",
"OperandToken a",
"a",
"OperandToken b",
"b",
"OperatorToken",
"class ContestScanner {\n\tBufferedReader reader;\n\tString[] line;\n\tint index;\n\tpublic ContestScanner() {\n\t\treader = new BufferedReader(new InputStreamReader(System.in));\n\t}\n\n\tpublic ContestScanner(String filename) throws FileNotFoundException {\n\t\treader = new BufferedReader(new InputStreamReader(new FileInputStream(filename)));\n\t}\n\n\tpublic String nextToken() throws IOException {\n\t\tif(line == null || index >= line.length)\n\t\t{\n\t\t\tline = reader.readLine().trim().split(\" \");\n\t\t\tindex = 0;\n\t\t}\n\n\t\treturn line[index++];\n\t}\n\n\tpublic String next() throws IOException {\n\t\treturn nextToken();\n\t}\n\n\tpublic String readLine() throws IOException {\n\t\tline = null;\n\t\tindex = 0;\n\n\t\treturn reader.readLine();\n\t}\n\n\tpublic int nextInt() throws IOException, NumberFormatException {\n\t\treturn Integer.parseInt(nextToken());\n\t}\n\n\tpublic long nextLong() throws IOException, NumberFormatException {\n\t\treturn Long.parseLong(nextToken());\n\t}\n\n\tpublic double nextDouble() throws IOException, NumberFormatException {\n\t\treturn Double.parseDouble(nextToken());\n\t}\n\n\tpublic int[] nextIntArray(int N) throws IOException, NumberFormatException {\n\t\tint[] result = new int[N];\n\n\t\tfor(int i=0; i < N; i++) result[i] = nextInt();\n\n\t\treturn result;\n\t}\n\n\tpublic long[] nextLongArray(int N) throws IOException, NumberFormatException {\n\t\tlong[] result = new long[N];\n\n\t\tfor(int i=0; i < N; i++) result[i] = nextLong();\n\n\t\treturn result;\n\t}\n\n\tpublic double[] nexDoubleArray(int N) throws IOException, NumberFormatException {\n\t\tdouble[] result = new double[N];\n\n\t\tfor(int i=0; i < N; i++) result[i] = nextDouble();\n\n\t\treturn result;\n\t}\n}",
"ContestScanner",
"BufferedReader reader;",
"reader",
"String[] line;",
"line",
"int index;",
"index",
"public ContestScanner() {\n\t\treader = new BufferedReader(new InputStreamReader(System.in));\n\t}",
"ContestScanner",
"{\n\t\treader = new BufferedReader(new InputStreamReader(System.in));\n\t}",
"reader = new BufferedReader(new InputStreamReader(System.in))",
"reader",
"new BufferedReader(new InputStreamReader(System.in))",
"public ContestScanner(String filename) throws FileNotFoundException {\n\t\treader = new BufferedReader(new InputStreamReader(new FileInputStream(filename)));\n\t}",
"ContestScanner",
"{\n\t\treader = new BufferedReader(new InputStreamReader(new FileInputStream(filename)));\n\t}",
"reader = new BufferedReader(new InputStreamReader(new FileInputStream(filename)))",
"reader",
"new BufferedReader(new InputStreamReader(new FileInputStream(filename)))",
"String filename",
"filename",
"public String nextToken() throws IOException {\n\t\tif(line == null || index >= line.length)\n\t\t{\n\t\t\tline = reader.readLine().trim().split(\" \");\n\t\t\tindex = 0;\n\t\t}\n\n\t\treturn line[index++];\n\t}",
"nextToken",
"{\n\t\tif(line == null || index >= line.length)\n\t\t{\n\t\t\tline = reader.readLine().trim().split(\" \");\n\t\t\tindex = 0;\n\t\t}\n\n\t\treturn line[index++];\n\t}",
"if(line == null || index >= line.length)\n\t\t{\n\t\t\tline = reader.readLine().trim().split(\" \");\n\t\t\tindex = 0;\n\t\t}",
"line == null || index >= line.length",
"line == null",
"line",
"null",
"index >= line.length",
"index",
"line.length",
"line",
"line.length",
"{\n\t\t\tline = reader.readLine().trim().split(\" \");\n\t\t\tindex = 0;\n\t\t}",
"line = reader.readLine().trim().split(\" \")",
"line",
"reader.readLine().trim().split(\" \")",
"reader.readLine().trim().split",
"reader.readLine().trim()",
"reader.readLine().trim",
"reader.readLine()",
"reader.readLine",
"reader",
"\" \"",
"index = 0",
"index",
"0",
"return line[index++];",
"line[index++]",
"line",
"index++",
"index",
"public String next() throws IOException {\n\t\treturn nextToken();\n\t}",
"next",
"{\n\t\treturn nextToken();\n\t}",
"return nextToken();",
"nextToken()",
"nextToken",
"public String readLine() throws IOException {\n\t\tline = null;\n\t\tindex = 0;\n\n\t\treturn reader.readLine();\n\t}",
"readLine",
"{\n\t\tline = null;\n\t\tindex = 0;\n\n\t\treturn reader.readLine();\n\t}",
"line = null",
"line",
"null",
"index = 0",
"index",
"0",
"return reader.readLine();",
"reader.readLine()",
"reader.readLine",
"reader",
"public int nextInt() throws IOException, NumberFormatException {\n\t\treturn Integer.parseInt(nextToken());\n\t}",
"nextInt",
"{\n\t\treturn Integer.parseInt(nextToken());\n\t}",
"return Integer.parseInt(nextToken());",
"Integer.parseInt(nextToken())",
"Integer.parseInt",
"Integer",
"nextToken()",
"nextToken",
"public long nextLong() throws IOException, NumberFormatException {\n\t\treturn Long.parseLong(nextToken());\n\t}",
"nextLong",
"{\n\t\treturn Long.parseLong(nextToken());\n\t}",
"return Long.parseLong(nextToken());",
"Long.parseLong(nextToken())",
"Long.parseLong",
"Long",
"nextToken()",
"nextToken",
"public double nextDouble() throws IOException, NumberFormatException {\n\t\treturn Double.parseDouble(nextToken());\n\t}",
"nextDouble",
"{\n\t\treturn Double.parseDouble(nextToken());\n\t}",
"return Double.parseDouble(nextToken());",
"Double.parseDouble(nextToken())",
"Double.parseDouble",
"Double",
"nextToken()",
"nextToken",
"public int[] nextIntArray(int N) throws IOException, NumberFormatException {\n\t\tint[] result = new int[N];\n\n\t\tfor(int i=0; i < N; i++) result[i] = nextInt();\n\n\t\treturn result;\n\t}",
"nextIntArray",
"{\n\t\tint[] result = new int[N];\n\n\t\tfor(int i=0; i < N; i++) result[i] = nextInt();\n\n\t\treturn result;\n\t}",
"int[] result = new int[N];",
"result",
"new int[N]",
"N",
"for(int i=0; i < N; i++) result[i] = nextInt();",
"int i=0;",
"int i=0;",
"i",
"0",
"i < N",
"i",
"N",
"i++",
"i++",
"i",
"result[i] = nextInt();",
"result[i] = nextInt()",
"result[i]",
"result",
"i",
"nextInt()",
"nextInt",
"return result;",
"result",
"int N",
"N",
"public long[] nextLongArray(int N) throws IOException, NumberFormatException {\n\t\tlong[] result = new long[N];\n\n\t\tfor(int i=0; i < N; i++) result[i] = nextLong();\n\n\t\treturn result;\n\t}",
"nextLongArray",
"{\n\t\tlong[] result = new long[N];\n\n\t\tfor(int i=0; i < N; i++) result[i] = nextLong();\n\n\t\treturn result;\n\t}",
"long[] result = new long[N];",
"result",
"new long[N]",
"N",
"for(int i=0; i < N; i++) result[i] = nextLong();",
"int i=0;",
"int i=0;",
"i",
"0",
"i < N",
"i",
"N",
"i++",
"i++",
"i",
"result[i] = nextLong();",
"result[i] = nextLong()",
"result[i]",
"result",
"i",
"nextLong()",
"nextLong",
"return result;",
"result",
"int N",
"N",
"public double[] nexDoubleArray(int N) throws IOException, NumberFormatException {\n\t\tdouble[] result = new double[N];\n\n\t\tfor(int i=0; i < N; i++) result[i] = nextDouble();\n\n\t\treturn result;\n\t}",
"nexDoubleArray",
"{\n\t\tdouble[] result = new double[N];\n\n\t\tfor(int i=0; i < N; i++) result[i] = nextDouble();\n\n\t\treturn result;\n\t}",
"double[] result = new double[N];",
"result",
"new double[N]",
"N",
"for(int i=0; i < N; i++) result[i] = nextDouble();",
"int i=0;",
"int i=0;",
"i",
"0",
"i < N",
"i",
"N",
"i++",
"i++",
"i",
"result[i] = nextDouble();",
"result[i] = nextDouble()",
"result[i]",
"result",
"i",
"nextDouble()",
"nextDouble",
"return result;",
"result",
"int N",
"N",
"public class Main {\n\tpublic static void main(String[] args) throws IOException {\n\t\tContestScanner scan = new ContestScanner();\n\n\t\t(new Solve(scan.readLine().split(\" \"))).solve();\n\t}\n}",
"public class Main {\n\tpublic static void main(String[] args) throws IOException {\n\t\tContestScanner scan = new ContestScanner();\n\n\t\t(new Solve(scan.readLine().split(\" \"))).solve();\n\t}\n}",
"Main"
] | import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class Main {
public static void main(String[] args) throws IOException {
ContestScanner scan = new ContestScanner();
(new Solve(scan.readLine().split(" "))).solve();
}
}
class Solve {
private final String[] tokens;
public Solve(String[] tokens)
{
this.tokens = tokens;
}
public void solve()
{
Token[] compiledTokens = new Token[tokens.length];
for(int i=0, l=tokens.length; i < l; i++)
{
String token = tokens[i];
if(token.equals("+"))
{
compiledTokens[i] = new AddOperator();
}
else if(token.equals("-"))
{
compiledTokens[i] = new SubtractOperator();
}
else if(token.equals("*"))
{
compiledTokens[i] = new MultiplyOperator();
}
else if(token.equals("/"))
{
compiledTokens[i] = new DivideOperator();
}
else
{
compiledTokens[i] = new OperandToken(Integer.parseInt(token));
}
}
Token[] stack = new Token[100];
int stackTop = -1;
for(Token t: compiledTokens)
{
if(t instanceof IOperator)
{
OperandToken b = (OperandToken)stack[stackTop--];
OperandToken a = (OperandToken)stack[stackTop--];
stack[++stackTop] = new OperandToken(((IOperator)t).apply(a, b));
}
else
{
stack[++stackTop] = t;
}
}
System.out.println(((OperandToken)stack[stackTop]).value());
}
}
abstract class Token {
}
class OperandToken extends Token {
private final int operand;
public OperandToken(int v)
{
operand = v;
}
public int value()
{
return operand;
}
}
interface IOperator {
public int apply(OperandToken a, OperandToken b);
}
abstract class OperatorToken extends Token implements IOperator {
}
class AddOperator extends OperatorToken {
public int apply(OperandToken a, OperandToken b)
{
return a.value() + b.value();
}
}
class SubtractOperator extends OperatorToken {
public int apply(OperandToken a, OperandToken b)
{
return a.value() - b.value();
}
}
class MultiplyOperator extends OperatorToken {
public int apply(OperandToken a, OperandToken b)
{
return a.value() * b.value();
}
}
class DivideOperator extends OperatorToken {
public int apply(OperandToken a, OperandToken b)
{
return a.value() / b.value();
}
}
class ContestScanner {
BufferedReader reader;
String[] line;
int index;
public ContestScanner() {
reader = new BufferedReader(new InputStreamReader(System.in));
}
public ContestScanner(String filename) throws FileNotFoundException {
reader = new BufferedReader(new InputStreamReader(new FileInputStream(filename)));
}
public String nextToken() throws IOException {
if(line == null || index >= line.length)
{
line = reader.readLine().trim().split(" ");
index = 0;
}
return line[index++];
}
public String next() throws IOException {
return nextToken();
}
public String readLine() throws IOException {
line = null;
index = 0;
return reader.readLine();
}
public int nextInt() throws IOException, NumberFormatException {
return Integer.parseInt(nextToken());
}
public long nextLong() throws IOException, NumberFormatException {
return Long.parseLong(nextToken());
}
public double nextDouble() throws IOException, NumberFormatException {
return Double.parseDouble(nextToken());
}
public int[] nextIntArray(int N) throws IOException, NumberFormatException {
int[] result = new int[N];
for(int i=0; i < N; i++) result[i] = nextInt();
return result;
}
public long[] nextLongArray(int N) throws IOException, NumberFormatException {
long[] result = new long[N];
for(int i=0; i < N; i++) result[i] = nextLong();
return result;
}
public double[] nexDoubleArray(int N) throws IOException, NumberFormatException {
double[] result = new double[N];
for(int i=0; i < N; i++) result[i] = nextDouble();
return result;
}
} |
[
7,
15,
13,
17,
6,
13,
41,
13,
41,
13,
12,
13,
30,
0,
18,
13,
40,
13,
13,
23,
13,
12,
13,
30,
40,
13,
29,
18,
13,
2,
13,
17,
12,
13,
30,
41,
13,
20,
0,
13,
20,
17,
42,
4,
18,
13,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
17,
14,
2,
13,
17,
30,
41,
13,
4,
13,
41,
13,
4,
13,
4,
13,
2,
13,
13,
14,
2,
13,
17,
30,
41,
13,
4,
13,
41,
13,
4,
13,
4,
13,
2,
13,
13,
14,
2,
13,
17,
30,
41,
13,
4,
13,
41,
13,
4,
13,
4,
13,
2,
13,
13,
30,
4,
13,
4,
18,
13,
13,
4,
18,
18,
13,
13,
4,
13,
4,
18,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
132,
5
],
[
132,
6
],
[
6,
7
],
[
132,
8
],
[
8,
9
],
[
132,
10
],
[
10,
11
],
[
10,
12
],
[
12,
13
],
[
13,
14
],
[
14,
15
],
[
14,
16
],
[
16,
17
],
[
13,
18
],
[
10,
19
],
[
19,
20
],
[
132,
21
],
[
21,
22
],
[
21,
23
],
[
23,
24
],
[
24,
25
],
[
23,
26
],
[
26,
27
],
[
27,
28
],
[
27,
29
],
[
29,
30
],
[
29,
31
],
[
132,
32
],
[
32,
33
],
[
32,
34
],
[
34,
35
],
[
35,
36
],
[
35,
37
],
[
34,
38
],
[
38,
39
],
[
38,
40
],
[
34,
42
],
[
42,
43
],
[
43,
44
],
[
44,
45
],
[
42,
46
],
[
46,
47
],
[
47,
48
],
[
47,
49
],
[
49,
50
],
[
50,
51
],
[
46,
52
],
[
52,
53
],
[
52,
54
],
[
54,
55
],
[
55,
56
],
[
54,
57
],
[
46,
58
],
[
58,
59
],
[
59,
60
],
[
59,
61
],
[
58,
62
],
[
62,
63
],
[
63,
64
],
[
63,
65
],
[
65,
66
],
[
62,
67
],
[
67,
68
],
[
67,
69
],
[
69,
70
],
[
62,
71
],
[
71,
72
],
[
71,
73
],
[
73,
74
],
[
73,
75
],
[
58,
76
],
[
76,
77
],
[
77,
78
],
[
77,
79
],
[
76,
80
],
[
80,
81
],
[
81,
82
],
[
81,
83
],
[
83,
84
],
[
80,
85
],
[
85,
86
],
[
85,
87
],
[
87,
88
],
[
80,
89
],
[
89,
90
],
[
89,
91
],
[
91,
92
],
[
91,
93
],
[
76,
94
],
[
94,
95
],
[
95,
96
],
[
95,
97
],
[
94,
98
],
[
98,
99
],
[
99,
100
],
[
99,
101
],
[
101,
102
],
[
98,
103
],
[
103,
104
],
[
103,
105
],
[
105,
106
],
[
98,
107
],
[
107,
108
],
[
107,
109
],
[
109,
110
],
[
109,
111
],
[
94,
112
],
[
112,
113
],
[
113,
114
],
[
113,
115
],
[
115,
116
],
[
116,
117
],
[
115,
118
],
[
34,
119
],
[
119,
120
],
[
120,
121
],
[
121,
122
],
[
121,
123
],
[
119,
124
],
[
124,
125
],
[
34,
126
],
[
126,
127
],
[
127,
128
],
[
32,
129
],
[
129,
130
],
[
0,
131
],
[
131,
132
],
[
131,
133
]
] | [
"import java.util.*;\n\npublic class Main {\n\n static int top;\n static int[] s;\n\n static void push(int x) {\n s[++top] = x;\n }\n\n static int pop() {\n top--;\n return s[top + 1];\n }\n\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n s = new int[1000];\n while (sc.hasNext()) {\n String s = sc.next();\n char c = s.charAt(0);\n if (c == '+') {\n int k = pop();\n int k2 = pop();\n push(k2 + k);\n } else if (c == '-') {\n int k = pop();\n int k2 = pop();\n push(k2 - k);\n } else if (c == '*') {\n int k = pop();\n int k2 = pop();\n push(k2 * k);\n } else {\n push(Integer.parseInt(s));\n }\n\n }\n System.out.println(pop());\n sc.close();\n }\n}",
"import java.util.*;",
"util.*",
"java",
"public class Main {\n\n static int top;\n static int[] s;\n\n static void push(int x) {\n s[++top] = x;\n }\n\n static int pop() {\n top--;\n return s[top + 1];\n }\n\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n s = new int[1000];\n while (sc.hasNext()) {\n String s = sc.next();\n char c = s.charAt(0);\n if (c == '+') {\n int k = pop();\n int k2 = pop();\n push(k2 + k);\n } else if (c == '-') {\n int k = pop();\n int k2 = pop();\n push(k2 - k);\n } else if (c == '*') {\n int k = pop();\n int k2 = pop();\n push(k2 * k);\n } else {\n push(Integer.parseInt(s));\n }\n\n }\n System.out.println(pop());\n sc.close();\n }\n}",
"Main",
"static int top;",
"top",
"static int[] s;",
"s",
"static void push(int x) {\n s[++top] = x;\n }",
"push",
"{\n s[++top] = x;\n }",
"s[++top] = x",
"s[++top]",
"s",
"++top",
"top",
"x",
"int x",
"x",
"static int pop() {\n top--;\n return s[top + 1];\n }",
"pop",
"{\n top--;\n return s[top + 1];\n }",
"top--",
"top",
"return s[top + 1];",
"s[top + 1]",
"s",
"top + 1",
"top",
"1",
"public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n s = new int[1000];\n while (sc.hasNext()) {\n String s = sc.next();\n char c = s.charAt(0);\n if (c == '+') {\n int k = pop();\n int k2 = pop();\n push(k2 + k);\n } else if (c == '-') {\n int k = pop();\n int k2 = pop();\n push(k2 - k);\n } else if (c == '*') {\n int k = pop();\n int k2 = pop();\n push(k2 * k);\n } else {\n push(Integer.parseInt(s));\n }\n\n }\n System.out.println(pop());\n sc.close();\n }",
"main",
"{\n Scanner sc = new Scanner(System.in);\n s = new int[1000];\n while (sc.hasNext()) {\n String s = sc.next();\n char c = s.charAt(0);\n if (c == '+') {\n int k = pop();\n int k2 = pop();\n push(k2 + k);\n } else if (c == '-') {\n int k = pop();\n int k2 = pop();\n push(k2 - k);\n } else if (c == '*') {\n int k = pop();\n int k2 = pop();\n push(k2 * k);\n } else {\n push(Integer.parseInt(s));\n }\n\n }\n System.out.println(pop());\n sc.close();\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"s = new int[1000]",
"s",
"new int[1000]",
"1000",
"while (sc.hasNext()) {\n String s = sc.next();\n char c = s.charAt(0);\n if (c == '+') {\n int k = pop();\n int k2 = pop();\n push(k2 + k);\n } else if (c == '-') {\n int k = pop();\n int k2 = pop();\n push(k2 - k);\n } else if (c == '*') {\n int k = pop();\n int k2 = pop();\n push(k2 * k);\n } else {\n push(Integer.parseInt(s));\n }\n\n }",
"sc.hasNext()",
"sc.hasNext",
"sc",
"{\n String s = sc.next();\n char c = s.charAt(0);\n if (c == '+') {\n int k = pop();\n int k2 = pop();\n push(k2 + k);\n } else if (c == '-') {\n int k = pop();\n int k2 = pop();\n push(k2 - k);\n } else if (c == '*') {\n int k = pop();\n int k2 = pop();\n push(k2 * k);\n } else {\n push(Integer.parseInt(s));\n }\n\n }",
"String s = sc.next();",
"s",
"sc.next()",
"sc.next",
"sc",
"char c = s.charAt(0);",
"c",
"s.charAt(0)",
"s.charAt",
"s",
"0",
"if (c == '+') {\n int k = pop();\n int k2 = pop();\n push(k2 + k);\n } else if (c == '-') {\n int k = pop();\n int k2 = pop();\n push(k2 - k);\n } else if (c == '*') {\n int k = pop();\n int k2 = pop();\n push(k2 * k);\n } else {\n push(Integer.parseInt(s));\n }",
"c == '+'",
"c",
"'+'",
"{\n int k = pop();\n int k2 = pop();\n push(k2 + k);\n }",
"int k = pop();",
"k",
"pop()",
"pop",
"int k2 = pop();",
"k2",
"pop()",
"pop",
"push(k2 + k)",
"push",
"k2 + k",
"k2",
"k",
"if (c == '-') {\n int k = pop();\n int k2 = pop();\n push(k2 - k);\n } else if (c == '*') {\n int k = pop();\n int k2 = pop();\n push(k2 * k);\n } else {\n push(Integer.parseInt(s));\n }",
"c == '-'",
"c",
"'-'",
"{\n int k = pop();\n int k2 = pop();\n push(k2 - k);\n }",
"int k = pop();",
"k",
"pop()",
"pop",
"int k2 = pop();",
"k2",
"pop()",
"pop",
"push(k2 - k)",
"push",
"k2 - k",
"k2",
"k",
"if (c == '*') {\n int k = pop();\n int k2 = pop();\n push(k2 * k);\n } else {\n push(Integer.parseInt(s));\n }",
"c == '*'",
"c",
"'*'",
"{\n int k = pop();\n int k2 = pop();\n push(k2 * k);\n }",
"int k = pop();",
"k",
"pop()",
"pop",
"int k2 = pop();",
"k2",
"pop()",
"pop",
"push(k2 * k)",
"push",
"k2 * k",
"k2",
"k",
"{\n push(Integer.parseInt(s));\n }",
"push(Integer.parseInt(s))",
"push",
"Integer.parseInt(s)",
"Integer.parseInt",
"Integer",
"s",
"System.out.println(pop())",
"System.out.println",
"System.out",
"System",
"System.out",
"pop()",
"pop",
"sc.close()",
"sc.close",
"sc",
"String[] args",
"args",
"public class Main {\n\n static int top;\n static int[] s;\n\n static void push(int x) {\n s[++top] = x;\n }\n\n static int pop() {\n top--;\n return s[top + 1];\n }\n\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n s = new int[1000];\n while (sc.hasNext()) {\n String s = sc.next();\n char c = s.charAt(0);\n if (c == '+') {\n int k = pop();\n int k2 = pop();\n push(k2 + k);\n } else if (c == '-') {\n int k = pop();\n int k2 = pop();\n push(k2 - k);\n } else if (c == '*') {\n int k = pop();\n int k2 = pop();\n push(k2 * k);\n } else {\n push(Integer.parseInt(s));\n }\n\n }\n System.out.println(pop());\n sc.close();\n }\n}",
"public class Main {\n\n static int top;\n static int[] s;\n\n static void push(int x) {\n s[++top] = x;\n }\n\n static int pop() {\n top--;\n return s[top + 1];\n }\n\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n s = new int[1000];\n while (sc.hasNext()) {\n String s = sc.next();\n char c = s.charAt(0);\n if (c == '+') {\n int k = pop();\n int k2 = pop();\n push(k2 + k);\n } else if (c == '-') {\n int k = pop();\n int k2 = pop();\n push(k2 - k);\n } else if (c == '*') {\n int k = pop();\n int k2 = pop();\n push(k2 * k);\n } else {\n push(Integer.parseInt(s));\n }\n\n }\n System.out.println(pop());\n sc.close();\n }\n}",
"Main"
] | import java.util.*;
public class Main {
static int top;
static int[] s;
static void push(int x) {
s[++top] = x;
}
static int pop() {
top--;
return s[top + 1];
}
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
s = new int[1000];
while (sc.hasNext()) {
String s = sc.next();
char c = s.charAt(0);
if (c == '+') {
int k = pop();
int k2 = pop();
push(k2 + k);
} else if (c == '-') {
int k = pop();
int k2 = pop();
push(k2 - k);
} else if (c == '*') {
int k = pop();
int k2 = pop();
push(k2 * k);
} else {
push(Integer.parseInt(s));
}
}
System.out.println(pop());
sc.close();
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
20,
41,
13,
4,
18,
4,
18,
13,
17,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
30,
14,
4,
13,
18,
13,
13,
30,
4,
18,
13,
18,
13,
13,
30,
14,
4,
18,
18,
13,
13,
17,
30,
4,
18,
13,
4,
18,
13,
2,
4,
13,
4,
18,
13,
4,
13,
4,
18,
13,
14,
4,
18,
18,
13,
13,
17,
30,
4,
18,
13,
4,
18,
13,
2,
40,
4,
13,
4,
18,
13,
4,
13,
4,
18,
13,
30,
4,
18,
13,
4,
18,
13,
2,
4,
13,
4,
18,
13,
4,
13,
4,
18,
13,
4,
18,
18,
13,
13,
4,
18,
13,
23,
13,
12,
13,
30,
29,
4,
18,
4,
18,
4,
18,
13,
17,
13,
23,
13,
12,
13,
30,
41,
13,
4,
18,
13,
17,
41,
13,
18,
13,
13,
41,
13,
20,
13,
42,
2,
40,
13,
17,
30,
0,
18,
13,
13,
4,
18,
13,
18,
13,
13,
29,
13,
23,
13,
12,
13,
30,
41,
13,
4,
18,
13,
17,
41,
13,
18,
13,
13,
41,
13,
20,
13,
42,
2,
40,
13,
17,
30,
0,
18,
13,
13,
4,
18,
13,
18,
13,
13,
29,
13,
23,
13,
12,
13,
30,
29,
4,
18,
13,
13,
23,
13,
12,
13,
30,
29,
4,
18,
13,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
10,
11
],
[
10,
12
],
[
0,
13
],
[
13,
14
],
[
13,
15
],
[
0,
16
],
[
16,
17
],
[
16,
18
],
[
0,
19
],
[
258,
20
],
[
258,
21
],
[
21,
22
],
[
21,
23
],
[
23,
24
],
[
24,
25
],
[
24,
26
],
[
23,
27
],
[
27,
28
],
[
27,
29
],
[
23,
30
],
[
30,
31
],
[
30,
32
],
[
32,
33
],
[
33,
34
],
[
34,
35
],
[
35,
36
],
[
32,
37
],
[
23,
38
],
[
38,
39
],
[
39,
40
],
[
40,
41
],
[
40,
42
],
[
38,
43
],
[
43,
44
],
[
43,
45
],
[
45,
46
],
[
45,
47
],
[
38,
48
],
[
48,
49
],
[
49,
50
],
[
38,
51
],
[
52,
52
],
[
52,
53
],
[
53,
54
],
[
54,
55
],
[
54,
56
],
[
56,
57
],
[
56,
58
],
[
53,
59
],
[
59,
60
],
[
60,
61
],
[
61,
62
],
[
60,
63
],
[
63,
64
],
[
63,
65
],
[
53,
66
],
[
66,
67
],
[
67,
68
],
[
68,
69
],
[
69,
70
],
[
70,
71
],
[
70,
72
],
[
68,
73
],
[
67,
74
],
[
74,
75
],
[
75,
76
],
[
76,
77
],
[
75,
78
],
[
78,
79
],
[
79,
80
],
[
78,
81
],
[
81,
82
],
[
82,
83
],
[
82,
84
],
[
84,
85
],
[
85,
86
],
[
81,
87
],
[
87,
88
],
[
87,
89
],
[
89,
90
],
[
90,
91
],
[
67,
92
],
[
92,
93
],
[
93,
94
],
[
94,
95
],
[
95,
96
],
[
95,
97
],
[
93,
98
],
[
92,
99
],
[
99,
100
],
[
100,
101
],
[
101,
102
],
[
100,
103
],
[
103,
104
],
[
104,
105
],
[
103,
106
],
[
106,
107
],
[
107,
108
],
[
108,
109
],
[
108,
110
],
[
110,
111
],
[
111,
112
],
[
106,
113
],
[
113,
114
],
[
113,
115
],
[
115,
116
],
[
116,
117
],
[
92,
118
],
[
118,
119
],
[
119,
120
],
[
120,
121
],
[
119,
122
],
[
122,
123
],
[
123,
124
],
[
122,
125
],
[
125,
126
],
[
126,
127
],
[
126,
128
],
[
128,
129
],
[
129,
130
],
[
125,
131
],
[
131,
132
],
[
131,
133
],
[
133,
134
],
[
134,
135
],
[
23,
136
],
[
136,
137
],
[
137,
138
],
[
138,
139
],
[
138,
140
],
[
136,
141
],
[
141,
142
],
[
142,
143
],
[
21,
144
],
[
144,
145
],
[
258,
146
],
[
146,
147
],
[
146,
148
],
[
148,
149
],
[
149,
150
],
[
150,
151
],
[
151,
152
],
[
152,
153
],
[
153,
154
],
[
154,
155
],
[
155,
156
],
[
154,
157
],
[
152,
158
],
[
146,
159
],
[
159,
160
],
[
258,
161
],
[
161,
162
],
[
161,
163
],
[
163,
164
],
[
164,
165
],
[
164,
166
],
[
166,
167
],
[
167,
168
],
[
166,
169
],
[
163,
170
],
[
170,
171
],
[
170,
172
],
[
172,
173
],
[
172,
174
],
[
163,
175
],
[
175,
176
],
[
175,
177
],
[
163,
179
],
[
179,
180
],
[
180,
181
],
[
181,
182
],
[
180,
183
],
[
179,
184
],
[
184,
185
],
[
185,
186
],
[
186,
187
],
[
186,
188
],
[
185,
189
],
[
189,
190
],
[
190,
191
],
[
189,
192
],
[
192,
193
],
[
192,
194
],
[
163,
195
],
[
195,
196
],
[
161,
197
],
[
197,
198
],
[
258,
199
],
[
199,
200
],
[
199,
201
],
[
201,
202
],
[
202,
203
],
[
202,
204
],
[
204,
205
],
[
205,
206
],
[
204,
207
],
[
201,
208
],
[
208,
209
],
[
208,
210
],
[
210,
211
],
[
210,
212
],
[
201,
213
],
[
213,
214
],
[
213,
215
],
[
201,
217
],
[
217,
218
],
[
218,
219
],
[
219,
220
],
[
218,
221
],
[
217,
222
],
[
222,
223
],
[
223,
224
],
[
224,
225
],
[
224,
226
],
[
223,
227
],
[
227,
228
],
[
228,
229
],
[
227,
230
],
[
230,
231
],
[
230,
232
],
[
201,
233
],
[
233,
234
],
[
199,
235
],
[
235,
236
],
[
258,
237
],
[
237,
238
],
[
237,
239
],
[
239,
240
],
[
240,
241
],
[
241,
242
],
[
242,
243
],
[
241,
244
],
[
237,
245
],
[
245,
246
],
[
258,
247
],
[
247,
248
],
[
247,
249
],
[
249,
250
],
[
250,
251
],
[
251,
252
],
[
252,
253
],
[
251,
254
],
[
247,
255
],
[
255,
256
],
[
0,
257
],
[
257,
258
],
[
257,
259
]
] | [
"import java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\nimport java.util.ArrayDeque;\nimport java.util.Deque;\nimport java.util.regex.Pattern;\n\npublic class Main {\n public static void main(String[] args) throws IOException {\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n Deque<String> ad = new ArrayDeque<String>();\n String[] lines = br.readLine().split(\" \");\n for (int i = 0; i < lines.length; i++) {\n if (isNumber(lines[i])) {\n ad.push(lines[i]);\n } else {\n if (lines[i].equals(\"+\")) {\n ad.push(String.valueOf(ip(ad.pop()) + ip(ad.pop())));\n } else if (lines[i].equals(\"-\")) {\n ad.push(String.valueOf(-ip(ad.pop()) + ip(ad.pop())));\n } else {\n ad.push(String.valueOf(ip(ad.pop()) * ip(ad.pop())));\n }\n }\n }\n System.out.println(ad.pop());\n }\n\n static boolean isNumber(String num) {\n return Pattern.compile(\"^\\\\-?[0-9]*\\\\.?[0-9]+$\").matcher(num).find();\n }\n\n static int[] createListInt(String line) {\n String[] lines = line.split(\" \");\n int n = lines.length;\n int[] list = new int[n];\n while (n-- > 0) {\n list[n] = Integer.parseInt(lines[n]);\n }\n return list;\n }\n\n static long[] createListLong(String line) {\n String[] lines = line.split(\" \");\n int n = lines.length;\n long[] list = new long[n];\n while (n-- > 0) {\n list[n] = Long.parseLong(lines[n]);\n }\n return list;\n }\n\n static int ip(String s) {\n return Integer.parseInt(s);\n }\n\n static long lp(String s) {\n return Long.parseLong(s);\n }\n}",
"import java.io.BufferedReader;",
"BufferedReader",
"java.io",
"import java.io.IOException;",
"IOException",
"java.io",
"import java.io.InputStreamReader;",
"InputStreamReader",
"java.io",
"import java.util.ArrayDeque;",
"ArrayDeque",
"java.util",
"import java.util.Deque;",
"Deque",
"java.util",
"import java.util.regex.Pattern;",
"Pattern",
"java.util.regex",
"public class Main {\n public static void main(String[] args) throws IOException {\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n Deque<String> ad = new ArrayDeque<String>();\n String[] lines = br.readLine().split(\" \");\n for (int i = 0; i < lines.length; i++) {\n if (isNumber(lines[i])) {\n ad.push(lines[i]);\n } else {\n if (lines[i].equals(\"+\")) {\n ad.push(String.valueOf(ip(ad.pop()) + ip(ad.pop())));\n } else if (lines[i].equals(\"-\")) {\n ad.push(String.valueOf(-ip(ad.pop()) + ip(ad.pop())));\n } else {\n ad.push(String.valueOf(ip(ad.pop()) * ip(ad.pop())));\n }\n }\n }\n System.out.println(ad.pop());\n }\n\n static boolean isNumber(String num) {\n return Pattern.compile(\"^\\\\-?[0-9]*\\\\.?[0-9]+$\").matcher(num).find();\n }\n\n static int[] createListInt(String line) {\n String[] lines = line.split(\" \");\n int n = lines.length;\n int[] list = new int[n];\n while (n-- > 0) {\n list[n] = Integer.parseInt(lines[n]);\n }\n return list;\n }\n\n static long[] createListLong(String line) {\n String[] lines = line.split(\" \");\n int n = lines.length;\n long[] list = new long[n];\n while (n-- > 0) {\n list[n] = Long.parseLong(lines[n]);\n }\n return list;\n }\n\n static int ip(String s) {\n return Integer.parseInt(s);\n }\n\n static long lp(String s) {\n return Long.parseLong(s);\n }\n}",
"Main",
"public static void main(String[] args) throws IOException {\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n Deque<String> ad = new ArrayDeque<String>();\n String[] lines = br.readLine().split(\" \");\n for (int i = 0; i < lines.length; i++) {\n if (isNumber(lines[i])) {\n ad.push(lines[i]);\n } else {\n if (lines[i].equals(\"+\")) {\n ad.push(String.valueOf(ip(ad.pop()) + ip(ad.pop())));\n } else if (lines[i].equals(\"-\")) {\n ad.push(String.valueOf(-ip(ad.pop()) + ip(ad.pop())));\n } else {\n ad.push(String.valueOf(ip(ad.pop()) * ip(ad.pop())));\n }\n }\n }\n System.out.println(ad.pop());\n }",
"main",
"{\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n Deque<String> ad = new ArrayDeque<String>();\n String[] lines = br.readLine().split(\" \");\n for (int i = 0; i < lines.length; i++) {\n if (isNumber(lines[i])) {\n ad.push(lines[i]);\n } else {\n if (lines[i].equals(\"+\")) {\n ad.push(String.valueOf(ip(ad.pop()) + ip(ad.pop())));\n } else if (lines[i].equals(\"-\")) {\n ad.push(String.valueOf(-ip(ad.pop()) + ip(ad.pop())));\n } else {\n ad.push(String.valueOf(ip(ad.pop()) * ip(ad.pop())));\n }\n }\n }\n System.out.println(ad.pop());\n }",
"BufferedReader br = new BufferedReader(new InputStreamReader(System.in));",
"br",
"new BufferedReader(new InputStreamReader(System.in))",
"Deque<String> ad = new ArrayDeque<String>();",
"ad",
"new ArrayDeque<String>()",
"String[] lines = br.readLine().split(\" \");",
"lines",
"br.readLine().split(\" \")",
"br.readLine().split",
"br.readLine()",
"br.readLine",
"br",
"\" \"",
"for (int i = 0; i < lines.length; i++) {\n if (isNumber(lines[i])) {\n ad.push(lines[i]);\n } else {\n if (lines[i].equals(\"+\")) {\n ad.push(String.valueOf(ip(ad.pop()) + ip(ad.pop())));\n } else if (lines[i].equals(\"-\")) {\n ad.push(String.valueOf(-ip(ad.pop()) + ip(ad.pop())));\n } else {\n ad.push(String.valueOf(ip(ad.pop()) * ip(ad.pop())));\n }\n }\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < lines.length",
"i",
"lines.length",
"lines",
"lines.length",
"i++",
"i++",
"i",
"{\n if (isNumber(lines[i])) {\n ad.push(lines[i]);\n } else {\n if (lines[i].equals(\"+\")) {\n ad.push(String.valueOf(ip(ad.pop()) + ip(ad.pop())));\n } else if (lines[i].equals(\"-\")) {\n ad.push(String.valueOf(-ip(ad.pop()) + ip(ad.pop())));\n } else {\n ad.push(String.valueOf(ip(ad.pop()) * ip(ad.pop())));\n }\n }\n }",
"{\n if (isNumber(lines[i])) {\n ad.push(lines[i]);\n } else {\n if (lines[i].equals(\"+\")) {\n ad.push(String.valueOf(ip(ad.pop()) + ip(ad.pop())));\n } else if (lines[i].equals(\"-\")) {\n ad.push(String.valueOf(-ip(ad.pop()) + ip(ad.pop())));\n } else {\n ad.push(String.valueOf(ip(ad.pop()) * ip(ad.pop())));\n }\n }\n }",
"if (isNumber(lines[i])) {\n ad.push(lines[i]);\n } else {\n if (lines[i].equals(\"+\")) {\n ad.push(String.valueOf(ip(ad.pop()) + ip(ad.pop())));\n } else if (lines[i].equals(\"-\")) {\n ad.push(String.valueOf(-ip(ad.pop()) + ip(ad.pop())));\n } else {\n ad.push(String.valueOf(ip(ad.pop()) * ip(ad.pop())));\n }\n }",
"isNumber(lines[i])",
"isNumber",
"lines[i]",
"lines",
"i",
"{\n ad.push(lines[i]);\n }",
"ad.push(lines[i])",
"ad.push",
"ad",
"lines[i]",
"lines",
"i",
"{\n if (lines[i].equals(\"+\")) {\n ad.push(String.valueOf(ip(ad.pop()) + ip(ad.pop())));\n } else if (lines[i].equals(\"-\")) {\n ad.push(String.valueOf(-ip(ad.pop()) + ip(ad.pop())));\n } else {\n ad.push(String.valueOf(ip(ad.pop()) * ip(ad.pop())));\n }\n }",
"if (lines[i].equals(\"+\")) {\n ad.push(String.valueOf(ip(ad.pop()) + ip(ad.pop())));\n } else if (lines[i].equals(\"-\")) {\n ad.push(String.valueOf(-ip(ad.pop()) + ip(ad.pop())));\n } else {\n ad.push(String.valueOf(ip(ad.pop()) * ip(ad.pop())));\n }",
"lines[i].equals(\"+\")",
"lines[i].equals",
"lines[i]",
"lines",
"i",
"\"+\"",
"{\n ad.push(String.valueOf(ip(ad.pop()) + ip(ad.pop())));\n }",
"ad.push(String.valueOf(ip(ad.pop()) + ip(ad.pop())))",
"ad.push",
"ad",
"String.valueOf(ip(ad.pop()) + ip(ad.pop()))",
"String.valueOf",
"String",
"ip(ad.pop()) + ip(ad.pop())",
"ip(ad.pop())",
"ip",
"ad.pop()",
"ad.pop",
"ad",
"ip(ad.pop())",
"ip",
"ad.pop()",
"ad.pop",
"ad",
"if (lines[i].equals(\"-\")) {\n ad.push(String.valueOf(-ip(ad.pop()) + ip(ad.pop())));\n } else {\n ad.push(String.valueOf(ip(ad.pop()) * ip(ad.pop())));\n }",
"lines[i].equals(\"-\")",
"lines[i].equals",
"lines[i]",
"lines",
"i",
"\"-\"",
"{\n ad.push(String.valueOf(-ip(ad.pop()) + ip(ad.pop())));\n }",
"ad.push(String.valueOf(-ip(ad.pop()) + ip(ad.pop())))",
"ad.push",
"ad",
"String.valueOf(-ip(ad.pop()) + ip(ad.pop()))",
"String.valueOf",
"String",
"-ip(ad.pop()) + ip(ad.pop())",
"-ip(ad.pop())",
"ip(ad.pop())",
"ip",
"ad.pop()",
"ad.pop",
"ad",
"ip(ad.pop())",
"ip",
"ad.pop()",
"ad.pop",
"ad",
"{\n ad.push(String.valueOf(ip(ad.pop()) * ip(ad.pop())));\n }",
"ad.push(String.valueOf(ip(ad.pop()) * ip(ad.pop())))",
"ad.push",
"ad",
"String.valueOf(ip(ad.pop()) * ip(ad.pop()))",
"String.valueOf",
"String",
"ip(ad.pop()) * ip(ad.pop())",
"ip(ad.pop())",
"ip",
"ad.pop()",
"ad.pop",
"ad",
"ip(ad.pop())",
"ip",
"ad.pop()",
"ad.pop",
"ad",
"System.out.println(ad.pop())",
"System.out.println",
"System.out",
"System",
"System.out",
"ad.pop()",
"ad.pop",
"ad",
"String[] args",
"args",
"static boolean isNumber(String num) {\n return Pattern.compile(\"^\\\\-?[0-9]*\\\\.?[0-9]+$\").matcher(num).find();\n }",
"isNumber",
"{\n return Pattern.compile(\"^\\\\-?[0-9]*\\\\.?[0-9]+$\").matcher(num).find();\n }",
"return Pattern.compile(\"^\\\\-?[0-9]*\\\\.?[0-9]+$\").matcher(num).find();",
"Pattern.compile(\"^\\\\-?[0-9]*\\\\.?[0-9]+$\").matcher(num).find()",
"Pattern.compile(\"^\\\\-?[0-9]*\\\\.?[0-9]+$\").matcher(num).find",
"Pattern.compile(\"^\\\\-?[0-9]*\\\\.?[0-9]+$\").matcher(num)",
"Pattern.compile(\"^\\\\-?[0-9]*\\\\.?[0-9]+$\").matcher",
"Pattern.compile(\"^\\\\-?[0-9]*\\\\.?[0-9]+$\")",
"Pattern.compile",
"Pattern",
"\"^\\\\-?[0-9]*\\\\.?[0-9]+$\"",
"num",
"String num",
"num",
"static int[] createListInt(String line) {\n String[] lines = line.split(\" \");\n int n = lines.length;\n int[] list = new int[n];\n while (n-- > 0) {\n list[n] = Integer.parseInt(lines[n]);\n }\n return list;\n }",
"createListInt",
"{\n String[] lines = line.split(\" \");\n int n = lines.length;\n int[] list = new int[n];\n while (n-- > 0) {\n list[n] = Integer.parseInt(lines[n]);\n }\n return list;\n }",
"String[] lines = line.split(\" \");",
"lines",
"line.split(\" \")",
"line.split",
"line",
"\" \"",
"int n = lines.length;",
"n",
"lines.length",
"lines",
"lines.length",
"int[] list = new int[n];",
"list",
"new int[n]",
"n",
"while (n-- > 0) {\n list[n] = Integer.parseInt(lines[n]);\n }",
"n-- > 0",
"n--",
"n",
"0",
"{\n list[n] = Integer.parseInt(lines[n]);\n }",
"list[n] = Integer.parseInt(lines[n])",
"list[n]",
"list",
"n",
"Integer.parseInt(lines[n])",
"Integer.parseInt",
"Integer",
"lines[n]",
"lines",
"n",
"return list;",
"list",
"String line",
"line",
"static long[] createListLong(String line) {\n String[] lines = line.split(\" \");\n int n = lines.length;\n long[] list = new long[n];\n while (n-- > 0) {\n list[n] = Long.parseLong(lines[n]);\n }\n return list;\n }",
"createListLong",
"{\n String[] lines = line.split(\" \");\n int n = lines.length;\n long[] list = new long[n];\n while (n-- > 0) {\n list[n] = Long.parseLong(lines[n]);\n }\n return list;\n }",
"String[] lines = line.split(\" \");",
"lines",
"line.split(\" \")",
"line.split",
"line",
"\" \"",
"int n = lines.length;",
"n",
"lines.length",
"lines",
"lines.length",
"long[] list = new long[n];",
"list",
"new long[n]",
"n",
"while (n-- > 0) {\n list[n] = Long.parseLong(lines[n]);\n }",
"n-- > 0",
"n--",
"n",
"0",
"{\n list[n] = Long.parseLong(lines[n]);\n }",
"list[n] = Long.parseLong(lines[n])",
"list[n]",
"list",
"n",
"Long.parseLong(lines[n])",
"Long.parseLong",
"Long",
"lines[n]",
"lines",
"n",
"return list;",
"list",
"String line",
"line",
"static int ip(String s) {\n return Integer.parseInt(s);\n }",
"ip",
"{\n return Integer.parseInt(s);\n }",
"return Integer.parseInt(s);",
"Integer.parseInt(s)",
"Integer.parseInt",
"Integer",
"s",
"String s",
"s",
"static long lp(String s) {\n return Long.parseLong(s);\n }",
"lp",
"{\n return Long.parseLong(s);\n }",
"return Long.parseLong(s);",
"Long.parseLong(s)",
"Long.parseLong",
"Long",
"s",
"String s",
"s",
"public class Main {\n public static void main(String[] args) throws IOException {\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n Deque<String> ad = new ArrayDeque<String>();\n String[] lines = br.readLine().split(\" \");\n for (int i = 0; i < lines.length; i++) {\n if (isNumber(lines[i])) {\n ad.push(lines[i]);\n } else {\n if (lines[i].equals(\"+\")) {\n ad.push(String.valueOf(ip(ad.pop()) + ip(ad.pop())));\n } else if (lines[i].equals(\"-\")) {\n ad.push(String.valueOf(-ip(ad.pop()) + ip(ad.pop())));\n } else {\n ad.push(String.valueOf(ip(ad.pop()) * ip(ad.pop())));\n }\n }\n }\n System.out.println(ad.pop());\n }\n\n static boolean isNumber(String num) {\n return Pattern.compile(\"^\\\\-?[0-9]*\\\\.?[0-9]+$\").matcher(num).find();\n }\n\n static int[] createListInt(String line) {\n String[] lines = line.split(\" \");\n int n = lines.length;\n int[] list = new int[n];\n while (n-- > 0) {\n list[n] = Integer.parseInt(lines[n]);\n }\n return list;\n }\n\n static long[] createListLong(String line) {\n String[] lines = line.split(\" \");\n int n = lines.length;\n long[] list = new long[n];\n while (n-- > 0) {\n list[n] = Long.parseLong(lines[n]);\n }\n return list;\n }\n\n static int ip(String s) {\n return Integer.parseInt(s);\n }\n\n static long lp(String s) {\n return Long.parseLong(s);\n }\n}",
"public class Main {\n public static void main(String[] args) throws IOException {\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n Deque<String> ad = new ArrayDeque<String>();\n String[] lines = br.readLine().split(\" \");\n for (int i = 0; i < lines.length; i++) {\n if (isNumber(lines[i])) {\n ad.push(lines[i]);\n } else {\n if (lines[i].equals(\"+\")) {\n ad.push(String.valueOf(ip(ad.pop()) + ip(ad.pop())));\n } else if (lines[i].equals(\"-\")) {\n ad.push(String.valueOf(-ip(ad.pop()) + ip(ad.pop())));\n } else {\n ad.push(String.valueOf(ip(ad.pop()) * ip(ad.pop())));\n }\n }\n }\n System.out.println(ad.pop());\n }\n\n static boolean isNumber(String num) {\n return Pattern.compile(\"^\\\\-?[0-9]*\\\\.?[0-9]+$\").matcher(num).find();\n }\n\n static int[] createListInt(String line) {\n String[] lines = line.split(\" \");\n int n = lines.length;\n int[] list = new int[n];\n while (n-- > 0) {\n list[n] = Integer.parseInt(lines[n]);\n }\n return list;\n }\n\n static long[] createListLong(String line) {\n String[] lines = line.split(\" \");\n int n = lines.length;\n long[] list = new long[n];\n while (n-- > 0) {\n list[n] = Long.parseLong(lines[n]);\n }\n return list;\n }\n\n static int ip(String s) {\n return Integer.parseInt(s);\n }\n\n static long lp(String s) {\n return Long.parseLong(s);\n }\n}",
"Main"
] | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayDeque;
import java.util.Deque;
import java.util.regex.Pattern;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
Deque<String> ad = new ArrayDeque<String>();
String[] lines = br.readLine().split(" ");
for (int i = 0; i < lines.length; i++) {
if (isNumber(lines[i])) {
ad.push(lines[i]);
} else {
if (lines[i].equals("+")) {
ad.push(String.valueOf(ip(ad.pop()) + ip(ad.pop())));
} else if (lines[i].equals("-")) {
ad.push(String.valueOf(-ip(ad.pop()) + ip(ad.pop())));
} else {
ad.push(String.valueOf(ip(ad.pop()) * ip(ad.pop())));
}
}
}
System.out.println(ad.pop());
}
static boolean isNumber(String num) {
return Pattern.compile("^\\-?[0-9]*\\.?[0-9]+$").matcher(num).find();
}
static int[] createListInt(String line) {
String[] lines = line.split(" ");
int n = lines.length;
int[] list = new int[n];
while (n-- > 0) {
list[n] = Integer.parseInt(lines[n]);
}
return list;
}
static long[] createListLong(String line) {
String[] lines = line.split(" ");
int n = lines.length;
long[] list = new long[n];
while (n-- > 0) {
list[n] = Long.parseLong(lines[n]);
}
return list;
}
static int ip(String s) {
return Integer.parseInt(s);
}
static long lp(String s) {
return Long.parseLong(s);
}
} |
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
41,
13,
17,
12,
13,
30,
41,
13,
20,
41,
13,
41,
13,
20,
42,
4,
18,
13,
30,
0,
13,
4,
18,
13,
14,
4,
18,
13,
4,
18,
13,
17,
4,
18,
13,
4,
18,
13,
13,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
14,
4,
18,
13,
17,
4,
18,
13,
2,
13,
13,
14,
4,
18,
13,
17,
4,
18,
13,
2,
13,
13,
14,
4,
18,
13,
17,
4,
18,
13,
2,
13,
13,
4,
18,
18,
13,
13,
4,
18,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
106,
11
],
[
106,
12
],
[
12,
13
],
[
12,
14
],
[
106,
15
],
[
15,
16
],
[
15,
17
],
[
17,
18
],
[
18,
19
],
[
18,
20
],
[
17,
21
],
[
21,
22
],
[
17,
23
],
[
23,
24
],
[
23,
25
],
[
17,
26
],
[
26,
27
],
[
27,
28
],
[
28,
29
],
[
26,
30
],
[
30,
31
],
[
31,
32
],
[
31,
33
],
[
33,
34
],
[
34,
35
],
[
30,
36
],
[
36,
37
],
[
37,
38
],
[
38,
39
],
[
37,
40
],
[
40,
41
],
[
41,
42
],
[
40,
43
],
[
36,
44
],
[
44,
45
],
[
45,
46
],
[
44,
47
],
[
47,
48
],
[
48,
49
],
[
47,
50
],
[
36,
51
],
[
51,
52
],
[
52,
53
],
[
52,
54
],
[
54,
55
],
[
55,
56
],
[
51,
57
],
[
57,
58
],
[
57,
59
],
[
59,
60
],
[
60,
61
],
[
51,
62
],
[
62,
63
],
[
63,
64
],
[
64,
65
],
[
63,
66
],
[
62,
67
],
[
67,
68
],
[
68,
69
],
[
67,
70
],
[
70,
71
],
[
70,
72
],
[
62,
73
],
[
73,
74
],
[
74,
75
],
[
75,
76
],
[
74,
77
],
[
73,
78
],
[
78,
79
],
[
79,
80
],
[
78,
81
],
[
81,
82
],
[
81,
83
],
[
73,
84
],
[
84,
85
],
[
85,
86
],
[
86,
87
],
[
85,
88
],
[
84,
89
],
[
89,
90
],
[
90,
91
],
[
89,
92
],
[
92,
93
],
[
92,
94
],
[
17,
95
],
[
95,
96
],
[
96,
97
],
[
97,
98
],
[
97,
99
],
[
95,
100
],
[
100,
101
],
[
101,
102
],
[
15,
103
],
[
103,
104
],
[
0,
105
],
[
105,
106
],
[
105,
107
]
] | [
"import java.util.*;\nimport java.io.*;\nimport java.lang.*;\n\npublic class Main {\n static final int INF = 1000000000; \n \n public static void main(String[] args) throws Exception { \n Scanner input = new Scanner(System.in);\n String st;\n Stack<Integer> stack = new Stack<Integer>();\n while (input.hasNext()) { \n st = input.next();\n if (Character.isDigit(st.charAt(0))) stack.push(Integer.parseInt(st));\n else {\n int x = stack.pop();\n int y = stack.pop();\n if (st.equals(\"+\")) stack.push(x + y);\n else if (st.equals(\"-\")) stack.push(y - x);\n else if (st.equals(\"*\")) stack.push(y * x);\n }\n }\n System.out.println(stack.pop());\n } \n}",
"import java.util.*;",
"util.*",
"java",
"import java.io.*;",
"io.*",
"java",
"import java.lang.*;",
"lang.*",
"java",
"public class Main {\n static final int INF = 1000000000; \n \n public static void main(String[] args) throws Exception { \n Scanner input = new Scanner(System.in);\n String st;\n Stack<Integer> stack = new Stack<Integer>();\n while (input.hasNext()) { \n st = input.next();\n if (Character.isDigit(st.charAt(0))) stack.push(Integer.parseInt(st));\n else {\n int x = stack.pop();\n int y = stack.pop();\n if (st.equals(\"+\")) stack.push(x + y);\n else if (st.equals(\"-\")) stack.push(y - x);\n else if (st.equals(\"*\")) stack.push(y * x);\n }\n }\n System.out.println(stack.pop());\n } \n}",
"Main",
"static final int INF = 1000000000;",
"INF",
"1000000000",
"public static void main(String[] args) throws Exception { \n Scanner input = new Scanner(System.in);\n String st;\n Stack<Integer> stack = new Stack<Integer>();\n while (input.hasNext()) { \n st = input.next();\n if (Character.isDigit(st.charAt(0))) stack.push(Integer.parseInt(st));\n else {\n int x = stack.pop();\n int y = stack.pop();\n if (st.equals(\"+\")) stack.push(x + y);\n else if (st.equals(\"-\")) stack.push(y - x);\n else if (st.equals(\"*\")) stack.push(y * x);\n }\n }\n System.out.println(stack.pop());\n }",
"main",
"{ \n Scanner input = new Scanner(System.in);\n String st;\n Stack<Integer> stack = new Stack<Integer>();\n while (input.hasNext()) { \n st = input.next();\n if (Character.isDigit(st.charAt(0))) stack.push(Integer.parseInt(st));\n else {\n int x = stack.pop();\n int y = stack.pop();\n if (st.equals(\"+\")) stack.push(x + y);\n else if (st.equals(\"-\")) stack.push(y - x);\n else if (st.equals(\"*\")) stack.push(y * x);\n }\n }\n System.out.println(stack.pop());\n }",
"Scanner input = new Scanner(System.in);",
"input",
"new Scanner(System.in)",
"String st;",
"st",
"Stack<Integer> stack = new Stack<Integer>();",
"stack",
"new Stack<Integer>()",
"while (input.hasNext()) { \n st = input.next();\n if (Character.isDigit(st.charAt(0))) stack.push(Integer.parseInt(st));\n else {\n int x = stack.pop();\n int y = stack.pop();\n if (st.equals(\"+\")) stack.push(x + y);\n else if (st.equals(\"-\")) stack.push(y - x);\n else if (st.equals(\"*\")) stack.push(y * x);\n }\n }",
"input.hasNext()",
"input.hasNext",
"input",
"{ \n st = input.next();\n if (Character.isDigit(st.charAt(0))) stack.push(Integer.parseInt(st));\n else {\n int x = stack.pop();\n int y = stack.pop();\n if (st.equals(\"+\")) stack.push(x + y);\n else if (st.equals(\"-\")) stack.push(y - x);\n else if (st.equals(\"*\")) stack.push(y * x);\n }\n }",
"st = input.next()",
"st",
"input.next()",
"input.next",
"input",
"if (Character.isDigit(st.charAt(0))) stack.push(Integer.parseInt(st));\n else {\n int x = stack.pop();\n int y = stack.pop();\n if (st.equals(\"+\")) stack.push(x + y);\n else if (st.equals(\"-\")) stack.push(y - x);\n else if (st.equals(\"*\")) stack.push(y * x);\n }",
"Character.isDigit(st.charAt(0))",
"Character.isDigit",
"Character",
"st.charAt(0)",
"st.charAt",
"st",
"0",
"stack.push(Integer.parseInt(st))",
"stack.push",
"stack",
"Integer.parseInt(st)",
"Integer.parseInt",
"Integer",
"st",
"{\n int x = stack.pop();\n int y = stack.pop();\n if (st.equals(\"+\")) stack.push(x + y);\n else if (st.equals(\"-\")) stack.push(y - x);\n else if (st.equals(\"*\")) stack.push(y * x);\n }",
"int x = stack.pop();",
"x",
"stack.pop()",
"stack.pop",
"stack",
"int y = stack.pop();",
"y",
"stack.pop()",
"stack.pop",
"stack",
"if (st.equals(\"+\")) stack.push(x + y);\n else if (st.equals(\"-\")) stack.push(y - x);\n else if (st.equals(\"*\")) stack.push(y * x);",
"st.equals(\"+\")",
"st.equals",
"st",
"\"+\"",
"stack.push(x + y)",
"stack.push",
"stack",
"x + y",
"x",
"y",
"if (st.equals(\"-\")) stack.push(y - x);\n else if (st.equals(\"*\")) stack.push(y * x);",
"st.equals(\"-\")",
"st.equals",
"st",
"\"-\"",
"stack.push(y - x)",
"stack.push",
"stack",
"y - x",
"y",
"x",
"if (st.equals(\"*\")) stack.push(y * x);",
"st.equals(\"*\")",
"st.equals",
"st",
"\"*\"",
"stack.push(y * x)",
"stack.push",
"stack",
"y * x",
"y",
"x",
"System.out.println(stack.pop())",
"System.out.println",
"System.out",
"System",
"System.out",
"stack.pop()",
"stack.pop",
"stack",
"String[] args",
"args",
"public class Main {\n static final int INF = 1000000000; \n \n public static void main(String[] args) throws Exception { \n Scanner input = new Scanner(System.in);\n String st;\n Stack<Integer> stack = new Stack<Integer>();\n while (input.hasNext()) { \n st = input.next();\n if (Character.isDigit(st.charAt(0))) stack.push(Integer.parseInt(st));\n else {\n int x = stack.pop();\n int y = stack.pop();\n if (st.equals(\"+\")) stack.push(x + y);\n else if (st.equals(\"-\")) stack.push(y - x);\n else if (st.equals(\"*\")) stack.push(y * x);\n }\n }\n System.out.println(stack.pop());\n } \n}",
"public class Main {\n static final int INF = 1000000000; \n \n public static void main(String[] args) throws Exception { \n Scanner input = new Scanner(System.in);\n String st;\n Stack<Integer> stack = new Stack<Integer>();\n while (input.hasNext()) { \n st = input.next();\n if (Character.isDigit(st.charAt(0))) stack.push(Integer.parseInt(st));\n else {\n int x = stack.pop();\n int y = stack.pop();\n if (st.equals(\"+\")) stack.push(x + y);\n else if (st.equals(\"-\")) stack.push(y - x);\n else if (st.equals(\"*\")) stack.push(y * x);\n }\n }\n System.out.println(stack.pop());\n } \n}",
"Main"
] | import java.util.*;
import java.io.*;
import java.lang.*;
public class Main {
static final int INF = 1000000000;
public static void main(String[] args) throws Exception {
Scanner input = new Scanner(System.in);
String st;
Stack<Integer> stack = new Stack<Integer>();
while (input.hasNext()) {
st = input.next();
if (Character.isDigit(st.charAt(0))) stack.push(Integer.parseInt(st));
else {
int x = stack.pop();
int y = stack.pop();
if (st.equals("+")) stack.push(x + y);
else if (st.equals("-")) stack.push(y - x);
else if (st.equals("*")) stack.push(y * x);
}
}
System.out.println(stack.pop());
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
17,
41,
13,
20,
28,
13,
13,
30,
30,
14,
2,
2,
4,
18,
13,
17,
4,
18,
13,
17,
4,
18,
13,
17,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
35,
13,
34,
17,
1,
4,
18,
13,
2,
13,
13,
3,
34,
17,
1,
4,
18,
13,
2,
13,
13,
3,
34,
17,
1,
4,
18,
13,
2,
13,
13,
3,
34,
1,
4,
18,
13,
29,
30,
4,
18,
13,
4,
18,
13,
13,
4,
18,
18,
13,
13,
4,
18,
13,
4,
18,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
117,
5
],
[
117,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
19,
22
],
[
8,
23
],
[
23,
24
],
[
23,
25
],
[
8,
26
],
[
26,
27
],
[
26,
28
],
[
26,
29
],
[
30,
30
],
[
30,
31
],
[
31,
32
],
[
33,
33
],
[
33,
34
],
[
34,
35
],
[
35,
36
],
[
34,
37
],
[
33,
38
],
[
38,
39
],
[
39,
40
],
[
38,
41
],
[
33,
42
],
[
42,
43
],
[
43,
44
],
[
42,
45
],
[
31,
46
],
[
46,
47
],
[
47,
48
],
[
47,
49
],
[
49,
50
],
[
50,
51
],
[
46,
52
],
[
52,
53
],
[
52,
54
],
[
54,
55
],
[
55,
56
],
[
46,
57
],
[
57,
58
],
[
57,
59
],
[
59,
60
],
[
59,
61
],
[
61,
62
],
[
62,
63
],
[
63,
64
],
[
62,
65
],
[
65,
66
],
[
65,
67
],
[
61,
68
],
[
57,
69
],
[
69,
70
],
[
69,
71
],
[
71,
72
],
[
72,
73
],
[
73,
74
],
[
72,
75
],
[
75,
76
],
[
75,
77
],
[
71,
78
],
[
57,
79
],
[
79,
80
],
[
79,
81
],
[
81,
82
],
[
82,
83
],
[
83,
84
],
[
82,
85
],
[
85,
86
],
[
85,
87
],
[
81,
88
],
[
57,
89
],
[
89,
90
],
[
90,
91
],
[
91,
92
],
[
92,
93
],
[
90,
94
],
[
31,
95
],
[
95,
96
],
[
96,
97
],
[
97,
98
],
[
96,
99
],
[
99,
100
],
[
100,
101
],
[
99,
102
],
[
8,
103
],
[
103,
104
],
[
104,
105
],
[
105,
106
],
[
105,
107
],
[
103,
108
],
[
108,
109
],
[
109,
110
],
[
8,
111
],
[
111,
112
],
[
112,
113
],
[
6,
114
],
[
114,
115
],
[
0,
116
],
[
116,
117
],
[
116,
118
]
] | [
"import java.util.*;\n\npublic class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n\n String str = sc.nextLine();\n String[] inputs = str.split(\" \");\n\n Stack<Integer> operands = new Stack<>();\n\n for (String s : inputs) {\n if (s.equals(\"+\") || s.equals(\"-\") || s.equals(\"*\")) {\n int i1 = operands.pop();\n int i2 = operands.pop();\n switch (s) {\n case \"+\":\n operands.push(i2+i1);\n break;\n case \"-\":\n operands.push(i2-i1);\n break;\n case \"*\":\n operands.push(i2*i1);\n break;\n default:\n sc.close();\n return;\n }\n } else {\n operands.push(Integer.parseInt(s));\n }\n }\n\n System.out.println(operands.pop());\n \n sc.close();\n }\n}\n",
"import java.util.*;",
"util.*",
"java",
"public class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n\n String str = sc.nextLine();\n String[] inputs = str.split(\" \");\n\n Stack<Integer> operands = new Stack<>();\n\n for (String s : inputs) {\n if (s.equals(\"+\") || s.equals(\"-\") || s.equals(\"*\")) {\n int i1 = operands.pop();\n int i2 = operands.pop();\n switch (s) {\n case \"+\":\n operands.push(i2+i1);\n break;\n case \"-\":\n operands.push(i2-i1);\n break;\n case \"*\":\n operands.push(i2*i1);\n break;\n default:\n sc.close();\n return;\n }\n } else {\n operands.push(Integer.parseInt(s));\n }\n }\n\n System.out.println(operands.pop());\n \n sc.close();\n }\n}",
"Main",
"public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n\n String str = sc.nextLine();\n String[] inputs = str.split(\" \");\n\n Stack<Integer> operands = new Stack<>();\n\n for (String s : inputs) {\n if (s.equals(\"+\") || s.equals(\"-\") || s.equals(\"*\")) {\n int i1 = operands.pop();\n int i2 = operands.pop();\n switch (s) {\n case \"+\":\n operands.push(i2+i1);\n break;\n case \"-\":\n operands.push(i2-i1);\n break;\n case \"*\":\n operands.push(i2*i1);\n break;\n default:\n sc.close();\n return;\n }\n } else {\n operands.push(Integer.parseInt(s));\n }\n }\n\n System.out.println(operands.pop());\n \n sc.close();\n }",
"main",
"{\n Scanner sc = new Scanner(System.in);\n\n String str = sc.nextLine();\n String[] inputs = str.split(\" \");\n\n Stack<Integer> operands = new Stack<>();\n\n for (String s : inputs) {\n if (s.equals(\"+\") || s.equals(\"-\") || s.equals(\"*\")) {\n int i1 = operands.pop();\n int i2 = operands.pop();\n switch (s) {\n case \"+\":\n operands.push(i2+i1);\n break;\n case \"-\":\n operands.push(i2-i1);\n break;\n case \"*\":\n operands.push(i2*i1);\n break;\n default:\n sc.close();\n return;\n }\n } else {\n operands.push(Integer.parseInt(s));\n }\n }\n\n System.out.println(operands.pop());\n \n sc.close();\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"String str = sc.nextLine();",
"str",
"sc.nextLine()",
"sc.nextLine",
"sc",
"String[] inputs = str.split(\" \");",
"inputs",
"str.split(\" \")",
"str.split",
"str",
"\" \"",
"Stack<Integer> operands = new Stack<>();",
"operands",
"new Stack<>()",
"for (String s : inputs) {\n if (s.equals(\"+\") || s.equals(\"-\") || s.equals(\"*\")) {\n int i1 = operands.pop();\n int i2 = operands.pop();\n switch (s) {\n case \"+\":\n operands.push(i2+i1);\n break;\n case \"-\":\n operands.push(i2-i1);\n break;\n case \"*\":\n operands.push(i2*i1);\n break;\n default:\n sc.close();\n return;\n }\n } else {\n operands.push(Integer.parseInt(s));\n }\n }",
"String s",
"inputs",
"{\n if (s.equals(\"+\") || s.equals(\"-\") || s.equals(\"*\")) {\n int i1 = operands.pop();\n int i2 = operands.pop();\n switch (s) {\n case \"+\":\n operands.push(i2+i1);\n break;\n case \"-\":\n operands.push(i2-i1);\n break;\n case \"*\":\n operands.push(i2*i1);\n break;\n default:\n sc.close();\n return;\n }\n } else {\n operands.push(Integer.parseInt(s));\n }\n }",
"{\n if (s.equals(\"+\") || s.equals(\"-\") || s.equals(\"*\")) {\n int i1 = operands.pop();\n int i2 = operands.pop();\n switch (s) {\n case \"+\":\n operands.push(i2+i1);\n break;\n case \"-\":\n operands.push(i2-i1);\n break;\n case \"*\":\n operands.push(i2*i1);\n break;\n default:\n sc.close();\n return;\n }\n } else {\n operands.push(Integer.parseInt(s));\n }\n }",
"if (s.equals(\"+\") || s.equals(\"-\") || s.equals(\"*\")) {\n int i1 = operands.pop();\n int i2 = operands.pop();\n switch (s) {\n case \"+\":\n operands.push(i2+i1);\n break;\n case \"-\":\n operands.push(i2-i1);\n break;\n case \"*\":\n operands.push(i2*i1);\n break;\n default:\n sc.close();\n return;\n }\n } else {\n operands.push(Integer.parseInt(s));\n }",
"s.equals(\"+\") || s.equals(\"-\") || s.equals(\"*\")",
"s.equals(\"+\") || s.equals(\"-\") || s.equals(\"*\")",
"s.equals(\"+\")",
"s.equals",
"s",
"\"+\"",
"s.equals(\"-\")",
"s.equals",
"s",
"\"-\"",
"s.equals(\"*\")",
"s.equals",
"s",
"\"*\"",
"{\n int i1 = operands.pop();\n int i2 = operands.pop();\n switch (s) {\n case \"+\":\n operands.push(i2+i1);\n break;\n case \"-\":\n operands.push(i2-i1);\n break;\n case \"*\":\n operands.push(i2*i1);\n break;\n default:\n sc.close();\n return;\n }\n }",
"int i1 = operands.pop();",
"i1",
"operands.pop()",
"operands.pop",
"operands",
"int i2 = operands.pop();",
"i2",
"operands.pop()",
"operands.pop",
"operands",
"switch (s) {\n case \"+\":\n operands.push(i2+i1);\n break;\n case \"-\":\n operands.push(i2-i1);\n break;\n case \"*\":\n operands.push(i2*i1);\n break;\n default:\n sc.close();\n return;\n }",
"s",
"case \"+\":",
"\"+\"",
"case \"+\":",
"operands.push(i2+i1)",
"operands.push",
"operands",
"i2+i1",
"i2",
"i1",
"break;",
"case \"-\":",
"\"-\"",
"case \"-\":",
"operands.push(i2-i1)",
"operands.push",
"operands",
"i2-i1",
"i2",
"i1",
"break;",
"case \"*\":",
"\"*\"",
"case \"*\":",
"operands.push(i2*i1)",
"operands.push",
"operands",
"i2*i1",
"i2",
"i1",
"break;",
"default:",
"default:",
"sc.close()",
"sc.close",
"sc",
"return;",
"{\n operands.push(Integer.parseInt(s));\n }",
"operands.push(Integer.parseInt(s))",
"operands.push",
"operands",
"Integer.parseInt(s)",
"Integer.parseInt",
"Integer",
"s",
"System.out.println(operands.pop())",
"System.out.println",
"System.out",
"System",
"System.out",
"operands.pop()",
"operands.pop",
"operands",
"sc.close()",
"sc.close",
"sc",
"String[] args",
"args",
"public class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n\n String str = sc.nextLine();\n String[] inputs = str.split(\" \");\n\n Stack<Integer> operands = new Stack<>();\n\n for (String s : inputs) {\n if (s.equals(\"+\") || s.equals(\"-\") || s.equals(\"*\")) {\n int i1 = operands.pop();\n int i2 = operands.pop();\n switch (s) {\n case \"+\":\n operands.push(i2+i1);\n break;\n case \"-\":\n operands.push(i2-i1);\n break;\n case \"*\":\n operands.push(i2*i1);\n break;\n default:\n sc.close();\n return;\n }\n } else {\n operands.push(Integer.parseInt(s));\n }\n }\n\n System.out.println(operands.pop());\n \n sc.close();\n }\n}",
"public class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n\n String str = sc.nextLine();\n String[] inputs = str.split(\" \");\n\n Stack<Integer> operands = new Stack<>();\n\n for (String s : inputs) {\n if (s.equals(\"+\") || s.equals(\"-\") || s.equals(\"*\")) {\n int i1 = operands.pop();\n int i2 = operands.pop();\n switch (s) {\n case \"+\":\n operands.push(i2+i1);\n break;\n case \"-\":\n operands.push(i2-i1);\n break;\n case \"*\":\n operands.push(i2*i1);\n break;\n default:\n sc.close();\n return;\n }\n } else {\n operands.push(Integer.parseInt(s));\n }\n }\n\n System.out.println(operands.pop());\n \n sc.close();\n }\n}",
"Main"
] | import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String str = sc.nextLine();
String[] inputs = str.split(" ");
Stack<Integer> operands = new Stack<>();
for (String s : inputs) {
if (s.equals("+") || s.equals("-") || s.equals("*")) {
int i1 = operands.pop();
int i2 = operands.pop();
switch (s) {
case "+":
operands.push(i2+i1);
break;
case "-":
operands.push(i2-i1);
break;
case "*":
operands.push(i2*i1);
break;
default:
sc.close();
return;
}
} else {
operands.push(Integer.parseInt(s));
}
}
System.out.println(operands.pop());
sc.close();
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
4,
18,
13,
17,
41,
13,
20,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
30,
14,
2,
2,
17,
4,
18,
18,
13,
13,
17,
2,
4,
18,
18,
13,
13,
17,
17,
30,
41,
13,
4,
18,
13,
18,
13,
13,
4,
18,
13,
13,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
17,
14,
2,
17,
4,
18,
18,
13,
13,
17,
30,
0,
13,
2,
13,
13,
14,
2,
17,
4,
18,
18,
13,
13,
17,
30,
0,
13,
2,
13,
13,
14,
2,
17,
4,
18,
18,
13,
13,
17,
30,
0,
13,
2,
13,
13,
30,
4,
18,
18,
13,
13,
17,
4,
18,
13,
13,
4,
18,
18,
13,
13,
4,
18,
13,
23,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
12,
14
],
[
11,
15
],
[
15,
16
],
[
15,
17
],
[
17,
18
],
[
18,
19
],
[
19,
20
],
[
20,
21
],
[
17,
22
],
[
11,
23
],
[
23,
24
],
[
23,
25
],
[
11,
26
],
[
26,
27
],
[
27,
28
],
[
28,
29
],
[
28,
30
],
[
26,
31
],
[
31,
32
],
[
31,
33
],
[
33,
34
],
[
33,
35
],
[
26,
36
],
[
36,
37
],
[
37,
38
],
[
26,
39
],
[
40,
40
],
[
40,
41
],
[
41,
42
],
[
42,
43
],
[
43,
44
],
[
43,
45
],
[
45,
46
],
[
46,
47
],
[
47,
48
],
[
47,
49
],
[
45,
50
],
[
42,
51
],
[
51,
52
],
[
52,
53
],
[
53,
54
],
[
54,
55
],
[
54,
56
],
[
52,
57
],
[
51,
58
],
[
41,
59
],
[
59,
60
],
[
60,
61
],
[
60,
62
],
[
62,
63
],
[
63,
64
],
[
62,
65
],
[
65,
66
],
[
65,
67
],
[
59,
68
],
[
68,
69
],
[
69,
70
],
[
68,
71
],
[
41,
72
],
[
72,
73
],
[
73,
74
],
[
73,
75
],
[
75,
76
],
[
76,
77
],
[
72,
78
],
[
78,
79
],
[
78,
80
],
[
80,
81
],
[
81,
82
],
[
72,
83
],
[
83,
84
],
[
83,
85
],
[
72,
86
],
[
86,
87
],
[
87,
88
],
[
87,
89
],
[
89,
90
],
[
90,
91
],
[
91,
92
],
[
91,
93
],
[
89,
94
],
[
86,
95
],
[
95,
96
],
[
96,
97
],
[
96,
98
],
[
98,
99
],
[
98,
100
],
[
86,
101
],
[
101,
102
],
[
102,
103
],
[
102,
104
],
[
104,
105
],
[
105,
106
],
[
106,
107
],
[
106,
108
],
[
104,
109
],
[
101,
110
],
[
110,
111
],
[
111,
112
],
[
111,
113
],
[
113,
114
],
[
113,
115
],
[
101,
116
],
[
116,
117
],
[
117,
118
],
[
117,
119
],
[
119,
120
],
[
120,
121
],
[
121,
122
],
[
121,
123
],
[
119,
124
],
[
116,
125
],
[
125,
126
],
[
126,
127
],
[
126,
128
],
[
128,
129
],
[
128,
130
],
[
116,
131
],
[
131,
132
],
[
132,
133
],
[
133,
134
],
[
134,
135
],
[
134,
136
],
[
132,
137
],
[
72,
138
],
[
138,
139
],
[
139,
140
],
[
138,
141
],
[
11,
142
],
[
142,
143
],
[
143,
144
],
[
144,
145
],
[
144,
146
],
[
142,
147
],
[
147,
148
],
[
148,
149
],
[
9,
150
],
[
150,
151
]
] | [
"import java.io.*;\nimport java.util.*;\n\nclass Main{\n\tpublic static void main(String[] args)throws IOException {\n\t\tBufferedReader br=new BufferedReader(new InputStreamReader(System.in));\n\t\tString[] A=br.readLine().split(\"\\\\s+\");\n\t\tLinkedList<Integer> stack=new LinkedList<Integer>();\n\t\tfor (int i = 0; i < A.length; i++) {\n\t\t\tif ('0'<=A[i].charAt(0) && A[i].charAt(0)<='9') {\n\t\t\t\t\tint num=Integer.parseInt(A[i]);\t\t\t\t\n\t\t\t\t\tstack.push(num);\n\t\t\t}else{\n\t\t\t\t\n\t\t\t\tint b=stack.pop();\n\t\t\t\tint a=stack.pop();\n\t\t\t int c=0;\n\t\t\t if('+'==A[i].charAt(0)){\n\t\t\t \tc=a+b;\n\t\t\t }else if('-'==A[i].charAt(0)){\n\t\t\t \tc=a-b;\n\t\t\t }else if('*'==A[i].charAt(0)){\n\t\t\t \tc=a*b;\n\t\t\t }else{\n\t\t\t \tSystem.out.println(\"bad\");\n\t\t\t }\n\t\t\t stack.push(c);\t\t \n\t\t\t}\n\t\t\t\n\t\t}\n\t\tSystem.out.println(stack.pop());\n\t}\n}",
"import java.io.*;",
"io.*",
"java",
"import java.util.*;",
"util.*",
"java",
"class Main{\n\tpublic static void main(String[] args)throws IOException {\n\t\tBufferedReader br=new BufferedReader(new InputStreamReader(System.in));\n\t\tString[] A=br.readLine().split(\"\\\\s+\");\n\t\tLinkedList<Integer> stack=new LinkedList<Integer>();\n\t\tfor (int i = 0; i < A.length; i++) {\n\t\t\tif ('0'<=A[i].charAt(0) && A[i].charAt(0)<='9') {\n\t\t\t\t\tint num=Integer.parseInt(A[i]);\t\t\t\t\n\t\t\t\t\tstack.push(num);\n\t\t\t}else{\n\t\t\t\t\n\t\t\t\tint b=stack.pop();\n\t\t\t\tint a=stack.pop();\n\t\t\t int c=0;\n\t\t\t if('+'==A[i].charAt(0)){\n\t\t\t \tc=a+b;\n\t\t\t }else if('-'==A[i].charAt(0)){\n\t\t\t \tc=a-b;\n\t\t\t }else if('*'==A[i].charAt(0)){\n\t\t\t \tc=a*b;\n\t\t\t }else{\n\t\t\t \tSystem.out.println(\"bad\");\n\t\t\t }\n\t\t\t stack.push(c);\t\t \n\t\t\t}\n\t\t\t\n\t\t}\n\t\tSystem.out.println(stack.pop());\n\t}\n}",
"Main",
"public static void main(String[] args)throws IOException {\n\t\tBufferedReader br=new BufferedReader(new InputStreamReader(System.in));\n\t\tString[] A=br.readLine().split(\"\\\\s+\");\n\t\tLinkedList<Integer> stack=new LinkedList<Integer>();\n\t\tfor (int i = 0; i < A.length; i++) {\n\t\t\tif ('0'<=A[i].charAt(0) && A[i].charAt(0)<='9') {\n\t\t\t\t\tint num=Integer.parseInt(A[i]);\t\t\t\t\n\t\t\t\t\tstack.push(num);\n\t\t\t}else{\n\t\t\t\t\n\t\t\t\tint b=stack.pop();\n\t\t\t\tint a=stack.pop();\n\t\t\t int c=0;\n\t\t\t if('+'==A[i].charAt(0)){\n\t\t\t \tc=a+b;\n\t\t\t }else if('-'==A[i].charAt(0)){\n\t\t\t \tc=a-b;\n\t\t\t }else if('*'==A[i].charAt(0)){\n\t\t\t \tc=a*b;\n\t\t\t }else{\n\t\t\t \tSystem.out.println(\"bad\");\n\t\t\t }\n\t\t\t stack.push(c);\t\t \n\t\t\t}\n\t\t\t\n\t\t}\n\t\tSystem.out.println(stack.pop());\n\t}",
"main",
"{\n\t\tBufferedReader br=new BufferedReader(new InputStreamReader(System.in));\n\t\tString[] A=br.readLine().split(\"\\\\s+\");\n\t\tLinkedList<Integer> stack=new LinkedList<Integer>();\n\t\tfor (int i = 0; i < A.length; i++) {\n\t\t\tif ('0'<=A[i].charAt(0) && A[i].charAt(0)<='9') {\n\t\t\t\t\tint num=Integer.parseInt(A[i]);\t\t\t\t\n\t\t\t\t\tstack.push(num);\n\t\t\t}else{\n\t\t\t\t\n\t\t\t\tint b=stack.pop();\n\t\t\t\tint a=stack.pop();\n\t\t\t int c=0;\n\t\t\t if('+'==A[i].charAt(0)){\n\t\t\t \tc=a+b;\n\t\t\t }else if('-'==A[i].charAt(0)){\n\t\t\t \tc=a-b;\n\t\t\t }else if('*'==A[i].charAt(0)){\n\t\t\t \tc=a*b;\n\t\t\t }else{\n\t\t\t \tSystem.out.println(\"bad\");\n\t\t\t }\n\t\t\t stack.push(c);\t\t \n\t\t\t}\n\t\t\t\n\t\t}\n\t\tSystem.out.println(stack.pop());\n\t}",
"BufferedReader br=new BufferedReader(new InputStreamReader(System.in));",
"br",
"new BufferedReader(new InputStreamReader(System.in))",
"String[] A=br.readLine().split(\"\\\\s+\");",
"A",
"br.readLine().split(\"\\\\s+\")",
"br.readLine().split",
"br.readLine()",
"br.readLine",
"br",
"\"\\\\s+\"",
"LinkedList<Integer> stack=new LinkedList<Integer>();",
"stack",
"new LinkedList<Integer>()",
"for (int i = 0; i < A.length; i++) {\n\t\t\tif ('0'<=A[i].charAt(0) && A[i].charAt(0)<='9') {\n\t\t\t\t\tint num=Integer.parseInt(A[i]);\t\t\t\t\n\t\t\t\t\tstack.push(num);\n\t\t\t}else{\n\t\t\t\t\n\t\t\t\tint b=stack.pop();\n\t\t\t\tint a=stack.pop();\n\t\t\t int c=0;\n\t\t\t if('+'==A[i].charAt(0)){\n\t\t\t \tc=a+b;\n\t\t\t }else if('-'==A[i].charAt(0)){\n\t\t\t \tc=a-b;\n\t\t\t }else if('*'==A[i].charAt(0)){\n\t\t\t \tc=a*b;\n\t\t\t }else{\n\t\t\t \tSystem.out.println(\"bad\");\n\t\t\t }\n\t\t\t stack.push(c);\t\t \n\t\t\t}\n\t\t\t\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < A.length",
"i",
"A.length",
"A",
"A.length",
"i++",
"i++",
"i",
"{\n\t\t\tif ('0'<=A[i].charAt(0) && A[i].charAt(0)<='9') {\n\t\t\t\t\tint num=Integer.parseInt(A[i]);\t\t\t\t\n\t\t\t\t\tstack.push(num);\n\t\t\t}else{\n\t\t\t\t\n\t\t\t\tint b=stack.pop();\n\t\t\t\tint a=stack.pop();\n\t\t\t int c=0;\n\t\t\t if('+'==A[i].charAt(0)){\n\t\t\t \tc=a+b;\n\t\t\t }else if('-'==A[i].charAt(0)){\n\t\t\t \tc=a-b;\n\t\t\t }else if('*'==A[i].charAt(0)){\n\t\t\t \tc=a*b;\n\t\t\t }else{\n\t\t\t \tSystem.out.println(\"bad\");\n\t\t\t }\n\t\t\t stack.push(c);\t\t \n\t\t\t}\n\t\t\t\n\t\t}",
"{\n\t\t\tif ('0'<=A[i].charAt(0) && A[i].charAt(0)<='9') {\n\t\t\t\t\tint num=Integer.parseInt(A[i]);\t\t\t\t\n\t\t\t\t\tstack.push(num);\n\t\t\t}else{\n\t\t\t\t\n\t\t\t\tint b=stack.pop();\n\t\t\t\tint a=stack.pop();\n\t\t\t int c=0;\n\t\t\t if('+'==A[i].charAt(0)){\n\t\t\t \tc=a+b;\n\t\t\t }else if('-'==A[i].charAt(0)){\n\t\t\t \tc=a-b;\n\t\t\t }else if('*'==A[i].charAt(0)){\n\t\t\t \tc=a*b;\n\t\t\t }else{\n\t\t\t \tSystem.out.println(\"bad\");\n\t\t\t }\n\t\t\t stack.push(c);\t\t \n\t\t\t}\n\t\t\t\n\t\t}",
"if ('0'<=A[i].charAt(0) && A[i].charAt(0)<='9') {\n\t\t\t\t\tint num=Integer.parseInt(A[i]);\t\t\t\t\n\t\t\t\t\tstack.push(num);\n\t\t\t}else{\n\t\t\t\t\n\t\t\t\tint b=stack.pop();\n\t\t\t\tint a=stack.pop();\n\t\t\t int c=0;\n\t\t\t if('+'==A[i].charAt(0)){\n\t\t\t \tc=a+b;\n\t\t\t }else if('-'==A[i].charAt(0)){\n\t\t\t \tc=a-b;\n\t\t\t }else if('*'==A[i].charAt(0)){\n\t\t\t \tc=a*b;\n\t\t\t }else{\n\t\t\t \tSystem.out.println(\"bad\");\n\t\t\t }\n\t\t\t stack.push(c);\t\t \n\t\t\t}",
"'0'<=A[i].charAt(0) && A[i].charAt(0)<='9'",
"'0'<=A[i].charAt(0)",
"'0'",
"A[i].charAt(0)",
"A[i].charAt",
"A[i]",
"A",
"i",
"0",
"A[i].charAt(0)<='9'",
"A[i].charAt(0)",
"A[i].charAt",
"A[i]",
"A",
"i",
"0",
"'9'",
"{\n\t\t\t\t\tint num=Integer.parseInt(A[i]);\t\t\t\t\n\t\t\t\t\tstack.push(num);\n\t\t\t}",
"int num=Integer.parseInt(A[i]);",
"num",
"Integer.parseInt(A[i])",
"Integer.parseInt",
"Integer",
"A[i]",
"A",
"i",
"stack.push(num)",
"stack.push",
"stack",
"num",
"{\n\t\t\t\t\n\t\t\t\tint b=stack.pop();\n\t\t\t\tint a=stack.pop();\n\t\t\t int c=0;\n\t\t\t if('+'==A[i].charAt(0)){\n\t\t\t \tc=a+b;\n\t\t\t }else if('-'==A[i].charAt(0)){\n\t\t\t \tc=a-b;\n\t\t\t }else if('*'==A[i].charAt(0)){\n\t\t\t \tc=a*b;\n\t\t\t }else{\n\t\t\t \tSystem.out.println(\"bad\");\n\t\t\t }\n\t\t\t stack.push(c);\t\t \n\t\t\t}",
"int b=stack.pop();",
"b",
"stack.pop()",
"stack.pop",
"stack",
"int a=stack.pop();",
"a",
"stack.pop()",
"stack.pop",
"stack",
"int c=0;",
"c",
"0",
"if('+'==A[i].charAt(0)){\n\t\t\t \tc=a+b;\n\t\t\t }else if('-'==A[i].charAt(0)){\n\t\t\t \tc=a-b;\n\t\t\t }else if('*'==A[i].charAt(0)){\n\t\t\t \tc=a*b;\n\t\t\t }else{\n\t\t\t \tSystem.out.println(\"bad\");\n\t\t\t }",
"'+'==A[i].charAt(0)",
"'+'",
"A[i].charAt(0)",
"A[i].charAt",
"A[i]",
"A",
"i",
"0",
"{\n\t\t\t \tc=a+b;\n\t\t\t }",
"c=a+b",
"c",
"a+b",
"a",
"b",
"if('-'==A[i].charAt(0)){\n\t\t\t \tc=a-b;\n\t\t\t }else if('*'==A[i].charAt(0)){\n\t\t\t \tc=a*b;\n\t\t\t }else{\n\t\t\t \tSystem.out.println(\"bad\");\n\t\t\t }",
"'-'==A[i].charAt(0)",
"'-'",
"A[i].charAt(0)",
"A[i].charAt",
"A[i]",
"A",
"i",
"0",
"{\n\t\t\t \tc=a-b;\n\t\t\t }",
"c=a-b",
"c",
"a-b",
"a",
"b",
"if('*'==A[i].charAt(0)){\n\t\t\t \tc=a*b;\n\t\t\t }else{\n\t\t\t \tSystem.out.println(\"bad\");\n\t\t\t }",
"'*'==A[i].charAt(0)",
"'*'",
"A[i].charAt(0)",
"A[i].charAt",
"A[i]",
"A",
"i",
"0",
"{\n\t\t\t \tc=a*b;\n\t\t\t }",
"c=a*b",
"c",
"a*b",
"a",
"b",
"{\n\t\t\t \tSystem.out.println(\"bad\");\n\t\t\t }",
"System.out.println(\"bad\")",
"System.out.println",
"System.out",
"System",
"System.out",
"\"bad\"",
"stack.push(c)",
"stack.push",
"stack",
"c",
"System.out.println(stack.pop())",
"System.out.println",
"System.out",
"System",
"System.out",
"stack.pop()",
"stack.pop",
"stack",
"String[] args",
"args"
] | import java.io.*;
import java.util.*;
class Main{
public static void main(String[] args)throws IOException {
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String[] A=br.readLine().split("\\s+");
LinkedList<Integer> stack=new LinkedList<Integer>();
for (int i = 0; i < A.length; i++) {
if ('0'<=A[i].charAt(0) && A[i].charAt(0)<='9') {
int num=Integer.parseInt(A[i]);
stack.push(num);
}else{
int b=stack.pop();
int a=stack.pop();
int c=0;
if('+'==A[i].charAt(0)){
c=a+b;
}else if('-'==A[i].charAt(0)){
c=a-b;
}else if('*'==A[i].charAt(0)){
c=a*b;
}else{
System.out.println("bad");
}
stack.push(c);
}
}
System.out.println(stack.pop());
}
} |
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
4,
18,
13,
17,
4,
18,
13,
41,
13,
20,
28,
13,
13,
30,
30,
14,
4,
13,
13,
30,
41,
13,
4,
18,
13,
13,
4,
18,
13,
13,
30,
4,
13,
13,
13,
4,
18,
18,
13,
13,
4,
18,
13,
23,
13,
12,
13,
30,
41,
13,
4,
18,
13,
17,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
35,
13,
34,
17,
1,
4,
18,
13,
2,
13,
13,
3,
34,
17,
1,
4,
18,
13,
2,
13,
13,
3,
34,
17,
1,
4,
18,
13,
2,
13,
13,
3,
34,
1,
3,
23,
13,
23,
13,
12,
13,
30,
38,
5,
13,
30,
29,
17,
30,
4,
18,
13,
13,
29,
17,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
144,
11
],
[
144,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
15,
17
],
[
14,
18
],
[
18,
19
],
[
18,
20
],
[
20,
21
],
[
21,
22
],
[
22,
23
],
[
23,
24
],
[
20,
25
],
[
14,
26
],
[
26,
27
],
[
27,
28
],
[
14,
29
],
[
29,
30
],
[
29,
31
],
[
14,
32
],
[
32,
33
],
[
32,
34
],
[
32,
35
],
[
36,
36
],
[
36,
37
],
[
37,
38
],
[
38,
39
],
[
38,
40
],
[
37,
41
],
[
41,
42
],
[
42,
43
],
[
42,
44
],
[
44,
45
],
[
45,
46
],
[
44,
47
],
[
41,
48
],
[
48,
49
],
[
49,
50
],
[
48,
51
],
[
37,
52
],
[
52,
53
],
[
53,
54
],
[
53,
55
],
[
53,
56
],
[
14,
57
],
[
57,
58
],
[
58,
59
],
[
59,
60
],
[
59,
61
],
[
57,
62
],
[
62,
63
],
[
63,
64
],
[
12,
65
],
[
65,
66
],
[
144,
67
],
[
67,
68
],
[
67,
69
],
[
69,
70
],
[
70,
71
],
[
70,
72
],
[
72,
73
],
[
73,
74
],
[
72,
75
],
[
69,
76
],
[
76,
77
],
[
76,
78
],
[
78,
79
],
[
79,
80
],
[
69,
81
],
[
81,
82
],
[
81,
83
],
[
83,
84
],
[
84,
85
],
[
69,
86
],
[
86,
87
],
[
86,
88
],
[
88,
89
],
[
88,
90
],
[
90,
91
],
[
91,
92
],
[
92,
93
],
[
91,
94
],
[
94,
95
],
[
94,
96
],
[
90,
97
],
[
86,
98
],
[
98,
99
],
[
98,
100
],
[
100,
101
],
[
101,
102
],
[
102,
103
],
[
101,
104
],
[
104,
105
],
[
104,
106
],
[
100,
107
],
[
86,
108
],
[
108,
109
],
[
108,
110
],
[
110,
111
],
[
111,
112
],
[
112,
113
],
[
111,
114
],
[
114,
115
],
[
114,
116
],
[
110,
117
],
[
86,
118
],
[
118,
119
],
[
119,
120
],
[
67,
121
],
[
121,
122
],
[
67,
123
],
[
123,
124
],
[
144,
125
],
[
125,
126
],
[
125,
127
],
[
127,
128
],
[
128,
129
],
[
129,
130
],
[
129,
131
],
[
131,
132
],
[
132,
133
],
[
128,
134
],
[
134,
135
],
[
135,
136
],
[
136,
137
],
[
135,
138
],
[
134,
139
],
[
139,
140
],
[
125,
141
],
[
141,
142
],
[
0,
143
],
[
143,
144
],
[
143,
145
]
] | [
"import java.util.ArrayDeque;\nimport java.util.Deque;\nimport java.util.Scanner;\n\npublic class Main {\n\n\tpublic static void main(String[] args) {\n\n\t\tScanner sc = new Scanner(System.in);\n\t\tString[] inputs = sc.nextLine().split(\" \");\n\t\tsc.close();\n\n\t\tDeque<Integer> dq = new ArrayDeque<>();\n\n\t\tfor(String val : inputs) {\n\n\t\t\tif(isInt(val)) {\n\t\t\t\tint num = Integer.parseInt(val);\n\t\t\t\tdq.push(num);\n\t\t\t} else {\n\t\t\t\tcalc(dq, val);\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.println(dq.pop());\n\n\t}\n\n\tprivate static void calc(Deque<Integer> dq, String val) {\n\n\t\tchar ope = val.charAt(0);\n\t\tint b = dq.pop();\n\t\tint a = dq.pop();\n\n\t\tswitch (ope) {\n\t\tcase '+':\n\t\t\tdq.push(a + b);\n\t\t\tbreak;\n\t\tcase '-':\n\t\t\tdq.push(a - b);\n\t\t\tbreak;\n\t\tcase '*':\n\t\t\tdq.push(a * b);\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tbreak;\n\t\t}\n\n\t}\n\n\tprivate static boolean isInt(String val) {\n\n\t\ttry {\n\t\t\tInteger.parseInt(val);\n\t\t\treturn true;\n\t\t} catch (NumberFormatException e) {\n\t\t\treturn false;\n\t\t}\n\t}\n\n}",
"import java.util.ArrayDeque;",
"ArrayDeque",
"java.util",
"import java.util.Deque;",
"Deque",
"java.util",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\n\t\tScanner sc = new Scanner(System.in);\n\t\tString[] inputs = sc.nextLine().split(\" \");\n\t\tsc.close();\n\n\t\tDeque<Integer> dq = new ArrayDeque<>();\n\n\t\tfor(String val : inputs) {\n\n\t\t\tif(isInt(val)) {\n\t\t\t\tint num = Integer.parseInt(val);\n\t\t\t\tdq.push(num);\n\t\t\t} else {\n\t\t\t\tcalc(dq, val);\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.println(dq.pop());\n\n\t}\n\n\tprivate static void calc(Deque<Integer> dq, String val) {\n\n\t\tchar ope = val.charAt(0);\n\t\tint b = dq.pop();\n\t\tint a = dq.pop();\n\n\t\tswitch (ope) {\n\t\tcase '+':\n\t\t\tdq.push(a + b);\n\t\t\tbreak;\n\t\tcase '-':\n\t\t\tdq.push(a - b);\n\t\t\tbreak;\n\t\tcase '*':\n\t\t\tdq.push(a * b);\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tbreak;\n\t\t}\n\n\t}\n\n\tprivate static boolean isInt(String val) {\n\n\t\ttry {\n\t\t\tInteger.parseInt(val);\n\t\t\treturn true;\n\t\t} catch (NumberFormatException e) {\n\t\t\treturn false;\n\t\t}\n\t}\n\n}",
"Main",
"public static void main(String[] args) {\n\n\t\tScanner sc = new Scanner(System.in);\n\t\tString[] inputs = sc.nextLine().split(\" \");\n\t\tsc.close();\n\n\t\tDeque<Integer> dq = new ArrayDeque<>();\n\n\t\tfor(String val : inputs) {\n\n\t\t\tif(isInt(val)) {\n\t\t\t\tint num = Integer.parseInt(val);\n\t\t\t\tdq.push(num);\n\t\t\t} else {\n\t\t\t\tcalc(dq, val);\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.println(dq.pop());\n\n\t}",
"main",
"{\n\n\t\tScanner sc = new Scanner(System.in);\n\t\tString[] inputs = sc.nextLine().split(\" \");\n\t\tsc.close();\n\n\t\tDeque<Integer> dq = new ArrayDeque<>();\n\n\t\tfor(String val : inputs) {\n\n\t\t\tif(isInt(val)) {\n\t\t\t\tint num = Integer.parseInt(val);\n\t\t\t\tdq.push(num);\n\t\t\t} else {\n\t\t\t\tcalc(dq, val);\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.println(dq.pop());\n\n\t}",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"String[] inputs = sc.nextLine().split(\" \");",
"inputs",
"sc.nextLine().split(\" \")",
"sc.nextLine().split",
"sc.nextLine()",
"sc.nextLine",
"sc",
"\" \"",
"sc.close()",
"sc.close",
"sc",
"Deque<Integer> dq = new ArrayDeque<>();",
"dq",
"new ArrayDeque<>()",
"for(String val : inputs) {\n\n\t\t\tif(isInt(val)) {\n\t\t\t\tint num = Integer.parseInt(val);\n\t\t\t\tdq.push(num);\n\t\t\t} else {\n\t\t\t\tcalc(dq, val);\n\t\t\t}\n\t\t}",
"String val",
"inputs",
"{\n\n\t\t\tif(isInt(val)) {\n\t\t\t\tint num = Integer.parseInt(val);\n\t\t\t\tdq.push(num);\n\t\t\t} else {\n\t\t\t\tcalc(dq, val);\n\t\t\t}\n\t\t}",
"{\n\n\t\t\tif(isInt(val)) {\n\t\t\t\tint num = Integer.parseInt(val);\n\t\t\t\tdq.push(num);\n\t\t\t} else {\n\t\t\t\tcalc(dq, val);\n\t\t\t}\n\t\t}",
"if(isInt(val)) {\n\t\t\t\tint num = Integer.parseInt(val);\n\t\t\t\tdq.push(num);\n\t\t\t} else {\n\t\t\t\tcalc(dq, val);\n\t\t\t}",
"isInt(val)",
"isInt",
"val",
"{\n\t\t\t\tint num = Integer.parseInt(val);\n\t\t\t\tdq.push(num);\n\t\t\t}",
"int num = Integer.parseInt(val);",
"num",
"Integer.parseInt(val)",
"Integer.parseInt",
"Integer",
"val",
"dq.push(num)",
"dq.push",
"dq",
"num",
"{\n\t\t\t\tcalc(dq, val);\n\t\t\t}",
"calc(dq, val)",
"calc",
"dq",
"val",
"System.out.println(dq.pop())",
"System.out.println",
"System.out",
"System",
"System.out",
"dq.pop()",
"dq.pop",
"dq",
"String[] args",
"args",
"private static void calc(Deque<Integer> dq, String val) {\n\n\t\tchar ope = val.charAt(0);\n\t\tint b = dq.pop();\n\t\tint a = dq.pop();\n\n\t\tswitch (ope) {\n\t\tcase '+':\n\t\t\tdq.push(a + b);\n\t\t\tbreak;\n\t\tcase '-':\n\t\t\tdq.push(a - b);\n\t\t\tbreak;\n\t\tcase '*':\n\t\t\tdq.push(a * b);\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tbreak;\n\t\t}\n\n\t}",
"calc",
"{\n\n\t\tchar ope = val.charAt(0);\n\t\tint b = dq.pop();\n\t\tint a = dq.pop();\n\n\t\tswitch (ope) {\n\t\tcase '+':\n\t\t\tdq.push(a + b);\n\t\t\tbreak;\n\t\tcase '-':\n\t\t\tdq.push(a - b);\n\t\t\tbreak;\n\t\tcase '*':\n\t\t\tdq.push(a * b);\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tbreak;\n\t\t}\n\n\t}",
"char ope = val.charAt(0);",
"ope",
"val.charAt(0)",
"val.charAt",
"val",
"0",
"int b = dq.pop();",
"b",
"dq.pop()",
"dq.pop",
"dq",
"int a = dq.pop();",
"a",
"dq.pop()",
"dq.pop",
"dq",
"switch (ope) {\n\t\tcase '+':\n\t\t\tdq.push(a + b);\n\t\t\tbreak;\n\t\tcase '-':\n\t\t\tdq.push(a - b);\n\t\t\tbreak;\n\t\tcase '*':\n\t\t\tdq.push(a * b);\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tbreak;\n\t\t}",
"ope",
"case '+':",
"'+'",
"case '+':",
"dq.push(a + b)",
"dq.push",
"dq",
"a + b",
"a",
"b",
"break;",
"case '-':",
"'-'",
"case '-':",
"dq.push(a - b)",
"dq.push",
"dq",
"a - b",
"a",
"b",
"break;",
"case '*':",
"'*'",
"case '*':",
"dq.push(a * b)",
"dq.push",
"dq",
"a * b",
"a",
"b",
"break;",
"default:",
"default:",
"break;",
"Deque<Integer> dq",
"dq",
"String val",
"val",
"private static boolean isInt(String val) {\n\n\t\ttry {\n\t\t\tInteger.parseInt(val);\n\t\t\treturn true;\n\t\t} catch (NumberFormatException e) {\n\t\t\treturn false;\n\t\t}\n\t}",
"isInt",
"{\n\n\t\ttry {\n\t\t\tInteger.parseInt(val);\n\t\t\treturn true;\n\t\t} catch (NumberFormatException e) {\n\t\t\treturn false;\n\t\t}\n\t}",
"try {\n\t\t\tInteger.parseInt(val);\n\t\t\treturn true;\n\t\t} catch (NumberFormatException e) {\n\t\t\treturn false;\n\t\t}",
"catch (NumberFormatException e) {\n\t\t\treturn false;\n\t\t}",
"NumberFormatException e",
"{\n\t\t\treturn false;\n\t\t}",
"return false;",
"false",
"{\n\t\t\tInteger.parseInt(val);\n\t\t\treturn true;\n\t\t}",
"Integer.parseInt(val)",
"Integer.parseInt",
"Integer",
"val",
"return true;",
"true",
"String val",
"val",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\n\t\tScanner sc = new Scanner(System.in);\n\t\tString[] inputs = sc.nextLine().split(\" \");\n\t\tsc.close();\n\n\t\tDeque<Integer> dq = new ArrayDeque<>();\n\n\t\tfor(String val : inputs) {\n\n\t\t\tif(isInt(val)) {\n\t\t\t\tint num = Integer.parseInt(val);\n\t\t\t\tdq.push(num);\n\t\t\t} else {\n\t\t\t\tcalc(dq, val);\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.println(dq.pop());\n\n\t}\n\n\tprivate static void calc(Deque<Integer> dq, String val) {\n\n\t\tchar ope = val.charAt(0);\n\t\tint b = dq.pop();\n\t\tint a = dq.pop();\n\n\t\tswitch (ope) {\n\t\tcase '+':\n\t\t\tdq.push(a + b);\n\t\t\tbreak;\n\t\tcase '-':\n\t\t\tdq.push(a - b);\n\t\t\tbreak;\n\t\tcase '*':\n\t\t\tdq.push(a * b);\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tbreak;\n\t\t}\n\n\t}\n\n\tprivate static boolean isInt(String val) {\n\n\t\ttry {\n\t\t\tInteger.parseInt(val);\n\t\t\treturn true;\n\t\t} catch (NumberFormatException e) {\n\t\t\treturn false;\n\t\t}\n\t}\n\n}",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\n\t\tScanner sc = new Scanner(System.in);\n\t\tString[] inputs = sc.nextLine().split(\" \");\n\t\tsc.close();\n\n\t\tDeque<Integer> dq = new ArrayDeque<>();\n\n\t\tfor(String val : inputs) {\n\n\t\t\tif(isInt(val)) {\n\t\t\t\tint num = Integer.parseInt(val);\n\t\t\t\tdq.push(num);\n\t\t\t} else {\n\t\t\t\tcalc(dq, val);\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.println(dq.pop());\n\n\t}\n\n\tprivate static void calc(Deque<Integer> dq, String val) {\n\n\t\tchar ope = val.charAt(0);\n\t\tint b = dq.pop();\n\t\tint a = dq.pop();\n\n\t\tswitch (ope) {\n\t\tcase '+':\n\t\t\tdq.push(a + b);\n\t\t\tbreak;\n\t\tcase '-':\n\t\t\tdq.push(a - b);\n\t\t\tbreak;\n\t\tcase '*':\n\t\t\tdq.push(a * b);\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tbreak;\n\t\t}\n\n\t}\n\n\tprivate static boolean isInt(String val) {\n\n\t\ttry {\n\t\t\tInteger.parseInt(val);\n\t\t\treturn true;\n\t\t} catch (NumberFormatException e) {\n\t\t\treturn false;\n\t\t}\n\t}\n\n}",
"Main"
] | import java.util.ArrayDeque;
import java.util.Deque;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String[] inputs = sc.nextLine().split(" ");
sc.close();
Deque<Integer> dq = new ArrayDeque<>();
for(String val : inputs) {
if(isInt(val)) {
int num = Integer.parseInt(val);
dq.push(num);
} else {
calc(dq, val);
}
}
System.out.println(dq.pop());
}
private static void calc(Deque<Integer> dq, String val) {
char ope = val.charAt(0);
int b = dq.pop();
int a = dq.pop();
switch (ope) {
case '+':
dq.push(a + b);
break;
case '-':
dq.push(a - b);
break;
case '*':
dq.push(a * b);
break;
default:
break;
}
}
private static boolean isInt(String val) {
try {
Integer.parseInt(val);
return true;
} catch (NumberFormatException e) {
return false;
}
}
} |
[
7,
15,
13,
17,
6,
13,
41,
13,
41,
13,
12,
13,
30,
0,
18,
36,
13,
17,
0,
13,
20,
17,
12,
13,
30,
0,
18,
13,
40,
13,
13,
23,
13,
12,
13,
30,
40,
13,
29,
18,
13,
13,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
20,
42,
4,
18,
13,
30,
41,
13,
4,
18,
13,
14,
2,
4,
18,
13,
17,
17,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
4,
18,
13,
2,
13,
13,
14,
2,
4,
18,
13,
17,
17,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
4,
18,
13,
2,
13,
13,
14,
2,
4,
18,
13,
17,
17,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
4,
18,
13,
2,
13,
13,
30,
4,
18,
13,
4,
18,
13,
13,
4,
18,
18,
13,
13,
4,
18,
13,
23,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
6,
7
],
[
4,
8
],
[
8,
9
],
[
4,
10
],
[
10,
11
],
[
10,
12
],
[
12,
13
],
[
13,
14
],
[
14,
15
],
[
14,
16
],
[
13,
17
],
[
12,
18
],
[
18,
19
],
[
18,
20
],
[
4,
22
],
[
22,
23
],
[
22,
24
],
[
24,
25
],
[
25,
26
],
[
26,
27
],
[
26,
28
],
[
28,
29
],
[
25,
30
],
[
22,
31
],
[
31,
32
],
[
4,
33
],
[
33,
34
],
[
33,
35
],
[
35,
36
],
[
36,
37
],
[
35,
38
],
[
38,
39
],
[
39,
40
],
[
39,
41
],
[
0,
42
],
[
42,
43
],
[
42,
44
],
[
44,
45
],
[
44,
46
],
[
46,
47
],
[
47,
48
],
[
47,
49
],
[
46,
50
],
[
50,
51
],
[
50,
52
],
[
46,
53
],
[
53,
54
],
[
54,
55
],
[
55,
56
],
[
53,
57
],
[
57,
58
],
[
58,
59
],
[
58,
60
],
[
60,
61
],
[
61,
62
],
[
57,
63
],
[
63,
64
],
[
64,
65
],
[
65,
66
],
[
66,
67
],
[
65,
68
],
[
64,
69
],
[
63,
70
],
[
70,
71
],
[
71,
72
],
[
71,
73
],
[
73,
74
],
[
74,
75
],
[
70,
76
],
[
76,
77
],
[
76,
78
],
[
78,
79
],
[
79,
80
],
[
70,
81
],
[
81,
82
],
[
82,
83
],
[
81,
84
],
[
84,
85
],
[
84,
86
],
[
63,
87
],
[
87,
88
],
[
88,
89
],
[
89,
90
],
[
90,
91
],
[
89,
92
],
[
88,
93
],
[
87,
94
],
[
94,
95
],
[
95,
96
],
[
95,
97
],
[
97,
98
],
[
98,
99
],
[
94,
100
],
[
100,
101
],
[
100,
102
],
[
102,
103
],
[
103,
104
],
[
94,
105
],
[
105,
106
],
[
106,
107
],
[
105,
108
],
[
108,
109
],
[
108,
110
],
[
87,
111
],
[
111,
112
],
[
112,
113
],
[
113,
114
],
[
114,
115
],
[
113,
116
],
[
112,
117
],
[
111,
118
],
[
118,
119
],
[
119,
120
],
[
119,
121
],
[
121,
122
],
[
122,
123
],
[
118,
124
],
[
124,
125
],
[
124,
126
],
[
126,
127
],
[
127,
128
],
[
118,
129
],
[
129,
130
],
[
130,
131
],
[
129,
132
],
[
132,
133
],
[
132,
134
],
[
111,
135
],
[
135,
136
],
[
136,
137
],
[
137,
138
],
[
136,
139
],
[
139,
140
],
[
140,
141
],
[
139,
142
],
[
46,
143
],
[
143,
144
],
[
144,
145
],
[
145,
146
],
[
145,
147
],
[
143,
148
],
[
148,
149
],
[
149,
150
],
[
44,
151
],
[
151,
152
]
] | [
"import java.util.Scanner;\n\nclass Stack {\n\tprivate int top;\n\tprivate int[] a;\n\t\n\tStack(){\n\t\tthis.top=0;\n\t\ta=new int[200];\n\t}\n\t\n\tvoid push(int x){\n\t\ta[top++]=x;\n\t}\n\t\n\tint pop(){\n\t\ttop--;\n\t\treturn a[top];\n\t}\n\t\n}\n\nclass Main {\n\tpublic static void main(String[] args){\n\t\tScanner scan=new Scanner(System.in);\n\t\tStack S=new Stack();\n\t\t\n\t\twhile(scan.hasNext()){\n\t\t\tString str=scan.next();\n\n\t\t\tif(str.charAt(0)=='+'){\n\t\t\t\tint a=S.pop();\n\t\t\t\tint b=S.pop();\n\t\t\t\tS.push(b+a);\n\t\t\t}\n\t\t\telse if(str.charAt(0)=='-'){\n\t\t\t\tint a=S.pop();\n\t\t\t\tint b=S.pop();\n\t\t\t\tS.push(b-a);\n\t\t\t}\n\t\t\telse if(str.charAt(0)=='*'){\n\t\t\t\tint a=S.pop();\n\t\t\t\tint b=S.pop();\n\t\t\t\tS.push(b*a);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tS.push(Integer.parseInt(str));\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(S.pop());\n\t}\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"class Stack {\n\tprivate int top;\n\tprivate int[] a;\n\t\n\tStack(){\n\t\tthis.top=0;\n\t\ta=new int[200];\n\t}\n\t\n\tvoid push(int x){\n\t\ta[top++]=x;\n\t}\n\t\n\tint pop(){\n\t\ttop--;\n\t\treturn a[top];\n\t}\n\t\n}",
"Stack",
"private int top;",
"top",
"private int[] a;",
"a",
"Stack(){\n\t\tthis.top=0;\n\t\ta=new int[200];\n\t}",
"Stack",
"{\n\t\tthis.top=0;\n\t\ta=new int[200];\n\t}",
"this.top=0",
"this.top",
"this",
"this.top",
"0",
"a=new int[200]",
"a",
"new int[200]",
"200",
"void push(int x){\n\t\ta[top++]=x;\n\t}",
"push",
"{\n\t\ta[top++]=x;\n\t}",
"a[top++]=x",
"a[top++]",
"a",
"top++",
"top",
"x",
"int x",
"x",
"int pop(){\n\t\ttop--;\n\t\treturn a[top];\n\t}",
"pop",
"{\n\t\ttop--;\n\t\treturn a[top];\n\t}",
"top--",
"top",
"return a[top];",
"a[top]",
"a",
"top",
"class Main {\n\tpublic static void main(String[] args){\n\t\tScanner scan=new Scanner(System.in);\n\t\tStack S=new Stack();\n\t\t\n\t\twhile(scan.hasNext()){\n\t\t\tString str=scan.next();\n\n\t\t\tif(str.charAt(0)=='+'){\n\t\t\t\tint a=S.pop();\n\t\t\t\tint b=S.pop();\n\t\t\t\tS.push(b+a);\n\t\t\t}\n\t\t\telse if(str.charAt(0)=='-'){\n\t\t\t\tint a=S.pop();\n\t\t\t\tint b=S.pop();\n\t\t\t\tS.push(b-a);\n\t\t\t}\n\t\t\telse if(str.charAt(0)=='*'){\n\t\t\t\tint a=S.pop();\n\t\t\t\tint b=S.pop();\n\t\t\t\tS.push(b*a);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tS.push(Integer.parseInt(str));\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(S.pop());\n\t}\n}",
"Main",
"public static void main(String[] args){\n\t\tScanner scan=new Scanner(System.in);\n\t\tStack S=new Stack();\n\t\t\n\t\twhile(scan.hasNext()){\n\t\t\tString str=scan.next();\n\n\t\t\tif(str.charAt(0)=='+'){\n\t\t\t\tint a=S.pop();\n\t\t\t\tint b=S.pop();\n\t\t\t\tS.push(b+a);\n\t\t\t}\n\t\t\telse if(str.charAt(0)=='-'){\n\t\t\t\tint a=S.pop();\n\t\t\t\tint b=S.pop();\n\t\t\t\tS.push(b-a);\n\t\t\t}\n\t\t\telse if(str.charAt(0)=='*'){\n\t\t\t\tint a=S.pop();\n\t\t\t\tint b=S.pop();\n\t\t\t\tS.push(b*a);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tS.push(Integer.parseInt(str));\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(S.pop());\n\t}",
"main",
"{\n\t\tScanner scan=new Scanner(System.in);\n\t\tStack S=new Stack();\n\t\t\n\t\twhile(scan.hasNext()){\n\t\t\tString str=scan.next();\n\n\t\t\tif(str.charAt(0)=='+'){\n\t\t\t\tint a=S.pop();\n\t\t\t\tint b=S.pop();\n\t\t\t\tS.push(b+a);\n\t\t\t}\n\t\t\telse if(str.charAt(0)=='-'){\n\t\t\t\tint a=S.pop();\n\t\t\t\tint b=S.pop();\n\t\t\t\tS.push(b-a);\n\t\t\t}\n\t\t\telse if(str.charAt(0)=='*'){\n\t\t\t\tint a=S.pop();\n\t\t\t\tint b=S.pop();\n\t\t\t\tS.push(b*a);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tS.push(Integer.parseInt(str));\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(S.pop());\n\t}",
"Scanner scan=new Scanner(System.in);",
"scan",
"new Scanner(System.in)",
"Stack S=new Stack();",
"S",
"new Stack()",
"while(scan.hasNext()){\n\t\t\tString str=scan.next();\n\n\t\t\tif(str.charAt(0)=='+'){\n\t\t\t\tint a=S.pop();\n\t\t\t\tint b=S.pop();\n\t\t\t\tS.push(b+a);\n\t\t\t}\n\t\t\telse if(str.charAt(0)=='-'){\n\t\t\t\tint a=S.pop();\n\t\t\t\tint b=S.pop();\n\t\t\t\tS.push(b-a);\n\t\t\t}\n\t\t\telse if(str.charAt(0)=='*'){\n\t\t\t\tint a=S.pop();\n\t\t\t\tint b=S.pop();\n\t\t\t\tS.push(b*a);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tS.push(Integer.parseInt(str));\n\t\t\t}\n\t\t}",
"scan.hasNext()",
"scan.hasNext",
"scan",
"{\n\t\t\tString str=scan.next();\n\n\t\t\tif(str.charAt(0)=='+'){\n\t\t\t\tint a=S.pop();\n\t\t\t\tint b=S.pop();\n\t\t\t\tS.push(b+a);\n\t\t\t}\n\t\t\telse if(str.charAt(0)=='-'){\n\t\t\t\tint a=S.pop();\n\t\t\t\tint b=S.pop();\n\t\t\t\tS.push(b-a);\n\t\t\t}\n\t\t\telse if(str.charAt(0)=='*'){\n\t\t\t\tint a=S.pop();\n\t\t\t\tint b=S.pop();\n\t\t\t\tS.push(b*a);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tS.push(Integer.parseInt(str));\n\t\t\t}\n\t\t}",
"String str=scan.next();",
"str",
"scan.next()",
"scan.next",
"scan",
"if(str.charAt(0)=='+'){\n\t\t\t\tint a=S.pop();\n\t\t\t\tint b=S.pop();\n\t\t\t\tS.push(b+a);\n\t\t\t}\n\t\t\telse if(str.charAt(0)=='-'){\n\t\t\t\tint a=S.pop();\n\t\t\t\tint b=S.pop();\n\t\t\t\tS.push(b-a);\n\t\t\t}\n\t\t\telse if(str.charAt(0)=='*'){\n\t\t\t\tint a=S.pop();\n\t\t\t\tint b=S.pop();\n\t\t\t\tS.push(b*a);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tS.push(Integer.parseInt(str));\n\t\t\t}",
"str.charAt(0)=='+'",
"str.charAt(0)",
"str.charAt",
"str",
"0",
"'+'",
"{\n\t\t\t\tint a=S.pop();\n\t\t\t\tint b=S.pop();\n\t\t\t\tS.push(b+a);\n\t\t\t}",
"int a=S.pop();",
"a",
"S.pop()",
"S.pop",
"S",
"int b=S.pop();",
"b",
"S.pop()",
"S.pop",
"S",
"S.push(b+a)",
"S.push",
"S",
"b+a",
"b",
"a",
"if(str.charAt(0)=='-'){\n\t\t\t\tint a=S.pop();\n\t\t\t\tint b=S.pop();\n\t\t\t\tS.push(b-a);\n\t\t\t}\n\t\t\telse if(str.charAt(0)=='*'){\n\t\t\t\tint a=S.pop();\n\t\t\t\tint b=S.pop();\n\t\t\t\tS.push(b*a);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tS.push(Integer.parseInt(str));\n\t\t\t}",
"str.charAt(0)=='-'",
"str.charAt(0)",
"str.charAt",
"str",
"0",
"'-'",
"{\n\t\t\t\tint a=S.pop();\n\t\t\t\tint b=S.pop();\n\t\t\t\tS.push(b-a);\n\t\t\t}",
"int a=S.pop();",
"a",
"S.pop()",
"S.pop",
"S",
"int b=S.pop();",
"b",
"S.pop()",
"S.pop",
"S",
"S.push(b-a)",
"S.push",
"S",
"b-a",
"b",
"a",
"if(str.charAt(0)=='*'){\n\t\t\t\tint a=S.pop();\n\t\t\t\tint b=S.pop();\n\t\t\t\tS.push(b*a);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tS.push(Integer.parseInt(str));\n\t\t\t}",
"str.charAt(0)=='*'",
"str.charAt(0)",
"str.charAt",
"str",
"0",
"'*'",
"{\n\t\t\t\tint a=S.pop();\n\t\t\t\tint b=S.pop();\n\t\t\t\tS.push(b*a);\n\t\t\t}",
"int a=S.pop();",
"a",
"S.pop()",
"S.pop",
"S",
"int b=S.pop();",
"b",
"S.pop()",
"S.pop",
"S",
"S.push(b*a)",
"S.push",
"S",
"b*a",
"b",
"a",
"{\n\t\t\t\tS.push(Integer.parseInt(str));\n\t\t\t}",
"S.push(Integer.parseInt(str))",
"S.push",
"S",
"Integer.parseInt(str)",
"Integer.parseInt",
"Integer",
"str",
"System.out.println(S.pop())",
"System.out.println",
"System.out",
"System",
"System.out",
"S.pop()",
"S.pop",
"S",
"String[] args",
"args"
] | import java.util.Scanner;
class Stack {
private int top;
private int[] a;
Stack(){
this.top=0;
a=new int[200];
}
void push(int x){
a[top++]=x;
}
int pop(){
top--;
return a[top];
}
}
class Main {
public static void main(String[] args){
Scanner scan=new Scanner(System.in);
Stack S=new Stack();
while(scan.hasNext()){
String str=scan.next();
if(str.charAt(0)=='+'){
int a=S.pop();
int b=S.pop();
S.push(b+a);
}
else if(str.charAt(0)=='-'){
int a=S.pop();
int b=S.pop();
S.push(b-a);
}
else if(str.charAt(0)=='*'){
int a=S.pop();
int b=S.pop();
S.push(b*a);
}
else {
S.push(Integer.parseInt(str));
}
}
System.out.println(S.pop());
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
20,
41,
13,
4,
18,
4,
18,
13,
17,
41,
13,
41,
13,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
30,
35,
18,
13,
13,
34,
17,
1,
0,
13,
4,
18,
13,
0,
13,
4,
18,
13,
4,
18,
13,
2,
13,
13,
3,
34,
17,
1,
0,
13,
4,
18,
13,
0,
13,
4,
18,
13,
4,
18,
13,
2,
13,
13,
3,
34,
17,
1,
0,
13,
4,
18,
13,
0,
13,
4,
18,
13,
4,
18,
13,
2,
13,
13,
3,
34,
1,
4,
18,
13,
4,
18,
13,
18,
13,
13,
3,
4,
18,
18,
13,
13,
4,
18,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
135,
11
],
[
135,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
15,
17
],
[
14,
18
],
[
18,
19
],
[
18,
20
],
[
14,
21
],
[
21,
22
],
[
21,
23
],
[
23,
24
],
[
24,
25
],
[
25,
26
],
[
26,
27
],
[
23,
28
],
[
14,
29
],
[
29,
30
],
[
14,
31
],
[
31,
32
],
[
14,
33
],
[
33,
34
],
[
34,
35
],
[
35,
36
],
[
35,
37
],
[
33,
38
],
[
38,
39
],
[
38,
40
],
[
40,
41
],
[
40,
42
],
[
33,
43
],
[
43,
44
],
[
44,
45
],
[
33,
46
],
[
47,
47
],
[
47,
48
],
[
48,
49
],
[
49,
50
],
[
49,
51
],
[
48,
52
],
[
52,
53
],
[
52,
54
],
[
54,
55
],
[
55,
56
],
[
55,
57
],
[
57,
58
],
[
58,
59
],
[
54,
60
],
[
60,
61
],
[
60,
62
],
[
62,
63
],
[
63,
64
],
[
54,
65
],
[
65,
66
],
[
66,
67
],
[
65,
68
],
[
68,
69
],
[
68,
70
],
[
54,
71
],
[
48,
72
],
[
72,
73
],
[
72,
74
],
[
74,
75
],
[
75,
76
],
[
75,
77
],
[
77,
78
],
[
78,
79
],
[
74,
80
],
[
80,
81
],
[
80,
82
],
[
82,
83
],
[
83,
84
],
[
74,
85
],
[
85,
86
],
[
86,
87
],
[
85,
88
],
[
88,
89
],
[
88,
90
],
[
74,
91
],
[
48,
92
],
[
92,
93
],
[
92,
94
],
[
94,
95
],
[
95,
96
],
[
95,
97
],
[
97,
98
],
[
98,
99
],
[
94,
100
],
[
100,
101
],
[
100,
102
],
[
102,
103
],
[
103,
104
],
[
94,
105
],
[
105,
106
],
[
106,
107
],
[
105,
108
],
[
108,
109
],
[
108,
110
],
[
94,
111
],
[
48,
112
],
[
112,
113
],
[
113,
114
],
[
114,
115
],
[
115,
116
],
[
114,
117
],
[
117,
118
],
[
118,
119
],
[
117,
120
],
[
120,
121
],
[
120,
122
],
[
113,
123
],
[
14,
124
],
[
124,
125
],
[
125,
126
],
[
126,
127
],
[
126,
128
],
[
124,
129
],
[
129,
130
],
[
130,
131
],
[
12,
132
],
[
132,
133
],
[
0,
134
],
[
134,
135
],
[
134,
136
]
] | [
"import java.io.*;\nimport java.util.Deque;\nimport java.util.ArrayDeque;\n\npublic class Main\n{\n\tpublic static void main(String[] args)throws IOException\n\t{\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tDeque<Integer> stack = new ArrayDeque<>();\n\t\tString[] str = br.readLine().split(\" \");\n\t\tint a,b;\n\t\t/*for(int i = 0; i < str.length ; i++){\n\t\t\tSystem.out.println(str[i]);\n\t\t}*/\n\t\tfor(int i = 0; i < str.length ; i++)\n\t\t{\n\t\t\tswitch(str[i])\n\t\t\t{\n\t\t\tcase \"+\":\n\t\t\t\ta = stack.pollLast();\n\t\t\t\tb = stack.pollLast();\n\t\t\t\tstack.offer(b+a);\n\t\t\t\t//System.out.println(\"a+b\"+a+\" \"+b+\"\"+(a+b));\n\t\t\t\t\n\t\t\t\tbreak;\n\t\t\tcase \"-\":\n\t\t\t\ta = stack.pollLast();\n\t\t\t\tb = stack.pollLast();\n\t\t\t\tstack.offer(b-a);\n\t\t\t\t//System.out.println(\"b-a\"+b+\" \"+a+\" \"+(b-a));\n\t\t\t\t\n\t\t\t\tbreak;\n\t\t\tcase \"*\":\n\t\t\t\ta = stack.pollLast();\n\t\t\t\tb = stack.pollLast();\n\t\t\t\tstack.offer(a*b);\n\t\t\t\t//System.out.println(\"a*b\"+a+\" \"+b+\"\"+(a*b));\n\t\t\t\t\n\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\tdefault :\n\t\t\t\tstack.offer(Integer.parseInt(str[i]));\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(stack.poll());\n\t\t\n\t}\n}",
"import java.io.*;",
"io.*",
"java",
"import java.util.Deque;",
"Deque",
"java.util",
"import java.util.ArrayDeque;",
"ArrayDeque",
"java.util",
"public class Main\n{\n\tpublic static void main(String[] args)throws IOException\n\t{\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tDeque<Integer> stack = new ArrayDeque<>();\n\t\tString[] str = br.readLine().split(\" \");\n\t\tint a,b;\n\t\t/*for(int i = 0; i < str.length ; i++){\n\t\t\tSystem.out.println(str[i]);\n\t\t}*/\n\t\tfor(int i = 0; i < str.length ; i++)\n\t\t{\n\t\t\tswitch(str[i])\n\t\t\t{\n\t\t\tcase \"+\":\n\t\t\t\ta = stack.pollLast();\n\t\t\t\tb = stack.pollLast();\n\t\t\t\tstack.offer(b+a);\n\t\t\t\t//System.out.println(\"a+b\"+a+\" \"+b+\"\"+(a+b));\n\t\t\t\t\n\t\t\t\tbreak;\n\t\t\tcase \"-\":\n\t\t\t\ta = stack.pollLast();\n\t\t\t\tb = stack.pollLast();\n\t\t\t\tstack.offer(b-a);\n\t\t\t\t//System.out.println(\"b-a\"+b+\" \"+a+\" \"+(b-a));\n\t\t\t\t\n\t\t\t\tbreak;\n\t\t\tcase \"*\":\n\t\t\t\ta = stack.pollLast();\n\t\t\t\tb = stack.pollLast();\n\t\t\t\tstack.offer(a*b);\n\t\t\t\t//System.out.println(\"a*b\"+a+\" \"+b+\"\"+(a*b));\n\t\t\t\t\n\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\tdefault :\n\t\t\t\tstack.offer(Integer.parseInt(str[i]));\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(stack.poll());\n\t\t\n\t}\n}",
"Main",
"public static void main(String[] args)throws IOException\n\t{\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tDeque<Integer> stack = new ArrayDeque<>();\n\t\tString[] str = br.readLine().split(\" \");\n\t\tint a,b;\n\t\t/*for(int i = 0; i < str.length ; i++){\n\t\t\tSystem.out.println(str[i]);\n\t\t}*/\n\t\tfor(int i = 0; i < str.length ; i++)\n\t\t{\n\t\t\tswitch(str[i])\n\t\t\t{\n\t\t\tcase \"+\":\n\t\t\t\ta = stack.pollLast();\n\t\t\t\tb = stack.pollLast();\n\t\t\t\tstack.offer(b+a);\n\t\t\t\t//System.out.println(\"a+b\"+a+\" \"+b+\"\"+(a+b));\n\t\t\t\t\n\t\t\t\tbreak;\n\t\t\tcase \"-\":\n\t\t\t\ta = stack.pollLast();\n\t\t\t\tb = stack.pollLast();\n\t\t\t\tstack.offer(b-a);\n\t\t\t\t//System.out.println(\"b-a\"+b+\" \"+a+\" \"+(b-a));\n\t\t\t\t\n\t\t\t\tbreak;\n\t\t\tcase \"*\":\n\t\t\t\ta = stack.pollLast();\n\t\t\t\tb = stack.pollLast();\n\t\t\t\tstack.offer(a*b);\n\t\t\t\t//System.out.println(\"a*b\"+a+\" \"+b+\"\"+(a*b));\n\t\t\t\t\n\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\tdefault :\n\t\t\t\tstack.offer(Integer.parseInt(str[i]));\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(stack.poll());\n\t\t\n\t}",
"main",
"{\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tDeque<Integer> stack = new ArrayDeque<>();\n\t\tString[] str = br.readLine().split(\" \");\n\t\tint a,b;\n\t\t/*for(int i = 0; i < str.length ; i++){\n\t\t\tSystem.out.println(str[i]);\n\t\t}*/\n\t\tfor(int i = 0; i < str.length ; i++)\n\t\t{\n\t\t\tswitch(str[i])\n\t\t\t{\n\t\t\tcase \"+\":\n\t\t\t\ta = stack.pollLast();\n\t\t\t\tb = stack.pollLast();\n\t\t\t\tstack.offer(b+a);\n\t\t\t\t//System.out.println(\"a+b\"+a+\" \"+b+\"\"+(a+b));\n\t\t\t\t\n\t\t\t\tbreak;\n\t\t\tcase \"-\":\n\t\t\t\ta = stack.pollLast();\n\t\t\t\tb = stack.pollLast();\n\t\t\t\tstack.offer(b-a);\n\t\t\t\t//System.out.println(\"b-a\"+b+\" \"+a+\" \"+(b-a));\n\t\t\t\t\n\t\t\t\tbreak;\n\t\t\tcase \"*\":\n\t\t\t\ta = stack.pollLast();\n\t\t\t\tb = stack.pollLast();\n\t\t\t\tstack.offer(a*b);\n\t\t\t\t//System.out.println(\"a*b\"+a+\" \"+b+\"\"+(a*b));\n\t\t\t\t\n\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\tdefault :\n\t\t\t\tstack.offer(Integer.parseInt(str[i]));\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(stack.poll());\n\t\t\n\t}",
"BufferedReader br = new BufferedReader(new InputStreamReader(System.in));",
"br",
"new BufferedReader(new InputStreamReader(System.in))",
"Deque<Integer> stack = new ArrayDeque<>();",
"stack",
"new ArrayDeque<>()",
"String[] str = br.readLine().split(\" \");",
"str",
"br.readLine().split(\" \")",
"br.readLine().split",
"br.readLine()",
"br.readLine",
"br",
"\" \"",
"int a",
"a",
"b;",
"b",
"for(int i = 0; i < str.length ; i++)\n\t\t{\n\t\t\tswitch(str[i])\n\t\t\t{\n\t\t\tcase \"+\":\n\t\t\t\ta = stack.pollLast();\n\t\t\t\tb = stack.pollLast();\n\t\t\t\tstack.offer(b+a);\n\t\t\t\t//System.out.println(\"a+b\"+a+\" \"+b+\"\"+(a+b));\n\t\t\t\t\n\t\t\t\tbreak;\n\t\t\tcase \"-\":\n\t\t\t\ta = stack.pollLast();\n\t\t\t\tb = stack.pollLast();\n\t\t\t\tstack.offer(b-a);\n\t\t\t\t//System.out.println(\"b-a\"+b+\" \"+a+\" \"+(b-a));\n\t\t\t\t\n\t\t\t\tbreak;\n\t\t\tcase \"*\":\n\t\t\t\ta = stack.pollLast();\n\t\t\t\tb = stack.pollLast();\n\t\t\t\tstack.offer(a*b);\n\t\t\t\t//System.out.println(\"a*b\"+a+\" \"+b+\"\"+(a*b));\n\t\t\t\t\n\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\tdefault :\n\t\t\t\tstack.offer(Integer.parseInt(str[i]));\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < str.length",
"i",
"str.length",
"str",
"str.length",
"i++",
"i++",
"i",
"{\n\t\t\tswitch(str[i])\n\t\t\t{\n\t\t\tcase \"+\":\n\t\t\t\ta = stack.pollLast();\n\t\t\t\tb = stack.pollLast();\n\t\t\t\tstack.offer(b+a);\n\t\t\t\t//System.out.println(\"a+b\"+a+\" \"+b+\"\"+(a+b));\n\t\t\t\t\n\t\t\t\tbreak;\n\t\t\tcase \"-\":\n\t\t\t\ta = stack.pollLast();\n\t\t\t\tb = stack.pollLast();\n\t\t\t\tstack.offer(b-a);\n\t\t\t\t//System.out.println(\"b-a\"+b+\" \"+a+\" \"+(b-a));\n\t\t\t\t\n\t\t\t\tbreak;\n\t\t\tcase \"*\":\n\t\t\t\ta = stack.pollLast();\n\t\t\t\tb = stack.pollLast();\n\t\t\t\tstack.offer(a*b);\n\t\t\t\t//System.out.println(\"a*b\"+a+\" \"+b+\"\"+(a*b));\n\t\t\t\t\n\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\tdefault :\n\t\t\t\tstack.offer(Integer.parseInt(str[i]));\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}",
"{\n\t\t\tswitch(str[i])\n\t\t\t{\n\t\t\tcase \"+\":\n\t\t\t\ta = stack.pollLast();\n\t\t\t\tb = stack.pollLast();\n\t\t\t\tstack.offer(b+a);\n\t\t\t\t//System.out.println(\"a+b\"+a+\" \"+b+\"\"+(a+b));\n\t\t\t\t\n\t\t\t\tbreak;\n\t\t\tcase \"-\":\n\t\t\t\ta = stack.pollLast();\n\t\t\t\tb = stack.pollLast();\n\t\t\t\tstack.offer(b-a);\n\t\t\t\t//System.out.println(\"b-a\"+b+\" \"+a+\" \"+(b-a));\n\t\t\t\t\n\t\t\t\tbreak;\n\t\t\tcase \"*\":\n\t\t\t\ta = stack.pollLast();\n\t\t\t\tb = stack.pollLast();\n\t\t\t\tstack.offer(a*b);\n\t\t\t\t//System.out.println(\"a*b\"+a+\" \"+b+\"\"+(a*b));\n\t\t\t\t\n\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\tdefault :\n\t\t\t\tstack.offer(Integer.parseInt(str[i]));\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}",
"switch(str[i])\n\t\t\t{\n\t\t\tcase \"+\":\n\t\t\t\ta = stack.pollLast();\n\t\t\t\tb = stack.pollLast();\n\t\t\t\tstack.offer(b+a);\n\t\t\t\t//System.out.println(\"a+b\"+a+\" \"+b+\"\"+(a+b));\n\t\t\t\t\n\t\t\t\tbreak;\n\t\t\tcase \"-\":\n\t\t\t\ta = stack.pollLast();\n\t\t\t\tb = stack.pollLast();\n\t\t\t\tstack.offer(b-a);\n\t\t\t\t//System.out.println(\"b-a\"+b+\" \"+a+\" \"+(b-a));\n\t\t\t\t\n\t\t\t\tbreak;\n\t\t\tcase \"*\":\n\t\t\t\ta = stack.pollLast();\n\t\t\t\tb = stack.pollLast();\n\t\t\t\tstack.offer(a*b);\n\t\t\t\t//System.out.println(\"a*b\"+a+\" \"+b+\"\"+(a*b));\n\t\t\t\t\n\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\tdefault :\n\t\t\t\tstack.offer(Integer.parseInt(str[i]));\n\t\t\t\tbreak;\n\t\t\t}",
"str[i]",
"str",
"i",
"case \"+\":",
"\"+\"",
"case \"+\":",
"a = stack.pollLast()",
"a",
"stack.pollLast()",
"stack.pollLast",
"stack",
"b = stack.pollLast()",
"b",
"stack.pollLast()",
"stack.pollLast",
"stack",
"stack.offer(b+a)",
"stack.offer",
"stack",
"b+a",
"b",
"a",
"break;",
"case \"-\":",
"\"-\"",
"case \"-\":",
"a = stack.pollLast()",
"a",
"stack.pollLast()",
"stack.pollLast",
"stack",
"b = stack.pollLast()",
"b",
"stack.pollLast()",
"stack.pollLast",
"stack",
"stack.offer(b-a)",
"stack.offer",
"stack",
"b-a",
"b",
"a",
"break;",
"case \"*\":",
"\"*\"",
"case \"*\":",
"a = stack.pollLast()",
"a",
"stack.pollLast()",
"stack.pollLast",
"stack",
"b = stack.pollLast()",
"b",
"stack.pollLast()",
"stack.pollLast",
"stack",
"stack.offer(a*b)",
"stack.offer",
"stack",
"a*b",
"a",
"b",
"break;",
"default :",
"default :",
"stack.offer(Integer.parseInt(str[i]))",
"stack.offer",
"stack",
"Integer.parseInt(str[i])",
"Integer.parseInt",
"Integer",
"str[i]",
"str",
"i",
"break;",
"System.out.println(stack.poll())",
"System.out.println",
"System.out",
"System",
"System.out",
"stack.poll()",
"stack.poll",
"stack",
"String[] args",
"args",
"public class Main\n{\n\tpublic static void main(String[] args)throws IOException\n\t{\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tDeque<Integer> stack = new ArrayDeque<>();\n\t\tString[] str = br.readLine().split(\" \");\n\t\tint a,b;\n\t\t/*for(int i = 0; i < str.length ; i++){\n\t\t\tSystem.out.println(str[i]);\n\t\t}*/\n\t\tfor(int i = 0; i < str.length ; i++)\n\t\t{\n\t\t\tswitch(str[i])\n\t\t\t{\n\t\t\tcase \"+\":\n\t\t\t\ta = stack.pollLast();\n\t\t\t\tb = stack.pollLast();\n\t\t\t\tstack.offer(b+a);\n\t\t\t\t//System.out.println(\"a+b\"+a+\" \"+b+\"\"+(a+b));\n\t\t\t\t\n\t\t\t\tbreak;\n\t\t\tcase \"-\":\n\t\t\t\ta = stack.pollLast();\n\t\t\t\tb = stack.pollLast();\n\t\t\t\tstack.offer(b-a);\n\t\t\t\t//System.out.println(\"b-a\"+b+\" \"+a+\" \"+(b-a));\n\t\t\t\t\n\t\t\t\tbreak;\n\t\t\tcase \"*\":\n\t\t\t\ta = stack.pollLast();\n\t\t\t\tb = stack.pollLast();\n\t\t\t\tstack.offer(a*b);\n\t\t\t\t//System.out.println(\"a*b\"+a+\" \"+b+\"\"+(a*b));\n\t\t\t\t\n\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\tdefault :\n\t\t\t\tstack.offer(Integer.parseInt(str[i]));\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(stack.poll());\n\t\t\n\t}\n}",
"public class Main\n{\n\tpublic static void main(String[] args)throws IOException\n\t{\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tDeque<Integer> stack = new ArrayDeque<>();\n\t\tString[] str = br.readLine().split(\" \");\n\t\tint a,b;\n\t\t/*for(int i = 0; i < str.length ; i++){\n\t\t\tSystem.out.println(str[i]);\n\t\t}*/\n\t\tfor(int i = 0; i < str.length ; i++)\n\t\t{\n\t\t\tswitch(str[i])\n\t\t\t{\n\t\t\tcase \"+\":\n\t\t\t\ta = stack.pollLast();\n\t\t\t\tb = stack.pollLast();\n\t\t\t\tstack.offer(b+a);\n\t\t\t\t//System.out.println(\"a+b\"+a+\" \"+b+\"\"+(a+b));\n\t\t\t\t\n\t\t\t\tbreak;\n\t\t\tcase \"-\":\n\t\t\t\ta = stack.pollLast();\n\t\t\t\tb = stack.pollLast();\n\t\t\t\tstack.offer(b-a);\n\t\t\t\t//System.out.println(\"b-a\"+b+\" \"+a+\" \"+(b-a));\n\t\t\t\t\n\t\t\t\tbreak;\n\t\t\tcase \"*\":\n\t\t\t\ta = stack.pollLast();\n\t\t\t\tb = stack.pollLast();\n\t\t\t\tstack.offer(a*b);\n\t\t\t\t//System.out.println(\"a*b\"+a+\" \"+b+\"\"+(a*b));\n\t\t\t\t\n\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\tdefault :\n\t\t\t\tstack.offer(Integer.parseInt(str[i]));\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(stack.poll());\n\t\t\n\t}\n}",
"Main"
] | import java.io.*;
import java.util.Deque;
import java.util.ArrayDeque;
public class Main
{
public static void main(String[] args)throws IOException
{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
Deque<Integer> stack = new ArrayDeque<>();
String[] str = br.readLine().split(" ");
int a,b;
/*for(int i = 0; i < str.length ; i++){
System.out.println(str[i]);
}*/
for(int i = 0; i < str.length ; i++)
{
switch(str[i])
{
case "+":
a = stack.pollLast();
b = stack.pollLast();
stack.offer(b+a);
//System.out.println("a+b"+a+" "+b+""+(a+b));
break;
case "-":
a = stack.pollLast();
b = stack.pollLast();
stack.offer(b-a);
//System.out.println("b-a"+b+" "+a+" "+(b-a));
break;
case "*":
a = stack.pollLast();
b = stack.pollLast();
stack.offer(a*b);
//System.out.println("a*b"+a+" "+b+""+(a*b));
break;
default :
stack.offer(Integer.parseInt(str[i]));
break;
}
}
System.out.println(stack.poll());
}
} |
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
4,
18,
13,
17,
4,
18,
13,
41,
13,
20,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
30,
41,
13,
18,
13,
13,
14,
2,
2,
2,
4,
18,
13,
17,
4,
18,
13,
17,
4,
18,
13,
17,
4,
18,
13,
17,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
14,
4,
18,
13,
17,
4,
18,
13,
2,
13,
13,
14,
4,
18,
13,
17,
4,
18,
13,
2,
13,
13,
14,
4,
18,
13,
17,
4,
18,
13,
2,
13,
13,
4,
18,
13,
2,
13,
13,
4,
18,
13,
4,
18,
13,
13,
41,
13,
4,
18,
13,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
140,
8
],
[
140,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
12,
14
],
[
11,
15
],
[
15,
16
],
[
15,
17
],
[
17,
18
],
[
18,
19
],
[
19,
20
],
[
20,
21
],
[
17,
22
],
[
11,
23
],
[
23,
24
],
[
24,
25
],
[
11,
26
],
[
26,
27
],
[
26,
28
],
[
11,
29
],
[
29,
30
],
[
30,
31
],
[
31,
32
],
[
31,
33
],
[
29,
34
],
[
34,
35
],
[
34,
36
],
[
36,
37
],
[
36,
38
],
[
29,
39
],
[
39,
40
],
[
40,
41
],
[
29,
42
],
[
43,
43
],
[
43,
44
],
[
44,
45
],
[
44,
46
],
[
46,
47
],
[
46,
48
],
[
43,
49
],
[
49,
50
],
[
52,
51
],
[
51,
52
],
[
52,
53
],
[
53,
54
],
[
54,
55
],
[
53,
56
],
[
52,
57
],
[
57,
58
],
[
58,
59
],
[
57,
60
],
[
51,
61
],
[
61,
62
],
[
62,
63
],
[
61,
64
],
[
52,
65
],
[
65,
66
],
[
66,
67
],
[
65,
68
],
[
49,
69
],
[
69,
70
],
[
70,
71
],
[
70,
72
],
[
72,
73
],
[
73,
74
],
[
69,
75
],
[
75,
76
],
[
75,
77
],
[
77,
78
],
[
78,
79
],
[
69,
80
],
[
80,
81
],
[
81,
82
],
[
82,
83
],
[
81,
84
],
[
80,
85
],
[
85,
86
],
[
86,
87
],
[
85,
88
],
[
88,
89
],
[
88,
90
],
[
80,
91
],
[
91,
92
],
[
92,
93
],
[
93,
94
],
[
92,
95
],
[
91,
96
],
[
96,
97
],
[
97,
98
],
[
96,
99
],
[
99,
100
],
[
99,
101
],
[
91,
102
],
[
102,
103
],
[
103,
104
],
[
104,
105
],
[
103,
106
],
[
102,
107
],
[
107,
108
],
[
108,
109
],
[
107,
110
],
[
110,
111
],
[
110,
112
],
[
102,
113
],
[
113,
114
],
[
114,
115
],
[
113,
116
],
[
116,
117
],
[
116,
118
],
[
49,
119
],
[
119,
120
],
[
120,
121
],
[
119,
122
],
[
122,
123
],
[
123,
124
],
[
122,
125
],
[
11,
126
],
[
126,
127
],
[
126,
128
],
[
128,
129
],
[
129,
130
],
[
11,
131
],
[
131,
132
],
[
132,
133
],
[
133,
134
],
[
133,
135
],
[
131,
136
],
[
9,
137
],
[
137,
138
],
[
0,
139
],
[
139,
140
],
[
139,
141
]
] | [
"\nimport java.util.Stack;\nimport java.util.Scanner;\n\npublic class Main{\n\tpublic static void main(String [] args) {\n\t\tScanner scan = new Scanner(System.in);\n\t\tString[] tokenStrings = scan.nextLine().split(\" \");\n\t\tscan.close();\n\t\tStack<Integer> tokens = new Stack<Integer>();\n\t\tfor(int i = 0; i < tokenStrings.length; i++) {\n\t\t\tString token = tokenStrings[i];\n\t\t\tif(token.equals(\"*\") || token.equals(\"/\") || token.equals(\"+\") || token.equals(\"-\")) {\n\t\t\t\tint operand1 = tokens.pop();\n\t\t\t\tint operand2 = tokens.pop();\n\t\t\t\tif(token.equals(\"*\"))\n\t\t\t\t\ttokens.push(operand2 * operand1);\n\t\t\t\telse if(token.equals(\"/\"))\n\t\t\t\t\ttokens.push(operand2 / operand1);\n\t\t\t\telse if(token.equals(\"+\"))\n\t\t\t\t\ttokens.push(operand2 + operand1);\n\t\t\t\telse\n\t\t\t\t\ttokens.push(operand2 - operand1);\n\t\t\t}\n\t\t\telse\n\t\t\t\ttokens.push(Integer.parseInt(token));\n\t\t\t\n\t\t}\n\n\t\tint answer = tokens.pop();\n\t\tSystem.out.println(answer);\n\t}\n}\n",
"import java.util.Stack;",
"Stack",
"java.util",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main{\n\tpublic static void main(String [] args) {\n\t\tScanner scan = new Scanner(System.in);\n\t\tString[] tokenStrings = scan.nextLine().split(\" \");\n\t\tscan.close();\n\t\tStack<Integer> tokens = new Stack<Integer>();\n\t\tfor(int i = 0; i < tokenStrings.length; i++) {\n\t\t\tString token = tokenStrings[i];\n\t\t\tif(token.equals(\"*\") || token.equals(\"/\") || token.equals(\"+\") || token.equals(\"-\")) {\n\t\t\t\tint operand1 = tokens.pop();\n\t\t\t\tint operand2 = tokens.pop();\n\t\t\t\tif(token.equals(\"*\"))\n\t\t\t\t\ttokens.push(operand2 * operand1);\n\t\t\t\telse if(token.equals(\"/\"))\n\t\t\t\t\ttokens.push(operand2 / operand1);\n\t\t\t\telse if(token.equals(\"+\"))\n\t\t\t\t\ttokens.push(operand2 + operand1);\n\t\t\t\telse\n\t\t\t\t\ttokens.push(operand2 - operand1);\n\t\t\t}\n\t\t\telse\n\t\t\t\ttokens.push(Integer.parseInt(token));\n\t\t\t\n\t\t}\n\n\t\tint answer = tokens.pop();\n\t\tSystem.out.println(answer);\n\t}\n}",
"Main",
"public static void main(String [] args) {\n\t\tScanner scan = new Scanner(System.in);\n\t\tString[] tokenStrings = scan.nextLine().split(\" \");\n\t\tscan.close();\n\t\tStack<Integer> tokens = new Stack<Integer>();\n\t\tfor(int i = 0; i < tokenStrings.length; i++) {\n\t\t\tString token = tokenStrings[i];\n\t\t\tif(token.equals(\"*\") || token.equals(\"/\") || token.equals(\"+\") || token.equals(\"-\")) {\n\t\t\t\tint operand1 = tokens.pop();\n\t\t\t\tint operand2 = tokens.pop();\n\t\t\t\tif(token.equals(\"*\"))\n\t\t\t\t\ttokens.push(operand2 * operand1);\n\t\t\t\telse if(token.equals(\"/\"))\n\t\t\t\t\ttokens.push(operand2 / operand1);\n\t\t\t\telse if(token.equals(\"+\"))\n\t\t\t\t\ttokens.push(operand2 + operand1);\n\t\t\t\telse\n\t\t\t\t\ttokens.push(operand2 - operand1);\n\t\t\t}\n\t\t\telse\n\t\t\t\ttokens.push(Integer.parseInt(token));\n\t\t\t\n\t\t}\n\n\t\tint answer = tokens.pop();\n\t\tSystem.out.println(answer);\n\t}",
"main",
"{\n\t\tScanner scan = new Scanner(System.in);\n\t\tString[] tokenStrings = scan.nextLine().split(\" \");\n\t\tscan.close();\n\t\tStack<Integer> tokens = new Stack<Integer>();\n\t\tfor(int i = 0; i < tokenStrings.length; i++) {\n\t\t\tString token = tokenStrings[i];\n\t\t\tif(token.equals(\"*\") || token.equals(\"/\") || token.equals(\"+\") || token.equals(\"-\")) {\n\t\t\t\tint operand1 = tokens.pop();\n\t\t\t\tint operand2 = tokens.pop();\n\t\t\t\tif(token.equals(\"*\"))\n\t\t\t\t\ttokens.push(operand2 * operand1);\n\t\t\t\telse if(token.equals(\"/\"))\n\t\t\t\t\ttokens.push(operand2 / operand1);\n\t\t\t\telse if(token.equals(\"+\"))\n\t\t\t\t\ttokens.push(operand2 + operand1);\n\t\t\t\telse\n\t\t\t\t\ttokens.push(operand2 - operand1);\n\t\t\t}\n\t\t\telse\n\t\t\t\ttokens.push(Integer.parseInt(token));\n\t\t\t\n\t\t}\n\n\t\tint answer = tokens.pop();\n\t\tSystem.out.println(answer);\n\t}",
"Scanner scan = new Scanner(System.in);",
"scan",
"new Scanner(System.in)",
"String[] tokenStrings = scan.nextLine().split(\" \");",
"tokenStrings",
"scan.nextLine().split(\" \")",
"scan.nextLine().split",
"scan.nextLine()",
"scan.nextLine",
"scan",
"\" \"",
"scan.close()",
"scan.close",
"scan",
"Stack<Integer> tokens = new Stack<Integer>();",
"tokens",
"new Stack<Integer>()",
"for(int i = 0; i < tokenStrings.length; i++) {\n\t\t\tString token = tokenStrings[i];\n\t\t\tif(token.equals(\"*\") || token.equals(\"/\") || token.equals(\"+\") || token.equals(\"-\")) {\n\t\t\t\tint operand1 = tokens.pop();\n\t\t\t\tint operand2 = tokens.pop();\n\t\t\t\tif(token.equals(\"*\"))\n\t\t\t\t\ttokens.push(operand2 * operand1);\n\t\t\t\telse if(token.equals(\"/\"))\n\t\t\t\t\ttokens.push(operand2 / operand1);\n\t\t\t\telse if(token.equals(\"+\"))\n\t\t\t\t\ttokens.push(operand2 + operand1);\n\t\t\t\telse\n\t\t\t\t\ttokens.push(operand2 - operand1);\n\t\t\t}\n\t\t\telse\n\t\t\t\ttokens.push(Integer.parseInt(token));\n\t\t\t\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < tokenStrings.length",
"i",
"tokenStrings.length",
"tokenStrings",
"tokenStrings.length",
"i++",
"i++",
"i",
"{\n\t\t\tString token = tokenStrings[i];\n\t\t\tif(token.equals(\"*\") || token.equals(\"/\") || token.equals(\"+\") || token.equals(\"-\")) {\n\t\t\t\tint operand1 = tokens.pop();\n\t\t\t\tint operand2 = tokens.pop();\n\t\t\t\tif(token.equals(\"*\"))\n\t\t\t\t\ttokens.push(operand2 * operand1);\n\t\t\t\telse if(token.equals(\"/\"))\n\t\t\t\t\ttokens.push(operand2 / operand1);\n\t\t\t\telse if(token.equals(\"+\"))\n\t\t\t\t\ttokens.push(operand2 + operand1);\n\t\t\t\telse\n\t\t\t\t\ttokens.push(operand2 - operand1);\n\t\t\t}\n\t\t\telse\n\t\t\t\ttokens.push(Integer.parseInt(token));\n\t\t\t\n\t\t}",
"{\n\t\t\tString token = tokenStrings[i];\n\t\t\tif(token.equals(\"*\") || token.equals(\"/\") || token.equals(\"+\") || token.equals(\"-\")) {\n\t\t\t\tint operand1 = tokens.pop();\n\t\t\t\tint operand2 = tokens.pop();\n\t\t\t\tif(token.equals(\"*\"))\n\t\t\t\t\ttokens.push(operand2 * operand1);\n\t\t\t\telse if(token.equals(\"/\"))\n\t\t\t\t\ttokens.push(operand2 / operand1);\n\t\t\t\telse if(token.equals(\"+\"))\n\t\t\t\t\ttokens.push(operand2 + operand1);\n\t\t\t\telse\n\t\t\t\t\ttokens.push(operand2 - operand1);\n\t\t\t}\n\t\t\telse\n\t\t\t\ttokens.push(Integer.parseInt(token));\n\t\t\t\n\t\t}",
"String token = tokenStrings[i];",
"token",
"tokenStrings[i]",
"tokenStrings",
"i",
"if(token.equals(\"*\") || token.equals(\"/\") || token.equals(\"+\") || token.equals(\"-\")) {\n\t\t\t\tint operand1 = tokens.pop();\n\t\t\t\tint operand2 = tokens.pop();\n\t\t\t\tif(token.equals(\"*\"))\n\t\t\t\t\ttokens.push(operand2 * operand1);\n\t\t\t\telse if(token.equals(\"/\"))\n\t\t\t\t\ttokens.push(operand2 / operand1);\n\t\t\t\telse if(token.equals(\"+\"))\n\t\t\t\t\ttokens.push(operand2 + operand1);\n\t\t\t\telse\n\t\t\t\t\ttokens.push(operand2 - operand1);\n\t\t\t}\n\t\t\telse\n\t\t\t\ttokens.push(Integer.parseInt(token));",
"token.equals(\"*\") || token.equals(\"/\") || token.equals(\"+\") || token.equals(\"-\")",
"token.equals(\"+\")",
"token.equals(\"*\") || token.equals(\"/\") || token.equals(\"+\") || token.equals(\"-\")",
"token.equals(\"*\")",
"token.equals",
"token",
"\"*\"",
"token.equals(\"/\")",
"token.equals",
"token",
"\"/\"",
"token.equals(\"+\")",
"token.equals",
"token",
"\"+\"",
"token.equals(\"-\")",
"token.equals",
"token",
"\"-\"",
"{\n\t\t\t\tint operand1 = tokens.pop();\n\t\t\t\tint operand2 = tokens.pop();\n\t\t\t\tif(token.equals(\"*\"))\n\t\t\t\t\ttokens.push(operand2 * operand1);\n\t\t\t\telse if(token.equals(\"/\"))\n\t\t\t\t\ttokens.push(operand2 / operand1);\n\t\t\t\telse if(token.equals(\"+\"))\n\t\t\t\t\ttokens.push(operand2 + operand1);\n\t\t\t\telse\n\t\t\t\t\ttokens.push(operand2 - operand1);\n\t\t\t}",
"int operand1 = tokens.pop();",
"operand1",
"tokens.pop()",
"tokens.pop",
"tokens",
"int operand2 = tokens.pop();",
"operand2",
"tokens.pop()",
"tokens.pop",
"tokens",
"if(token.equals(\"*\"))\n\t\t\t\t\ttokens.push(operand2 * operand1);\n\t\t\t\telse if(token.equals(\"/\"))\n\t\t\t\t\ttokens.push(operand2 / operand1);\n\t\t\t\telse if(token.equals(\"+\"))\n\t\t\t\t\ttokens.push(operand2 + operand1);\n\t\t\t\telse\n\t\t\t\t\ttokens.push(operand2 - operand1);",
"token.equals(\"*\")",
"token.equals",
"token",
"\"*\"",
"tokens.push(operand2 * operand1)",
"tokens.push",
"tokens",
"operand2 * operand1",
"operand2",
"operand1",
"if(token.equals(\"/\"))\n\t\t\t\t\ttokens.push(operand2 / operand1);\n\t\t\t\telse if(token.equals(\"+\"))\n\t\t\t\t\ttokens.push(operand2 + operand1);\n\t\t\t\telse\n\t\t\t\t\ttokens.push(operand2 - operand1);",
"token.equals(\"/\")",
"token.equals",
"token",
"\"/\"",
"tokens.push(operand2 / operand1)",
"tokens.push",
"tokens",
"operand2 / operand1",
"operand2",
"operand1",
"if(token.equals(\"+\"))\n\t\t\t\t\ttokens.push(operand2 + operand1);\n\t\t\t\telse\n\t\t\t\t\ttokens.push(operand2 - operand1);",
"token.equals(\"+\")",
"token.equals",
"token",
"\"+\"",
"tokens.push(operand2 + operand1)",
"tokens.push",
"tokens",
"operand2 + operand1",
"operand2",
"operand1",
"tokens.push(operand2 - operand1)",
"tokens.push",
"tokens",
"operand2 - operand1",
"operand2",
"operand1",
"tokens.push(Integer.parseInt(token))",
"tokens.push",
"tokens",
"Integer.parseInt(token)",
"Integer.parseInt",
"Integer",
"token",
"int answer = tokens.pop();",
"answer",
"tokens.pop()",
"tokens.pop",
"tokens",
"System.out.println(answer)",
"System.out.println",
"System.out",
"System",
"System.out",
"answer",
"String [] args",
"args",
"public class Main{\n\tpublic static void main(String [] args) {\n\t\tScanner scan = new Scanner(System.in);\n\t\tString[] tokenStrings = scan.nextLine().split(\" \");\n\t\tscan.close();\n\t\tStack<Integer> tokens = new Stack<Integer>();\n\t\tfor(int i = 0; i < tokenStrings.length; i++) {\n\t\t\tString token = tokenStrings[i];\n\t\t\tif(token.equals(\"*\") || token.equals(\"/\") || token.equals(\"+\") || token.equals(\"-\")) {\n\t\t\t\tint operand1 = tokens.pop();\n\t\t\t\tint operand2 = tokens.pop();\n\t\t\t\tif(token.equals(\"*\"))\n\t\t\t\t\ttokens.push(operand2 * operand1);\n\t\t\t\telse if(token.equals(\"/\"))\n\t\t\t\t\ttokens.push(operand2 / operand1);\n\t\t\t\telse if(token.equals(\"+\"))\n\t\t\t\t\ttokens.push(operand2 + operand1);\n\t\t\t\telse\n\t\t\t\t\ttokens.push(operand2 - operand1);\n\t\t\t}\n\t\t\telse\n\t\t\t\ttokens.push(Integer.parseInt(token));\n\t\t\t\n\t\t}\n\n\t\tint answer = tokens.pop();\n\t\tSystem.out.println(answer);\n\t}\n}",
"public class Main{\n\tpublic static void main(String [] args) {\n\t\tScanner scan = new Scanner(System.in);\n\t\tString[] tokenStrings = scan.nextLine().split(\" \");\n\t\tscan.close();\n\t\tStack<Integer> tokens = new Stack<Integer>();\n\t\tfor(int i = 0; i < tokenStrings.length; i++) {\n\t\t\tString token = tokenStrings[i];\n\t\t\tif(token.equals(\"*\") || token.equals(\"/\") || token.equals(\"+\") || token.equals(\"-\")) {\n\t\t\t\tint operand1 = tokens.pop();\n\t\t\t\tint operand2 = tokens.pop();\n\t\t\t\tif(token.equals(\"*\"))\n\t\t\t\t\ttokens.push(operand2 * operand1);\n\t\t\t\telse if(token.equals(\"/\"))\n\t\t\t\t\ttokens.push(operand2 / operand1);\n\t\t\t\telse if(token.equals(\"+\"))\n\t\t\t\t\ttokens.push(operand2 + operand1);\n\t\t\t\telse\n\t\t\t\t\ttokens.push(operand2 - operand1);\n\t\t\t}\n\t\t\telse\n\t\t\t\ttokens.push(Integer.parseInt(token));\n\t\t\t\n\t\t}\n\n\t\tint answer = tokens.pop();\n\t\tSystem.out.println(answer);\n\t}\n}",
"Main"
] |
import java.util.Stack;
import java.util.Scanner;
public class Main{
public static void main(String [] args) {
Scanner scan = new Scanner(System.in);
String[] tokenStrings = scan.nextLine().split(" ");
scan.close();
Stack<Integer> tokens = new Stack<Integer>();
for(int i = 0; i < tokenStrings.length; i++) {
String token = tokenStrings[i];
if(token.equals("*") || token.equals("/") || token.equals("+") || token.equals("-")) {
int operand1 = tokens.pop();
int operand2 = tokens.pop();
if(token.equals("*"))
tokens.push(operand2 * operand1);
else if(token.equals("/"))
tokens.push(operand2 / operand1);
else if(token.equals("+"))
tokens.push(operand2 + operand1);
else
tokens.push(operand2 - operand1);
}
else
tokens.push(Integer.parseInt(token));
}
int answer = tokens.pop();
System.out.println(answer);
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
38,
30,
41,
13,
20,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
17,
28,
13,
13,
30,
30,
14,
2,
2,
4,
18,
13,
17,
4,
18,
13,
17,
4,
18,
13,
17,
30,
41,
13,
4,
18,
13,
4,
18,
13,
41,
13,
4,
18,
13,
4,
18,
13,
14,
4,
18,
13,
17,
30,
4,
18,
13,
4,
18,
13,
2,
13,
13,
14,
4,
18,
13,
17,
30,
4,
18,
13,
4,
18,
13,
2,
13,
13,
30,
4,
18,
13,
4,
18,
13,
2,
13,
13,
30,
4,
18,
13,
13,
4,
18,
18,
13,
13,
4,
18,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
124,
8
],
[
124,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
13,
14
],
[
14,
15
],
[
14,
16
],
[
13,
17
],
[
17,
18
],
[
17,
19
],
[
13,
20
],
[
20,
21
],
[
20,
22
],
[
22,
23
],
[
23,
24
],
[
13,
25
],
[
25,
26
],
[
25,
27
],
[
27,
28
],
[
28,
29
],
[
27,
30
],
[
13,
31
],
[
31,
32
],
[
31,
33
],
[
31,
34
],
[
35,
35
],
[
35,
36
],
[
36,
37
],
[
38,
38
],
[
38,
39
],
[
39,
40
],
[
40,
41
],
[
39,
42
],
[
38,
43
],
[
43,
44
],
[
44,
45
],
[
43,
46
],
[
38,
47
],
[
47,
48
],
[
48,
49
],
[
47,
50
],
[
36,
51
],
[
51,
52
],
[
52,
53
],
[
52,
54
],
[
54,
55
],
[
55,
56
],
[
54,
57
],
[
57,
58
],
[
58,
59
],
[
51,
60
],
[
60,
61
],
[
60,
62
],
[
62,
63
],
[
63,
64
],
[
62,
65
],
[
65,
66
],
[
66,
67
],
[
51,
68
],
[
68,
69
],
[
69,
70
],
[
70,
71
],
[
69,
72
],
[
68,
73
],
[
73,
74
],
[
74,
75
],
[
75,
76
],
[
74,
77
],
[
77,
78
],
[
78,
79
],
[
77,
80
],
[
80,
81
],
[
80,
82
],
[
68,
83
],
[
83,
84
],
[
84,
85
],
[
85,
86
],
[
84,
87
],
[
83,
88
],
[
88,
89
],
[
89,
90
],
[
90,
91
],
[
89,
92
],
[
92,
93
],
[
93,
94
],
[
92,
95
],
[
95,
96
],
[
95,
97
],
[
83,
98
],
[
98,
99
],
[
99,
100
],
[
100,
101
],
[
99,
102
],
[
102,
103
],
[
103,
104
],
[
102,
105
],
[
105,
106
],
[
105,
107
],
[
36,
108
],
[
108,
109
],
[
109,
110
],
[
110,
111
],
[
109,
112
],
[
13,
113
],
[
113,
114
],
[
114,
115
],
[
115,
116
],
[
115,
117
],
[
113,
118
],
[
118,
119
],
[
119,
120
],
[
9,
121
],
[
121,
122
],
[
0,
123
],
[
123,
124
],
[
123,
125
]
] | [
"import java.util.Scanner;\nimport java.util.Stack;\n\npublic class Main {\n\tpublic static void main(String[] args) {\n\t\ttry(Scanner sc = new Scanner(System.in)){\n\t\t\tStack<String> stack=new Stack<String>();\n\t\t\tString s=sc.nextLine();\n\t\t\tString[] token=s.split(\" \");\n\t\t\tfor(String t:token) {\n\t\t\t\tif(t.equals(\"+\") || t.equals(\"-\") || t.equals(\"*\")){ \n\t\t\t\t\tint num1=Integer.valueOf((String) stack.pop());\n\t\t\t\t\tint num2=Integer.valueOf((String) stack.pop());\n\t\t\t\t\tif(t.equals(\"+\")) {\n\t\t\t\t\t\tstack.push(String.valueOf(num1+num2));\n\t\t\t\t\t}\n\t\t\t\t\telse if(t.equals(\"-\")) {\n\t\t\t\t\t\tstack.push(String.valueOf(num2-num1));\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tstack.push(String.valueOf(num1*num2));\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tstack.push(t);\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(stack.pop());\n\n\t\t}\n\t}\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"import java.util.Stack;",
"Stack",
"java.util",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\ttry(Scanner sc = new Scanner(System.in)){\n\t\t\tStack<String> stack=new Stack<String>();\n\t\t\tString s=sc.nextLine();\n\t\t\tString[] token=s.split(\" \");\n\t\t\tfor(String t:token) {\n\t\t\t\tif(t.equals(\"+\") || t.equals(\"-\") || t.equals(\"*\")){ \n\t\t\t\t\tint num1=Integer.valueOf((String) stack.pop());\n\t\t\t\t\tint num2=Integer.valueOf((String) stack.pop());\n\t\t\t\t\tif(t.equals(\"+\")) {\n\t\t\t\t\t\tstack.push(String.valueOf(num1+num2));\n\t\t\t\t\t}\n\t\t\t\t\telse if(t.equals(\"-\")) {\n\t\t\t\t\t\tstack.push(String.valueOf(num2-num1));\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tstack.push(String.valueOf(num1*num2));\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tstack.push(t);\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(stack.pop());\n\n\t\t}\n\t}\n}",
"Main",
"public static void main(String[] args) {\n\t\ttry(Scanner sc = new Scanner(System.in)){\n\t\t\tStack<String> stack=new Stack<String>();\n\t\t\tString s=sc.nextLine();\n\t\t\tString[] token=s.split(\" \");\n\t\t\tfor(String t:token) {\n\t\t\t\tif(t.equals(\"+\") || t.equals(\"-\") || t.equals(\"*\")){ \n\t\t\t\t\tint num1=Integer.valueOf((String) stack.pop());\n\t\t\t\t\tint num2=Integer.valueOf((String) stack.pop());\n\t\t\t\t\tif(t.equals(\"+\")) {\n\t\t\t\t\t\tstack.push(String.valueOf(num1+num2));\n\t\t\t\t\t}\n\t\t\t\t\telse if(t.equals(\"-\")) {\n\t\t\t\t\t\tstack.push(String.valueOf(num2-num1));\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tstack.push(String.valueOf(num1*num2));\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tstack.push(t);\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(stack.pop());\n\n\t\t}\n\t}",
"main",
"{\n\t\ttry(Scanner sc = new Scanner(System.in)){\n\t\t\tStack<String> stack=new Stack<String>();\n\t\t\tString s=sc.nextLine();\n\t\t\tString[] token=s.split(\" \");\n\t\t\tfor(String t:token) {\n\t\t\t\tif(t.equals(\"+\") || t.equals(\"-\") || t.equals(\"*\")){ \n\t\t\t\t\tint num1=Integer.valueOf((String) stack.pop());\n\t\t\t\t\tint num2=Integer.valueOf((String) stack.pop());\n\t\t\t\t\tif(t.equals(\"+\")) {\n\t\t\t\t\t\tstack.push(String.valueOf(num1+num2));\n\t\t\t\t\t}\n\t\t\t\t\telse if(t.equals(\"-\")) {\n\t\t\t\t\t\tstack.push(String.valueOf(num2-num1));\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tstack.push(String.valueOf(num1*num2));\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tstack.push(t);\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(stack.pop());\n\n\t\t}\n\t}",
"try(Scanner sc = new Scanner(System.in)){\n\t\t\tStack<String> stack=new Stack<String>();\n\t\t\tString s=sc.nextLine();\n\t\t\tString[] token=s.split(\" \");\n\t\t\tfor(String t:token) {\n\t\t\t\tif(t.equals(\"+\") || t.equals(\"-\") || t.equals(\"*\")){ \n\t\t\t\t\tint num1=Integer.valueOf((String) stack.pop());\n\t\t\t\t\tint num2=Integer.valueOf((String) stack.pop());\n\t\t\t\t\tif(t.equals(\"+\")) {\n\t\t\t\t\t\tstack.push(String.valueOf(num1+num2));\n\t\t\t\t\t}\n\t\t\t\t\telse if(t.equals(\"-\")) {\n\t\t\t\t\t\tstack.push(String.valueOf(num2-num1));\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tstack.push(String.valueOf(num1*num2));\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tstack.push(t);\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(stack.pop());\n\n\t\t}",
"{\n\t\t\tStack<String> stack=new Stack<String>();\n\t\t\tString s=sc.nextLine();\n\t\t\tString[] token=s.split(\" \");\n\t\t\tfor(String t:token) {\n\t\t\t\tif(t.equals(\"+\") || t.equals(\"-\") || t.equals(\"*\")){ \n\t\t\t\t\tint num1=Integer.valueOf((String) stack.pop());\n\t\t\t\t\tint num2=Integer.valueOf((String) stack.pop());\n\t\t\t\t\tif(t.equals(\"+\")) {\n\t\t\t\t\t\tstack.push(String.valueOf(num1+num2));\n\t\t\t\t\t}\n\t\t\t\t\telse if(t.equals(\"-\")) {\n\t\t\t\t\t\tstack.push(String.valueOf(num2-num1));\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tstack.push(String.valueOf(num1*num2));\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tstack.push(t);\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(stack.pop());\n\n\t\t}",
"Scanner sc = new Scanner(System.in)",
"Scanner sc = new Scanner(System.in)",
"new Scanner(System.in)",
"Stack<String> stack=new Stack<String>();",
"stack",
"new Stack<String>()",
"String s=sc.nextLine();",
"s",
"sc.nextLine()",
"sc.nextLine",
"sc",
"String[] token=s.split(\" \");",
"token",
"s.split(\" \")",
"s.split",
"s",
"\" \"",
"for(String t:token) {\n\t\t\t\tif(t.equals(\"+\") || t.equals(\"-\") || t.equals(\"*\")){ \n\t\t\t\t\tint num1=Integer.valueOf((String) stack.pop());\n\t\t\t\t\tint num2=Integer.valueOf((String) stack.pop());\n\t\t\t\t\tif(t.equals(\"+\")) {\n\t\t\t\t\t\tstack.push(String.valueOf(num1+num2));\n\t\t\t\t\t}\n\t\t\t\t\telse if(t.equals(\"-\")) {\n\t\t\t\t\t\tstack.push(String.valueOf(num2-num1));\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tstack.push(String.valueOf(num1*num2));\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tstack.push(t);\n\t\t\t\t}\n\t\t\t}",
"String t",
"token",
"{\n\t\t\t\tif(t.equals(\"+\") || t.equals(\"-\") || t.equals(\"*\")){ \n\t\t\t\t\tint num1=Integer.valueOf((String) stack.pop());\n\t\t\t\t\tint num2=Integer.valueOf((String) stack.pop());\n\t\t\t\t\tif(t.equals(\"+\")) {\n\t\t\t\t\t\tstack.push(String.valueOf(num1+num2));\n\t\t\t\t\t}\n\t\t\t\t\telse if(t.equals(\"-\")) {\n\t\t\t\t\t\tstack.push(String.valueOf(num2-num1));\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tstack.push(String.valueOf(num1*num2));\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tstack.push(t);\n\t\t\t\t}\n\t\t\t}",
"{\n\t\t\t\tif(t.equals(\"+\") || t.equals(\"-\") || t.equals(\"*\")){ \n\t\t\t\t\tint num1=Integer.valueOf((String) stack.pop());\n\t\t\t\t\tint num2=Integer.valueOf((String) stack.pop());\n\t\t\t\t\tif(t.equals(\"+\")) {\n\t\t\t\t\t\tstack.push(String.valueOf(num1+num2));\n\t\t\t\t\t}\n\t\t\t\t\telse if(t.equals(\"-\")) {\n\t\t\t\t\t\tstack.push(String.valueOf(num2-num1));\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tstack.push(String.valueOf(num1*num2));\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tstack.push(t);\n\t\t\t\t}\n\t\t\t}",
"if(t.equals(\"+\") || t.equals(\"-\") || t.equals(\"*\")){ \n\t\t\t\t\tint num1=Integer.valueOf((String) stack.pop());\n\t\t\t\t\tint num2=Integer.valueOf((String) stack.pop());\n\t\t\t\t\tif(t.equals(\"+\")) {\n\t\t\t\t\t\tstack.push(String.valueOf(num1+num2));\n\t\t\t\t\t}\n\t\t\t\t\telse if(t.equals(\"-\")) {\n\t\t\t\t\t\tstack.push(String.valueOf(num2-num1));\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tstack.push(String.valueOf(num1*num2));\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tstack.push(t);\n\t\t\t\t}",
"t.equals(\"+\") || t.equals(\"-\") || t.equals(\"*\")",
"t.equals(\"+\") || t.equals(\"-\") || t.equals(\"*\")",
"t.equals(\"+\")",
"t.equals",
"t",
"\"+\"",
"t.equals(\"-\")",
"t.equals",
"t",
"\"-\"",
"t.equals(\"*\")",
"t.equals",
"t",
"\"*\"",
"{ \n\t\t\t\t\tint num1=Integer.valueOf((String) stack.pop());\n\t\t\t\t\tint num2=Integer.valueOf((String) stack.pop());\n\t\t\t\t\tif(t.equals(\"+\")) {\n\t\t\t\t\t\tstack.push(String.valueOf(num1+num2));\n\t\t\t\t\t}\n\t\t\t\t\telse if(t.equals(\"-\")) {\n\t\t\t\t\t\tstack.push(String.valueOf(num2-num1));\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tstack.push(String.valueOf(num1*num2));\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}",
"int num1=Integer.valueOf((String) stack.pop());",
"num1",
"Integer.valueOf((String) stack.pop())",
"Integer.valueOf",
"Integer",
"(String) stack.pop()",
"stack.pop",
"stack",
"int num2=Integer.valueOf((String) stack.pop());",
"num2",
"Integer.valueOf((String) stack.pop())",
"Integer.valueOf",
"Integer",
"(String) stack.pop()",
"stack.pop",
"stack",
"if(t.equals(\"+\")) {\n\t\t\t\t\t\tstack.push(String.valueOf(num1+num2));\n\t\t\t\t\t}\n\t\t\t\t\telse if(t.equals(\"-\")) {\n\t\t\t\t\t\tstack.push(String.valueOf(num2-num1));\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tstack.push(String.valueOf(num1*num2));\n\t\t\t\t\t}",
"t.equals(\"+\")",
"t.equals",
"t",
"\"+\"",
"{\n\t\t\t\t\t\tstack.push(String.valueOf(num1+num2));\n\t\t\t\t\t}",
"stack.push(String.valueOf(num1+num2))",
"stack.push",
"stack",
"String.valueOf(num1+num2)",
"String.valueOf",
"String",
"num1+num2",
"num1",
"num2",
"if(t.equals(\"-\")) {\n\t\t\t\t\t\tstack.push(String.valueOf(num2-num1));\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tstack.push(String.valueOf(num1*num2));\n\t\t\t\t\t}",
"t.equals(\"-\")",
"t.equals",
"t",
"\"-\"",
"{\n\t\t\t\t\t\tstack.push(String.valueOf(num2-num1));\n\t\t\t\t\t}",
"stack.push(String.valueOf(num2-num1))",
"stack.push",
"stack",
"String.valueOf(num2-num1)",
"String.valueOf",
"String",
"num2-num1",
"num2",
"num1",
"{\n\t\t\t\t\t\tstack.push(String.valueOf(num1*num2));\n\t\t\t\t\t}",
"stack.push(String.valueOf(num1*num2))",
"stack.push",
"stack",
"String.valueOf(num1*num2)",
"String.valueOf",
"String",
"num1*num2",
"num1",
"num2",
"{\n\t\t\t\t\tstack.push(t);\n\t\t\t\t}",
"stack.push(t)",
"stack.push",
"stack",
"t",
"System.out.println(stack.pop())",
"System.out.println",
"System.out",
"System",
"System.out",
"stack.pop()",
"stack.pop",
"stack",
"String[] args",
"args",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\ttry(Scanner sc = new Scanner(System.in)){\n\t\t\tStack<String> stack=new Stack<String>();\n\t\t\tString s=sc.nextLine();\n\t\t\tString[] token=s.split(\" \");\n\t\t\tfor(String t:token) {\n\t\t\t\tif(t.equals(\"+\") || t.equals(\"-\") || t.equals(\"*\")){ \n\t\t\t\t\tint num1=Integer.valueOf((String) stack.pop());\n\t\t\t\t\tint num2=Integer.valueOf((String) stack.pop());\n\t\t\t\t\tif(t.equals(\"+\")) {\n\t\t\t\t\t\tstack.push(String.valueOf(num1+num2));\n\t\t\t\t\t}\n\t\t\t\t\telse if(t.equals(\"-\")) {\n\t\t\t\t\t\tstack.push(String.valueOf(num2-num1));\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tstack.push(String.valueOf(num1*num2));\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tstack.push(t);\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(stack.pop());\n\n\t\t}\n\t}\n}",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\ttry(Scanner sc = new Scanner(System.in)){\n\t\t\tStack<String> stack=new Stack<String>();\n\t\t\tString s=sc.nextLine();\n\t\t\tString[] token=s.split(\" \");\n\t\t\tfor(String t:token) {\n\t\t\t\tif(t.equals(\"+\") || t.equals(\"-\") || t.equals(\"*\")){ \n\t\t\t\t\tint num1=Integer.valueOf((String) stack.pop());\n\t\t\t\t\tint num2=Integer.valueOf((String) stack.pop());\n\t\t\t\t\tif(t.equals(\"+\")) {\n\t\t\t\t\t\tstack.push(String.valueOf(num1+num2));\n\t\t\t\t\t}\n\t\t\t\t\telse if(t.equals(\"-\")) {\n\t\t\t\t\t\tstack.push(String.valueOf(num2-num1));\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tstack.push(String.valueOf(num1*num2));\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tstack.push(t);\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(stack.pop());\n\n\t\t}\n\t}\n}",
"Main"
] | import java.util.Scanner;
import java.util.Stack;
public class Main {
public static void main(String[] args) {
try(Scanner sc = new Scanner(System.in)){
Stack<String> stack=new Stack<String>();
String s=sc.nextLine();
String[] token=s.split(" ");
for(String t:token) {
if(t.equals("+") || t.equals("-") || t.equals("*")){
int num1=Integer.valueOf((String) stack.pop());
int num2=Integer.valueOf((String) stack.pop());
if(t.equals("+")) {
stack.push(String.valueOf(num1+num2));
}
else if(t.equals("-")) {
stack.push(String.valueOf(num2-num1));
}
else {
stack.push(String.valueOf(num1*num2));
}
}
else {
stack.push(t);
}
}
System.out.println(stack.pop());
}
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
29,
4,
18,
13,
4,
18,
13,
23,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
17,
41,
13,
20,
28,
13,
13,
30,
30,
35,
13,
34,
17,
1,
4,
18,
13,
4,
18,
13,
2,
4,
13,
13,
4,
13,
13,
3,
34,
17,
1,
41,
13,
4,
13,
13,
41,
13,
4,
13,
13,
4,
18,
13,
4,
18,
13,
2,
13,
13,
3,
34,
17,
1,
4,
18,
13,
4,
18,
13,
2,
4,
13,
13,
4,
13,
13,
3,
34,
1,
4,
18,
13,
13,
3,
4,
18,
18,
13,
13,
4,
18,
13,
23,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
13,
14
],
[
14,
15
],
[
13,
16
],
[
16,
17
],
[
17,
18
],
[
9,
19
],
[
19,
20
],
[
7,
21
],
[
21,
22
],
[
21,
23
],
[
23,
24
],
[
24,
25
],
[
24,
26
],
[
23,
27
],
[
27,
28
],
[
27,
29
],
[
29,
30
],
[
30,
31
],
[
23,
32
],
[
32,
33
],
[
32,
34
],
[
34,
35
],
[
35,
36
],
[
34,
37
],
[
23,
38
],
[
38,
39
],
[
38,
40
],
[
23,
41
],
[
41,
42
],
[
41,
43
],
[
41,
44
],
[
45,
45
],
[
45,
46
],
[
46,
47
],
[
46,
48
],
[
48,
49
],
[
48,
50
],
[
50,
51
],
[
51,
52
],
[
52,
53
],
[
51,
54
],
[
54,
55
],
[
55,
56
],
[
54,
57
],
[
57,
58
],
[
58,
59
],
[
58,
60
],
[
57,
61
],
[
61,
62
],
[
61,
63
],
[
50,
64
],
[
46,
65
],
[
65,
66
],
[
65,
67
],
[
67,
68
],
[
68,
69
],
[
68,
70
],
[
70,
71
],
[
70,
72
],
[
67,
73
],
[
73,
74
],
[
73,
75
],
[
75,
76
],
[
75,
77
],
[
67,
78
],
[
78,
79
],
[
79,
80
],
[
78,
81
],
[
81,
82
],
[
82,
83
],
[
81,
84
],
[
84,
85
],
[
84,
86
],
[
67,
87
],
[
46,
88
],
[
88,
89
],
[
88,
90
],
[
90,
91
],
[
91,
92
],
[
92,
93
],
[
91,
94
],
[
94,
95
],
[
95,
96
],
[
94,
97
],
[
97,
98
],
[
98,
99
],
[
98,
100
],
[
97,
101
],
[
101,
102
],
[
101,
103
],
[
90,
104
],
[
46,
105
],
[
105,
106
],
[
106,
107
],
[
107,
108
],
[
108,
109
],
[
107,
110
],
[
106,
111
],
[
23,
112
],
[
112,
113
],
[
113,
114
],
[
114,
115
],
[
114,
116
],
[
112,
117
],
[
117,
118
],
[
118,
119
],
[
21,
120
],
[
120,
121
]
] | [
"import java.util.Scanner;\nimport java.util.Stack;\n\nclass Main {\n\n public static int popAsInt(Stack<String> stack) {\n return Integer.parseInt(stack.pop());\n }\n\n public static void main(String[] args) {\n Scanner s = new Scanner(System.in);\n String opsStr = s.nextLine();\n String[] ops = opsStr.split(\" \");\n Stack<String> stack = new Stack<String>();\n for (String op : ops) {\n switch(op) {\n case \"+\":\n stack.push(Integer.toString(popAsInt(stack) + popAsInt(stack)));\n break;\n case \"-\":\n int second = popAsInt(stack);\n int first = popAsInt(stack);\n stack.push(Integer.toString(first - second));\n break;\n case \"*\":\n stack.push(Integer.toString(popAsInt(stack) * popAsInt(stack)));\n break;\n default:\n stack.push(op);\n break;\n }\n }\n System.out.println(stack.pop());\n }\n\n}\n",
"import java.util.Scanner;",
"Scanner",
"java.util",
"import java.util.Stack;",
"Stack",
"java.util",
"class Main {\n\n public static int popAsInt(Stack<String> stack) {\n return Integer.parseInt(stack.pop());\n }\n\n public static void main(String[] args) {\n Scanner s = new Scanner(System.in);\n String opsStr = s.nextLine();\n String[] ops = opsStr.split(\" \");\n Stack<String> stack = new Stack<String>();\n for (String op : ops) {\n switch(op) {\n case \"+\":\n stack.push(Integer.toString(popAsInt(stack) + popAsInt(stack)));\n break;\n case \"-\":\n int second = popAsInt(stack);\n int first = popAsInt(stack);\n stack.push(Integer.toString(first - second));\n break;\n case \"*\":\n stack.push(Integer.toString(popAsInt(stack) * popAsInt(stack)));\n break;\n default:\n stack.push(op);\n break;\n }\n }\n System.out.println(stack.pop());\n }\n\n}",
"Main",
"public static int popAsInt(Stack<String> stack) {\n return Integer.parseInt(stack.pop());\n }",
"popAsInt",
"{\n return Integer.parseInt(stack.pop());\n }",
"return Integer.parseInt(stack.pop());",
"Integer.parseInt(stack.pop())",
"Integer.parseInt",
"Integer",
"stack.pop()",
"stack.pop",
"stack",
"Stack<String> stack",
"stack",
"public static void main(String[] args) {\n Scanner s = new Scanner(System.in);\n String opsStr = s.nextLine();\n String[] ops = opsStr.split(\" \");\n Stack<String> stack = new Stack<String>();\n for (String op : ops) {\n switch(op) {\n case \"+\":\n stack.push(Integer.toString(popAsInt(stack) + popAsInt(stack)));\n break;\n case \"-\":\n int second = popAsInt(stack);\n int first = popAsInt(stack);\n stack.push(Integer.toString(first - second));\n break;\n case \"*\":\n stack.push(Integer.toString(popAsInt(stack) * popAsInt(stack)));\n break;\n default:\n stack.push(op);\n break;\n }\n }\n System.out.println(stack.pop());\n }",
"main",
"{\n Scanner s = new Scanner(System.in);\n String opsStr = s.nextLine();\n String[] ops = opsStr.split(\" \");\n Stack<String> stack = new Stack<String>();\n for (String op : ops) {\n switch(op) {\n case \"+\":\n stack.push(Integer.toString(popAsInt(stack) + popAsInt(stack)));\n break;\n case \"-\":\n int second = popAsInt(stack);\n int first = popAsInt(stack);\n stack.push(Integer.toString(first - second));\n break;\n case \"*\":\n stack.push(Integer.toString(popAsInt(stack) * popAsInt(stack)));\n break;\n default:\n stack.push(op);\n break;\n }\n }\n System.out.println(stack.pop());\n }",
"Scanner s = new Scanner(System.in);",
"s",
"new Scanner(System.in)",
"String opsStr = s.nextLine();",
"opsStr",
"s.nextLine()",
"s.nextLine",
"s",
"String[] ops = opsStr.split(\" \");",
"ops",
"opsStr.split(\" \")",
"opsStr.split",
"opsStr",
"\" \"",
"Stack<String> stack = new Stack<String>();",
"stack",
"new Stack<String>()",
"for (String op : ops) {\n switch(op) {\n case \"+\":\n stack.push(Integer.toString(popAsInt(stack) + popAsInt(stack)));\n break;\n case \"-\":\n int second = popAsInt(stack);\n int first = popAsInt(stack);\n stack.push(Integer.toString(first - second));\n break;\n case \"*\":\n stack.push(Integer.toString(popAsInt(stack) * popAsInt(stack)));\n break;\n default:\n stack.push(op);\n break;\n }\n }",
"String op",
"ops",
"{\n switch(op) {\n case \"+\":\n stack.push(Integer.toString(popAsInt(stack) + popAsInt(stack)));\n break;\n case \"-\":\n int second = popAsInt(stack);\n int first = popAsInt(stack);\n stack.push(Integer.toString(first - second));\n break;\n case \"*\":\n stack.push(Integer.toString(popAsInt(stack) * popAsInt(stack)));\n break;\n default:\n stack.push(op);\n break;\n }\n }",
"{\n switch(op) {\n case \"+\":\n stack.push(Integer.toString(popAsInt(stack) + popAsInt(stack)));\n break;\n case \"-\":\n int second = popAsInt(stack);\n int first = popAsInt(stack);\n stack.push(Integer.toString(first - second));\n break;\n case \"*\":\n stack.push(Integer.toString(popAsInt(stack) * popAsInt(stack)));\n break;\n default:\n stack.push(op);\n break;\n }\n }",
"switch(op) {\n case \"+\":\n stack.push(Integer.toString(popAsInt(stack) + popAsInt(stack)));\n break;\n case \"-\":\n int second = popAsInt(stack);\n int first = popAsInt(stack);\n stack.push(Integer.toString(first - second));\n break;\n case \"*\":\n stack.push(Integer.toString(popAsInt(stack) * popAsInt(stack)));\n break;\n default:\n stack.push(op);\n break;\n }",
"op",
"case \"+\":",
"\"+\"",
"case \"+\":",
"stack.push(Integer.toString(popAsInt(stack) + popAsInt(stack)))",
"stack.push",
"stack",
"Integer.toString(popAsInt(stack) + popAsInt(stack))",
"Integer.toString",
"Integer",
"popAsInt(stack) + popAsInt(stack)",
"popAsInt(stack)",
"popAsInt",
"stack",
"popAsInt(stack)",
"popAsInt",
"stack",
"break;",
"case \"-\":",
"\"-\"",
"case \"-\":",
"int second = popAsInt(stack);",
"second",
"popAsInt(stack)",
"popAsInt",
"stack",
"int first = popAsInt(stack);",
"first",
"popAsInt(stack)",
"popAsInt",
"stack",
"stack.push(Integer.toString(first - second))",
"stack.push",
"stack",
"Integer.toString(first - second)",
"Integer.toString",
"Integer",
"first - second",
"first",
"second",
"break;",
"case \"*\":",
"\"*\"",
"case \"*\":",
"stack.push(Integer.toString(popAsInt(stack) * popAsInt(stack)))",
"stack.push",
"stack",
"Integer.toString(popAsInt(stack) * popAsInt(stack))",
"Integer.toString",
"Integer",
"popAsInt(stack) * popAsInt(stack)",
"popAsInt(stack)",
"popAsInt",
"stack",
"popAsInt(stack)",
"popAsInt",
"stack",
"break;",
"default:",
"default:",
"stack.push(op)",
"stack.push",
"stack",
"op",
"break;",
"System.out.println(stack.pop())",
"System.out.println",
"System.out",
"System",
"System.out",
"stack.pop()",
"stack.pop",
"stack",
"String[] args",
"args"
] | import java.util.Scanner;
import java.util.Stack;
class Main {
public static int popAsInt(Stack<String> stack) {
return Integer.parseInt(stack.pop());
}
public static void main(String[] args) {
Scanner s = new Scanner(System.in);
String opsStr = s.nextLine();
String[] ops = opsStr.split(" ");
Stack<String> stack = new Stack<String>();
for (String op : ops) {
switch(op) {
case "+":
stack.push(Integer.toString(popAsInt(stack) + popAsInt(stack)));
break;
case "-":
int second = popAsInt(stack);
int first = popAsInt(stack);
stack.push(Integer.toString(first - second));
break;
case "*":
stack.push(Integer.toString(popAsInt(stack) * popAsInt(stack)));
break;
default:
stack.push(op);
break;
}
}
System.out.println(stack.pop());
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
41,
13,
41,
13,
41,
13,
12,
13,
30,
0,
13,
40,
17,
0,
13,
20,
17,
0,
13,
17,
12,
13,
30,
0,
13,
18,
13,
13,
0,
18,
13,
40,
13,
17,
29,
13,
12,
13,
30,
0,
18,
13,
40,
13,
13,
23,
13,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
20,
41,
13,
41,
13,
38,
5,
13,
30,
4,
18,
13,
30,
41,
13,
0,
13,
4,
18,
4,
18,
13,
17,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
30,
14,
4,
18,
18,
13,
13,
17,
30,
0,
13,
4,
18,
13,
0,
13,
4,
18,
13,
4,
18,
13,
2,
13,
13,
14,
4,
18,
18,
13,
13,
17,
30,
0,
13,
4,
18,
13,
0,
13,
4,
18,
13,
4,
18,
13,
2,
13,
13,
14,
4,
18,
18,
13,
13,
17,
30,
0,
13,
4,
18,
13,
0,
13,
4,
18,
13,
4,
18,
13,
2,
13,
13,
14,
4,
18,
18,
13,
13,
17,
30,
0,
13,
4,
18,
13,
0,
13,
4,
18,
13,
4,
18,
13,
2,
13,
13,
30,
4,
18,
13,
4,
18,
13,
18,
13,
13,
4,
18,
18,
13,
13,
4,
18,
13,
23,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
10,
11
],
[
10,
12
],
[
12,
13
],
[
10,
14
],
[
14,
15
],
[
10,
16
],
[
16,
17
],
[
10,
18
],
[
18,
19
],
[
18,
20
],
[
20,
21
],
[
21,
22
],
[
21,
23
],
[
23,
24
],
[
20,
25
],
[
25,
26
],
[
25,
27
],
[
20,
29
],
[
29,
30
],
[
29,
31
],
[
10,
32
],
[
32,
33
],
[
32,
34
],
[
34,
35
],
[
35,
36
],
[
35,
37
],
[
37,
38
],
[
37,
39
],
[
34,
40
],
[
40,
41
],
[
41,
42
],
[
41,
43
],
[
43,
44
],
[
40,
45
],
[
34,
46
],
[
46,
47
],
[
10,
48
],
[
48,
49
],
[
48,
50
],
[
50,
51
],
[
51,
52
],
[
52,
53
],
[
52,
54
],
[
54,
55
],
[
51,
56
],
[
48,
57
],
[
57,
58
],
[
0,
59
],
[
59,
60
],
[
59,
61
],
[
61,
62
],
[
61,
63
],
[
63,
64
],
[
64,
65
],
[
64,
66
],
[
63,
67
],
[
67,
68
],
[
67,
69
],
[
63,
70
],
[
70,
71
],
[
63,
72
],
[
72,
73
],
[
63,
74
],
[
74,
75
],
[
75,
76
],
[
75,
77
],
[
77,
78
],
[
78,
79
],
[
79,
80
],
[
74,
81
],
[
81,
82
],
[
82,
83
],
[
81,
84
],
[
84,
85
],
[
84,
86
],
[
86,
87
],
[
87,
88
],
[
88,
89
],
[
89,
90
],
[
86,
91
],
[
81,
92
],
[
92,
93
],
[
93,
94
],
[
94,
95
],
[
94,
96
],
[
92,
97
],
[
97,
98
],
[
97,
99
],
[
99,
100
],
[
99,
101
],
[
92,
102
],
[
102,
103
],
[
103,
104
],
[
92,
105
],
[
106,
106
],
[
106,
107
],
[
107,
108
],
[
108,
109
],
[
109,
110
],
[
110,
111
],
[
110,
112
],
[
108,
113
],
[
107,
114
],
[
114,
115
],
[
115,
116
],
[
115,
117
],
[
117,
118
],
[
118,
119
],
[
114,
120
],
[
120,
121
],
[
120,
122
],
[
122,
123
],
[
123,
124
],
[
114,
125
],
[
125,
126
],
[
126,
127
],
[
125,
128
],
[
128,
129
],
[
128,
130
],
[
107,
131
],
[
131,
132
],
[
132,
133
],
[
133,
134
],
[
134,
135
],
[
134,
136
],
[
132,
137
],
[
131,
138
],
[
138,
139
],
[
139,
140
],
[
139,
141
],
[
141,
142
],
[
142,
143
],
[
138,
144
],
[
144,
145
],
[
144,
146
],
[
146,
147
],
[
147,
148
],
[
138,
149
],
[
149,
150
],
[
150,
151
],
[
149,
152
],
[
152,
153
],
[
152,
154
],
[
131,
155
],
[
155,
156
],
[
156,
157
],
[
157,
158
],
[
158,
159
],
[
158,
160
],
[
156,
161
],
[
155,
162
],
[
162,
163
],
[
163,
164
],
[
163,
165
],
[
165,
166
],
[
166,
167
],
[
162,
168
],
[
168,
169
],
[
168,
170
],
[
170,
171
],
[
171,
172
],
[
162,
173
],
[
173,
174
],
[
174,
175
],
[
173,
176
],
[
176,
177
],
[
176,
178
],
[
155,
179
],
[
179,
180
],
[
180,
181
],
[
181,
182
],
[
182,
183
],
[
182,
184
],
[
180,
185
],
[
179,
186
],
[
186,
187
],
[
187,
188
],
[
187,
189
],
[
189,
190
],
[
190,
191
],
[
186,
192
],
[
192,
193
],
[
192,
194
],
[
194,
195
],
[
195,
196
],
[
186,
197
],
[
197,
198
],
[
198,
199
],
[
197,
200
],
[
200,
201
],
[
200,
202
],
[
179,
203
],
[
203,
204
],
[
204,
205
],
[
205,
206
],
[
204,
207
],
[
207,
208
],
[
208,
209
],
[
207,
210
],
[
210,
211
],
[
210,
212
],
[
81,
213
],
[
213,
214
],
[
214,
215
],
[
215,
216
],
[
215,
217
],
[
213,
218
],
[
218,
219
],
[
219,
220
],
[
61,
221
],
[
221,
222
]
] | [
"import java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\n\nclass Stack {\n\n int top, tmp;\n int[] data;\n\n public Stack() {\n top = -1;\n data = new int[1000];\n tmp = 0;\n }\n\n public int pop() {\n tmp = data[top];\n data[top--] = 0;\n return tmp;\n }\n\n public void push(int a) {\n data[++top] = a;\n }\n}\n\nclass Main {\n public static void main(String[] args) {\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n Stack s = new Stack();\n int a, b;\n try {\n String[] n;\n n = br.readLine().split(\" \");\n for (int i = 0; i < n.length; i++) {\n if (n[i].equals(\"+\")) {\n a = s.pop();\n b = s.pop();\n s.push(a + b);\n } else if (n[i].equals(\"-\")) {\n a = s.pop();\n b = s.pop();\n s.push(b - a);\n } else if (n[i].equals(\"/\")) {\n a = s.pop();\n b = s.pop();\n s.push(b / a);\n } else if (n[i].equals(\"*\")) {\n a = s.pop();\n b = s.pop();\n s.push(a * b);\n } else {\n s.push(Integer.parseInt(n[i]));\n }\n }\n System.out.println(s.pop());\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n }\n}",
"import java.io.BufferedReader;",
"BufferedReader",
"java.io",
"import java.io.IOException;",
"IOException",
"java.io",
"import java.io.InputStreamReader;",
"InputStreamReader",
"java.io",
"class Stack {\n\n int top, tmp;\n int[] data;\n\n public Stack() {\n top = -1;\n data = new int[1000];\n tmp = 0;\n }\n\n public int pop() {\n tmp = data[top];\n data[top--] = 0;\n return tmp;\n }\n\n public void push(int a) {\n data[++top] = a;\n }\n}",
"Stack",
"int top",
"top",
"tmp;",
"tmp",
"int[] data;",
"data",
"public Stack() {\n top = -1;\n data = new int[1000];\n tmp = 0;\n }",
"Stack",
"{\n top = -1;\n data = new int[1000];\n tmp = 0;\n }",
"top = -1",
"top",
"-1",
"1",
"data = new int[1000]",
"data",
"new int[1000]",
"1000",
"tmp = 0",
"tmp",
"0",
"public int pop() {\n tmp = data[top];\n data[top--] = 0;\n return tmp;\n }",
"pop",
"{\n tmp = data[top];\n data[top--] = 0;\n return tmp;\n }",
"tmp = data[top]",
"tmp",
"data[top]",
"data",
"top",
"data[top--] = 0",
"data[top--]",
"data",
"top--",
"top",
"0",
"return tmp;",
"tmp",
"public void push(int a) {\n data[++top] = a;\n }",
"push",
"{\n data[++top] = a;\n }",
"data[++top] = a",
"data[++top]",
"data",
"++top",
"top",
"a",
"int a",
"a",
"class Main {\n public static void main(String[] args) {\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n Stack s = new Stack();\n int a, b;\n try {\n String[] n;\n n = br.readLine().split(\" \");\n for (int i = 0; i < n.length; i++) {\n if (n[i].equals(\"+\")) {\n a = s.pop();\n b = s.pop();\n s.push(a + b);\n } else if (n[i].equals(\"-\")) {\n a = s.pop();\n b = s.pop();\n s.push(b - a);\n } else if (n[i].equals(\"/\")) {\n a = s.pop();\n b = s.pop();\n s.push(b / a);\n } else if (n[i].equals(\"*\")) {\n a = s.pop();\n b = s.pop();\n s.push(a * b);\n } else {\n s.push(Integer.parseInt(n[i]));\n }\n }\n System.out.println(s.pop());\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n }\n}",
"Main",
"public static void main(String[] args) {\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n Stack s = new Stack();\n int a, b;\n try {\n String[] n;\n n = br.readLine().split(\" \");\n for (int i = 0; i < n.length; i++) {\n if (n[i].equals(\"+\")) {\n a = s.pop();\n b = s.pop();\n s.push(a + b);\n } else if (n[i].equals(\"-\")) {\n a = s.pop();\n b = s.pop();\n s.push(b - a);\n } else if (n[i].equals(\"/\")) {\n a = s.pop();\n b = s.pop();\n s.push(b / a);\n } else if (n[i].equals(\"*\")) {\n a = s.pop();\n b = s.pop();\n s.push(a * b);\n } else {\n s.push(Integer.parseInt(n[i]));\n }\n }\n System.out.println(s.pop());\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n }",
"main",
"{\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n Stack s = new Stack();\n int a, b;\n try {\n String[] n;\n n = br.readLine().split(\" \");\n for (int i = 0; i < n.length; i++) {\n if (n[i].equals(\"+\")) {\n a = s.pop();\n b = s.pop();\n s.push(a + b);\n } else if (n[i].equals(\"-\")) {\n a = s.pop();\n b = s.pop();\n s.push(b - a);\n } else if (n[i].equals(\"/\")) {\n a = s.pop();\n b = s.pop();\n s.push(b / a);\n } else if (n[i].equals(\"*\")) {\n a = s.pop();\n b = s.pop();\n s.push(a * b);\n } else {\n s.push(Integer.parseInt(n[i]));\n }\n }\n System.out.println(s.pop());\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n }",
"BufferedReader br = new BufferedReader(new InputStreamReader(System.in));",
"br",
"new BufferedReader(new InputStreamReader(System.in))",
"Stack s = new Stack();",
"s",
"new Stack()",
"int a",
"a",
"b;",
"b",
"try {\n String[] n;\n n = br.readLine().split(\" \");\n for (int i = 0; i < n.length; i++) {\n if (n[i].equals(\"+\")) {\n a = s.pop();\n b = s.pop();\n s.push(a + b);\n } else if (n[i].equals(\"-\")) {\n a = s.pop();\n b = s.pop();\n s.push(b - a);\n } else if (n[i].equals(\"/\")) {\n a = s.pop();\n b = s.pop();\n s.push(b / a);\n } else if (n[i].equals(\"*\")) {\n a = s.pop();\n b = s.pop();\n s.push(a * b);\n } else {\n s.push(Integer.parseInt(n[i]));\n }\n }\n System.out.println(s.pop());\n } catch (IOException e) {\n e.printStackTrace();\n }",
"catch (IOException e) {\n e.printStackTrace();\n }",
"IOException e",
"{\n e.printStackTrace();\n }",
"e.printStackTrace()",
"e.printStackTrace",
"e",
"{\n String[] n;\n n = br.readLine().split(\" \");\n for (int i = 0; i < n.length; i++) {\n if (n[i].equals(\"+\")) {\n a = s.pop();\n b = s.pop();\n s.push(a + b);\n } else if (n[i].equals(\"-\")) {\n a = s.pop();\n b = s.pop();\n s.push(b - a);\n } else if (n[i].equals(\"/\")) {\n a = s.pop();\n b = s.pop();\n s.push(b / a);\n } else if (n[i].equals(\"*\")) {\n a = s.pop();\n b = s.pop();\n s.push(a * b);\n } else {\n s.push(Integer.parseInt(n[i]));\n }\n }\n System.out.println(s.pop());\n }",
"String[] n;",
"n",
"n = br.readLine().split(\" \")",
"n",
"br.readLine().split(\" \")",
"br.readLine().split",
"br.readLine()",
"br.readLine",
"br",
"\" \"",
"for (int i = 0; i < n.length; i++) {\n if (n[i].equals(\"+\")) {\n a = s.pop();\n b = s.pop();\n s.push(a + b);\n } else if (n[i].equals(\"-\")) {\n a = s.pop();\n b = s.pop();\n s.push(b - a);\n } else if (n[i].equals(\"/\")) {\n a = s.pop();\n b = s.pop();\n s.push(b / a);\n } else if (n[i].equals(\"*\")) {\n a = s.pop();\n b = s.pop();\n s.push(a * b);\n } else {\n s.push(Integer.parseInt(n[i]));\n }\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n.length",
"i",
"n.length",
"n",
"n.length",
"i++",
"i++",
"i",
"{\n if (n[i].equals(\"+\")) {\n a = s.pop();\n b = s.pop();\n s.push(a + b);\n } else if (n[i].equals(\"-\")) {\n a = s.pop();\n b = s.pop();\n s.push(b - a);\n } else if (n[i].equals(\"/\")) {\n a = s.pop();\n b = s.pop();\n s.push(b / a);\n } else if (n[i].equals(\"*\")) {\n a = s.pop();\n b = s.pop();\n s.push(a * b);\n } else {\n s.push(Integer.parseInt(n[i]));\n }\n }",
"{\n if (n[i].equals(\"+\")) {\n a = s.pop();\n b = s.pop();\n s.push(a + b);\n } else if (n[i].equals(\"-\")) {\n a = s.pop();\n b = s.pop();\n s.push(b - a);\n } else if (n[i].equals(\"/\")) {\n a = s.pop();\n b = s.pop();\n s.push(b / a);\n } else if (n[i].equals(\"*\")) {\n a = s.pop();\n b = s.pop();\n s.push(a * b);\n } else {\n s.push(Integer.parseInt(n[i]));\n }\n }",
"if (n[i].equals(\"+\")) {\n a = s.pop();\n b = s.pop();\n s.push(a + b);\n } else if (n[i].equals(\"-\")) {\n a = s.pop();\n b = s.pop();\n s.push(b - a);\n } else if (n[i].equals(\"/\")) {\n a = s.pop();\n b = s.pop();\n s.push(b / a);\n } else if (n[i].equals(\"*\")) {\n a = s.pop();\n b = s.pop();\n s.push(a * b);\n } else {\n s.push(Integer.parseInt(n[i]));\n }",
"n[i].equals(\"+\")",
"n[i].equals",
"n[i]",
"n",
"i",
"\"+\"",
"{\n a = s.pop();\n b = s.pop();\n s.push(a + b);\n }",
"a = s.pop()",
"a",
"s.pop()",
"s.pop",
"s",
"b = s.pop()",
"b",
"s.pop()",
"s.pop",
"s",
"s.push(a + b)",
"s.push",
"s",
"a + b",
"a",
"b",
"if (n[i].equals(\"-\")) {\n a = s.pop();\n b = s.pop();\n s.push(b - a);\n } else if (n[i].equals(\"/\")) {\n a = s.pop();\n b = s.pop();\n s.push(b / a);\n } else if (n[i].equals(\"*\")) {\n a = s.pop();\n b = s.pop();\n s.push(a * b);\n } else {\n s.push(Integer.parseInt(n[i]));\n }",
"n[i].equals(\"-\")",
"n[i].equals",
"n[i]",
"n",
"i",
"\"-\"",
"{\n a = s.pop();\n b = s.pop();\n s.push(b - a);\n }",
"a = s.pop()",
"a",
"s.pop()",
"s.pop",
"s",
"b = s.pop()",
"b",
"s.pop()",
"s.pop",
"s",
"s.push(b - a)",
"s.push",
"s",
"b - a",
"b",
"a",
"if (n[i].equals(\"/\")) {\n a = s.pop();\n b = s.pop();\n s.push(b / a);\n } else if (n[i].equals(\"*\")) {\n a = s.pop();\n b = s.pop();\n s.push(a * b);\n } else {\n s.push(Integer.parseInt(n[i]));\n }",
"n[i].equals(\"/\")",
"n[i].equals",
"n[i]",
"n",
"i",
"\"/\"",
"{\n a = s.pop();\n b = s.pop();\n s.push(b / a);\n }",
"a = s.pop()",
"a",
"s.pop()",
"s.pop",
"s",
"b = s.pop()",
"b",
"s.pop()",
"s.pop",
"s",
"s.push(b / a)",
"s.push",
"s",
"b / a",
"b",
"a",
"if (n[i].equals(\"*\")) {\n a = s.pop();\n b = s.pop();\n s.push(a * b);\n } else {\n s.push(Integer.parseInt(n[i]));\n }",
"n[i].equals(\"*\")",
"n[i].equals",
"n[i]",
"n",
"i",
"\"*\"",
"{\n a = s.pop();\n b = s.pop();\n s.push(a * b);\n }",
"a = s.pop()",
"a",
"s.pop()",
"s.pop",
"s",
"b = s.pop()",
"b",
"s.pop()",
"s.pop",
"s",
"s.push(a * b)",
"s.push",
"s",
"a * b",
"a",
"b",
"{\n s.push(Integer.parseInt(n[i]));\n }",
"s.push(Integer.parseInt(n[i]))",
"s.push",
"s",
"Integer.parseInt(n[i])",
"Integer.parseInt",
"Integer",
"n[i]",
"n",
"i",
"System.out.println(s.pop())",
"System.out.println",
"System.out",
"System",
"System.out",
"s.pop()",
"s.pop",
"s",
"String[] args",
"args"
] | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
class Stack {
int top, tmp;
int[] data;
public Stack() {
top = -1;
data = new int[1000];
tmp = 0;
}
public int pop() {
tmp = data[top];
data[top--] = 0;
return tmp;
}
public void push(int a) {
data[++top] = a;
}
}
class Main {
public static void main(String[] args) {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
Stack s = new Stack();
int a, b;
try {
String[] n;
n = br.readLine().split(" ");
for (int i = 0; i < n.length; i++) {
if (n[i].equals("+")) {
a = s.pop();
b = s.pop();
s.push(a + b);
} else if (n[i].equals("-")) {
a = s.pop();
b = s.pop();
s.push(b - a);
} else if (n[i].equals("/")) {
a = s.pop();
b = s.pop();
s.push(b / a);
} else if (n[i].equals("*")) {
a = s.pop();
b = s.pop();
s.push(a * b);
} else {
s.push(Integer.parseInt(n[i]));
}
}
System.out.println(s.pop());
} catch (IOException e) {
e.printStackTrace();
}
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
4,
18,
13,
17,
41,
13,
20,
18,
13,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
30,
41,
13,
18,
13,
13,
14,
4,
18,
13,
17,
30,
0,
18,
13,
13,
4,
18,
13,
13,
40,
13,
30,
35,
13,
34,
17,
1,
0,
18,
13,
2,
13,
17,
2,
18,
13,
2,
13,
17,
18,
13,
2,
13,
17,
40,
13,
3,
34,
17,
1,
0,
18,
13,
2,
13,
17,
2,
18,
13,
2,
13,
17,
18,
13,
2,
13,
17,
40,
13,
3,
34,
17,
1,
0,
18,
13,
2,
13,
17,
2,
18,
13,
2,
13,
17,
18,
13,
2,
13,
17,
40,
13,
3,
4,
18,
18,
13,
13,
18,
13,
2,
13,
17,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
150,
5
],
[
150,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
16,
17
],
[
17,
18
],
[
14,
19
],
[
8,
20
],
[
20,
21
],
[
20,
22
],
[
23,
24
],
[
23,
25
],
[
8,
26
],
[
26,
27
],
[
26,
28
],
[
8,
29
],
[
29,
30
],
[
30,
31
],
[
31,
32
],
[
31,
33
],
[
29,
34
],
[
34,
35
],
[
34,
36
],
[
36,
37
],
[
36,
38
],
[
29,
39
],
[
39,
40
],
[
40,
41
],
[
29,
42
],
[
43,
43
],
[
43,
44
],
[
44,
45
],
[
44,
46
],
[
46,
47
],
[
46,
48
],
[
43,
49
],
[
49,
50
],
[
50,
51
],
[
51,
52
],
[
50,
53
],
[
49,
54
],
[
54,
55
],
[
55,
56
],
[
56,
57
],
[
56,
58
],
[
55,
59
],
[
59,
60
],
[
60,
61
],
[
59,
62
],
[
54,
63
],
[
63,
64
],
[
49,
65
],
[
65,
66
],
[
66,
67
],
[
66,
68
],
[
68,
69
],
[
68,
70
],
[
70,
71
],
[
71,
72
],
[
72,
73
],
[
72,
74
],
[
74,
75
],
[
74,
76
],
[
71,
77
],
[
77,
78
],
[
78,
79
],
[
78,
80
],
[
80,
81
],
[
80,
82
],
[
77,
83
],
[
83,
84
],
[
83,
85
],
[
85,
86
],
[
85,
87
],
[
70,
88
],
[
88,
89
],
[
70,
90
],
[
66,
91
],
[
91,
92
],
[
91,
93
],
[
93,
94
],
[
94,
95
],
[
95,
96
],
[
95,
97
],
[
97,
98
],
[
97,
99
],
[
94,
100
],
[
100,
101
],
[
101,
102
],
[
101,
103
],
[
103,
104
],
[
103,
105
],
[
100,
106
],
[
106,
107
],
[
106,
108
],
[
108,
109
],
[
108,
110
],
[
93,
111
],
[
111,
112
],
[
93,
113
],
[
66,
114
],
[
114,
115
],
[
114,
116
],
[
116,
117
],
[
117,
118
],
[
118,
119
],
[
118,
120
],
[
120,
121
],
[
120,
122
],
[
117,
123
],
[
123,
124
],
[
124,
125
],
[
124,
126
],
[
126,
127
],
[
126,
128
],
[
123,
129
],
[
129,
130
],
[
129,
131
],
[
131,
132
],
[
131,
133
],
[
116,
134
],
[
134,
135
],
[
116,
136
],
[
8,
137
],
[
137,
138
],
[
138,
139
],
[
139,
140
],
[
139,
141
],
[
137,
142
],
[
142,
143
],
[
142,
144
],
[
144,
145
],
[
144,
146
],
[
6,
147
],
[
147,
148
],
[
0,
149
],
[
149,
150
],
[
149,
151
]
] | [
"import java.util.Scanner;\n\npublic class Main {\n\n\tpublic static void main(String[] args) throws Exception {\n\n\t\tScanner sc = new Scanner(System.in);\n\t\tString[] str = sc.nextLine().split(\" \");\n\t\tint[] num = new int[str.length];\n\t\tint i = 0;\n\n\t\tfor(int j = 0; j < str.length; j++) {\n\n\t\t\tString temp = str[j];\n\n\t\t\tif(temp.matches(\"[0-9]{1,}\")) {\n\t\t\t\tnum[i] = Integer.parseInt(temp);\n\t\t\t\ti++;\n\t\t\t} else {\n\t\t\t\tswitch(temp) {\n\t\t\t\tcase \"+\" :\n\t\t\t\t\tnum[i-2] = num[i-2] + num[i-1];\n\t\t\t\t\ti--;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"-\" :\n\t\t\t\t\tnum[i-2] = num[i-2] - num[i-1];\n\t\t\t\t\ti--;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"*\" :\n\t\t\t\t\tnum[i-2] = num[i-2] * num[i-1];\n\t\t\t\t\ti--;\n\t\t\t\t\tbreak;\n\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(num[i-1]);\n\t}\n\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\n\tpublic static void main(String[] args) throws Exception {\n\n\t\tScanner sc = new Scanner(System.in);\n\t\tString[] str = sc.nextLine().split(\" \");\n\t\tint[] num = new int[str.length];\n\t\tint i = 0;\n\n\t\tfor(int j = 0; j < str.length; j++) {\n\n\t\t\tString temp = str[j];\n\n\t\t\tif(temp.matches(\"[0-9]{1,}\")) {\n\t\t\t\tnum[i] = Integer.parseInt(temp);\n\t\t\t\ti++;\n\t\t\t} else {\n\t\t\t\tswitch(temp) {\n\t\t\t\tcase \"+\" :\n\t\t\t\t\tnum[i-2] = num[i-2] + num[i-1];\n\t\t\t\t\ti--;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"-\" :\n\t\t\t\t\tnum[i-2] = num[i-2] - num[i-1];\n\t\t\t\t\ti--;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"*\" :\n\t\t\t\t\tnum[i-2] = num[i-2] * num[i-1];\n\t\t\t\t\ti--;\n\t\t\t\t\tbreak;\n\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(num[i-1]);\n\t}\n\n}",
"Main",
"public static void main(String[] args) throws Exception {\n\n\t\tScanner sc = new Scanner(System.in);\n\t\tString[] str = sc.nextLine().split(\" \");\n\t\tint[] num = new int[str.length];\n\t\tint i = 0;\n\n\t\tfor(int j = 0; j < str.length; j++) {\n\n\t\t\tString temp = str[j];\n\n\t\t\tif(temp.matches(\"[0-9]{1,}\")) {\n\t\t\t\tnum[i] = Integer.parseInt(temp);\n\t\t\t\ti++;\n\t\t\t} else {\n\t\t\t\tswitch(temp) {\n\t\t\t\tcase \"+\" :\n\t\t\t\t\tnum[i-2] = num[i-2] + num[i-1];\n\t\t\t\t\ti--;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"-\" :\n\t\t\t\t\tnum[i-2] = num[i-2] - num[i-1];\n\t\t\t\t\ti--;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"*\" :\n\t\t\t\t\tnum[i-2] = num[i-2] * num[i-1];\n\t\t\t\t\ti--;\n\t\t\t\t\tbreak;\n\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(num[i-1]);\n\t}",
"main",
"{\n\n\t\tScanner sc = new Scanner(System.in);\n\t\tString[] str = sc.nextLine().split(\" \");\n\t\tint[] num = new int[str.length];\n\t\tint i = 0;\n\n\t\tfor(int j = 0; j < str.length; j++) {\n\n\t\t\tString temp = str[j];\n\n\t\t\tif(temp.matches(\"[0-9]{1,}\")) {\n\t\t\t\tnum[i] = Integer.parseInt(temp);\n\t\t\t\ti++;\n\t\t\t} else {\n\t\t\t\tswitch(temp) {\n\t\t\t\tcase \"+\" :\n\t\t\t\t\tnum[i-2] = num[i-2] + num[i-1];\n\t\t\t\t\ti--;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"-\" :\n\t\t\t\t\tnum[i-2] = num[i-2] - num[i-1];\n\t\t\t\t\ti--;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"*\" :\n\t\t\t\t\tnum[i-2] = num[i-2] * num[i-1];\n\t\t\t\t\ti--;\n\t\t\t\t\tbreak;\n\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(num[i-1]);\n\t}",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"String[] str = sc.nextLine().split(\" \");",
"str",
"sc.nextLine().split(\" \")",
"sc.nextLine().split",
"sc.nextLine()",
"sc.nextLine",
"sc",
"\" \"",
"int[] num = new int[str.length];",
"num",
"new int[str.length]",
"str.length",
"str",
"str.length",
"int i = 0;",
"i",
"0",
"for(int j = 0; j < str.length; j++) {\n\n\t\t\tString temp = str[j];\n\n\t\t\tif(temp.matches(\"[0-9]{1,}\")) {\n\t\t\t\tnum[i] = Integer.parseInt(temp);\n\t\t\t\ti++;\n\t\t\t} else {\n\t\t\t\tswitch(temp) {\n\t\t\t\tcase \"+\" :\n\t\t\t\t\tnum[i-2] = num[i-2] + num[i-1];\n\t\t\t\t\ti--;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"-\" :\n\t\t\t\t\tnum[i-2] = num[i-2] - num[i-1];\n\t\t\t\t\ti--;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"*\" :\n\t\t\t\t\tnum[i-2] = num[i-2] * num[i-1];\n\t\t\t\t\ti--;\n\t\t\t\t\tbreak;\n\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < str.length",
"j",
"str.length",
"str",
"str.length",
"j++",
"j++",
"j",
"{\n\n\t\t\tString temp = str[j];\n\n\t\t\tif(temp.matches(\"[0-9]{1,}\")) {\n\t\t\t\tnum[i] = Integer.parseInt(temp);\n\t\t\t\ti++;\n\t\t\t} else {\n\t\t\t\tswitch(temp) {\n\t\t\t\tcase \"+\" :\n\t\t\t\t\tnum[i-2] = num[i-2] + num[i-1];\n\t\t\t\t\ti--;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"-\" :\n\t\t\t\t\tnum[i-2] = num[i-2] - num[i-1];\n\t\t\t\t\ti--;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"*\" :\n\t\t\t\t\tnum[i-2] = num[i-2] * num[i-1];\n\t\t\t\t\ti--;\n\t\t\t\t\tbreak;\n\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"{\n\n\t\t\tString temp = str[j];\n\n\t\t\tif(temp.matches(\"[0-9]{1,}\")) {\n\t\t\t\tnum[i] = Integer.parseInt(temp);\n\t\t\t\ti++;\n\t\t\t} else {\n\t\t\t\tswitch(temp) {\n\t\t\t\tcase \"+\" :\n\t\t\t\t\tnum[i-2] = num[i-2] + num[i-1];\n\t\t\t\t\ti--;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"-\" :\n\t\t\t\t\tnum[i-2] = num[i-2] - num[i-1];\n\t\t\t\t\ti--;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"*\" :\n\t\t\t\t\tnum[i-2] = num[i-2] * num[i-1];\n\t\t\t\t\ti--;\n\t\t\t\t\tbreak;\n\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"String temp = str[j];",
"temp",
"str[j]",
"str",
"j",
"if(temp.matches(\"[0-9]{1,}\")) {\n\t\t\t\tnum[i] = Integer.parseInt(temp);\n\t\t\t\ti++;\n\t\t\t} else {\n\t\t\t\tswitch(temp) {\n\t\t\t\tcase \"+\" :\n\t\t\t\t\tnum[i-2] = num[i-2] + num[i-1];\n\t\t\t\t\ti--;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"-\" :\n\t\t\t\t\tnum[i-2] = num[i-2] - num[i-1];\n\t\t\t\t\ti--;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"*\" :\n\t\t\t\t\tnum[i-2] = num[i-2] * num[i-1];\n\t\t\t\t\ti--;\n\t\t\t\t\tbreak;\n\n\t\t\t\t}\n\t\t\t}",
"temp.matches(\"[0-9]{1,}\")",
"temp.matches",
"temp",
"\"[0-9]{1,}\"",
"{\n\t\t\t\tnum[i] = Integer.parseInt(temp);\n\t\t\t\ti++;\n\t\t\t}",
"num[i] = Integer.parseInt(temp)",
"num[i]",
"num",
"i",
"Integer.parseInt(temp)",
"Integer.parseInt",
"Integer",
"temp",
"i++",
"i",
"{\n\t\t\t\tswitch(temp) {\n\t\t\t\tcase \"+\" :\n\t\t\t\t\tnum[i-2] = num[i-2] + num[i-1];\n\t\t\t\t\ti--;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"-\" :\n\t\t\t\t\tnum[i-2] = num[i-2] - num[i-1];\n\t\t\t\t\ti--;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"*\" :\n\t\t\t\t\tnum[i-2] = num[i-2] * num[i-1];\n\t\t\t\t\ti--;\n\t\t\t\t\tbreak;\n\n\t\t\t\t}\n\t\t\t}",
"switch(temp) {\n\t\t\t\tcase \"+\" :\n\t\t\t\t\tnum[i-2] = num[i-2] + num[i-1];\n\t\t\t\t\ti--;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"-\" :\n\t\t\t\t\tnum[i-2] = num[i-2] - num[i-1];\n\t\t\t\t\ti--;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"*\" :\n\t\t\t\t\tnum[i-2] = num[i-2] * num[i-1];\n\t\t\t\t\ti--;\n\t\t\t\t\tbreak;\n\n\t\t\t\t}",
"temp",
"case \"+\" :",
"\"+\"",
"case \"+\" :",
"num[i-2] = num[i-2] + num[i-1]",
"num[i-2]",
"num",
"i-2",
"i",
"2",
"num[i-2] + num[i-1]",
"num[i-2]",
"num",
"i-2",
"i",
"2",
"num[i-1]",
"num",
"i-1",
"i",
"1",
"i--",
"i",
"break;",
"case \"-\" :",
"\"-\"",
"case \"-\" :",
"num[i-2] = num[i-2] - num[i-1]",
"num[i-2]",
"num",
"i-2",
"i",
"2",
"num[i-2] - num[i-1]",
"num[i-2]",
"num",
"i-2",
"i",
"2",
"num[i-1]",
"num",
"i-1",
"i",
"1",
"i--",
"i",
"break;",
"case \"*\" :",
"\"*\"",
"case \"*\" :",
"num[i-2] = num[i-2] * num[i-1]",
"num[i-2]",
"num",
"i-2",
"i",
"2",
"num[i-2] * num[i-1]",
"num[i-2]",
"num",
"i-2",
"i",
"2",
"num[i-1]",
"num",
"i-1",
"i",
"1",
"i--",
"i",
"break;",
"System.out.println(num[i-1])",
"System.out.println",
"System.out",
"System",
"System.out",
"num[i-1]",
"num",
"i-1",
"i",
"1",
"String[] args",
"args",
"public class Main {\n\n\tpublic static void main(String[] args) throws Exception {\n\n\t\tScanner sc = new Scanner(System.in);\n\t\tString[] str = sc.nextLine().split(\" \");\n\t\tint[] num = new int[str.length];\n\t\tint i = 0;\n\n\t\tfor(int j = 0; j < str.length; j++) {\n\n\t\t\tString temp = str[j];\n\n\t\t\tif(temp.matches(\"[0-9]{1,}\")) {\n\t\t\t\tnum[i] = Integer.parseInt(temp);\n\t\t\t\ti++;\n\t\t\t} else {\n\t\t\t\tswitch(temp) {\n\t\t\t\tcase \"+\" :\n\t\t\t\t\tnum[i-2] = num[i-2] + num[i-1];\n\t\t\t\t\ti--;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"-\" :\n\t\t\t\t\tnum[i-2] = num[i-2] - num[i-1];\n\t\t\t\t\ti--;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"*\" :\n\t\t\t\t\tnum[i-2] = num[i-2] * num[i-1];\n\t\t\t\t\ti--;\n\t\t\t\t\tbreak;\n\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(num[i-1]);\n\t}\n\n}",
"public class Main {\n\n\tpublic static void main(String[] args) throws Exception {\n\n\t\tScanner sc = new Scanner(System.in);\n\t\tString[] str = sc.nextLine().split(\" \");\n\t\tint[] num = new int[str.length];\n\t\tint i = 0;\n\n\t\tfor(int j = 0; j < str.length; j++) {\n\n\t\t\tString temp = str[j];\n\n\t\t\tif(temp.matches(\"[0-9]{1,}\")) {\n\t\t\t\tnum[i] = Integer.parseInt(temp);\n\t\t\t\ti++;\n\t\t\t} else {\n\t\t\t\tswitch(temp) {\n\t\t\t\tcase \"+\" :\n\t\t\t\t\tnum[i-2] = num[i-2] + num[i-1];\n\t\t\t\t\ti--;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"-\" :\n\t\t\t\t\tnum[i-2] = num[i-2] - num[i-1];\n\t\t\t\t\ti--;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"*\" :\n\t\t\t\t\tnum[i-2] = num[i-2] * num[i-1];\n\t\t\t\t\ti--;\n\t\t\t\t\tbreak;\n\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(num[i-1]);\n\t}\n\n}",
"Main"
] | import java.util.Scanner;
public class Main {
public static void main(String[] args) throws Exception {
Scanner sc = new Scanner(System.in);
String[] str = sc.nextLine().split(" ");
int[] num = new int[str.length];
int i = 0;
for(int j = 0; j < str.length; j++) {
String temp = str[j];
if(temp.matches("[0-9]{1,}")) {
num[i] = Integer.parseInt(temp);
i++;
} else {
switch(temp) {
case "+" :
num[i-2] = num[i-2] + num[i-1];
i--;
break;
case "-" :
num[i-2] = num[i-2] - num[i-1];
i--;
break;
case "*" :
num[i-2] = num[i-2] * num[i-1];
i--;
break;
}
}
}
System.out.println(num[i-1]);
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
41,
13,
20,
12,
13,
30,
41,
13,
0,
13,
4,
18,
13,
41,
13,
4,
18,
13,
17,
41,
13,
20,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
30,
41,
13,
17,
38,
5,
13,
30,
0,
13,
17,
30,
41,
13,
4,
18,
13,
18,
13,
13,
14,
13,
30,
4,
18,
13,
4,
18,
13,
18,
13,
13,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
35,
18,
13,
13,
34,
17,
1,
4,
18,
13,
2,
13,
13,
3,
34,
17,
1,
4,
18,
13,
2,
13,
13,
3,
34,
17,
1,
4,
18,
13,
2,
13,
13,
3,
34,
17,
1,
4,
18,
13,
2,
13,
13,
3,
4,
18,
18,
13,
13,
4,
18,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
143,
8
],
[
143,
9
],
[
9,
10
],
[
9,
11
],
[
143,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
14,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
14,
22
],
[
22,
23
],
[
22,
24
],
[
24,
25
],
[
25,
26
],
[
24,
27
],
[
14,
28
],
[
28,
29
],
[
28,
30
],
[
14,
31
],
[
31,
32
],
[
32,
33
],
[
33,
34
],
[
33,
35
],
[
31,
36
],
[
36,
37
],
[
36,
38
],
[
38,
39
],
[
38,
40
],
[
31,
41
],
[
41,
42
],
[
42,
43
],
[
31,
44
],
[
45,
45
],
[
45,
46
],
[
46,
47
],
[
46,
48
],
[
45,
49
],
[
49,
50
],
[
50,
51
],
[
50,
52
],
[
52,
53
],
[
53,
54
],
[
53,
55
],
[
49,
56
],
[
56,
57
],
[
57,
58
],
[
57,
59
],
[
59,
60
],
[
60,
61
],
[
59,
62
],
[
62,
63
],
[
62,
64
],
[
45,
65
],
[
65,
66
],
[
65,
67
],
[
67,
68
],
[
68,
69
],
[
69,
70
],
[
68,
71
],
[
71,
72
],
[
72,
73
],
[
71,
74
],
[
74,
75
],
[
74,
76
],
[
65,
77
],
[
77,
78
],
[
78,
79
],
[
78,
80
],
[
80,
81
],
[
81,
82
],
[
77,
83
],
[
83,
84
],
[
83,
85
],
[
85,
86
],
[
86,
87
],
[
77,
88
],
[
88,
89
],
[
89,
90
],
[
89,
91
],
[
88,
92
],
[
92,
93
],
[
92,
94
],
[
94,
95
],
[
95,
96
],
[
96,
97
],
[
95,
98
],
[
98,
99
],
[
98,
100
],
[
94,
101
],
[
88,
102
],
[
102,
103
],
[
102,
104
],
[
104,
105
],
[
105,
106
],
[
106,
107
],
[
105,
108
],
[
108,
109
],
[
108,
110
],
[
104,
111
],
[
88,
112
],
[
112,
113
],
[
112,
114
],
[
114,
115
],
[
115,
116
],
[
116,
117
],
[
115,
118
],
[
118,
119
],
[
118,
120
],
[
114,
121
],
[
88,
122
],
[
122,
123
],
[
122,
124
],
[
124,
125
],
[
125,
126
],
[
126,
127
],
[
125,
128
],
[
128,
129
],
[
128,
130
],
[
124,
131
],
[
14,
132
],
[
132,
133
],
[
133,
134
],
[
134,
135
],
[
134,
136
],
[
132,
137
],
[
137,
138
],
[
138,
139
],
[
12,
140
],
[
140,
141
],
[
0,
142
],
[
142,
143
],
[
142,
144
]
] | [
"import java.util.Scanner;\nimport java.util.Stack;\n\npublic class Main {\n public static Scanner sc=new Scanner(System.in);\n \n public static void main(String[] args) {\n String s;\n s=sc.nextLine();\n String a[]=s.split(\" \");\n Stack<Integer> st=new Stack<>();\n for(int i=0;i<a.length;i++) {\n boolean numeric = true;\n try {\n int num = Integer.parseInt(a[i]);\n } catch (NumberFormatException e) {\n numeric = false;\n }\n if(numeric) {\n st.push(Integer.parseInt(a[i]));\n }else {\n int val1=st.pop();\n int val2=st.pop();\n switch(a[i]) {\n case \"+\":\n st.push(val2+val1);\n break;\n case \"-\":\n st.push(val2-val1);\n break;\n case \"*\":\n st.push(val2*val1);\n break;\n case \"/\":\n st.push(val2/val1);\n break;\n }\n }\n }\n \n System.out.println(st.pop());\n \n }\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"import java.util.Stack;",
"Stack",
"java.util",
"public class Main {\n public static Scanner sc=new Scanner(System.in);\n \n public static void main(String[] args) {\n String s;\n s=sc.nextLine();\n String a[]=s.split(\" \");\n Stack<Integer> st=new Stack<>();\n for(int i=0;i<a.length;i++) {\n boolean numeric = true;\n try {\n int num = Integer.parseInt(a[i]);\n } catch (NumberFormatException e) {\n numeric = false;\n }\n if(numeric) {\n st.push(Integer.parseInt(a[i]));\n }else {\n int val1=st.pop();\n int val2=st.pop();\n switch(a[i]) {\n case \"+\":\n st.push(val2+val1);\n break;\n case \"-\":\n st.push(val2-val1);\n break;\n case \"*\":\n st.push(val2*val1);\n break;\n case \"/\":\n st.push(val2/val1);\n break;\n }\n }\n }\n \n System.out.println(st.pop());\n \n }\n}",
"Main",
"public static Scanner sc=new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"public static void main(String[] args) {\n String s;\n s=sc.nextLine();\n String a[]=s.split(\" \");\n Stack<Integer> st=new Stack<>();\n for(int i=0;i<a.length;i++) {\n boolean numeric = true;\n try {\n int num = Integer.parseInt(a[i]);\n } catch (NumberFormatException e) {\n numeric = false;\n }\n if(numeric) {\n st.push(Integer.parseInt(a[i]));\n }else {\n int val1=st.pop();\n int val2=st.pop();\n switch(a[i]) {\n case \"+\":\n st.push(val2+val1);\n break;\n case \"-\":\n st.push(val2-val1);\n break;\n case \"*\":\n st.push(val2*val1);\n break;\n case \"/\":\n st.push(val2/val1);\n break;\n }\n }\n }\n \n System.out.println(st.pop());\n \n }",
"main",
"{\n String s;\n s=sc.nextLine();\n String a[]=s.split(\" \");\n Stack<Integer> st=new Stack<>();\n for(int i=0;i<a.length;i++) {\n boolean numeric = true;\n try {\n int num = Integer.parseInt(a[i]);\n } catch (NumberFormatException e) {\n numeric = false;\n }\n if(numeric) {\n st.push(Integer.parseInt(a[i]));\n }else {\n int val1=st.pop();\n int val2=st.pop();\n switch(a[i]) {\n case \"+\":\n st.push(val2+val1);\n break;\n case \"-\":\n st.push(val2-val1);\n break;\n case \"*\":\n st.push(val2*val1);\n break;\n case \"/\":\n st.push(val2/val1);\n break;\n }\n }\n }\n \n System.out.println(st.pop());\n \n }",
"String s;",
"s",
"s=sc.nextLine()",
"s",
"sc.nextLine()",
"sc.nextLine",
"sc",
"String a[]=s.split(\" \");",
"a",
"s.split(\" \")",
"s.split",
"s",
"\" \"",
"Stack<Integer> st=new Stack<>();",
"st",
"new Stack<>()",
"for(int i=0;i<a.length;i++) {\n boolean numeric = true;\n try {\n int num = Integer.parseInt(a[i]);\n } catch (NumberFormatException e) {\n numeric = false;\n }\n if(numeric) {\n st.push(Integer.parseInt(a[i]));\n }else {\n int val1=st.pop();\n int val2=st.pop();\n switch(a[i]) {\n case \"+\":\n st.push(val2+val1);\n break;\n case \"-\":\n st.push(val2-val1);\n break;\n case \"*\":\n st.push(val2*val1);\n break;\n case \"/\":\n st.push(val2/val1);\n break;\n }\n }\n }",
"int i=0;",
"int i=0;",
"i",
"0",
"i<a.length",
"i",
"a.length",
"a",
"a.length",
"i++",
"i++",
"i",
"{\n boolean numeric = true;\n try {\n int num = Integer.parseInt(a[i]);\n } catch (NumberFormatException e) {\n numeric = false;\n }\n if(numeric) {\n st.push(Integer.parseInt(a[i]));\n }else {\n int val1=st.pop();\n int val2=st.pop();\n switch(a[i]) {\n case \"+\":\n st.push(val2+val1);\n break;\n case \"-\":\n st.push(val2-val1);\n break;\n case \"*\":\n st.push(val2*val1);\n break;\n case \"/\":\n st.push(val2/val1);\n break;\n }\n }\n }",
"{\n boolean numeric = true;\n try {\n int num = Integer.parseInt(a[i]);\n } catch (NumberFormatException e) {\n numeric = false;\n }\n if(numeric) {\n st.push(Integer.parseInt(a[i]));\n }else {\n int val1=st.pop();\n int val2=st.pop();\n switch(a[i]) {\n case \"+\":\n st.push(val2+val1);\n break;\n case \"-\":\n st.push(val2-val1);\n break;\n case \"*\":\n st.push(val2*val1);\n break;\n case \"/\":\n st.push(val2/val1);\n break;\n }\n }\n }",
"boolean numeric = true;",
"numeric",
"true",
"try {\n int num = Integer.parseInt(a[i]);\n } catch (NumberFormatException e) {\n numeric = false;\n }",
"catch (NumberFormatException e) {\n numeric = false;\n }",
"NumberFormatException e",
"{\n numeric = false;\n }",
"numeric = false",
"numeric",
"false",
"{\n int num = Integer.parseInt(a[i]);\n }",
"int num = Integer.parseInt(a[i]);",
"num",
"Integer.parseInt(a[i])",
"Integer.parseInt",
"Integer",
"a[i]",
"a",
"i",
"if(numeric) {\n st.push(Integer.parseInt(a[i]));\n }else {\n int val1=st.pop();\n int val2=st.pop();\n switch(a[i]) {\n case \"+\":\n st.push(val2+val1);\n break;\n case \"-\":\n st.push(val2-val1);\n break;\n case \"*\":\n st.push(val2*val1);\n break;\n case \"/\":\n st.push(val2/val1);\n break;\n }\n }",
"numeric",
"{\n st.push(Integer.parseInt(a[i]));\n }",
"st.push(Integer.parseInt(a[i]))",
"st.push",
"st",
"Integer.parseInt(a[i])",
"Integer.parseInt",
"Integer",
"a[i]",
"a",
"i",
"{\n int val1=st.pop();\n int val2=st.pop();\n switch(a[i]) {\n case \"+\":\n st.push(val2+val1);\n break;\n case \"-\":\n st.push(val2-val1);\n break;\n case \"*\":\n st.push(val2*val1);\n break;\n case \"/\":\n st.push(val2/val1);\n break;\n }\n }",
"int val1=st.pop();",
"val1",
"st.pop()",
"st.pop",
"st",
"int val2=st.pop();",
"val2",
"st.pop()",
"st.pop",
"st",
"switch(a[i]) {\n case \"+\":\n st.push(val2+val1);\n break;\n case \"-\":\n st.push(val2-val1);\n break;\n case \"*\":\n st.push(val2*val1);\n break;\n case \"/\":\n st.push(val2/val1);\n break;\n }",
"a[i]",
"a",
"i",
"case \"+\":",
"\"+\"",
"case \"+\":",
"st.push(val2+val1)",
"st.push",
"st",
"val2+val1",
"val2",
"val1",
"break;",
"case \"-\":",
"\"-\"",
"case \"-\":",
"st.push(val2-val1)",
"st.push",
"st",
"val2-val1",
"val2",
"val1",
"break;",
"case \"*\":",
"\"*\"",
"case \"*\":",
"st.push(val2*val1)",
"st.push",
"st",
"val2*val1",
"val2",
"val1",
"break;",
"case \"/\":",
"\"/\"",
"case \"/\":",
"st.push(val2/val1)",
"st.push",
"st",
"val2/val1",
"val2",
"val1",
"break;",
"System.out.println(st.pop())",
"System.out.println",
"System.out",
"System",
"System.out",
"st.pop()",
"st.pop",
"st",
"String[] args",
"args",
"public class Main {\n public static Scanner sc=new Scanner(System.in);\n \n public static void main(String[] args) {\n String s;\n s=sc.nextLine();\n String a[]=s.split(\" \");\n Stack<Integer> st=new Stack<>();\n for(int i=0;i<a.length;i++) {\n boolean numeric = true;\n try {\n int num = Integer.parseInt(a[i]);\n } catch (NumberFormatException e) {\n numeric = false;\n }\n if(numeric) {\n st.push(Integer.parseInt(a[i]));\n }else {\n int val1=st.pop();\n int val2=st.pop();\n switch(a[i]) {\n case \"+\":\n st.push(val2+val1);\n break;\n case \"-\":\n st.push(val2-val1);\n break;\n case \"*\":\n st.push(val2*val1);\n break;\n case \"/\":\n st.push(val2/val1);\n break;\n }\n }\n }\n \n System.out.println(st.pop());\n \n }\n}",
"public class Main {\n public static Scanner sc=new Scanner(System.in);\n \n public static void main(String[] args) {\n String s;\n s=sc.nextLine();\n String a[]=s.split(\" \");\n Stack<Integer> st=new Stack<>();\n for(int i=0;i<a.length;i++) {\n boolean numeric = true;\n try {\n int num = Integer.parseInt(a[i]);\n } catch (NumberFormatException e) {\n numeric = false;\n }\n if(numeric) {\n st.push(Integer.parseInt(a[i]));\n }else {\n int val1=st.pop();\n int val2=st.pop();\n switch(a[i]) {\n case \"+\":\n st.push(val2+val1);\n break;\n case \"-\":\n st.push(val2-val1);\n break;\n case \"*\":\n st.push(val2*val1);\n break;\n case \"/\":\n st.push(val2/val1);\n break;\n }\n }\n }\n \n System.out.println(st.pop());\n \n }\n}",
"Main"
] | import java.util.Scanner;
import java.util.Stack;
public class Main {
public static Scanner sc=new Scanner(System.in);
public static void main(String[] args) {
String s;
s=sc.nextLine();
String a[]=s.split(" ");
Stack<Integer> st=new Stack<>();
for(int i=0;i<a.length;i++) {
boolean numeric = true;
try {
int num = Integer.parseInt(a[i]);
} catch (NumberFormatException e) {
numeric = false;
}
if(numeric) {
st.push(Integer.parseInt(a[i]));
}else {
int val1=st.pop();
int val2=st.pop();
switch(a[i]) {
case "+":
st.push(val2+val1);
break;
case "-":
st.push(val2-val1);
break;
case "*":
st.push(val2*val1);
break;
case "/":
st.push(val2/val1);
break;
}
}
}
System.out.println(st.pop());
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
20,
42,
4,
18,
13,
30,
41,
13,
4,
18,
13,
41,
13,
41,
13,
14,
4,
18,
13,
17,
30,
0,
13,
4,
18,
13,
4,
18,
13,
0,
13,
4,
18,
13,
4,
18,
13,
4,
18,
13,
4,
18,
13,
2,
13,
13,
14,
4,
18,
13,
17,
30,
0,
13,
4,
18,
13,
4,
18,
13,
0,
13,
4,
18,
13,
4,
18,
13,
4,
18,
13,
4,
18,
13,
2,
13,
13,
14,
4,
18,
13,
17,
30,
0,
13,
4,
18,
13,
4,
18,
13,
0,
13,
4,
18,
13,
4,
18,
13,
4,
18,
13,
4,
18,
13,
2,
13,
13,
14,
4,
18,
13,
17,
30,
3,
30,
4,
18,
13,
13,
41,
13,
4,
18,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
4,
18,
13,
4,
18,
13,
13,
4,
18,
18,
13,
13,
4,
18,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
175,
8
],
[
175,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
12,
14
],
[
11,
15
],
[
15,
16
],
[
15,
17
],
[
11,
18
],
[
18,
19
],
[
19,
20
],
[
20,
21
],
[
18,
22
],
[
22,
23
],
[
23,
24
],
[
23,
25
],
[
25,
26
],
[
26,
27
],
[
22,
28
],
[
28,
29
],
[
22,
30
],
[
30,
31
],
[
22,
32
],
[
32,
33
],
[
33,
34
],
[
34,
35
],
[
33,
36
],
[
32,
37
],
[
37,
38
],
[
38,
39
],
[
38,
40
],
[
40,
41
],
[
41,
42
],
[
40,
43
],
[
43,
44
],
[
44,
45
],
[
37,
46
],
[
46,
47
],
[
46,
48
],
[
48,
49
],
[
49,
50
],
[
48,
51
],
[
51,
52
],
[
52,
53
],
[
37,
54
],
[
54,
55
],
[
55,
56
],
[
54,
57
],
[
57,
58
],
[
58,
59
],
[
57,
60
],
[
60,
61
],
[
60,
62
],
[
32,
63
],
[
63,
64
],
[
64,
65
],
[
65,
66
],
[
64,
67
],
[
63,
68
],
[
68,
69
],
[
69,
70
],
[
69,
71
],
[
71,
72
],
[
72,
73
],
[
71,
74
],
[
74,
75
],
[
75,
76
],
[
68,
77
],
[
77,
78
],
[
77,
79
],
[
79,
80
],
[
80,
81
],
[
79,
82
],
[
82,
83
],
[
83,
84
],
[
68,
85
],
[
85,
86
],
[
86,
87
],
[
85,
88
],
[
88,
89
],
[
89,
90
],
[
88,
91
],
[
91,
92
],
[
91,
93
],
[
63,
94
],
[
94,
95
],
[
95,
96
],
[
96,
97
],
[
95,
98
],
[
94,
99
],
[
99,
100
],
[
100,
101
],
[
100,
102
],
[
102,
103
],
[
103,
104
],
[
102,
105
],
[
105,
106
],
[
106,
107
],
[
99,
108
],
[
108,
109
],
[
108,
110
],
[
110,
111
],
[
111,
112
],
[
110,
113
],
[
113,
114
],
[
114,
115
],
[
99,
116
],
[
116,
117
],
[
117,
118
],
[
116,
119
],
[
119,
120
],
[
120,
121
],
[
119,
122
],
[
122,
123
],
[
122,
124
],
[
94,
125
],
[
125,
126
],
[
126,
127
],
[
127,
128
],
[
126,
129
],
[
125,
130
],
[
130,
131
],
[
125,
132
],
[
132,
133
],
[
133,
134
],
[
134,
135
],
[
133,
136
],
[
22,
137
],
[
137,
138
],
[
137,
139
],
[
139,
140
],
[
140,
141
],
[
22,
142
],
[
142,
143
],
[
143,
144
],
[
144,
145
],
[
144,
146
],
[
142,
147
],
[
147,
148
],
[
147,
149
],
[
142,
150
],
[
150,
151
],
[
151,
152
],
[
142,
153
],
[
154,
154
],
[
154,
155
],
[
155,
156
],
[
155,
157
],
[
157,
158
],
[
158,
159
],
[
154,
160
],
[
160,
161
],
[
161,
162
],
[
160,
163
],
[
11,
164
],
[
164,
165
],
[
165,
166
],
[
166,
167
],
[
166,
168
],
[
164,
169
],
[
169,
170
],
[
170,
171
],
[
9,
172
],
[
172,
173
],
[
0,
174
],
[
174,
175
],
[
174,
176
]
] | [
"import java.io.*;\nimport java.util.*;\n\npublic class Main\n{\n public static void main(String[] args)\n {\n Deque<String> formula = new ArrayDeque<String>();\n Scanner scan = new Scanner(System.in);\n\n while(scan.hasNext())\n {\n String input = scan.next();\n int num2,num1;\n\n if(input.equals(\"+\"))\n {\n num2 = Integer.parseInt(formula.poll());\n num1 = Integer.parseInt(formula.poll());\n formula.push(String.valueOf(num1+num2));\n }\n else if(input.equals(\"*\"))\n {\n num2 = Integer.parseInt(formula.poll());\n num1 = Integer.parseInt(formula.poll());\n formula.push(String.valueOf(num1*num2));\n }\n else if(input.equals(\"-\"))\n {\n num2 = Integer.parseInt(formula.poll());\n num1 = Integer.parseInt(formula.poll());\n formula.push(String.valueOf(num1-num2)); \n }\n else if(input.equals(\"=\"))\n {\n break;\n }\n else\n {\n formula.push(input);\n }\n int size = formula.size();\n for(int i = 0; i<size; i++)\n {\n String p = formula.pollLast();\n// System.out.printf(\"%s \",p);\n formula.push(p);\n }\n// System.out.println();\n }\n System.out.println(formula.poll());\n }\n}",
"import java.io.*;",
"io.*",
"java",
"import java.util.*;",
"util.*",
"java",
"public class Main\n{\n public static void main(String[] args)\n {\n Deque<String> formula = new ArrayDeque<String>();\n Scanner scan = new Scanner(System.in);\n\n while(scan.hasNext())\n {\n String input = scan.next();\n int num2,num1;\n\n if(input.equals(\"+\"))\n {\n num2 = Integer.parseInt(formula.poll());\n num1 = Integer.parseInt(formula.poll());\n formula.push(String.valueOf(num1+num2));\n }\n else if(input.equals(\"*\"))\n {\n num2 = Integer.parseInt(formula.poll());\n num1 = Integer.parseInt(formula.poll());\n formula.push(String.valueOf(num1*num2));\n }\n else if(input.equals(\"-\"))\n {\n num2 = Integer.parseInt(formula.poll());\n num1 = Integer.parseInt(formula.poll());\n formula.push(String.valueOf(num1-num2)); \n }\n else if(input.equals(\"=\"))\n {\n break;\n }\n else\n {\n formula.push(input);\n }\n int size = formula.size();\n for(int i = 0; i<size; i++)\n {\n String p = formula.pollLast();\n// System.out.printf(\"%s \",p);\n formula.push(p);\n }\n// System.out.println();\n }\n System.out.println(formula.poll());\n }\n}",
"Main",
"public static void main(String[] args)\n {\n Deque<String> formula = new ArrayDeque<String>();\n Scanner scan = new Scanner(System.in);\n\n while(scan.hasNext())\n {\n String input = scan.next();\n int num2,num1;\n\n if(input.equals(\"+\"))\n {\n num2 = Integer.parseInt(formula.poll());\n num1 = Integer.parseInt(formula.poll());\n formula.push(String.valueOf(num1+num2));\n }\n else if(input.equals(\"*\"))\n {\n num2 = Integer.parseInt(formula.poll());\n num1 = Integer.parseInt(formula.poll());\n formula.push(String.valueOf(num1*num2));\n }\n else if(input.equals(\"-\"))\n {\n num2 = Integer.parseInt(formula.poll());\n num1 = Integer.parseInt(formula.poll());\n formula.push(String.valueOf(num1-num2)); \n }\n else if(input.equals(\"=\"))\n {\n break;\n }\n else\n {\n formula.push(input);\n }\n int size = formula.size();\n for(int i = 0; i<size; i++)\n {\n String p = formula.pollLast();\n// System.out.printf(\"%s \",p);\n formula.push(p);\n }\n// System.out.println();\n }\n System.out.println(formula.poll());\n }",
"main",
"{\n Deque<String> formula = new ArrayDeque<String>();\n Scanner scan = new Scanner(System.in);\n\n while(scan.hasNext())\n {\n String input = scan.next();\n int num2,num1;\n\n if(input.equals(\"+\"))\n {\n num2 = Integer.parseInt(formula.poll());\n num1 = Integer.parseInt(formula.poll());\n formula.push(String.valueOf(num1+num2));\n }\n else if(input.equals(\"*\"))\n {\n num2 = Integer.parseInt(formula.poll());\n num1 = Integer.parseInt(formula.poll());\n formula.push(String.valueOf(num1*num2));\n }\n else if(input.equals(\"-\"))\n {\n num2 = Integer.parseInt(formula.poll());\n num1 = Integer.parseInt(formula.poll());\n formula.push(String.valueOf(num1-num2)); \n }\n else if(input.equals(\"=\"))\n {\n break;\n }\n else\n {\n formula.push(input);\n }\n int size = formula.size();\n for(int i = 0; i<size; i++)\n {\n String p = formula.pollLast();\n// System.out.printf(\"%s \",p);\n formula.push(p);\n }\n// System.out.println();\n }\n System.out.println(formula.poll());\n }",
"Deque<String> formula = new ArrayDeque<String>();",
"formula",
"new ArrayDeque<String>()",
"Scanner scan = new Scanner(System.in);",
"scan",
"new Scanner(System.in)",
"while(scan.hasNext())\n {\n String input = scan.next();\n int num2,num1;\n\n if(input.equals(\"+\"))\n {\n num2 = Integer.parseInt(formula.poll());\n num1 = Integer.parseInt(formula.poll());\n formula.push(String.valueOf(num1+num2));\n }\n else if(input.equals(\"*\"))\n {\n num2 = Integer.parseInt(formula.poll());\n num1 = Integer.parseInt(formula.poll());\n formula.push(String.valueOf(num1*num2));\n }\n else if(input.equals(\"-\"))\n {\n num2 = Integer.parseInt(formula.poll());\n num1 = Integer.parseInt(formula.poll());\n formula.push(String.valueOf(num1-num2)); \n }\n else if(input.equals(\"=\"))\n {\n break;\n }\n else\n {\n formula.push(input);\n }\n int size = formula.size();\n for(int i = 0; i<size; i++)\n {\n String p = formula.pollLast();\n// System.out.printf(\"%s \",p);\n formula.push(p);\n }\n// System.out.println();\n }",
"scan.hasNext()",
"scan.hasNext",
"scan",
"{\n String input = scan.next();\n int num2,num1;\n\n if(input.equals(\"+\"))\n {\n num2 = Integer.parseInt(formula.poll());\n num1 = Integer.parseInt(formula.poll());\n formula.push(String.valueOf(num1+num2));\n }\n else if(input.equals(\"*\"))\n {\n num2 = Integer.parseInt(formula.poll());\n num1 = Integer.parseInt(formula.poll());\n formula.push(String.valueOf(num1*num2));\n }\n else if(input.equals(\"-\"))\n {\n num2 = Integer.parseInt(formula.poll());\n num1 = Integer.parseInt(formula.poll());\n formula.push(String.valueOf(num1-num2)); \n }\n else if(input.equals(\"=\"))\n {\n break;\n }\n else\n {\n formula.push(input);\n }\n int size = formula.size();\n for(int i = 0; i<size; i++)\n {\n String p = formula.pollLast();\n// System.out.printf(\"%s \",p);\n formula.push(p);\n }\n// System.out.println();\n }",
"String input = scan.next();",
"input",
"scan.next()",
"scan.next",
"scan",
"int num2",
"num2",
"num1;",
"num1",
"if(input.equals(\"+\"))\n {\n num2 = Integer.parseInt(formula.poll());\n num1 = Integer.parseInt(formula.poll());\n formula.push(String.valueOf(num1+num2));\n }\n else if(input.equals(\"*\"))\n {\n num2 = Integer.parseInt(formula.poll());\n num1 = Integer.parseInt(formula.poll());\n formula.push(String.valueOf(num1*num2));\n }\n else if(input.equals(\"-\"))\n {\n num2 = Integer.parseInt(formula.poll());\n num1 = Integer.parseInt(formula.poll());\n formula.push(String.valueOf(num1-num2)); \n }\n else if(input.equals(\"=\"))\n {\n break;\n }\n else\n {\n formula.push(input);\n }",
"input.equals(\"+\")",
"input.equals",
"input",
"\"+\"",
"{\n num2 = Integer.parseInt(formula.poll());\n num1 = Integer.parseInt(formula.poll());\n formula.push(String.valueOf(num1+num2));\n }",
"num2 = Integer.parseInt(formula.poll())",
"num2",
"Integer.parseInt(formula.poll())",
"Integer.parseInt",
"Integer",
"formula.poll()",
"formula.poll",
"formula",
"num1 = Integer.parseInt(formula.poll())",
"num1",
"Integer.parseInt(formula.poll())",
"Integer.parseInt",
"Integer",
"formula.poll()",
"formula.poll",
"formula",
"formula.push(String.valueOf(num1+num2))",
"formula.push",
"formula",
"String.valueOf(num1+num2)",
"String.valueOf",
"String",
"num1+num2",
"num1",
"num2",
"if(input.equals(\"*\"))\n {\n num2 = Integer.parseInt(formula.poll());\n num1 = Integer.parseInt(formula.poll());\n formula.push(String.valueOf(num1*num2));\n }\n else if(input.equals(\"-\"))\n {\n num2 = Integer.parseInt(formula.poll());\n num1 = Integer.parseInt(formula.poll());\n formula.push(String.valueOf(num1-num2)); \n }\n else if(input.equals(\"=\"))\n {\n break;\n }\n else\n {\n formula.push(input);\n }",
"input.equals(\"*\")",
"input.equals",
"input",
"\"*\"",
"{\n num2 = Integer.parseInt(formula.poll());\n num1 = Integer.parseInt(formula.poll());\n formula.push(String.valueOf(num1*num2));\n }",
"num2 = Integer.parseInt(formula.poll())",
"num2",
"Integer.parseInt(formula.poll())",
"Integer.parseInt",
"Integer",
"formula.poll()",
"formula.poll",
"formula",
"num1 = Integer.parseInt(formula.poll())",
"num1",
"Integer.parseInt(formula.poll())",
"Integer.parseInt",
"Integer",
"formula.poll()",
"formula.poll",
"formula",
"formula.push(String.valueOf(num1*num2))",
"formula.push",
"formula",
"String.valueOf(num1*num2)",
"String.valueOf",
"String",
"num1*num2",
"num1",
"num2",
"if(input.equals(\"-\"))\n {\n num2 = Integer.parseInt(formula.poll());\n num1 = Integer.parseInt(formula.poll());\n formula.push(String.valueOf(num1-num2)); \n }\n else if(input.equals(\"=\"))\n {\n break;\n }\n else\n {\n formula.push(input);\n }",
"input.equals(\"-\")",
"input.equals",
"input",
"\"-\"",
"{\n num2 = Integer.parseInt(formula.poll());\n num1 = Integer.parseInt(formula.poll());\n formula.push(String.valueOf(num1-num2)); \n }",
"num2 = Integer.parseInt(formula.poll())",
"num2",
"Integer.parseInt(formula.poll())",
"Integer.parseInt",
"Integer",
"formula.poll()",
"formula.poll",
"formula",
"num1 = Integer.parseInt(formula.poll())",
"num1",
"Integer.parseInt(formula.poll())",
"Integer.parseInt",
"Integer",
"formula.poll()",
"formula.poll",
"formula",
"formula.push(String.valueOf(num1-num2))",
"formula.push",
"formula",
"String.valueOf(num1-num2)",
"String.valueOf",
"String",
"num1-num2",
"num1",
"num2",
"if(input.equals(\"=\"))\n {\n break;\n }\n else\n {\n formula.push(input);\n }",
"input.equals(\"=\")",
"input.equals",
"input",
"\"=\"",
"{\n break;\n }",
"break;",
"{\n formula.push(input);\n }",
"formula.push(input)",
"formula.push",
"formula",
"input",
"int size = formula.size();",
"size",
"formula.size()",
"formula.size",
"formula",
"for(int i = 0; i<size; i++)\n {\n String p = formula.pollLast();\n// System.out.printf(\"%s \",p);\n formula.push(p);\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i<size",
"i",
"size",
"i++",
"i++",
"i",
"{\n String p = formula.pollLast();\n// System.out.printf(\"%s \",p);\n formula.push(p);\n }",
"{\n String p = formula.pollLast();\n// System.out.printf(\"%s \",p);\n formula.push(p);\n }",
"String p = formula.pollLast();",
"p",
"formula.pollLast()",
"formula.pollLast",
"formula",
"formula.push(p)",
"formula.push",
"formula",
"p",
"System.out.println(formula.poll())",
"System.out.println",
"System.out",
"System",
"System.out",
"formula.poll()",
"formula.poll",
"formula",
"String[] args",
"args",
"public class Main\n{\n public static void main(String[] args)\n {\n Deque<String> formula = new ArrayDeque<String>();\n Scanner scan = new Scanner(System.in);\n\n while(scan.hasNext())\n {\n String input = scan.next();\n int num2,num1;\n\n if(input.equals(\"+\"))\n {\n num2 = Integer.parseInt(formula.poll());\n num1 = Integer.parseInt(formula.poll());\n formula.push(String.valueOf(num1+num2));\n }\n else if(input.equals(\"*\"))\n {\n num2 = Integer.parseInt(formula.poll());\n num1 = Integer.parseInt(formula.poll());\n formula.push(String.valueOf(num1*num2));\n }\n else if(input.equals(\"-\"))\n {\n num2 = Integer.parseInt(formula.poll());\n num1 = Integer.parseInt(formula.poll());\n formula.push(String.valueOf(num1-num2)); \n }\n else if(input.equals(\"=\"))\n {\n break;\n }\n else\n {\n formula.push(input);\n }\n int size = formula.size();\n for(int i = 0; i<size; i++)\n {\n String p = formula.pollLast();\n// System.out.printf(\"%s \",p);\n formula.push(p);\n }\n// System.out.println();\n }\n System.out.println(formula.poll());\n }\n}",
"public class Main\n{\n public static void main(String[] args)\n {\n Deque<String> formula = new ArrayDeque<String>();\n Scanner scan = new Scanner(System.in);\n\n while(scan.hasNext())\n {\n String input = scan.next();\n int num2,num1;\n\n if(input.equals(\"+\"))\n {\n num2 = Integer.parseInt(formula.poll());\n num1 = Integer.parseInt(formula.poll());\n formula.push(String.valueOf(num1+num2));\n }\n else if(input.equals(\"*\"))\n {\n num2 = Integer.parseInt(formula.poll());\n num1 = Integer.parseInt(formula.poll());\n formula.push(String.valueOf(num1*num2));\n }\n else if(input.equals(\"-\"))\n {\n num2 = Integer.parseInt(formula.poll());\n num1 = Integer.parseInt(formula.poll());\n formula.push(String.valueOf(num1-num2)); \n }\n else if(input.equals(\"=\"))\n {\n break;\n }\n else\n {\n formula.push(input);\n }\n int size = formula.size();\n for(int i = 0; i<size; i++)\n {\n String p = formula.pollLast();\n// System.out.printf(\"%s \",p);\n formula.push(p);\n }\n// System.out.println();\n }\n System.out.println(formula.poll());\n }\n}",
"Main"
] | import java.io.*;
import java.util.*;
public class Main
{
public static void main(String[] args)
{
Deque<String> formula = new ArrayDeque<String>();
Scanner scan = new Scanner(System.in);
while(scan.hasNext())
{
String input = scan.next();
int num2,num1;
if(input.equals("+"))
{
num2 = Integer.parseInt(formula.poll());
num1 = Integer.parseInt(formula.poll());
formula.push(String.valueOf(num1+num2));
}
else if(input.equals("*"))
{
num2 = Integer.parseInt(formula.poll());
num1 = Integer.parseInt(formula.poll());
formula.push(String.valueOf(num1*num2));
}
else if(input.equals("-"))
{
num2 = Integer.parseInt(formula.poll());
num1 = Integer.parseInt(formula.poll());
formula.push(String.valueOf(num1-num2));
}
else if(input.equals("="))
{
break;
}
else
{
formula.push(input);
}
int size = formula.size();
for(int i = 0; i<size; i++)
{
String p = formula.pollLast();
// System.out.printf("%s ",p);
formula.push(p);
}
// System.out.println();
}
System.out.println(formula.poll());
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
4,
18,
13,
17,
41,
13,
20,
18,
13,
13,
41,
13,
17,
41,
13,
41,
13,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
30,
38,
5,
13,
30,
0,
13,
18,
13,
40,
13,
0,
13,
18,
13,
40,
13,
35,
18,
13,
13,
34,
17,
1,
0,
18,
13,
40,
13,
2,
13,
13,
3,
34,
17,
1,
0,
18,
13,
40,
13,
2,
13,
13,
3,
34,
17,
1,
0,
18,
13,
40,
13,
2,
13,
13,
3,
30,
41,
13,
4,
18,
13,
18,
13,
13,
0,
18,
13,
40,
13,
13,
4,
18,
18,
13,
13,
18,
13,
40,
13,
23,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
16,
17
],
[
17,
18
],
[
14,
19
],
[
8,
20
],
[
20,
21
],
[
20,
22
],
[
23,
24
],
[
23,
25
],
[
8,
26
],
[
26,
27
],
[
26,
28
],
[
8,
29
],
[
29,
30
],
[
8,
31
],
[
31,
32
],
[
8,
33
],
[
33,
34
],
[
34,
35
],
[
35,
36
],
[
35,
37
],
[
33,
38
],
[
38,
39
],
[
38,
40
],
[
40,
41
],
[
40,
42
],
[
33,
43
],
[
43,
44
],
[
44,
45
],
[
33,
46
],
[
47,
47
],
[
47,
48
],
[
48,
49
],
[
49,
50
],
[
49,
51
],
[
51,
52
],
[
52,
53
],
[
52,
54
],
[
54,
55
],
[
54,
56
],
[
56,
57
],
[
51,
58
],
[
58,
59
],
[
58,
60
],
[
60,
61
],
[
60,
62
],
[
62,
63
],
[
51,
64
],
[
64,
65
],
[
65,
66
],
[
65,
67
],
[
64,
68
],
[
68,
69
],
[
68,
70
],
[
70,
71
],
[
71,
72
],
[
72,
73
],
[
72,
74
],
[
74,
75
],
[
71,
76
],
[
76,
77
],
[
76,
78
],
[
70,
79
],
[
64,
80
],
[
80,
81
],
[
80,
82
],
[
82,
83
],
[
83,
84
],
[
84,
85
],
[
84,
86
],
[
86,
87
],
[
83,
88
],
[
88,
89
],
[
88,
90
],
[
82,
91
],
[
64,
92
],
[
92,
93
],
[
92,
94
],
[
94,
95
],
[
95,
96
],
[
96,
97
],
[
96,
98
],
[
98,
99
],
[
95,
100
],
[
100,
101
],
[
100,
102
],
[
94,
103
],
[
48,
104
],
[
104,
105
],
[
105,
106
],
[
105,
107
],
[
107,
108
],
[
108,
109
],
[
107,
110
],
[
110,
111
],
[
110,
112
],
[
104,
113
],
[
113,
114
],
[
114,
115
],
[
114,
116
],
[
116,
117
],
[
113,
118
],
[
8,
119
],
[
119,
120
],
[
120,
121
],
[
121,
122
],
[
121,
123
],
[
119,
124
],
[
124,
125
],
[
124,
126
],
[
126,
127
],
[
6,
128
],
[
128,
129
]
] | [
"\nimport java.util.*;\n\nclass Main{\n\tpublic static void main(String[] args){\n\t\tScanner sc= new Scanner(System.in);\n\t\t\n\t\tString S[] = sc.nextLine().split(\" \");\n\t\tint stack[] = new int[S.length];\n\t\tint idx = 0, a, b; \n\n\t\tfor(int i=0; i<S.length; i++){\t\t\t\n\t\t\ttry{\n\t\t\t\tint x = Integer.parseInt(S[i]);\n\t\t\t\tstack[idx++] = x;\n\n\t\t\t}catch(java.lang.NumberFormatException ex){\n\t\t\t\tb = stack[--idx];\n\t\t\t\ta = stack[--idx];\n\n\t\t\t\tswitch (S[i]) {\n\t\t\t\t\tcase \"+\":\tstack[idx++] = a + b; break;\n\t\t\t\t\tcase \"-\":\tstack[idx++] = a - b; break;\n\t\t\t\t\tcase \"*\":\tstack[idx++] = a * b; break;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(stack[--idx]);\n\t}\t\n}",
"import java.util.*;",
"util.*",
"java",
"class Main{\n\tpublic static void main(String[] args){\n\t\tScanner sc= new Scanner(System.in);\n\t\t\n\t\tString S[] = sc.nextLine().split(\" \");\n\t\tint stack[] = new int[S.length];\n\t\tint idx = 0, a, b; \n\n\t\tfor(int i=0; i<S.length; i++){\t\t\t\n\t\t\ttry{\n\t\t\t\tint x = Integer.parseInt(S[i]);\n\t\t\t\tstack[idx++] = x;\n\n\t\t\t}catch(java.lang.NumberFormatException ex){\n\t\t\t\tb = stack[--idx];\n\t\t\t\ta = stack[--idx];\n\n\t\t\t\tswitch (S[i]) {\n\t\t\t\t\tcase \"+\":\tstack[idx++] = a + b; break;\n\t\t\t\t\tcase \"-\":\tstack[idx++] = a - b; break;\n\t\t\t\t\tcase \"*\":\tstack[idx++] = a * b; break;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(stack[--idx]);\n\t}\t\n}",
"Main",
"public static void main(String[] args){\n\t\tScanner sc= new Scanner(System.in);\n\t\t\n\t\tString S[] = sc.nextLine().split(\" \");\n\t\tint stack[] = new int[S.length];\n\t\tint idx = 0, a, b; \n\n\t\tfor(int i=0; i<S.length; i++){\t\t\t\n\t\t\ttry{\n\t\t\t\tint x = Integer.parseInt(S[i]);\n\t\t\t\tstack[idx++] = x;\n\n\t\t\t}catch(java.lang.NumberFormatException ex){\n\t\t\t\tb = stack[--idx];\n\t\t\t\ta = stack[--idx];\n\n\t\t\t\tswitch (S[i]) {\n\t\t\t\t\tcase \"+\":\tstack[idx++] = a + b; break;\n\t\t\t\t\tcase \"-\":\tstack[idx++] = a - b; break;\n\t\t\t\t\tcase \"*\":\tstack[idx++] = a * b; break;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(stack[--idx]);\n\t}",
"main",
"{\n\t\tScanner sc= new Scanner(System.in);\n\t\t\n\t\tString S[] = sc.nextLine().split(\" \");\n\t\tint stack[] = new int[S.length];\n\t\tint idx = 0, a, b; \n\n\t\tfor(int i=0; i<S.length; i++){\t\t\t\n\t\t\ttry{\n\t\t\t\tint x = Integer.parseInt(S[i]);\n\t\t\t\tstack[idx++] = x;\n\n\t\t\t}catch(java.lang.NumberFormatException ex){\n\t\t\t\tb = stack[--idx];\n\t\t\t\ta = stack[--idx];\n\n\t\t\t\tswitch (S[i]) {\n\t\t\t\t\tcase \"+\":\tstack[idx++] = a + b; break;\n\t\t\t\t\tcase \"-\":\tstack[idx++] = a - b; break;\n\t\t\t\t\tcase \"*\":\tstack[idx++] = a * b; break;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(stack[--idx]);\n\t}",
"Scanner sc= new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"String S[] = sc.nextLine().split(\" \");",
"S",
"sc.nextLine().split(\" \")",
"sc.nextLine().split",
"sc.nextLine()",
"sc.nextLine",
"sc",
"\" \"",
"int stack[] = new int[S.length];",
"stack",
"new int[S.length]",
"S.length",
"S",
"S.length",
"int idx = 0",
"idx",
"0",
"a",
"a",
"b;",
"b",
"for(int i=0; i<S.length; i++){\t\t\t\n\t\t\ttry{\n\t\t\t\tint x = Integer.parseInt(S[i]);\n\t\t\t\tstack[idx++] = x;\n\n\t\t\t}catch(java.lang.NumberFormatException ex){\n\t\t\t\tb = stack[--idx];\n\t\t\t\ta = stack[--idx];\n\n\t\t\t\tswitch (S[i]) {\n\t\t\t\t\tcase \"+\":\tstack[idx++] = a + b; break;\n\t\t\t\t\tcase \"-\":\tstack[idx++] = a - b; break;\n\t\t\t\t\tcase \"*\":\tstack[idx++] = a * b; break;\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<S.length",
"i",
"S.length",
"S",
"S.length",
"i++",
"i++",
"i",
"{\t\t\t\n\t\t\ttry{\n\t\t\t\tint x = Integer.parseInt(S[i]);\n\t\t\t\tstack[idx++] = x;\n\n\t\t\t}catch(java.lang.NumberFormatException ex){\n\t\t\t\tb = stack[--idx];\n\t\t\t\ta = stack[--idx];\n\n\t\t\t\tswitch (S[i]) {\n\t\t\t\t\tcase \"+\":\tstack[idx++] = a + b; break;\n\t\t\t\t\tcase \"-\":\tstack[idx++] = a - b; break;\n\t\t\t\t\tcase \"*\":\tstack[idx++] = a * b; break;\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"{\t\t\t\n\t\t\ttry{\n\t\t\t\tint x = Integer.parseInt(S[i]);\n\t\t\t\tstack[idx++] = x;\n\n\t\t\t}catch(java.lang.NumberFormatException ex){\n\t\t\t\tb = stack[--idx];\n\t\t\t\ta = stack[--idx];\n\n\t\t\t\tswitch (S[i]) {\n\t\t\t\t\tcase \"+\":\tstack[idx++] = a + b; break;\n\t\t\t\t\tcase \"-\":\tstack[idx++] = a - b; break;\n\t\t\t\t\tcase \"*\":\tstack[idx++] = a * b; break;\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"try{\n\t\t\t\tint x = Integer.parseInt(S[i]);\n\t\t\t\tstack[idx++] = x;\n\n\t\t\t}catch(java.lang.NumberFormatException ex){\n\t\t\t\tb = stack[--idx];\n\t\t\t\ta = stack[--idx];\n\n\t\t\t\tswitch (S[i]) {\n\t\t\t\t\tcase \"+\":\tstack[idx++] = a + b; break;\n\t\t\t\t\tcase \"-\":\tstack[idx++] = a - b; break;\n\t\t\t\t\tcase \"*\":\tstack[idx++] = a * b; break;\n\t\t\t\t}\n\t\t\t}",
"catch(java.lang.NumberFormatException ex){\n\t\t\t\tb = stack[--idx];\n\t\t\t\ta = stack[--idx];\n\n\t\t\t\tswitch (S[i]) {\n\t\t\t\t\tcase \"+\":\tstack[idx++] = a + b; break;\n\t\t\t\t\tcase \"-\":\tstack[idx++] = a - b; break;\n\t\t\t\t\tcase \"*\":\tstack[idx++] = a * b; break;\n\t\t\t\t}\n\t\t\t}",
"java.lang.NumberFormatException ex",
"{\n\t\t\t\tb = stack[--idx];\n\t\t\t\ta = stack[--idx];\n\n\t\t\t\tswitch (S[i]) {\n\t\t\t\t\tcase \"+\":\tstack[idx++] = a + b; break;\n\t\t\t\t\tcase \"-\":\tstack[idx++] = a - b; break;\n\t\t\t\t\tcase \"*\":\tstack[idx++] = a * b; break;\n\t\t\t\t}\n\t\t\t}",
"b = stack[--idx]",
"b",
"stack[--idx]",
"stack",
"--idx",
"idx",
"a = stack[--idx]",
"a",
"stack[--idx]",
"stack",
"--idx",
"idx",
"switch (S[i]) {\n\t\t\t\t\tcase \"+\":\tstack[idx++] = a + b; break;\n\t\t\t\t\tcase \"-\":\tstack[idx++] = a - b; break;\n\t\t\t\t\tcase \"*\":\tstack[idx++] = a * b; break;\n\t\t\t\t}",
"S[i]",
"S",
"i",
"case \"+\":",
"\"+\"",
"case \"+\":",
"stack[idx++] = a + b",
"stack[idx++]",
"stack",
"idx++",
"idx",
"a + b",
"a",
"b",
"break;",
"case \"-\":",
"\"-\"",
"case \"-\":",
"stack[idx++] = a - b",
"stack[idx++]",
"stack",
"idx++",
"idx",
"a - b",
"a",
"b",
"break;",
"case \"*\":",
"\"*\"",
"case \"*\":",
"stack[idx++] = a * b",
"stack[idx++]",
"stack",
"idx++",
"idx",
"a * b",
"a",
"b",
"break;",
"{\n\t\t\t\tint x = Integer.parseInt(S[i]);\n\t\t\t\tstack[idx++] = x;\n\n\t\t\t}",
"int x = Integer.parseInt(S[i]);",
"x",
"Integer.parseInt(S[i])",
"Integer.parseInt",
"Integer",
"S[i]",
"S",
"i",
"stack[idx++] = x",
"stack[idx++]",
"stack",
"idx++",
"idx",
"x",
"System.out.println(stack[--idx])",
"System.out.println",
"System.out",
"System",
"System.out",
"stack[--idx]",
"stack",
"--idx",
"idx",
"String[] args",
"args"
] |
import java.util.*;
class Main{
public static void main(String[] args){
Scanner sc= new Scanner(System.in);
String S[] = sc.nextLine().split(" ");
int stack[] = new int[S.length];
int idx = 0, a, b;
for(int i=0; i<S.length; i++){
try{
int x = Integer.parseInt(S[i]);
stack[idx++] = x;
}catch(java.lang.NumberFormatException ex){
b = stack[--idx];
a = stack[--idx];
switch (S[i]) {
case "+": stack[idx++] = a + b; break;
case "-": stack[idx++] = a - b; break;
case "*": stack[idx++] = a * b; break;
}
}
}
System.out.println(stack[--idx]);
}
} |
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
41,
13,
20,
17,
41,
13,
40,
17,
12,
13,
30,
41,
13,
20,
42,
4,
18,
13,
30,
41,
13,
4,
18,
13,
4,
13,
13,
4,
18,
18,
13,
13,
18,
13,
17,
4,
18,
13,
4,
18,
13,
17,
23,
13,
12,
13,
30,
35,
13,
34,
17,
1,
0,
18,
13,
2,
13,
17,
18,
13,
13,
40,
13,
3,
34,
17,
1,
0,
18,
13,
2,
13,
17,
18,
13,
13,
40,
13,
3,
34,
17,
1,
0,
18,
13,
2,
13,
17,
18,
13,
13,
40,
13,
3,
34,
1,
40,
13,
0,
18,
13,
13,
4,
18,
13,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
10,
11
],
[
10,
12
],
[
0,
13
],
[
13,
14
],
[
13,
15
],
[
0,
16
],
[
16,
17
],
[
16,
18
],
[
0,
19
],
[
19,
20
],
[
19,
21
],
[
0,
22
],
[
22,
23
],
[
22,
24
],
[
0,
25
],
[
25,
26
],
[
25,
27
],
[
0,
28
],
[
28,
29
],
[
28,
30
],
[
0,
31
],
[
142,
32
],
[
142,
33
],
[
33,
34
],
[
33,
35
],
[
142,
37
],
[
37,
38
],
[
37,
39
],
[
39,
40
],
[
142,
41
],
[
41,
42
],
[
41,
43
],
[
43,
44
],
[
44,
45
],
[
44,
46
],
[
43,
47
],
[
47,
48
],
[
48,
49
],
[
49,
50
],
[
47,
51
],
[
51,
52
],
[
52,
53
],
[
52,
54
],
[
54,
55
],
[
55,
56
],
[
51,
57
],
[
57,
58
],
[
57,
59
],
[
43,
60
],
[
60,
61
],
[
61,
62
],
[
62,
63
],
[
62,
64
],
[
60,
65
],
[
65,
66
],
[
65,
67
],
[
43,
68
],
[
68,
69
],
[
69,
70
],
[
43,
71
],
[
71,
72
],
[
72,
73
],
[
71,
74
],
[
41,
75
],
[
75,
76
],
[
142,
77
],
[
77,
78
],
[
77,
79
],
[
79,
80
],
[
80,
81
],
[
80,
82
],
[
82,
83
],
[
82,
84
],
[
84,
85
],
[
85,
86
],
[
86,
87
],
[
86,
88
],
[
88,
89
],
[
88,
90
],
[
85,
91
],
[
91,
92
],
[
91,
93
],
[
84,
94
],
[
94,
95
],
[
84,
96
],
[
80,
97
],
[
97,
98
],
[
97,
99
],
[
99,
100
],
[
100,
101
],
[
101,
102
],
[
101,
103
],
[
103,
104
],
[
103,
105
],
[
100,
106
],
[
106,
107
],
[
106,
108
],
[
99,
109
],
[
109,
110
],
[
99,
111
],
[
80,
112
],
[
112,
113
],
[
112,
114
],
[
114,
115
],
[
115,
116
],
[
116,
117
],
[
116,
118
],
[
118,
119
],
[
118,
120
],
[
115,
121
],
[
121,
122
],
[
121,
123
],
[
114,
124
],
[
124,
125
],
[
114,
126
],
[
80,
127
],
[
127,
128
],
[
128,
129
],
[
129,
130
],
[
128,
131
],
[
131,
132
],
[
132,
133
],
[
132,
134
],
[
131,
135
],
[
135,
136
],
[
136,
137
],
[
135,
138
],
[
77,
139
],
[
139,
140
],
[
0,
141
],
[
141,
142
],
[
141,
143
]
] | [
"import java.io.File;\nimport java.io.FileNotFoundException;\nimport java.lang.management.ManagementFactory;\nimport java.lang.management.ThreadMXBean;\nimport java.util.ArrayList;\nimport java.util.Collections;\nimport java.util.Comparator;\nimport java.util.List;\nimport java.util.PriorityQueue;\nimport java.util.Scanner;\n\npublic class Main {\n\n\tpublic static void main(String[] args) throws FileNotFoundException {\n\n\t\tScanner scan = new Scanner(System.in);\n\t\t// Scanner scan = new Scanner(new\n\t\t// File(\"D:\\\\UserArea\\\\J0124567\\\\Downloads\\\\2010-input.txt\"));\n\n\t\twhile (scan.hasNext()) {\n\n\t\t\tString s = scan.next();\n\t\t\tDo(s);\n\t\t}\n\t\tSystem.out.println(stk[0]);\n\n\t\tscan.close();\n\t\tSystem.exit(0);\n\t}\n\n\tstatic int[] stk = new int[101];\n\tstatic int pt = -1;\n\n\tprivate static void Do(String s) {\n\t\tswitch (s) {\n\t\tcase (\"+\"):\n\t\t\tstk[pt - 1] += stk[pt];\n\t\t\tpt--;\n\t\t\tbreak;\n\t\tcase (\"-\"):\n\t\t\tstk[pt - 1] -= stk[pt];\n\t\t\tpt--;\n\t\t\tbreak;\n\t\tcase (\"*\"):\n\t\t\tstk[pt - 1] *= stk[pt];\n\t\t\tpt--;\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tpt++;\n\t\t\tstk[pt] = Integer.valueOf(s);\n\t\t}\n\n\t}\n\n}",
"import java.io.File;",
"File",
"java.io",
"import java.io.FileNotFoundException;",
"FileNotFoundException",
"java.io",
"import java.lang.management.ManagementFactory;",
"ManagementFactory",
"java.lang.management",
"import java.lang.management.ThreadMXBean;",
"ThreadMXBean",
"java.lang.management",
"import java.util.ArrayList;",
"ArrayList",
"java.util",
"import java.util.Collections;",
"Collections",
"java.util",
"import java.util.Comparator;",
"Comparator",
"java.util",
"import java.util.List;",
"List",
"java.util",
"import java.util.PriorityQueue;",
"PriorityQueue",
"java.util",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\n\tpublic static void main(String[] args) throws FileNotFoundException {\n\n\t\tScanner scan = new Scanner(System.in);\n\t\t// Scanner scan = new Scanner(new\n\t\t// File(\"D:\\\\UserArea\\\\J0124567\\\\Downloads\\\\2010-input.txt\"));\n\n\t\twhile (scan.hasNext()) {\n\n\t\t\tString s = scan.next();\n\t\t\tDo(s);\n\t\t}\n\t\tSystem.out.println(stk[0]);\n\n\t\tscan.close();\n\t\tSystem.exit(0);\n\t}\n\n\tstatic int[] stk = new int[101];\n\tstatic int pt = -1;\n\n\tprivate static void Do(String s) {\n\t\tswitch (s) {\n\t\tcase (\"+\"):\n\t\t\tstk[pt - 1] += stk[pt];\n\t\t\tpt--;\n\t\t\tbreak;\n\t\tcase (\"-\"):\n\t\t\tstk[pt - 1] -= stk[pt];\n\t\t\tpt--;\n\t\t\tbreak;\n\t\tcase (\"*\"):\n\t\t\tstk[pt - 1] *= stk[pt];\n\t\t\tpt--;\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tpt++;\n\t\t\tstk[pt] = Integer.valueOf(s);\n\t\t}\n\n\t}\n\n}",
"Main",
"static int[] stk = new int[101];",
"stk",
"new int[101]",
"101",
"static int pt = -1;",
"pt",
"-1",
"1",
"public static void main(String[] args) throws FileNotFoundException {\n\n\t\tScanner scan = new Scanner(System.in);\n\t\t// Scanner scan = new Scanner(new\n\t\t// File(\"D:\\\\UserArea\\\\J0124567\\\\Downloads\\\\2010-input.txt\"));\n\n\t\twhile (scan.hasNext()) {\n\n\t\t\tString s = scan.next();\n\t\t\tDo(s);\n\t\t}\n\t\tSystem.out.println(stk[0]);\n\n\t\tscan.close();\n\t\tSystem.exit(0);\n\t}",
"main",
"{\n\n\t\tScanner scan = new Scanner(System.in);\n\t\t// Scanner scan = new Scanner(new\n\t\t// File(\"D:\\\\UserArea\\\\J0124567\\\\Downloads\\\\2010-input.txt\"));\n\n\t\twhile (scan.hasNext()) {\n\n\t\t\tString s = scan.next();\n\t\t\tDo(s);\n\t\t}\n\t\tSystem.out.println(stk[0]);\n\n\t\tscan.close();\n\t\tSystem.exit(0);\n\t}",
"Scanner scan = new Scanner(System.in);",
"scan",
"new Scanner(System.in)",
"while (scan.hasNext()) {\n\n\t\t\tString s = scan.next();\n\t\t\tDo(s);\n\t\t}",
"scan.hasNext()",
"scan.hasNext",
"scan",
"{\n\n\t\t\tString s = scan.next();\n\t\t\tDo(s);\n\t\t}",
"String s = scan.next();",
"s",
"scan.next()",
"scan.next",
"scan",
"Do(s)",
"Do",
"s",
"System.out.println(stk[0])",
"System.out.println",
"System.out",
"System",
"System.out",
"stk[0]",
"stk",
"0",
"scan.close()",
"scan.close",
"scan",
"System.exit(0)",
"System.exit",
"System",
"0",
"String[] args",
"args",
"private static void Do(String s) {\n\t\tswitch (s) {\n\t\tcase (\"+\"):\n\t\t\tstk[pt - 1] += stk[pt];\n\t\t\tpt--;\n\t\t\tbreak;\n\t\tcase (\"-\"):\n\t\t\tstk[pt - 1] -= stk[pt];\n\t\t\tpt--;\n\t\t\tbreak;\n\t\tcase (\"*\"):\n\t\t\tstk[pt - 1] *= stk[pt];\n\t\t\tpt--;\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tpt++;\n\t\t\tstk[pt] = Integer.valueOf(s);\n\t\t}\n\n\t}",
"Do",
"{\n\t\tswitch (s) {\n\t\tcase (\"+\"):\n\t\t\tstk[pt - 1] += stk[pt];\n\t\t\tpt--;\n\t\t\tbreak;\n\t\tcase (\"-\"):\n\t\t\tstk[pt - 1] -= stk[pt];\n\t\t\tpt--;\n\t\t\tbreak;\n\t\tcase (\"*\"):\n\t\t\tstk[pt - 1] *= stk[pt];\n\t\t\tpt--;\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tpt++;\n\t\t\tstk[pt] = Integer.valueOf(s);\n\t\t}\n\n\t}",
"switch (s) {\n\t\tcase (\"+\"):\n\t\t\tstk[pt - 1] += stk[pt];\n\t\t\tpt--;\n\t\t\tbreak;\n\t\tcase (\"-\"):\n\t\t\tstk[pt - 1] -= stk[pt];\n\t\t\tpt--;\n\t\t\tbreak;\n\t\tcase (\"*\"):\n\t\t\tstk[pt - 1] *= stk[pt];\n\t\t\tpt--;\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tpt++;\n\t\t\tstk[pt] = Integer.valueOf(s);\n\t\t}",
"s",
"case (\"+\"):",
"(\"+\")",
"case (\"+\"):",
"stk[pt - 1] += stk[pt]",
"stk[pt - 1]",
"stk",
"pt - 1",
"pt",
"1",
"stk[pt]",
"stk",
"pt",
"pt--",
"pt",
"break;",
"case (\"-\"):",
"(\"-\")",
"case (\"-\"):",
"stk[pt - 1] -= stk[pt]",
"stk[pt - 1]",
"stk",
"pt - 1",
"pt",
"1",
"stk[pt]",
"stk",
"pt",
"pt--",
"pt",
"break;",
"case (\"*\"):",
"(\"*\")",
"case (\"*\"):",
"stk[pt - 1] *= stk[pt]",
"stk[pt - 1]",
"stk",
"pt - 1",
"pt",
"1",
"stk[pt]",
"stk",
"pt",
"pt--",
"pt",
"break;",
"default:",
"default:",
"pt++",
"pt",
"stk[pt] = Integer.valueOf(s)",
"stk[pt]",
"stk",
"pt",
"Integer.valueOf(s)",
"Integer.valueOf",
"Integer",
"s",
"String s",
"s",
"public class Main {\n\n\tpublic static void main(String[] args) throws FileNotFoundException {\n\n\t\tScanner scan = new Scanner(System.in);\n\t\t// Scanner scan = new Scanner(new\n\t\t// File(\"D:\\\\UserArea\\\\J0124567\\\\Downloads\\\\2010-input.txt\"));\n\n\t\twhile (scan.hasNext()) {\n\n\t\t\tString s = scan.next();\n\t\t\tDo(s);\n\t\t}\n\t\tSystem.out.println(stk[0]);\n\n\t\tscan.close();\n\t\tSystem.exit(0);\n\t}\n\n\tstatic int[] stk = new int[101];\n\tstatic int pt = -1;\n\n\tprivate static void Do(String s) {\n\t\tswitch (s) {\n\t\tcase (\"+\"):\n\t\t\tstk[pt - 1] += stk[pt];\n\t\t\tpt--;\n\t\t\tbreak;\n\t\tcase (\"-\"):\n\t\t\tstk[pt - 1] -= stk[pt];\n\t\t\tpt--;\n\t\t\tbreak;\n\t\tcase (\"*\"):\n\t\t\tstk[pt - 1] *= stk[pt];\n\t\t\tpt--;\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tpt++;\n\t\t\tstk[pt] = Integer.valueOf(s);\n\t\t}\n\n\t}\n\n}",
"public class Main {\n\n\tpublic static void main(String[] args) throws FileNotFoundException {\n\n\t\tScanner scan = new Scanner(System.in);\n\t\t// Scanner scan = new Scanner(new\n\t\t// File(\"D:\\\\UserArea\\\\J0124567\\\\Downloads\\\\2010-input.txt\"));\n\n\t\twhile (scan.hasNext()) {\n\n\t\t\tString s = scan.next();\n\t\t\tDo(s);\n\t\t}\n\t\tSystem.out.println(stk[0]);\n\n\t\tscan.close();\n\t\tSystem.exit(0);\n\t}\n\n\tstatic int[] stk = new int[101];\n\tstatic int pt = -1;\n\n\tprivate static void Do(String s) {\n\t\tswitch (s) {\n\t\tcase (\"+\"):\n\t\t\tstk[pt - 1] += stk[pt];\n\t\t\tpt--;\n\t\t\tbreak;\n\t\tcase (\"-\"):\n\t\t\tstk[pt - 1] -= stk[pt];\n\t\t\tpt--;\n\t\t\tbreak;\n\t\tcase (\"*\"):\n\t\t\tstk[pt - 1] *= stk[pt];\n\t\t\tpt--;\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tpt++;\n\t\t\tstk[pt] = Integer.valueOf(s);\n\t\t}\n\n\t}\n\n}",
"Main"
] | import java.io.File;
import java.io.FileNotFoundException;
import java.lang.management.ManagementFactory;
import java.lang.management.ThreadMXBean;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import java.util.PriorityQueue;
import java.util.Scanner;
public class Main {
public static void main(String[] args) throws FileNotFoundException {
Scanner scan = new Scanner(System.in);
// Scanner scan = new Scanner(new
// File("D:\\UserArea\\J0124567\\Downloads\\2010-input.txt"));
while (scan.hasNext()) {
String s = scan.next();
Do(s);
}
System.out.println(stk[0]);
scan.close();
System.exit(0);
}
static int[] stk = new int[101];
static int pt = -1;
private static void Do(String s) {
switch (s) {
case ("+"):
stk[pt - 1] += stk[pt];
pt--;
break;
case ("-"):
stk[pt - 1] -= stk[pt];
pt--;
break;
case ("*"):
stk[pt - 1] *= stk[pt];
pt--;
break;
default:
pt++;
stk[pt] = Integer.valueOf(s);
}
}
} |
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
17,
28,
13,
4,
18,
13,
17,
30,
30,
14,
2,
4,
18,
13,
13,
40,
17,
30,
4,
18,
13,
4,
18,
13,
13,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
35,
13,
34,
17,
1,
4,
18,
13,
2,
13,
13,
3,
34,
17,
1,
4,
18,
13,
2,
13,
13,
3,
34,
17,
1,
4,
18,
13,
2,
13,
13,
3,
34,
17,
1,
4,
18,
13,
2,
13,
13,
3,
29,
4,
18,
13,
23,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
4,
18,
18,
13,
13,
4,
13,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
126,
11
],
[
126,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
15,
17
],
[
14,
18
],
[
18,
19
],
[
18,
20
],
[
14,
21
],
[
21,
22
],
[
21,
23
],
[
23,
24
],
[
24,
25
],
[
23,
26
],
[
21,
27
],
[
28,
28
],
[
28,
29
],
[
29,
30
],
[
30,
31
],
[
31,
32
],
[
32,
33
],
[
31,
34
],
[
30,
35
],
[
35,
36
],
[
29,
37
],
[
37,
38
],
[
38,
39
],
[
39,
40
],
[
38,
41
],
[
41,
42
],
[
42,
43
],
[
41,
44
],
[
29,
45
],
[
45,
46
],
[
46,
47
],
[
46,
48
],
[
48,
49
],
[
49,
50
],
[
45,
51
],
[
51,
52
],
[
51,
53
],
[
53,
54
],
[
54,
55
],
[
45,
56
],
[
56,
57
],
[
56,
58
],
[
58,
59
],
[
58,
60
],
[
60,
61
],
[
61,
62
],
[
62,
63
],
[
61,
64
],
[
64,
65
],
[
64,
66
],
[
60,
67
],
[
56,
68
],
[
68,
69
],
[
68,
70
],
[
70,
71
],
[
71,
72
],
[
72,
73
],
[
71,
74
],
[
74,
75
],
[
74,
76
],
[
70,
77
],
[
56,
78
],
[
78,
79
],
[
78,
80
],
[
80,
81
],
[
81,
82
],
[
82,
83
],
[
81,
84
],
[
84,
85
],
[
84,
86
],
[
80,
87
],
[
56,
88
],
[
88,
89
],
[
88,
90
],
[
90,
91
],
[
91,
92
],
[
92,
93
],
[
91,
94
],
[
94,
95
],
[
94,
96
],
[
90,
97
],
[
14,
98
],
[
98,
99
],
[
99,
100
],
[
100,
101
],
[
12,
102
],
[
102,
103
],
[
126,
104
],
[
104,
105
],
[
104,
106
],
[
106,
107
],
[
107,
108
],
[
107,
109
],
[
106,
110
],
[
110,
111
],
[
110,
112
],
[
112,
113
],
[
113,
114
],
[
106,
115
],
[
115,
116
],
[
116,
117
],
[
117,
118
],
[
117,
119
],
[
115,
120
],
[
120,
121
],
[
120,
122
],
[
104,
123
],
[
123,
124
],
[
0,
125
],
[
125,
126
],
[
125,
127
]
] | [
"\n\nimport java.util.ArrayDeque;\nimport java.util.Deque;\nimport java.util.Scanner;\n\npublic class Main {\n\tprivate static int calculate(String date) {\n\t\tDeque<Integer> d1 = new ArrayDeque<>();\n\t\t//数字入栈,操作符入栈,一个操作符取出两个数组计算\n\t\tString sc = \"+-*/\";\n\t\tfor (String s : date.split(\" \")) {\n\t\t\t\n\t\t\tif (sc.indexOf(s) == -1) {\n\t\t\t\t//System.out.println(s);\n\t\t\t\td1.push(Integer.valueOf(s));\n\t\t\t}\n\t\t\t\t\n\t\t\telse {\n\t\t\t\tInteger i2 = d1.pop();\n\t\t\t\tInteger i1 = d1.pop();\n\t\t\t\tswitch(s) {\n\t\t\t\tcase \"+\": d1.push(i1 + i2); break;\n\t\t\t\tcase \"-\": d1.push(i1 - i2);break;\n\t\t\t\tcase \"*\": d1.push(i1 * i2);break;\n\t\t\t\tcase \"/\": d1.push(i1 / i2);break;\n\t\t\t\t}\n\t\t\t\t//System.out.println(d1);\n\t\t}\n\t\t\t\n\t\t}\n\t\treturn d1.pop();\n\t}\n\tpublic static void main(String[] args) {\n\t\tScanner scan = new Scanner(System.in);\n\t\t//System.out.println(Integer.valueOf('0'));\n\t\tString date = scan.nextLine();\n\t\tSystem.out.println(calculate(date));\n\t}\n}\n",
"import java.util.ArrayDeque;",
"ArrayDeque",
"java.util",
"import java.util.Deque;",
"Deque",
"java.util",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\tprivate static int calculate(String date) {\n\t\tDeque<Integer> d1 = new ArrayDeque<>();\n\t\t//数字入栈,操作符入栈,一个操作符取出两个数组计算\n\t\tString sc = \"+-*/\";\n\t\tfor (String s : date.split(\" \")) {\n\t\t\t\n\t\t\tif (sc.indexOf(s) == -1) {\n\t\t\t\t//System.out.println(s);\n\t\t\t\td1.push(Integer.valueOf(s));\n\t\t\t}\n\t\t\t\t\n\t\t\telse {\n\t\t\t\tInteger i2 = d1.pop();\n\t\t\t\tInteger i1 = d1.pop();\n\t\t\t\tswitch(s) {\n\t\t\t\tcase \"+\": d1.push(i1 + i2); break;\n\t\t\t\tcase \"-\": d1.push(i1 - i2);break;\n\t\t\t\tcase \"*\": d1.push(i1 * i2);break;\n\t\t\t\tcase \"/\": d1.push(i1 / i2);break;\n\t\t\t\t}\n\t\t\t\t//System.out.println(d1);\n\t\t}\n\t\t\t\n\t\t}\n\t\treturn d1.pop();\n\t}\n\tpublic static void main(String[] args) {\n\t\tScanner scan = new Scanner(System.in);\n\t\t//System.out.println(Integer.valueOf('0'));\n\t\tString date = scan.nextLine();\n\t\tSystem.out.println(calculate(date));\n\t}\n}",
"Main",
"private static int calculate(String date) {\n\t\tDeque<Integer> d1 = new ArrayDeque<>();\n\t\t//数字入栈,操作符入栈,一个操作符取出两个数组计算\n\t\tString sc = \"+-*/\";\n\t\tfor (String s : date.split(\" \")) {\n\t\t\t\n\t\t\tif (sc.indexOf(s) == -1) {\n\t\t\t\t//System.out.println(s);\n\t\t\t\td1.push(Integer.valueOf(s));\n\t\t\t}\n\t\t\t\t\n\t\t\telse {\n\t\t\t\tInteger i2 = d1.pop();\n\t\t\t\tInteger i1 = d1.pop();\n\t\t\t\tswitch(s) {\n\t\t\t\tcase \"+\": d1.push(i1 + i2); break;\n\t\t\t\tcase \"-\": d1.push(i1 - i2);break;\n\t\t\t\tcase \"*\": d1.push(i1 * i2);break;\n\t\t\t\tcase \"/\": d1.push(i1 / i2);break;\n\t\t\t\t}\n\t\t\t\t//System.out.println(d1);\n\t\t}\n\t\t\t\n\t\t}\n\t\treturn d1.pop();\n\t}",
"calculate",
"{\n\t\tDeque<Integer> d1 = new ArrayDeque<>();\n\t\t//数字入栈,操作符入栈,一个操作符取出两个数组计算\n\t\tString sc = \"+-*/\";\n\t\tfor (String s : date.split(\" \")) {\n\t\t\t\n\t\t\tif (sc.indexOf(s) == -1) {\n\t\t\t\t//System.out.println(s);\n\t\t\t\td1.push(Integer.valueOf(s));\n\t\t\t}\n\t\t\t\t\n\t\t\telse {\n\t\t\t\tInteger i2 = d1.pop();\n\t\t\t\tInteger i1 = d1.pop();\n\t\t\t\tswitch(s) {\n\t\t\t\tcase \"+\": d1.push(i1 + i2); break;\n\t\t\t\tcase \"-\": d1.push(i1 - i2);break;\n\t\t\t\tcase \"*\": d1.push(i1 * i2);break;\n\t\t\t\tcase \"/\": d1.push(i1 / i2);break;\n\t\t\t\t}\n\t\t\t\t//System.out.println(d1);\n\t\t}\n\t\t\t\n\t\t}\n\t\treturn d1.pop();\n\t}",
"Deque<Integer> d1 = new ArrayDeque<>();",
"d1",
"new ArrayDeque<>()",
"String sc = \"+-*/\";",
"sc",
"\"+-*/\"",
"for (String s : date.split(\" \")) {\n\t\t\t\n\t\t\tif (sc.indexOf(s) == -1) {\n\t\t\t\t//System.out.println(s);\n\t\t\t\td1.push(Integer.valueOf(s));\n\t\t\t}\n\t\t\t\t\n\t\t\telse {\n\t\t\t\tInteger i2 = d1.pop();\n\t\t\t\tInteger i1 = d1.pop();\n\t\t\t\tswitch(s) {\n\t\t\t\tcase \"+\": d1.push(i1 + i2); break;\n\t\t\t\tcase \"-\": d1.push(i1 - i2);break;\n\t\t\t\tcase \"*\": d1.push(i1 * i2);break;\n\t\t\t\tcase \"/\": d1.push(i1 / i2);break;\n\t\t\t\t}\n\t\t\t\t//System.out.println(d1);\n\t\t}\n\t\t\t\n\t\t}",
"String s",
"date.split(\" \")",
"date.split",
"date",
"\" \"",
"{\n\t\t\t\n\t\t\tif (sc.indexOf(s) == -1) {\n\t\t\t\t//System.out.println(s);\n\t\t\t\td1.push(Integer.valueOf(s));\n\t\t\t}\n\t\t\t\t\n\t\t\telse {\n\t\t\t\tInteger i2 = d1.pop();\n\t\t\t\tInteger i1 = d1.pop();\n\t\t\t\tswitch(s) {\n\t\t\t\tcase \"+\": d1.push(i1 + i2); break;\n\t\t\t\tcase \"-\": d1.push(i1 - i2);break;\n\t\t\t\tcase \"*\": d1.push(i1 * i2);break;\n\t\t\t\tcase \"/\": d1.push(i1 / i2);break;\n\t\t\t\t}\n\t\t\t\t//System.out.println(d1);\n\t\t}\n\t\t\t\n\t\t}",
"{\n\t\t\t\n\t\t\tif (sc.indexOf(s) == -1) {\n\t\t\t\t//System.out.println(s);\n\t\t\t\td1.push(Integer.valueOf(s));\n\t\t\t}\n\t\t\t\t\n\t\t\telse {\n\t\t\t\tInteger i2 = d1.pop();\n\t\t\t\tInteger i1 = d1.pop();\n\t\t\t\tswitch(s) {\n\t\t\t\tcase \"+\": d1.push(i1 + i2); break;\n\t\t\t\tcase \"-\": d1.push(i1 - i2);break;\n\t\t\t\tcase \"*\": d1.push(i1 * i2);break;\n\t\t\t\tcase \"/\": d1.push(i1 / i2);break;\n\t\t\t\t}\n\t\t\t\t//System.out.println(d1);\n\t\t}\n\t\t\t\n\t\t}",
"if (sc.indexOf(s) == -1) {\n\t\t\t\t//System.out.println(s);\n\t\t\t\td1.push(Integer.valueOf(s));\n\t\t\t}\n\t\t\t\t\n\t\t\telse {\n\t\t\t\tInteger i2 = d1.pop();\n\t\t\t\tInteger i1 = d1.pop();\n\t\t\t\tswitch(s) {\n\t\t\t\tcase \"+\": d1.push(i1 + i2); break;\n\t\t\t\tcase \"-\": d1.push(i1 - i2);break;\n\t\t\t\tcase \"*\": d1.push(i1 * i2);break;\n\t\t\t\tcase \"/\": d1.push(i1 / i2);break;\n\t\t\t\t}\n\t\t\t\t//System.out.println(d1);\n\t\t}",
"sc.indexOf(s) == -1",
"sc.indexOf(s)",
"sc.indexOf",
"sc",
"s",
"-1",
"1",
"{\n\t\t\t\t//System.out.println(s);\n\t\t\t\td1.push(Integer.valueOf(s));\n\t\t\t}",
"d1.push(Integer.valueOf(s))",
"d1.push",
"d1",
"Integer.valueOf(s)",
"Integer.valueOf",
"Integer",
"s",
"{\n\t\t\t\tInteger i2 = d1.pop();\n\t\t\t\tInteger i1 = d1.pop();\n\t\t\t\tswitch(s) {\n\t\t\t\tcase \"+\": d1.push(i1 + i2); break;\n\t\t\t\tcase \"-\": d1.push(i1 - i2);break;\n\t\t\t\tcase \"*\": d1.push(i1 * i2);break;\n\t\t\t\tcase \"/\": d1.push(i1 / i2);break;\n\t\t\t\t}\n\t\t\t\t//System.out.println(d1);\n\t\t}",
"Integer i2 = d1.pop();",
"i2",
"d1.pop()",
"d1.pop",
"d1",
"Integer i1 = d1.pop();",
"i1",
"d1.pop()",
"d1.pop",
"d1",
"switch(s) {\n\t\t\t\tcase \"+\": d1.push(i1 + i2); break;\n\t\t\t\tcase \"-\": d1.push(i1 - i2);break;\n\t\t\t\tcase \"*\": d1.push(i1 * i2);break;\n\t\t\t\tcase \"/\": d1.push(i1 / i2);break;\n\t\t\t\t}",
"s",
"case \"+\":",
"\"+\"",
"case \"+\":",
"d1.push(i1 + i2)",
"d1.push",
"d1",
"i1 + i2",
"i1",
"i2",
"break;",
"case \"-\":",
"\"-\"",
"case \"-\":",
"d1.push(i1 - i2)",
"d1.push",
"d1",
"i1 - i2",
"i1",
"i2",
"break;",
"case \"*\":",
"\"*\"",
"case \"*\":",
"d1.push(i1 * i2)",
"d1.push",
"d1",
"i1 * i2",
"i1",
"i2",
"break;",
"case \"/\":",
"\"/\"",
"case \"/\":",
"d1.push(i1 / i2)",
"d1.push",
"d1",
"i1 / i2",
"i1",
"i2",
"break;",
"return d1.pop();",
"d1.pop()",
"d1.pop",
"d1",
"String date",
"date",
"public static void main(String[] args) {\n\t\tScanner scan = new Scanner(System.in);\n\t\t//System.out.println(Integer.valueOf('0'));\n\t\tString date = scan.nextLine();\n\t\tSystem.out.println(calculate(date));\n\t}",
"main",
"{\n\t\tScanner scan = new Scanner(System.in);\n\t\t//System.out.println(Integer.valueOf('0'));\n\t\tString date = scan.nextLine();\n\t\tSystem.out.println(calculate(date));\n\t}",
"Scanner scan = new Scanner(System.in);",
"scan",
"new Scanner(System.in)",
"String date = scan.nextLine();",
"date",
"scan.nextLine()",
"scan.nextLine",
"scan",
"System.out.println(calculate(date))",
"System.out.println",
"System.out",
"System",
"System.out",
"calculate(date)",
"calculate",
"date",
"String[] args",
"args",
"public class Main {\n\tprivate static int calculate(String date) {\n\t\tDeque<Integer> d1 = new ArrayDeque<>();\n\t\t//数字入栈,操作符入栈,一个操作符取出两个数组计算\n\t\tString sc = \"+-*/\";\n\t\tfor (String s : date.split(\" \")) {\n\t\t\t\n\t\t\tif (sc.indexOf(s) == -1) {\n\t\t\t\t//System.out.println(s);\n\t\t\t\td1.push(Integer.valueOf(s));\n\t\t\t}\n\t\t\t\t\n\t\t\telse {\n\t\t\t\tInteger i2 = d1.pop();\n\t\t\t\tInteger i1 = d1.pop();\n\t\t\t\tswitch(s) {\n\t\t\t\tcase \"+\": d1.push(i1 + i2); break;\n\t\t\t\tcase \"-\": d1.push(i1 - i2);break;\n\t\t\t\tcase \"*\": d1.push(i1 * i2);break;\n\t\t\t\tcase \"/\": d1.push(i1 / i2);break;\n\t\t\t\t}\n\t\t\t\t//System.out.println(d1);\n\t\t}\n\t\t\t\n\t\t}\n\t\treturn d1.pop();\n\t}\n\tpublic static void main(String[] args) {\n\t\tScanner scan = new Scanner(System.in);\n\t\t//System.out.println(Integer.valueOf('0'));\n\t\tString date = scan.nextLine();\n\t\tSystem.out.println(calculate(date));\n\t}\n}",
"public class Main {\n\tprivate static int calculate(String date) {\n\t\tDeque<Integer> d1 = new ArrayDeque<>();\n\t\t//数字入栈,操作符入栈,一个操作符取出两个数组计算\n\t\tString sc = \"+-*/\";\n\t\tfor (String s : date.split(\" \")) {\n\t\t\t\n\t\t\tif (sc.indexOf(s) == -1) {\n\t\t\t\t//System.out.println(s);\n\t\t\t\td1.push(Integer.valueOf(s));\n\t\t\t}\n\t\t\t\t\n\t\t\telse {\n\t\t\t\tInteger i2 = d1.pop();\n\t\t\t\tInteger i1 = d1.pop();\n\t\t\t\tswitch(s) {\n\t\t\t\tcase \"+\": d1.push(i1 + i2); break;\n\t\t\t\tcase \"-\": d1.push(i1 - i2);break;\n\t\t\t\tcase \"*\": d1.push(i1 * i2);break;\n\t\t\t\tcase \"/\": d1.push(i1 / i2);break;\n\t\t\t\t}\n\t\t\t\t//System.out.println(d1);\n\t\t}\n\t\t\t\n\t\t}\n\t\treturn d1.pop();\n\t}\n\tpublic static void main(String[] args) {\n\t\tScanner scan = new Scanner(System.in);\n\t\t//System.out.println(Integer.valueOf('0'));\n\t\tString date = scan.nextLine();\n\t\tSystem.out.println(calculate(date));\n\t}\n}",
"Main"
] |
import java.util.ArrayDeque;
import java.util.Deque;
import java.util.Scanner;
public class Main {
private static int calculate(String date) {
Deque<Integer> d1 = new ArrayDeque<>();
//数字入栈,操作符入栈,一个操作符取出两个数组计算
String sc = "+-*/";
for (String s : date.split(" ")) {
if (sc.indexOf(s) == -1) {
//System.out.println(s);
d1.push(Integer.valueOf(s));
}
else {
Integer i2 = d1.pop();
Integer i1 = d1.pop();
switch(s) {
case "+": d1.push(i1 + i2); break;
case "-": d1.push(i1 - i2);break;
case "*": d1.push(i1 * i2);break;
case "/": d1.push(i1 / i2);break;
}
//System.out.println(d1);
}
}
return d1.pop();
}
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
//System.out.println(Integer.valueOf('0'));
String date = scan.nextLine();
System.out.println(calculate(date));
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
20,
41,
13,
4,
18,
4,
18,
13,
17,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
30,
14,
4,
18,
18,
13,
13,
17,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
4,
18,
13,
2,
13,
13,
14,
4,
18,
18,
13,
13,
17,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
4,
18,
13,
2,
13,
13,
14,
4,
18,
18,
13,
13,
17,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
4,
18,
13,
2,
13,
13,
30,
41,
13,
4,
18,
13,
18,
13,
13,
4,
18,
13,
13,
4,
18,
18,
13,
13,
4,
18,
13,
23,
13,
6,
13,
41,
13,
41,
13,
41,
13,
12,
13,
30,
0,
13,
17,
0,
18,
36,
13,
13,
0,
13,
20,
13,
23,
13,
12,
13,
30,
29,
2,
13,
17,
12,
13,
30,
29,
2,
13,
2,
13,
17,
12,
13,
30,
14,
40,
4,
13,
30,
40,
13,
0,
18,
13,
13,
13,
23,
13,
12,
13,
30,
14,
40,
4,
13,
30,
40,
13,
29,
18,
13,
2,
13,
17,
29,
40,
17,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
214,
8
],
[
214,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
12,
14
],
[
11,
15
],
[
15,
16
],
[
15,
17
],
[
11,
18
],
[
18,
19
],
[
18,
20
],
[
20,
21
],
[
21,
22
],
[
22,
23
],
[
23,
24
],
[
20,
25
],
[
11,
26
],
[
26,
27
],
[
27,
28
],
[
28,
29
],
[
28,
30
],
[
26,
31
],
[
31,
32
],
[
31,
33
],
[
33,
34
],
[
33,
35
],
[
26,
36
],
[
36,
37
],
[
37,
38
],
[
26,
39
],
[
40,
40
],
[
40,
41
],
[
41,
42
],
[
42,
43
],
[
43,
44
],
[
44,
45
],
[
44,
46
],
[
42,
47
],
[
41,
48
],
[
48,
49
],
[
49,
50
],
[
49,
51
],
[
51,
52
],
[
52,
53
],
[
48,
54
],
[
54,
55
],
[
54,
56
],
[
56,
57
],
[
57,
58
],
[
48,
59
],
[
59,
60
],
[
60,
61
],
[
59,
62
],
[
62,
63
],
[
62,
64
],
[
41,
65
],
[
65,
66
],
[
66,
67
],
[
67,
68
],
[
68,
69
],
[
68,
70
],
[
66,
71
],
[
65,
72
],
[
72,
73
],
[
73,
74
],
[
73,
75
],
[
75,
76
],
[
76,
77
],
[
72,
78
],
[
78,
79
],
[
78,
80
],
[
80,
81
],
[
81,
82
],
[
72,
83
],
[
83,
84
],
[
84,
85
],
[
83,
86
],
[
86,
87
],
[
86,
88
],
[
65,
89
],
[
89,
90
],
[
90,
91
],
[
91,
92
],
[
92,
93
],
[
92,
94
],
[
90,
95
],
[
89,
96
],
[
96,
97
],
[
97,
98
],
[
97,
99
],
[
99,
100
],
[
100,
101
],
[
96,
102
],
[
102,
103
],
[
102,
104
],
[
104,
105
],
[
105,
106
],
[
96,
107
],
[
107,
108
],
[
108,
109
],
[
107,
110
],
[
110,
111
],
[
110,
112
],
[
89,
113
],
[
113,
114
],
[
114,
115
],
[
114,
116
],
[
116,
117
],
[
117,
118
],
[
116,
119
],
[
119,
120
],
[
119,
121
],
[
113,
122
],
[
122,
123
],
[
123,
124
],
[
122,
125
],
[
11,
126
],
[
126,
127
],
[
127,
128
],
[
128,
129
],
[
128,
130
],
[
126,
131
],
[
131,
132
],
[
132,
133
],
[
9,
134
],
[
134,
135
],
[
0,
136
],
[
136,
137
],
[
136,
138
],
[
138,
139
],
[
136,
140
],
[
140,
141
],
[
136,
142
],
[
142,
143
],
[
136,
144
],
[
144,
145
],
[
144,
146
],
[
146,
147
],
[
147,
148
],
[
147,
149
],
[
146,
150
],
[
150,
151
],
[
151,
152
],
[
151,
153
],
[
150,
154
],
[
146,
155
],
[
155,
156
],
[
155,
157
],
[
144,
159
],
[
159,
160
],
[
136,
161
],
[
161,
162
],
[
161,
163
],
[
163,
164
],
[
164,
165
],
[
165,
166
],
[
165,
167
],
[
136,
168
],
[
168,
169
],
[
168,
170
],
[
170,
171
],
[
171,
172
],
[
172,
173
],
[
172,
174
],
[
174,
175
],
[
174,
176
],
[
136,
177
],
[
177,
178
],
[
177,
179
],
[
179,
180
],
[
180,
181
],
[
181,
182
],
[
182,
183
],
[
180,
184
],
[
184,
185
],
[
185,
186
],
[
184,
187
],
[
187,
188
],
[
188,
189
],
[
188,
190
],
[
187,
191
],
[
177,
192
],
[
192,
193
],
[
136,
194
],
[
194,
195
],
[
194,
196
],
[
196,
197
],
[
197,
198
],
[
198,
199
],
[
199,
200
],
[
197,
201
],
[
201,
202
],
[
202,
203
],
[
201,
204
],
[
204,
205
],
[
205,
206
],
[
205,
207
],
[
207,
208
],
[
207,
209
],
[
196,
210
],
[
210,
211
],
[
211,
212
],
[
0,
213
],
[
213,
214
],
[
213,
215
]
] | [
"import java.io.*;\nimport java.util.*;\n\npublic class Main{\n public static void main(String args[]) throws IOException{\n\tBufferedReader br=new BufferedReader(new InputStreamReader(System.in));\n\n\n\tStack stack=new Stack(1000);\n\t\n\tString str[]=br.readLine().split(\" \");\n\n\tfor(int i=0;i<str.length;i++){\n\t if ( str[i].equals(\"+\")){\n\t\tint a=stack.pop();\n\t\tint b=stack.pop();\n\t\tstack.push(b+a);\n\t } else if ( str[i].equals(\"-\") ){\n\t\tint a=stack.pop();\n\t\tint b=stack.pop();\n\t\tstack.push(b-a);\n\t } else if ( str[i].equals(\"*\")){\n\t\tint a=stack.pop();\n\t\tint b=stack.pop();\n\t\tstack.push(b*a);\n\t } else {\n\t\tint x = Integer.parseInt(str[i]);\n\t\tstack.push(x);\n\t }\n\t}\n\tSystem.out.println(stack.pop());\n }\n}\nclass Stack{\n int top;\n final int MAX;\n int S[];\n \n public Stack(int MAX){\n\ttop=0;\n\tthis.MAX=MAX;\n\tS=new int[MAX];\n }\n public boolean isEmpty(){\n\treturn top==0;\n }\n\n public boolean isFull(){\n\treturn top>=MAX-1;\n }\n\n public void push(int x){\n\tif(!isFull()){\n\t top++;\n\t S[top]=x;\n\t}\n }\n public int pop(){\n\tif(!isEmpty()){\n\t top--;\n\t return S[top+1];\n\t}\n\treturn -1;\n }\n}\n",
"import java.io.*;",
"io.*",
"java",
"import java.util.*;",
"util.*",
"java",
"public class Main{\n public static void main(String args[]) throws IOException{\n\tBufferedReader br=new BufferedReader(new InputStreamReader(System.in));\n\n\n\tStack stack=new Stack(1000);\n\t\n\tString str[]=br.readLine().split(\" \");\n\n\tfor(int i=0;i<str.length;i++){\n\t if ( str[i].equals(\"+\")){\n\t\tint a=stack.pop();\n\t\tint b=stack.pop();\n\t\tstack.push(b+a);\n\t } else if ( str[i].equals(\"-\") ){\n\t\tint a=stack.pop();\n\t\tint b=stack.pop();\n\t\tstack.push(b-a);\n\t } else if ( str[i].equals(\"*\")){\n\t\tint a=stack.pop();\n\t\tint b=stack.pop();\n\t\tstack.push(b*a);\n\t } else {\n\t\tint x = Integer.parseInt(str[i]);\n\t\tstack.push(x);\n\t }\n\t}\n\tSystem.out.println(stack.pop());\n }\n}",
"Main",
"public static void main(String args[]) throws IOException{\n\tBufferedReader br=new BufferedReader(new InputStreamReader(System.in));\n\n\n\tStack stack=new Stack(1000);\n\t\n\tString str[]=br.readLine().split(\" \");\n\n\tfor(int i=0;i<str.length;i++){\n\t if ( str[i].equals(\"+\")){\n\t\tint a=stack.pop();\n\t\tint b=stack.pop();\n\t\tstack.push(b+a);\n\t } else if ( str[i].equals(\"-\") ){\n\t\tint a=stack.pop();\n\t\tint b=stack.pop();\n\t\tstack.push(b-a);\n\t } else if ( str[i].equals(\"*\")){\n\t\tint a=stack.pop();\n\t\tint b=stack.pop();\n\t\tstack.push(b*a);\n\t } else {\n\t\tint x = Integer.parseInt(str[i]);\n\t\tstack.push(x);\n\t }\n\t}\n\tSystem.out.println(stack.pop());\n }",
"main",
"{\n\tBufferedReader br=new BufferedReader(new InputStreamReader(System.in));\n\n\n\tStack stack=new Stack(1000);\n\t\n\tString str[]=br.readLine().split(\" \");\n\n\tfor(int i=0;i<str.length;i++){\n\t if ( str[i].equals(\"+\")){\n\t\tint a=stack.pop();\n\t\tint b=stack.pop();\n\t\tstack.push(b+a);\n\t } else if ( str[i].equals(\"-\") ){\n\t\tint a=stack.pop();\n\t\tint b=stack.pop();\n\t\tstack.push(b-a);\n\t } else if ( str[i].equals(\"*\")){\n\t\tint a=stack.pop();\n\t\tint b=stack.pop();\n\t\tstack.push(b*a);\n\t } else {\n\t\tint x = Integer.parseInt(str[i]);\n\t\tstack.push(x);\n\t }\n\t}\n\tSystem.out.println(stack.pop());\n }",
"BufferedReader br=new BufferedReader(new InputStreamReader(System.in));",
"br",
"new BufferedReader(new InputStreamReader(System.in))",
"Stack stack=new Stack(1000);",
"stack",
"new Stack(1000)",
"String str[]=br.readLine().split(\" \");",
"str",
"br.readLine().split(\" \")",
"br.readLine().split",
"br.readLine()",
"br.readLine",
"br",
"\" \"",
"for(int i=0;i<str.length;i++){\n\t if ( str[i].equals(\"+\")){\n\t\tint a=stack.pop();\n\t\tint b=stack.pop();\n\t\tstack.push(b+a);\n\t } else if ( str[i].equals(\"-\") ){\n\t\tint a=stack.pop();\n\t\tint b=stack.pop();\n\t\tstack.push(b-a);\n\t } else if ( str[i].equals(\"*\")){\n\t\tint a=stack.pop();\n\t\tint b=stack.pop();\n\t\tstack.push(b*a);\n\t } else {\n\t\tint x = Integer.parseInt(str[i]);\n\t\tstack.push(x);\n\t }\n\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<str.length",
"i",
"str.length",
"str",
"str.length",
"i++",
"i++",
"i",
"{\n\t if ( str[i].equals(\"+\")){\n\t\tint a=stack.pop();\n\t\tint b=stack.pop();\n\t\tstack.push(b+a);\n\t } else if ( str[i].equals(\"-\") ){\n\t\tint a=stack.pop();\n\t\tint b=stack.pop();\n\t\tstack.push(b-a);\n\t } else if ( str[i].equals(\"*\")){\n\t\tint a=stack.pop();\n\t\tint b=stack.pop();\n\t\tstack.push(b*a);\n\t } else {\n\t\tint x = Integer.parseInt(str[i]);\n\t\tstack.push(x);\n\t }\n\t}",
"{\n\t if ( str[i].equals(\"+\")){\n\t\tint a=stack.pop();\n\t\tint b=stack.pop();\n\t\tstack.push(b+a);\n\t } else if ( str[i].equals(\"-\") ){\n\t\tint a=stack.pop();\n\t\tint b=stack.pop();\n\t\tstack.push(b-a);\n\t } else if ( str[i].equals(\"*\")){\n\t\tint a=stack.pop();\n\t\tint b=stack.pop();\n\t\tstack.push(b*a);\n\t } else {\n\t\tint x = Integer.parseInt(str[i]);\n\t\tstack.push(x);\n\t }\n\t}",
"if ( str[i].equals(\"+\")){\n\t\tint a=stack.pop();\n\t\tint b=stack.pop();\n\t\tstack.push(b+a);\n\t } else if ( str[i].equals(\"-\") ){\n\t\tint a=stack.pop();\n\t\tint b=stack.pop();\n\t\tstack.push(b-a);\n\t } else if ( str[i].equals(\"*\")){\n\t\tint a=stack.pop();\n\t\tint b=stack.pop();\n\t\tstack.push(b*a);\n\t } else {\n\t\tint x = Integer.parseInt(str[i]);\n\t\tstack.push(x);\n\t }",
"str[i].equals(\"+\")",
"str[i].equals",
"str[i]",
"str",
"i",
"\"+\"",
"{\n\t\tint a=stack.pop();\n\t\tint b=stack.pop();\n\t\tstack.push(b+a);\n\t }",
"int a=stack.pop();",
"a",
"stack.pop()",
"stack.pop",
"stack",
"int b=stack.pop();",
"b",
"stack.pop()",
"stack.pop",
"stack",
"stack.push(b+a)",
"stack.push",
"stack",
"b+a",
"b",
"a",
"if ( str[i].equals(\"-\") ){\n\t\tint a=stack.pop();\n\t\tint b=stack.pop();\n\t\tstack.push(b-a);\n\t } else if ( str[i].equals(\"*\")){\n\t\tint a=stack.pop();\n\t\tint b=stack.pop();\n\t\tstack.push(b*a);\n\t } else {\n\t\tint x = Integer.parseInt(str[i]);\n\t\tstack.push(x);\n\t }",
"str[i].equals(\"-\")",
"str[i].equals",
"str[i]",
"str",
"i",
"\"-\"",
"{\n\t\tint a=stack.pop();\n\t\tint b=stack.pop();\n\t\tstack.push(b-a);\n\t }",
"int a=stack.pop();",
"a",
"stack.pop()",
"stack.pop",
"stack",
"int b=stack.pop();",
"b",
"stack.pop()",
"stack.pop",
"stack",
"stack.push(b-a)",
"stack.push",
"stack",
"b-a",
"b",
"a",
"if ( str[i].equals(\"*\")){\n\t\tint a=stack.pop();\n\t\tint b=stack.pop();\n\t\tstack.push(b*a);\n\t } else {\n\t\tint x = Integer.parseInt(str[i]);\n\t\tstack.push(x);\n\t }",
"str[i].equals(\"*\")",
"str[i].equals",
"str[i]",
"str",
"i",
"\"*\"",
"{\n\t\tint a=stack.pop();\n\t\tint b=stack.pop();\n\t\tstack.push(b*a);\n\t }",
"int a=stack.pop();",
"a",
"stack.pop()",
"stack.pop",
"stack",
"int b=stack.pop();",
"b",
"stack.pop()",
"stack.pop",
"stack",
"stack.push(b*a)",
"stack.push",
"stack",
"b*a",
"b",
"a",
"{\n\t\tint x = Integer.parseInt(str[i]);\n\t\tstack.push(x);\n\t }",
"int x = Integer.parseInt(str[i]);",
"x",
"Integer.parseInt(str[i])",
"Integer.parseInt",
"Integer",
"str[i]",
"str",
"i",
"stack.push(x)",
"stack.push",
"stack",
"x",
"System.out.println(stack.pop())",
"System.out.println",
"System.out",
"System",
"System.out",
"stack.pop()",
"stack.pop",
"stack",
"String args[]",
"args",
"class Stack{\n int top;\n final int MAX;\n int S[];\n \n public Stack(int MAX){\n\ttop=0;\n\tthis.MAX=MAX;\n\tS=new int[MAX];\n }\n public boolean isEmpty(){\n\treturn top==0;\n }\n\n public boolean isFull(){\n\treturn top>=MAX-1;\n }\n\n public void push(int x){\n\tif(!isFull()){\n\t top++;\n\t S[top]=x;\n\t}\n }\n public int pop(){\n\tif(!isEmpty()){\n\t top--;\n\t return S[top+1];\n\t}\n\treturn -1;\n }\n}",
"Stack",
"int top;",
"top",
"final int MAX;",
"MAX",
"int S[];",
"S",
"public Stack(int MAX){\n\ttop=0;\n\tthis.MAX=MAX;\n\tS=new int[MAX];\n }",
"Stack",
"{\n\ttop=0;\n\tthis.MAX=MAX;\n\tS=new int[MAX];\n }",
"top=0",
"top",
"0",
"this.MAX=MAX",
"this.MAX",
"this",
"this.MAX",
"MAX",
"S=new int[MAX]",
"S",
"new int[MAX]",
"MAX",
"int MAX",
"MAX",
"public boolean isEmpty(){\n\treturn top==0;\n }",
"isEmpty",
"{\n\treturn top==0;\n }",
"return top==0;",
"top==0",
"top",
"0",
"public boolean isFull(){\n\treturn top>=MAX-1;\n }",
"isFull",
"{\n\treturn top>=MAX-1;\n }",
"return top>=MAX-1;",
"top>=MAX-1",
"top",
"MAX-1",
"MAX",
"1",
"public void push(int x){\n\tif(!isFull()){\n\t top++;\n\t S[top]=x;\n\t}\n }",
"push",
"{\n\tif(!isFull()){\n\t top++;\n\t S[top]=x;\n\t}\n }",
"if(!isFull()){\n\t top++;\n\t S[top]=x;\n\t}",
"!isFull()",
"isFull()",
"isFull",
"{\n\t top++;\n\t S[top]=x;\n\t}",
"top++",
"top",
"S[top]=x",
"S[top]",
"S",
"top",
"x",
"int x",
"x",
"public int pop(){\n\tif(!isEmpty()){\n\t top--;\n\t return S[top+1];\n\t}\n\treturn -1;\n }",
"pop",
"{\n\tif(!isEmpty()){\n\t top--;\n\t return S[top+1];\n\t}\n\treturn -1;\n }",
"if(!isEmpty()){\n\t top--;\n\t return S[top+1];\n\t}",
"!isEmpty()",
"isEmpty()",
"isEmpty",
"{\n\t top--;\n\t return S[top+1];\n\t}",
"top--",
"top",
"return S[top+1];",
"S[top+1]",
"S",
"top+1",
"top",
"1",
"return -1;",
"-1",
"1",
"public class Main{\n public static void main(String args[]) throws IOException{\n\tBufferedReader br=new BufferedReader(new InputStreamReader(System.in));\n\n\n\tStack stack=new Stack(1000);\n\t\n\tString str[]=br.readLine().split(\" \");\n\n\tfor(int i=0;i<str.length;i++){\n\t if ( str[i].equals(\"+\")){\n\t\tint a=stack.pop();\n\t\tint b=stack.pop();\n\t\tstack.push(b+a);\n\t } else if ( str[i].equals(\"-\") ){\n\t\tint a=stack.pop();\n\t\tint b=stack.pop();\n\t\tstack.push(b-a);\n\t } else if ( str[i].equals(\"*\")){\n\t\tint a=stack.pop();\n\t\tint b=stack.pop();\n\t\tstack.push(b*a);\n\t } else {\n\t\tint x = Integer.parseInt(str[i]);\n\t\tstack.push(x);\n\t }\n\t}\n\tSystem.out.println(stack.pop());\n }\n}",
"public class Main{\n public static void main(String args[]) throws IOException{\n\tBufferedReader br=new BufferedReader(new InputStreamReader(System.in));\n\n\n\tStack stack=new Stack(1000);\n\t\n\tString str[]=br.readLine().split(\" \");\n\n\tfor(int i=0;i<str.length;i++){\n\t if ( str[i].equals(\"+\")){\n\t\tint a=stack.pop();\n\t\tint b=stack.pop();\n\t\tstack.push(b+a);\n\t } else if ( str[i].equals(\"-\") ){\n\t\tint a=stack.pop();\n\t\tint b=stack.pop();\n\t\tstack.push(b-a);\n\t } else if ( str[i].equals(\"*\")){\n\t\tint a=stack.pop();\n\t\tint b=stack.pop();\n\t\tstack.push(b*a);\n\t } else {\n\t\tint x = Integer.parseInt(str[i]);\n\t\tstack.push(x);\n\t }\n\t}\n\tSystem.out.println(stack.pop());\n }\n}",
"Main"
] | import java.io.*;
import java.util.*;
public class Main{
public static void main(String args[]) throws IOException{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
Stack stack=new Stack(1000);
String str[]=br.readLine().split(" ");
for(int i=0;i<str.length;i++){
if ( str[i].equals("+")){
int a=stack.pop();
int b=stack.pop();
stack.push(b+a);
} else if ( str[i].equals("-") ){
int a=stack.pop();
int b=stack.pop();
stack.push(b-a);
} else if ( str[i].equals("*")){
int a=stack.pop();
int b=stack.pop();
stack.push(b*a);
} else {
int x = Integer.parseInt(str[i]);
stack.push(x);
}
}
System.out.println(stack.pop());
}
}
class Stack{
int top;
final int MAX;
int S[];
public Stack(int MAX){
top=0;
this.MAX=MAX;
S=new int[MAX];
}
public boolean isEmpty(){
return top==0;
}
public boolean isFull(){
return top>=MAX-1;
}
public void push(int x){
if(!isFull()){
top++;
S[top]=x;
}
}
public int pop(){
if(!isEmpty()){
top--;
return S[top+1];
}
return -1;
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
38,
30,
41,
13,
20,
41,
13,
4,
18,
4,
18,
13,
17,
41,
13,
17,
41,
13,
20,
28,
13,
13,
30,
30,
35,
13,
34,
17,
1,
0,
13,
4,
18,
13,
0,
13,
4,
18,
13,
4,
18,
13,
13,
0,
13,
17,
3,
34,
17,
1,
0,
13,
4,
18,
13,
0,
13,
4,
18,
13,
4,
18,
13,
13,
0,
13,
17,
3,
34,
17,
1,
0,
13,
4,
18,
13,
0,
13,
4,
18,
13,
4,
18,
13,
13,
0,
13,
17,
3,
34,
1,
4,
18,
13,
4,
18,
13,
13,
3,
42,
40,
4,
18,
13,
0,
13,
4,
18,
13,
4,
18,
18,
13,
13,
13,
23,
13,
6,
13,
41,
13,
41,
13,
12,
13,
30,
0,
13,
20,
13,
0,
13,
17,
23,
13,
12,
13,
30,
0,
13,
17,
12,
13,
30,
29,
13,
12,
13,
30,
29,
2,
13,
17,
12,
13,
30,
29,
2,
13,
2,
18,
13,
13,
17,
12,
13,
30,
14,
4,
13,
29,
17,
0,
18,
13,
40,
13,
13,
29,
17,
23,
13,
12,
13,
30,
14,
4,
13,
29,
17,
29,
18,
13,
40,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
211,
11
],
[
211,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
16,
17
],
[
17,
18
],
[
17,
19
],
[
16,
20
],
[
20,
21
],
[
20,
22
],
[
22,
23
],
[
23,
24
],
[
24,
25
],
[
25,
26
],
[
22,
27
],
[
16,
28
],
[
28,
29
],
[
28,
30
],
[
16,
31
],
[
31,
32
],
[
31,
33
],
[
16,
34
],
[
34,
35
],
[
34,
36
],
[
34,
37
],
[
38,
38
],
[
38,
39
],
[
39,
40
],
[
39,
41
],
[
41,
42
],
[
41,
43
],
[
43,
44
],
[
44,
45
],
[
44,
46
],
[
46,
47
],
[
47,
48
],
[
43,
49
],
[
49,
50
],
[
49,
51
],
[
51,
52
],
[
52,
53
],
[
43,
54
],
[
54,
55
],
[
55,
56
],
[
54,
57
],
[
43,
58
],
[
58,
59
],
[
58,
60
],
[
43,
61
],
[
39,
62
],
[
62,
63
],
[
62,
64
],
[
64,
65
],
[
65,
66
],
[
65,
67
],
[
67,
68
],
[
68,
69
],
[
64,
70
],
[
70,
71
],
[
70,
72
],
[
72,
73
],
[
73,
74
],
[
64,
75
],
[
75,
76
],
[
76,
77
],
[
75,
78
],
[
64,
79
],
[
79,
80
],
[
79,
81
],
[
64,
82
],
[
39,
83
],
[
83,
84
],
[
83,
85
],
[
85,
86
],
[
86,
87
],
[
86,
88
],
[
88,
89
],
[
89,
90
],
[
85,
91
],
[
91,
92
],
[
91,
93
],
[
93,
94
],
[
94,
95
],
[
85,
96
],
[
96,
97
],
[
97,
98
],
[
96,
99
],
[
85,
100
],
[
100,
101
],
[
100,
102
],
[
85,
103
],
[
39,
104
],
[
104,
105
],
[
105,
106
],
[
106,
107
],
[
107,
108
],
[
106,
109
],
[
109,
110
],
[
110,
111
],
[
109,
112
],
[
105,
113
],
[
16,
114
],
[
114,
115
],
[
115,
116
],
[
116,
117
],
[
117,
118
],
[
114,
119
],
[
119,
120
],
[
119,
121
],
[
121,
122
],
[
122,
123
],
[
16,
124
],
[
124,
125
],
[
125,
126
],
[
126,
127
],
[
126,
128
],
[
124,
129
],
[
12,
130
],
[
130,
131
],
[
0,
132
],
[
132,
133
],
[
132,
134
],
[
134,
135
],
[
132,
136
],
[
136,
137
],
[
132,
138
],
[
138,
139
],
[
138,
140
],
[
140,
141
],
[
141,
142
],
[
141,
143
],
[
140,
145
],
[
145,
146
],
[
145,
147
],
[
138,
148
],
[
148,
149
],
[
132,
150
],
[
150,
151
],
[
150,
152
],
[
152,
153
],
[
153,
154
],
[
153,
155
],
[
132,
156
],
[
156,
157
],
[
156,
158
],
[
158,
159
],
[
159,
160
],
[
132,
161
],
[
161,
162
],
[
161,
163
],
[
163,
164
],
[
164,
165
],
[
165,
166
],
[
165,
167
],
[
132,
168
],
[
168,
169
],
[
168,
170
],
[
170,
171
],
[
171,
172
],
[
172,
173
],
[
172,
174
],
[
174,
175
],
[
175,
176
],
[
175,
177
],
[
174,
178
],
[
132,
179
],
[
179,
180
],
[
179,
181
],
[
181,
182
],
[
182,
183
],
[
183,
184
],
[
182,
185
],
[
185,
186
],
[
181,
187
],
[
187,
188
],
[
188,
189
],
[
188,
190
],
[
190,
191
],
[
187,
192
],
[
181,
193
],
[
193,
194
],
[
179,
195
],
[
195,
196
],
[
132,
197
],
[
197,
198
],
[
197,
199
],
[
199,
200
],
[
200,
201
],
[
201,
202
],
[
200,
203
],
[
203,
204
],
[
199,
205
],
[
205,
206
],
[
206,
207
],
[
206,
208
],
[
208,
209
],
[
0,
210
],
[
210,
211
],
[
210,
212
]
] | [
"import java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\n\npublic class Main {\n\n public static void main(String[] args) throws IOException {\n \n try(BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {\n\n String[] line = br.readLine().split(\" \");\n int buf = 0;\n Stack stack = new Stack(line.length);\n\n for (String s : line) {\n switch(s) {\n case \"+\" :\n buf += stack.pop();\n buf += stack.pop();\n stack.push(buf);\n buf = 0;\n break;\n\n case \"-\" :\n buf -= stack.pop();\n buf += stack.pop();\n stack.push(buf);\n buf = 0;\n break;\n\n case \"*\" :\n buf = stack.pop();\n buf *= stack.pop();\n stack.push(buf);\n buf = 0;\n break;\n\n default :\n stack.push(Integer.parseInt(s));\n break;\n }\n }\n\n while(!stack.isEmpty())\n buf += stack.pop();\n \n System.out.println(buf);\n }\n }\n}\n\nclass Stack {\n int[] stack;\n int ite;\n\n public Stack(int capacity) {\n stack = new int[capacity];\n ite = 0;\n }\n\n public void initialize() {\n ite = 0;\n }\n\n public int getIte() {\n return ite;\n }\n\n public boolean isEmpty() {\n return ite == 0;\n }\n\n public boolean isFull() {\n return ite >= stack.length-1;\n }\n\n public boolean push(int x) {\n if(isFull()) return false;\n\n stack[++ite] = x;\n return true;\n }\n\n public int pop() {\n if(isEmpty()) return 0;\n\n return stack[ite--];\n\n }\n}",
"import java.io.BufferedReader;",
"BufferedReader",
"java.io",
"import java.io.IOException;",
"IOException",
"java.io",
"import java.io.InputStreamReader;",
"InputStreamReader",
"java.io",
"public class Main {\n\n public static void main(String[] args) throws IOException {\n \n try(BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {\n\n String[] line = br.readLine().split(\" \");\n int buf = 0;\n Stack stack = new Stack(line.length);\n\n for (String s : line) {\n switch(s) {\n case \"+\" :\n buf += stack.pop();\n buf += stack.pop();\n stack.push(buf);\n buf = 0;\n break;\n\n case \"-\" :\n buf -= stack.pop();\n buf += stack.pop();\n stack.push(buf);\n buf = 0;\n break;\n\n case \"*\" :\n buf = stack.pop();\n buf *= stack.pop();\n stack.push(buf);\n buf = 0;\n break;\n\n default :\n stack.push(Integer.parseInt(s));\n break;\n }\n }\n\n while(!stack.isEmpty())\n buf += stack.pop();\n \n System.out.println(buf);\n }\n }\n}",
"Main",
"public static void main(String[] args) throws IOException {\n \n try(BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {\n\n String[] line = br.readLine().split(\" \");\n int buf = 0;\n Stack stack = new Stack(line.length);\n\n for (String s : line) {\n switch(s) {\n case \"+\" :\n buf += stack.pop();\n buf += stack.pop();\n stack.push(buf);\n buf = 0;\n break;\n\n case \"-\" :\n buf -= stack.pop();\n buf += stack.pop();\n stack.push(buf);\n buf = 0;\n break;\n\n case \"*\" :\n buf = stack.pop();\n buf *= stack.pop();\n stack.push(buf);\n buf = 0;\n break;\n\n default :\n stack.push(Integer.parseInt(s));\n break;\n }\n }\n\n while(!stack.isEmpty())\n buf += stack.pop();\n \n System.out.println(buf);\n }\n }",
"main",
"{\n \n try(BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {\n\n String[] line = br.readLine().split(\" \");\n int buf = 0;\n Stack stack = new Stack(line.length);\n\n for (String s : line) {\n switch(s) {\n case \"+\" :\n buf += stack.pop();\n buf += stack.pop();\n stack.push(buf);\n buf = 0;\n break;\n\n case \"-\" :\n buf -= stack.pop();\n buf += stack.pop();\n stack.push(buf);\n buf = 0;\n break;\n\n case \"*\" :\n buf = stack.pop();\n buf *= stack.pop();\n stack.push(buf);\n buf = 0;\n break;\n\n default :\n stack.push(Integer.parseInt(s));\n break;\n }\n }\n\n while(!stack.isEmpty())\n buf += stack.pop();\n \n System.out.println(buf);\n }\n }",
"try(BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {\n\n String[] line = br.readLine().split(\" \");\n int buf = 0;\n Stack stack = new Stack(line.length);\n\n for (String s : line) {\n switch(s) {\n case \"+\" :\n buf += stack.pop();\n buf += stack.pop();\n stack.push(buf);\n buf = 0;\n break;\n\n case \"-\" :\n buf -= stack.pop();\n buf += stack.pop();\n stack.push(buf);\n buf = 0;\n break;\n\n case \"*\" :\n buf = stack.pop();\n buf *= stack.pop();\n stack.push(buf);\n buf = 0;\n break;\n\n default :\n stack.push(Integer.parseInt(s));\n break;\n }\n }\n\n while(!stack.isEmpty())\n buf += stack.pop();\n \n System.out.println(buf);\n }",
"{\n\n String[] line = br.readLine().split(\" \");\n int buf = 0;\n Stack stack = new Stack(line.length);\n\n for (String s : line) {\n switch(s) {\n case \"+\" :\n buf += stack.pop();\n buf += stack.pop();\n stack.push(buf);\n buf = 0;\n break;\n\n case \"-\" :\n buf -= stack.pop();\n buf += stack.pop();\n stack.push(buf);\n buf = 0;\n break;\n\n case \"*\" :\n buf = stack.pop();\n buf *= stack.pop();\n stack.push(buf);\n buf = 0;\n break;\n\n default :\n stack.push(Integer.parseInt(s));\n break;\n }\n }\n\n while(!stack.isEmpty())\n buf += stack.pop();\n \n System.out.println(buf);\n }",
"BufferedReader br = new BufferedReader(new InputStreamReader(System.in))",
"BufferedReader br = new BufferedReader(new InputStreamReader(System.in))",
"new BufferedReader(new InputStreamReader(System.in))",
"String[] line = br.readLine().split(\" \");",
"line",
"br.readLine().split(\" \")",
"br.readLine().split",
"br.readLine()",
"br.readLine",
"br",
"\" \"",
"int buf = 0;",
"buf",
"0",
"Stack stack = new Stack(line.length);",
"stack",
"new Stack(line.length)",
"for (String s : line) {\n switch(s) {\n case \"+\" :\n buf += stack.pop();\n buf += stack.pop();\n stack.push(buf);\n buf = 0;\n break;\n\n case \"-\" :\n buf -= stack.pop();\n buf += stack.pop();\n stack.push(buf);\n buf = 0;\n break;\n\n case \"*\" :\n buf = stack.pop();\n buf *= stack.pop();\n stack.push(buf);\n buf = 0;\n break;\n\n default :\n stack.push(Integer.parseInt(s));\n break;\n }\n }",
"String s",
"line",
"{\n switch(s) {\n case \"+\" :\n buf += stack.pop();\n buf += stack.pop();\n stack.push(buf);\n buf = 0;\n break;\n\n case \"-\" :\n buf -= stack.pop();\n buf += stack.pop();\n stack.push(buf);\n buf = 0;\n break;\n\n case \"*\" :\n buf = stack.pop();\n buf *= stack.pop();\n stack.push(buf);\n buf = 0;\n break;\n\n default :\n stack.push(Integer.parseInt(s));\n break;\n }\n }",
"{\n switch(s) {\n case \"+\" :\n buf += stack.pop();\n buf += stack.pop();\n stack.push(buf);\n buf = 0;\n break;\n\n case \"-\" :\n buf -= stack.pop();\n buf += stack.pop();\n stack.push(buf);\n buf = 0;\n break;\n\n case \"*\" :\n buf = stack.pop();\n buf *= stack.pop();\n stack.push(buf);\n buf = 0;\n break;\n\n default :\n stack.push(Integer.parseInt(s));\n break;\n }\n }",
"switch(s) {\n case \"+\" :\n buf += stack.pop();\n buf += stack.pop();\n stack.push(buf);\n buf = 0;\n break;\n\n case \"-\" :\n buf -= stack.pop();\n buf += stack.pop();\n stack.push(buf);\n buf = 0;\n break;\n\n case \"*\" :\n buf = stack.pop();\n buf *= stack.pop();\n stack.push(buf);\n buf = 0;\n break;\n\n default :\n stack.push(Integer.parseInt(s));\n break;\n }",
"s",
"case \"+\" :",
"\"+\"",
"case \"+\" :",
"buf += stack.pop()",
"buf",
"stack.pop()",
"stack.pop",
"stack",
"buf += stack.pop()",
"buf",
"stack.pop()",
"stack.pop",
"stack",
"stack.push(buf)",
"stack.push",
"stack",
"buf",
"buf = 0",
"buf",
"0",
"break;",
"case \"-\" :",
"\"-\"",
"case \"-\" :",
"buf -= stack.pop()",
"buf",
"stack.pop()",
"stack.pop",
"stack",
"buf += stack.pop()",
"buf",
"stack.pop()",
"stack.pop",
"stack",
"stack.push(buf)",
"stack.push",
"stack",
"buf",
"buf = 0",
"buf",
"0",
"break;",
"case \"*\" :",
"\"*\"",
"case \"*\" :",
"buf = stack.pop()",
"buf",
"stack.pop()",
"stack.pop",
"stack",
"buf *= stack.pop()",
"buf",
"stack.pop()",
"stack.pop",
"stack",
"stack.push(buf)",
"stack.push",
"stack",
"buf",
"buf = 0",
"buf",
"0",
"break;",
"default :",
"default :",
"stack.push(Integer.parseInt(s))",
"stack.push",
"stack",
"Integer.parseInt(s)",
"Integer.parseInt",
"Integer",
"s",
"break;",
"while(!stack.isEmpty())\n buf += stack.pop();",
"!stack.isEmpty()",
"stack.isEmpty()",
"stack.isEmpty",
"stack",
"buf += stack.pop()",
"buf",
"stack.pop()",
"stack.pop",
"stack",
"System.out.println(buf)",
"System.out.println",
"System.out",
"System",
"System.out",
"buf",
"String[] args",
"args",
"class Stack {\n int[] stack;\n int ite;\n\n public Stack(int capacity) {\n stack = new int[capacity];\n ite = 0;\n }\n\n public void initialize() {\n ite = 0;\n }\n\n public int getIte() {\n return ite;\n }\n\n public boolean isEmpty() {\n return ite == 0;\n }\n\n public boolean isFull() {\n return ite >= stack.length-1;\n }\n\n public boolean push(int x) {\n if(isFull()) return false;\n\n stack[++ite] = x;\n return true;\n }\n\n public int pop() {\n if(isEmpty()) return 0;\n\n return stack[ite--];\n\n }\n}",
"Stack",
"int[] stack;",
"stack",
"int ite;",
"ite",
"public Stack(int capacity) {\n stack = new int[capacity];\n ite = 0;\n }",
"Stack",
"{\n stack = new int[capacity];\n ite = 0;\n }",
"stack = new int[capacity]",
"stack",
"new int[capacity]",
"capacity",
"ite = 0",
"ite",
"0",
"int capacity",
"capacity",
"public void initialize() {\n ite = 0;\n }",
"initialize",
"{\n ite = 0;\n }",
"ite = 0",
"ite",
"0",
"public int getIte() {\n return ite;\n }",
"getIte",
"{\n return ite;\n }",
"return ite;",
"ite",
"public boolean isEmpty() {\n return ite == 0;\n }",
"isEmpty",
"{\n return ite == 0;\n }",
"return ite == 0;",
"ite == 0",
"ite",
"0",
"public boolean isFull() {\n return ite >= stack.length-1;\n }",
"isFull",
"{\n return ite >= stack.length-1;\n }",
"return ite >= stack.length-1;",
"ite >= stack.length-1",
"ite",
"stack.length-1",
"stack.length",
"stack",
"stack.length",
"1",
"public boolean push(int x) {\n if(isFull()) return false;\n\n stack[++ite] = x;\n return true;\n }",
"push",
"{\n if(isFull()) return false;\n\n stack[++ite] = x;\n return true;\n }",
"if(isFull()) return false;",
"isFull()",
"isFull",
"return false;",
"false",
"stack[++ite] = x",
"stack[++ite]",
"stack",
"++ite",
"ite",
"x",
"return true;",
"true",
"int x",
"x",
"public int pop() {\n if(isEmpty()) return 0;\n\n return stack[ite--];\n\n }",
"pop",
"{\n if(isEmpty()) return 0;\n\n return stack[ite--];\n\n }",
"if(isEmpty()) return 0;",
"isEmpty()",
"isEmpty",
"return 0;",
"0",
"return stack[ite--];",
"stack[ite--]",
"stack",
"ite--",
"ite",
"public class Main {\n\n public static void main(String[] args) throws IOException {\n \n try(BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {\n\n String[] line = br.readLine().split(\" \");\n int buf = 0;\n Stack stack = new Stack(line.length);\n\n for (String s : line) {\n switch(s) {\n case \"+\" :\n buf += stack.pop();\n buf += stack.pop();\n stack.push(buf);\n buf = 0;\n break;\n\n case \"-\" :\n buf -= stack.pop();\n buf += stack.pop();\n stack.push(buf);\n buf = 0;\n break;\n\n case \"*\" :\n buf = stack.pop();\n buf *= stack.pop();\n stack.push(buf);\n buf = 0;\n break;\n\n default :\n stack.push(Integer.parseInt(s));\n break;\n }\n }\n\n while(!stack.isEmpty())\n buf += stack.pop();\n \n System.out.println(buf);\n }\n }\n}",
"public class Main {\n\n public static void main(String[] args) throws IOException {\n \n try(BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {\n\n String[] line = br.readLine().split(\" \");\n int buf = 0;\n Stack stack = new Stack(line.length);\n\n for (String s : line) {\n switch(s) {\n case \"+\" :\n buf += stack.pop();\n buf += stack.pop();\n stack.push(buf);\n buf = 0;\n break;\n\n case \"-\" :\n buf -= stack.pop();\n buf += stack.pop();\n stack.push(buf);\n buf = 0;\n break;\n\n case \"*\" :\n buf = stack.pop();\n buf *= stack.pop();\n stack.push(buf);\n buf = 0;\n break;\n\n default :\n stack.push(Integer.parseInt(s));\n break;\n }\n }\n\n while(!stack.isEmpty())\n buf += stack.pop();\n \n System.out.println(buf);\n }\n }\n}",
"Main"
] | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Main {
public static void main(String[] args) throws IOException {
try(BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {
String[] line = br.readLine().split(" ");
int buf = 0;
Stack stack = new Stack(line.length);
for (String s : line) {
switch(s) {
case "+" :
buf += stack.pop();
buf += stack.pop();
stack.push(buf);
buf = 0;
break;
case "-" :
buf -= stack.pop();
buf += stack.pop();
stack.push(buf);
buf = 0;
break;
case "*" :
buf = stack.pop();
buf *= stack.pop();
stack.push(buf);
buf = 0;
break;
default :
stack.push(Integer.parseInt(s));
break;
}
}
while(!stack.isEmpty())
buf += stack.pop();
System.out.println(buf);
}
}
}
class Stack {
int[] stack;
int ite;
public Stack(int capacity) {
stack = new int[capacity];
ite = 0;
}
public void initialize() {
ite = 0;
}
public int getIte() {
return ite;
}
public boolean isEmpty() {
return ite == 0;
}
public boolean isFull() {
return ite >= stack.length-1;
}
public boolean push(int x) {
if(isFull()) return false;
stack[++ite] = x;
return true;
}
public int pop() {
if(isEmpty()) return 0;
return stack[ite--];
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
20,
41,
13,
20,
41,
13,
17,
38,
5,
13,
30,
4,
18,
13,
30,
0,
13,
4,
18,
13,
41,
13,
4,
18,
13,
17,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
30,
14,
4,
18,
17,
18,
13,
13,
30,
41,
13,
4,
18,
13,
4,
18,
13,
41,
13,
4,
18,
13,
4,
18,
13,
4,
18,
13,
4,
18,
13,
2,
13,
13,
14,
4,
18,
17,
18,
13,
13,
30,
41,
13,
4,
18,
13,
4,
18,
13,
41,
13,
4,
18,
13,
4,
18,
13,
4,
18,
13,
4,
18,
13,
2,
13,
13,
14,
4,
18,
17,
18,
13,
13,
30,
41,
13,
4,
18,
13,
4,
18,
13,
41,
13,
4,
18,
13,
4,
18,
13,
4,
18,
13,
4,
18,
13,
2,
13,
13,
30,
4,
18,
13,
18,
13,
13,
4,
18,
18,
13,
13,
4,
18,
13,
4,
18,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
10,
11
],
[
10,
12
],
[
0,
13
],
[
13,
14
],
[
13,
15
],
[
0,
16
],
[
187,
17
],
[
187,
18
],
[
18,
19
],
[
18,
20
],
[
20,
21
],
[
21,
22
],
[
21,
23
],
[
20,
24
],
[
24,
25
],
[
24,
26
],
[
20,
27
],
[
27,
28
],
[
27,
29
],
[
20,
30
],
[
30,
31
],
[
30,
32
],
[
20,
33
],
[
33,
34
],
[
34,
35
],
[
34,
36
],
[
36,
37
],
[
37,
38
],
[
38,
39
],
[
33,
40
],
[
40,
41
],
[
41,
42
],
[
41,
43
],
[
43,
44
],
[
44,
45
],
[
20,
46
],
[
46,
47
],
[
46,
48
],
[
48,
49
],
[
49,
50
],
[
48,
51
],
[
20,
52
],
[
52,
53
],
[
53,
54
],
[
54,
55
],
[
54,
56
],
[
52,
57
],
[
57,
58
],
[
57,
59
],
[
59,
60
],
[
59,
61
],
[
52,
62
],
[
62,
63
],
[
63,
64
],
[
52,
65
],
[
66,
66
],
[
66,
67
],
[
67,
68
],
[
68,
69
],
[
69,
70
],
[
68,
71
],
[
71,
72
],
[
71,
73
],
[
67,
74
],
[
74,
75
],
[
75,
76
],
[
75,
77
],
[
77,
78
],
[
78,
79
],
[
77,
80
],
[
80,
81
],
[
81,
82
],
[
74,
83
],
[
83,
84
],
[
83,
85
],
[
85,
86
],
[
86,
87
],
[
85,
88
],
[
88,
89
],
[
89,
90
],
[
74,
91
],
[
91,
92
],
[
92,
93
],
[
91,
94
],
[
94,
95
],
[
95,
96
],
[
94,
97
],
[
97,
98
],
[
97,
99
],
[
67,
100
],
[
100,
101
],
[
101,
102
],
[
102,
103
],
[
101,
104
],
[
104,
105
],
[
104,
106
],
[
100,
107
],
[
107,
108
],
[
108,
109
],
[
108,
110
],
[
110,
111
],
[
111,
112
],
[
110,
113
],
[
113,
114
],
[
114,
115
],
[
107,
116
],
[
116,
117
],
[
116,
118
],
[
118,
119
],
[
119,
120
],
[
118,
121
],
[
121,
122
],
[
122,
123
],
[
107,
124
],
[
124,
125
],
[
125,
126
],
[
124,
127
],
[
127,
128
],
[
128,
129
],
[
127,
130
],
[
130,
131
],
[
130,
132
],
[
100,
133
],
[
133,
134
],
[
134,
135
],
[
135,
136
],
[
134,
137
],
[
137,
138
],
[
137,
139
],
[
133,
140
],
[
140,
141
],
[
141,
142
],
[
141,
143
],
[
143,
144
],
[
144,
145
],
[
143,
146
],
[
146,
147
],
[
147,
148
],
[
140,
149
],
[
149,
150
],
[
149,
151
],
[
151,
152
],
[
152,
153
],
[
151,
154
],
[
154,
155
],
[
155,
156
],
[
140,
157
],
[
157,
158
],
[
158,
159
],
[
157,
160
],
[
160,
161
],
[
161,
162
],
[
160,
163
],
[
163,
164
],
[
163,
165
],
[
133,
166
],
[
166,
167
],
[
167,
168
],
[
168,
169
],
[
167,
170
],
[
170,
171
],
[
170,
172
],
[
20,
173
],
[
173,
174
],
[
174,
175
],
[
175,
176
],
[
175,
177
],
[
173,
178
],
[
178,
179
],
[
179,
180
],
[
20,
181
],
[
181,
182
],
[
182,
183
],
[
18,
184
],
[
184,
185
],
[
0,
186
],
[
186,
187
],
[
186,
188
]
] | [
"import java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\nimport java.util.Scanner;\nimport java.util.Stack;\n\npublic class Main\n{\n public static void main(String[] args)\n {\n Scanner scan = new Scanner(System.in);\n Stack<String> stack = new Stack<String>();\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\n String line = \"\";\n try\n {\n line = br.readLine();\n }\n catch (IOException e)\n {\n e.printStackTrace();\n }\n\n String[] s = line.split(\" \");\n\n for (int i = 0; i < s.length; i++)\n {\n if (\"+\".equals(s[i]))\n {\n int op1 = Integer.parseInt(stack.pop());\n int op2 = Integer.parseInt(stack.pop());\n stack.push(Integer.toString((op1 + op2)));\n }\n else if (\"-\".equals(s[i]))\n {\n int op1 = Integer.parseInt(stack.pop());\n int op2 = Integer.parseInt(stack.pop());\n stack.push(Integer.toString((op2 - op1)));\n }\n else if (\"*\".equals(s[i]))\n {\n int op1 = Integer.parseInt(stack.pop());\n int op2 = Integer.parseInt(stack.pop());\n stack.push(Integer.toString((op1 * op2)));\n }\n else\n {\n stack.push(s[i]);\n }\n }\n\n System.out.println(stack.pop());\n scan.close();\n }\n\n}",
"import java.io.BufferedReader;",
"BufferedReader",
"java.io",
"import java.io.IOException;",
"IOException",
"java.io",
"import java.io.InputStreamReader;",
"InputStreamReader",
"java.io",
"import java.util.Scanner;",
"Scanner",
"java.util",
"import java.util.Stack;",
"Stack",
"java.util",
"public class Main\n{\n public static void main(String[] args)\n {\n Scanner scan = new Scanner(System.in);\n Stack<String> stack = new Stack<String>();\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\n String line = \"\";\n try\n {\n line = br.readLine();\n }\n catch (IOException e)\n {\n e.printStackTrace();\n }\n\n String[] s = line.split(\" \");\n\n for (int i = 0; i < s.length; i++)\n {\n if (\"+\".equals(s[i]))\n {\n int op1 = Integer.parseInt(stack.pop());\n int op2 = Integer.parseInt(stack.pop());\n stack.push(Integer.toString((op1 + op2)));\n }\n else if (\"-\".equals(s[i]))\n {\n int op1 = Integer.parseInt(stack.pop());\n int op2 = Integer.parseInt(stack.pop());\n stack.push(Integer.toString((op2 - op1)));\n }\n else if (\"*\".equals(s[i]))\n {\n int op1 = Integer.parseInt(stack.pop());\n int op2 = Integer.parseInt(stack.pop());\n stack.push(Integer.toString((op1 * op2)));\n }\n else\n {\n stack.push(s[i]);\n }\n }\n\n System.out.println(stack.pop());\n scan.close();\n }\n\n}",
"Main",
"public static void main(String[] args)\n {\n Scanner scan = new Scanner(System.in);\n Stack<String> stack = new Stack<String>();\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\n String line = \"\";\n try\n {\n line = br.readLine();\n }\n catch (IOException e)\n {\n e.printStackTrace();\n }\n\n String[] s = line.split(\" \");\n\n for (int i = 0; i < s.length; i++)\n {\n if (\"+\".equals(s[i]))\n {\n int op1 = Integer.parseInt(stack.pop());\n int op2 = Integer.parseInt(stack.pop());\n stack.push(Integer.toString((op1 + op2)));\n }\n else if (\"-\".equals(s[i]))\n {\n int op1 = Integer.parseInt(stack.pop());\n int op2 = Integer.parseInt(stack.pop());\n stack.push(Integer.toString((op2 - op1)));\n }\n else if (\"*\".equals(s[i]))\n {\n int op1 = Integer.parseInt(stack.pop());\n int op2 = Integer.parseInt(stack.pop());\n stack.push(Integer.toString((op1 * op2)));\n }\n else\n {\n stack.push(s[i]);\n }\n }\n\n System.out.println(stack.pop());\n scan.close();\n }",
"main",
"{\n Scanner scan = new Scanner(System.in);\n Stack<String> stack = new Stack<String>();\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\n String line = \"\";\n try\n {\n line = br.readLine();\n }\n catch (IOException e)\n {\n e.printStackTrace();\n }\n\n String[] s = line.split(\" \");\n\n for (int i = 0; i < s.length; i++)\n {\n if (\"+\".equals(s[i]))\n {\n int op1 = Integer.parseInt(stack.pop());\n int op2 = Integer.parseInt(stack.pop());\n stack.push(Integer.toString((op1 + op2)));\n }\n else if (\"-\".equals(s[i]))\n {\n int op1 = Integer.parseInt(stack.pop());\n int op2 = Integer.parseInt(stack.pop());\n stack.push(Integer.toString((op2 - op1)));\n }\n else if (\"*\".equals(s[i]))\n {\n int op1 = Integer.parseInt(stack.pop());\n int op2 = Integer.parseInt(stack.pop());\n stack.push(Integer.toString((op1 * op2)));\n }\n else\n {\n stack.push(s[i]);\n }\n }\n\n System.out.println(stack.pop());\n scan.close();\n }",
"Scanner scan = new Scanner(System.in);",
"scan",
"new Scanner(System.in)",
"Stack<String> stack = new Stack<String>();",
"stack",
"new Stack<String>()",
"BufferedReader br = new BufferedReader(new InputStreamReader(System.in));",
"br",
"new BufferedReader(new InputStreamReader(System.in))",
"String line = \"\";",
"line",
"\"\"",
"try\n {\n line = br.readLine();\n }\n catch (IOException e)\n {\n e.printStackTrace();\n }",
"catch (IOException e)\n {\n e.printStackTrace();\n }",
"IOException e",
"{\n e.printStackTrace();\n }",
"e.printStackTrace()",
"e.printStackTrace",
"e",
"{\n line = br.readLine();\n }",
"line = br.readLine()",
"line",
"br.readLine()",
"br.readLine",
"br",
"String[] s = line.split(\" \");",
"s",
"line.split(\" \")",
"line.split",
"line",
"\" \"",
"for (int i = 0; i < s.length; i++)\n {\n if (\"+\".equals(s[i]))\n {\n int op1 = Integer.parseInt(stack.pop());\n int op2 = Integer.parseInt(stack.pop());\n stack.push(Integer.toString((op1 + op2)));\n }\n else if (\"-\".equals(s[i]))\n {\n int op1 = Integer.parseInt(stack.pop());\n int op2 = Integer.parseInt(stack.pop());\n stack.push(Integer.toString((op2 - op1)));\n }\n else if (\"*\".equals(s[i]))\n {\n int op1 = Integer.parseInt(stack.pop());\n int op2 = Integer.parseInt(stack.pop());\n stack.push(Integer.toString((op1 * op2)));\n }\n else\n {\n stack.push(s[i]);\n }\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < s.length",
"i",
"s.length",
"s",
"s.length",
"i++",
"i++",
"i",
"{\n if (\"+\".equals(s[i]))\n {\n int op1 = Integer.parseInt(stack.pop());\n int op2 = Integer.parseInt(stack.pop());\n stack.push(Integer.toString((op1 + op2)));\n }\n else if (\"-\".equals(s[i]))\n {\n int op1 = Integer.parseInt(stack.pop());\n int op2 = Integer.parseInt(stack.pop());\n stack.push(Integer.toString((op2 - op1)));\n }\n else if (\"*\".equals(s[i]))\n {\n int op1 = Integer.parseInt(stack.pop());\n int op2 = Integer.parseInt(stack.pop());\n stack.push(Integer.toString((op1 * op2)));\n }\n else\n {\n stack.push(s[i]);\n }\n }",
"{\n if (\"+\".equals(s[i]))\n {\n int op1 = Integer.parseInt(stack.pop());\n int op2 = Integer.parseInt(stack.pop());\n stack.push(Integer.toString((op1 + op2)));\n }\n else if (\"-\".equals(s[i]))\n {\n int op1 = Integer.parseInt(stack.pop());\n int op2 = Integer.parseInt(stack.pop());\n stack.push(Integer.toString((op2 - op1)));\n }\n else if (\"*\".equals(s[i]))\n {\n int op1 = Integer.parseInt(stack.pop());\n int op2 = Integer.parseInt(stack.pop());\n stack.push(Integer.toString((op1 * op2)));\n }\n else\n {\n stack.push(s[i]);\n }\n }",
"if (\"+\".equals(s[i]))\n {\n int op1 = Integer.parseInt(stack.pop());\n int op2 = Integer.parseInt(stack.pop());\n stack.push(Integer.toString((op1 + op2)));\n }\n else if (\"-\".equals(s[i]))\n {\n int op1 = Integer.parseInt(stack.pop());\n int op2 = Integer.parseInt(stack.pop());\n stack.push(Integer.toString((op2 - op1)));\n }\n else if (\"*\".equals(s[i]))\n {\n int op1 = Integer.parseInt(stack.pop());\n int op2 = Integer.parseInt(stack.pop());\n stack.push(Integer.toString((op1 * op2)));\n }\n else\n {\n stack.push(s[i]);\n }",
"\"+\".equals(s[i])",
"\"+\".equals",
"\"+\"",
"s[i]",
"s",
"i",
"{\n int op1 = Integer.parseInt(stack.pop());\n int op2 = Integer.parseInt(stack.pop());\n stack.push(Integer.toString((op1 + op2)));\n }",
"int op1 = Integer.parseInt(stack.pop());",
"op1",
"Integer.parseInt(stack.pop())",
"Integer.parseInt",
"Integer",
"stack.pop()",
"stack.pop",
"stack",
"int op2 = Integer.parseInt(stack.pop());",
"op2",
"Integer.parseInt(stack.pop())",
"Integer.parseInt",
"Integer",
"stack.pop()",
"stack.pop",
"stack",
"stack.push(Integer.toString((op1 + op2)))",
"stack.push",
"stack",
"Integer.toString((op1 + op2))",
"Integer.toString",
"Integer",
"(op1 + op2)",
"op1",
"op2",
"if (\"-\".equals(s[i]))\n {\n int op1 = Integer.parseInt(stack.pop());\n int op2 = Integer.parseInt(stack.pop());\n stack.push(Integer.toString((op2 - op1)));\n }\n else if (\"*\".equals(s[i]))\n {\n int op1 = Integer.parseInt(stack.pop());\n int op2 = Integer.parseInt(stack.pop());\n stack.push(Integer.toString((op1 * op2)));\n }\n else\n {\n stack.push(s[i]);\n }",
"\"-\".equals(s[i])",
"\"-\".equals",
"\"-\"",
"s[i]",
"s",
"i",
"{\n int op1 = Integer.parseInt(stack.pop());\n int op2 = Integer.parseInt(stack.pop());\n stack.push(Integer.toString((op2 - op1)));\n }",
"int op1 = Integer.parseInt(stack.pop());",
"op1",
"Integer.parseInt(stack.pop())",
"Integer.parseInt",
"Integer",
"stack.pop()",
"stack.pop",
"stack",
"int op2 = Integer.parseInt(stack.pop());",
"op2",
"Integer.parseInt(stack.pop())",
"Integer.parseInt",
"Integer",
"stack.pop()",
"stack.pop",
"stack",
"stack.push(Integer.toString((op2 - op1)))",
"stack.push",
"stack",
"Integer.toString((op2 - op1))",
"Integer.toString",
"Integer",
"(op2 - op1)",
"op2",
"op1",
"if (\"*\".equals(s[i]))\n {\n int op1 = Integer.parseInt(stack.pop());\n int op2 = Integer.parseInt(stack.pop());\n stack.push(Integer.toString((op1 * op2)));\n }\n else\n {\n stack.push(s[i]);\n }",
"\"*\".equals(s[i])",
"\"*\".equals",
"\"*\"",
"s[i]",
"s",
"i",
"{\n int op1 = Integer.parseInt(stack.pop());\n int op2 = Integer.parseInt(stack.pop());\n stack.push(Integer.toString((op1 * op2)));\n }",
"int op1 = Integer.parseInt(stack.pop());",
"op1",
"Integer.parseInt(stack.pop())",
"Integer.parseInt",
"Integer",
"stack.pop()",
"stack.pop",
"stack",
"int op2 = Integer.parseInt(stack.pop());",
"op2",
"Integer.parseInt(stack.pop())",
"Integer.parseInt",
"Integer",
"stack.pop()",
"stack.pop",
"stack",
"stack.push(Integer.toString((op1 * op2)))",
"stack.push",
"stack",
"Integer.toString((op1 * op2))",
"Integer.toString",
"Integer",
"(op1 * op2)",
"op1",
"op2",
"{\n stack.push(s[i]);\n }",
"stack.push(s[i])",
"stack.push",
"stack",
"s[i]",
"s",
"i",
"System.out.println(stack.pop())",
"System.out.println",
"System.out",
"System",
"System.out",
"stack.pop()",
"stack.pop",
"stack",
"scan.close()",
"scan.close",
"scan",
"String[] args",
"args",
"public class Main\n{\n public static void main(String[] args)\n {\n Scanner scan = new Scanner(System.in);\n Stack<String> stack = new Stack<String>();\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\n String line = \"\";\n try\n {\n line = br.readLine();\n }\n catch (IOException e)\n {\n e.printStackTrace();\n }\n\n String[] s = line.split(\" \");\n\n for (int i = 0; i < s.length; i++)\n {\n if (\"+\".equals(s[i]))\n {\n int op1 = Integer.parseInt(stack.pop());\n int op2 = Integer.parseInt(stack.pop());\n stack.push(Integer.toString((op1 + op2)));\n }\n else if (\"-\".equals(s[i]))\n {\n int op1 = Integer.parseInt(stack.pop());\n int op2 = Integer.parseInt(stack.pop());\n stack.push(Integer.toString((op2 - op1)));\n }\n else if (\"*\".equals(s[i]))\n {\n int op1 = Integer.parseInt(stack.pop());\n int op2 = Integer.parseInt(stack.pop());\n stack.push(Integer.toString((op1 * op2)));\n }\n else\n {\n stack.push(s[i]);\n }\n }\n\n System.out.println(stack.pop());\n scan.close();\n }\n\n}",
"public class Main\n{\n public static void main(String[] args)\n {\n Scanner scan = new Scanner(System.in);\n Stack<String> stack = new Stack<String>();\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\n String line = \"\";\n try\n {\n line = br.readLine();\n }\n catch (IOException e)\n {\n e.printStackTrace();\n }\n\n String[] s = line.split(\" \");\n\n for (int i = 0; i < s.length; i++)\n {\n if (\"+\".equals(s[i]))\n {\n int op1 = Integer.parseInt(stack.pop());\n int op2 = Integer.parseInt(stack.pop());\n stack.push(Integer.toString((op1 + op2)));\n }\n else if (\"-\".equals(s[i]))\n {\n int op1 = Integer.parseInt(stack.pop());\n int op2 = Integer.parseInt(stack.pop());\n stack.push(Integer.toString((op2 - op1)));\n }\n else if (\"*\".equals(s[i]))\n {\n int op1 = Integer.parseInt(stack.pop());\n int op2 = Integer.parseInt(stack.pop());\n stack.push(Integer.toString((op1 * op2)));\n }\n else\n {\n stack.push(s[i]);\n }\n }\n\n System.out.println(stack.pop());\n scan.close();\n }\n\n}",
"Main"
] | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Scanner;
import java.util.Stack;
public class Main
{
public static void main(String[] args)
{
Scanner scan = new Scanner(System.in);
Stack<String> stack = new Stack<String>();
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String line = "";
try
{
line = br.readLine();
}
catch (IOException e)
{
e.printStackTrace();
}
String[] s = line.split(" ");
for (int i = 0; i < s.length; i++)
{
if ("+".equals(s[i]))
{
int op1 = Integer.parseInt(stack.pop());
int op2 = Integer.parseInt(stack.pop());
stack.push(Integer.toString((op1 + op2)));
}
else if ("-".equals(s[i]))
{
int op1 = Integer.parseInt(stack.pop());
int op2 = Integer.parseInt(stack.pop());
stack.push(Integer.toString((op2 - op1)));
}
else if ("*".equals(s[i]))
{
int op1 = Integer.parseInt(stack.pop());
int op2 = Integer.parseInt(stack.pop());
stack.push(Integer.toString((op1 * op2)));
}
else
{
stack.push(s[i]);
}
}
System.out.println(stack.pop());
scan.close();
}
} |
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
41,
13,
20,
12,
13,
30,
4,
18,
20,
23,
13,
12,
13,
30,
41,
13,
20,
41,
13,
20,
4,
18,
13,
4,
13,
4,
18,
13,
17,
4,
18,
13,
12,
13,
30,
41,
13,
17,
28,
13,
13,
30,
30,
35,
4,
18,
13,
17,
34,
17,
30,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
0,
13,
4,
18,
13,
2,
13,
13,
3,
34,
17,
30,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
0,
13,
4,
18,
13,
2,
13,
13,
3,
34,
17,
30,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
0,
13,
4,
18,
13,
2,
13,
13,
3,
34,
30,
30,
4,
18,
13,
4,
18,
13,
13,
29,
13,
23,
13,
6,
13,
41,
13,
17,
41,
13,
20,
13,
41,
13,
17,
12,
13,
30,
29,
2,
13,
17,
12,
13,
30,
29,
2,
13,
13,
12,
13,
30,
14,
4,
13,
37,
20,
29,
18,
13,
40,
13,
12,
13,
30,
14,
4,
13,
37,
20,
29,
0,
18,
13,
40,
13,
13,
23,
13,
6,
13,
41,
13,
20,
12,
13,
30,
29,
4,
18,
4,
18,
13,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
10,
11
],
[
10,
12
],
[
0,
13
],
[
220,
14
],
[
220,
15
],
[
15,
16
],
[
15,
17
],
[
220,
18
],
[
18,
19
],
[
18,
20
],
[
20,
21
],
[
21,
22
],
[
22,
23
],
[
18,
24
],
[
24,
25
],
[
220,
26
],
[
26,
27
],
[
26,
28
],
[
28,
29
],
[
29,
30
],
[
29,
31
],
[
28,
32
],
[
32,
33
],
[
32,
34
],
[
28,
35
],
[
35,
36
],
[
36,
37
],
[
35,
38
],
[
38,
39
],
[
38,
40
],
[
40,
41
],
[
41,
42
],
[
40,
43
],
[
28,
44
],
[
44,
45
],
[
45,
46
],
[
220,
47
],
[
47,
48
],
[
47,
49
],
[
49,
50
],
[
50,
51
],
[
50,
52
],
[
49,
53
],
[
53,
54
],
[
53,
55
],
[
53,
56
],
[
57,
57
],
[
57,
58
],
[
58,
59
],
[
59,
60
],
[
60,
61
],
[
59,
62
],
[
58,
63
],
[
63,
64
],
[
63,
65
],
[
65,
66
],
[
66,
67
],
[
67,
68
],
[
67,
69
],
[
69,
70
],
[
70,
71
],
[
66,
72
],
[
72,
73
],
[
72,
74
],
[
74,
75
],
[
75,
76
],
[
66,
77
],
[
77,
78
],
[
77,
79
],
[
79,
80
],
[
80,
81
],
[
79,
82
],
[
82,
83
],
[
82,
84
],
[
66,
85
],
[
58,
86
],
[
86,
87
],
[
86,
88
],
[
88,
89
],
[
89,
90
],
[
90,
91
],
[
90,
92
],
[
92,
93
],
[
93,
94
],
[
89,
95
],
[
95,
96
],
[
95,
97
],
[
97,
98
],
[
98,
99
],
[
89,
100
],
[
100,
101
],
[
100,
102
],
[
102,
103
],
[
103,
104
],
[
102,
105
],
[
105,
106
],
[
105,
107
],
[
89,
108
],
[
58,
109
],
[
109,
110
],
[
109,
111
],
[
111,
112
],
[
112,
113
],
[
113,
114
],
[
113,
115
],
[
115,
116
],
[
116,
117
],
[
112,
118
],
[
118,
119
],
[
118,
120
],
[
120,
121
],
[
121,
122
],
[
112,
123
],
[
123,
124
],
[
123,
125
],
[
125,
126
],
[
126,
127
],
[
125,
128
],
[
128,
129
],
[
128,
130
],
[
112,
131
],
[
58,
132
],
[
132,
133
],
[
133,
134
],
[
134,
135
],
[
135,
136
],
[
136,
137
],
[
135,
138
],
[
138,
139
],
[
139,
140
],
[
138,
141
],
[
49,
142
],
[
142,
143
],
[
47,
144
],
[
144,
145
],
[
0,
146
],
[
146,
147
],
[
146,
148
],
[
148,
149
],
[
148,
150
],
[
146,
151
],
[
151,
152
],
[
151,
153
],
[
146,
155
],
[
155,
156
],
[
155,
157
],
[
146,
158
],
[
158,
159
],
[
158,
160
],
[
160,
161
],
[
161,
162
],
[
162,
163
],
[
162,
164
],
[
146,
165
],
[
165,
166
],
[
165,
167
],
[
167,
168
],
[
168,
169
],
[
169,
170
],
[
169,
171
],
[
146,
172
],
[
172,
173
],
[
172,
174
],
[
174,
175
],
[
175,
176
],
[
176,
177
],
[
175,
178
],
[
178,
179
],
[
174,
180
],
[
180,
181
],
[
181,
182
],
[
181,
183
],
[
183,
184
],
[
146,
185
],
[
185,
186
],
[
185,
187
],
[
187,
188
],
[
188,
189
],
[
189,
190
],
[
188,
191
],
[
191,
192
],
[
187,
193
],
[
193,
194
],
[
194,
195
],
[
195,
196
],
[
195,
197
],
[
197,
198
],
[
194,
199
],
[
185,
200
],
[
200,
201
],
[
0,
202
],
[
202,
203
],
[
202,
204
],
[
204,
205
],
[
204,
206
],
[
202,
207
],
[
207,
208
],
[
207,
209
],
[
209,
210
],
[
210,
211
],
[
211,
212
],
[
212,
213
],
[
213,
214
],
[
214,
215
],
[
211,
216
],
[
207,
217
],
[
217,
218
],
[
0,
219
],
[
219,
220
],
[
219,
221
]
] | [
"import java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\nimport java.io.PrintWriter;\n \npublic class Main {\n\tprivate MyIntStack st = new MyIntStack();\n\n public static void main(String[] args) throws IOException {\n new Main().exec();\n }\n \n public void exec() throws IOException {\n \tSimpleInputUtil in = new SimpleInputUtil();\n PrintWriter out = new PrintWriter(System.out);\n out.println(calc(in.readStrArray(\" \")));\n out.flush();\n }\n\n private int calc(String[] exp) {\n \tint ret=0;\n \tfor(String s: exp) {\n \t\tswitch(s.charAt(0)){\n\t \t\tcase '+':{\n\t \t\t\tint b = st.pop();\n\t \t\t\tint a = st.pop();\n\t \t\t\tret = st.push(a + b);\n\t \t\t\tbreak;\n\t \t\t}\n\t \t\tcase '-':{\n\t \t\t\tint b = st.pop();\n\t \t\t\tint a = st.pop();\n\t \t\t\tret = st.push(a - b);\n\t \t\t\tbreak;\n\t \t\t}\n\t \t\tcase '*':{\n\t \t\t\tint b = st.pop();\n\t \t\t\tint a = st.pop();\n\t \t\t\tret = st.push(a * b);\n\t \t\t\tbreak;\n\t \t\t}\n\t \t\tdefault:{\n\t \t\t\tst.push(Integer.parseInt(s));\n\t \t\t}\n \t\t}\n \t}\n \treturn ret;\n }\n\n}\n\nclass MyIntStack {\n\tprivate static final int CAPACITY = 100;\n\tprivate int[] stack = new int[CAPACITY];\n private int head = 0;\n \n public boolean isEmpty(){return head == 0;}\n public boolean isFull(){return head == CAPACITY;}\n \n public int pop() {\n \tif(isEmpty()) throw new IllegalStateException();\n \treturn stack[--head];\n }\n \n public int push(int value) {\n \tif(isFull()) throw new IllegalStateException();\n \treturn stack[head++] = value;\n }\n}\n\nclass SimpleInputUtil {\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\n public String[] readStrArray(String delim) throws NumberFormatException, IOException{\n \treturn br.readLine().split(delim);\n }\n \n}",
"import java.io.BufferedReader;",
"BufferedReader",
"java.io",
"import java.io.IOException;",
"IOException",
"java.io",
"import java.io.InputStreamReader;",
"InputStreamReader",
"java.io",
"import java.io.PrintWriter;",
"PrintWriter",
"java.io",
"public class Main {\n\tprivate MyIntStack st = new MyIntStack();\n\n public static void main(String[] args) throws IOException {\n new Main().exec();\n }\n \n public void exec() throws IOException {\n \tSimpleInputUtil in = new SimpleInputUtil();\n PrintWriter out = new PrintWriter(System.out);\n out.println(calc(in.readStrArray(\" \")));\n out.flush();\n }\n\n private int calc(String[] exp) {\n \tint ret=0;\n \tfor(String s: exp) {\n \t\tswitch(s.charAt(0)){\n\t \t\tcase '+':{\n\t \t\t\tint b = st.pop();\n\t \t\t\tint a = st.pop();\n\t \t\t\tret = st.push(a + b);\n\t \t\t\tbreak;\n\t \t\t}\n\t \t\tcase '-':{\n\t \t\t\tint b = st.pop();\n\t \t\t\tint a = st.pop();\n\t \t\t\tret = st.push(a - b);\n\t \t\t\tbreak;\n\t \t\t}\n\t \t\tcase '*':{\n\t \t\t\tint b = st.pop();\n\t \t\t\tint a = st.pop();\n\t \t\t\tret = st.push(a * b);\n\t \t\t\tbreak;\n\t \t\t}\n\t \t\tdefault:{\n\t \t\t\tst.push(Integer.parseInt(s));\n\t \t\t}\n \t\t}\n \t}\n \treturn ret;\n }\n\n}",
"Main",
"private MyIntStack st = new MyIntStack();",
"st",
"new MyIntStack()",
"public static void main(String[] args) throws IOException {\n new Main().exec();\n }",
"main",
"{\n new Main().exec();\n }",
"new Main().exec()",
"new Main().exec",
"new Main()",
"String[] args",
"args",
"public void exec() throws IOException {\n \tSimpleInputUtil in = new SimpleInputUtil();\n PrintWriter out = new PrintWriter(System.out);\n out.println(calc(in.readStrArray(\" \")));\n out.flush();\n }",
"exec",
"{\n \tSimpleInputUtil in = new SimpleInputUtil();\n PrintWriter out = new PrintWriter(System.out);\n out.println(calc(in.readStrArray(\" \")));\n out.flush();\n }",
"SimpleInputUtil in = new SimpleInputUtil();",
"in",
"new SimpleInputUtil()",
"PrintWriter out = new PrintWriter(System.out);",
"out",
"new PrintWriter(System.out)",
"out.println(calc(in.readStrArray(\" \")))",
"out.println",
"out",
"calc(in.readStrArray(\" \"))",
"calc",
"in.readStrArray(\" \")",
"in.readStrArray",
"in",
"\" \"",
"out.flush()",
"out.flush",
"out",
"private int calc(String[] exp) {\n \tint ret=0;\n \tfor(String s: exp) {\n \t\tswitch(s.charAt(0)){\n\t \t\tcase '+':{\n\t \t\t\tint b = st.pop();\n\t \t\t\tint a = st.pop();\n\t \t\t\tret = st.push(a + b);\n\t \t\t\tbreak;\n\t \t\t}\n\t \t\tcase '-':{\n\t \t\t\tint b = st.pop();\n\t \t\t\tint a = st.pop();\n\t \t\t\tret = st.push(a - b);\n\t \t\t\tbreak;\n\t \t\t}\n\t \t\tcase '*':{\n\t \t\t\tint b = st.pop();\n\t \t\t\tint a = st.pop();\n\t \t\t\tret = st.push(a * b);\n\t \t\t\tbreak;\n\t \t\t}\n\t \t\tdefault:{\n\t \t\t\tst.push(Integer.parseInt(s));\n\t \t\t}\n \t\t}\n \t}\n \treturn ret;\n }",
"calc",
"{\n \tint ret=0;\n \tfor(String s: exp) {\n \t\tswitch(s.charAt(0)){\n\t \t\tcase '+':{\n\t \t\t\tint b = st.pop();\n\t \t\t\tint a = st.pop();\n\t \t\t\tret = st.push(a + b);\n\t \t\t\tbreak;\n\t \t\t}\n\t \t\tcase '-':{\n\t \t\t\tint b = st.pop();\n\t \t\t\tint a = st.pop();\n\t \t\t\tret = st.push(a - b);\n\t \t\t\tbreak;\n\t \t\t}\n\t \t\tcase '*':{\n\t \t\t\tint b = st.pop();\n\t \t\t\tint a = st.pop();\n\t \t\t\tret = st.push(a * b);\n\t \t\t\tbreak;\n\t \t\t}\n\t \t\tdefault:{\n\t \t\t\tst.push(Integer.parseInt(s));\n\t \t\t}\n \t\t}\n \t}\n \treturn ret;\n }",
"int ret=0;",
"ret",
"0",
"for(String s: exp) {\n \t\tswitch(s.charAt(0)){\n\t \t\tcase '+':{\n\t \t\t\tint b = st.pop();\n\t \t\t\tint a = st.pop();\n\t \t\t\tret = st.push(a + b);\n\t \t\t\tbreak;\n\t \t\t}\n\t \t\tcase '-':{\n\t \t\t\tint b = st.pop();\n\t \t\t\tint a = st.pop();\n\t \t\t\tret = st.push(a - b);\n\t \t\t\tbreak;\n\t \t\t}\n\t \t\tcase '*':{\n\t \t\t\tint b = st.pop();\n\t \t\t\tint a = st.pop();\n\t \t\t\tret = st.push(a * b);\n\t \t\t\tbreak;\n\t \t\t}\n\t \t\tdefault:{\n\t \t\t\tst.push(Integer.parseInt(s));\n\t \t\t}\n \t\t}\n \t}",
"String s",
"exp",
"{\n \t\tswitch(s.charAt(0)){\n\t \t\tcase '+':{\n\t \t\t\tint b = st.pop();\n\t \t\t\tint a = st.pop();\n\t \t\t\tret = st.push(a + b);\n\t \t\t\tbreak;\n\t \t\t}\n\t \t\tcase '-':{\n\t \t\t\tint b = st.pop();\n\t \t\t\tint a = st.pop();\n\t \t\t\tret = st.push(a - b);\n\t \t\t\tbreak;\n\t \t\t}\n\t \t\tcase '*':{\n\t \t\t\tint b = st.pop();\n\t \t\t\tint a = st.pop();\n\t \t\t\tret = st.push(a * b);\n\t \t\t\tbreak;\n\t \t\t}\n\t \t\tdefault:{\n\t \t\t\tst.push(Integer.parseInt(s));\n\t \t\t}\n \t\t}\n \t}",
"{\n \t\tswitch(s.charAt(0)){\n\t \t\tcase '+':{\n\t \t\t\tint b = st.pop();\n\t \t\t\tint a = st.pop();\n\t \t\t\tret = st.push(a + b);\n\t \t\t\tbreak;\n\t \t\t}\n\t \t\tcase '-':{\n\t \t\t\tint b = st.pop();\n\t \t\t\tint a = st.pop();\n\t \t\t\tret = st.push(a - b);\n\t \t\t\tbreak;\n\t \t\t}\n\t \t\tcase '*':{\n\t \t\t\tint b = st.pop();\n\t \t\t\tint a = st.pop();\n\t \t\t\tret = st.push(a * b);\n\t \t\t\tbreak;\n\t \t\t}\n\t \t\tdefault:{\n\t \t\t\tst.push(Integer.parseInt(s));\n\t \t\t}\n \t\t}\n \t}",
"switch(s.charAt(0)){\n\t \t\tcase '+':{\n\t \t\t\tint b = st.pop();\n\t \t\t\tint a = st.pop();\n\t \t\t\tret = st.push(a + b);\n\t \t\t\tbreak;\n\t \t\t}\n\t \t\tcase '-':{\n\t \t\t\tint b = st.pop();\n\t \t\t\tint a = st.pop();\n\t \t\t\tret = st.push(a - b);\n\t \t\t\tbreak;\n\t \t\t}\n\t \t\tcase '*':{\n\t \t\t\tint b = st.pop();\n\t \t\t\tint a = st.pop();\n\t \t\t\tret = st.push(a * b);\n\t \t\t\tbreak;\n\t \t\t}\n\t \t\tdefault:{\n\t \t\t\tst.push(Integer.parseInt(s));\n\t \t\t}\n \t\t}",
"s.charAt(0)",
"s.charAt",
"s",
"0",
"case '+':",
"'+'",
"case '+':",
"{\n\t \t\t\tint b = st.pop();\n\t \t\t\tint a = st.pop();\n\t \t\t\tret = st.push(a + b);\n\t \t\t\tbreak;\n\t \t\t}",
"int b = st.pop();",
"b",
"st.pop()",
"st.pop",
"st",
"int a = st.pop();",
"a",
"st.pop()",
"st.pop",
"st",
"ret = st.push(a + b)",
"ret",
"st.push(a + b)",
"st.push",
"st",
"a + b",
"a",
"b",
"break;",
"case '-':",
"'-'",
"case '-':",
"{\n\t \t\t\tint b = st.pop();\n\t \t\t\tint a = st.pop();\n\t \t\t\tret = st.push(a - b);\n\t \t\t\tbreak;\n\t \t\t}",
"int b = st.pop();",
"b",
"st.pop()",
"st.pop",
"st",
"int a = st.pop();",
"a",
"st.pop()",
"st.pop",
"st",
"ret = st.push(a - b)",
"ret",
"st.push(a - b)",
"st.push",
"st",
"a - b",
"a",
"b",
"break;",
"case '*':",
"'*'",
"case '*':",
"{\n\t \t\t\tint b = st.pop();\n\t \t\t\tint a = st.pop();\n\t \t\t\tret = st.push(a * b);\n\t \t\t\tbreak;\n\t \t\t}",
"int b = st.pop();",
"b",
"st.pop()",
"st.pop",
"st",
"int a = st.pop();",
"a",
"st.pop()",
"st.pop",
"st",
"ret = st.push(a * b)",
"ret",
"st.push(a * b)",
"st.push",
"st",
"a * b",
"a",
"b",
"break;",
"default:",
"default:",
"{\n\t \t\t\tst.push(Integer.parseInt(s));\n\t \t\t}",
"st.push(Integer.parseInt(s))",
"st.push",
"st",
"Integer.parseInt(s)",
"Integer.parseInt",
"Integer",
"s",
"return ret;",
"ret",
"String[] exp",
"exp",
"class MyIntStack {\n\tprivate static final int CAPACITY = 100;\n\tprivate int[] stack = new int[CAPACITY];\n private int head = 0;\n \n public boolean isEmpty(){return head == 0;}\n public boolean isFull(){return head == CAPACITY;}\n \n public int pop() {\n \tif(isEmpty()) throw new IllegalStateException();\n \treturn stack[--head];\n }\n \n public int push(int value) {\n \tif(isFull()) throw new IllegalStateException();\n \treturn stack[head++] = value;\n }\n}",
"MyIntStack",
"private static final int CAPACITY = 100;",
"CAPACITY",
"100",
"private int[] stack = new int[CAPACITY];",
"stack",
"new int[CAPACITY]",
"CAPACITY",
"private int head = 0;",
"head",
"0",
"public boolean isEmpty(){return head == 0;}",
"isEmpty",
"{return head == 0;}",
"return head == 0;",
"head == 0",
"head",
"0",
"public boolean isFull(){return head == CAPACITY;}",
"isFull",
"{return head == CAPACITY;}",
"return head == CAPACITY;",
"head == CAPACITY",
"head",
"CAPACITY",
"public int pop() {\n \tif(isEmpty()) throw new IllegalStateException();\n \treturn stack[--head];\n }",
"pop",
"{\n \tif(isEmpty()) throw new IllegalStateException();\n \treturn stack[--head];\n }",
"if(isEmpty()) throw new IllegalStateException();",
"isEmpty()",
"isEmpty",
"throw new IllegalStateException();",
"new IllegalStateException()",
"return stack[--head];",
"stack[--head]",
"stack",
"--head",
"head",
"public int push(int value) {\n \tif(isFull()) throw new IllegalStateException();\n \treturn stack[head++] = value;\n }",
"push",
"{\n \tif(isFull()) throw new IllegalStateException();\n \treturn stack[head++] = value;\n }",
"if(isFull()) throw new IllegalStateException();",
"isFull()",
"isFull",
"throw new IllegalStateException();",
"new IllegalStateException()",
"return stack[head++] = value;",
"stack[head++] = value",
"stack[head++]",
"stack",
"head++",
"head",
"value",
"int value",
"value",
"class SimpleInputUtil {\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\n public String[] readStrArray(String delim) throws NumberFormatException, IOException{\n \treturn br.readLine().split(delim);\n }\n \n}",
"SimpleInputUtil",
"BufferedReader br = new BufferedReader(new InputStreamReader(System.in));",
"br",
"new BufferedReader(new InputStreamReader(System.in))",
"public String[] readStrArray(String delim) throws NumberFormatException, IOException{\n \treturn br.readLine().split(delim);\n }",
"readStrArray",
"{\n \treturn br.readLine().split(delim);\n }",
"return br.readLine().split(delim);",
"br.readLine().split(delim)",
"br.readLine().split",
"br.readLine()",
"br.readLine",
"br",
"delim",
"String delim",
"delim",
"public class Main {\n\tprivate MyIntStack st = new MyIntStack();\n\n public static void main(String[] args) throws IOException {\n new Main().exec();\n }\n \n public void exec() throws IOException {\n \tSimpleInputUtil in = new SimpleInputUtil();\n PrintWriter out = new PrintWriter(System.out);\n out.println(calc(in.readStrArray(\" \")));\n out.flush();\n }\n\n private int calc(String[] exp) {\n \tint ret=0;\n \tfor(String s: exp) {\n \t\tswitch(s.charAt(0)){\n\t \t\tcase '+':{\n\t \t\t\tint b = st.pop();\n\t \t\t\tint a = st.pop();\n\t \t\t\tret = st.push(a + b);\n\t \t\t\tbreak;\n\t \t\t}\n\t \t\tcase '-':{\n\t \t\t\tint b = st.pop();\n\t \t\t\tint a = st.pop();\n\t \t\t\tret = st.push(a - b);\n\t \t\t\tbreak;\n\t \t\t}\n\t \t\tcase '*':{\n\t \t\t\tint b = st.pop();\n\t \t\t\tint a = st.pop();\n\t \t\t\tret = st.push(a * b);\n\t \t\t\tbreak;\n\t \t\t}\n\t \t\tdefault:{\n\t \t\t\tst.push(Integer.parseInt(s));\n\t \t\t}\n \t\t}\n \t}\n \treturn ret;\n }\n\n}",
"public class Main {\n\tprivate MyIntStack st = new MyIntStack();\n\n public static void main(String[] args) throws IOException {\n new Main().exec();\n }\n \n public void exec() throws IOException {\n \tSimpleInputUtil in = new SimpleInputUtil();\n PrintWriter out = new PrintWriter(System.out);\n out.println(calc(in.readStrArray(\" \")));\n out.flush();\n }\n\n private int calc(String[] exp) {\n \tint ret=0;\n \tfor(String s: exp) {\n \t\tswitch(s.charAt(0)){\n\t \t\tcase '+':{\n\t \t\t\tint b = st.pop();\n\t \t\t\tint a = st.pop();\n\t \t\t\tret = st.push(a + b);\n\t \t\t\tbreak;\n\t \t\t}\n\t \t\tcase '-':{\n\t \t\t\tint b = st.pop();\n\t \t\t\tint a = st.pop();\n\t \t\t\tret = st.push(a - b);\n\t \t\t\tbreak;\n\t \t\t}\n\t \t\tcase '*':{\n\t \t\t\tint b = st.pop();\n\t \t\t\tint a = st.pop();\n\t \t\t\tret = st.push(a * b);\n\t \t\t\tbreak;\n\t \t\t}\n\t \t\tdefault:{\n\t \t\t\tst.push(Integer.parseInt(s));\n\t \t\t}\n \t\t}\n \t}\n \treturn ret;\n }\n\n}",
"Main"
] | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
public class Main {
private MyIntStack st = new MyIntStack();
public static void main(String[] args) throws IOException {
new Main().exec();
}
public void exec() throws IOException {
SimpleInputUtil in = new SimpleInputUtil();
PrintWriter out = new PrintWriter(System.out);
out.println(calc(in.readStrArray(" ")));
out.flush();
}
private int calc(String[] exp) {
int ret=0;
for(String s: exp) {
switch(s.charAt(0)){
case '+':{
int b = st.pop();
int a = st.pop();
ret = st.push(a + b);
break;
}
case '-':{
int b = st.pop();
int a = st.pop();
ret = st.push(a - b);
break;
}
case '*':{
int b = st.pop();
int a = st.pop();
ret = st.push(a * b);
break;
}
default:{
st.push(Integer.parseInt(s));
}
}
}
return ret;
}
}
class MyIntStack {
private static final int CAPACITY = 100;
private int[] stack = new int[CAPACITY];
private int head = 0;
public boolean isEmpty(){return head == 0;}
public boolean isFull(){return head == CAPACITY;}
public int pop() {
if(isEmpty()) throw new IllegalStateException();
return stack[--head];
}
public int push(int value) {
if(isFull()) throw new IllegalStateException();
return stack[head++] = value;
}
}
class SimpleInputUtil {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
public String[] readStrArray(String delim) throws NumberFormatException, IOException{
return br.readLine().split(delim);
}
} |
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
4,
18,
13,
17,
41,
13,
20,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
30,
41,
13,
17,
41,
13,
17,
35,
18,
13,
13,
34,
17,
1,
0,
13,
4,
18,
13,
0,
13,
4,
18,
13,
4,
18,
13,
2,
13,
13,
3,
34,
17,
1,
0,
13,
4,
18,
13,
0,
13,
4,
18,
13,
4,
18,
13,
2,
13,
13,
3,
34,
17,
1,
0,
13,
4,
18,
13,
0,
13,
4,
18,
13,
4,
18,
13,
2,
13,
13,
3,
34,
1,
4,
18,
13,
4,
18,
13,
18,
13,
13,
4,
18,
18,
13,
13,
4,
18,
13,
23,
13,
6,
13,
41,
13,
17,
41,
13,
12,
13,
30,
0,
13,
20,
17,
12,
13,
30,
0,
18,
13,
13,
13,
40,
13,
23,
13,
12,
13,
30,
40,
13,
29,
18,
13,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
10,
11
],
[
10,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
15,
17
],
[
14,
18
],
[
18,
19
],
[
18,
20
],
[
20,
21
],
[
21,
22
],
[
22,
23
],
[
23,
24
],
[
20,
25
],
[
14,
26
],
[
26,
27
],
[
26,
28
],
[
14,
29
],
[
29,
30
],
[
30,
31
],
[
31,
32
],
[
31,
33
],
[
29,
34
],
[
34,
35
],
[
34,
36
],
[
36,
37
],
[
36,
38
],
[
29,
39
],
[
39,
40
],
[
40,
41
],
[
29,
42
],
[
43,
43
],
[
43,
44
],
[
44,
45
],
[
44,
46
],
[
43,
47
],
[
47,
48
],
[
47,
49
],
[
43,
50
],
[
50,
51
],
[
51,
52
],
[
51,
53
],
[
50,
54
],
[
54,
55
],
[
54,
56
],
[
56,
57
],
[
57,
58
],
[
57,
59
],
[
59,
60
],
[
60,
61
],
[
56,
62
],
[
62,
63
],
[
62,
64
],
[
64,
65
],
[
65,
66
],
[
56,
67
],
[
67,
68
],
[
68,
69
],
[
67,
70
],
[
70,
71
],
[
70,
72
],
[
56,
73
],
[
50,
74
],
[
74,
75
],
[
74,
76
],
[
76,
77
],
[
77,
78
],
[
77,
79
],
[
79,
80
],
[
80,
81
],
[
76,
82
],
[
82,
83
],
[
82,
84
],
[
84,
85
],
[
85,
86
],
[
76,
87
],
[
87,
88
],
[
88,
89
],
[
87,
90
],
[
90,
91
],
[
90,
92
],
[
76,
93
],
[
50,
94
],
[
94,
95
],
[
94,
96
],
[
96,
97
],
[
97,
98
],
[
97,
99
],
[
99,
100
],
[
100,
101
],
[
96,
102
],
[
102,
103
],
[
102,
104
],
[
104,
105
],
[
105,
106
],
[
96,
107
],
[
107,
108
],
[
108,
109
],
[
107,
110
],
[
110,
111
],
[
110,
112
],
[
96,
113
],
[
50,
114
],
[
114,
115
],
[
115,
116
],
[
116,
117
],
[
117,
118
],
[
116,
119
],
[
119,
120
],
[
120,
121
],
[
119,
122
],
[
122,
123
],
[
122,
124
],
[
14,
125
],
[
125,
126
],
[
126,
127
],
[
127,
128
],
[
127,
129
],
[
125,
130
],
[
130,
131
],
[
131,
132
],
[
12,
133
],
[
133,
134
],
[
0,
135
],
[
135,
136
],
[
135,
137
],
[
137,
138
],
[
137,
139
],
[
135,
140
],
[
140,
141
],
[
135,
142
],
[
142,
143
],
[
142,
144
],
[
144,
145
],
[
145,
146
],
[
145,
147
],
[
135,
149
],
[
149,
150
],
[
149,
151
],
[
151,
152
],
[
152,
153
],
[
153,
154
],
[
153,
155
],
[
152,
156
],
[
151,
157
],
[
157,
158
],
[
149,
159
],
[
159,
160
],
[
135,
161
],
[
161,
162
],
[
161,
163
],
[
163,
164
],
[
164,
165
],
[
163,
166
],
[
166,
167
],
[
167,
168
],
[
167,
169
]
] | [
"import java.io.BufferedReader;\nimport java.io.InputStreamReader;\nimport java.io.IOException;\n\nclass Main{\n\n\tpublic static void main(String[] args) throws IOException{\n\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tString[] input = br.readLine().split(\" \");\n\t\tStack s = new Stack();\n\n\t\tfor(int i = 0; i < input.length; i++){\n\n\t\t\tint x = 0;\n\t\t\tint y = 0;\n\n\t\t\tswitch(input[i]){\n\n\t\t\t\tcase \"+\":\n\t\t\t\t\ty = s.pop();\n\t\t\t\t\tx = s.pop();\n\t\t\t\t\ts.push(x + y);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"-\":\n\t\t\t\t\ty = s.pop();\n\t\t\t\t\tx = s.pop();\n\t\t\t\t\ts.push(x - y);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"*\":\n\t\t\t\t\ty = s.pop();\n\t\t\t\t\tx = s.pop();\n\t\t\t\t\ts.push(x * y);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\ts.push(Integer.parseInt(input[i]));\n\n\t\t\t}\n\n\t\t}\n\n\t\tSystem.out.println(s.pop());\n\n\t}\n\n}\n\nclass Stack{\n\n\tpublic static int size = 0;\n\tprivate int[] array;\n\n\tpublic Stack(){\n\n\t\tarray = new int[100];\n\n\t}\n\n\tpublic void push(int n){\n\n\t\tarray[size] = n;\n\t\tsize++;\n\n\t}\n\n\tpublic int pop(){\n\n\t\tsize--;\n\n\t\treturn array[size];\n\n\t}\n\n}",
"import java.io.BufferedReader;",
"BufferedReader",
"java.io",
"import java.io.InputStreamReader;",
"InputStreamReader",
"java.io",
"import java.io.IOException;",
"IOException",
"java.io",
"class Main{\n\n\tpublic static void main(String[] args) throws IOException{\n\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tString[] input = br.readLine().split(\" \");\n\t\tStack s = new Stack();\n\n\t\tfor(int i = 0; i < input.length; i++){\n\n\t\t\tint x = 0;\n\t\t\tint y = 0;\n\n\t\t\tswitch(input[i]){\n\n\t\t\t\tcase \"+\":\n\t\t\t\t\ty = s.pop();\n\t\t\t\t\tx = s.pop();\n\t\t\t\t\ts.push(x + y);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"-\":\n\t\t\t\t\ty = s.pop();\n\t\t\t\t\tx = s.pop();\n\t\t\t\t\ts.push(x - y);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"*\":\n\t\t\t\t\ty = s.pop();\n\t\t\t\t\tx = s.pop();\n\t\t\t\t\ts.push(x * y);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\ts.push(Integer.parseInt(input[i]));\n\n\t\t\t}\n\n\t\t}\n\n\t\tSystem.out.println(s.pop());\n\n\t}\n\n}",
"Main",
"public static void main(String[] args) throws IOException{\n\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tString[] input = br.readLine().split(\" \");\n\t\tStack s = new Stack();\n\n\t\tfor(int i = 0; i < input.length; i++){\n\n\t\t\tint x = 0;\n\t\t\tint y = 0;\n\n\t\t\tswitch(input[i]){\n\n\t\t\t\tcase \"+\":\n\t\t\t\t\ty = s.pop();\n\t\t\t\t\tx = s.pop();\n\t\t\t\t\ts.push(x + y);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"-\":\n\t\t\t\t\ty = s.pop();\n\t\t\t\t\tx = s.pop();\n\t\t\t\t\ts.push(x - y);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"*\":\n\t\t\t\t\ty = s.pop();\n\t\t\t\t\tx = s.pop();\n\t\t\t\t\ts.push(x * y);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\ts.push(Integer.parseInt(input[i]));\n\n\t\t\t}\n\n\t\t}\n\n\t\tSystem.out.println(s.pop());\n\n\t}",
"main",
"{\n\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tString[] input = br.readLine().split(\" \");\n\t\tStack s = new Stack();\n\n\t\tfor(int i = 0; i < input.length; i++){\n\n\t\t\tint x = 0;\n\t\t\tint y = 0;\n\n\t\t\tswitch(input[i]){\n\n\t\t\t\tcase \"+\":\n\t\t\t\t\ty = s.pop();\n\t\t\t\t\tx = s.pop();\n\t\t\t\t\ts.push(x + y);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"-\":\n\t\t\t\t\ty = s.pop();\n\t\t\t\t\tx = s.pop();\n\t\t\t\t\ts.push(x - y);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"*\":\n\t\t\t\t\ty = s.pop();\n\t\t\t\t\tx = s.pop();\n\t\t\t\t\ts.push(x * y);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\ts.push(Integer.parseInt(input[i]));\n\n\t\t\t}\n\n\t\t}\n\n\t\tSystem.out.println(s.pop());\n\n\t}",
"BufferedReader br = new BufferedReader(new InputStreamReader(System.in));",
"br",
"new BufferedReader(new InputStreamReader(System.in))",
"String[] input = br.readLine().split(\" \");",
"input",
"br.readLine().split(\" \")",
"br.readLine().split",
"br.readLine()",
"br.readLine",
"br",
"\" \"",
"Stack s = new Stack();",
"s",
"new Stack()",
"for(int i = 0; i < input.length; i++){\n\n\t\t\tint x = 0;\n\t\t\tint y = 0;\n\n\t\t\tswitch(input[i]){\n\n\t\t\t\tcase \"+\":\n\t\t\t\t\ty = s.pop();\n\t\t\t\t\tx = s.pop();\n\t\t\t\t\ts.push(x + y);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"-\":\n\t\t\t\t\ty = s.pop();\n\t\t\t\t\tx = s.pop();\n\t\t\t\t\ts.push(x - y);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"*\":\n\t\t\t\t\ty = s.pop();\n\t\t\t\t\tx = s.pop();\n\t\t\t\t\ts.push(x * y);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\ts.push(Integer.parseInt(input[i]));\n\n\t\t\t}\n\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < input.length",
"i",
"input.length",
"input",
"input.length",
"i++",
"i++",
"i",
"{\n\n\t\t\tint x = 0;\n\t\t\tint y = 0;\n\n\t\t\tswitch(input[i]){\n\n\t\t\t\tcase \"+\":\n\t\t\t\t\ty = s.pop();\n\t\t\t\t\tx = s.pop();\n\t\t\t\t\ts.push(x + y);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"-\":\n\t\t\t\t\ty = s.pop();\n\t\t\t\t\tx = s.pop();\n\t\t\t\t\ts.push(x - y);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"*\":\n\t\t\t\t\ty = s.pop();\n\t\t\t\t\tx = s.pop();\n\t\t\t\t\ts.push(x * y);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\ts.push(Integer.parseInt(input[i]));\n\n\t\t\t}\n\n\t\t}",
"{\n\n\t\t\tint x = 0;\n\t\t\tint y = 0;\n\n\t\t\tswitch(input[i]){\n\n\t\t\t\tcase \"+\":\n\t\t\t\t\ty = s.pop();\n\t\t\t\t\tx = s.pop();\n\t\t\t\t\ts.push(x + y);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"-\":\n\t\t\t\t\ty = s.pop();\n\t\t\t\t\tx = s.pop();\n\t\t\t\t\ts.push(x - y);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"*\":\n\t\t\t\t\ty = s.pop();\n\t\t\t\t\tx = s.pop();\n\t\t\t\t\ts.push(x * y);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\ts.push(Integer.parseInt(input[i]));\n\n\t\t\t}\n\n\t\t}",
"int x = 0;",
"x",
"0",
"int y = 0;",
"y",
"0",
"switch(input[i]){\n\n\t\t\t\tcase \"+\":\n\t\t\t\t\ty = s.pop();\n\t\t\t\t\tx = s.pop();\n\t\t\t\t\ts.push(x + y);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"-\":\n\t\t\t\t\ty = s.pop();\n\t\t\t\t\tx = s.pop();\n\t\t\t\t\ts.push(x - y);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"*\":\n\t\t\t\t\ty = s.pop();\n\t\t\t\t\tx = s.pop();\n\t\t\t\t\ts.push(x * y);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\ts.push(Integer.parseInt(input[i]));\n\n\t\t\t}",
"input[i]",
"input",
"i",
"case \"+\":",
"\"+\"",
"case \"+\":",
"y = s.pop()",
"y",
"s.pop()",
"s.pop",
"s",
"x = s.pop()",
"x",
"s.pop()",
"s.pop",
"s",
"s.push(x + y)",
"s.push",
"s",
"x + y",
"x",
"y",
"break;",
"case \"-\":",
"\"-\"",
"case \"-\":",
"y = s.pop()",
"y",
"s.pop()",
"s.pop",
"s",
"x = s.pop()",
"x",
"s.pop()",
"s.pop",
"s",
"s.push(x - y)",
"s.push",
"s",
"x - y",
"x",
"y",
"break;",
"case \"*\":",
"\"*\"",
"case \"*\":",
"y = s.pop()",
"y",
"s.pop()",
"s.pop",
"s",
"x = s.pop()",
"x",
"s.pop()",
"s.pop",
"s",
"s.push(x * y)",
"s.push",
"s",
"x * y",
"x",
"y",
"break;",
"default:",
"default:",
"s.push(Integer.parseInt(input[i]))",
"s.push",
"s",
"Integer.parseInt(input[i])",
"Integer.parseInt",
"Integer",
"input[i]",
"input",
"i",
"System.out.println(s.pop())",
"System.out.println",
"System.out",
"System",
"System.out",
"s.pop()",
"s.pop",
"s",
"String[] args",
"args",
"class Stack{\n\n\tpublic static int size = 0;\n\tprivate int[] array;\n\n\tpublic Stack(){\n\n\t\tarray = new int[100];\n\n\t}\n\n\tpublic void push(int n){\n\n\t\tarray[size] = n;\n\t\tsize++;\n\n\t}\n\n\tpublic int pop(){\n\n\t\tsize--;\n\n\t\treturn array[size];\n\n\t}\n\n}",
"Stack",
"public static int size = 0;",
"size",
"0",
"private int[] array;",
"array",
"public Stack(){\n\n\t\tarray = new int[100];\n\n\t}",
"Stack",
"{\n\n\t\tarray = new int[100];\n\n\t}",
"array = new int[100]",
"array",
"new int[100]",
"100",
"public void push(int n){\n\n\t\tarray[size] = n;\n\t\tsize++;\n\n\t}",
"push",
"{\n\n\t\tarray[size] = n;\n\t\tsize++;\n\n\t}",
"array[size] = n",
"array[size]",
"array",
"size",
"n",
"size++",
"size",
"int n",
"n",
"public int pop(){\n\n\t\tsize--;\n\n\t\treturn array[size];\n\n\t}",
"pop",
"{\n\n\t\tsize--;\n\n\t\treturn array[size];\n\n\t}",
"size--",
"size",
"return array[size];",
"array[size]",
"array",
"size"
] | import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;
class Main{
public static void main(String[] args) throws IOException{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String[] input = br.readLine().split(" ");
Stack s = new Stack();
for(int i = 0; i < input.length; i++){
int x = 0;
int y = 0;
switch(input[i]){
case "+":
y = s.pop();
x = s.pop();
s.push(x + y);
break;
case "-":
y = s.pop();
x = s.pop();
s.push(x - y);
break;
case "*":
y = s.pop();
x = s.pop();
s.push(x * y);
break;
default:
s.push(Integer.parseInt(input[i]));
}
}
System.out.println(s.pop());
}
}
class Stack{
public static int size = 0;
private int[] array;
public Stack(){
array = new int[100];
}
public void push(int n){
array[size] = n;
size++;
}
public int pop(){
size--;
return array[size];
}
} |
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
4,
18,
13,
17,
41,
13,
20,
41,
13,
17,
41,
13,
17,
28,
13,
13,
30,
30,
14,
4,
18,
4,
18,
13,
17,
17,
17,
13,
30,
0,
13,
4,
18,
13,
4,
18,
13,
0,
13,
4,
18,
13,
4,
18,
13,
41,
13,
13,
14,
4,
18,
17,
13,
0,
13,
4,
18,
13,
2,
13,
13,
14,
4,
18,
17,
13,
0,
13,
4,
18,
13,
2,
13,
13,
14,
4,
18,
17,
13,
0,
13,
4,
18,
13,
2,
13,
13,
4,
18,
13,
13,
4,
18,
18,
13,
13,
4,
18,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
10,
11
],
[
10,
12
],
[
0,
13
],
[
127,
14
],
[
127,
15
],
[
15,
16
],
[
15,
17
],
[
17,
18
],
[
18,
19
],
[
18,
20
],
[
17,
21
],
[
21,
22
],
[
21,
23
],
[
23,
24
],
[
24,
25
],
[
25,
26
],
[
26,
27
],
[
23,
28
],
[
17,
29
],
[
29,
30
],
[
29,
31
],
[
17,
32
],
[
32,
33
],
[
32,
34
],
[
17,
35
],
[
35,
36
],
[
35,
37
],
[
17,
38
],
[
38,
39
],
[
38,
40
],
[
38,
41
],
[
42,
42
],
[
42,
43
],
[
43,
44
],
[
44,
45
],
[
45,
46
],
[
46,
47
],
[
47,
48
],
[
46,
49
],
[
46,
50
],
[
46,
51
],
[
44,
52
],
[
43,
53
],
[
53,
54
],
[
54,
55
],
[
54,
56
],
[
56,
57
],
[
57,
58
],
[
56,
59
],
[
59,
60
],
[
60,
61
],
[
53,
62
],
[
62,
63
],
[
62,
64
],
[
64,
65
],
[
65,
66
],
[
64,
67
],
[
67,
68
],
[
68,
69
],
[
42,
70
],
[
70,
71
],
[
70,
72
],
[
42,
73
],
[
73,
74
],
[
74,
75
],
[
75,
76
],
[
74,
77
],
[
73,
78
],
[
78,
79
],
[
78,
80
],
[
80,
81
],
[
81,
82
],
[
80,
83
],
[
83,
84
],
[
83,
85
],
[
42,
86
],
[
86,
87
],
[
87,
88
],
[
88,
89
],
[
87,
90
],
[
86,
91
],
[
91,
92
],
[
91,
93
],
[
93,
94
],
[
94,
95
],
[
93,
96
],
[
96,
97
],
[
96,
98
],
[
42,
99
],
[
99,
100
],
[
100,
101
],
[
101,
102
],
[
100,
103
],
[
99,
104
],
[
104,
105
],
[
104,
106
],
[
106,
107
],
[
107,
108
],
[
106,
109
],
[
109,
110
],
[
109,
111
],
[
42,
112
],
[
112,
113
],
[
113,
114
],
[
112,
115
],
[
17,
116
],
[
116,
117
],
[
117,
118
],
[
118,
119
],
[
118,
120
],
[
116,
121
],
[
121,
122
],
[
122,
123
],
[
15,
124
],
[
124,
125
],
[
0,
126
],
[
126,
127
],
[
126,
128
]
] | [
"import java.util.ArrayDeque;\nimport java.util.Arrays;\nimport java.util.Deque;\nimport java.util.Scanner;\n\npublic class Main {\n\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n\n String[] strs = sc.nextLine().split(\" \");\n\n Deque<String> stack = new ArrayDeque<>();\n\n long a = 0;\n long b = 0;\n \n for (String s : strs) {\n if (Arrays.asList(\"+\", \"-\", \"*\").contains(s)) {\n a = Long.valueOf(stack.pop());\n b = Long.valueOf(stack.pop());\n }\n\n String r = s;\n if (\"+\".equals(s)) r = String.valueOf(b + a);\n if (\"-\".equals(s)) r = String.valueOf(b - a);\n if (\"*\".equals(s)) r = String.valueOf(b * a);\n\n stack.push(r);\n }\n\n System.out.println(stack.pop());\n }\n}",
"import java.util.ArrayDeque;",
"ArrayDeque",
"java.util",
"import java.util.Arrays;",
"Arrays",
"java.util",
"import java.util.Deque;",
"Deque",
"java.util",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n\n String[] strs = sc.nextLine().split(\" \");\n\n Deque<String> stack = new ArrayDeque<>();\n\n long a = 0;\n long b = 0;\n \n for (String s : strs) {\n if (Arrays.asList(\"+\", \"-\", \"*\").contains(s)) {\n a = Long.valueOf(stack.pop());\n b = Long.valueOf(stack.pop());\n }\n\n String r = s;\n if (\"+\".equals(s)) r = String.valueOf(b + a);\n if (\"-\".equals(s)) r = String.valueOf(b - a);\n if (\"*\".equals(s)) r = String.valueOf(b * a);\n\n stack.push(r);\n }\n\n System.out.println(stack.pop());\n }\n}",
"Main",
"public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n\n String[] strs = sc.nextLine().split(\" \");\n\n Deque<String> stack = new ArrayDeque<>();\n\n long a = 0;\n long b = 0;\n \n for (String s : strs) {\n if (Arrays.asList(\"+\", \"-\", \"*\").contains(s)) {\n a = Long.valueOf(stack.pop());\n b = Long.valueOf(stack.pop());\n }\n\n String r = s;\n if (\"+\".equals(s)) r = String.valueOf(b + a);\n if (\"-\".equals(s)) r = String.valueOf(b - a);\n if (\"*\".equals(s)) r = String.valueOf(b * a);\n\n stack.push(r);\n }\n\n System.out.println(stack.pop());\n }",
"main",
"{\n Scanner sc = new Scanner(System.in);\n\n String[] strs = sc.nextLine().split(\" \");\n\n Deque<String> stack = new ArrayDeque<>();\n\n long a = 0;\n long b = 0;\n \n for (String s : strs) {\n if (Arrays.asList(\"+\", \"-\", \"*\").contains(s)) {\n a = Long.valueOf(stack.pop());\n b = Long.valueOf(stack.pop());\n }\n\n String r = s;\n if (\"+\".equals(s)) r = String.valueOf(b + a);\n if (\"-\".equals(s)) r = String.valueOf(b - a);\n if (\"*\".equals(s)) r = String.valueOf(b * a);\n\n stack.push(r);\n }\n\n System.out.println(stack.pop());\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"String[] strs = sc.nextLine().split(\" \");",
"strs",
"sc.nextLine().split(\" \")",
"sc.nextLine().split",
"sc.nextLine()",
"sc.nextLine",
"sc",
"\" \"",
"Deque<String> stack = new ArrayDeque<>();",
"stack",
"new ArrayDeque<>()",
"long a = 0;",
"a",
"0",
"long b = 0;",
"b",
"0",
"for (String s : strs) {\n if (Arrays.asList(\"+\", \"-\", \"*\").contains(s)) {\n a = Long.valueOf(stack.pop());\n b = Long.valueOf(stack.pop());\n }\n\n String r = s;\n if (\"+\".equals(s)) r = String.valueOf(b + a);\n if (\"-\".equals(s)) r = String.valueOf(b - a);\n if (\"*\".equals(s)) r = String.valueOf(b * a);\n\n stack.push(r);\n }",
"String s",
"strs",
"{\n if (Arrays.asList(\"+\", \"-\", \"*\").contains(s)) {\n a = Long.valueOf(stack.pop());\n b = Long.valueOf(stack.pop());\n }\n\n String r = s;\n if (\"+\".equals(s)) r = String.valueOf(b + a);\n if (\"-\".equals(s)) r = String.valueOf(b - a);\n if (\"*\".equals(s)) r = String.valueOf(b * a);\n\n stack.push(r);\n }",
"{\n if (Arrays.asList(\"+\", \"-\", \"*\").contains(s)) {\n a = Long.valueOf(stack.pop());\n b = Long.valueOf(stack.pop());\n }\n\n String r = s;\n if (\"+\".equals(s)) r = String.valueOf(b + a);\n if (\"-\".equals(s)) r = String.valueOf(b - a);\n if (\"*\".equals(s)) r = String.valueOf(b * a);\n\n stack.push(r);\n }",
"if (Arrays.asList(\"+\", \"-\", \"*\").contains(s)) {\n a = Long.valueOf(stack.pop());\n b = Long.valueOf(stack.pop());\n }",
"Arrays.asList(\"+\", \"-\", \"*\").contains(s)",
"Arrays.asList(\"+\", \"-\", \"*\").contains",
"Arrays.asList(\"+\", \"-\", \"*\")",
"Arrays.asList",
"Arrays",
"\"+\"",
"\"-\"",
"\"*\"",
"s",
"{\n a = Long.valueOf(stack.pop());\n b = Long.valueOf(stack.pop());\n }",
"a = Long.valueOf(stack.pop())",
"a",
"Long.valueOf(stack.pop())",
"Long.valueOf",
"Long",
"stack.pop()",
"stack.pop",
"stack",
"b = Long.valueOf(stack.pop())",
"b",
"Long.valueOf(stack.pop())",
"Long.valueOf",
"Long",
"stack.pop()",
"stack.pop",
"stack",
"String r = s;",
"r",
"s",
"if (\"+\".equals(s)) r = String.valueOf(b + a);",
"\"+\".equals(s)",
"\"+\".equals",
"\"+\"",
"s",
"r = String.valueOf(b + a)",
"r",
"String.valueOf(b + a)",
"String.valueOf",
"String",
"b + a",
"b",
"a",
"if (\"-\".equals(s)) r = String.valueOf(b - a);",
"\"-\".equals(s)",
"\"-\".equals",
"\"-\"",
"s",
"r = String.valueOf(b - a)",
"r",
"String.valueOf(b - a)",
"String.valueOf",
"String",
"b - a",
"b",
"a",
"if (\"*\".equals(s)) r = String.valueOf(b * a);",
"\"*\".equals(s)",
"\"*\".equals",
"\"*\"",
"s",
"r = String.valueOf(b * a)",
"r",
"String.valueOf(b * a)",
"String.valueOf",
"String",
"b * a",
"b",
"a",
"stack.push(r)",
"stack.push",
"stack",
"r",
"System.out.println(stack.pop())",
"System.out.println",
"System.out",
"System",
"System.out",
"stack.pop()",
"stack.pop",
"stack",
"String[] args",
"args",
"public class Main {\n\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n\n String[] strs = sc.nextLine().split(\" \");\n\n Deque<String> stack = new ArrayDeque<>();\n\n long a = 0;\n long b = 0;\n \n for (String s : strs) {\n if (Arrays.asList(\"+\", \"-\", \"*\").contains(s)) {\n a = Long.valueOf(stack.pop());\n b = Long.valueOf(stack.pop());\n }\n\n String r = s;\n if (\"+\".equals(s)) r = String.valueOf(b + a);\n if (\"-\".equals(s)) r = String.valueOf(b - a);\n if (\"*\".equals(s)) r = String.valueOf(b * a);\n\n stack.push(r);\n }\n\n System.out.println(stack.pop());\n }\n}",
"public class Main {\n\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n\n String[] strs = sc.nextLine().split(\" \");\n\n Deque<String> stack = new ArrayDeque<>();\n\n long a = 0;\n long b = 0;\n \n for (String s : strs) {\n if (Arrays.asList(\"+\", \"-\", \"*\").contains(s)) {\n a = Long.valueOf(stack.pop());\n b = Long.valueOf(stack.pop());\n }\n\n String r = s;\n if (\"+\".equals(s)) r = String.valueOf(b + a);\n if (\"-\".equals(s)) r = String.valueOf(b - a);\n if (\"*\".equals(s)) r = String.valueOf(b * a);\n\n stack.push(r);\n }\n\n System.out.println(stack.pop());\n }\n}",
"Main"
] | import java.util.ArrayDeque;
import java.util.Arrays;
import java.util.Deque;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String[] strs = sc.nextLine().split(" ");
Deque<String> stack = new ArrayDeque<>();
long a = 0;
long b = 0;
for (String s : strs) {
if (Arrays.asList("+", "-", "*").contains(s)) {
a = Long.valueOf(stack.pop());
b = Long.valueOf(stack.pop());
}
String r = s;
if ("+".equals(s)) r = String.valueOf(b + a);
if ("-".equals(s)) r = String.valueOf(b - a);
if ("*".equals(s)) r = String.valueOf(b * a);
stack.push(r);
}
System.out.println(stack.pop());
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
41,
13,
41,
13,
41,
13,
20,
42,
4,
18,
13,
30,
0,
13,
4,
18,
13,
35,
13,
34,
17,
1,
0,
13,
4,
18,
13,
0,
13,
4,
18,
13,
4,
18,
13,
2,
13,
13,
3,
34,
17,
1,
0,
13,
4,
18,
13,
0,
13,
4,
18,
13,
4,
18,
13,
2,
13,
13,
3,
34,
17,
1,
0,
13,
4,
18,
13,
0,
13,
4,
18,
13,
4,
18,
13,
2,
13,
13,
3,
34,
1,
4,
18,
13,
4,
18,
13,
13,
4,
18,
18,
13,
13,
4,
18,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
113,
5
],
[
113,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
8,
14
],
[
14,
15
],
[
8,
16
],
[
16,
17
],
[
8,
18
],
[
18,
19
],
[
18,
20
],
[
8,
21
],
[
21,
22
],
[
22,
23
],
[
23,
24
],
[
21,
25
],
[
25,
26
],
[
26,
27
],
[
26,
28
],
[
28,
29
],
[
29,
30
],
[
25,
31
],
[
31,
32
],
[
31,
33
],
[
33,
34
],
[
33,
35
],
[
35,
36
],
[
36,
37
],
[
36,
38
],
[
38,
39
],
[
39,
40
],
[
35,
41
],
[
41,
42
],
[
41,
43
],
[
43,
44
],
[
44,
45
],
[
35,
46
],
[
46,
47
],
[
47,
48
],
[
46,
49
],
[
49,
50
],
[
49,
51
],
[
35,
52
],
[
31,
53
],
[
53,
54
],
[
53,
55
],
[
55,
56
],
[
56,
57
],
[
56,
58
],
[
58,
59
],
[
59,
60
],
[
55,
61
],
[
61,
62
],
[
61,
63
],
[
63,
64
],
[
64,
65
],
[
55,
66
],
[
66,
67
],
[
67,
68
],
[
66,
69
],
[
69,
70
],
[
69,
71
],
[
55,
72
],
[
31,
73
],
[
73,
74
],
[
73,
75
],
[
75,
76
],
[
76,
77
],
[
76,
78
],
[
78,
79
],
[
79,
80
],
[
75,
81
],
[
81,
82
],
[
81,
83
],
[
83,
84
],
[
84,
85
],
[
75,
86
],
[
86,
87
],
[
87,
88
],
[
86,
89
],
[
89,
90
],
[
89,
91
],
[
75,
92
],
[
31,
93
],
[
93,
94
],
[
94,
95
],
[
95,
96
],
[
96,
97
],
[
95,
98
],
[
98,
99
],
[
99,
100
],
[
98,
101
],
[
8,
102
],
[
102,
103
],
[
103,
104
],
[
104,
105
],
[
104,
106
],
[
102,
107
],
[
107,
108
],
[
108,
109
],
[
6,
110
],
[
110,
111
],
[
0,
112
],
[
112,
113
],
[
112,
114
]
] | [
"import java.util.*;\n\npublic class Main {\n\tpublic static void main(String[] args){\n\t\tScanner scanner = new Scanner(System.in);\n\t\tString next;\n\t\tint op1, op2;\n\t\tStack<Integer> stack = new Stack<Integer>();\n\n\t\twhile(scanner.hasNext()){\n\t\t\tnext = scanner.next();\n\t\t\tswitch(next){\n\t\t\t\tcase \"+\":\n\t\t\t\t\top1 = stack.pop();\n\t\t\t\t\top2 = stack.pop();\n\t\t\t\t\tstack.push(op2+op1);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"-\":\n\t\t\t\t\top1 = stack.pop();\n\t\t\t\t\top2 = stack.pop();\n\t\t\t\t\tstack.push(op2-op1);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"*\":\n\t\t\t\t\top1 = stack.pop();\n\t\t\t\t\top2 = stack.pop();\n\t\t\t\t\tstack.push(op2*op1);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault :\n\t\t\t\t\tstack.push(Integer.parseInt(next));\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.println(stack.pop());\n\n\t}\n}",
"import java.util.*;",
"util.*",
"java",
"public class Main {\n\tpublic static void main(String[] args){\n\t\tScanner scanner = new Scanner(System.in);\n\t\tString next;\n\t\tint op1, op2;\n\t\tStack<Integer> stack = new Stack<Integer>();\n\n\t\twhile(scanner.hasNext()){\n\t\t\tnext = scanner.next();\n\t\t\tswitch(next){\n\t\t\t\tcase \"+\":\n\t\t\t\t\top1 = stack.pop();\n\t\t\t\t\top2 = stack.pop();\n\t\t\t\t\tstack.push(op2+op1);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"-\":\n\t\t\t\t\top1 = stack.pop();\n\t\t\t\t\top2 = stack.pop();\n\t\t\t\t\tstack.push(op2-op1);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"*\":\n\t\t\t\t\top1 = stack.pop();\n\t\t\t\t\top2 = stack.pop();\n\t\t\t\t\tstack.push(op2*op1);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault :\n\t\t\t\t\tstack.push(Integer.parseInt(next));\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.println(stack.pop());\n\n\t}\n}",
"Main",
"public static void main(String[] args){\n\t\tScanner scanner = new Scanner(System.in);\n\t\tString next;\n\t\tint op1, op2;\n\t\tStack<Integer> stack = new Stack<Integer>();\n\n\t\twhile(scanner.hasNext()){\n\t\t\tnext = scanner.next();\n\t\t\tswitch(next){\n\t\t\t\tcase \"+\":\n\t\t\t\t\top1 = stack.pop();\n\t\t\t\t\top2 = stack.pop();\n\t\t\t\t\tstack.push(op2+op1);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"-\":\n\t\t\t\t\top1 = stack.pop();\n\t\t\t\t\top2 = stack.pop();\n\t\t\t\t\tstack.push(op2-op1);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"*\":\n\t\t\t\t\top1 = stack.pop();\n\t\t\t\t\top2 = stack.pop();\n\t\t\t\t\tstack.push(op2*op1);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault :\n\t\t\t\t\tstack.push(Integer.parseInt(next));\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.println(stack.pop());\n\n\t}",
"main",
"{\n\t\tScanner scanner = new Scanner(System.in);\n\t\tString next;\n\t\tint op1, op2;\n\t\tStack<Integer> stack = new Stack<Integer>();\n\n\t\twhile(scanner.hasNext()){\n\t\t\tnext = scanner.next();\n\t\t\tswitch(next){\n\t\t\t\tcase \"+\":\n\t\t\t\t\top1 = stack.pop();\n\t\t\t\t\top2 = stack.pop();\n\t\t\t\t\tstack.push(op2+op1);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"-\":\n\t\t\t\t\top1 = stack.pop();\n\t\t\t\t\top2 = stack.pop();\n\t\t\t\t\tstack.push(op2-op1);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"*\":\n\t\t\t\t\top1 = stack.pop();\n\t\t\t\t\top2 = stack.pop();\n\t\t\t\t\tstack.push(op2*op1);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault :\n\t\t\t\t\tstack.push(Integer.parseInt(next));\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.println(stack.pop());\n\n\t}",
"Scanner scanner = new Scanner(System.in);",
"scanner",
"new Scanner(System.in)",
"String next;",
"next",
"int op1",
"op1",
"op2;",
"op2",
"Stack<Integer> stack = new Stack<Integer>();",
"stack",
"new Stack<Integer>()",
"while(scanner.hasNext()){\n\t\t\tnext = scanner.next();\n\t\t\tswitch(next){\n\t\t\t\tcase \"+\":\n\t\t\t\t\top1 = stack.pop();\n\t\t\t\t\top2 = stack.pop();\n\t\t\t\t\tstack.push(op2+op1);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"-\":\n\t\t\t\t\top1 = stack.pop();\n\t\t\t\t\top2 = stack.pop();\n\t\t\t\t\tstack.push(op2-op1);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"*\":\n\t\t\t\t\top1 = stack.pop();\n\t\t\t\t\top2 = stack.pop();\n\t\t\t\t\tstack.push(op2*op1);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault :\n\t\t\t\t\tstack.push(Integer.parseInt(next));\n\t\t\t}\n\t\t}",
"scanner.hasNext()",
"scanner.hasNext",
"scanner",
"{\n\t\t\tnext = scanner.next();\n\t\t\tswitch(next){\n\t\t\t\tcase \"+\":\n\t\t\t\t\top1 = stack.pop();\n\t\t\t\t\top2 = stack.pop();\n\t\t\t\t\tstack.push(op2+op1);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"-\":\n\t\t\t\t\top1 = stack.pop();\n\t\t\t\t\top2 = stack.pop();\n\t\t\t\t\tstack.push(op2-op1);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"*\":\n\t\t\t\t\top1 = stack.pop();\n\t\t\t\t\top2 = stack.pop();\n\t\t\t\t\tstack.push(op2*op1);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault :\n\t\t\t\t\tstack.push(Integer.parseInt(next));\n\t\t\t}\n\t\t}",
"next = scanner.next()",
"next",
"scanner.next()",
"scanner.next",
"scanner",
"switch(next){\n\t\t\t\tcase \"+\":\n\t\t\t\t\top1 = stack.pop();\n\t\t\t\t\top2 = stack.pop();\n\t\t\t\t\tstack.push(op2+op1);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"-\":\n\t\t\t\t\top1 = stack.pop();\n\t\t\t\t\top2 = stack.pop();\n\t\t\t\t\tstack.push(op2-op1);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"*\":\n\t\t\t\t\top1 = stack.pop();\n\t\t\t\t\top2 = stack.pop();\n\t\t\t\t\tstack.push(op2*op1);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault :\n\t\t\t\t\tstack.push(Integer.parseInt(next));\n\t\t\t}",
"next",
"case \"+\":",
"\"+\"",
"case \"+\":",
"op1 = stack.pop()",
"op1",
"stack.pop()",
"stack.pop",
"stack",
"op2 = stack.pop()",
"op2",
"stack.pop()",
"stack.pop",
"stack",
"stack.push(op2+op1)",
"stack.push",
"stack",
"op2+op1",
"op2",
"op1",
"break;",
"case \"-\":",
"\"-\"",
"case \"-\":",
"op1 = stack.pop()",
"op1",
"stack.pop()",
"stack.pop",
"stack",
"op2 = stack.pop()",
"op2",
"stack.pop()",
"stack.pop",
"stack",
"stack.push(op2-op1)",
"stack.push",
"stack",
"op2-op1",
"op2",
"op1",
"break;",
"case \"*\":",
"\"*\"",
"case \"*\":",
"op1 = stack.pop()",
"op1",
"stack.pop()",
"stack.pop",
"stack",
"op2 = stack.pop()",
"op2",
"stack.pop()",
"stack.pop",
"stack",
"stack.push(op2*op1)",
"stack.push",
"stack",
"op2*op1",
"op2",
"op1",
"break;",
"default :",
"default :",
"stack.push(Integer.parseInt(next))",
"stack.push",
"stack",
"Integer.parseInt(next)",
"Integer.parseInt",
"Integer",
"next",
"System.out.println(stack.pop())",
"System.out.println",
"System.out",
"System",
"System.out",
"stack.pop()",
"stack.pop",
"stack",
"String[] args",
"args",
"public class Main {\n\tpublic static void main(String[] args){\n\t\tScanner scanner = new Scanner(System.in);\n\t\tString next;\n\t\tint op1, op2;\n\t\tStack<Integer> stack = new Stack<Integer>();\n\n\t\twhile(scanner.hasNext()){\n\t\t\tnext = scanner.next();\n\t\t\tswitch(next){\n\t\t\t\tcase \"+\":\n\t\t\t\t\top1 = stack.pop();\n\t\t\t\t\top2 = stack.pop();\n\t\t\t\t\tstack.push(op2+op1);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"-\":\n\t\t\t\t\top1 = stack.pop();\n\t\t\t\t\top2 = stack.pop();\n\t\t\t\t\tstack.push(op2-op1);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"*\":\n\t\t\t\t\top1 = stack.pop();\n\t\t\t\t\top2 = stack.pop();\n\t\t\t\t\tstack.push(op2*op1);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault :\n\t\t\t\t\tstack.push(Integer.parseInt(next));\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.println(stack.pop());\n\n\t}\n}",
"public class Main {\n\tpublic static void main(String[] args){\n\t\tScanner scanner = new Scanner(System.in);\n\t\tString next;\n\t\tint op1, op2;\n\t\tStack<Integer> stack = new Stack<Integer>();\n\n\t\twhile(scanner.hasNext()){\n\t\t\tnext = scanner.next();\n\t\t\tswitch(next){\n\t\t\t\tcase \"+\":\n\t\t\t\t\top1 = stack.pop();\n\t\t\t\t\top2 = stack.pop();\n\t\t\t\t\tstack.push(op2+op1);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"-\":\n\t\t\t\t\top1 = stack.pop();\n\t\t\t\t\top2 = stack.pop();\n\t\t\t\t\tstack.push(op2-op1);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"*\":\n\t\t\t\t\top1 = stack.pop();\n\t\t\t\t\top2 = stack.pop();\n\t\t\t\t\tstack.push(op2*op1);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault :\n\t\t\t\t\tstack.push(Integer.parseInt(next));\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.println(stack.pop());\n\n\t}\n}",
"Main"
] | import java.util.*;
public class Main {
public static void main(String[] args){
Scanner scanner = new Scanner(System.in);
String next;
int op1, op2;
Stack<Integer> stack = new Stack<Integer>();
while(scanner.hasNext()){
next = scanner.next();
switch(next){
case "+":
op1 = stack.pop();
op2 = stack.pop();
stack.push(op2+op1);
break;
case "-":
op1 = stack.pop();
op2 = stack.pop();
stack.push(op2-op1);
break;
case "*":
op1 = stack.pop();
op2 = stack.pop();
stack.push(op2*op1);
break;
default :
stack.push(Integer.parseInt(next));
}
}
System.out.println(stack.pop());
}
} |
[
7,
15,
13,
17,
6,
13,
41,
13,
17,
41,
13,
20,
17,
12,
13,
30,
41,
13,
20,
42,
4,
18,
13,
30,
14,
4,
18,
13,
30,
41,
13,
4,
18,
13,
4,
13,
13,
30,
41,
13,
4,
18,
13,
41,
13,
4,
13,
41,
13,
4,
13,
35,
13,
34,
17,
1,
4,
13,
2,
13,
13,
3,
34,
17,
1,
4,
13,
2,
13,
13,
3,
34,
17,
1,
4,
13,
2,
13,
13,
3,
4,
18,
18,
13,
13,
4,
13,
23,
13,
12,
13,
30,
14,
2,
13,
2,
18,
13,
13,
17,
30,
4,
18,
18,
13,
13,
17,
29,
0,
18,
13,
13,
13,
40,
13,
23,
13,
12,
13,
30,
14,
2,
13,
17,
30,
4,
18,
18,
13,
13,
17,
29,
40,
17,
40,
13,
41,
13,
18,
13,
13,
29,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
144,
5
],
[
144,
6
],
[
6,
7
],
[
6,
8
],
[
144,
9
],
[
9,
10
],
[
9,
11
],
[
144,
13
],
[
13,
14
],
[
13,
15
],
[
15,
16
],
[
16,
17
],
[
16,
18
],
[
15,
19
],
[
19,
20
],
[
20,
21
],
[
21,
22
],
[
19,
23
],
[
23,
24
],
[
24,
25
],
[
25,
26
],
[
26,
27
],
[
24,
28
],
[
28,
29
],
[
29,
30
],
[
29,
31
],
[
31,
32
],
[
32,
33
],
[
28,
34
],
[
34,
35
],
[
34,
36
],
[
24,
37
],
[
37,
38
],
[
38,
39
],
[
38,
40
],
[
40,
41
],
[
41,
42
],
[
37,
43
],
[
43,
44
],
[
43,
45
],
[
45,
46
],
[
37,
47
],
[
47,
48
],
[
47,
49
],
[
49,
50
],
[
37,
51
],
[
51,
52
],
[
51,
53
],
[
53,
54
],
[
53,
55
],
[
55,
56
],
[
56,
57
],
[
56,
58
],
[
58,
59
],
[
58,
60
],
[
55,
61
],
[
51,
62
],
[
62,
63
],
[
62,
64
],
[
64,
65
],
[
65,
66
],
[
65,
67
],
[
67,
68
],
[
67,
69
],
[
64,
70
],
[
51,
71
],
[
71,
72
],
[
71,
73
],
[
73,
74
],
[
74,
75
],
[
74,
76
],
[
76,
77
],
[
76,
78
],
[
73,
79
],
[
15,
80
],
[
80,
81
],
[
81,
82
],
[
82,
83
],
[
82,
84
],
[
80,
85
],
[
85,
86
],
[
13,
87
],
[
87,
88
],
[
144,
89
],
[
89,
90
],
[
89,
91
],
[
91,
92
],
[
92,
93
],
[
93,
94
],
[
93,
95
],
[
95,
96
],
[
96,
97
],
[
96,
98
],
[
95,
99
],
[
92,
100
],
[
100,
101
],
[
101,
102
],
[
102,
103
],
[
103,
104
],
[
103,
105
],
[
101,
106
],
[
100,
107
],
[
91,
108
],
[
108,
109
],
[
109,
110
],
[
109,
111
],
[
108,
112
],
[
91,
113
],
[
113,
114
],
[
89,
115
],
[
115,
116
],
[
144,
117
],
[
117,
118
],
[
117,
119
],
[
119,
120
],
[
120,
121
],
[
121,
122
],
[
121,
123
],
[
120,
124
],
[
124,
125
],
[
125,
126
],
[
126,
127
],
[
127,
128
],
[
127,
129
],
[
125,
130
],
[
124,
131
],
[
131,
132
],
[
132,
133
],
[
119,
134
],
[
134,
135
],
[
119,
136
],
[
136,
137
],
[
136,
138
],
[
138,
139
],
[
138,
140
],
[
119,
141
],
[
141,
142
],
[
0,
143
],
[
143,
144
],
[
143,
145
]
] | [
"import java.util.Scanner;\n\npublic class Main {\n\tstatic int top = 1;\n\tstatic int[] stack = new int[200];\n\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\twhile (sc.hasNext()) {\n\t\t\tif (sc.hasNextInt()) {\n\t\t\t\tint tmpNum = sc.nextInt();\n\t\t\t\tpop(tmpNum);\n\n\t\t\t} else {\n\t\t\t\tString opr = sc.next();\n\t\t\t\tint a = push();\n\t\t\t\tint b = push();\n\n\t\t\t\tswitch (opr) {\n\t\t\t\tcase \"+\":\n\t\t\t\t\tpop(b + a);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"-\":\n\t\t\t\t\tpop(b - a);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"*\":\n\t\t\t\t\tpop(b * a);\n\t\t\t\t\tbreak;\n\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(push());\n\n\t}\n\n\tstatic void pop(int x) {\n\t\tif (top == stack.length - 1) {\n\t\t\tSystem.err.println(\"スタックが満杯です\");\n\t\t\treturn;\n\t\t}\n\t\tstack[top] = x;\n\t\ttop++;\n\t}\n\n\tstatic int push() {\n\t\tif (top == 0) {\n\t\t\tSystem.err.println(\"スタックが空っぽです\");\n\t\t\treturn -1;\n\t\t}\n\t\ttop--;\n\t\tint ret = stack[top];\n\t\treturn ret;\n\t}\n\n}\n",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\tstatic int top = 1;\n\tstatic int[] stack = new int[200];\n\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\twhile (sc.hasNext()) {\n\t\t\tif (sc.hasNextInt()) {\n\t\t\t\tint tmpNum = sc.nextInt();\n\t\t\t\tpop(tmpNum);\n\n\t\t\t} else {\n\t\t\t\tString opr = sc.next();\n\t\t\t\tint a = push();\n\t\t\t\tint b = push();\n\n\t\t\t\tswitch (opr) {\n\t\t\t\tcase \"+\":\n\t\t\t\t\tpop(b + a);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"-\":\n\t\t\t\t\tpop(b - a);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"*\":\n\t\t\t\t\tpop(b * a);\n\t\t\t\t\tbreak;\n\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(push());\n\n\t}\n\n\tstatic void pop(int x) {\n\t\tif (top == stack.length - 1) {\n\t\t\tSystem.err.println(\"スタックが満杯です\");\n\t\t\treturn;\n\t\t}\n\t\tstack[top] = x;\n\t\ttop++;\n\t}\n\n\tstatic int push() {\n\t\tif (top == 0) {\n\t\t\tSystem.err.println(\"スタックが空っぽです\");\n\t\t\treturn -1;\n\t\t}\n\t\ttop--;\n\t\tint ret = stack[top];\n\t\treturn ret;\n\t}\n\n}",
"Main",
"static int top = 1;",
"top",
"1",
"static int[] stack = new int[200];",
"stack",
"new int[200]",
"200",
"public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\twhile (sc.hasNext()) {\n\t\t\tif (sc.hasNextInt()) {\n\t\t\t\tint tmpNum = sc.nextInt();\n\t\t\t\tpop(tmpNum);\n\n\t\t\t} else {\n\t\t\t\tString opr = sc.next();\n\t\t\t\tint a = push();\n\t\t\t\tint b = push();\n\n\t\t\t\tswitch (opr) {\n\t\t\t\tcase \"+\":\n\t\t\t\t\tpop(b + a);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"-\":\n\t\t\t\t\tpop(b - a);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"*\":\n\t\t\t\t\tpop(b * a);\n\t\t\t\t\tbreak;\n\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(push());\n\n\t}",
"main",
"{\n\t\tScanner sc = new Scanner(System.in);\n\t\twhile (sc.hasNext()) {\n\t\t\tif (sc.hasNextInt()) {\n\t\t\t\tint tmpNum = sc.nextInt();\n\t\t\t\tpop(tmpNum);\n\n\t\t\t} else {\n\t\t\t\tString opr = sc.next();\n\t\t\t\tint a = push();\n\t\t\t\tint b = push();\n\n\t\t\t\tswitch (opr) {\n\t\t\t\tcase \"+\":\n\t\t\t\t\tpop(b + a);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"-\":\n\t\t\t\t\tpop(b - a);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"*\":\n\t\t\t\t\tpop(b * a);\n\t\t\t\t\tbreak;\n\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(push());\n\n\t}",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"while (sc.hasNext()) {\n\t\t\tif (sc.hasNextInt()) {\n\t\t\t\tint tmpNum = sc.nextInt();\n\t\t\t\tpop(tmpNum);\n\n\t\t\t} else {\n\t\t\t\tString opr = sc.next();\n\t\t\t\tint a = push();\n\t\t\t\tint b = push();\n\n\t\t\t\tswitch (opr) {\n\t\t\t\tcase \"+\":\n\t\t\t\t\tpop(b + a);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"-\":\n\t\t\t\t\tpop(b - a);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"*\":\n\t\t\t\t\tpop(b * a);\n\t\t\t\t\tbreak;\n\n\t\t\t\t}\n\n\t\t\t}\n\t\t}",
"sc.hasNext()",
"sc.hasNext",
"sc",
"{\n\t\t\tif (sc.hasNextInt()) {\n\t\t\t\tint tmpNum = sc.nextInt();\n\t\t\t\tpop(tmpNum);\n\n\t\t\t} else {\n\t\t\t\tString opr = sc.next();\n\t\t\t\tint a = push();\n\t\t\t\tint b = push();\n\n\t\t\t\tswitch (opr) {\n\t\t\t\tcase \"+\":\n\t\t\t\t\tpop(b + a);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"-\":\n\t\t\t\t\tpop(b - a);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"*\":\n\t\t\t\t\tpop(b * a);\n\t\t\t\t\tbreak;\n\n\t\t\t\t}\n\n\t\t\t}\n\t\t}",
"if (sc.hasNextInt()) {\n\t\t\t\tint tmpNum = sc.nextInt();\n\t\t\t\tpop(tmpNum);\n\n\t\t\t} else {\n\t\t\t\tString opr = sc.next();\n\t\t\t\tint a = push();\n\t\t\t\tint b = push();\n\n\t\t\t\tswitch (opr) {\n\t\t\t\tcase \"+\":\n\t\t\t\t\tpop(b + a);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"-\":\n\t\t\t\t\tpop(b - a);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"*\":\n\t\t\t\t\tpop(b * a);\n\t\t\t\t\tbreak;\n\n\t\t\t\t}\n\n\t\t\t}",
"sc.hasNextInt()",
"sc.hasNextInt",
"sc",
"{\n\t\t\t\tint tmpNum = sc.nextInt();\n\t\t\t\tpop(tmpNum);\n\n\t\t\t}",
"int tmpNum = sc.nextInt();",
"tmpNum",
"sc.nextInt()",
"sc.nextInt",
"sc",
"pop(tmpNum)",
"pop",
"tmpNum",
"{\n\t\t\t\tString opr = sc.next();\n\t\t\t\tint a = push();\n\t\t\t\tint b = push();\n\n\t\t\t\tswitch (opr) {\n\t\t\t\tcase \"+\":\n\t\t\t\t\tpop(b + a);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"-\":\n\t\t\t\t\tpop(b - a);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"*\":\n\t\t\t\t\tpop(b * a);\n\t\t\t\t\tbreak;\n\n\t\t\t\t}\n\n\t\t\t}",
"String opr = sc.next();",
"opr",
"sc.next()",
"sc.next",
"sc",
"int a = push();",
"a",
"push()",
"push",
"int b = push();",
"b",
"push()",
"push",
"switch (opr) {\n\t\t\t\tcase \"+\":\n\t\t\t\t\tpop(b + a);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"-\":\n\t\t\t\t\tpop(b - a);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"*\":\n\t\t\t\t\tpop(b * a);\n\t\t\t\t\tbreak;\n\n\t\t\t\t}",
"opr",
"case \"+\":",
"\"+\"",
"case \"+\":",
"pop(b + a)",
"pop",
"b + a",
"b",
"a",
"break;",
"case \"-\":",
"\"-\"",
"case \"-\":",
"pop(b - a)",
"pop",
"b - a",
"b",
"a",
"break;",
"case \"*\":",
"\"*\"",
"case \"*\":",
"pop(b * a)",
"pop",
"b * a",
"b",
"a",
"break;",
"System.out.println(push())",
"System.out.println",
"System.out",
"System",
"System.out",
"push()",
"push",
"String[] args",
"args",
"static void pop(int x) {\n\t\tif (top == stack.length - 1) {\n\t\t\tSystem.err.println(\"スタックが満杯です\");\n\t\t\treturn;\n\t\t}\n\t\tstack[top] = x;\n\t\ttop++;\n\t}",
"pop",
"{\n\t\tif (top == stack.length - 1) {\n\t\t\tSystem.err.println(\"スタックが満杯です\");\n\t\t\treturn;\n\t\t}\n\t\tstack[top] = x;\n\t\ttop++;\n\t}",
"if (top == stack.length - 1) {\n\t\t\tSystem.err.println(\"スタックが満杯です\");\n\t\t\treturn;\n\t\t}",
"top == stack.length - 1",
"top",
"stack.length - 1",
"stack.length",
"stack",
"stack.length",
"1",
"{\n\t\t\tSystem.err.println(\"スタックが満杯です\");\n\t\t\treturn;\n\t\t}",
"System.err.println(\"スタックが満杯です\")",
"System.err.println",
"System.err",
"System",
"System.err",
"\"スタックが満杯です\"",
"return;",
"stack[top] = x",
"stack[top]",
"stack",
"top",
"x",
"top++",
"top",
"int x",
"x",
"static int push() {\n\t\tif (top == 0) {\n\t\t\tSystem.err.println(\"スタックが空っぽです\");\n\t\t\treturn -1;\n\t\t}\n\t\ttop--;\n\t\tint ret = stack[top];\n\t\treturn ret;\n\t}",
"push",
"{\n\t\tif (top == 0) {\n\t\t\tSystem.err.println(\"スタックが空っぽです\");\n\t\t\treturn -1;\n\t\t}\n\t\ttop--;\n\t\tint ret = stack[top];\n\t\treturn ret;\n\t}",
"if (top == 0) {\n\t\t\tSystem.err.println(\"スタックが空っぽです\");\n\t\t\treturn -1;\n\t\t}",
"top == 0",
"top",
"0",
"{\n\t\t\tSystem.err.println(\"スタックが空っぽです\");\n\t\t\treturn -1;\n\t\t}",
"System.err.println(\"スタックが空っぽです\")",
"System.err.println",
"System.err",
"System",
"System.err",
"\"スタックが空っぽです\"",
"return -1;",
"-1",
"1",
"top--",
"top",
"int ret = stack[top];",
"ret",
"stack[top]",
"stack",
"top",
"return ret;",
"ret",
"public class Main {\n\tstatic int top = 1;\n\tstatic int[] stack = new int[200];\n\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\twhile (sc.hasNext()) {\n\t\t\tif (sc.hasNextInt()) {\n\t\t\t\tint tmpNum = sc.nextInt();\n\t\t\t\tpop(tmpNum);\n\n\t\t\t} else {\n\t\t\t\tString opr = sc.next();\n\t\t\t\tint a = push();\n\t\t\t\tint b = push();\n\n\t\t\t\tswitch (opr) {\n\t\t\t\tcase \"+\":\n\t\t\t\t\tpop(b + a);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"-\":\n\t\t\t\t\tpop(b - a);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"*\":\n\t\t\t\t\tpop(b * a);\n\t\t\t\t\tbreak;\n\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(push());\n\n\t}\n\n\tstatic void pop(int x) {\n\t\tif (top == stack.length - 1) {\n\t\t\tSystem.err.println(\"スタックが満杯です\");\n\t\t\treturn;\n\t\t}\n\t\tstack[top] = x;\n\t\ttop++;\n\t}\n\n\tstatic int push() {\n\t\tif (top == 0) {\n\t\t\tSystem.err.println(\"スタックが空っぽです\");\n\t\t\treturn -1;\n\t\t}\n\t\ttop--;\n\t\tint ret = stack[top];\n\t\treturn ret;\n\t}\n\n}",
"public class Main {\n\tstatic int top = 1;\n\tstatic int[] stack = new int[200];\n\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\twhile (sc.hasNext()) {\n\t\t\tif (sc.hasNextInt()) {\n\t\t\t\tint tmpNum = sc.nextInt();\n\t\t\t\tpop(tmpNum);\n\n\t\t\t} else {\n\t\t\t\tString opr = sc.next();\n\t\t\t\tint a = push();\n\t\t\t\tint b = push();\n\n\t\t\t\tswitch (opr) {\n\t\t\t\tcase \"+\":\n\t\t\t\t\tpop(b + a);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"-\":\n\t\t\t\t\tpop(b - a);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"*\":\n\t\t\t\t\tpop(b * a);\n\t\t\t\t\tbreak;\n\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(push());\n\n\t}\n\n\tstatic void pop(int x) {\n\t\tif (top == stack.length - 1) {\n\t\t\tSystem.err.println(\"スタックが満杯です\");\n\t\t\treturn;\n\t\t}\n\t\tstack[top] = x;\n\t\ttop++;\n\t}\n\n\tstatic int push() {\n\t\tif (top == 0) {\n\t\t\tSystem.err.println(\"スタックが空っぽです\");\n\t\t\treturn -1;\n\t\t}\n\t\ttop--;\n\t\tint ret = stack[top];\n\t\treturn ret;\n\t}\n\n}",
"Main"
] | import java.util.Scanner;
public class Main {
static int top = 1;
static int[] stack = new int[200];
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
while (sc.hasNext()) {
if (sc.hasNextInt()) {
int tmpNum = sc.nextInt();
pop(tmpNum);
} else {
String opr = sc.next();
int a = push();
int b = push();
switch (opr) {
case "+":
pop(b + a);
break;
case "-":
pop(b - a);
break;
case "*":
pop(b * a);
break;
}
}
}
System.out.println(push());
}
static void pop(int x) {
if (top == stack.length - 1) {
System.err.println("スタックが満杯です");
return;
}
stack[top] = x;
top++;
}
static int push() {
if (top == 0) {
System.err.println("スタックが空っぽです");
return -1;
}
top--;
int ret = stack[top];
return ret;
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
20,
42,
4,
18,
13,
30,
41,
13,
4,
18,
13,
41,
13,
41,
13,
35,
13,
34,
17,
1,
0,
13,
4,
18,
13,
4,
18,
13,
0,
13,
4,
18,
13,
4,
18,
13,
4,
18,
13,
4,
18,
13,
2,
13,
13,
3,
34,
17,
1,
0,
13,
4,
18,
13,
4,
18,
13,
0,
13,
4,
18,
13,
4,
18,
13,
4,
18,
13,
4,
18,
13,
2,
13,
13,
3,
34,
17,
1,
0,
13,
4,
18,
13,
4,
18,
13,
0,
13,
4,
18,
13,
4,
18,
13,
4,
18,
13,
4,
18,
13,
2,
13,
13,
3,
34,
1,
4,
18,
13,
13,
3,
4,
18,
18,
13,
13,
4,
18,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
139,
8
],
[
139,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
12,
14
],
[
11,
15
],
[
15,
16
],
[
15,
17
],
[
11,
18
],
[
18,
19
],
[
19,
20
],
[
20,
21
],
[
18,
22
],
[
22,
23
],
[
23,
24
],
[
23,
25
],
[
25,
26
],
[
26,
27
],
[
22,
28
],
[
28,
29
],
[
22,
30
],
[
30,
31
],
[
22,
32
],
[
32,
33
],
[
32,
34
],
[
34,
35
],
[
34,
36
],
[
36,
37
],
[
37,
38
],
[
37,
39
],
[
39,
40
],
[
40,
41
],
[
39,
42
],
[
42,
43
],
[
43,
44
],
[
36,
45
],
[
45,
46
],
[
45,
47
],
[
47,
48
],
[
48,
49
],
[
47,
50
],
[
50,
51
],
[
51,
52
],
[
36,
53
],
[
53,
54
],
[
54,
55
],
[
53,
56
],
[
56,
57
],
[
57,
58
],
[
56,
59
],
[
59,
60
],
[
59,
61
],
[
36,
62
],
[
32,
63
],
[
63,
64
],
[
63,
65
],
[
65,
66
],
[
66,
67
],
[
66,
68
],
[
68,
69
],
[
69,
70
],
[
68,
71
],
[
71,
72
],
[
72,
73
],
[
65,
74
],
[
74,
75
],
[
74,
76
],
[
76,
77
],
[
77,
78
],
[
76,
79
],
[
79,
80
],
[
80,
81
],
[
65,
82
],
[
82,
83
],
[
83,
84
],
[
82,
85
],
[
85,
86
],
[
86,
87
],
[
85,
88
],
[
88,
89
],
[
88,
90
],
[
65,
91
],
[
32,
92
],
[
92,
93
],
[
92,
94
],
[
94,
95
],
[
95,
96
],
[
95,
97
],
[
97,
98
],
[
98,
99
],
[
97,
100
],
[
100,
101
],
[
101,
102
],
[
94,
103
],
[
103,
104
],
[
103,
105
],
[
105,
106
],
[
106,
107
],
[
105,
108
],
[
108,
109
],
[
109,
110
],
[
94,
111
],
[
111,
112
],
[
112,
113
],
[
111,
114
],
[
114,
115
],
[
115,
116
],
[
114,
117
],
[
117,
118
],
[
117,
119
],
[
94,
120
],
[
32,
121
],
[
121,
122
],
[
122,
123
],
[
123,
124
],
[
124,
125
],
[
123,
126
],
[
122,
127
],
[
11,
128
],
[
128,
129
],
[
129,
130
],
[
130,
131
],
[
130,
132
],
[
128,
133
],
[
133,
134
],
[
134,
135
],
[
9,
136
],
[
136,
137
],
[
0,
138
],
[
138,
139
],
[
138,
140
]
] | [
"import java.io.*;\nimport java.util.*;\n\npublic class Main\n{\n public static void main(String[] args)\n {\n Deque<String> formula = new ArrayDeque<String>();\n Scanner scan = new Scanner(System.in);\n\n while(scan.hasNext())\n {\n String input = scan.next();\n int num2,num1;\n switch(input)\n {\n case \"+\":\n num2 = Integer.parseInt(formula.poll());\n num1 = Integer.parseInt(formula.poll());\n formula.push(String.valueOf(num1+num2));\n break;\n case \"-\":\n num2 = Integer.parseInt(formula.poll());\n num1 = Integer.parseInt(formula.poll());\n formula.push(String.valueOf(num1-num2));\n break;\n case \"*\":\n num2 = Integer.parseInt(formula.poll());\n num1 = Integer.parseInt(formula.poll());\n formula.push(String.valueOf(num1*num2));\n break;\n default:\n formula.push(input);\n break;\n }\n }\n System.out.println(formula.poll());\n }\n}",
"import java.io.*;",
"io.*",
"java",
"import java.util.*;",
"util.*",
"java",
"public class Main\n{\n public static void main(String[] args)\n {\n Deque<String> formula = new ArrayDeque<String>();\n Scanner scan = new Scanner(System.in);\n\n while(scan.hasNext())\n {\n String input = scan.next();\n int num2,num1;\n switch(input)\n {\n case \"+\":\n num2 = Integer.parseInt(formula.poll());\n num1 = Integer.parseInt(formula.poll());\n formula.push(String.valueOf(num1+num2));\n break;\n case \"-\":\n num2 = Integer.parseInt(formula.poll());\n num1 = Integer.parseInt(formula.poll());\n formula.push(String.valueOf(num1-num2));\n break;\n case \"*\":\n num2 = Integer.parseInt(formula.poll());\n num1 = Integer.parseInt(formula.poll());\n formula.push(String.valueOf(num1*num2));\n break;\n default:\n formula.push(input);\n break;\n }\n }\n System.out.println(formula.poll());\n }\n}",
"Main",
"public static void main(String[] args)\n {\n Deque<String> formula = new ArrayDeque<String>();\n Scanner scan = new Scanner(System.in);\n\n while(scan.hasNext())\n {\n String input = scan.next();\n int num2,num1;\n switch(input)\n {\n case \"+\":\n num2 = Integer.parseInt(formula.poll());\n num1 = Integer.parseInt(formula.poll());\n formula.push(String.valueOf(num1+num2));\n break;\n case \"-\":\n num2 = Integer.parseInt(formula.poll());\n num1 = Integer.parseInt(formula.poll());\n formula.push(String.valueOf(num1-num2));\n break;\n case \"*\":\n num2 = Integer.parseInt(formula.poll());\n num1 = Integer.parseInt(formula.poll());\n formula.push(String.valueOf(num1*num2));\n break;\n default:\n formula.push(input);\n break;\n }\n }\n System.out.println(formula.poll());\n }",
"main",
"{\n Deque<String> formula = new ArrayDeque<String>();\n Scanner scan = new Scanner(System.in);\n\n while(scan.hasNext())\n {\n String input = scan.next();\n int num2,num1;\n switch(input)\n {\n case \"+\":\n num2 = Integer.parseInt(formula.poll());\n num1 = Integer.parseInt(formula.poll());\n formula.push(String.valueOf(num1+num2));\n break;\n case \"-\":\n num2 = Integer.parseInt(formula.poll());\n num1 = Integer.parseInt(formula.poll());\n formula.push(String.valueOf(num1-num2));\n break;\n case \"*\":\n num2 = Integer.parseInt(formula.poll());\n num1 = Integer.parseInt(formula.poll());\n formula.push(String.valueOf(num1*num2));\n break;\n default:\n formula.push(input);\n break;\n }\n }\n System.out.println(formula.poll());\n }",
"Deque<String> formula = new ArrayDeque<String>();",
"formula",
"new ArrayDeque<String>()",
"Scanner scan = new Scanner(System.in);",
"scan",
"new Scanner(System.in)",
"while(scan.hasNext())\n {\n String input = scan.next();\n int num2,num1;\n switch(input)\n {\n case \"+\":\n num2 = Integer.parseInt(formula.poll());\n num1 = Integer.parseInt(formula.poll());\n formula.push(String.valueOf(num1+num2));\n break;\n case \"-\":\n num2 = Integer.parseInt(formula.poll());\n num1 = Integer.parseInt(formula.poll());\n formula.push(String.valueOf(num1-num2));\n break;\n case \"*\":\n num2 = Integer.parseInt(formula.poll());\n num1 = Integer.parseInt(formula.poll());\n formula.push(String.valueOf(num1*num2));\n break;\n default:\n formula.push(input);\n break;\n }\n }",
"scan.hasNext()",
"scan.hasNext",
"scan",
"{\n String input = scan.next();\n int num2,num1;\n switch(input)\n {\n case \"+\":\n num2 = Integer.parseInt(formula.poll());\n num1 = Integer.parseInt(formula.poll());\n formula.push(String.valueOf(num1+num2));\n break;\n case \"-\":\n num2 = Integer.parseInt(formula.poll());\n num1 = Integer.parseInt(formula.poll());\n formula.push(String.valueOf(num1-num2));\n break;\n case \"*\":\n num2 = Integer.parseInt(formula.poll());\n num1 = Integer.parseInt(formula.poll());\n formula.push(String.valueOf(num1*num2));\n break;\n default:\n formula.push(input);\n break;\n }\n }",
"String input = scan.next();",
"input",
"scan.next()",
"scan.next",
"scan",
"int num2",
"num2",
"num1;",
"num1",
"switch(input)\n {\n case \"+\":\n num2 = Integer.parseInt(formula.poll());\n num1 = Integer.parseInt(formula.poll());\n formula.push(String.valueOf(num1+num2));\n break;\n case \"-\":\n num2 = Integer.parseInt(formula.poll());\n num1 = Integer.parseInt(formula.poll());\n formula.push(String.valueOf(num1-num2));\n break;\n case \"*\":\n num2 = Integer.parseInt(formula.poll());\n num1 = Integer.parseInt(formula.poll());\n formula.push(String.valueOf(num1*num2));\n break;\n default:\n formula.push(input);\n break;\n }",
"input",
"case \"+\":",
"\"+\"",
"case \"+\":",
"num2 = Integer.parseInt(formula.poll())",
"num2",
"Integer.parseInt(formula.poll())",
"Integer.parseInt",
"Integer",
"formula.poll()",
"formula.poll",
"formula",
"num1 = Integer.parseInt(formula.poll())",
"num1",
"Integer.parseInt(formula.poll())",
"Integer.parseInt",
"Integer",
"formula.poll()",
"formula.poll",
"formula",
"formula.push(String.valueOf(num1+num2))",
"formula.push",
"formula",
"String.valueOf(num1+num2)",
"String.valueOf",
"String",
"num1+num2",
"num1",
"num2",
"break;",
"case \"-\":",
"\"-\"",
"case \"-\":",
"num2 = Integer.parseInt(formula.poll())",
"num2",
"Integer.parseInt(formula.poll())",
"Integer.parseInt",
"Integer",
"formula.poll()",
"formula.poll",
"formula",
"num1 = Integer.parseInt(formula.poll())",
"num1",
"Integer.parseInt(formula.poll())",
"Integer.parseInt",
"Integer",
"formula.poll()",
"formula.poll",
"formula",
"formula.push(String.valueOf(num1-num2))",
"formula.push",
"formula",
"String.valueOf(num1-num2)",
"String.valueOf",
"String",
"num1-num2",
"num1",
"num2",
"break;",
"case \"*\":",
"\"*\"",
"case \"*\":",
"num2 = Integer.parseInt(formula.poll())",
"num2",
"Integer.parseInt(formula.poll())",
"Integer.parseInt",
"Integer",
"formula.poll()",
"formula.poll",
"formula",
"num1 = Integer.parseInt(formula.poll())",
"num1",
"Integer.parseInt(formula.poll())",
"Integer.parseInt",
"Integer",
"formula.poll()",
"formula.poll",
"formula",
"formula.push(String.valueOf(num1*num2))",
"formula.push",
"formula",
"String.valueOf(num1*num2)",
"String.valueOf",
"String",
"num1*num2",
"num1",
"num2",
"break;",
"default:",
"default:",
"formula.push(input)",
"formula.push",
"formula",
"input",
"break;",
"System.out.println(formula.poll())",
"System.out.println",
"System.out",
"System",
"System.out",
"formula.poll()",
"formula.poll",
"formula",
"String[] args",
"args",
"public class Main\n{\n public static void main(String[] args)\n {\n Deque<String> formula = new ArrayDeque<String>();\n Scanner scan = new Scanner(System.in);\n\n while(scan.hasNext())\n {\n String input = scan.next();\n int num2,num1;\n switch(input)\n {\n case \"+\":\n num2 = Integer.parseInt(formula.poll());\n num1 = Integer.parseInt(formula.poll());\n formula.push(String.valueOf(num1+num2));\n break;\n case \"-\":\n num2 = Integer.parseInt(formula.poll());\n num1 = Integer.parseInt(formula.poll());\n formula.push(String.valueOf(num1-num2));\n break;\n case \"*\":\n num2 = Integer.parseInt(formula.poll());\n num1 = Integer.parseInt(formula.poll());\n formula.push(String.valueOf(num1*num2));\n break;\n default:\n formula.push(input);\n break;\n }\n }\n System.out.println(formula.poll());\n }\n}",
"public class Main\n{\n public static void main(String[] args)\n {\n Deque<String> formula = new ArrayDeque<String>();\n Scanner scan = new Scanner(System.in);\n\n while(scan.hasNext())\n {\n String input = scan.next();\n int num2,num1;\n switch(input)\n {\n case \"+\":\n num2 = Integer.parseInt(formula.poll());\n num1 = Integer.parseInt(formula.poll());\n formula.push(String.valueOf(num1+num2));\n break;\n case \"-\":\n num2 = Integer.parseInt(formula.poll());\n num1 = Integer.parseInt(formula.poll());\n formula.push(String.valueOf(num1-num2));\n break;\n case \"*\":\n num2 = Integer.parseInt(formula.poll());\n num1 = Integer.parseInt(formula.poll());\n formula.push(String.valueOf(num1*num2));\n break;\n default:\n formula.push(input);\n break;\n }\n }\n System.out.println(formula.poll());\n }\n}",
"Main"
] | import java.io.*;
import java.util.*;
public class Main
{
public static void main(String[] args)
{
Deque<String> formula = new ArrayDeque<String>();
Scanner scan = new Scanner(System.in);
while(scan.hasNext())
{
String input = scan.next();
int num2,num1;
switch(input)
{
case "+":
num2 = Integer.parseInt(formula.poll());
num1 = Integer.parseInt(formula.poll());
formula.push(String.valueOf(num1+num2));
break;
case "-":
num2 = Integer.parseInt(formula.poll());
num1 = Integer.parseInt(formula.poll());
formula.push(String.valueOf(num1-num2));
break;
case "*":
num2 = Integer.parseInt(formula.poll());
num1 = Integer.parseInt(formula.poll());
formula.push(String.valueOf(num1*num2));
break;
default:
formula.push(input);
break;
}
}
System.out.println(formula.poll());
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
20,
41,
13,
20,
4,
18,
13,
17,
4,
18,
13,
17,
4,
18,
13,
17,
42,
4,
18,
13,
30,
41,
13,
4,
18,
4,
18,
13,
17,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
30,
41,
13,
18,
13,
13,
14,
40,
4,
18,
13,
13,
30,
41,
13,
4,
18,
13,
13,
4,
18,
13,
13,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
14,
4,
18,
13,
17,
30,
4,
18,
13,
2,
13,
13,
14,
4,
18,
13,
17,
30,
4,
18,
13,
2,
13,
13,
30,
4,
18,
13,
2,
13,
13,
4,
18,
18,
13,
13,
4,
18,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
133,
5
],
[
133,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
8,
15
],
[
15,
16
],
[
15,
17
],
[
8,
18
],
[
18,
19
],
[
19,
20
],
[
18,
21
],
[
8,
22
],
[
22,
23
],
[
23,
24
],
[
22,
25
],
[
8,
26
],
[
26,
27
],
[
27,
28
],
[
26,
29
],
[
8,
30
],
[
30,
31
],
[
31,
32
],
[
32,
33
],
[
30,
34
],
[
34,
35
],
[
35,
36
],
[
35,
37
],
[
37,
38
],
[
38,
39
],
[
39,
40
],
[
40,
41
],
[
37,
42
],
[
34,
43
],
[
43,
44
],
[
44,
45
],
[
45,
46
],
[
45,
47
],
[
43,
48
],
[
48,
49
],
[
48,
50
],
[
50,
51
],
[
50,
52
],
[
43,
53
],
[
53,
54
],
[
54,
55
],
[
43,
56
],
[
57,
57
],
[
57,
58
],
[
58,
59
],
[
58,
60
],
[
60,
61
],
[
60,
62
],
[
57,
63
],
[
63,
64
],
[
64,
65
],
[
65,
66
],
[
66,
67
],
[
65,
68
],
[
63,
69
],
[
69,
70
],
[
70,
71
],
[
70,
72
],
[
72,
73
],
[
73,
74
],
[
72,
75
],
[
69,
76
],
[
76,
77
],
[
77,
78
],
[
76,
79
],
[
63,
80
],
[
80,
81
],
[
81,
82
],
[
81,
83
],
[
83,
84
],
[
84,
85
],
[
80,
86
],
[
86,
87
],
[
86,
88
],
[
88,
89
],
[
89,
90
],
[
80,
91
],
[
91,
92
],
[
92,
93
],
[
93,
94
],
[
92,
95
],
[
91,
96
],
[
96,
97
],
[
97,
98
],
[
98,
99
],
[
97,
100
],
[
100,
101
],
[
100,
102
],
[
91,
103
],
[
103,
104
],
[
104,
105
],
[
105,
106
],
[
104,
107
],
[
103,
108
],
[
108,
109
],
[
109,
110
],
[
110,
111
],
[
109,
112
],
[
112,
113
],
[
112,
114
],
[
103,
115
],
[
115,
116
],
[
116,
117
],
[
117,
118
],
[
116,
119
],
[
119,
120
],
[
119,
121
],
[
34,
122
],
[
122,
123
],
[
123,
124
],
[
124,
125
],
[
124,
126
],
[
122,
127
],
[
127,
128
],
[
128,
129
],
[
6,
130
],
[
130,
131
],
[
0,
132
],
[
132,
133
],
[
132,
134
]
] | [
"import java.util.*;\npublic class Main{\n\tpublic static void main(String args[]){\n\t\tStack<Integer> stack = new Stack<Integer>();\n\t\tScanner sc = new Scanner(System.in);\n\t\tSet<String> ops = new HashSet<String>();\n\t\tops.add(\"-\");\n\t\tops.add(\"+\");\n\t\tops.add(\"*\");\n\t\twhile(sc.hasNext()){\n\t\t\tString[] line = sc.nextLine().split(\" \");\n\t\t\tfor(int i=0;i<line.length;i++){\n\t\t\t\tString t =line[i];\n\t\t\t\tif(!ops.contains(t)){\n\t\t\t\t\tint val = Integer.parseInt(t);\n\t\t\t\t\tstack.push(val);\n\t\t\t\t}else{\n\t\t\t\t\tint val1 =stack.pop();\n\t\t\t\t\tint val2 = stack.pop();\n\t\t\t\t\tif(t.equals(\"+\")){\n\t\t\t\t\t\tstack.push(val2+val1);\n\t\t\t\t\t}else if(t.equals(\"-\")){\n\t\t\t\t\t\tstack.push(val2-val1);\n\t\t\t\t\t}else{\n\t\t\t\t\t\tstack.push(val2*val1);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(stack.peek());\n\t\t}\n\t}\n\n}",
"import java.util.*;",
"util.*",
"java",
"public class Main{\n\tpublic static void main(String args[]){\n\t\tStack<Integer> stack = new Stack<Integer>();\n\t\tScanner sc = new Scanner(System.in);\n\t\tSet<String> ops = new HashSet<String>();\n\t\tops.add(\"-\");\n\t\tops.add(\"+\");\n\t\tops.add(\"*\");\n\t\twhile(sc.hasNext()){\n\t\t\tString[] line = sc.nextLine().split(\" \");\n\t\t\tfor(int i=0;i<line.length;i++){\n\t\t\t\tString t =line[i];\n\t\t\t\tif(!ops.contains(t)){\n\t\t\t\t\tint val = Integer.parseInt(t);\n\t\t\t\t\tstack.push(val);\n\t\t\t\t}else{\n\t\t\t\t\tint val1 =stack.pop();\n\t\t\t\t\tint val2 = stack.pop();\n\t\t\t\t\tif(t.equals(\"+\")){\n\t\t\t\t\t\tstack.push(val2+val1);\n\t\t\t\t\t}else if(t.equals(\"-\")){\n\t\t\t\t\t\tstack.push(val2-val1);\n\t\t\t\t\t}else{\n\t\t\t\t\t\tstack.push(val2*val1);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(stack.peek());\n\t\t}\n\t}\n\n}",
"Main",
"public static void main(String args[]){\n\t\tStack<Integer> stack = new Stack<Integer>();\n\t\tScanner sc = new Scanner(System.in);\n\t\tSet<String> ops = new HashSet<String>();\n\t\tops.add(\"-\");\n\t\tops.add(\"+\");\n\t\tops.add(\"*\");\n\t\twhile(sc.hasNext()){\n\t\t\tString[] line = sc.nextLine().split(\" \");\n\t\t\tfor(int i=0;i<line.length;i++){\n\t\t\t\tString t =line[i];\n\t\t\t\tif(!ops.contains(t)){\n\t\t\t\t\tint val = Integer.parseInt(t);\n\t\t\t\t\tstack.push(val);\n\t\t\t\t}else{\n\t\t\t\t\tint val1 =stack.pop();\n\t\t\t\t\tint val2 = stack.pop();\n\t\t\t\t\tif(t.equals(\"+\")){\n\t\t\t\t\t\tstack.push(val2+val1);\n\t\t\t\t\t}else if(t.equals(\"-\")){\n\t\t\t\t\t\tstack.push(val2-val1);\n\t\t\t\t\t}else{\n\t\t\t\t\t\tstack.push(val2*val1);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(stack.peek());\n\t\t}\n\t}",
"main",
"{\n\t\tStack<Integer> stack = new Stack<Integer>();\n\t\tScanner sc = new Scanner(System.in);\n\t\tSet<String> ops = new HashSet<String>();\n\t\tops.add(\"-\");\n\t\tops.add(\"+\");\n\t\tops.add(\"*\");\n\t\twhile(sc.hasNext()){\n\t\t\tString[] line = sc.nextLine().split(\" \");\n\t\t\tfor(int i=0;i<line.length;i++){\n\t\t\t\tString t =line[i];\n\t\t\t\tif(!ops.contains(t)){\n\t\t\t\t\tint val = Integer.parseInt(t);\n\t\t\t\t\tstack.push(val);\n\t\t\t\t}else{\n\t\t\t\t\tint val1 =stack.pop();\n\t\t\t\t\tint val2 = stack.pop();\n\t\t\t\t\tif(t.equals(\"+\")){\n\t\t\t\t\t\tstack.push(val2+val1);\n\t\t\t\t\t}else if(t.equals(\"-\")){\n\t\t\t\t\t\tstack.push(val2-val1);\n\t\t\t\t\t}else{\n\t\t\t\t\t\tstack.push(val2*val1);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(stack.peek());\n\t\t}\n\t}",
"Stack<Integer> stack = new Stack<Integer>();",
"stack",
"new Stack<Integer>()",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"Set<String> ops = new HashSet<String>();",
"ops",
"new HashSet<String>()",
"ops.add(\"-\")",
"ops.add",
"ops",
"\"-\"",
"ops.add(\"+\")",
"ops.add",
"ops",
"\"+\"",
"ops.add(\"*\")",
"ops.add",
"ops",
"\"*\"",
"while(sc.hasNext()){\n\t\t\tString[] line = sc.nextLine().split(\" \");\n\t\t\tfor(int i=0;i<line.length;i++){\n\t\t\t\tString t =line[i];\n\t\t\t\tif(!ops.contains(t)){\n\t\t\t\t\tint val = Integer.parseInt(t);\n\t\t\t\t\tstack.push(val);\n\t\t\t\t}else{\n\t\t\t\t\tint val1 =stack.pop();\n\t\t\t\t\tint val2 = stack.pop();\n\t\t\t\t\tif(t.equals(\"+\")){\n\t\t\t\t\t\tstack.push(val2+val1);\n\t\t\t\t\t}else if(t.equals(\"-\")){\n\t\t\t\t\t\tstack.push(val2-val1);\n\t\t\t\t\t}else{\n\t\t\t\t\t\tstack.push(val2*val1);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(stack.peek());\n\t\t}",
"sc.hasNext()",
"sc.hasNext",
"sc",
"{\n\t\t\tString[] line = sc.nextLine().split(\" \");\n\t\t\tfor(int i=0;i<line.length;i++){\n\t\t\t\tString t =line[i];\n\t\t\t\tif(!ops.contains(t)){\n\t\t\t\t\tint val = Integer.parseInt(t);\n\t\t\t\t\tstack.push(val);\n\t\t\t\t}else{\n\t\t\t\t\tint val1 =stack.pop();\n\t\t\t\t\tint val2 = stack.pop();\n\t\t\t\t\tif(t.equals(\"+\")){\n\t\t\t\t\t\tstack.push(val2+val1);\n\t\t\t\t\t}else if(t.equals(\"-\")){\n\t\t\t\t\t\tstack.push(val2-val1);\n\t\t\t\t\t}else{\n\t\t\t\t\t\tstack.push(val2*val1);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(stack.peek());\n\t\t}",
"String[] line = sc.nextLine().split(\" \");",
"line",
"sc.nextLine().split(\" \")",
"sc.nextLine().split",
"sc.nextLine()",
"sc.nextLine",
"sc",
"\" \"",
"for(int i=0;i<line.length;i++){\n\t\t\t\tString t =line[i];\n\t\t\t\tif(!ops.contains(t)){\n\t\t\t\t\tint val = Integer.parseInt(t);\n\t\t\t\t\tstack.push(val);\n\t\t\t\t}else{\n\t\t\t\t\tint val1 =stack.pop();\n\t\t\t\t\tint val2 = stack.pop();\n\t\t\t\t\tif(t.equals(\"+\")){\n\t\t\t\t\t\tstack.push(val2+val1);\n\t\t\t\t\t}else if(t.equals(\"-\")){\n\t\t\t\t\t\tstack.push(val2-val1);\n\t\t\t\t\t}else{\n\t\t\t\t\t\tstack.push(val2*val1);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<line.length",
"i",
"line.length",
"line",
"line.length",
"i++",
"i++",
"i",
"{\n\t\t\t\tString t =line[i];\n\t\t\t\tif(!ops.contains(t)){\n\t\t\t\t\tint val = Integer.parseInt(t);\n\t\t\t\t\tstack.push(val);\n\t\t\t\t}else{\n\t\t\t\t\tint val1 =stack.pop();\n\t\t\t\t\tint val2 = stack.pop();\n\t\t\t\t\tif(t.equals(\"+\")){\n\t\t\t\t\t\tstack.push(val2+val1);\n\t\t\t\t\t}else if(t.equals(\"-\")){\n\t\t\t\t\t\tstack.push(val2-val1);\n\t\t\t\t\t}else{\n\t\t\t\t\t\tstack.push(val2*val1);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}",
"{\n\t\t\t\tString t =line[i];\n\t\t\t\tif(!ops.contains(t)){\n\t\t\t\t\tint val = Integer.parseInt(t);\n\t\t\t\t\tstack.push(val);\n\t\t\t\t}else{\n\t\t\t\t\tint val1 =stack.pop();\n\t\t\t\t\tint val2 = stack.pop();\n\t\t\t\t\tif(t.equals(\"+\")){\n\t\t\t\t\t\tstack.push(val2+val1);\n\t\t\t\t\t}else if(t.equals(\"-\")){\n\t\t\t\t\t\tstack.push(val2-val1);\n\t\t\t\t\t}else{\n\t\t\t\t\t\tstack.push(val2*val1);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}",
"String t =line[i];",
"t",
"line[i]",
"line",
"i",
"if(!ops.contains(t)){\n\t\t\t\t\tint val = Integer.parseInt(t);\n\t\t\t\t\tstack.push(val);\n\t\t\t\t}else{\n\t\t\t\t\tint val1 =stack.pop();\n\t\t\t\t\tint val2 = stack.pop();\n\t\t\t\t\tif(t.equals(\"+\")){\n\t\t\t\t\t\tstack.push(val2+val1);\n\t\t\t\t\t}else if(t.equals(\"-\")){\n\t\t\t\t\t\tstack.push(val2-val1);\n\t\t\t\t\t}else{\n\t\t\t\t\t\tstack.push(val2*val1);\n\t\t\t\t\t}\n\t\t\t\t}",
"!ops.contains(t)",
"ops.contains(t)",
"ops.contains",
"ops",
"t",
"{\n\t\t\t\t\tint val = Integer.parseInt(t);\n\t\t\t\t\tstack.push(val);\n\t\t\t\t}",
"int val = Integer.parseInt(t);",
"val",
"Integer.parseInt(t)",
"Integer.parseInt",
"Integer",
"t",
"stack.push(val)",
"stack.push",
"stack",
"val",
"{\n\t\t\t\t\tint val1 =stack.pop();\n\t\t\t\t\tint val2 = stack.pop();\n\t\t\t\t\tif(t.equals(\"+\")){\n\t\t\t\t\t\tstack.push(val2+val1);\n\t\t\t\t\t}else if(t.equals(\"-\")){\n\t\t\t\t\t\tstack.push(val2-val1);\n\t\t\t\t\t}else{\n\t\t\t\t\t\tstack.push(val2*val1);\n\t\t\t\t\t}\n\t\t\t\t}",
"int val1 =stack.pop();",
"val1",
"stack.pop()",
"stack.pop",
"stack",
"int val2 = stack.pop();",
"val2",
"stack.pop()",
"stack.pop",
"stack",
"if(t.equals(\"+\")){\n\t\t\t\t\t\tstack.push(val2+val1);\n\t\t\t\t\t}else if(t.equals(\"-\")){\n\t\t\t\t\t\tstack.push(val2-val1);\n\t\t\t\t\t}else{\n\t\t\t\t\t\tstack.push(val2*val1);\n\t\t\t\t\t}",
"t.equals(\"+\")",
"t.equals",
"t",
"\"+\"",
"{\n\t\t\t\t\t\tstack.push(val2+val1);\n\t\t\t\t\t}",
"stack.push(val2+val1)",
"stack.push",
"stack",
"val2+val1",
"val2",
"val1",
"if(t.equals(\"-\")){\n\t\t\t\t\t\tstack.push(val2-val1);\n\t\t\t\t\t}else{\n\t\t\t\t\t\tstack.push(val2*val1);\n\t\t\t\t\t}",
"t.equals(\"-\")",
"t.equals",
"t",
"\"-\"",
"{\n\t\t\t\t\t\tstack.push(val2-val1);\n\t\t\t\t\t}",
"stack.push(val2-val1)",
"stack.push",
"stack",
"val2-val1",
"val2",
"val1",
"{\n\t\t\t\t\t\tstack.push(val2*val1);\n\t\t\t\t\t}",
"stack.push(val2*val1)",
"stack.push",
"stack",
"val2*val1",
"val2",
"val1",
"System.out.println(stack.peek())",
"System.out.println",
"System.out",
"System",
"System.out",
"stack.peek()",
"stack.peek",
"stack",
"String args[]",
"args",
"public class Main{\n\tpublic static void main(String args[]){\n\t\tStack<Integer> stack = new Stack<Integer>();\n\t\tScanner sc = new Scanner(System.in);\n\t\tSet<String> ops = new HashSet<String>();\n\t\tops.add(\"-\");\n\t\tops.add(\"+\");\n\t\tops.add(\"*\");\n\t\twhile(sc.hasNext()){\n\t\t\tString[] line = sc.nextLine().split(\" \");\n\t\t\tfor(int i=0;i<line.length;i++){\n\t\t\t\tString t =line[i];\n\t\t\t\tif(!ops.contains(t)){\n\t\t\t\t\tint val = Integer.parseInt(t);\n\t\t\t\t\tstack.push(val);\n\t\t\t\t}else{\n\t\t\t\t\tint val1 =stack.pop();\n\t\t\t\t\tint val2 = stack.pop();\n\t\t\t\t\tif(t.equals(\"+\")){\n\t\t\t\t\t\tstack.push(val2+val1);\n\t\t\t\t\t}else if(t.equals(\"-\")){\n\t\t\t\t\t\tstack.push(val2-val1);\n\t\t\t\t\t}else{\n\t\t\t\t\t\tstack.push(val2*val1);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(stack.peek());\n\t\t}\n\t}\n\n}",
"public class Main{\n\tpublic static void main(String args[]){\n\t\tStack<Integer> stack = new Stack<Integer>();\n\t\tScanner sc = new Scanner(System.in);\n\t\tSet<String> ops = new HashSet<String>();\n\t\tops.add(\"-\");\n\t\tops.add(\"+\");\n\t\tops.add(\"*\");\n\t\twhile(sc.hasNext()){\n\t\t\tString[] line = sc.nextLine().split(\" \");\n\t\t\tfor(int i=0;i<line.length;i++){\n\t\t\t\tString t =line[i];\n\t\t\t\tif(!ops.contains(t)){\n\t\t\t\t\tint val = Integer.parseInt(t);\n\t\t\t\t\tstack.push(val);\n\t\t\t\t}else{\n\t\t\t\t\tint val1 =stack.pop();\n\t\t\t\t\tint val2 = stack.pop();\n\t\t\t\t\tif(t.equals(\"+\")){\n\t\t\t\t\t\tstack.push(val2+val1);\n\t\t\t\t\t}else if(t.equals(\"-\")){\n\t\t\t\t\t\tstack.push(val2-val1);\n\t\t\t\t\t}else{\n\t\t\t\t\t\tstack.push(val2*val1);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(stack.peek());\n\t\t}\n\t}\n\n}",
"Main"
] | import java.util.*;
public class Main{
public static void main(String args[]){
Stack<Integer> stack = new Stack<Integer>();
Scanner sc = new Scanner(System.in);
Set<String> ops = new HashSet<String>();
ops.add("-");
ops.add("+");
ops.add("*");
while(sc.hasNext()){
String[] line = sc.nextLine().split(" ");
for(int i=0;i<line.length;i++){
String t =line[i];
if(!ops.contains(t)){
int val = Integer.parseInt(t);
stack.push(val);
}else{
int val1 =stack.pop();
int val2 = stack.pop();
if(t.equals("+")){
stack.push(val2+val1);
}else if(t.equals("-")){
stack.push(val2-val1);
}else{
stack.push(val2*val1);
}
}
}
System.out.println(stack.peek());
}
}
} |
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
20,
4,
18,
18,
13,
13,
4,
18,
13,
23,
13,
6,
13,
41,
13,
41,
13,
20,
17,
41,
13,
41,
13,
41,
13,
41,
13,
17,
12,
13,
30,
0,
18,
36,
13,
13,
23,
13,
12,
13,
30,
41,
13,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
18,
13,
13,
17,
0,
13,
2,
13,
17,
0,
13,
2,
13,
17,
14,
2,
13,
17,
30,
0,
18,
13,
13,
2,
18,
13,
13,
18,
13,
13,
40,
13,
14,
2,
13,
17,
30,
0,
18,
13,
13,
2,
18,
13,
13,
18,
13,
13,
40,
13,
14,
2,
13,
17,
30,
0,
18,
13,
13,
2,
18,
13,
13,
18,
13,
13,
40,
13,
30,
0,
18,
13,
13,
4,
18,
13,
18,
13,
13,
40,
13,
0,
13,
18,
13,
17,
29,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
171,
11
],
[
171,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
15,
17
],
[
14,
18
],
[
18,
19
],
[
18,
20
],
[
14,
21
],
[
21,
22
],
[
22,
23
],
[
23,
24
],
[
23,
25
],
[
21,
26
],
[
26,
27
],
[
27,
28
],
[
12,
29
],
[
29,
30
],
[
0,
31
],
[
31,
32
],
[
31,
33
],
[
33,
34
],
[
31,
35
],
[
35,
36
],
[
35,
37
],
[
31,
39
],
[
39,
40
],
[
31,
41
],
[
41,
42
],
[
31,
43
],
[
43,
44
],
[
31,
45
],
[
45,
46
],
[
45,
47
],
[
31,
48
],
[
48,
49
],
[
48,
50
],
[
50,
51
],
[
51,
52
],
[
52,
53
],
[
52,
54
],
[
51,
55
],
[
48,
56
],
[
56,
57
],
[
31,
58
],
[
58,
59
],
[
58,
60
],
[
60,
61
],
[
61,
62
],
[
60,
63
],
[
63,
64
],
[
64,
65
],
[
65,
66
],
[
65,
67
],
[
63,
68
],
[
68,
69
],
[
68,
70
],
[
70,
71
],
[
70,
72
],
[
63,
73
],
[
73,
74
],
[
74,
75
],
[
63,
76
],
[
77,
77
],
[
77,
78
],
[
78,
79
],
[
78,
80
],
[
80,
81
],
[
81,
82
],
[
82,
83
],
[
82,
84
],
[
80,
85
],
[
77,
86
],
[
86,
87
],
[
86,
88
],
[
88,
89
],
[
88,
90
],
[
77,
91
],
[
91,
92
],
[
91,
93
],
[
93,
94
],
[
93,
95
],
[
77,
96
],
[
96,
97
],
[
97,
98
],
[
97,
99
],
[
96,
100
],
[
100,
101
],
[
101,
102
],
[
102,
103
],
[
102,
104
],
[
101,
105
],
[
105,
106
],
[
106,
107
],
[
106,
108
],
[
105,
109
],
[
109,
110
],
[
109,
111
],
[
100,
112
],
[
112,
113
],
[
96,
114
],
[
114,
115
],
[
115,
116
],
[
115,
117
],
[
114,
118
],
[
118,
119
],
[
119,
120
],
[
120,
121
],
[
120,
122
],
[
119,
123
],
[
123,
124
],
[
124,
125
],
[
124,
126
],
[
123,
127
],
[
127,
128
],
[
127,
129
],
[
118,
130
],
[
130,
131
],
[
114,
132
],
[
132,
133
],
[
133,
134
],
[
133,
135
],
[
132,
136
],
[
136,
137
],
[
137,
138
],
[
138,
139
],
[
138,
140
],
[
137,
141
],
[
141,
142
],
[
142,
143
],
[
142,
144
],
[
141,
145
],
[
145,
146
],
[
145,
147
],
[
136,
148
],
[
148,
149
],
[
132,
150
],
[
150,
151
],
[
151,
152
],
[
152,
153
],
[
152,
154
],
[
151,
155
],
[
155,
156
],
[
156,
157
],
[
155,
158
],
[
158,
159
],
[
158,
160
],
[
150,
161
],
[
161,
162
],
[
60,
163
],
[
163,
164
],
[
163,
165
],
[
165,
166
],
[
165,
167
],
[
60,
168
],
[
168,
169
],
[
0,
170
],
[
170,
171
],
[
170,
172
]
] | [
"import java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\n\npublic class Main {\n\tpublic static void main(String[] args) throws IOException {\n\t\tBufferedReader in = new BufferedReader(new InputStreamReader(System.in));\n\t\tStackSub readDataArr = new StackSub(in.readLine().split(\" \"));\n\t\tSystem.out.println(readDataArr.calcData());\n\t}\n}\n\nclass StackSub {\n\tprivate String[] readData;\n\tprivate int[] stack = new int[100];\n\tprivate int ans, operand1, operand2, pointer = 0;\n\n\tStackSub(String[] readData) {\n\t\tthis.readData = readData;\n\t}\n\n\tpublic int calcData() {\n\t\tchar tempCharData;\n\t\tfor (int i = 0; i < readData.length; i++) {\n\t\t\ttempCharData = readData[i].charAt(0);\n\t\t\toperand1 = pointer - 2;\n\t\t\toperand2 = pointer - 1;\n\n\t\t\tif (tempCharData == '+') {\n\t\t\t\tstack[operand1] = stack[operand1] + stack[operand2];\n\t\t\t\tpointer--;\n\t\t\t} else if (tempCharData == '-') {\n\t\t\t\tstack[operand1] = stack[operand1] - stack[operand2];\n\t\t\t\tpointer--;\n\t\t\t} else if (tempCharData == '*') {\n\t\t\t\tstack[operand1] = stack[operand1] * stack[operand2];\n\t\t\t\tpointer--;\n\t\t\t} else {\n\t\t\t\tstack[pointer] = Integer.parseInt(readData[i]);\n\t\t\t\tpointer++;\n\t\t\t}\n\t\t}\n\t\tans = stack[0];\n\t\treturn ans;\n\t}\n}",
"import java.io.BufferedReader;",
"BufferedReader",
"java.io",
"import java.io.IOException;",
"IOException",
"java.io",
"import java.io.InputStreamReader;",
"InputStreamReader",
"java.io",
"public class Main {\n\tpublic static void main(String[] args) throws IOException {\n\t\tBufferedReader in = new BufferedReader(new InputStreamReader(System.in));\n\t\tStackSub readDataArr = new StackSub(in.readLine().split(\" \"));\n\t\tSystem.out.println(readDataArr.calcData());\n\t}\n}",
"Main",
"public static void main(String[] args) throws IOException {\n\t\tBufferedReader in = new BufferedReader(new InputStreamReader(System.in));\n\t\tStackSub readDataArr = new StackSub(in.readLine().split(\" \"));\n\t\tSystem.out.println(readDataArr.calcData());\n\t}",
"main",
"{\n\t\tBufferedReader in = new BufferedReader(new InputStreamReader(System.in));\n\t\tStackSub readDataArr = new StackSub(in.readLine().split(\" \"));\n\t\tSystem.out.println(readDataArr.calcData());\n\t}",
"BufferedReader in = new BufferedReader(new InputStreamReader(System.in));",
"in",
"new BufferedReader(new InputStreamReader(System.in))",
"StackSub readDataArr = new StackSub(in.readLine().split(\" \"));",
"readDataArr",
"new StackSub(in.readLine().split(\" \"))",
"System.out.println(readDataArr.calcData())",
"System.out.println",
"System.out",
"System",
"System.out",
"readDataArr.calcData()",
"readDataArr.calcData",
"readDataArr",
"String[] args",
"args",
"class StackSub {\n\tprivate String[] readData;\n\tprivate int[] stack = new int[100];\n\tprivate int ans, operand1, operand2, pointer = 0;\n\n\tStackSub(String[] readData) {\n\t\tthis.readData = readData;\n\t}\n\n\tpublic int calcData() {\n\t\tchar tempCharData;\n\t\tfor (int i = 0; i < readData.length; i++) {\n\t\t\ttempCharData = readData[i].charAt(0);\n\t\t\toperand1 = pointer - 2;\n\t\t\toperand2 = pointer - 1;\n\n\t\t\tif (tempCharData == '+') {\n\t\t\t\tstack[operand1] = stack[operand1] + stack[operand2];\n\t\t\t\tpointer--;\n\t\t\t} else if (tempCharData == '-') {\n\t\t\t\tstack[operand1] = stack[operand1] - stack[operand2];\n\t\t\t\tpointer--;\n\t\t\t} else if (tempCharData == '*') {\n\t\t\t\tstack[operand1] = stack[operand1] * stack[operand2];\n\t\t\t\tpointer--;\n\t\t\t} else {\n\t\t\t\tstack[pointer] = Integer.parseInt(readData[i]);\n\t\t\t\tpointer++;\n\t\t\t}\n\t\t}\n\t\tans = stack[0];\n\t\treturn ans;\n\t}\n}",
"StackSub",
"private String[] readData;",
"readData",
"private int[] stack = new int[100];",
"stack",
"new int[100]",
"100",
"private int ans",
"ans",
"operand1",
"operand1",
"operand2",
"operand2",
"pointer = 0;",
"pointer",
"0",
"StackSub(String[] readData) {\n\t\tthis.readData = readData;\n\t}",
"StackSub",
"{\n\t\tthis.readData = readData;\n\t}",
"this.readData = readData",
"this.readData",
"this",
"this.readData",
"readData",
"String[] readData",
"readData",
"public int calcData() {\n\t\tchar tempCharData;\n\t\tfor (int i = 0; i < readData.length; i++) {\n\t\t\ttempCharData = readData[i].charAt(0);\n\t\t\toperand1 = pointer - 2;\n\t\t\toperand2 = pointer - 1;\n\n\t\t\tif (tempCharData == '+') {\n\t\t\t\tstack[operand1] = stack[operand1] + stack[operand2];\n\t\t\t\tpointer--;\n\t\t\t} else if (tempCharData == '-') {\n\t\t\t\tstack[operand1] = stack[operand1] - stack[operand2];\n\t\t\t\tpointer--;\n\t\t\t} else if (tempCharData == '*') {\n\t\t\t\tstack[operand1] = stack[operand1] * stack[operand2];\n\t\t\t\tpointer--;\n\t\t\t} else {\n\t\t\t\tstack[pointer] = Integer.parseInt(readData[i]);\n\t\t\t\tpointer++;\n\t\t\t}\n\t\t}\n\t\tans = stack[0];\n\t\treturn ans;\n\t}",
"calcData",
"{\n\t\tchar tempCharData;\n\t\tfor (int i = 0; i < readData.length; i++) {\n\t\t\ttempCharData = readData[i].charAt(0);\n\t\t\toperand1 = pointer - 2;\n\t\t\toperand2 = pointer - 1;\n\n\t\t\tif (tempCharData == '+') {\n\t\t\t\tstack[operand1] = stack[operand1] + stack[operand2];\n\t\t\t\tpointer--;\n\t\t\t} else if (tempCharData == '-') {\n\t\t\t\tstack[operand1] = stack[operand1] - stack[operand2];\n\t\t\t\tpointer--;\n\t\t\t} else if (tempCharData == '*') {\n\t\t\t\tstack[operand1] = stack[operand1] * stack[operand2];\n\t\t\t\tpointer--;\n\t\t\t} else {\n\t\t\t\tstack[pointer] = Integer.parseInt(readData[i]);\n\t\t\t\tpointer++;\n\t\t\t}\n\t\t}\n\t\tans = stack[0];\n\t\treturn ans;\n\t}",
"char tempCharData;",
"tempCharData",
"for (int i = 0; i < readData.length; i++) {\n\t\t\ttempCharData = readData[i].charAt(0);\n\t\t\toperand1 = pointer - 2;\n\t\t\toperand2 = pointer - 1;\n\n\t\t\tif (tempCharData == '+') {\n\t\t\t\tstack[operand1] = stack[operand1] + stack[operand2];\n\t\t\t\tpointer--;\n\t\t\t} else if (tempCharData == '-') {\n\t\t\t\tstack[operand1] = stack[operand1] - stack[operand2];\n\t\t\t\tpointer--;\n\t\t\t} else if (tempCharData == '*') {\n\t\t\t\tstack[operand1] = stack[operand1] * stack[operand2];\n\t\t\t\tpointer--;\n\t\t\t} else {\n\t\t\t\tstack[pointer] = Integer.parseInt(readData[i]);\n\t\t\t\tpointer++;\n\t\t\t}\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < readData.length",
"i",
"readData.length",
"readData",
"readData.length",
"i++",
"i++",
"i",
"{\n\t\t\ttempCharData = readData[i].charAt(0);\n\t\t\toperand1 = pointer - 2;\n\t\t\toperand2 = pointer - 1;\n\n\t\t\tif (tempCharData == '+') {\n\t\t\t\tstack[operand1] = stack[operand1] + stack[operand2];\n\t\t\t\tpointer--;\n\t\t\t} else if (tempCharData == '-') {\n\t\t\t\tstack[operand1] = stack[operand1] - stack[operand2];\n\t\t\t\tpointer--;\n\t\t\t} else if (tempCharData == '*') {\n\t\t\t\tstack[operand1] = stack[operand1] * stack[operand2];\n\t\t\t\tpointer--;\n\t\t\t} else {\n\t\t\t\tstack[pointer] = Integer.parseInt(readData[i]);\n\t\t\t\tpointer++;\n\t\t\t}\n\t\t}",
"{\n\t\t\ttempCharData = readData[i].charAt(0);\n\t\t\toperand1 = pointer - 2;\n\t\t\toperand2 = pointer - 1;\n\n\t\t\tif (tempCharData == '+') {\n\t\t\t\tstack[operand1] = stack[operand1] + stack[operand2];\n\t\t\t\tpointer--;\n\t\t\t} else if (tempCharData == '-') {\n\t\t\t\tstack[operand1] = stack[operand1] - stack[operand2];\n\t\t\t\tpointer--;\n\t\t\t} else if (tempCharData == '*') {\n\t\t\t\tstack[operand1] = stack[operand1] * stack[operand2];\n\t\t\t\tpointer--;\n\t\t\t} else {\n\t\t\t\tstack[pointer] = Integer.parseInt(readData[i]);\n\t\t\t\tpointer++;\n\t\t\t}\n\t\t}",
"tempCharData = readData[i].charAt(0)",
"tempCharData",
"readData[i].charAt(0)",
"readData[i].charAt",
"readData[i]",
"readData",
"i",
"0",
"operand1 = pointer - 2",
"operand1",
"pointer - 2",
"pointer",
"2",
"operand2 = pointer - 1",
"operand2",
"pointer - 1",
"pointer",
"1",
"if (tempCharData == '+') {\n\t\t\t\tstack[operand1] = stack[operand1] + stack[operand2];\n\t\t\t\tpointer--;\n\t\t\t} else if (tempCharData == '-') {\n\t\t\t\tstack[operand1] = stack[operand1] - stack[operand2];\n\t\t\t\tpointer--;\n\t\t\t} else if (tempCharData == '*') {\n\t\t\t\tstack[operand1] = stack[operand1] * stack[operand2];\n\t\t\t\tpointer--;\n\t\t\t} else {\n\t\t\t\tstack[pointer] = Integer.parseInt(readData[i]);\n\t\t\t\tpointer++;\n\t\t\t}",
"tempCharData == '+'",
"tempCharData",
"'+'",
"{\n\t\t\t\tstack[operand1] = stack[operand1] + stack[operand2];\n\t\t\t\tpointer--;\n\t\t\t}",
"stack[operand1] = stack[operand1] + stack[operand2]",
"stack[operand1]",
"stack",
"operand1",
"stack[operand1] + stack[operand2]",
"stack[operand1]",
"stack",
"operand1",
"stack[operand2]",
"stack",
"operand2",
"pointer--",
"pointer",
"if (tempCharData == '-') {\n\t\t\t\tstack[operand1] = stack[operand1] - stack[operand2];\n\t\t\t\tpointer--;\n\t\t\t} else if (tempCharData == '*') {\n\t\t\t\tstack[operand1] = stack[operand1] * stack[operand2];\n\t\t\t\tpointer--;\n\t\t\t} else {\n\t\t\t\tstack[pointer] = Integer.parseInt(readData[i]);\n\t\t\t\tpointer++;\n\t\t\t}",
"tempCharData == '-'",
"tempCharData",
"'-'",
"{\n\t\t\t\tstack[operand1] = stack[operand1] - stack[operand2];\n\t\t\t\tpointer--;\n\t\t\t}",
"stack[operand1] = stack[operand1] - stack[operand2]",
"stack[operand1]",
"stack",
"operand1",
"stack[operand1] - stack[operand2]",
"stack[operand1]",
"stack",
"operand1",
"stack[operand2]",
"stack",
"operand2",
"pointer--",
"pointer",
"if (tempCharData == '*') {\n\t\t\t\tstack[operand1] = stack[operand1] * stack[operand2];\n\t\t\t\tpointer--;\n\t\t\t} else {\n\t\t\t\tstack[pointer] = Integer.parseInt(readData[i]);\n\t\t\t\tpointer++;\n\t\t\t}",
"tempCharData == '*'",
"tempCharData",
"'*'",
"{\n\t\t\t\tstack[operand1] = stack[operand1] * stack[operand2];\n\t\t\t\tpointer--;\n\t\t\t}",
"stack[operand1] = stack[operand1] * stack[operand2]",
"stack[operand1]",
"stack",
"operand1",
"stack[operand1] * stack[operand2]",
"stack[operand1]",
"stack",
"operand1",
"stack[operand2]",
"stack",
"operand2",
"pointer--",
"pointer",
"{\n\t\t\t\tstack[pointer] = Integer.parseInt(readData[i]);\n\t\t\t\tpointer++;\n\t\t\t}",
"stack[pointer] = Integer.parseInt(readData[i])",
"stack[pointer]",
"stack",
"pointer",
"Integer.parseInt(readData[i])",
"Integer.parseInt",
"Integer",
"readData[i]",
"readData",
"i",
"pointer++",
"pointer",
"ans = stack[0]",
"ans",
"stack[0]",
"stack",
"0",
"return ans;",
"ans",
"public class Main {\n\tpublic static void main(String[] args) throws IOException {\n\t\tBufferedReader in = new BufferedReader(new InputStreamReader(System.in));\n\t\tStackSub readDataArr = new StackSub(in.readLine().split(\" \"));\n\t\tSystem.out.println(readDataArr.calcData());\n\t}\n}",
"public class Main {\n\tpublic static void main(String[] args) throws IOException {\n\t\tBufferedReader in = new BufferedReader(new InputStreamReader(System.in));\n\t\tStackSub readDataArr = new StackSub(in.readLine().split(\" \"));\n\t\tSystem.out.println(readDataArr.calcData());\n\t}\n}",
"Main"
] | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
StackSub readDataArr = new StackSub(in.readLine().split(" "));
System.out.println(readDataArr.calcData());
}
}
class StackSub {
private String[] readData;
private int[] stack = new int[100];
private int ans, operand1, operand2, pointer = 0;
StackSub(String[] readData) {
this.readData = readData;
}
public int calcData() {
char tempCharData;
for (int i = 0; i < readData.length; i++) {
tempCharData = readData[i].charAt(0);
operand1 = pointer - 2;
operand2 = pointer - 1;
if (tempCharData == '+') {
stack[operand1] = stack[operand1] + stack[operand2];
pointer--;
} else if (tempCharData == '-') {
stack[operand1] = stack[operand1] - stack[operand2];
pointer--;
} else if (tempCharData == '*') {
stack[operand1] = stack[operand1] * stack[operand2];
pointer--;
} else {
stack[pointer] = Integer.parseInt(readData[i]);
pointer++;
}
}
ans = stack[0];
return ans;
}
} |
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
4,
18,
13,
17,
41,
13,
20,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
30,
14,
4,
18,
18,
13,
13,
17,
30,
4,
18,
13,
2,
4,
18,
13,
4,
18,
13,
14,
4,
18,
18,
13,
13,
17,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
4,
18,
13,
2,
13,
13,
14,
4,
18,
18,
13,
13,
17,
30,
4,
18,
13,
2,
4,
18,
13,
4,
18,
13,
30,
4,
18,
13,
4,
18,
13,
18,
13,
13,
4,
18,
18,
13,
13,
4,
18,
13,
23,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
10,
11
],
[
10,
12
],
[
0,
13
],
[
13,
14
],
[
13,
15
],
[
15,
16
],
[
15,
17
],
[
17,
18
],
[
18,
19
],
[
18,
20
],
[
17,
21
],
[
21,
22
],
[
21,
23
],
[
23,
24
],
[
24,
25
],
[
25,
26
],
[
26,
27
],
[
23,
28
],
[
17,
29
],
[
29,
30
],
[
29,
31
],
[
17,
32
],
[
32,
33
],
[
33,
34
],
[
34,
35
],
[
34,
36
],
[
32,
37
],
[
37,
38
],
[
37,
39
],
[
39,
40
],
[
39,
41
],
[
32,
42
],
[
42,
43
],
[
43,
44
],
[
32,
45
],
[
46,
46
],
[
46,
47
],
[
47,
48
],
[
48,
49
],
[
49,
50
],
[
50,
51
],
[
50,
52
],
[
48,
53
],
[
47,
54
],
[
54,
55
],
[
55,
56
],
[
56,
57
],
[
55,
58
],
[
58,
59
],
[
59,
60
],
[
60,
61
],
[
58,
62
],
[
62,
63
],
[
63,
64
],
[
47,
65
],
[
65,
66
],
[
66,
67
],
[
67,
68
],
[
68,
69
],
[
68,
70
],
[
66,
71
],
[
65,
72
],
[
72,
73
],
[
73,
74
],
[
73,
75
],
[
75,
76
],
[
76,
77
],
[
72,
78
],
[
78,
79
],
[
78,
80
],
[
80,
81
],
[
81,
82
],
[
72,
83
],
[
83,
84
],
[
84,
85
],
[
83,
86
],
[
86,
87
],
[
86,
88
],
[
65,
89
],
[
89,
90
],
[
90,
91
],
[
91,
92
],
[
92,
93
],
[
92,
94
],
[
90,
95
],
[
89,
96
],
[
96,
97
],
[
97,
98
],
[
98,
99
],
[
97,
100
],
[
100,
101
],
[
101,
102
],
[
102,
103
],
[
100,
104
],
[
104,
105
],
[
105,
106
],
[
89,
107
],
[
107,
108
],
[
108,
109
],
[
109,
110
],
[
108,
111
],
[
111,
112
],
[
112,
113
],
[
111,
114
],
[
114,
115
],
[
114,
116
],
[
17,
117
],
[
117,
118
],
[
118,
119
],
[
119,
120
],
[
119,
121
],
[
117,
122
],
[
122,
123
],
[
123,
124
],
[
15,
125
],
[
125,
126
]
] | [
"import java.io.BufferedReader;\nimport java.io.InputStreamReader;\nimport java.util.ArrayList;\nimport java.util.Stack;\n\nclass Main {\n\tpublic static void main(String[] args) throws Exception {\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tString[] str = br.readLine().split(\" \");\n\t\tStack<Integer> stack = new Stack<Integer>();\n\n\t\tfor (int i = 0; i < str.length; i++) {\n\t\t\tif (str[i].equals(\"+\")) {\n\t\t\t\tstack.push(stack.pop() + stack.pop());\n\t\t\t} else if (str[i].equals(\"-\")) {\n\t\t\t\tint num01 = stack.pop();\n\t\t\t\tint num02 = stack.pop();\n\t\t\t\tstack.push(num02 - num01);\n\t\t\t} else if (str[i].equals(\"*\")) {\n\t\t\t\tstack.push(stack.pop() * stack.pop());\n\t\t\t} else {\n\t\t\t\tstack.push(Integer.parseInt(str[i]));\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(stack.pop());\n\t}\n}",
"import java.io.BufferedReader;",
"BufferedReader",
"java.io",
"import java.io.InputStreamReader;",
"InputStreamReader",
"java.io",
"import java.util.ArrayList;",
"ArrayList",
"java.util",
"import java.util.Stack;",
"Stack",
"java.util",
"class Main {\n\tpublic static void main(String[] args) throws Exception {\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tString[] str = br.readLine().split(\" \");\n\t\tStack<Integer> stack = new Stack<Integer>();\n\n\t\tfor (int i = 0; i < str.length; i++) {\n\t\t\tif (str[i].equals(\"+\")) {\n\t\t\t\tstack.push(stack.pop() + stack.pop());\n\t\t\t} else if (str[i].equals(\"-\")) {\n\t\t\t\tint num01 = stack.pop();\n\t\t\t\tint num02 = stack.pop();\n\t\t\t\tstack.push(num02 - num01);\n\t\t\t} else if (str[i].equals(\"*\")) {\n\t\t\t\tstack.push(stack.pop() * stack.pop());\n\t\t\t} else {\n\t\t\t\tstack.push(Integer.parseInt(str[i]));\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(stack.pop());\n\t}\n}",
"Main",
"public static void main(String[] args) throws Exception {\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tString[] str = br.readLine().split(\" \");\n\t\tStack<Integer> stack = new Stack<Integer>();\n\n\t\tfor (int i = 0; i < str.length; i++) {\n\t\t\tif (str[i].equals(\"+\")) {\n\t\t\t\tstack.push(stack.pop() + stack.pop());\n\t\t\t} else if (str[i].equals(\"-\")) {\n\t\t\t\tint num01 = stack.pop();\n\t\t\t\tint num02 = stack.pop();\n\t\t\t\tstack.push(num02 - num01);\n\t\t\t} else if (str[i].equals(\"*\")) {\n\t\t\t\tstack.push(stack.pop() * stack.pop());\n\t\t\t} else {\n\t\t\t\tstack.push(Integer.parseInt(str[i]));\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(stack.pop());\n\t}",
"main",
"{\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tString[] str = br.readLine().split(\" \");\n\t\tStack<Integer> stack = new Stack<Integer>();\n\n\t\tfor (int i = 0; i < str.length; i++) {\n\t\t\tif (str[i].equals(\"+\")) {\n\t\t\t\tstack.push(stack.pop() + stack.pop());\n\t\t\t} else if (str[i].equals(\"-\")) {\n\t\t\t\tint num01 = stack.pop();\n\t\t\t\tint num02 = stack.pop();\n\t\t\t\tstack.push(num02 - num01);\n\t\t\t} else if (str[i].equals(\"*\")) {\n\t\t\t\tstack.push(stack.pop() * stack.pop());\n\t\t\t} else {\n\t\t\t\tstack.push(Integer.parseInt(str[i]));\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(stack.pop());\n\t}",
"BufferedReader br = new BufferedReader(new InputStreamReader(System.in));",
"br",
"new BufferedReader(new InputStreamReader(System.in))",
"String[] str = br.readLine().split(\" \");",
"str",
"br.readLine().split(\" \")",
"br.readLine().split",
"br.readLine()",
"br.readLine",
"br",
"\" \"",
"Stack<Integer> stack = new Stack<Integer>();",
"stack",
"new Stack<Integer>()",
"for (int i = 0; i < str.length; i++) {\n\t\t\tif (str[i].equals(\"+\")) {\n\t\t\t\tstack.push(stack.pop() + stack.pop());\n\t\t\t} else if (str[i].equals(\"-\")) {\n\t\t\t\tint num01 = stack.pop();\n\t\t\t\tint num02 = stack.pop();\n\t\t\t\tstack.push(num02 - num01);\n\t\t\t} else if (str[i].equals(\"*\")) {\n\t\t\t\tstack.push(stack.pop() * stack.pop());\n\t\t\t} else {\n\t\t\t\tstack.push(Integer.parseInt(str[i]));\n\t\t\t}\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < str.length",
"i",
"str.length",
"str",
"str.length",
"i++",
"i++",
"i",
"{\n\t\t\tif (str[i].equals(\"+\")) {\n\t\t\t\tstack.push(stack.pop() + stack.pop());\n\t\t\t} else if (str[i].equals(\"-\")) {\n\t\t\t\tint num01 = stack.pop();\n\t\t\t\tint num02 = stack.pop();\n\t\t\t\tstack.push(num02 - num01);\n\t\t\t} else if (str[i].equals(\"*\")) {\n\t\t\t\tstack.push(stack.pop() * stack.pop());\n\t\t\t} else {\n\t\t\t\tstack.push(Integer.parseInt(str[i]));\n\t\t\t}\n\t\t}",
"{\n\t\t\tif (str[i].equals(\"+\")) {\n\t\t\t\tstack.push(stack.pop() + stack.pop());\n\t\t\t} else if (str[i].equals(\"-\")) {\n\t\t\t\tint num01 = stack.pop();\n\t\t\t\tint num02 = stack.pop();\n\t\t\t\tstack.push(num02 - num01);\n\t\t\t} else if (str[i].equals(\"*\")) {\n\t\t\t\tstack.push(stack.pop() * stack.pop());\n\t\t\t} else {\n\t\t\t\tstack.push(Integer.parseInt(str[i]));\n\t\t\t}\n\t\t}",
"if (str[i].equals(\"+\")) {\n\t\t\t\tstack.push(stack.pop() + stack.pop());\n\t\t\t} else if (str[i].equals(\"-\")) {\n\t\t\t\tint num01 = stack.pop();\n\t\t\t\tint num02 = stack.pop();\n\t\t\t\tstack.push(num02 - num01);\n\t\t\t} else if (str[i].equals(\"*\")) {\n\t\t\t\tstack.push(stack.pop() * stack.pop());\n\t\t\t} else {\n\t\t\t\tstack.push(Integer.parseInt(str[i]));\n\t\t\t}",
"str[i].equals(\"+\")",
"str[i].equals",
"str[i]",
"str",
"i",
"\"+\"",
"{\n\t\t\t\tstack.push(stack.pop() + stack.pop());\n\t\t\t}",
"stack.push(stack.pop() + stack.pop())",
"stack.push",
"stack",
"stack.pop() + stack.pop()",
"stack.pop()",
"stack.pop",
"stack",
"stack.pop()",
"stack.pop",
"stack",
"if (str[i].equals(\"-\")) {\n\t\t\t\tint num01 = stack.pop();\n\t\t\t\tint num02 = stack.pop();\n\t\t\t\tstack.push(num02 - num01);\n\t\t\t} else if (str[i].equals(\"*\")) {\n\t\t\t\tstack.push(stack.pop() * stack.pop());\n\t\t\t} else {\n\t\t\t\tstack.push(Integer.parseInt(str[i]));\n\t\t\t}",
"str[i].equals(\"-\")",
"str[i].equals",
"str[i]",
"str",
"i",
"\"-\"",
"{\n\t\t\t\tint num01 = stack.pop();\n\t\t\t\tint num02 = stack.pop();\n\t\t\t\tstack.push(num02 - num01);\n\t\t\t}",
"int num01 = stack.pop();",
"num01",
"stack.pop()",
"stack.pop",
"stack",
"int num02 = stack.pop();",
"num02",
"stack.pop()",
"stack.pop",
"stack",
"stack.push(num02 - num01)",
"stack.push",
"stack",
"num02 - num01",
"num02",
"num01",
"if (str[i].equals(\"*\")) {\n\t\t\t\tstack.push(stack.pop() * stack.pop());\n\t\t\t} else {\n\t\t\t\tstack.push(Integer.parseInt(str[i]));\n\t\t\t}",
"str[i].equals(\"*\")",
"str[i].equals",
"str[i]",
"str",
"i",
"\"*\"",
"{\n\t\t\t\tstack.push(stack.pop() * stack.pop());\n\t\t\t}",
"stack.push(stack.pop() * stack.pop())",
"stack.push",
"stack",
"stack.pop() * stack.pop()",
"stack.pop()",
"stack.pop",
"stack",
"stack.pop()",
"stack.pop",
"stack",
"{\n\t\t\t\tstack.push(Integer.parseInt(str[i]));\n\t\t\t}",
"stack.push(Integer.parseInt(str[i]))",
"stack.push",
"stack",
"Integer.parseInt(str[i])",
"Integer.parseInt",
"Integer",
"str[i]",
"str",
"i",
"System.out.println(stack.pop())",
"System.out.println",
"System.out",
"System",
"System.out",
"stack.pop()",
"stack.pop",
"stack",
"String[] args",
"args"
] | import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Stack;
class Main {
public static void main(String[] args) throws Exception {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String[] str = br.readLine().split(" ");
Stack<Integer> stack = new Stack<Integer>();
for (int i = 0; i < str.length; i++) {
if (str[i].equals("+")) {
stack.push(stack.pop() + stack.pop());
} else if (str[i].equals("-")) {
int num01 = stack.pop();
int num02 = stack.pop();
stack.push(num02 - num01);
} else if (str[i].equals("*")) {
stack.push(stack.pop() * stack.pop());
} else {
stack.push(Integer.parseInt(str[i]));
}
}
System.out.println(stack.pop());
}
} |
[
7,
15,
13,
17,
6,
13,
41,
13,
17,
41,
13,
20,
17,
12,
13,
30,
0,
18,
13,
40,
13,
13,
23,
13,
12,
13,
30,
40,
13,
29,
18,
13,
2,
13,
17,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
17,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
30,
14,
4,
18,
18,
13,
13,
17,
30,
41,
13,
4,
13,
41,
13,
4,
13,
4,
13,
2,
13,
13,
14,
4,
18,
18,
13,
13,
17,
30,
41,
13,
4,
13,
41,
13,
4,
13,
4,
13,
2,
13,
13,
14,
4,
18,
18,
13,
13,
17,
30,
41,
13,
4,
13,
41,
13,
4,
13,
4,
13,
2,
13,
13,
30,
4,
13,
4,
18,
13,
18,
13,
13,
4,
18,
18,
13,
13,
4,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
149,
5
],
[
149,
6
],
[
6,
7
],
[
6,
8
],
[
149,
9
],
[
9,
10
],
[
9,
11
],
[
149,
13
],
[
13,
14
],
[
13,
15
],
[
15,
16
],
[
16,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
16,
21
],
[
13,
22
],
[
22,
23
],
[
149,
24
],
[
24,
25
],
[
24,
26
],
[
26,
27
],
[
27,
28
],
[
26,
29
],
[
29,
30
],
[
30,
31
],
[
30,
32
],
[
32,
33
],
[
32,
34
],
[
149,
35
],
[
35,
36
],
[
35,
37
],
[
37,
38
],
[
38,
39
],
[
38,
40
],
[
37,
41
],
[
41,
42
],
[
41,
43
],
[
43,
44
],
[
44,
45
],
[
37,
46
],
[
46,
47
],
[
46,
48
],
[
48,
49
],
[
49,
50
],
[
48,
51
],
[
37,
52
],
[
52,
53
],
[
53,
54
],
[
54,
55
],
[
54,
56
],
[
52,
57
],
[
57,
58
],
[
57,
59
],
[
59,
60
],
[
59,
61
],
[
52,
62
],
[
62,
63
],
[
63,
64
],
[
52,
65
],
[
66,
66
],
[
66,
67
],
[
67,
68
],
[
68,
69
],
[
69,
70
],
[
70,
71
],
[
70,
72
],
[
68,
73
],
[
67,
74
],
[
74,
75
],
[
75,
76
],
[
75,
77
],
[
77,
78
],
[
74,
79
],
[
79,
80
],
[
79,
81
],
[
81,
82
],
[
74,
83
],
[
83,
84
],
[
83,
85
],
[
85,
86
],
[
85,
87
],
[
67,
88
],
[
88,
89
],
[
89,
90
],
[
90,
91
],
[
91,
92
],
[
91,
93
],
[
89,
94
],
[
88,
95
],
[
95,
96
],
[
96,
97
],
[
96,
98
],
[
98,
99
],
[
95,
100
],
[
100,
101
],
[
100,
102
],
[
102,
103
],
[
95,
104
],
[
104,
105
],
[
104,
106
],
[
106,
107
],
[
106,
108
],
[
88,
109
],
[
109,
110
],
[
110,
111
],
[
111,
112
],
[
112,
113
],
[
112,
114
],
[
110,
115
],
[
109,
116
],
[
116,
117
],
[
117,
118
],
[
117,
119
],
[
119,
120
],
[
116,
121
],
[
121,
122
],
[
121,
123
],
[
123,
124
],
[
116,
125
],
[
125,
126
],
[
125,
127
],
[
127,
128
],
[
127,
129
],
[
109,
130
],
[
130,
131
],
[
131,
132
],
[
131,
133
],
[
133,
134
],
[
134,
135
],
[
133,
136
],
[
136,
137
],
[
136,
138
],
[
37,
139
],
[
139,
140
],
[
140,
141
],
[
141,
142
],
[
141,
143
],
[
139,
144
],
[
144,
145
],
[
35,
146
],
[
146,
147
],
[
0,
148
],
[
148,
149
],
[
148,
150
]
] | [
"import java.util.Scanner;\n\npublic class Main {\n\n static int top = 0;\n static int[] num = new int[1000];\n\n public static void push(int x){\n\n num[++top] = x;\n }\n\n public static int pop(){\n\n top--;\n return num[top+1];\n }\n\n public static void main(String[] args) {\n\n Scanner sc = new Scanner(System.in);\n String str = sc.nextLine();\n\n String[] strings = str.split(\" \");\n for (int i=0; i<strings.length; i++){\n if (strings[i].equals(\"+\")){\n int a = pop();\n int b = pop();\n push(a+b);\n }\n else if (strings[i].equals(\"-\")){\n int a = pop();\n int b = pop();\n push(b-a);\n }\n else if (strings[i].equals(\"*\")){\n int a = pop();\n int b = pop();\n push(a*b);\n }\n else {\n push(Integer.parseInt(strings[i]));\n }\n }\n\n System.out.println(pop());\n }\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\n static int top = 0;\n static int[] num = new int[1000];\n\n public static void push(int x){\n\n num[++top] = x;\n }\n\n public static int pop(){\n\n top--;\n return num[top+1];\n }\n\n public static void main(String[] args) {\n\n Scanner sc = new Scanner(System.in);\n String str = sc.nextLine();\n\n String[] strings = str.split(\" \");\n for (int i=0; i<strings.length; i++){\n if (strings[i].equals(\"+\")){\n int a = pop();\n int b = pop();\n push(a+b);\n }\n else if (strings[i].equals(\"-\")){\n int a = pop();\n int b = pop();\n push(b-a);\n }\n else if (strings[i].equals(\"*\")){\n int a = pop();\n int b = pop();\n push(a*b);\n }\n else {\n push(Integer.parseInt(strings[i]));\n }\n }\n\n System.out.println(pop());\n }\n}",
"Main",
"static int top = 0;",
"top",
"0",
"static int[] num = new int[1000];",
"num",
"new int[1000]",
"1000",
"public static void push(int x){\n\n num[++top] = x;\n }",
"push",
"{\n\n num[++top] = x;\n }",
"num[++top] = x",
"num[++top]",
"num",
"++top",
"top",
"x",
"int x",
"x",
"public static int pop(){\n\n top--;\n return num[top+1];\n }",
"pop",
"{\n\n top--;\n return num[top+1];\n }",
"top--",
"top",
"return num[top+1];",
"num[top+1]",
"num",
"top+1",
"top",
"1",
"public static void main(String[] args) {\n\n Scanner sc = new Scanner(System.in);\n String str = sc.nextLine();\n\n String[] strings = str.split(\" \");\n for (int i=0; i<strings.length; i++){\n if (strings[i].equals(\"+\")){\n int a = pop();\n int b = pop();\n push(a+b);\n }\n else if (strings[i].equals(\"-\")){\n int a = pop();\n int b = pop();\n push(b-a);\n }\n else if (strings[i].equals(\"*\")){\n int a = pop();\n int b = pop();\n push(a*b);\n }\n else {\n push(Integer.parseInt(strings[i]));\n }\n }\n\n System.out.println(pop());\n }",
"main",
"{\n\n Scanner sc = new Scanner(System.in);\n String str = sc.nextLine();\n\n String[] strings = str.split(\" \");\n for (int i=0; i<strings.length; i++){\n if (strings[i].equals(\"+\")){\n int a = pop();\n int b = pop();\n push(a+b);\n }\n else if (strings[i].equals(\"-\")){\n int a = pop();\n int b = pop();\n push(b-a);\n }\n else if (strings[i].equals(\"*\")){\n int a = pop();\n int b = pop();\n push(a*b);\n }\n else {\n push(Integer.parseInt(strings[i]));\n }\n }\n\n System.out.println(pop());\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"String str = sc.nextLine();",
"str",
"sc.nextLine()",
"sc.nextLine",
"sc",
"String[] strings = str.split(\" \");",
"strings",
"str.split(\" \")",
"str.split",
"str",
"\" \"",
"for (int i=0; i<strings.length; i++){\n if (strings[i].equals(\"+\")){\n int a = pop();\n int b = pop();\n push(a+b);\n }\n else if (strings[i].equals(\"-\")){\n int a = pop();\n int b = pop();\n push(b-a);\n }\n else if (strings[i].equals(\"*\")){\n int a = pop();\n int b = pop();\n push(a*b);\n }\n else {\n push(Integer.parseInt(strings[i]));\n }\n }",
"int i=0;",
"int i=0;",
"i",
"0",
"i<strings.length",
"i",
"strings.length",
"strings",
"strings.length",
"i++",
"i++",
"i",
"{\n if (strings[i].equals(\"+\")){\n int a = pop();\n int b = pop();\n push(a+b);\n }\n else if (strings[i].equals(\"-\")){\n int a = pop();\n int b = pop();\n push(b-a);\n }\n else if (strings[i].equals(\"*\")){\n int a = pop();\n int b = pop();\n push(a*b);\n }\n else {\n push(Integer.parseInt(strings[i]));\n }\n }",
"{\n if (strings[i].equals(\"+\")){\n int a = pop();\n int b = pop();\n push(a+b);\n }\n else if (strings[i].equals(\"-\")){\n int a = pop();\n int b = pop();\n push(b-a);\n }\n else if (strings[i].equals(\"*\")){\n int a = pop();\n int b = pop();\n push(a*b);\n }\n else {\n push(Integer.parseInt(strings[i]));\n }\n }",
"if (strings[i].equals(\"+\")){\n int a = pop();\n int b = pop();\n push(a+b);\n }\n else if (strings[i].equals(\"-\")){\n int a = pop();\n int b = pop();\n push(b-a);\n }\n else if (strings[i].equals(\"*\")){\n int a = pop();\n int b = pop();\n push(a*b);\n }\n else {\n push(Integer.parseInt(strings[i]));\n }",
"strings[i].equals(\"+\")",
"strings[i].equals",
"strings[i]",
"strings",
"i",
"\"+\"",
"{\n int a = pop();\n int b = pop();\n push(a+b);\n }",
"int a = pop();",
"a",
"pop()",
"pop",
"int b = pop();",
"b",
"pop()",
"pop",
"push(a+b)",
"push",
"a+b",
"a",
"b",
"if (strings[i].equals(\"-\")){\n int a = pop();\n int b = pop();\n push(b-a);\n }\n else if (strings[i].equals(\"*\")){\n int a = pop();\n int b = pop();\n push(a*b);\n }\n else {\n push(Integer.parseInt(strings[i]));\n }",
"strings[i].equals(\"-\")",
"strings[i].equals",
"strings[i]",
"strings",
"i",
"\"-\"",
"{\n int a = pop();\n int b = pop();\n push(b-a);\n }",
"int a = pop();",
"a",
"pop()",
"pop",
"int b = pop();",
"b",
"pop()",
"pop",
"push(b-a)",
"push",
"b-a",
"b",
"a",
"if (strings[i].equals(\"*\")){\n int a = pop();\n int b = pop();\n push(a*b);\n }\n else {\n push(Integer.parseInt(strings[i]));\n }",
"strings[i].equals(\"*\")",
"strings[i].equals",
"strings[i]",
"strings",
"i",
"\"*\"",
"{\n int a = pop();\n int b = pop();\n push(a*b);\n }",
"int a = pop();",
"a",
"pop()",
"pop",
"int b = pop();",
"b",
"pop()",
"pop",
"push(a*b)",
"push",
"a*b",
"a",
"b",
"{\n push(Integer.parseInt(strings[i]));\n }",
"push(Integer.parseInt(strings[i]))",
"push",
"Integer.parseInt(strings[i])",
"Integer.parseInt",
"Integer",
"strings[i]",
"strings",
"i",
"System.out.println(pop())",
"System.out.println",
"System.out",
"System",
"System.out",
"pop()",
"pop",
"String[] args",
"args",
"public class Main {\n\n static int top = 0;\n static int[] num = new int[1000];\n\n public static void push(int x){\n\n num[++top] = x;\n }\n\n public static int pop(){\n\n top--;\n return num[top+1];\n }\n\n public static void main(String[] args) {\n\n Scanner sc = new Scanner(System.in);\n String str = sc.nextLine();\n\n String[] strings = str.split(\" \");\n for (int i=0; i<strings.length; i++){\n if (strings[i].equals(\"+\")){\n int a = pop();\n int b = pop();\n push(a+b);\n }\n else if (strings[i].equals(\"-\")){\n int a = pop();\n int b = pop();\n push(b-a);\n }\n else if (strings[i].equals(\"*\")){\n int a = pop();\n int b = pop();\n push(a*b);\n }\n else {\n push(Integer.parseInt(strings[i]));\n }\n }\n\n System.out.println(pop());\n }\n}",
"public class Main {\n\n static int top = 0;\n static int[] num = new int[1000];\n\n public static void push(int x){\n\n num[++top] = x;\n }\n\n public static int pop(){\n\n top--;\n return num[top+1];\n }\n\n public static void main(String[] args) {\n\n Scanner sc = new Scanner(System.in);\n String str = sc.nextLine();\n\n String[] strings = str.split(\" \");\n for (int i=0; i<strings.length; i++){\n if (strings[i].equals(\"+\")){\n int a = pop();\n int b = pop();\n push(a+b);\n }\n else if (strings[i].equals(\"-\")){\n int a = pop();\n int b = pop();\n push(b-a);\n }\n else if (strings[i].equals(\"*\")){\n int a = pop();\n int b = pop();\n push(a*b);\n }\n else {\n push(Integer.parseInt(strings[i]));\n }\n }\n\n System.out.println(pop());\n }\n}",
"Main"
] | import java.util.Scanner;
public class Main {
static int top = 0;
static int[] num = new int[1000];
public static void push(int x){
num[++top] = x;
}
public static int pop(){
top--;
return num[top+1];
}
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String str = sc.nextLine();
String[] strings = str.split(" ");
for (int i=0; i<strings.length; i++){
if (strings[i].equals("+")){
int a = pop();
int b = pop();
push(a+b);
}
else if (strings[i].equals("-")){
int a = pop();
int b = pop();
push(b-a);
}
else if (strings[i].equals("*")){
int a = pop();
int b = pop();
push(a*b);
}
else {
push(Integer.parseInt(strings[i]));
}
}
System.out.println(pop());
}
} |
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
20,
41,
13,
20,
17,
41,
13,
17,
0,
18,
13,
13,
4,
18,
13,
38,
5,
13,
30,
30,
42,
2,
18,
13,
13,
17,
30,
41,
13,
4,
13,
18,
13,
13,
14,
13,
30,
4,
18,
13,
4,
18,
13,
18,
13,
13,
30,
14,
4,
18,
18,
13,
13,
17,
30,
4,
18,
13,
2,
4,
18,
13,
17,
2,
4,
18,
13,
2,
4,
18,
13,
17,
4,
18,
13,
2,
4,
18,
13,
17,
4,
18,
13,
2,
4,
18,
13,
17,
14,
4,
18,
18,
13,
13,
17,
30,
4,
18,
13,
2,
4,
18,
13,
17,
2,
4,
18,
13,
2,
4,
18,
13,
17,
4,
18,
13,
2,
4,
18,
13,
17,
4,
18,
13,
2,
4,
18,
13,
17,
30,
4,
18,
13,
2,
4,
18,
13,
17,
2,
4,
18,
13,
2,
4,
18,
13,
17,
4,
18,
13,
2,
4,
18,
13,
17,
4,
18,
13,
2,
4,
18,
13,
17,
40,
13,
0,
18,
13,
13,
4,
18,
13,
4,
18,
18,
13,
13,
4,
18,
13,
17,
23,
13,
12,
13,
30,
38,
5,
13,
30,
29,
17,
30,
4,
18,
13,
13,
29,
17,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
219,
8
],
[
219,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
12,
14
],
[
11,
15
],
[
15,
16
],
[
15,
17
],
[
11,
18
],
[
18,
19
],
[
18,
20
],
[
11,
22
],
[
22,
23
],
[
22,
24
],
[
11,
25
],
[
25,
26
],
[
26,
27
],
[
26,
28
],
[
25,
29
],
[
29,
30
],
[
30,
31
],
[
11,
32
],
[
32,
33
],
[
33,
34
],
[
33,
35
],
[
32,
36
],
[
36,
37
],
[
37,
38
],
[
38,
39
],
[
39,
40
],
[
39,
41
],
[
38,
42
],
[
37,
43
],
[
43,
44
],
[
44,
45
],
[
44,
46
],
[
46,
47
],
[
46,
48
],
[
48,
49
],
[
48,
50
],
[
43,
51
],
[
51,
52
],
[
51,
53
],
[
53,
54
],
[
54,
55
],
[
55,
56
],
[
54,
57
],
[
57,
58
],
[
58,
59
],
[
57,
60
],
[
60,
61
],
[
60,
62
],
[
51,
63
],
[
63,
64
],
[
64,
65
],
[
65,
66
],
[
66,
67
],
[
67,
68
],
[
67,
69
],
[
65,
70
],
[
64,
71
],
[
71,
72
],
[
72,
73
],
[
73,
74
],
[
72,
75
],
[
75,
76
],
[
76,
77
],
[
77,
78
],
[
75,
79
],
[
72,
80
],
[
80,
81
],
[
81,
82
],
[
82,
83
],
[
81,
84
],
[
84,
85
],
[
85,
86
],
[
86,
87
],
[
84,
88
],
[
80,
89
],
[
89,
90
],
[
90,
91
],
[
89,
92
],
[
92,
93
],
[
93,
94
],
[
94,
95
],
[
92,
96
],
[
71,
97
],
[
97,
98
],
[
98,
99
],
[
97,
100
],
[
100,
101
],
[
101,
102
],
[
102,
103
],
[
100,
104
],
[
64,
105
],
[
105,
106
],
[
106,
107
],
[
107,
108
],
[
108,
109
],
[
108,
110
],
[
106,
111
],
[
105,
112
],
[
112,
113
],
[
113,
114
],
[
114,
115
],
[
113,
116
],
[
116,
117
],
[
117,
118
],
[
118,
119
],
[
116,
120
],
[
113,
121
],
[
121,
122
],
[
122,
123
],
[
123,
124
],
[
122,
125
],
[
125,
126
],
[
126,
127
],
[
127,
128
],
[
125,
129
],
[
121,
130
],
[
130,
131
],
[
131,
132
],
[
130,
133
],
[
133,
134
],
[
134,
135
],
[
135,
136
],
[
133,
137
],
[
112,
138
],
[
138,
139
],
[
139,
140
],
[
138,
141
],
[
141,
142
],
[
142,
143
],
[
143,
144
],
[
141,
145
],
[
105,
146
],
[
146,
147
],
[
147,
148
],
[
148,
149
],
[
147,
150
],
[
150,
151
],
[
151,
152
],
[
152,
153
],
[
150,
154
],
[
147,
155
],
[
155,
156
],
[
156,
157
],
[
157,
158
],
[
156,
159
],
[
159,
160
],
[
160,
161
],
[
161,
162
],
[
159,
163
],
[
155,
164
],
[
164,
165
],
[
165,
166
],
[
164,
167
],
[
167,
168
],
[
168,
169
],
[
169,
170
],
[
167,
171
],
[
146,
172
],
[
172,
173
],
[
173,
174
],
[
172,
175
],
[
175,
176
],
[
176,
177
],
[
177,
178
],
[
175,
179
],
[
43,
180
],
[
180,
181
],
[
43,
182
],
[
182,
183
],
[
183,
184
],
[
183,
185
],
[
182,
186
],
[
186,
187
],
[
187,
188
],
[
11,
189
],
[
189,
190
],
[
190,
191
],
[
191,
192
],
[
191,
193
],
[
189,
194
],
[
194,
195
],
[
195,
196
],
[
194,
197
],
[
9,
198
],
[
198,
199
],
[
219,
200
],
[
200,
201
],
[
200,
202
],
[
202,
203
],
[
203,
204
],
[
204,
205
],
[
204,
206
],
[
206,
207
],
[
207,
208
],
[
203,
209
],
[
209,
210
],
[
210,
211
],
[
211,
212
],
[
210,
213
],
[
209,
214
],
[
214,
215
],
[
200,
216
],
[
216,
217
],
[
0,
218
],
[
218,
219
],
[
218,
220
]
] | [
"import java.util.*;\nimport java.io.IOException;\npublic class Main {\n public static void main(String[] args) throws Exception {\n Scanner sc = new Scanner(System.in);\n List<Integer> list = new ArrayList<>();\n String[] a = new String[1000];\n int i = 0;\n a[i] = sc.next();\n try{\n while(a[i] != null){\n boolean b = isNumber(a[i]);\n if(b){\n list.add(Integer.parseInt(a[i]));\n }else{\n if(a[i].equals(\"+\")){\n list.set(list.size()- 2, list.get(list.size()- 1) + list.get(list.size()- 2));\n list.remove(list.size()-1);\n }else if(a[i].equals(\"-\")){\n list.set(list.size()- 2, list.get(list.size()- 2) - list.get(list.size()- 1));\n list.remove(list.size()- 1);\n }else{\n list.set(list.size()- 2, list.get(list.size()- 1) * list.get(list.size()- 2));\n list.remove(list.size()- 1);\n }\n }\n i++;\n a[i] = sc.next();\n }\n \n }catch(Exception e){\n \n }\n \n System.out.println(list.get(0));\n }\n public static boolean isNumber(String num) {\n try {\n Integer.parseInt(num);\n return true;\n } catch (NumberFormatException e) {\n return false;\n }\n}\n}\n\n",
"import java.util.*;",
"util.*",
"java",
"import java.io.IOException;",
"IOException",
"java.io",
"public class Main {\n public static void main(String[] args) throws Exception {\n Scanner sc = new Scanner(System.in);\n List<Integer> list = new ArrayList<>();\n String[] a = new String[1000];\n int i = 0;\n a[i] = sc.next();\n try{\n while(a[i] != null){\n boolean b = isNumber(a[i]);\n if(b){\n list.add(Integer.parseInt(a[i]));\n }else{\n if(a[i].equals(\"+\")){\n list.set(list.size()- 2, list.get(list.size()- 1) + list.get(list.size()- 2));\n list.remove(list.size()-1);\n }else if(a[i].equals(\"-\")){\n list.set(list.size()- 2, list.get(list.size()- 2) - list.get(list.size()- 1));\n list.remove(list.size()- 1);\n }else{\n list.set(list.size()- 2, list.get(list.size()- 1) * list.get(list.size()- 2));\n list.remove(list.size()- 1);\n }\n }\n i++;\n a[i] = sc.next();\n }\n \n }catch(Exception e){\n \n }\n \n System.out.println(list.get(0));\n }\n public static boolean isNumber(String num) {\n try {\n Integer.parseInt(num);\n return true;\n } catch (NumberFormatException e) {\n return false;\n }\n}\n}",
"Main",
"public static void main(String[] args) throws Exception {\n Scanner sc = new Scanner(System.in);\n List<Integer> list = new ArrayList<>();\n String[] a = new String[1000];\n int i = 0;\n a[i] = sc.next();\n try{\n while(a[i] != null){\n boolean b = isNumber(a[i]);\n if(b){\n list.add(Integer.parseInt(a[i]));\n }else{\n if(a[i].equals(\"+\")){\n list.set(list.size()- 2, list.get(list.size()- 1) + list.get(list.size()- 2));\n list.remove(list.size()-1);\n }else if(a[i].equals(\"-\")){\n list.set(list.size()- 2, list.get(list.size()- 2) - list.get(list.size()- 1));\n list.remove(list.size()- 1);\n }else{\n list.set(list.size()- 2, list.get(list.size()- 1) * list.get(list.size()- 2));\n list.remove(list.size()- 1);\n }\n }\n i++;\n a[i] = sc.next();\n }\n \n }catch(Exception e){\n \n }\n \n System.out.println(list.get(0));\n }",
"main",
"{\n Scanner sc = new Scanner(System.in);\n List<Integer> list = new ArrayList<>();\n String[] a = new String[1000];\n int i = 0;\n a[i] = sc.next();\n try{\n while(a[i] != null){\n boolean b = isNumber(a[i]);\n if(b){\n list.add(Integer.parseInt(a[i]));\n }else{\n if(a[i].equals(\"+\")){\n list.set(list.size()- 2, list.get(list.size()- 1) + list.get(list.size()- 2));\n list.remove(list.size()-1);\n }else if(a[i].equals(\"-\")){\n list.set(list.size()- 2, list.get(list.size()- 2) - list.get(list.size()- 1));\n list.remove(list.size()- 1);\n }else{\n list.set(list.size()- 2, list.get(list.size()- 1) * list.get(list.size()- 2));\n list.remove(list.size()- 1);\n }\n }\n i++;\n a[i] = sc.next();\n }\n \n }catch(Exception e){\n \n }\n \n System.out.println(list.get(0));\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"List<Integer> list = new ArrayList<>();",
"list",
"new ArrayList<>()",
"String[] a = new String[1000];",
"a",
"new String[1000]",
"1000",
"int i = 0;",
"i",
"0",
"a[i] = sc.next()",
"a[i]",
"a",
"i",
"sc.next()",
"sc.next",
"sc",
"try{\n while(a[i] != null){\n boolean b = isNumber(a[i]);\n if(b){\n list.add(Integer.parseInt(a[i]));\n }else{\n if(a[i].equals(\"+\")){\n list.set(list.size()- 2, list.get(list.size()- 1) + list.get(list.size()- 2));\n list.remove(list.size()-1);\n }else if(a[i].equals(\"-\")){\n list.set(list.size()- 2, list.get(list.size()- 2) - list.get(list.size()- 1));\n list.remove(list.size()- 1);\n }else{\n list.set(list.size()- 2, list.get(list.size()- 1) * list.get(list.size()- 2));\n list.remove(list.size()- 1);\n }\n }\n i++;\n a[i] = sc.next();\n }\n \n }catch(Exception e){\n \n }",
"catch(Exception e){\n \n }",
"Exception e",
"{\n \n }",
"{\n while(a[i] != null){\n boolean b = isNumber(a[i]);\n if(b){\n list.add(Integer.parseInt(a[i]));\n }else{\n if(a[i].equals(\"+\")){\n list.set(list.size()- 2, list.get(list.size()- 1) + list.get(list.size()- 2));\n list.remove(list.size()-1);\n }else if(a[i].equals(\"-\")){\n list.set(list.size()- 2, list.get(list.size()- 2) - list.get(list.size()- 1));\n list.remove(list.size()- 1);\n }else{\n list.set(list.size()- 2, list.get(list.size()- 1) * list.get(list.size()- 2));\n list.remove(list.size()- 1);\n }\n }\n i++;\n a[i] = sc.next();\n }\n \n }",
"while(a[i] != null){\n boolean b = isNumber(a[i]);\n if(b){\n list.add(Integer.parseInt(a[i]));\n }else{\n if(a[i].equals(\"+\")){\n list.set(list.size()- 2, list.get(list.size()- 1) + list.get(list.size()- 2));\n list.remove(list.size()-1);\n }else if(a[i].equals(\"-\")){\n list.set(list.size()- 2, list.get(list.size()- 2) - list.get(list.size()- 1));\n list.remove(list.size()- 1);\n }else{\n list.set(list.size()- 2, list.get(list.size()- 1) * list.get(list.size()- 2));\n list.remove(list.size()- 1);\n }\n }\n i++;\n a[i] = sc.next();\n }",
"a[i] != null",
"a[i]",
"a",
"i",
"null",
"{\n boolean b = isNumber(a[i]);\n if(b){\n list.add(Integer.parseInt(a[i]));\n }else{\n if(a[i].equals(\"+\")){\n list.set(list.size()- 2, list.get(list.size()- 1) + list.get(list.size()- 2));\n list.remove(list.size()-1);\n }else if(a[i].equals(\"-\")){\n list.set(list.size()- 2, list.get(list.size()- 2) - list.get(list.size()- 1));\n list.remove(list.size()- 1);\n }else{\n list.set(list.size()- 2, list.get(list.size()- 1) * list.get(list.size()- 2));\n list.remove(list.size()- 1);\n }\n }\n i++;\n a[i] = sc.next();\n }",
"boolean b = isNumber(a[i]);",
"b",
"isNumber(a[i])",
"isNumber",
"a[i]",
"a",
"i",
"if(b){\n list.add(Integer.parseInt(a[i]));\n }else{\n if(a[i].equals(\"+\")){\n list.set(list.size()- 2, list.get(list.size()- 1) + list.get(list.size()- 2));\n list.remove(list.size()-1);\n }else if(a[i].equals(\"-\")){\n list.set(list.size()- 2, list.get(list.size()- 2) - list.get(list.size()- 1));\n list.remove(list.size()- 1);\n }else{\n list.set(list.size()- 2, list.get(list.size()- 1) * list.get(list.size()- 2));\n list.remove(list.size()- 1);\n }\n }",
"b",
"{\n list.add(Integer.parseInt(a[i]));\n }",
"list.add(Integer.parseInt(a[i]))",
"list.add",
"list",
"Integer.parseInt(a[i])",
"Integer.parseInt",
"Integer",
"a[i]",
"a",
"i",
"{\n if(a[i].equals(\"+\")){\n list.set(list.size()- 2, list.get(list.size()- 1) + list.get(list.size()- 2));\n list.remove(list.size()-1);\n }else if(a[i].equals(\"-\")){\n list.set(list.size()- 2, list.get(list.size()- 2) - list.get(list.size()- 1));\n list.remove(list.size()- 1);\n }else{\n list.set(list.size()- 2, list.get(list.size()- 1) * list.get(list.size()- 2));\n list.remove(list.size()- 1);\n }\n }",
"if(a[i].equals(\"+\")){\n list.set(list.size()- 2, list.get(list.size()- 1) + list.get(list.size()- 2));\n list.remove(list.size()-1);\n }else if(a[i].equals(\"-\")){\n list.set(list.size()- 2, list.get(list.size()- 2) - list.get(list.size()- 1));\n list.remove(list.size()- 1);\n }else{\n list.set(list.size()- 2, list.get(list.size()- 1) * list.get(list.size()- 2));\n list.remove(list.size()- 1);\n }",
"a[i].equals(\"+\")",
"a[i].equals",
"a[i]",
"a",
"i",
"\"+\"",
"{\n list.set(list.size()- 2, list.get(list.size()- 1) + list.get(list.size()- 2));\n list.remove(list.size()-1);\n }",
"list.set(list.size()- 2, list.get(list.size()- 1) + list.get(list.size()- 2))",
"list.set",
"list",
"list.size()- 2",
"list.size()",
"list.size",
"list",
"2",
"list.get(list.size()- 1) + list.get(list.size()- 2)",
"list.get(list.size()- 1)",
"list.get",
"list",
"list.size()- 1",
"list.size()",
"list.size",
"list",
"1",
"list.get(list.size()- 2)",
"list.get",
"list",
"list.size()- 2",
"list.size()",
"list.size",
"list",
"2",
"list.remove(list.size()-1)",
"list.remove",
"list",
"list.size()-1",
"list.size()",
"list.size",
"list",
"1",
"if(a[i].equals(\"-\")){\n list.set(list.size()- 2, list.get(list.size()- 2) - list.get(list.size()- 1));\n list.remove(list.size()- 1);\n }else{\n list.set(list.size()- 2, list.get(list.size()- 1) * list.get(list.size()- 2));\n list.remove(list.size()- 1);\n }",
"a[i].equals(\"-\")",
"a[i].equals",
"a[i]",
"a",
"i",
"\"-\"",
"{\n list.set(list.size()- 2, list.get(list.size()- 2) - list.get(list.size()- 1));\n list.remove(list.size()- 1);\n }",
"list.set(list.size()- 2, list.get(list.size()- 2) - list.get(list.size()- 1))",
"list.set",
"list",
"list.size()- 2",
"list.size()",
"list.size",
"list",
"2",
"list.get(list.size()- 2) - list.get(list.size()- 1)",
"list.get(list.size()- 2)",
"list.get",
"list",
"list.size()- 2",
"list.size()",
"list.size",
"list",
"2",
"list.get(list.size()- 1)",
"list.get",
"list",
"list.size()- 1",
"list.size()",
"list.size",
"list",
"1",
"list.remove(list.size()- 1)",
"list.remove",
"list",
"list.size()- 1",
"list.size()",
"list.size",
"list",
"1",
"{\n list.set(list.size()- 2, list.get(list.size()- 1) * list.get(list.size()- 2));\n list.remove(list.size()- 1);\n }",
"list.set(list.size()- 2, list.get(list.size()- 1) * list.get(list.size()- 2))",
"list.set",
"list",
"list.size()- 2",
"list.size()",
"list.size",
"list",
"2",
"list.get(list.size()- 1) * list.get(list.size()- 2)",
"list.get(list.size()- 1)",
"list.get",
"list",
"list.size()- 1",
"list.size()",
"list.size",
"list",
"1",
"list.get(list.size()- 2)",
"list.get",
"list",
"list.size()- 2",
"list.size()",
"list.size",
"list",
"2",
"list.remove(list.size()- 1)",
"list.remove",
"list",
"list.size()- 1",
"list.size()",
"list.size",
"list",
"1",
"i++",
"i",
"a[i] = sc.next()",
"a[i]",
"a",
"i",
"sc.next()",
"sc.next",
"sc",
"System.out.println(list.get(0))",
"System.out.println",
"System.out",
"System",
"System.out",
"list.get(0)",
"list.get",
"list",
"0",
"String[] args",
"args",
"public static boolean isNumber(String num) {\n try {\n Integer.parseInt(num);\n return true;\n } catch (NumberFormatException e) {\n return false;\n }\n}",
"isNumber",
"{\n try {\n Integer.parseInt(num);\n return true;\n } catch (NumberFormatException e) {\n return false;\n }\n}",
"try {\n Integer.parseInt(num);\n return true;\n } catch (NumberFormatException e) {\n return false;\n }",
"catch (NumberFormatException e) {\n return false;\n }",
"NumberFormatException e",
"{\n return false;\n }",
"return false;",
"false",
"{\n Integer.parseInt(num);\n return true;\n }",
"Integer.parseInt(num)",
"Integer.parseInt",
"Integer",
"num",
"return true;",
"true",
"String num",
"num",
"public class Main {\n public static void main(String[] args) throws Exception {\n Scanner sc = new Scanner(System.in);\n List<Integer> list = new ArrayList<>();\n String[] a = new String[1000];\n int i = 0;\n a[i] = sc.next();\n try{\n while(a[i] != null){\n boolean b = isNumber(a[i]);\n if(b){\n list.add(Integer.parseInt(a[i]));\n }else{\n if(a[i].equals(\"+\")){\n list.set(list.size()- 2, list.get(list.size()- 1) + list.get(list.size()- 2));\n list.remove(list.size()-1);\n }else if(a[i].equals(\"-\")){\n list.set(list.size()- 2, list.get(list.size()- 2) - list.get(list.size()- 1));\n list.remove(list.size()- 1);\n }else{\n list.set(list.size()- 2, list.get(list.size()- 1) * list.get(list.size()- 2));\n list.remove(list.size()- 1);\n }\n }\n i++;\n a[i] = sc.next();\n }\n \n }catch(Exception e){\n \n }\n \n System.out.println(list.get(0));\n }\n public static boolean isNumber(String num) {\n try {\n Integer.parseInt(num);\n return true;\n } catch (NumberFormatException e) {\n return false;\n }\n}\n}",
"public class Main {\n public static void main(String[] args) throws Exception {\n Scanner sc = new Scanner(System.in);\n List<Integer> list = new ArrayList<>();\n String[] a = new String[1000];\n int i = 0;\n a[i] = sc.next();\n try{\n while(a[i] != null){\n boolean b = isNumber(a[i]);\n if(b){\n list.add(Integer.parseInt(a[i]));\n }else{\n if(a[i].equals(\"+\")){\n list.set(list.size()- 2, list.get(list.size()- 1) + list.get(list.size()- 2));\n list.remove(list.size()-1);\n }else if(a[i].equals(\"-\")){\n list.set(list.size()- 2, list.get(list.size()- 2) - list.get(list.size()- 1));\n list.remove(list.size()- 1);\n }else{\n list.set(list.size()- 2, list.get(list.size()- 1) * list.get(list.size()- 2));\n list.remove(list.size()- 1);\n }\n }\n i++;\n a[i] = sc.next();\n }\n \n }catch(Exception e){\n \n }\n \n System.out.println(list.get(0));\n }\n public static boolean isNumber(String num) {\n try {\n Integer.parseInt(num);\n return true;\n } catch (NumberFormatException e) {\n return false;\n }\n}\n}",
"Main"
] | import java.util.*;
import java.io.IOException;
public class Main {
public static void main(String[] args) throws Exception {
Scanner sc = new Scanner(System.in);
List<Integer> list = new ArrayList<>();
String[] a = new String[1000];
int i = 0;
a[i] = sc.next();
try{
while(a[i] != null){
boolean b = isNumber(a[i]);
if(b){
list.add(Integer.parseInt(a[i]));
}else{
if(a[i].equals("+")){
list.set(list.size()- 2, list.get(list.size()- 1) + list.get(list.size()- 2));
list.remove(list.size()-1);
}else if(a[i].equals("-")){
list.set(list.size()- 2, list.get(list.size()- 2) - list.get(list.size()- 1));
list.remove(list.size()- 1);
}else{
list.set(list.size()- 2, list.get(list.size()- 1) * list.get(list.size()- 2));
list.remove(list.size()- 1);
}
}
i++;
a[i] = sc.next();
}
}catch(Exception e){
}
System.out.println(list.get(0));
}
public static boolean isNumber(String num) {
try {
Integer.parseInt(num);
return true;
} catch (NumberFormatException e) {
return false;
}
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
41,
13,
41,
13,
12,
13,
30,
41,
13,
17,
42,
2,
2,
13,
18,
13,
13,
2,
18,
13,
13,
17,
30,
0,
13,
17,
0,
13,
2,
18,
13,
13,
17,
40,
13,
40,
13,
29,
13,
12,
13,
30,
41,
13,
18,
13,
13,
0,
13,
17,
29,
13,
12,
13,
30,
14,
2,
13,
17,
30,
29,
2,
13,
13,
14,
2,
13,
17,
30,
29,
2,
13,
13,
14,
2,
13,
17,
30,
29,
2,
13,
13,
29,
17,
23,
13,
23,
13,
23,
13,
12,
13,
30,
41,
13,
20,
0,
13,
4,
18,
4,
18,
13,
0,
13,
17,
41,
13,
20,
42,
2,
13,
18,
13,
13,
30,
14,
2,
2,
17,
18,
13,
13,
2,
18,
13,
13,
17,
30,
41,
13,
4,
13,
4,
18,
13,
13,
30,
41,
13,
4,
13,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
4,
13,
13,
13,
13,
4,
18,
13,
13,
4,
18,
18,
13,
13,
4,
18,
13,
12,
13,
30,
4,
18,
20,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
189,
8
],
[
189,
9
],
[
9,
10
],
[
189,
11
],
[
11,
12
],
[
189,
13
],
[
13,
14
],
[
13,
15
],
[
15,
16
],
[
16,
17
],
[
16,
18
],
[
15,
19
],
[
19,
20
],
[
20,
21
],
[
21,
22
],
[
21,
23
],
[
23,
24
],
[
23,
25
],
[
20,
26
],
[
26,
27
],
[
27,
28
],
[
27,
29
],
[
26,
30
],
[
19,
31
],
[
31,
32
],
[
32,
33
],
[
32,
34
],
[
31,
35
],
[
35,
36
],
[
35,
37
],
[
37,
38
],
[
38,
39
],
[
38,
40
],
[
37,
41
],
[
31,
42
],
[
42,
43
],
[
15,
44
],
[
44,
45
],
[
15,
46
],
[
46,
47
],
[
189,
48
],
[
48,
49
],
[
48,
50
],
[
50,
51
],
[
51,
52
],
[
51,
53
],
[
53,
54
],
[
53,
55
],
[
50,
56
],
[
56,
57
],
[
56,
58
],
[
50,
59
],
[
59,
60
],
[
189,
61
],
[
61,
62
],
[
61,
63
],
[
63,
64
],
[
64,
65
],
[
65,
66
],
[
65,
67
],
[
64,
68
],
[
68,
69
],
[
69,
70
],
[
70,
71
],
[
70,
72
],
[
63,
73
],
[
73,
74
],
[
74,
75
],
[
74,
76
],
[
73,
77
],
[
77,
78
],
[
78,
79
],
[
79,
80
],
[
79,
81
],
[
63,
82
],
[
82,
83
],
[
83,
84
],
[
83,
85
],
[
82,
86
],
[
86,
87
],
[
87,
88
],
[
88,
89
],
[
88,
90
],
[
63,
91
],
[
91,
92
],
[
61,
93
],
[
93,
94
],
[
61,
95
],
[
95,
96
],
[
61,
97
],
[
97,
98
],
[
189,
99
],
[
99,
100
],
[
99,
101
],
[
101,
102
],
[
102,
103
],
[
102,
104
],
[
101,
105
],
[
105,
106
],
[
105,
107
],
[
107,
108
],
[
108,
109
],
[
109,
110
],
[
110,
111
],
[
101,
112
],
[
112,
113
],
[
112,
114
],
[
101,
115
],
[
115,
116
],
[
115,
117
],
[
101,
118
],
[
118,
119
],
[
119,
120
],
[
119,
121
],
[
121,
122
],
[
121,
123
],
[
118,
124
],
[
124,
125
],
[
125,
126
],
[
126,
127
],
[
127,
128
],
[
127,
129
],
[
129,
130
],
[
129,
131
],
[
126,
132
],
[
132,
133
],
[
133,
134
],
[
133,
135
],
[
132,
136
],
[
125,
137
],
[
137,
138
],
[
138,
139
],
[
138,
140
],
[
140,
141
],
[
137,
142
],
[
142,
143
],
[
143,
144
],
[
142,
145
],
[
125,
146
],
[
146,
147
],
[
147,
148
],
[
147,
149
],
[
149,
150
],
[
146,
151
],
[
151,
152
],
[
151,
153
],
[
153,
154
],
[
154,
155
],
[
146,
156
],
[
156,
157
],
[
156,
158
],
[
158,
159
],
[
159,
160
],
[
146,
161
],
[
161,
162
],
[
161,
163
],
[
163,
164
],
[
163,
165
],
[
163,
166
],
[
163,
167
],
[
146,
168
],
[
168,
169
],
[
169,
170
],
[
168,
171
],
[
101,
172
],
[
172,
173
],
[
173,
174
],
[
174,
175
],
[
174,
176
],
[
172,
177
],
[
177,
178
],
[
178,
179
],
[
189,
180
],
[
180,
181
],
[
180,
182
],
[
182,
183
],
[
183,
184
],
[
184,
185
],
[
180,
186
],
[
186,
187
],
[
0,
188
],
[
188,
189
],
[
188,
190
]
] | [
"import java.util.Scanner;\nimport java.util.Stack;\n\npublic class Main {\n\n char[] c;\n int id;\n\n int number() {\n int ret = 0;\n while (id < c.length && c[id] != ' ') {\n ret *= 10;\n ret += c[id] - '0';\n id++;\n }\n id++;\n return ret;\n }\n\n int operand() {\n int ret = c[id];\n id += 2;\n return ret;\n }\n\n int calc(int s, int t, int op) {\n if (op == '+') {\n return s + t;\n }\n if (op == '-') {\n return s - t;\n }\n if (op == '*') {\n return s * t;\n }\n return 999;\n }\n\n void run() {\n Scanner sc = new Scanner(System.in);\n\n c = sc.nextLine().toCharArray();\n id = 0;\n\n Stack<Integer> stack = new Stack<Integer>();\n while (id < c.length) {\n if ('0' <= c[id] && c[id] <= '9') {\n int k = number();\n stack.push(k);\n } else {\n int op = operand();\n int s = stack.pop();\n int t = stack.pop();\n int u = calc(t, s, op);\n stack.push(u);\n }\n }\n System.out.println(stack.peek());\n }\n\n public static void main(String[] args) {\n new Main().run();\n }\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"import java.util.Stack;",
"Stack",
"java.util",
"public class Main {\n\n char[] c;\n int id;\n\n int number() {\n int ret = 0;\n while (id < c.length && c[id] != ' ') {\n ret *= 10;\n ret += c[id] - '0';\n id++;\n }\n id++;\n return ret;\n }\n\n int operand() {\n int ret = c[id];\n id += 2;\n return ret;\n }\n\n int calc(int s, int t, int op) {\n if (op == '+') {\n return s + t;\n }\n if (op == '-') {\n return s - t;\n }\n if (op == '*') {\n return s * t;\n }\n return 999;\n }\n\n void run() {\n Scanner sc = new Scanner(System.in);\n\n c = sc.nextLine().toCharArray();\n id = 0;\n\n Stack<Integer> stack = new Stack<Integer>();\n while (id < c.length) {\n if ('0' <= c[id] && c[id] <= '9') {\n int k = number();\n stack.push(k);\n } else {\n int op = operand();\n int s = stack.pop();\n int t = stack.pop();\n int u = calc(t, s, op);\n stack.push(u);\n }\n }\n System.out.println(stack.peek());\n }\n\n public static void main(String[] args) {\n new Main().run();\n }\n}",
"Main",
"char[] c;",
"c",
"int id;",
"id",
"int number() {\n int ret = 0;\n while (id < c.length && c[id] != ' ') {\n ret *= 10;\n ret += c[id] - '0';\n id++;\n }\n id++;\n return ret;\n }",
"number",
"{\n int ret = 0;\n while (id < c.length && c[id] != ' ') {\n ret *= 10;\n ret += c[id] - '0';\n id++;\n }\n id++;\n return ret;\n }",
"int ret = 0;",
"ret",
"0",
"while (id < c.length && c[id] != ' ') {\n ret *= 10;\n ret += c[id] - '0';\n id++;\n }",
"id < c.length && c[id] != ' '",
"id < c.length",
"id",
"c.length",
"c",
"c.length",
"c[id] != ' '",
"c[id]",
"c",
"id",
"' '",
"{\n ret *= 10;\n ret += c[id] - '0';\n id++;\n }",
"ret *= 10",
"ret",
"10",
"ret += c[id] - '0'",
"ret",
"c[id] - '0'",
"c[id]",
"c",
"id",
"'0'",
"id++",
"id",
"id++",
"id",
"return ret;",
"ret",
"int operand() {\n int ret = c[id];\n id += 2;\n return ret;\n }",
"operand",
"{\n int ret = c[id];\n id += 2;\n return ret;\n }",
"int ret = c[id];",
"ret",
"c[id]",
"c",
"id",
"id += 2",
"id",
"2",
"return ret;",
"ret",
"int calc(int s, int t, int op) {\n if (op == '+') {\n return s + t;\n }\n if (op == '-') {\n return s - t;\n }\n if (op == '*') {\n return s * t;\n }\n return 999;\n }",
"calc",
"{\n if (op == '+') {\n return s + t;\n }\n if (op == '-') {\n return s - t;\n }\n if (op == '*') {\n return s * t;\n }\n return 999;\n }",
"if (op == '+') {\n return s + t;\n }",
"op == '+'",
"op",
"'+'",
"{\n return s + t;\n }",
"return s + t;",
"s + t",
"s",
"t",
"if (op == '-') {\n return s - t;\n }",
"op == '-'",
"op",
"'-'",
"{\n return s - t;\n }",
"return s - t;",
"s - t",
"s",
"t",
"if (op == '*') {\n return s * t;\n }",
"op == '*'",
"op",
"'*'",
"{\n return s * t;\n }",
"return s * t;",
"s * t",
"s",
"t",
"return 999;",
"999",
"int s",
"s",
"int t",
"t",
"int op",
"op",
"void run() {\n Scanner sc = new Scanner(System.in);\n\n c = sc.nextLine().toCharArray();\n id = 0;\n\n Stack<Integer> stack = new Stack<Integer>();\n while (id < c.length) {\n if ('0' <= c[id] && c[id] <= '9') {\n int k = number();\n stack.push(k);\n } else {\n int op = operand();\n int s = stack.pop();\n int t = stack.pop();\n int u = calc(t, s, op);\n stack.push(u);\n }\n }\n System.out.println(stack.peek());\n }",
"run",
"{\n Scanner sc = new Scanner(System.in);\n\n c = sc.nextLine().toCharArray();\n id = 0;\n\n Stack<Integer> stack = new Stack<Integer>();\n while (id < c.length) {\n if ('0' <= c[id] && c[id] <= '9') {\n int k = number();\n stack.push(k);\n } else {\n int op = operand();\n int s = stack.pop();\n int t = stack.pop();\n int u = calc(t, s, op);\n stack.push(u);\n }\n }\n System.out.println(stack.peek());\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"c = sc.nextLine().toCharArray()",
"c",
"sc.nextLine().toCharArray()",
"sc.nextLine().toCharArray",
"sc.nextLine()",
"sc.nextLine",
"sc",
"id = 0",
"id",
"0",
"Stack<Integer> stack = new Stack<Integer>();",
"stack",
"new Stack<Integer>()",
"while (id < c.length) {\n if ('0' <= c[id] && c[id] <= '9') {\n int k = number();\n stack.push(k);\n } else {\n int op = operand();\n int s = stack.pop();\n int t = stack.pop();\n int u = calc(t, s, op);\n stack.push(u);\n }\n }",
"id < c.length",
"id",
"c.length",
"c",
"c.length",
"{\n if ('0' <= c[id] && c[id] <= '9') {\n int k = number();\n stack.push(k);\n } else {\n int op = operand();\n int s = stack.pop();\n int t = stack.pop();\n int u = calc(t, s, op);\n stack.push(u);\n }\n }",
"if ('0' <= c[id] && c[id] <= '9') {\n int k = number();\n stack.push(k);\n } else {\n int op = operand();\n int s = stack.pop();\n int t = stack.pop();\n int u = calc(t, s, op);\n stack.push(u);\n }",
"'0' <= c[id] && c[id] <= '9'",
"'0' <= c[id]",
"'0'",
"c[id]",
"c",
"id",
"c[id] <= '9'",
"c[id]",
"c",
"id",
"'9'",
"{\n int k = number();\n stack.push(k);\n }",
"int k = number();",
"k",
"number()",
"number",
"stack.push(k)",
"stack.push",
"stack",
"k",
"{\n int op = operand();\n int s = stack.pop();\n int t = stack.pop();\n int u = calc(t, s, op);\n stack.push(u);\n }",
"int op = operand();",
"op",
"operand()",
"operand",
"int s = stack.pop();",
"s",
"stack.pop()",
"stack.pop",
"stack",
"int t = stack.pop();",
"t",
"stack.pop()",
"stack.pop",
"stack",
"int u = calc(t, s, op);",
"u",
"calc(t, s, op)",
"calc",
"t",
"s",
"op",
"stack.push(u)",
"stack.push",
"stack",
"u",
"System.out.println(stack.peek())",
"System.out.println",
"System.out",
"System",
"System.out",
"stack.peek()",
"stack.peek",
"stack",
"public static void main(String[] args) {\n new Main().run();\n }",
"main",
"{\n new Main().run();\n }",
"new Main().run()",
"new Main().run",
"new Main()",
"String[] args",
"args",
"public class Main {\n\n char[] c;\n int id;\n\n int number() {\n int ret = 0;\n while (id < c.length && c[id] != ' ') {\n ret *= 10;\n ret += c[id] - '0';\n id++;\n }\n id++;\n return ret;\n }\n\n int operand() {\n int ret = c[id];\n id += 2;\n return ret;\n }\n\n int calc(int s, int t, int op) {\n if (op == '+') {\n return s + t;\n }\n if (op == '-') {\n return s - t;\n }\n if (op == '*') {\n return s * t;\n }\n return 999;\n }\n\n void run() {\n Scanner sc = new Scanner(System.in);\n\n c = sc.nextLine().toCharArray();\n id = 0;\n\n Stack<Integer> stack = new Stack<Integer>();\n while (id < c.length) {\n if ('0' <= c[id] && c[id] <= '9') {\n int k = number();\n stack.push(k);\n } else {\n int op = operand();\n int s = stack.pop();\n int t = stack.pop();\n int u = calc(t, s, op);\n stack.push(u);\n }\n }\n System.out.println(stack.peek());\n }\n\n public static void main(String[] args) {\n new Main().run();\n }\n}",
"public class Main {\n\n char[] c;\n int id;\n\n int number() {\n int ret = 0;\n while (id < c.length && c[id] != ' ') {\n ret *= 10;\n ret += c[id] - '0';\n id++;\n }\n id++;\n return ret;\n }\n\n int operand() {\n int ret = c[id];\n id += 2;\n return ret;\n }\n\n int calc(int s, int t, int op) {\n if (op == '+') {\n return s + t;\n }\n if (op == '-') {\n return s - t;\n }\n if (op == '*') {\n return s * t;\n }\n return 999;\n }\n\n void run() {\n Scanner sc = new Scanner(System.in);\n\n c = sc.nextLine().toCharArray();\n id = 0;\n\n Stack<Integer> stack = new Stack<Integer>();\n while (id < c.length) {\n if ('0' <= c[id] && c[id] <= '9') {\n int k = number();\n stack.push(k);\n } else {\n int op = operand();\n int s = stack.pop();\n int t = stack.pop();\n int u = calc(t, s, op);\n stack.push(u);\n }\n }\n System.out.println(stack.peek());\n }\n\n public static void main(String[] args) {\n new Main().run();\n }\n}",
"Main"
] | import java.util.Scanner;
import java.util.Stack;
public class Main {
char[] c;
int id;
int number() {
int ret = 0;
while (id < c.length && c[id] != ' ') {
ret *= 10;
ret += c[id] - '0';
id++;
}
id++;
return ret;
}
int operand() {
int ret = c[id];
id += 2;
return ret;
}
int calc(int s, int t, int op) {
if (op == '+') {
return s + t;
}
if (op == '-') {
return s - t;
}
if (op == '*') {
return s * t;
}
return 999;
}
void run() {
Scanner sc = new Scanner(System.in);
c = sc.nextLine().toCharArray();
id = 0;
Stack<Integer> stack = new Stack<Integer>();
while (id < c.length) {
if ('0' <= c[id] && c[id] <= '9') {
int k = number();
stack.push(k);
} else {
int op = operand();
int s = stack.pop();
int t = stack.pop();
int u = calc(t, s, op);
stack.push(u);
}
}
System.out.println(stack.peek());
}
public static void main(String[] args) {
new Main().run();
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
20,
41,
13,
4,
18,
13,
28,
13,
4,
18,
13,
17,
30,
30,
14,
4,
18,
17,
13,
30,
4,
18,
13,
2,
4,
18,
13,
4,
18,
13,
14,
4,
18,
17,
13,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
4,
18,
13,
2,
13,
13,
14,
4,
18,
17,
13,
30,
4,
18,
13,
2,
4,
18,
13,
4,
18,
13,
30,
4,
18,
13,
4,
18,
13,
13,
4,
18,
18,
13,
13,
4,
18,
13,
23,
13,
6,
13,
41,
13,
17,
41,
13,
41,
13,
12,
13,
30,
0,
13,
20,
13,
0,
13,
17,
12,
13,
30,
0,
18,
13,
13,
13,
40,
13,
23,
13,
12,
13,
30,
41,
13,
18,
13,
2,
13,
17,
40,
13,
29,
13,
12,
13,
30,
29,
2,
13,
17,
12,
13,
30,
29,
2,
13,
2,
13,
17,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
162,
5
],
[
162,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
8,
15
],
[
15,
16
],
[
15,
17
],
[
17,
18
],
[
18,
19
],
[
8,
20
],
[
20,
21
],
[
20,
22
],
[
22,
23
],
[
23,
24
],
[
22,
25
],
[
20,
26
],
[
27,
27
],
[
27,
28
],
[
28,
29
],
[
29,
30
],
[
30,
31
],
[
29,
32
],
[
28,
33
],
[
33,
34
],
[
34,
35
],
[
35,
36
],
[
34,
37
],
[
37,
38
],
[
38,
39
],
[
39,
40
],
[
37,
41
],
[
41,
42
],
[
42,
43
],
[
28,
44
],
[
44,
45
],
[
45,
46
],
[
46,
47
],
[
45,
48
],
[
44,
49
],
[
49,
50
],
[
50,
51
],
[
50,
52
],
[
52,
53
],
[
53,
54
],
[
49,
55
],
[
55,
56
],
[
55,
57
],
[
57,
58
],
[
58,
59
],
[
49,
60
],
[
60,
61
],
[
61,
62
],
[
60,
63
],
[
63,
64
],
[
63,
65
],
[
44,
66
],
[
66,
67
],
[
67,
68
],
[
68,
69
],
[
67,
70
],
[
66,
71
],
[
71,
72
],
[
72,
73
],
[
73,
74
],
[
72,
75
],
[
75,
76
],
[
76,
77
],
[
77,
78
],
[
75,
79
],
[
79,
80
],
[
80,
81
],
[
66,
82
],
[
82,
83
],
[
83,
84
],
[
84,
85
],
[
83,
86
],
[
86,
87
],
[
87,
88
],
[
86,
89
],
[
8,
90
],
[
90,
91
],
[
91,
92
],
[
92,
93
],
[
92,
94
],
[
90,
95
],
[
95,
96
],
[
96,
97
],
[
6,
98
],
[
98,
99
],
[
162,
100
],
[
100,
101
],
[
100,
102
],
[
102,
103
],
[
102,
104
],
[
100,
105
],
[
105,
106
],
[
100,
107
],
[
107,
108
],
[
100,
109
],
[
109,
110
],
[
109,
111
],
[
111,
112
],
[
112,
113
],
[
112,
114
],
[
111,
116
],
[
116,
117
],
[
116,
118
],
[
100,
119
],
[
119,
120
],
[
119,
121
],
[
121,
122
],
[
122,
123
],
[
123,
124
],
[
123,
125
],
[
122,
126
],
[
121,
127
],
[
127,
128
],
[
119,
129
],
[
129,
130
],
[
100,
131
],
[
131,
132
],
[
131,
133
],
[
133,
134
],
[
134,
135
],
[
134,
136
],
[
136,
137
],
[
136,
138
],
[
138,
139
],
[
138,
140
],
[
133,
141
],
[
141,
142
],
[
133,
143
],
[
143,
144
],
[
100,
145
],
[
145,
146
],
[
145,
147
],
[
147,
148
],
[
148,
149
],
[
149,
150
],
[
149,
151
],
[
100,
152
],
[
152,
153
],
[
152,
154
],
[
154,
155
],
[
155,
156
],
[
156,
157
],
[
156,
158
],
[
158,
159
],
[
158,
160
],
[
0,
161
],
[
161,
162
],
[
161,
163
]
] | [
"import java.util.Scanner;\n\npublic class Main {\n public static void main(String[] args) {\n Stack stack = new Stack();\n Scanner scanner = new Scanner(System.in);\n String line = scanner.nextLine();\n for (String s : line.split(\" \")) {\n if (\"+\".equals(s)) {\n stack.push(stack.pop() + stack.pop());\n } else if (\"-\".equals(s)) {\n int first = stack.pop();\n int second = stack.pop();\n stack.push(second - first);\n } else if (\"*\".equals(s)) {\n stack.push(stack.pop() * stack.pop());\n } else {\n stack.push(Integer.parseInt(s));\n }\n }\n System.out.println(stack.pop());\n }\n\n private static class Stack {\n\n static final int MAX = 200;\n\n int[] array;\n int index;\n\n Stack() {\n array = new int[MAX];\n index = 0;\n }\n\n void push(int value) {\n array[index] = value;\n index++;\n }\n\n int pop() {\n int value = array[index - 1];\n index--;\n return value;\n }\n\n boolean isEmpty() {\n return index == 0;\n }\n\n boolean isFull() {\n return index == MAX + 1;\n }\n }\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n public static void main(String[] args) {\n Stack stack = new Stack();\n Scanner scanner = new Scanner(System.in);\n String line = scanner.nextLine();\n for (String s : line.split(\" \")) {\n if (\"+\".equals(s)) {\n stack.push(stack.pop() + stack.pop());\n } else if (\"-\".equals(s)) {\n int first = stack.pop();\n int second = stack.pop();\n stack.push(second - first);\n } else if (\"*\".equals(s)) {\n stack.push(stack.pop() * stack.pop());\n } else {\n stack.push(Integer.parseInt(s));\n }\n }\n System.out.println(stack.pop());\n }\n\n private static class Stack {\n\n static final int MAX = 200;\n\n int[] array;\n int index;\n\n Stack() {\n array = new int[MAX];\n index = 0;\n }\n\n void push(int value) {\n array[index] = value;\n index++;\n }\n\n int pop() {\n int value = array[index - 1];\n index--;\n return value;\n }\n\n boolean isEmpty() {\n return index == 0;\n }\n\n boolean isFull() {\n return index == MAX + 1;\n }\n }\n}",
"Main",
"public static void main(String[] args) {\n Stack stack = new Stack();\n Scanner scanner = new Scanner(System.in);\n String line = scanner.nextLine();\n for (String s : line.split(\" \")) {\n if (\"+\".equals(s)) {\n stack.push(stack.pop() + stack.pop());\n } else if (\"-\".equals(s)) {\n int first = stack.pop();\n int second = stack.pop();\n stack.push(second - first);\n } else if (\"*\".equals(s)) {\n stack.push(stack.pop() * stack.pop());\n } else {\n stack.push(Integer.parseInt(s));\n }\n }\n System.out.println(stack.pop());\n }",
"main",
"{\n Stack stack = new Stack();\n Scanner scanner = new Scanner(System.in);\n String line = scanner.nextLine();\n for (String s : line.split(\" \")) {\n if (\"+\".equals(s)) {\n stack.push(stack.pop() + stack.pop());\n } else if (\"-\".equals(s)) {\n int first = stack.pop();\n int second = stack.pop();\n stack.push(second - first);\n } else if (\"*\".equals(s)) {\n stack.push(stack.pop() * stack.pop());\n } else {\n stack.push(Integer.parseInt(s));\n }\n }\n System.out.println(stack.pop());\n }",
"Stack stack = new Stack();",
"stack",
"new Stack()",
"Scanner scanner = new Scanner(System.in);",
"scanner",
"new Scanner(System.in)",
"String line = scanner.nextLine();",
"line",
"scanner.nextLine()",
"scanner.nextLine",
"scanner",
"for (String s : line.split(\" \")) {\n if (\"+\".equals(s)) {\n stack.push(stack.pop() + stack.pop());\n } else if (\"-\".equals(s)) {\n int first = stack.pop();\n int second = stack.pop();\n stack.push(second - first);\n } else if (\"*\".equals(s)) {\n stack.push(stack.pop() * stack.pop());\n } else {\n stack.push(Integer.parseInt(s));\n }\n }",
"String s",
"line.split(\" \")",
"line.split",
"line",
"\" \"",
"{\n if (\"+\".equals(s)) {\n stack.push(stack.pop() + stack.pop());\n } else if (\"-\".equals(s)) {\n int first = stack.pop();\n int second = stack.pop();\n stack.push(second - first);\n } else if (\"*\".equals(s)) {\n stack.push(stack.pop() * stack.pop());\n } else {\n stack.push(Integer.parseInt(s));\n }\n }",
"{\n if (\"+\".equals(s)) {\n stack.push(stack.pop() + stack.pop());\n } else if (\"-\".equals(s)) {\n int first = stack.pop();\n int second = stack.pop();\n stack.push(second - first);\n } else if (\"*\".equals(s)) {\n stack.push(stack.pop() * stack.pop());\n } else {\n stack.push(Integer.parseInt(s));\n }\n }",
"if (\"+\".equals(s)) {\n stack.push(stack.pop() + stack.pop());\n } else if (\"-\".equals(s)) {\n int first = stack.pop();\n int second = stack.pop();\n stack.push(second - first);\n } else if (\"*\".equals(s)) {\n stack.push(stack.pop() * stack.pop());\n } else {\n stack.push(Integer.parseInt(s));\n }",
"\"+\".equals(s)",
"\"+\".equals",
"\"+\"",
"s",
"{\n stack.push(stack.pop() + stack.pop());\n }",
"stack.push(stack.pop() + stack.pop())",
"stack.push",
"stack",
"stack.pop() + stack.pop()",
"stack.pop()",
"stack.pop",
"stack",
"stack.pop()",
"stack.pop",
"stack",
"if (\"-\".equals(s)) {\n int first = stack.pop();\n int second = stack.pop();\n stack.push(second - first);\n } else if (\"*\".equals(s)) {\n stack.push(stack.pop() * stack.pop());\n } else {\n stack.push(Integer.parseInt(s));\n }",
"\"-\".equals(s)",
"\"-\".equals",
"\"-\"",
"s",
"{\n int first = stack.pop();\n int second = stack.pop();\n stack.push(second - first);\n }",
"int first = stack.pop();",
"first",
"stack.pop()",
"stack.pop",
"stack",
"int second = stack.pop();",
"second",
"stack.pop()",
"stack.pop",
"stack",
"stack.push(second - first)",
"stack.push",
"stack",
"second - first",
"second",
"first",
"if (\"*\".equals(s)) {\n stack.push(stack.pop() * stack.pop());\n } else {\n stack.push(Integer.parseInt(s));\n }",
"\"*\".equals(s)",
"\"*\".equals",
"\"*\"",
"s",
"{\n stack.push(stack.pop() * stack.pop());\n }",
"stack.push(stack.pop() * stack.pop())",
"stack.push",
"stack",
"stack.pop() * stack.pop()",
"stack.pop()",
"stack.pop",
"stack",
"stack.pop()",
"stack.pop",
"stack",
"{\n stack.push(Integer.parseInt(s));\n }",
"stack.push(Integer.parseInt(s))",
"stack.push",
"stack",
"Integer.parseInt(s)",
"Integer.parseInt",
"Integer",
"s",
"System.out.println(stack.pop())",
"System.out.println",
"System.out",
"System",
"System.out",
"stack.pop()",
"stack.pop",
"stack",
"String[] args",
"args",
"private static class Stack {\n\n static final int MAX = 200;\n\n int[] array;\n int index;\n\n Stack() {\n array = new int[MAX];\n index = 0;\n }\n\n void push(int value) {\n array[index] = value;\n index++;\n }\n\n int pop() {\n int value = array[index - 1];\n index--;\n return value;\n }\n\n boolean isEmpty() {\n return index == 0;\n }\n\n boolean isFull() {\n return index == MAX + 1;\n }\n }",
"Stack",
"static final int MAX = 200;",
"MAX",
"200",
"int[] array;",
"array",
"int index;",
"index",
"Stack() {\n array = new int[MAX];\n index = 0;\n }",
"Stack",
"{\n array = new int[MAX];\n index = 0;\n }",
"array = new int[MAX]",
"array",
"new int[MAX]",
"MAX",
"index = 0",
"index",
"0",
"void push(int value) {\n array[index] = value;\n index++;\n }",
"push",
"{\n array[index] = value;\n index++;\n }",
"array[index] = value",
"array[index]",
"array",
"index",
"value",
"index++",
"index",
"int value",
"value",
"int pop() {\n int value = array[index - 1];\n index--;\n return value;\n }",
"pop",
"{\n int value = array[index - 1];\n index--;\n return value;\n }",
"int value = array[index - 1];",
"value",
"array[index - 1]",
"array",
"index - 1",
"index",
"1",
"index--",
"index",
"return value;",
"value",
"boolean isEmpty() {\n return index == 0;\n }",
"isEmpty",
"{\n return index == 0;\n }",
"return index == 0;",
"index == 0",
"index",
"0",
"boolean isFull() {\n return index == MAX + 1;\n }",
"isFull",
"{\n return index == MAX + 1;\n }",
"return index == MAX + 1;",
"index == MAX + 1",
"index",
"MAX + 1",
"MAX",
"1",
"public class Main {\n public static void main(String[] args) {\n Stack stack = new Stack();\n Scanner scanner = new Scanner(System.in);\n String line = scanner.nextLine();\n for (String s : line.split(\" \")) {\n if (\"+\".equals(s)) {\n stack.push(stack.pop() + stack.pop());\n } else if (\"-\".equals(s)) {\n int first = stack.pop();\n int second = stack.pop();\n stack.push(second - first);\n } else if (\"*\".equals(s)) {\n stack.push(stack.pop() * stack.pop());\n } else {\n stack.push(Integer.parseInt(s));\n }\n }\n System.out.println(stack.pop());\n }\n\n private static class Stack {\n\n static final int MAX = 200;\n\n int[] array;\n int index;\n\n Stack() {\n array = new int[MAX];\n index = 0;\n }\n\n void push(int value) {\n array[index] = value;\n index++;\n }\n\n int pop() {\n int value = array[index - 1];\n index--;\n return value;\n }\n\n boolean isEmpty() {\n return index == 0;\n }\n\n boolean isFull() {\n return index == MAX + 1;\n }\n }\n}",
"public class Main {\n public static void main(String[] args) {\n Stack stack = new Stack();\n Scanner scanner = new Scanner(System.in);\n String line = scanner.nextLine();\n for (String s : line.split(\" \")) {\n if (\"+\".equals(s)) {\n stack.push(stack.pop() + stack.pop());\n } else if (\"-\".equals(s)) {\n int first = stack.pop();\n int second = stack.pop();\n stack.push(second - first);\n } else if (\"*\".equals(s)) {\n stack.push(stack.pop() * stack.pop());\n } else {\n stack.push(Integer.parseInt(s));\n }\n }\n System.out.println(stack.pop());\n }\n\n private static class Stack {\n\n static final int MAX = 200;\n\n int[] array;\n int index;\n\n Stack() {\n array = new int[MAX];\n index = 0;\n }\n\n void push(int value) {\n array[index] = value;\n index++;\n }\n\n int pop() {\n int value = array[index - 1];\n index--;\n return value;\n }\n\n boolean isEmpty() {\n return index == 0;\n }\n\n boolean isFull() {\n return index == MAX + 1;\n }\n }\n}",
"Main"
] | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Stack stack = new Stack();
Scanner scanner = new Scanner(System.in);
String line = scanner.nextLine();
for (String s : line.split(" ")) {
if ("+".equals(s)) {
stack.push(stack.pop() + stack.pop());
} else if ("-".equals(s)) {
int first = stack.pop();
int second = stack.pop();
stack.push(second - first);
} else if ("*".equals(s)) {
stack.push(stack.pop() * stack.pop());
} else {
stack.push(Integer.parseInt(s));
}
}
System.out.println(stack.pop());
}
private static class Stack {
static final int MAX = 200;
int[] array;
int index;
Stack() {
array = new int[MAX];
index = 0;
}
void push(int value) {
array[index] = value;
index++;
}
int pop() {
int value = array[index - 1];
index--;
return value;
}
boolean isEmpty() {
return index == 0;
}
boolean isFull() {
return index == MAX + 1;
}
}
} |
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
41,
13,
20,
12,
13,
30,
41,
13,
20,
42,
4,
18,
13,
30,
41,
13,
4,
18,
13,
14,
4,
18,
13,
17,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
4,
18,
13,
2,
13,
13,
14,
4,
18,
13,
17,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
4,
18,
13,
2,
13,
13,
14,
4,
18,
13,
17,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
4,
18,
13,
2,
13,
13,
30,
4,
18,
13,
4,
18,
13,
13,
4,
18,
18,
13,
13,
4,
18,
13,
23,
13,
6,
13,
41,
13,
41,
13,
12,
13,
30,
0,
13,
20,
12,
13,
30,
14,
2,
2,
13,
17,
4,
18,
13,
30,
29,
17,
30,
38,
5,
13,
30,
4,
18,
13,
29,
17,
30,
4,
18,
13,
17,
14,
2,
4,
18,
13,
17,
30,
4,
18,
13,
29,
17,
30,
4,
18,
13,
29,
17,
12,
13,
30,
42,
2,
2,
13,
17,
40,
4,
18,
13,
30,
38,
5,
13,
30,
4,
18,
13,
30,
0,
13,
20,
29,
4,
18,
13,
12,
13,
30,
29,
4,
18,
13,
4,
13,
12,
13,
30,
29,
4,
18,
13,
4,
13,
12,
13,
30,
29,
4,
18,
13,
4,
13,
12,
13,
30,
41,
13,
17,
38,
5,
13,
30,
4,
18,
13,
30,
0,
13,
4,
18,
13,
29,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
10,
11
],
[
10,
12
],
[
0,
13
],
[
13,
14
],
[
13,
15
],
[
0,
16
],
[
257,
17
],
[
257,
18
],
[
18,
19
],
[
18,
20
],
[
257,
21
],
[
21,
22
],
[
21,
23
],
[
23,
24
],
[
24,
25
],
[
24,
26
],
[
23,
27
],
[
27,
28
],
[
28,
29
],
[
29,
30
],
[
27,
31
],
[
31,
32
],
[
32,
33
],
[
32,
34
],
[
34,
35
],
[
35,
36
],
[
31,
37
],
[
37,
38
],
[
38,
39
],
[
39,
40
],
[
38,
41
],
[
37,
42
],
[
42,
43
],
[
43,
44
],
[
43,
45
],
[
45,
46
],
[
46,
47
],
[
42,
48
],
[
48,
49
],
[
48,
50
],
[
50,
51
],
[
51,
52
],
[
42,
53
],
[
53,
54
],
[
54,
55
],
[
53,
56
],
[
56,
57
],
[
56,
58
],
[
37,
59
],
[
59,
60
],
[
60,
61
],
[
61,
62
],
[
60,
63
],
[
59,
64
],
[
64,
65
],
[
65,
66
],
[
65,
67
],
[
67,
68
],
[
68,
69
],
[
64,
70
],
[
70,
71
],
[
70,
72
],
[
72,
73
],
[
73,
74
],
[
64,
75
],
[
75,
76
],
[
76,
77
],
[
75,
78
],
[
78,
79
],
[
78,
80
],
[
59,
81
],
[
81,
82
],
[
82,
83
],
[
83,
84
],
[
82,
85
],
[
81,
86
],
[
86,
87
],
[
87,
88
],
[
87,
89
],
[
89,
90
],
[
90,
91
],
[
86,
92
],
[
92,
93
],
[
92,
94
],
[
94,
95
],
[
95,
96
],
[
86,
97
],
[
97,
98
],
[
98,
99
],
[
97,
100
],
[
100,
101
],
[
100,
102
],
[
81,
103
],
[
103,
104
],
[
104,
105
],
[
105,
106
],
[
104,
107
],
[
107,
108
],
[
108,
109
],
[
107,
110
],
[
23,
111
],
[
111,
112
],
[
112,
113
],
[
113,
114
],
[
113,
115
],
[
111,
116
],
[
116,
117
],
[
117,
118
],
[
21,
119
],
[
119,
120
],
[
257,
121
],
[
121,
122
],
[
121,
123
],
[
123,
124
],
[
121,
125
],
[
125,
126
],
[
121,
127
],
[
127,
128
],
[
127,
129
],
[
129,
130
],
[
130,
131
],
[
130,
132
],
[
121,
133
],
[
133,
134
],
[
133,
135
],
[
135,
136
],
[
136,
137
],
[
137,
138
],
[
138,
139
],
[
138,
140
],
[
137,
141
],
[
141,
142
],
[
142,
143
],
[
136,
144
],
[
144,
145
],
[
145,
146
],
[
136,
147
],
[
147,
148
],
[
148,
149
],
[
149,
150
],
[
149,
151
],
[
151,
152
],
[
152,
153
],
[
153,
154
],
[
151,
155
],
[
155,
156
],
[
148,
157
],
[
157,
158
],
[
158,
159
],
[
159,
160
],
[
158,
161
],
[
157,
162
],
[
162,
163
],
[
163,
164
],
[
164,
165
],
[
165,
166
],
[
163,
167
],
[
162,
168
],
[
168,
169
],
[
169,
170
],
[
170,
171
],
[
168,
172
],
[
172,
173
],
[
162,
174
],
[
174,
175
],
[
175,
176
],
[
176,
177
],
[
174,
178
],
[
178,
179
],
[
121,
180
],
[
180,
181
],
[
180,
182
],
[
182,
183
],
[
183,
184
],
[
184,
185
],
[
185,
186
],
[
185,
187
],
[
184,
188
],
[
188,
189
],
[
189,
190
],
[
190,
191
],
[
183,
192
],
[
192,
193
],
[
193,
194
],
[
194,
195
],
[
194,
196
],
[
196,
197
],
[
197,
198
],
[
198,
199
],
[
193,
200
],
[
200,
201
],
[
201,
202
],
[
201,
203
],
[
182,
204
],
[
204,
205
],
[
205,
206
],
[
206,
207
],
[
121,
208
],
[
208,
209
],
[
208,
210
],
[
210,
211
],
[
211,
212
],
[
212,
213
],
[
213,
214
],
[
212,
215
],
[
215,
216
],
[
121,
217
],
[
217,
218
],
[
217,
219
],
[
219,
220
],
[
220,
221
],
[
221,
222
],
[
222,
223
],
[
221,
224
],
[
224,
225
],
[
121,
226
],
[
226,
227
],
[
226,
228
],
[
228,
229
],
[
229,
230
],
[
230,
231
],
[
231,
232
],
[
230,
233
],
[
233,
234
],
[
121,
235
],
[
235,
236
],
[
235,
237
],
[
237,
238
],
[
238,
239
],
[
238,
240
],
[
237,
241
],
[
241,
242
],
[
242,
243
],
[
242,
244
],
[
244,
245
],
[
245,
246
],
[
246,
247
],
[
241,
248
],
[
248,
249
],
[
249,
250
],
[
249,
251
],
[
251,
252
],
[
252,
253
],
[
237,
254
],
[
254,
255
],
[
0,
256
],
[
256,
257
],
[
256,
258
]
] | [
"import java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\nimport java.util.Stack;\nimport java.util.StringTokenizer;\n\npublic class Main {\n\tprivate static FastScanner sc = new FastScanner();\n\n\tpublic static void main(String[] args) {\n\t\tStack<Integer> s = new Stack<Integer>();\n\t\t\n\t\twhile(sc.hasNext()) {\n\t\t\tString str = sc.next();\n\t\t\tif(str.equals(\"+\")) {\n\t\t\t\tint b = s.pop();\n\t\t\t\tint a = s.pop();\n\t\t\t\ts.push(a+b);\t\t\t\n\t\t\t} else if(str.equals(\"-\")) {\n\t\t\t\tint b = s.pop();\n\t\t\t\tint a = s.pop();\n\t\t\t\ts.push(a-b);\n\t\t\t} else if(str.equals(\"*\")) {\n\t\t\t\tint b = s.pop();\n\t\t\t\tint a = s.pop();\n\t\t\t\ts.push(a*b);\n\t\t\t} else {\n\t\t\t\ts.push(Integer.parseInt(str));\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(s.pop());\n\n\t}\n\n\tstatic class FastScanner {\n BufferedReader br;\n StringTokenizer st;\n\n public FastScanner() {\n br = new BufferedReader(new InputStreamReader(System.in));\n }\n \n boolean hasNext(){\n \tif(st != null && st.hasMoreElements()) {\n \t\treturn true;\n \t} else {\n \t\ttry {\n\t\t\t\t\tbr.mark(1024);\n\t\t\t\t\tif(br.readLine() == null) {\n\t\t\t\t\t\tbr.reset();\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tbr.reset();\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t \t\t\t\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t\treturn false;\n\t\t\t\t}\n \t}\n }\n\n String next() {\n while (st == null || !st.hasMoreElements()) {\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }\n\n int nextInt() {\n return Integer.parseInt(next());\n }\n\n long nextLong() {\n return Long.parseLong(next());\n }\n\n double nextDouble() {\n return Double.parseDouble(next());\n }\n\n String nextLine() {\n String str = \"\";\n try {\n str = br.readLine();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return str;\n }\n }\n}",
"import java.io.BufferedReader;",
"BufferedReader",
"java.io",
"import java.io.IOException;",
"IOException",
"java.io",
"import java.io.InputStreamReader;",
"InputStreamReader",
"java.io",
"import java.util.Stack;",
"Stack",
"java.util",
"import java.util.StringTokenizer;",
"StringTokenizer",
"java.util",
"public class Main {\n\tprivate static FastScanner sc = new FastScanner();\n\n\tpublic static void main(String[] args) {\n\t\tStack<Integer> s = new Stack<Integer>();\n\t\t\n\t\twhile(sc.hasNext()) {\n\t\t\tString str = sc.next();\n\t\t\tif(str.equals(\"+\")) {\n\t\t\t\tint b = s.pop();\n\t\t\t\tint a = s.pop();\n\t\t\t\ts.push(a+b);\t\t\t\n\t\t\t} else if(str.equals(\"-\")) {\n\t\t\t\tint b = s.pop();\n\t\t\t\tint a = s.pop();\n\t\t\t\ts.push(a-b);\n\t\t\t} else if(str.equals(\"*\")) {\n\t\t\t\tint b = s.pop();\n\t\t\t\tint a = s.pop();\n\t\t\t\ts.push(a*b);\n\t\t\t} else {\n\t\t\t\ts.push(Integer.parseInt(str));\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(s.pop());\n\n\t}\n\n\tstatic class FastScanner {\n BufferedReader br;\n StringTokenizer st;\n\n public FastScanner() {\n br = new BufferedReader(new InputStreamReader(System.in));\n }\n \n boolean hasNext(){\n \tif(st != null && st.hasMoreElements()) {\n \t\treturn true;\n \t} else {\n \t\ttry {\n\t\t\t\t\tbr.mark(1024);\n\t\t\t\t\tif(br.readLine() == null) {\n\t\t\t\t\t\tbr.reset();\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tbr.reset();\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t \t\t\t\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t\treturn false;\n\t\t\t\t}\n \t}\n }\n\n String next() {\n while (st == null || !st.hasMoreElements()) {\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }\n\n int nextInt() {\n return Integer.parseInt(next());\n }\n\n long nextLong() {\n return Long.parseLong(next());\n }\n\n double nextDouble() {\n return Double.parseDouble(next());\n }\n\n String nextLine() {\n String str = \"\";\n try {\n str = br.readLine();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return str;\n }\n }\n}",
"Main",
"private static FastScanner sc = new FastScanner();",
"sc",
"new FastScanner()",
"public static void main(String[] args) {\n\t\tStack<Integer> s = new Stack<Integer>();\n\t\t\n\t\twhile(sc.hasNext()) {\n\t\t\tString str = sc.next();\n\t\t\tif(str.equals(\"+\")) {\n\t\t\t\tint b = s.pop();\n\t\t\t\tint a = s.pop();\n\t\t\t\ts.push(a+b);\t\t\t\n\t\t\t} else if(str.equals(\"-\")) {\n\t\t\t\tint b = s.pop();\n\t\t\t\tint a = s.pop();\n\t\t\t\ts.push(a-b);\n\t\t\t} else if(str.equals(\"*\")) {\n\t\t\t\tint b = s.pop();\n\t\t\t\tint a = s.pop();\n\t\t\t\ts.push(a*b);\n\t\t\t} else {\n\t\t\t\ts.push(Integer.parseInt(str));\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(s.pop());\n\n\t}",
"main",
"{\n\t\tStack<Integer> s = new Stack<Integer>();\n\t\t\n\t\twhile(sc.hasNext()) {\n\t\t\tString str = sc.next();\n\t\t\tif(str.equals(\"+\")) {\n\t\t\t\tint b = s.pop();\n\t\t\t\tint a = s.pop();\n\t\t\t\ts.push(a+b);\t\t\t\n\t\t\t} else if(str.equals(\"-\")) {\n\t\t\t\tint b = s.pop();\n\t\t\t\tint a = s.pop();\n\t\t\t\ts.push(a-b);\n\t\t\t} else if(str.equals(\"*\")) {\n\t\t\t\tint b = s.pop();\n\t\t\t\tint a = s.pop();\n\t\t\t\ts.push(a*b);\n\t\t\t} else {\n\t\t\t\ts.push(Integer.parseInt(str));\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(s.pop());\n\n\t}",
"Stack<Integer> s = new Stack<Integer>();",
"s",
"new Stack<Integer>()",
"while(sc.hasNext()) {\n\t\t\tString str = sc.next();\n\t\t\tif(str.equals(\"+\")) {\n\t\t\t\tint b = s.pop();\n\t\t\t\tint a = s.pop();\n\t\t\t\ts.push(a+b);\t\t\t\n\t\t\t} else if(str.equals(\"-\")) {\n\t\t\t\tint b = s.pop();\n\t\t\t\tint a = s.pop();\n\t\t\t\ts.push(a-b);\n\t\t\t} else if(str.equals(\"*\")) {\n\t\t\t\tint b = s.pop();\n\t\t\t\tint a = s.pop();\n\t\t\t\ts.push(a*b);\n\t\t\t} else {\n\t\t\t\ts.push(Integer.parseInt(str));\n\t\t\t}\n\t\t}",
"sc.hasNext()",
"sc.hasNext",
"sc",
"{\n\t\t\tString str = sc.next();\n\t\t\tif(str.equals(\"+\")) {\n\t\t\t\tint b = s.pop();\n\t\t\t\tint a = s.pop();\n\t\t\t\ts.push(a+b);\t\t\t\n\t\t\t} else if(str.equals(\"-\")) {\n\t\t\t\tint b = s.pop();\n\t\t\t\tint a = s.pop();\n\t\t\t\ts.push(a-b);\n\t\t\t} else if(str.equals(\"*\")) {\n\t\t\t\tint b = s.pop();\n\t\t\t\tint a = s.pop();\n\t\t\t\ts.push(a*b);\n\t\t\t} else {\n\t\t\t\ts.push(Integer.parseInt(str));\n\t\t\t}\n\t\t}",
"String str = sc.next();",
"str",
"sc.next()",
"sc.next",
"sc",
"if(str.equals(\"+\")) {\n\t\t\t\tint b = s.pop();\n\t\t\t\tint a = s.pop();\n\t\t\t\ts.push(a+b);\t\t\t\n\t\t\t} else if(str.equals(\"-\")) {\n\t\t\t\tint b = s.pop();\n\t\t\t\tint a = s.pop();\n\t\t\t\ts.push(a-b);\n\t\t\t} else if(str.equals(\"*\")) {\n\t\t\t\tint b = s.pop();\n\t\t\t\tint a = s.pop();\n\t\t\t\ts.push(a*b);\n\t\t\t} else {\n\t\t\t\ts.push(Integer.parseInt(str));\n\t\t\t}",
"str.equals(\"+\")",
"str.equals",
"str",
"\"+\"",
"{\n\t\t\t\tint b = s.pop();\n\t\t\t\tint a = s.pop();\n\t\t\t\ts.push(a+b);\t\t\t\n\t\t\t}",
"int b = s.pop();",
"b",
"s.pop()",
"s.pop",
"s",
"int a = s.pop();",
"a",
"s.pop()",
"s.pop",
"s",
"s.push(a+b)",
"s.push",
"s",
"a+b",
"a",
"b",
"if(str.equals(\"-\")) {\n\t\t\t\tint b = s.pop();\n\t\t\t\tint a = s.pop();\n\t\t\t\ts.push(a-b);\n\t\t\t} else if(str.equals(\"*\")) {\n\t\t\t\tint b = s.pop();\n\t\t\t\tint a = s.pop();\n\t\t\t\ts.push(a*b);\n\t\t\t} else {\n\t\t\t\ts.push(Integer.parseInt(str));\n\t\t\t}",
"str.equals(\"-\")",
"str.equals",
"str",
"\"-\"",
"{\n\t\t\t\tint b = s.pop();\n\t\t\t\tint a = s.pop();\n\t\t\t\ts.push(a-b);\n\t\t\t}",
"int b = s.pop();",
"b",
"s.pop()",
"s.pop",
"s",
"int a = s.pop();",
"a",
"s.pop()",
"s.pop",
"s",
"s.push(a-b)",
"s.push",
"s",
"a-b",
"a",
"b",
"if(str.equals(\"*\")) {\n\t\t\t\tint b = s.pop();\n\t\t\t\tint a = s.pop();\n\t\t\t\ts.push(a*b);\n\t\t\t} else {\n\t\t\t\ts.push(Integer.parseInt(str));\n\t\t\t}",
"str.equals(\"*\")",
"str.equals",
"str",
"\"*\"",
"{\n\t\t\t\tint b = s.pop();\n\t\t\t\tint a = s.pop();\n\t\t\t\ts.push(a*b);\n\t\t\t}",
"int b = s.pop();",
"b",
"s.pop()",
"s.pop",
"s",
"int a = s.pop();",
"a",
"s.pop()",
"s.pop",
"s",
"s.push(a*b)",
"s.push",
"s",
"a*b",
"a",
"b",
"{\n\t\t\t\ts.push(Integer.parseInt(str));\n\t\t\t}",
"s.push(Integer.parseInt(str))",
"s.push",
"s",
"Integer.parseInt(str)",
"Integer.parseInt",
"Integer",
"str",
"System.out.println(s.pop())",
"System.out.println",
"System.out",
"System",
"System.out",
"s.pop()",
"s.pop",
"s",
"String[] args",
"args",
"static class FastScanner {\n BufferedReader br;\n StringTokenizer st;\n\n public FastScanner() {\n br = new BufferedReader(new InputStreamReader(System.in));\n }\n \n boolean hasNext(){\n \tif(st != null && st.hasMoreElements()) {\n \t\treturn true;\n \t} else {\n \t\ttry {\n\t\t\t\t\tbr.mark(1024);\n\t\t\t\t\tif(br.readLine() == null) {\n\t\t\t\t\t\tbr.reset();\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tbr.reset();\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t \t\t\t\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t\treturn false;\n\t\t\t\t}\n \t}\n }\n\n String next() {\n while (st == null || !st.hasMoreElements()) {\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }\n\n int nextInt() {\n return Integer.parseInt(next());\n }\n\n long nextLong() {\n return Long.parseLong(next());\n }\n\n double nextDouble() {\n return Double.parseDouble(next());\n }\n\n String nextLine() {\n String str = \"\";\n try {\n str = br.readLine();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return str;\n }\n }",
"FastScanner",
"BufferedReader br;",
"br",
"StringTokenizer st;",
"st",
"public FastScanner() {\n br = new BufferedReader(new InputStreamReader(System.in));\n }",
"FastScanner",
"{\n br = new BufferedReader(new InputStreamReader(System.in));\n }",
"br = new BufferedReader(new InputStreamReader(System.in))",
"br",
"new BufferedReader(new InputStreamReader(System.in))",
"boolean hasNext(){\n \tif(st != null && st.hasMoreElements()) {\n \t\treturn true;\n \t} else {\n \t\ttry {\n\t\t\t\t\tbr.mark(1024);\n\t\t\t\t\tif(br.readLine() == null) {\n\t\t\t\t\t\tbr.reset();\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tbr.reset();\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t \t\t\t\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t\treturn false;\n\t\t\t\t}\n \t}\n }",
"hasNext",
"{\n \tif(st != null && st.hasMoreElements()) {\n \t\treturn true;\n \t} else {\n \t\ttry {\n\t\t\t\t\tbr.mark(1024);\n\t\t\t\t\tif(br.readLine() == null) {\n\t\t\t\t\t\tbr.reset();\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tbr.reset();\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t \t\t\t\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t\treturn false;\n\t\t\t\t}\n \t}\n }",
"if(st != null && st.hasMoreElements()) {\n \t\treturn true;\n \t} else {\n \t\ttry {\n\t\t\t\t\tbr.mark(1024);\n\t\t\t\t\tif(br.readLine() == null) {\n\t\t\t\t\t\tbr.reset();\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tbr.reset();\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t \t\t\t\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t\treturn false;\n\t\t\t\t}\n \t}",
"st != null && st.hasMoreElements()",
"st != null",
"st",
"null",
"st.hasMoreElements()",
"st.hasMoreElements",
"st",
"{\n \t\treturn true;\n \t}",
"return true;",
"true",
"{\n \t\ttry {\n\t\t\t\t\tbr.mark(1024);\n\t\t\t\t\tif(br.readLine() == null) {\n\t\t\t\t\t\tbr.reset();\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tbr.reset();\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t \t\t\t\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t\treturn false;\n\t\t\t\t}\n \t}",
"try {\n\t\t\t\t\tbr.mark(1024);\n\t\t\t\t\tif(br.readLine() == null) {\n\t\t\t\t\t\tbr.reset();\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tbr.reset();\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t \t\t\t\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t\treturn false;\n\t\t\t\t}",
"catch (IOException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t\treturn false;\n\t\t\t\t}",
"IOException e",
"{\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t\treturn false;\n\t\t\t\t}",
"e.printStackTrace()",
"e.printStackTrace",
"e",
"return false;",
"false",
"{\n\t\t\t\t\tbr.mark(1024);\n\t\t\t\t\tif(br.readLine() == null) {\n\t\t\t\t\t\tbr.reset();\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tbr.reset();\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t \t\t\t\n\t\t\t\t}",
"br.mark(1024)",
"br.mark",
"br",
"1024",
"if(br.readLine() == null) {\n\t\t\t\t\t\tbr.reset();\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tbr.reset();\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}",
"br.readLine() == null",
"br.readLine()",
"br.readLine",
"br",
"null",
"{\n\t\t\t\t\t\tbr.reset();\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}",
"br.reset()",
"br.reset",
"br",
"return false;",
"false",
"{\n\t\t\t\t\t\tbr.reset();\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}",
"br.reset()",
"br.reset",
"br",
"return true;",
"true",
"String next() {\n while (st == null || !st.hasMoreElements()) {\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }",
"next",
"{\n while (st == null || !st.hasMoreElements()) {\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }",
"while (st == null || !st.hasMoreElements()) {\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }\n }",
"st == null || !st.hasMoreElements()",
"st == null",
"st",
"null",
"!st.hasMoreElements()",
"st.hasMoreElements()",
"st.hasMoreElements",
"st",
"{\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }\n }",
"try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }",
"catch (IOException e) {\n e.printStackTrace();\n }",
"IOException e",
"{\n e.printStackTrace();\n }",
"e.printStackTrace()",
"e.printStackTrace",
"e",
"{\n st = new StringTokenizer(br.readLine());\n }",
"st = new StringTokenizer(br.readLine())",
"st",
"new StringTokenizer(br.readLine())",
"return st.nextToken();",
"st.nextToken()",
"st.nextToken",
"st",
"int nextInt() {\n return Integer.parseInt(next());\n }",
"nextInt",
"{\n return Integer.parseInt(next());\n }",
"return Integer.parseInt(next());",
"Integer.parseInt(next())",
"Integer.parseInt",
"Integer",
"next()",
"next",
"long nextLong() {\n return Long.parseLong(next());\n }",
"nextLong",
"{\n return Long.parseLong(next());\n }",
"return Long.parseLong(next());",
"Long.parseLong(next())",
"Long.parseLong",
"Long",
"next()",
"next",
"double nextDouble() {\n return Double.parseDouble(next());\n }",
"nextDouble",
"{\n return Double.parseDouble(next());\n }",
"return Double.parseDouble(next());",
"Double.parseDouble(next())",
"Double.parseDouble",
"Double",
"next()",
"next",
"String nextLine() {\n String str = \"\";\n try {\n str = br.readLine();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return str;\n }",
"nextLine",
"{\n String str = \"\";\n try {\n str = br.readLine();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return str;\n }",
"String str = \"\";",
"str",
"\"\"",
"try {\n str = br.readLine();\n } catch (IOException e) {\n e.printStackTrace();\n }",
"catch (IOException e) {\n e.printStackTrace();\n }",
"IOException e",
"{\n e.printStackTrace();\n }",
"e.printStackTrace()",
"e.printStackTrace",
"e",
"{\n str = br.readLine();\n }",
"str = br.readLine()",
"str",
"br.readLine()",
"br.readLine",
"br",
"return str;",
"str",
"public class Main {\n\tprivate static FastScanner sc = new FastScanner();\n\n\tpublic static void main(String[] args) {\n\t\tStack<Integer> s = new Stack<Integer>();\n\t\t\n\t\twhile(sc.hasNext()) {\n\t\t\tString str = sc.next();\n\t\t\tif(str.equals(\"+\")) {\n\t\t\t\tint b = s.pop();\n\t\t\t\tint a = s.pop();\n\t\t\t\ts.push(a+b);\t\t\t\n\t\t\t} else if(str.equals(\"-\")) {\n\t\t\t\tint b = s.pop();\n\t\t\t\tint a = s.pop();\n\t\t\t\ts.push(a-b);\n\t\t\t} else if(str.equals(\"*\")) {\n\t\t\t\tint b = s.pop();\n\t\t\t\tint a = s.pop();\n\t\t\t\ts.push(a*b);\n\t\t\t} else {\n\t\t\t\ts.push(Integer.parseInt(str));\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(s.pop());\n\n\t}\n\n\tstatic class FastScanner {\n BufferedReader br;\n StringTokenizer st;\n\n public FastScanner() {\n br = new BufferedReader(new InputStreamReader(System.in));\n }\n \n boolean hasNext(){\n \tif(st != null && st.hasMoreElements()) {\n \t\treturn true;\n \t} else {\n \t\ttry {\n\t\t\t\t\tbr.mark(1024);\n\t\t\t\t\tif(br.readLine() == null) {\n\t\t\t\t\t\tbr.reset();\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tbr.reset();\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t \t\t\t\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t\treturn false;\n\t\t\t\t}\n \t}\n }\n\n String next() {\n while (st == null || !st.hasMoreElements()) {\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }\n\n int nextInt() {\n return Integer.parseInt(next());\n }\n\n long nextLong() {\n return Long.parseLong(next());\n }\n\n double nextDouble() {\n return Double.parseDouble(next());\n }\n\n String nextLine() {\n String str = \"\";\n try {\n str = br.readLine();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return str;\n }\n }\n}",
"public class Main {\n\tprivate static FastScanner sc = new FastScanner();\n\n\tpublic static void main(String[] args) {\n\t\tStack<Integer> s = new Stack<Integer>();\n\t\t\n\t\twhile(sc.hasNext()) {\n\t\t\tString str = sc.next();\n\t\t\tif(str.equals(\"+\")) {\n\t\t\t\tint b = s.pop();\n\t\t\t\tint a = s.pop();\n\t\t\t\ts.push(a+b);\t\t\t\n\t\t\t} else if(str.equals(\"-\")) {\n\t\t\t\tint b = s.pop();\n\t\t\t\tint a = s.pop();\n\t\t\t\ts.push(a-b);\n\t\t\t} else if(str.equals(\"*\")) {\n\t\t\t\tint b = s.pop();\n\t\t\t\tint a = s.pop();\n\t\t\t\ts.push(a*b);\n\t\t\t} else {\n\t\t\t\ts.push(Integer.parseInt(str));\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(s.pop());\n\n\t}\n\n\tstatic class FastScanner {\n BufferedReader br;\n StringTokenizer st;\n\n public FastScanner() {\n br = new BufferedReader(new InputStreamReader(System.in));\n }\n \n boolean hasNext(){\n \tif(st != null && st.hasMoreElements()) {\n \t\treturn true;\n \t} else {\n \t\ttry {\n\t\t\t\t\tbr.mark(1024);\n\t\t\t\t\tif(br.readLine() == null) {\n\t\t\t\t\t\tbr.reset();\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tbr.reset();\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t \t\t\t\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t\treturn false;\n\t\t\t\t}\n \t}\n }\n\n String next() {\n while (st == null || !st.hasMoreElements()) {\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }\n\n int nextInt() {\n return Integer.parseInt(next());\n }\n\n long nextLong() {\n return Long.parseLong(next());\n }\n\n double nextDouble() {\n return Double.parseDouble(next());\n }\n\n String nextLine() {\n String str = \"\";\n try {\n str = br.readLine();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return str;\n }\n }\n}",
"Main"
] | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Stack;
import java.util.StringTokenizer;
public class Main {
private static FastScanner sc = new FastScanner();
public static void main(String[] args) {
Stack<Integer> s = new Stack<Integer>();
while(sc.hasNext()) {
String str = sc.next();
if(str.equals("+")) {
int b = s.pop();
int a = s.pop();
s.push(a+b);
} else if(str.equals("-")) {
int b = s.pop();
int a = s.pop();
s.push(a-b);
} else if(str.equals("*")) {
int b = s.pop();
int a = s.pop();
s.push(a*b);
} else {
s.push(Integer.parseInt(str));
}
}
System.out.println(s.pop());
}
static class FastScanner {
BufferedReader br;
StringTokenizer st;
public FastScanner() {
br = new BufferedReader(new InputStreamReader(System.in));
}
boolean hasNext(){
if(st != null && st.hasMoreElements()) {
return true;
} else {
try {
br.mark(1024);
if(br.readLine() == null) {
br.reset();
return false;
} else {
br.reset();
return true;
}
} catch (IOException e) {
e.printStackTrace();
return false;
}
}
}
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());
}
String nextLine() {
String str = "";
try {
str = br.readLine();
} catch (IOException e) {
e.printStackTrace();
}
return str;
}
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
41,
13,
41,
13,
41,
13,
20,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
17,
28,
13,
13,
30,
30,
35,
13,
34,
17,
1,
0,
13,
4,
18,
13,
0,
13,
4,
18,
13,
4,
18,
13,
2,
13,
13,
3,
34,
17,
1,
0,
13,
4,
18,
13,
0,
13,
4,
18,
13,
4,
18,
13,
2,
13,
13,
3,
34,
17,
1,
0,
13,
4,
18,
13,
0,
13,
4,
18,
13,
4,
18,
13,
2,
13,
13,
3,
34,
17,
1,
0,
13,
4,
18,
13,
0,
13,
4,
18,
13,
4,
18,
13,
2,
13,
13,
3,
34,
1,
4,
18,
13,
4,
18,
13,
13,
3,
0,
13,
4,
18,
13,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
143,
5
],
[
143,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
8,
11
],
[
11,
12
],
[
8,
13
],
[
13,
14
],
[
8,
15
],
[
15,
16
],
[
15,
17
],
[
8,
18
],
[
18,
19
],
[
18,
20
],
[
8,
21
],
[
21,
22
],
[
21,
23
],
[
23,
24
],
[
24,
25
],
[
8,
26
],
[
26,
27
],
[
26,
28
],
[
28,
29
],
[
29,
30
],
[
28,
31
],
[
8,
32
],
[
32,
33
],
[
32,
34
],
[
32,
35
],
[
36,
36
],
[
36,
37
],
[
37,
38
],
[
37,
39
],
[
39,
40
],
[
39,
41
],
[
41,
42
],
[
42,
43
],
[
42,
44
],
[
44,
45
],
[
45,
46
],
[
41,
47
],
[
47,
48
],
[
47,
49
],
[
49,
50
],
[
50,
51
],
[
41,
52
],
[
52,
53
],
[
53,
54
],
[
52,
55
],
[
55,
56
],
[
55,
57
],
[
41,
58
],
[
37,
59
],
[
59,
60
],
[
59,
61
],
[
61,
62
],
[
62,
63
],
[
62,
64
],
[
64,
65
],
[
65,
66
],
[
61,
67
],
[
67,
68
],
[
67,
69
],
[
69,
70
],
[
70,
71
],
[
61,
72
],
[
72,
73
],
[
73,
74
],
[
72,
75
],
[
75,
76
],
[
75,
77
],
[
61,
78
],
[
37,
79
],
[
79,
80
],
[
79,
81
],
[
81,
82
],
[
82,
83
],
[
82,
84
],
[
84,
85
],
[
85,
86
],
[
81,
87
],
[
87,
88
],
[
87,
89
],
[
89,
90
],
[
90,
91
],
[
81,
92
],
[
92,
93
],
[
93,
94
],
[
92,
95
],
[
95,
96
],
[
95,
97
],
[
81,
98
],
[
37,
99
],
[
99,
100
],
[
99,
101
],
[
101,
102
],
[
102,
103
],
[
102,
104
],
[
104,
105
],
[
105,
106
],
[
101,
107
],
[
107,
108
],
[
107,
109
],
[
109,
110
],
[
110,
111
],
[
101,
112
],
[
112,
113
],
[
113,
114
],
[
112,
115
],
[
115,
116
],
[
115,
117
],
[
101,
118
],
[
37,
119
],
[
119,
120
],
[
120,
121
],
[
121,
122
],
[
122,
123
],
[
121,
124
],
[
124,
125
],
[
125,
126
],
[
124,
127
],
[
120,
128
],
[
8,
129
],
[
129,
130
],
[
129,
131
],
[
131,
132
],
[
132,
133
],
[
8,
134
],
[
134,
135
],
[
135,
136
],
[
136,
137
],
[
136,
138
],
[
134,
139
],
[
6,
140
],
[
140,
141
],
[
0,
142
],
[
142,
143
],
[
142,
144
]
] | [
"\nimport java.util.*;\n\n\npublic class Main {\n\tpublic static void main(String[] args) {\t \n\t int number1;\n\t int number2;\n\t int answer;\n\t Scanner in = new Scanner(System.in);\n\t Stack<Integer> stack = new Stack<Integer>();\n\t String operator = in.nextLine();\n\t String[] arr = operator.split(\" \");\n\t \n\t for(String t : arr){\n\t \n\t switch(t){\n\t case \"+\":\n\t \tnumber1 = stack.pop();\n\t \tnumber2 = stack.pop();\n\t stack.push(number2 + number1);\n\t break;\n\t case \"-\":\n\t \tnumber1 = stack.pop();\n\t \tnumber2 = stack.pop();\n\t stack.push(number2 - number1);\n\t break;\n\t case \"*\":\n\t \tnumber1 = stack.pop();\n\t \tnumber2 = stack.pop();\n\t stack.push(number2 * number1);\n\t break;\n\t case \"/\":\n\t \tnumber1 = stack.pop();\n\t \tnumber2 = stack.pop();\n\t stack.push(number2 / number1);\n\t break;\n\t \n\t default:\n\t \tstack.push(Integer.parseInt(t));\n\t \tbreak;\n\t }\n\t }\n\t answer = stack.pop();\n\t System.out.println(answer);\n\t }\n}\n",
"import java.util.*;",
"util.*",
"java",
"public class Main {\n\tpublic static void main(String[] args) {\t \n\t int number1;\n\t int number2;\n\t int answer;\n\t Scanner in = new Scanner(System.in);\n\t Stack<Integer> stack = new Stack<Integer>();\n\t String operator = in.nextLine();\n\t String[] arr = operator.split(\" \");\n\t \n\t for(String t : arr){\n\t \n\t switch(t){\n\t case \"+\":\n\t \tnumber1 = stack.pop();\n\t \tnumber2 = stack.pop();\n\t stack.push(number2 + number1);\n\t break;\n\t case \"-\":\n\t \tnumber1 = stack.pop();\n\t \tnumber2 = stack.pop();\n\t stack.push(number2 - number1);\n\t break;\n\t case \"*\":\n\t \tnumber1 = stack.pop();\n\t \tnumber2 = stack.pop();\n\t stack.push(number2 * number1);\n\t break;\n\t case \"/\":\n\t \tnumber1 = stack.pop();\n\t \tnumber2 = stack.pop();\n\t stack.push(number2 / number1);\n\t break;\n\t \n\t default:\n\t \tstack.push(Integer.parseInt(t));\n\t \tbreak;\n\t }\n\t }\n\t answer = stack.pop();\n\t System.out.println(answer);\n\t }\n}",
"Main",
"public static void main(String[] args) {\t \n\t int number1;\n\t int number2;\n\t int answer;\n\t Scanner in = new Scanner(System.in);\n\t Stack<Integer> stack = new Stack<Integer>();\n\t String operator = in.nextLine();\n\t String[] arr = operator.split(\" \");\n\t \n\t for(String t : arr){\n\t \n\t switch(t){\n\t case \"+\":\n\t \tnumber1 = stack.pop();\n\t \tnumber2 = stack.pop();\n\t stack.push(number2 + number1);\n\t break;\n\t case \"-\":\n\t \tnumber1 = stack.pop();\n\t \tnumber2 = stack.pop();\n\t stack.push(number2 - number1);\n\t break;\n\t case \"*\":\n\t \tnumber1 = stack.pop();\n\t \tnumber2 = stack.pop();\n\t stack.push(number2 * number1);\n\t break;\n\t case \"/\":\n\t \tnumber1 = stack.pop();\n\t \tnumber2 = stack.pop();\n\t stack.push(number2 / number1);\n\t break;\n\t \n\t default:\n\t \tstack.push(Integer.parseInt(t));\n\t \tbreak;\n\t }\n\t }\n\t answer = stack.pop();\n\t System.out.println(answer);\n\t }",
"main",
"{\t \n\t int number1;\n\t int number2;\n\t int answer;\n\t Scanner in = new Scanner(System.in);\n\t Stack<Integer> stack = new Stack<Integer>();\n\t String operator = in.nextLine();\n\t String[] arr = operator.split(\" \");\n\t \n\t for(String t : arr){\n\t \n\t switch(t){\n\t case \"+\":\n\t \tnumber1 = stack.pop();\n\t \tnumber2 = stack.pop();\n\t stack.push(number2 + number1);\n\t break;\n\t case \"-\":\n\t \tnumber1 = stack.pop();\n\t \tnumber2 = stack.pop();\n\t stack.push(number2 - number1);\n\t break;\n\t case \"*\":\n\t \tnumber1 = stack.pop();\n\t \tnumber2 = stack.pop();\n\t stack.push(number2 * number1);\n\t break;\n\t case \"/\":\n\t \tnumber1 = stack.pop();\n\t \tnumber2 = stack.pop();\n\t stack.push(number2 / number1);\n\t break;\n\t \n\t default:\n\t \tstack.push(Integer.parseInt(t));\n\t \tbreak;\n\t }\n\t }\n\t answer = stack.pop();\n\t System.out.println(answer);\n\t }",
"int number1;",
"number1",
"int number2;",
"number2",
"int answer;",
"answer",
"Scanner in = new Scanner(System.in);",
"in",
"new Scanner(System.in)",
"Stack<Integer> stack = new Stack<Integer>();",
"stack",
"new Stack<Integer>()",
"String operator = in.nextLine();",
"operator",
"in.nextLine()",
"in.nextLine",
"in",
"String[] arr = operator.split(\" \");",
"arr",
"operator.split(\" \")",
"operator.split",
"operator",
"\" \"",
"for(String t : arr){\n\t \n\t switch(t){\n\t case \"+\":\n\t \tnumber1 = stack.pop();\n\t \tnumber2 = stack.pop();\n\t stack.push(number2 + number1);\n\t break;\n\t case \"-\":\n\t \tnumber1 = stack.pop();\n\t \tnumber2 = stack.pop();\n\t stack.push(number2 - number1);\n\t break;\n\t case \"*\":\n\t \tnumber1 = stack.pop();\n\t \tnumber2 = stack.pop();\n\t stack.push(number2 * number1);\n\t break;\n\t case \"/\":\n\t \tnumber1 = stack.pop();\n\t \tnumber2 = stack.pop();\n\t stack.push(number2 / number1);\n\t break;\n\t \n\t default:\n\t \tstack.push(Integer.parseInt(t));\n\t \tbreak;\n\t }\n\t }",
"String t",
"arr",
"{\n\t \n\t switch(t){\n\t case \"+\":\n\t \tnumber1 = stack.pop();\n\t \tnumber2 = stack.pop();\n\t stack.push(number2 + number1);\n\t break;\n\t case \"-\":\n\t \tnumber1 = stack.pop();\n\t \tnumber2 = stack.pop();\n\t stack.push(number2 - number1);\n\t break;\n\t case \"*\":\n\t \tnumber1 = stack.pop();\n\t \tnumber2 = stack.pop();\n\t stack.push(number2 * number1);\n\t break;\n\t case \"/\":\n\t \tnumber1 = stack.pop();\n\t \tnumber2 = stack.pop();\n\t stack.push(number2 / number1);\n\t break;\n\t \n\t default:\n\t \tstack.push(Integer.parseInt(t));\n\t \tbreak;\n\t }\n\t }",
"{\n\t \n\t switch(t){\n\t case \"+\":\n\t \tnumber1 = stack.pop();\n\t \tnumber2 = stack.pop();\n\t stack.push(number2 + number1);\n\t break;\n\t case \"-\":\n\t \tnumber1 = stack.pop();\n\t \tnumber2 = stack.pop();\n\t stack.push(number2 - number1);\n\t break;\n\t case \"*\":\n\t \tnumber1 = stack.pop();\n\t \tnumber2 = stack.pop();\n\t stack.push(number2 * number1);\n\t break;\n\t case \"/\":\n\t \tnumber1 = stack.pop();\n\t \tnumber2 = stack.pop();\n\t stack.push(number2 / number1);\n\t break;\n\t \n\t default:\n\t \tstack.push(Integer.parseInt(t));\n\t \tbreak;\n\t }\n\t }",
"switch(t){\n\t case \"+\":\n\t \tnumber1 = stack.pop();\n\t \tnumber2 = stack.pop();\n\t stack.push(number2 + number1);\n\t break;\n\t case \"-\":\n\t \tnumber1 = stack.pop();\n\t \tnumber2 = stack.pop();\n\t stack.push(number2 - number1);\n\t break;\n\t case \"*\":\n\t \tnumber1 = stack.pop();\n\t \tnumber2 = stack.pop();\n\t stack.push(number2 * number1);\n\t break;\n\t case \"/\":\n\t \tnumber1 = stack.pop();\n\t \tnumber2 = stack.pop();\n\t stack.push(number2 / number1);\n\t break;\n\t \n\t default:\n\t \tstack.push(Integer.parseInt(t));\n\t \tbreak;\n\t }",
"t",
"case \"+\":",
"\"+\"",
"case \"+\":",
"number1 = stack.pop()",
"number1",
"stack.pop()",
"stack.pop",
"stack",
"number2 = stack.pop()",
"number2",
"stack.pop()",
"stack.pop",
"stack",
"stack.push(number2 + number1)",
"stack.push",
"stack",
"number2 + number1",
"number2",
"number1",
"break;",
"case \"-\":",
"\"-\"",
"case \"-\":",
"number1 = stack.pop()",
"number1",
"stack.pop()",
"stack.pop",
"stack",
"number2 = stack.pop()",
"number2",
"stack.pop()",
"stack.pop",
"stack",
"stack.push(number2 - number1)",
"stack.push",
"stack",
"number2 - number1",
"number2",
"number1",
"break;",
"case \"*\":",
"\"*\"",
"case \"*\":",
"number1 = stack.pop()",
"number1",
"stack.pop()",
"stack.pop",
"stack",
"number2 = stack.pop()",
"number2",
"stack.pop()",
"stack.pop",
"stack",
"stack.push(number2 * number1)",
"stack.push",
"stack",
"number2 * number1",
"number2",
"number1",
"break;",
"case \"/\":",
"\"/\"",
"case \"/\":",
"number1 = stack.pop()",
"number1",
"stack.pop()",
"stack.pop",
"stack",
"number2 = stack.pop()",
"number2",
"stack.pop()",
"stack.pop",
"stack",
"stack.push(number2 / number1)",
"stack.push",
"stack",
"number2 / number1",
"number2",
"number1",
"break;",
"default:",
"default:",
"stack.push(Integer.parseInt(t))",
"stack.push",
"stack",
"Integer.parseInt(t)",
"Integer.parseInt",
"Integer",
"t",
"break;",
"answer = stack.pop()",
"answer",
"stack.pop()",
"stack.pop",
"stack",
"System.out.println(answer)",
"System.out.println",
"System.out",
"System",
"System.out",
"answer",
"String[] args",
"args",
"public class Main {\n\tpublic static void main(String[] args) {\t \n\t int number1;\n\t int number2;\n\t int answer;\n\t Scanner in = new Scanner(System.in);\n\t Stack<Integer> stack = new Stack<Integer>();\n\t String operator = in.nextLine();\n\t String[] arr = operator.split(\" \");\n\t \n\t for(String t : arr){\n\t \n\t switch(t){\n\t case \"+\":\n\t \tnumber1 = stack.pop();\n\t \tnumber2 = stack.pop();\n\t stack.push(number2 + number1);\n\t break;\n\t case \"-\":\n\t \tnumber1 = stack.pop();\n\t \tnumber2 = stack.pop();\n\t stack.push(number2 - number1);\n\t break;\n\t case \"*\":\n\t \tnumber1 = stack.pop();\n\t \tnumber2 = stack.pop();\n\t stack.push(number2 * number1);\n\t break;\n\t case \"/\":\n\t \tnumber1 = stack.pop();\n\t \tnumber2 = stack.pop();\n\t stack.push(number2 / number1);\n\t break;\n\t \n\t default:\n\t \tstack.push(Integer.parseInt(t));\n\t \tbreak;\n\t }\n\t }\n\t answer = stack.pop();\n\t System.out.println(answer);\n\t }\n}",
"public class Main {\n\tpublic static void main(String[] args) {\t \n\t int number1;\n\t int number2;\n\t int answer;\n\t Scanner in = new Scanner(System.in);\n\t Stack<Integer> stack = new Stack<Integer>();\n\t String operator = in.nextLine();\n\t String[] arr = operator.split(\" \");\n\t \n\t for(String t : arr){\n\t \n\t switch(t){\n\t case \"+\":\n\t \tnumber1 = stack.pop();\n\t \tnumber2 = stack.pop();\n\t stack.push(number2 + number1);\n\t break;\n\t case \"-\":\n\t \tnumber1 = stack.pop();\n\t \tnumber2 = stack.pop();\n\t stack.push(number2 - number1);\n\t break;\n\t case \"*\":\n\t \tnumber1 = stack.pop();\n\t \tnumber2 = stack.pop();\n\t stack.push(number2 * number1);\n\t break;\n\t case \"/\":\n\t \tnumber1 = stack.pop();\n\t \tnumber2 = stack.pop();\n\t stack.push(number2 / number1);\n\t break;\n\t \n\t default:\n\t \tstack.push(Integer.parseInt(t));\n\t \tbreak;\n\t }\n\t }\n\t answer = stack.pop();\n\t System.out.println(answer);\n\t }\n}",
"Main"
] |
import java.util.*;
public class Main {
public static void main(String[] args) {
int number1;
int number2;
int answer;
Scanner in = new Scanner(System.in);
Stack<Integer> stack = new Stack<Integer>();
String operator = in.nextLine();
String[] arr = operator.split(" ");
for(String t : arr){
switch(t){
case "+":
number1 = stack.pop();
number2 = stack.pop();
stack.push(number2 + number1);
break;
case "-":
number1 = stack.pop();
number2 = stack.pop();
stack.push(number2 - number1);
break;
case "*":
number1 = stack.pop();
number2 = stack.pop();
stack.push(number2 * number1);
break;
case "/":
number1 = stack.pop();
number2 = stack.pop();
stack.push(number2 / number1);
break;
default:
stack.push(Integer.parseInt(t));
break;
}
}
answer = stack.pop();
System.out.println(answer);
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
4,
18,
13,
17,
41,
13,
20,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
30,
41,
13,
41,
13,
35,
18,
13,
13,
34,
17,
1,
0,
13,
4,
18,
13,
4,
18,
13,
0,
13,
4,
18,
13,
4,
18,
13,
4,
18,
13,
4,
18,
13,
2,
13,
13,
3,
34,
17,
1,
0,
13,
4,
18,
13,
4,
18,
13,
0,
13,
4,
18,
13,
4,
18,
13,
4,
18,
13,
4,
18,
13,
2,
13,
13,
3,
34,
17,
1,
0,
13,
4,
18,
13,
4,
18,
13,
0,
13,
4,
18,
13,
4,
18,
13,
4,
18,
13,
4,
18,
13,
2,
13,
13,
3,
34,
1,
4,
18,
13,
18,
13,
13,
3,
4,
18,
18,
13,
13,
4,
18,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
10,
11
],
[
10,
12
],
[
0,
13
],
[
13,
14
],
[
13,
15
],
[
0,
16
],
[
165,
17
],
[
165,
18
],
[
18,
19
],
[
18,
20
],
[
20,
21
],
[
21,
22
],
[
21,
23
],
[
20,
24
],
[
24,
25
],
[
24,
26
],
[
26,
27
],
[
27,
28
],
[
28,
29
],
[
29,
30
],
[
26,
31
],
[
20,
32
],
[
32,
33
],
[
32,
34
],
[
20,
35
],
[
35,
36
],
[
36,
37
],
[
37,
38
],
[
37,
39
],
[
35,
40
],
[
40,
41
],
[
40,
42
],
[
42,
43
],
[
42,
44
],
[
35,
45
],
[
45,
46
],
[
46,
47
],
[
35,
48
],
[
49,
49
],
[
49,
50
],
[
50,
51
],
[
49,
52
],
[
52,
53
],
[
49,
54
],
[
54,
55
],
[
55,
56
],
[
55,
57
],
[
54,
58
],
[
58,
59
],
[
58,
60
],
[
60,
61
],
[
61,
62
],
[
61,
63
],
[
63,
64
],
[
64,
65
],
[
63,
66
],
[
66,
67
],
[
67,
68
],
[
60,
69
],
[
69,
70
],
[
69,
71
],
[
71,
72
],
[
72,
73
],
[
71,
74
],
[
74,
75
],
[
75,
76
],
[
60,
77
],
[
77,
78
],
[
78,
79
],
[
77,
80
],
[
80,
81
],
[
81,
82
],
[
80,
83
],
[
83,
84
],
[
83,
85
],
[
60,
86
],
[
54,
87
],
[
87,
88
],
[
87,
89
],
[
89,
90
],
[
90,
91
],
[
90,
92
],
[
92,
93
],
[
93,
94
],
[
92,
95
],
[
95,
96
],
[
96,
97
],
[
89,
98
],
[
98,
99
],
[
98,
100
],
[
100,
101
],
[
101,
102
],
[
100,
103
],
[
103,
104
],
[
104,
105
],
[
89,
106
],
[
106,
107
],
[
107,
108
],
[
106,
109
],
[
109,
110
],
[
110,
111
],
[
109,
112
],
[
112,
113
],
[
112,
114
],
[
89,
115
],
[
54,
116
],
[
116,
117
],
[
116,
118
],
[
118,
119
],
[
119,
120
],
[
119,
121
],
[
121,
122
],
[
122,
123
],
[
121,
124
],
[
124,
125
],
[
125,
126
],
[
118,
127
],
[
127,
128
],
[
127,
129
],
[
129,
130
],
[
130,
131
],
[
129,
132
],
[
132,
133
],
[
133,
134
],
[
118,
135
],
[
135,
136
],
[
136,
137
],
[
135,
138
],
[
138,
139
],
[
139,
140
],
[
138,
141
],
[
141,
142
],
[
141,
143
],
[
118,
144
],
[
54,
145
],
[
145,
146
],
[
146,
147
],
[
147,
148
],
[
148,
149
],
[
147,
150
],
[
150,
151
],
[
150,
152
],
[
146,
153
],
[
20,
154
],
[
154,
155
],
[
155,
156
],
[
156,
157
],
[
156,
158
],
[
154,
159
],
[
159,
160
],
[
160,
161
],
[
18,
162
],
[
162,
163
],
[
0,
164
],
[
164,
165
],
[
164,
166
]
] | [
"import java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\nimport java.util.ArrayDeque;\nimport java.util.Deque;\n\npublic class Main {\n\n\tpublic static void main(String[] args) throws NumberFormatException, IOException {\n\t\t// TODO ?????????????????????????????????????????????\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\t\n\t\tString[] formula = br.readLine().split(\" \");\n\t\t\n\t\tDeque<String> deq = new ArrayDeque<String>();\n\t\t\n\t\tfor(int i = 0; i < formula.length; i++){\n\t\t\tint tmp1; \n\t\t\tint tmp2;\n\t\t\t\n\t\t\tswitch(formula[i]){\n\t\t\tcase \"+\":\n\t\t\t\ttmp1 = Integer.parseInt(deq.removeFirst());\n\t\t\t\ttmp2 = Integer.parseInt(deq.removeFirst());\n\t\t\t\t\n\t\t\t\tdeq.addFirst(Integer.toString(tmp2 + tmp1));\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase \"*\":\n\t\t\t\ttmp1 = Integer.parseInt(deq.removeFirst());\n\t\t\t\ttmp2 = Integer.parseInt(deq.removeFirst());\n\t\t\t\t\n\t\t\t\tdeq.addFirst(Integer.toString(tmp2 * tmp1));\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase \"-\":\n\t\t\t\ttmp1 = Integer.parseInt(deq.removeFirst());\n\t\t\t\ttmp2 = Integer.parseInt(deq.removeFirst());\n\t\t\t\t\n\t\t\t\tdeq.addFirst(Integer.toString(tmp2 - tmp1));\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tdefault:\n\t\t\t\tdeq.addFirst(formula[i]);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(deq.removeLast());\n\t}\n\n}",
"import java.io.BufferedReader;",
"BufferedReader",
"java.io",
"import java.io.IOException;",
"IOException",
"java.io",
"import java.io.InputStreamReader;",
"InputStreamReader",
"java.io",
"import java.util.ArrayDeque;",
"ArrayDeque",
"java.util",
"import java.util.Deque;",
"Deque",
"java.util",
"public class Main {\n\n\tpublic static void main(String[] args) throws NumberFormatException, IOException {\n\t\t// TODO ?????????????????????????????????????????????\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\t\n\t\tString[] formula = br.readLine().split(\" \");\n\t\t\n\t\tDeque<String> deq = new ArrayDeque<String>();\n\t\t\n\t\tfor(int i = 0; i < formula.length; i++){\n\t\t\tint tmp1; \n\t\t\tint tmp2;\n\t\t\t\n\t\t\tswitch(formula[i]){\n\t\t\tcase \"+\":\n\t\t\t\ttmp1 = Integer.parseInt(deq.removeFirst());\n\t\t\t\ttmp2 = Integer.parseInt(deq.removeFirst());\n\t\t\t\t\n\t\t\t\tdeq.addFirst(Integer.toString(tmp2 + tmp1));\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase \"*\":\n\t\t\t\ttmp1 = Integer.parseInt(deq.removeFirst());\n\t\t\t\ttmp2 = Integer.parseInt(deq.removeFirst());\n\t\t\t\t\n\t\t\t\tdeq.addFirst(Integer.toString(tmp2 * tmp1));\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase \"-\":\n\t\t\t\ttmp1 = Integer.parseInt(deq.removeFirst());\n\t\t\t\ttmp2 = Integer.parseInt(deq.removeFirst());\n\t\t\t\t\n\t\t\t\tdeq.addFirst(Integer.toString(tmp2 - tmp1));\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tdefault:\n\t\t\t\tdeq.addFirst(formula[i]);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(deq.removeLast());\n\t}\n\n}",
"Main",
"public static void main(String[] args) throws NumberFormatException, IOException {\n\t\t// TODO ?????????????????????????????????????????????\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\t\n\t\tString[] formula = br.readLine().split(\" \");\n\t\t\n\t\tDeque<String> deq = new ArrayDeque<String>();\n\t\t\n\t\tfor(int i = 0; i < formula.length; i++){\n\t\t\tint tmp1; \n\t\t\tint tmp2;\n\t\t\t\n\t\t\tswitch(formula[i]){\n\t\t\tcase \"+\":\n\t\t\t\ttmp1 = Integer.parseInt(deq.removeFirst());\n\t\t\t\ttmp2 = Integer.parseInt(deq.removeFirst());\n\t\t\t\t\n\t\t\t\tdeq.addFirst(Integer.toString(tmp2 + tmp1));\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase \"*\":\n\t\t\t\ttmp1 = Integer.parseInt(deq.removeFirst());\n\t\t\t\ttmp2 = Integer.parseInt(deq.removeFirst());\n\t\t\t\t\n\t\t\t\tdeq.addFirst(Integer.toString(tmp2 * tmp1));\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase \"-\":\n\t\t\t\ttmp1 = Integer.parseInt(deq.removeFirst());\n\t\t\t\ttmp2 = Integer.parseInt(deq.removeFirst());\n\t\t\t\t\n\t\t\t\tdeq.addFirst(Integer.toString(tmp2 - tmp1));\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tdefault:\n\t\t\t\tdeq.addFirst(formula[i]);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(deq.removeLast());\n\t}",
"main",
"{\n\t\t// TODO ?????????????????????????????????????????????\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\t\n\t\tString[] formula = br.readLine().split(\" \");\n\t\t\n\t\tDeque<String> deq = new ArrayDeque<String>();\n\t\t\n\t\tfor(int i = 0; i < formula.length; i++){\n\t\t\tint tmp1; \n\t\t\tint tmp2;\n\t\t\t\n\t\t\tswitch(formula[i]){\n\t\t\tcase \"+\":\n\t\t\t\ttmp1 = Integer.parseInt(deq.removeFirst());\n\t\t\t\ttmp2 = Integer.parseInt(deq.removeFirst());\n\t\t\t\t\n\t\t\t\tdeq.addFirst(Integer.toString(tmp2 + tmp1));\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase \"*\":\n\t\t\t\ttmp1 = Integer.parseInt(deq.removeFirst());\n\t\t\t\ttmp2 = Integer.parseInt(deq.removeFirst());\n\t\t\t\t\n\t\t\t\tdeq.addFirst(Integer.toString(tmp2 * tmp1));\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase \"-\":\n\t\t\t\ttmp1 = Integer.parseInt(deq.removeFirst());\n\t\t\t\ttmp2 = Integer.parseInt(deq.removeFirst());\n\t\t\t\t\n\t\t\t\tdeq.addFirst(Integer.toString(tmp2 - tmp1));\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tdefault:\n\t\t\t\tdeq.addFirst(formula[i]);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(deq.removeLast());\n\t}",
"BufferedReader br = new BufferedReader(new InputStreamReader(System.in));",
"br",
"new BufferedReader(new InputStreamReader(System.in))",
"String[] formula = br.readLine().split(\" \");",
"formula",
"br.readLine().split(\" \")",
"br.readLine().split",
"br.readLine()",
"br.readLine",
"br",
"\" \"",
"Deque<String> deq = new ArrayDeque<String>();",
"deq",
"new ArrayDeque<String>()",
"for(int i = 0; i < formula.length; i++){\n\t\t\tint tmp1; \n\t\t\tint tmp2;\n\t\t\t\n\t\t\tswitch(formula[i]){\n\t\t\tcase \"+\":\n\t\t\t\ttmp1 = Integer.parseInt(deq.removeFirst());\n\t\t\t\ttmp2 = Integer.parseInt(deq.removeFirst());\n\t\t\t\t\n\t\t\t\tdeq.addFirst(Integer.toString(tmp2 + tmp1));\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase \"*\":\n\t\t\t\ttmp1 = Integer.parseInt(deq.removeFirst());\n\t\t\t\ttmp2 = Integer.parseInt(deq.removeFirst());\n\t\t\t\t\n\t\t\t\tdeq.addFirst(Integer.toString(tmp2 * tmp1));\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase \"-\":\n\t\t\t\ttmp1 = Integer.parseInt(deq.removeFirst());\n\t\t\t\ttmp2 = Integer.parseInt(deq.removeFirst());\n\t\t\t\t\n\t\t\t\tdeq.addFirst(Integer.toString(tmp2 - tmp1));\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tdefault:\n\t\t\t\tdeq.addFirst(formula[i]);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < formula.length",
"i",
"formula.length",
"formula",
"formula.length",
"i++",
"i++",
"i",
"{\n\t\t\tint tmp1; \n\t\t\tint tmp2;\n\t\t\t\n\t\t\tswitch(formula[i]){\n\t\t\tcase \"+\":\n\t\t\t\ttmp1 = Integer.parseInt(deq.removeFirst());\n\t\t\t\ttmp2 = Integer.parseInt(deq.removeFirst());\n\t\t\t\t\n\t\t\t\tdeq.addFirst(Integer.toString(tmp2 + tmp1));\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase \"*\":\n\t\t\t\ttmp1 = Integer.parseInt(deq.removeFirst());\n\t\t\t\ttmp2 = Integer.parseInt(deq.removeFirst());\n\t\t\t\t\n\t\t\t\tdeq.addFirst(Integer.toString(tmp2 * tmp1));\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase \"-\":\n\t\t\t\ttmp1 = Integer.parseInt(deq.removeFirst());\n\t\t\t\ttmp2 = Integer.parseInt(deq.removeFirst());\n\t\t\t\t\n\t\t\t\tdeq.addFirst(Integer.toString(tmp2 - tmp1));\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tdefault:\n\t\t\t\tdeq.addFirst(formula[i]);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}",
"{\n\t\t\tint tmp1; \n\t\t\tint tmp2;\n\t\t\t\n\t\t\tswitch(formula[i]){\n\t\t\tcase \"+\":\n\t\t\t\ttmp1 = Integer.parseInt(deq.removeFirst());\n\t\t\t\ttmp2 = Integer.parseInt(deq.removeFirst());\n\t\t\t\t\n\t\t\t\tdeq.addFirst(Integer.toString(tmp2 + tmp1));\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase \"*\":\n\t\t\t\ttmp1 = Integer.parseInt(deq.removeFirst());\n\t\t\t\ttmp2 = Integer.parseInt(deq.removeFirst());\n\t\t\t\t\n\t\t\t\tdeq.addFirst(Integer.toString(tmp2 * tmp1));\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase \"-\":\n\t\t\t\ttmp1 = Integer.parseInt(deq.removeFirst());\n\t\t\t\ttmp2 = Integer.parseInt(deq.removeFirst());\n\t\t\t\t\n\t\t\t\tdeq.addFirst(Integer.toString(tmp2 - tmp1));\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tdefault:\n\t\t\t\tdeq.addFirst(formula[i]);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}",
"int tmp1;",
"tmp1",
"int tmp2;",
"tmp2",
"switch(formula[i]){\n\t\t\tcase \"+\":\n\t\t\t\ttmp1 = Integer.parseInt(deq.removeFirst());\n\t\t\t\ttmp2 = Integer.parseInt(deq.removeFirst());\n\t\t\t\t\n\t\t\t\tdeq.addFirst(Integer.toString(tmp2 + tmp1));\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase \"*\":\n\t\t\t\ttmp1 = Integer.parseInt(deq.removeFirst());\n\t\t\t\ttmp2 = Integer.parseInt(deq.removeFirst());\n\t\t\t\t\n\t\t\t\tdeq.addFirst(Integer.toString(tmp2 * tmp1));\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase \"-\":\n\t\t\t\ttmp1 = Integer.parseInt(deq.removeFirst());\n\t\t\t\ttmp2 = Integer.parseInt(deq.removeFirst());\n\t\t\t\t\n\t\t\t\tdeq.addFirst(Integer.toString(tmp2 - tmp1));\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tdefault:\n\t\t\t\tdeq.addFirst(formula[i]);\n\t\t\t\tbreak;\n\t\t\t}",
"formula[i]",
"formula",
"i",
"case \"+\":",
"\"+\"",
"case \"+\":",
"tmp1 = Integer.parseInt(deq.removeFirst())",
"tmp1",
"Integer.parseInt(deq.removeFirst())",
"Integer.parseInt",
"Integer",
"deq.removeFirst()",
"deq.removeFirst",
"deq",
"tmp2 = Integer.parseInt(deq.removeFirst())",
"tmp2",
"Integer.parseInt(deq.removeFirst())",
"Integer.parseInt",
"Integer",
"deq.removeFirst()",
"deq.removeFirst",
"deq",
"deq.addFirst(Integer.toString(tmp2 + tmp1))",
"deq.addFirst",
"deq",
"Integer.toString(tmp2 + tmp1)",
"Integer.toString",
"Integer",
"tmp2 + tmp1",
"tmp2",
"tmp1",
"break;",
"case \"*\":",
"\"*\"",
"case \"*\":",
"tmp1 = Integer.parseInt(deq.removeFirst())",
"tmp1",
"Integer.parseInt(deq.removeFirst())",
"Integer.parseInt",
"Integer",
"deq.removeFirst()",
"deq.removeFirst",
"deq",
"tmp2 = Integer.parseInt(deq.removeFirst())",
"tmp2",
"Integer.parseInt(deq.removeFirst())",
"Integer.parseInt",
"Integer",
"deq.removeFirst()",
"deq.removeFirst",
"deq",
"deq.addFirst(Integer.toString(tmp2 * tmp1))",
"deq.addFirst",
"deq",
"Integer.toString(tmp2 * tmp1)",
"Integer.toString",
"Integer",
"tmp2 * tmp1",
"tmp2",
"tmp1",
"break;",
"case \"-\":",
"\"-\"",
"case \"-\":",
"tmp1 = Integer.parseInt(deq.removeFirst())",
"tmp1",
"Integer.parseInt(deq.removeFirst())",
"Integer.parseInt",
"Integer",
"deq.removeFirst()",
"deq.removeFirst",
"deq",
"tmp2 = Integer.parseInt(deq.removeFirst())",
"tmp2",
"Integer.parseInt(deq.removeFirst())",
"Integer.parseInt",
"Integer",
"deq.removeFirst()",
"deq.removeFirst",
"deq",
"deq.addFirst(Integer.toString(tmp2 - tmp1))",
"deq.addFirst",
"deq",
"Integer.toString(tmp2 - tmp1)",
"Integer.toString",
"Integer",
"tmp2 - tmp1",
"tmp2",
"tmp1",
"break;",
"default:",
"default:",
"deq.addFirst(formula[i])",
"deq.addFirst",
"deq",
"formula[i]",
"formula",
"i",
"break;",
"System.out.println(deq.removeLast())",
"System.out.println",
"System.out",
"System",
"System.out",
"deq.removeLast()",
"deq.removeLast",
"deq",
"String[] args",
"args",
"public class Main {\n\n\tpublic static void main(String[] args) throws NumberFormatException, IOException {\n\t\t// TODO ?????????????????????????????????????????????\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\t\n\t\tString[] formula = br.readLine().split(\" \");\n\t\t\n\t\tDeque<String> deq = new ArrayDeque<String>();\n\t\t\n\t\tfor(int i = 0; i < formula.length; i++){\n\t\t\tint tmp1; \n\t\t\tint tmp2;\n\t\t\t\n\t\t\tswitch(formula[i]){\n\t\t\tcase \"+\":\n\t\t\t\ttmp1 = Integer.parseInt(deq.removeFirst());\n\t\t\t\ttmp2 = Integer.parseInt(deq.removeFirst());\n\t\t\t\t\n\t\t\t\tdeq.addFirst(Integer.toString(tmp2 + tmp1));\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase \"*\":\n\t\t\t\ttmp1 = Integer.parseInt(deq.removeFirst());\n\t\t\t\ttmp2 = Integer.parseInt(deq.removeFirst());\n\t\t\t\t\n\t\t\t\tdeq.addFirst(Integer.toString(tmp2 * tmp1));\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase \"-\":\n\t\t\t\ttmp1 = Integer.parseInt(deq.removeFirst());\n\t\t\t\ttmp2 = Integer.parseInt(deq.removeFirst());\n\t\t\t\t\n\t\t\t\tdeq.addFirst(Integer.toString(tmp2 - tmp1));\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tdefault:\n\t\t\t\tdeq.addFirst(formula[i]);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(deq.removeLast());\n\t}\n\n}",
"public class Main {\n\n\tpublic static void main(String[] args) throws NumberFormatException, IOException {\n\t\t// TODO ?????????????????????????????????????????????\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\t\n\t\tString[] formula = br.readLine().split(\" \");\n\t\t\n\t\tDeque<String> deq = new ArrayDeque<String>();\n\t\t\n\t\tfor(int i = 0; i < formula.length; i++){\n\t\t\tint tmp1; \n\t\t\tint tmp2;\n\t\t\t\n\t\t\tswitch(formula[i]){\n\t\t\tcase \"+\":\n\t\t\t\ttmp1 = Integer.parseInt(deq.removeFirst());\n\t\t\t\ttmp2 = Integer.parseInt(deq.removeFirst());\n\t\t\t\t\n\t\t\t\tdeq.addFirst(Integer.toString(tmp2 + tmp1));\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase \"*\":\n\t\t\t\ttmp1 = Integer.parseInt(deq.removeFirst());\n\t\t\t\ttmp2 = Integer.parseInt(deq.removeFirst());\n\t\t\t\t\n\t\t\t\tdeq.addFirst(Integer.toString(tmp2 * tmp1));\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase \"-\":\n\t\t\t\ttmp1 = Integer.parseInt(deq.removeFirst());\n\t\t\t\ttmp2 = Integer.parseInt(deq.removeFirst());\n\t\t\t\t\n\t\t\t\tdeq.addFirst(Integer.toString(tmp2 - tmp1));\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tdefault:\n\t\t\t\tdeq.addFirst(formula[i]);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(deq.removeLast());\n\t}\n\n}",
"Main"
] | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayDeque;
import java.util.Deque;
public class Main {
public static void main(String[] args) throws NumberFormatException, IOException {
// TODO ?????????????????????????????????????????????
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String[] formula = br.readLine().split(" ");
Deque<String> deq = new ArrayDeque<String>();
for(int i = 0; i < formula.length; i++){
int tmp1;
int tmp2;
switch(formula[i]){
case "+":
tmp1 = Integer.parseInt(deq.removeFirst());
tmp2 = Integer.parseInt(deq.removeFirst());
deq.addFirst(Integer.toString(tmp2 + tmp1));
break;
case "*":
tmp1 = Integer.parseInt(deq.removeFirst());
tmp2 = Integer.parseInt(deq.removeFirst());
deq.addFirst(Integer.toString(tmp2 * tmp1));
break;
case "-":
tmp1 = Integer.parseInt(deq.removeFirst());
tmp2 = Integer.parseInt(deq.removeFirst());
deq.addFirst(Integer.toString(tmp2 - tmp1));
break;
default:
deq.addFirst(formula[i]);
break;
}
}
System.out.println(deq.removeLast());
}
} |
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
20,
41,
13,
4,
18,
4,
18,
13,
17,
41,
13,
20,
41,
13,
41,
13,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
30,
35,
18,
13,
13,
34,
17,
1,
0,
13,
4,
18,
13,
0,
13,
4,
18,
13,
4,
18,
13,
2,
13,
13,
3,
34,
17,
1,
0,
13,
4,
18,
13,
0,
13,
4,
18,
13,
4,
18,
13,
2,
13,
13,
3,
34,
17,
1,
0,
13,
4,
18,
13,
0,
13,
4,
18,
13,
4,
18,
13,
2,
13,
13,
3,
34,
1,
4,
18,
13,
4,
18,
13,
18,
13,
13,
3,
4,
18,
13,
4,
18,
13,
4,
18,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
136,
8
],
[
136,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
12,
14
],
[
11,
15
],
[
15,
16
],
[
15,
17
],
[
11,
18
],
[
18,
19
],
[
18,
20
],
[
20,
21
],
[
21,
22
],
[
22,
23
],
[
23,
24
],
[
20,
25
],
[
11,
26
],
[
26,
27
],
[
26,
28
],
[
11,
29
],
[
29,
30
],
[
11,
31
],
[
31,
32
],
[
11,
33
],
[
33,
34
],
[
34,
35
],
[
35,
36
],
[
35,
37
],
[
33,
38
],
[
38,
39
],
[
38,
40
],
[
40,
41
],
[
40,
42
],
[
33,
43
],
[
43,
44
],
[
44,
45
],
[
33,
46
],
[
47,
47
],
[
47,
48
],
[
48,
49
],
[
49,
50
],
[
49,
51
],
[
48,
52
],
[
52,
53
],
[
52,
54
],
[
54,
55
],
[
55,
56
],
[
55,
57
],
[
57,
58
],
[
58,
59
],
[
54,
60
],
[
60,
61
],
[
60,
62
],
[
62,
63
],
[
63,
64
],
[
54,
65
],
[
65,
66
],
[
66,
67
],
[
65,
68
],
[
68,
69
],
[
68,
70
],
[
54,
71
],
[
48,
72
],
[
72,
73
],
[
72,
74
],
[
74,
75
],
[
75,
76
],
[
75,
77
],
[
77,
78
],
[
78,
79
],
[
74,
80
],
[
80,
81
],
[
80,
82
],
[
82,
83
],
[
83,
84
],
[
74,
85
],
[
85,
86
],
[
86,
87
],
[
85,
88
],
[
88,
89
],
[
88,
90
],
[
74,
91
],
[
48,
92
],
[
92,
93
],
[
92,
94
],
[
94,
95
],
[
95,
96
],
[
95,
97
],
[
97,
98
],
[
98,
99
],
[
94,
100
],
[
100,
101
],
[
100,
102
],
[
102,
103
],
[
103,
104
],
[
94,
105
],
[
105,
106
],
[
106,
107
],
[
105,
108
],
[
108,
109
],
[
108,
110
],
[
94,
111
],
[
48,
112
],
[
112,
113
],
[
113,
114
],
[
114,
115
],
[
115,
116
],
[
114,
117
],
[
117,
118
],
[
118,
119
],
[
117,
120
],
[
120,
121
],
[
120,
122
],
[
113,
123
],
[
11,
124
],
[
124,
125
],
[
125,
126
],
[
124,
127
],
[
127,
128
],
[
128,
129
],
[
11,
130
],
[
130,
131
],
[
131,
132
],
[
9,
133
],
[
133,
134
],
[
0,
135
],
[
135,
136
],
[
135,
137
]
] | [
"import java.io.*;\nimport java.util.*;\n\npublic class Main {\n\tpublic static void main(String[] args) throws NumberFormatException, IOException{\n\t\tBufferedReader br=new BufferedReader(new InputStreamReader(System.in));\n\t\tPrintWriter pr=new PrintWriter(System.out);\n\t\tString str[]=br.readLine().split(\" \");\n\t\tDeque<Integer> stack=new ArrayDeque<Integer>();\n\t\tint a,b;\n\t\tfor (int i=0;i<str.length;i++){\n\t\t\tswitch(str[i]){\n\t\t\tcase \"+\":\n\t\t\t\ta=stack.pop();\n\t\t\t\tb=stack.pop();\n\t\t\t\tstack.push(b+a);\n\t\t\t\tbreak;\n\t\t\tcase \"-\":\n\t\t\t\ta=stack.pop();\n\t\t\t\tb=stack.pop();\n\t\t\t\tstack.push(b-a);\n\t\t\t\tbreak;\n\t\t\tcase \"*\":\n\t\t\t\ta=stack.pop();\n\t\t\t\tb=stack.pop();\n\t\t\t\tstack.push(b*a);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tstack.push(Integer.parseInt(str[i]));\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tpr.println(stack.pop());\n\t\tpr.close();\n\t}\n\n}",
"import java.io.*;",
"io.*",
"java",
"import java.util.*;",
"util.*",
"java",
"public class Main {\n\tpublic static void main(String[] args) throws NumberFormatException, IOException{\n\t\tBufferedReader br=new BufferedReader(new InputStreamReader(System.in));\n\t\tPrintWriter pr=new PrintWriter(System.out);\n\t\tString str[]=br.readLine().split(\" \");\n\t\tDeque<Integer> stack=new ArrayDeque<Integer>();\n\t\tint a,b;\n\t\tfor (int i=0;i<str.length;i++){\n\t\t\tswitch(str[i]){\n\t\t\tcase \"+\":\n\t\t\t\ta=stack.pop();\n\t\t\t\tb=stack.pop();\n\t\t\t\tstack.push(b+a);\n\t\t\t\tbreak;\n\t\t\tcase \"-\":\n\t\t\t\ta=stack.pop();\n\t\t\t\tb=stack.pop();\n\t\t\t\tstack.push(b-a);\n\t\t\t\tbreak;\n\t\t\tcase \"*\":\n\t\t\t\ta=stack.pop();\n\t\t\t\tb=stack.pop();\n\t\t\t\tstack.push(b*a);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tstack.push(Integer.parseInt(str[i]));\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tpr.println(stack.pop());\n\t\tpr.close();\n\t}\n\n}",
"Main",
"public static void main(String[] args) throws NumberFormatException, IOException{\n\t\tBufferedReader br=new BufferedReader(new InputStreamReader(System.in));\n\t\tPrintWriter pr=new PrintWriter(System.out);\n\t\tString str[]=br.readLine().split(\" \");\n\t\tDeque<Integer> stack=new ArrayDeque<Integer>();\n\t\tint a,b;\n\t\tfor (int i=0;i<str.length;i++){\n\t\t\tswitch(str[i]){\n\t\t\tcase \"+\":\n\t\t\t\ta=stack.pop();\n\t\t\t\tb=stack.pop();\n\t\t\t\tstack.push(b+a);\n\t\t\t\tbreak;\n\t\t\tcase \"-\":\n\t\t\t\ta=stack.pop();\n\t\t\t\tb=stack.pop();\n\t\t\t\tstack.push(b-a);\n\t\t\t\tbreak;\n\t\t\tcase \"*\":\n\t\t\t\ta=stack.pop();\n\t\t\t\tb=stack.pop();\n\t\t\t\tstack.push(b*a);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tstack.push(Integer.parseInt(str[i]));\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tpr.println(stack.pop());\n\t\tpr.close();\n\t}",
"main",
"{\n\t\tBufferedReader br=new BufferedReader(new InputStreamReader(System.in));\n\t\tPrintWriter pr=new PrintWriter(System.out);\n\t\tString str[]=br.readLine().split(\" \");\n\t\tDeque<Integer> stack=new ArrayDeque<Integer>();\n\t\tint a,b;\n\t\tfor (int i=0;i<str.length;i++){\n\t\t\tswitch(str[i]){\n\t\t\tcase \"+\":\n\t\t\t\ta=stack.pop();\n\t\t\t\tb=stack.pop();\n\t\t\t\tstack.push(b+a);\n\t\t\t\tbreak;\n\t\t\tcase \"-\":\n\t\t\t\ta=stack.pop();\n\t\t\t\tb=stack.pop();\n\t\t\t\tstack.push(b-a);\n\t\t\t\tbreak;\n\t\t\tcase \"*\":\n\t\t\t\ta=stack.pop();\n\t\t\t\tb=stack.pop();\n\t\t\t\tstack.push(b*a);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tstack.push(Integer.parseInt(str[i]));\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tpr.println(stack.pop());\n\t\tpr.close();\n\t}",
"BufferedReader br=new BufferedReader(new InputStreamReader(System.in));",
"br",
"new BufferedReader(new InputStreamReader(System.in))",
"PrintWriter pr=new PrintWriter(System.out);",
"pr",
"new PrintWriter(System.out)",
"String str[]=br.readLine().split(\" \");",
"str",
"br.readLine().split(\" \")",
"br.readLine().split",
"br.readLine()",
"br.readLine",
"br",
"\" \"",
"Deque<Integer> stack=new ArrayDeque<Integer>();",
"stack",
"new ArrayDeque<Integer>()",
"int a",
"a",
"b;",
"b",
"for (int i=0;i<str.length;i++){\n\t\t\tswitch(str[i]){\n\t\t\tcase \"+\":\n\t\t\t\ta=stack.pop();\n\t\t\t\tb=stack.pop();\n\t\t\t\tstack.push(b+a);\n\t\t\t\tbreak;\n\t\t\tcase \"-\":\n\t\t\t\ta=stack.pop();\n\t\t\t\tb=stack.pop();\n\t\t\t\tstack.push(b-a);\n\t\t\t\tbreak;\n\t\t\tcase \"*\":\n\t\t\t\ta=stack.pop();\n\t\t\t\tb=stack.pop();\n\t\t\t\tstack.push(b*a);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tstack.push(Integer.parseInt(str[i]));\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<str.length",
"i",
"str.length",
"str",
"str.length",
"i++",
"i++",
"i",
"{\n\t\t\tswitch(str[i]){\n\t\t\tcase \"+\":\n\t\t\t\ta=stack.pop();\n\t\t\t\tb=stack.pop();\n\t\t\t\tstack.push(b+a);\n\t\t\t\tbreak;\n\t\t\tcase \"-\":\n\t\t\t\ta=stack.pop();\n\t\t\t\tb=stack.pop();\n\t\t\t\tstack.push(b-a);\n\t\t\t\tbreak;\n\t\t\tcase \"*\":\n\t\t\t\ta=stack.pop();\n\t\t\t\tb=stack.pop();\n\t\t\t\tstack.push(b*a);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tstack.push(Integer.parseInt(str[i]));\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}",
"{\n\t\t\tswitch(str[i]){\n\t\t\tcase \"+\":\n\t\t\t\ta=stack.pop();\n\t\t\t\tb=stack.pop();\n\t\t\t\tstack.push(b+a);\n\t\t\t\tbreak;\n\t\t\tcase \"-\":\n\t\t\t\ta=stack.pop();\n\t\t\t\tb=stack.pop();\n\t\t\t\tstack.push(b-a);\n\t\t\t\tbreak;\n\t\t\tcase \"*\":\n\t\t\t\ta=stack.pop();\n\t\t\t\tb=stack.pop();\n\t\t\t\tstack.push(b*a);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tstack.push(Integer.parseInt(str[i]));\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}",
"switch(str[i]){\n\t\t\tcase \"+\":\n\t\t\t\ta=stack.pop();\n\t\t\t\tb=stack.pop();\n\t\t\t\tstack.push(b+a);\n\t\t\t\tbreak;\n\t\t\tcase \"-\":\n\t\t\t\ta=stack.pop();\n\t\t\t\tb=stack.pop();\n\t\t\t\tstack.push(b-a);\n\t\t\t\tbreak;\n\t\t\tcase \"*\":\n\t\t\t\ta=stack.pop();\n\t\t\t\tb=stack.pop();\n\t\t\t\tstack.push(b*a);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tstack.push(Integer.parseInt(str[i]));\n\t\t\t\tbreak;\n\t\t\t}",
"str[i]",
"str",
"i",
"case \"+\":",
"\"+\"",
"case \"+\":",
"a=stack.pop()",
"a",
"stack.pop()",
"stack.pop",
"stack",
"b=stack.pop()",
"b",
"stack.pop()",
"stack.pop",
"stack",
"stack.push(b+a)",
"stack.push",
"stack",
"b+a",
"b",
"a",
"break;",
"case \"-\":",
"\"-\"",
"case \"-\":",
"a=stack.pop()",
"a",
"stack.pop()",
"stack.pop",
"stack",
"b=stack.pop()",
"b",
"stack.pop()",
"stack.pop",
"stack",
"stack.push(b-a)",
"stack.push",
"stack",
"b-a",
"b",
"a",
"break;",
"case \"*\":",
"\"*\"",
"case \"*\":",
"a=stack.pop()",
"a",
"stack.pop()",
"stack.pop",
"stack",
"b=stack.pop()",
"b",
"stack.pop()",
"stack.pop",
"stack",
"stack.push(b*a)",
"stack.push",
"stack",
"b*a",
"b",
"a",
"break;",
"default:",
"default:",
"stack.push(Integer.parseInt(str[i]))",
"stack.push",
"stack",
"Integer.parseInt(str[i])",
"Integer.parseInt",
"Integer",
"str[i]",
"str",
"i",
"break;",
"pr.println(stack.pop())",
"pr.println",
"pr",
"stack.pop()",
"stack.pop",
"stack",
"pr.close()",
"pr.close",
"pr",
"String[] args",
"args",
"public class Main {\n\tpublic static void main(String[] args) throws NumberFormatException, IOException{\n\t\tBufferedReader br=new BufferedReader(new InputStreamReader(System.in));\n\t\tPrintWriter pr=new PrintWriter(System.out);\n\t\tString str[]=br.readLine().split(\" \");\n\t\tDeque<Integer> stack=new ArrayDeque<Integer>();\n\t\tint a,b;\n\t\tfor (int i=0;i<str.length;i++){\n\t\t\tswitch(str[i]){\n\t\t\tcase \"+\":\n\t\t\t\ta=stack.pop();\n\t\t\t\tb=stack.pop();\n\t\t\t\tstack.push(b+a);\n\t\t\t\tbreak;\n\t\t\tcase \"-\":\n\t\t\t\ta=stack.pop();\n\t\t\t\tb=stack.pop();\n\t\t\t\tstack.push(b-a);\n\t\t\t\tbreak;\n\t\t\tcase \"*\":\n\t\t\t\ta=stack.pop();\n\t\t\t\tb=stack.pop();\n\t\t\t\tstack.push(b*a);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tstack.push(Integer.parseInt(str[i]));\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tpr.println(stack.pop());\n\t\tpr.close();\n\t}\n\n}",
"public class Main {\n\tpublic static void main(String[] args) throws NumberFormatException, IOException{\n\t\tBufferedReader br=new BufferedReader(new InputStreamReader(System.in));\n\t\tPrintWriter pr=new PrintWriter(System.out);\n\t\tString str[]=br.readLine().split(\" \");\n\t\tDeque<Integer> stack=new ArrayDeque<Integer>();\n\t\tint a,b;\n\t\tfor (int i=0;i<str.length;i++){\n\t\t\tswitch(str[i]){\n\t\t\tcase \"+\":\n\t\t\t\ta=stack.pop();\n\t\t\t\tb=stack.pop();\n\t\t\t\tstack.push(b+a);\n\t\t\t\tbreak;\n\t\t\tcase \"-\":\n\t\t\t\ta=stack.pop();\n\t\t\t\tb=stack.pop();\n\t\t\t\tstack.push(b-a);\n\t\t\t\tbreak;\n\t\t\tcase \"*\":\n\t\t\t\ta=stack.pop();\n\t\t\t\tb=stack.pop();\n\t\t\t\tstack.push(b*a);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tstack.push(Integer.parseInt(str[i]));\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tpr.println(stack.pop());\n\t\tpr.close();\n\t}\n\n}",
"Main"
] | import java.io.*;
import java.util.*;
public class Main {
public static void main(String[] args) throws NumberFormatException, IOException{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
PrintWriter pr=new PrintWriter(System.out);
String str[]=br.readLine().split(" ");
Deque<Integer> stack=new ArrayDeque<Integer>();
int a,b;
for (int i=0;i<str.length;i++){
switch(str[i]){
case "+":
a=stack.pop();
b=stack.pop();
stack.push(b+a);
break;
case "-":
a=stack.pop();
b=stack.pop();
stack.push(b-a);
break;
case "*":
a=stack.pop();
b=stack.pop();
stack.push(b*a);
break;
default:
stack.push(Integer.parseInt(str[i]));
break;
}
}
pr.println(stack.pop());
pr.close();
}
} |
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
17,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
30,
14,
4,
18,
18,
13,
13,
17,
30,
41,
13,
2,
4,
18,
13,
4,
18,
13,
4,
18,
13,
13,
14,
4,
18,
18,
13,
13,
17,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
2,
13,
13,
4,
18,
13,
13,
14,
4,
18,
18,
13,
13,
17,
30,
41,
13,
2,
4,
18,
13,
4,
18,
13,
4,
18,
13,
13,
30,
4,
18,
13,
4,
18,
13,
18,
13,
13,
4,
18,
18,
13,
13,
4,
18,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
134,
8
],
[
134,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
12,
14
],
[
11,
15
],
[
15,
16
],
[
15,
17
],
[
11,
18
],
[
18,
19
],
[
18,
20
],
[
20,
21
],
[
21,
22
],
[
11,
23
],
[
23,
24
],
[
23,
25
],
[
25,
26
],
[
26,
27
],
[
25,
28
],
[
11,
29
],
[
29,
30
],
[
30,
31
],
[
31,
32
],
[
31,
33
],
[
29,
34
],
[
34,
35
],
[
34,
36
],
[
36,
37
],
[
36,
38
],
[
29,
39
],
[
39,
40
],
[
40,
41
],
[
29,
42
],
[
43,
43
],
[
43,
44
],
[
44,
45
],
[
45,
46
],
[
46,
47
],
[
47,
48
],
[
47,
49
],
[
45,
50
],
[
44,
51
],
[
51,
52
],
[
52,
53
],
[
52,
54
],
[
54,
55
],
[
55,
56
],
[
56,
57
],
[
54,
58
],
[
58,
59
],
[
59,
60
],
[
51,
61
],
[
61,
62
],
[
62,
63
],
[
61,
64
],
[
44,
65
],
[
65,
66
],
[
66,
67
],
[
67,
68
],
[
68,
69
],
[
68,
70
],
[
66,
71
],
[
65,
72
],
[
72,
73
],
[
73,
74
],
[
73,
75
],
[
75,
76
],
[
76,
77
],
[
72,
78
],
[
78,
79
],
[
78,
80
],
[
80,
81
],
[
81,
82
],
[
72,
83
],
[
83,
84
],
[
83,
85
],
[
85,
86
],
[
85,
87
],
[
72,
88
],
[
88,
89
],
[
89,
90
],
[
88,
91
],
[
65,
92
],
[
92,
93
],
[
93,
94
],
[
94,
95
],
[
95,
96
],
[
95,
97
],
[
93,
98
],
[
92,
99
],
[
99,
100
],
[
100,
101
],
[
100,
102
],
[
102,
103
],
[
103,
104
],
[
104,
105
],
[
102,
106
],
[
106,
107
],
[
107,
108
],
[
99,
109
],
[
109,
110
],
[
110,
111
],
[
109,
112
],
[
92,
113
],
[
113,
114
],
[
114,
115
],
[
115,
116
],
[
114,
117
],
[
117,
118
],
[
118,
119
],
[
117,
120
],
[
120,
121
],
[
120,
122
],
[
11,
123
],
[
123,
124
],
[
124,
125
],
[
125,
126
],
[
125,
127
],
[
123,
128
],
[
128,
129
],
[
129,
130
],
[
9,
131
],
[
131,
132
],
[
0,
133
],
[
133,
134
],
[
133,
135
]
] | [
"\n\nimport java.util.Scanner;\nimport java.util.Stack;\n\npublic class Main {\n\tpublic static void main(String[] args) {\n\t\tStack<Integer> stack = new Stack<Integer>();\n\t\tScanner sc = new Scanner(System.in);\n\t\t\n\t\tString line = sc.nextLine();\n\t\tString[] str = line.split(\" \");\n\t\t\n//\t\tfor(int i=0;i<str.length;i++)\n//\t\t{\n//\t\t\tSystem.out.println(str[i]);\n//\t\t}\n\t\t\n\t\tfor(int i=0;i<str.length;i++)\n\t\t{\n\t\t\tif(str[i].equals(\"+\"))\n\t\t\t{\n\t\t\t\tint ans = stack.pop()+stack.pop();\n\t\t\t\tstack.push(ans);\n\t\t\t}\n\t\t\telse if(str[i].equals(\"-\"))\n\t\t\t{\n\t\t\t\t//不能直接减除\n\t\t\t\tint a = stack.pop();\n\t\t\t\tint b = stack.pop();\n\t\t\t\tint ans = b-a;\n\t\t\t\t//int ans = stack.pop()-stack.pop();\n\t\t\t\tstack.push(ans);\n\t\t\t}\n\t\t\telse if(str[i].equals(\"*\"))\n\t\t\t{\n\t\t\t\tint ans = stack.pop()*stack.pop();\n\t\t\t\tstack.push(ans);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tstack.push(Integer.parseInt(str[i]));\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(stack.pop());\n\t\t\n\t}\n}\n",
"import java.util.Scanner;",
"Scanner",
"java.util",
"import java.util.Stack;",
"Stack",
"java.util",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tStack<Integer> stack = new Stack<Integer>();\n\t\tScanner sc = new Scanner(System.in);\n\t\t\n\t\tString line = sc.nextLine();\n\t\tString[] str = line.split(\" \");\n\t\t\n//\t\tfor(int i=0;i<str.length;i++)\n//\t\t{\n//\t\t\tSystem.out.println(str[i]);\n//\t\t}\n\t\t\n\t\tfor(int i=0;i<str.length;i++)\n\t\t{\n\t\t\tif(str[i].equals(\"+\"))\n\t\t\t{\n\t\t\t\tint ans = stack.pop()+stack.pop();\n\t\t\t\tstack.push(ans);\n\t\t\t}\n\t\t\telse if(str[i].equals(\"-\"))\n\t\t\t{\n\t\t\t\t//不能直接减除\n\t\t\t\tint a = stack.pop();\n\t\t\t\tint b = stack.pop();\n\t\t\t\tint ans = b-a;\n\t\t\t\t//int ans = stack.pop()-stack.pop();\n\t\t\t\tstack.push(ans);\n\t\t\t}\n\t\t\telse if(str[i].equals(\"*\"))\n\t\t\t{\n\t\t\t\tint ans = stack.pop()*stack.pop();\n\t\t\t\tstack.push(ans);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tstack.push(Integer.parseInt(str[i]));\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(stack.pop());\n\t\t\n\t}\n}",
"Main",
"public static void main(String[] args) {\n\t\tStack<Integer> stack = new Stack<Integer>();\n\t\tScanner sc = new Scanner(System.in);\n\t\t\n\t\tString line = sc.nextLine();\n\t\tString[] str = line.split(\" \");\n\t\t\n//\t\tfor(int i=0;i<str.length;i++)\n//\t\t{\n//\t\t\tSystem.out.println(str[i]);\n//\t\t}\n\t\t\n\t\tfor(int i=0;i<str.length;i++)\n\t\t{\n\t\t\tif(str[i].equals(\"+\"))\n\t\t\t{\n\t\t\t\tint ans = stack.pop()+stack.pop();\n\t\t\t\tstack.push(ans);\n\t\t\t}\n\t\t\telse if(str[i].equals(\"-\"))\n\t\t\t{\n\t\t\t\t//不能直接减除\n\t\t\t\tint a = stack.pop();\n\t\t\t\tint b = stack.pop();\n\t\t\t\tint ans = b-a;\n\t\t\t\t//int ans = stack.pop()-stack.pop();\n\t\t\t\tstack.push(ans);\n\t\t\t}\n\t\t\telse if(str[i].equals(\"*\"))\n\t\t\t{\n\t\t\t\tint ans = stack.pop()*stack.pop();\n\t\t\t\tstack.push(ans);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tstack.push(Integer.parseInt(str[i]));\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(stack.pop());\n\t\t\n\t}",
"main",
"{\n\t\tStack<Integer> stack = new Stack<Integer>();\n\t\tScanner sc = new Scanner(System.in);\n\t\t\n\t\tString line = sc.nextLine();\n\t\tString[] str = line.split(\" \");\n\t\t\n//\t\tfor(int i=0;i<str.length;i++)\n//\t\t{\n//\t\t\tSystem.out.println(str[i]);\n//\t\t}\n\t\t\n\t\tfor(int i=0;i<str.length;i++)\n\t\t{\n\t\t\tif(str[i].equals(\"+\"))\n\t\t\t{\n\t\t\t\tint ans = stack.pop()+stack.pop();\n\t\t\t\tstack.push(ans);\n\t\t\t}\n\t\t\telse if(str[i].equals(\"-\"))\n\t\t\t{\n\t\t\t\t//不能直接减除\n\t\t\t\tint a = stack.pop();\n\t\t\t\tint b = stack.pop();\n\t\t\t\tint ans = b-a;\n\t\t\t\t//int ans = stack.pop()-stack.pop();\n\t\t\t\tstack.push(ans);\n\t\t\t}\n\t\t\telse if(str[i].equals(\"*\"))\n\t\t\t{\n\t\t\t\tint ans = stack.pop()*stack.pop();\n\t\t\t\tstack.push(ans);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tstack.push(Integer.parseInt(str[i]));\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(stack.pop());\n\t\t\n\t}",
"Stack<Integer> stack = new Stack<Integer>();",
"stack",
"new Stack<Integer>()",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"String line = sc.nextLine();",
"line",
"sc.nextLine()",
"sc.nextLine",
"sc",
"String[] str = line.split(\" \");",
"str",
"line.split(\" \")",
"line.split",
"line",
"\" \"",
"for(int i=0;i<str.length;i++)\n\t\t{\n\t\t\tif(str[i].equals(\"+\"))\n\t\t\t{\n\t\t\t\tint ans = stack.pop()+stack.pop();\n\t\t\t\tstack.push(ans);\n\t\t\t}\n\t\t\telse if(str[i].equals(\"-\"))\n\t\t\t{\n\t\t\t\t//不能直接减除\n\t\t\t\tint a = stack.pop();\n\t\t\t\tint b = stack.pop();\n\t\t\t\tint ans = b-a;\n\t\t\t\t//int ans = stack.pop()-stack.pop();\n\t\t\t\tstack.push(ans);\n\t\t\t}\n\t\t\telse if(str[i].equals(\"*\"))\n\t\t\t{\n\t\t\t\tint ans = stack.pop()*stack.pop();\n\t\t\t\tstack.push(ans);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tstack.push(Integer.parseInt(str[i]));\n\t\t\t}\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<str.length",
"i",
"str.length",
"str",
"str.length",
"i++",
"i++",
"i",
"{\n\t\t\tif(str[i].equals(\"+\"))\n\t\t\t{\n\t\t\t\tint ans = stack.pop()+stack.pop();\n\t\t\t\tstack.push(ans);\n\t\t\t}\n\t\t\telse if(str[i].equals(\"-\"))\n\t\t\t{\n\t\t\t\t//不能直接减除\n\t\t\t\tint a = stack.pop();\n\t\t\t\tint b = stack.pop();\n\t\t\t\tint ans = b-a;\n\t\t\t\t//int ans = stack.pop()-stack.pop();\n\t\t\t\tstack.push(ans);\n\t\t\t}\n\t\t\telse if(str[i].equals(\"*\"))\n\t\t\t{\n\t\t\t\tint ans = stack.pop()*stack.pop();\n\t\t\t\tstack.push(ans);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tstack.push(Integer.parseInt(str[i]));\n\t\t\t}\n\t\t}",
"{\n\t\t\tif(str[i].equals(\"+\"))\n\t\t\t{\n\t\t\t\tint ans = stack.pop()+stack.pop();\n\t\t\t\tstack.push(ans);\n\t\t\t}\n\t\t\telse if(str[i].equals(\"-\"))\n\t\t\t{\n\t\t\t\t//不能直接减除\n\t\t\t\tint a = stack.pop();\n\t\t\t\tint b = stack.pop();\n\t\t\t\tint ans = b-a;\n\t\t\t\t//int ans = stack.pop()-stack.pop();\n\t\t\t\tstack.push(ans);\n\t\t\t}\n\t\t\telse if(str[i].equals(\"*\"))\n\t\t\t{\n\t\t\t\tint ans = stack.pop()*stack.pop();\n\t\t\t\tstack.push(ans);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tstack.push(Integer.parseInt(str[i]));\n\t\t\t}\n\t\t}",
"if(str[i].equals(\"+\"))\n\t\t\t{\n\t\t\t\tint ans = stack.pop()+stack.pop();\n\t\t\t\tstack.push(ans);\n\t\t\t}\n\t\t\telse if(str[i].equals(\"-\"))\n\t\t\t{\n\t\t\t\t//不能直接减除\n\t\t\t\tint a = stack.pop();\n\t\t\t\tint b = stack.pop();\n\t\t\t\tint ans = b-a;\n\t\t\t\t//int ans = stack.pop()-stack.pop();\n\t\t\t\tstack.push(ans);\n\t\t\t}\n\t\t\telse if(str[i].equals(\"*\"))\n\t\t\t{\n\t\t\t\tint ans = stack.pop()*stack.pop();\n\t\t\t\tstack.push(ans);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tstack.push(Integer.parseInt(str[i]));\n\t\t\t}",
"str[i].equals(\"+\")",
"str[i].equals",
"str[i]",
"str",
"i",
"\"+\"",
"{\n\t\t\t\tint ans = stack.pop()+stack.pop();\n\t\t\t\tstack.push(ans);\n\t\t\t}",
"int ans = stack.pop()+stack.pop();",
"ans",
"stack.pop()+stack.pop()",
"stack.pop()",
"stack.pop",
"stack",
"stack.pop()",
"stack.pop",
"stack",
"stack.push(ans)",
"stack.push",
"stack",
"ans",
"if(str[i].equals(\"-\"))\n\t\t\t{\n\t\t\t\t//不能直接减除\n\t\t\t\tint a = stack.pop();\n\t\t\t\tint b = stack.pop();\n\t\t\t\tint ans = b-a;\n\t\t\t\t//int ans = stack.pop()-stack.pop();\n\t\t\t\tstack.push(ans);\n\t\t\t}\n\t\t\telse if(str[i].equals(\"*\"))\n\t\t\t{\n\t\t\t\tint ans = stack.pop()*stack.pop();\n\t\t\t\tstack.push(ans);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tstack.push(Integer.parseInt(str[i]));\n\t\t\t}",
"str[i].equals(\"-\")",
"str[i].equals",
"str[i]",
"str",
"i",
"\"-\"",
"{\n\t\t\t\t//不能直接减除\n\t\t\t\tint a = stack.pop();\n\t\t\t\tint b = stack.pop();\n\t\t\t\tint ans = b-a;\n\t\t\t\t//int ans = stack.pop()-stack.pop();\n\t\t\t\tstack.push(ans);\n\t\t\t}",
"int a = stack.pop();",
"a",
"stack.pop()",
"stack.pop",
"stack",
"int b = stack.pop();",
"b",
"stack.pop()",
"stack.pop",
"stack",
"int ans = b-a;",
"ans",
"b-a",
"b",
"a",
"stack.push(ans)",
"stack.push",
"stack",
"ans",
"if(str[i].equals(\"*\"))\n\t\t\t{\n\t\t\t\tint ans = stack.pop()*stack.pop();\n\t\t\t\tstack.push(ans);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tstack.push(Integer.parseInt(str[i]));\n\t\t\t}",
"str[i].equals(\"*\")",
"str[i].equals",
"str[i]",
"str",
"i",
"\"*\"",
"{\n\t\t\t\tint ans = stack.pop()*stack.pop();\n\t\t\t\tstack.push(ans);\n\t\t\t}",
"int ans = stack.pop()*stack.pop();",
"ans",
"stack.pop()*stack.pop()",
"stack.pop()",
"stack.pop",
"stack",
"stack.pop()",
"stack.pop",
"stack",
"stack.push(ans)",
"stack.push",
"stack",
"ans",
"{\n\t\t\t\tstack.push(Integer.parseInt(str[i]));\n\t\t\t}",
"stack.push(Integer.parseInt(str[i]))",
"stack.push",
"stack",
"Integer.parseInt(str[i])",
"Integer.parseInt",
"Integer",
"str[i]",
"str",
"i",
"System.out.println(stack.pop())",
"System.out.println",
"System.out",
"System",
"System.out",
"stack.pop()",
"stack.pop",
"stack",
"String[] args",
"args",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tStack<Integer> stack = new Stack<Integer>();\n\t\tScanner sc = new Scanner(System.in);\n\t\t\n\t\tString line = sc.nextLine();\n\t\tString[] str = line.split(\" \");\n\t\t\n//\t\tfor(int i=0;i<str.length;i++)\n//\t\t{\n//\t\t\tSystem.out.println(str[i]);\n//\t\t}\n\t\t\n\t\tfor(int i=0;i<str.length;i++)\n\t\t{\n\t\t\tif(str[i].equals(\"+\"))\n\t\t\t{\n\t\t\t\tint ans = stack.pop()+stack.pop();\n\t\t\t\tstack.push(ans);\n\t\t\t}\n\t\t\telse if(str[i].equals(\"-\"))\n\t\t\t{\n\t\t\t\t//不能直接减除\n\t\t\t\tint a = stack.pop();\n\t\t\t\tint b = stack.pop();\n\t\t\t\tint ans = b-a;\n\t\t\t\t//int ans = stack.pop()-stack.pop();\n\t\t\t\tstack.push(ans);\n\t\t\t}\n\t\t\telse if(str[i].equals(\"*\"))\n\t\t\t{\n\t\t\t\tint ans = stack.pop()*stack.pop();\n\t\t\t\tstack.push(ans);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tstack.push(Integer.parseInt(str[i]));\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(stack.pop());\n\t\t\n\t}\n}",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tStack<Integer> stack = new Stack<Integer>();\n\t\tScanner sc = new Scanner(System.in);\n\t\t\n\t\tString line = sc.nextLine();\n\t\tString[] str = line.split(\" \");\n\t\t\n//\t\tfor(int i=0;i<str.length;i++)\n//\t\t{\n//\t\t\tSystem.out.println(str[i]);\n//\t\t}\n\t\t\n\t\tfor(int i=0;i<str.length;i++)\n\t\t{\n\t\t\tif(str[i].equals(\"+\"))\n\t\t\t{\n\t\t\t\tint ans = stack.pop()+stack.pop();\n\t\t\t\tstack.push(ans);\n\t\t\t}\n\t\t\telse if(str[i].equals(\"-\"))\n\t\t\t{\n\t\t\t\t//不能直接减除\n\t\t\t\tint a = stack.pop();\n\t\t\t\tint b = stack.pop();\n\t\t\t\tint ans = b-a;\n\t\t\t\t//int ans = stack.pop()-stack.pop();\n\t\t\t\tstack.push(ans);\n\t\t\t}\n\t\t\telse if(str[i].equals(\"*\"))\n\t\t\t{\n\t\t\t\tint ans = stack.pop()*stack.pop();\n\t\t\t\tstack.push(ans);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tstack.push(Integer.parseInt(str[i]));\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(stack.pop());\n\t\t\n\t}\n}",
"Main"
] |
import java.util.Scanner;
import java.util.Stack;
public class Main {
public static void main(String[] args) {
Stack<Integer> stack = new Stack<Integer>();
Scanner sc = new Scanner(System.in);
String line = sc.nextLine();
String[] str = line.split(" ");
// for(int i=0;i<str.length;i++)
// {
// System.out.println(str[i]);
// }
for(int i=0;i<str.length;i++)
{
if(str[i].equals("+"))
{
int ans = stack.pop()+stack.pop();
stack.push(ans);
}
else if(str[i].equals("-"))
{
//不能直接减除
int a = stack.pop();
int b = stack.pop();
int ans = b-a;
//int ans = stack.pop()-stack.pop();
stack.push(ans);
}
else if(str[i].equals("*"))
{
int ans = stack.pop()*stack.pop();
stack.push(ans);
}
else
{
stack.push(Integer.parseInt(str[i]));
}
}
System.out.println(stack.pop());
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
41,
13,
41,
13,
12,
13,
30,
0,
13,
17,
0,
13,
20,
13,
23,
13,
12,
13,
30,
0,
18,
13,
40,
13,
13,
23,
13,
12,
13,
30,
0,
18,
13,
40,
13,
4,
18,
13,
13,
23,
13,
12,
13,
30,
29,
18,
13,
40,
13,
12,
13,
30,
29,
4,
18,
13,
4,
13,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
20,
41,
13,
4,
18,
4,
18,
13,
17,
28,
13,
13,
30,
30,
14,
4,
18,
17,
13,
30,
4,
18,
13,
2,
4,
18,
13,
4,
18,
13,
14,
4,
18,
17,
13,
30,
4,
18,
13,
2,
4,
18,
13,
4,
18,
13,
14,
4,
18,
17,
13,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
4,
18,
13,
2,
13,
13,
30,
4,
18,
13,
13,
4,
18,
18,
13,
13,
4,
18,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
10,
11
],
[
10,
12
],
[
12,
13
],
[
10,
14
],
[
14,
15
],
[
10,
16
],
[
16,
17
],
[
16,
18
],
[
18,
19
],
[
19,
20
],
[
19,
21
],
[
18,
22
],
[
22,
23
],
[
22,
24
],
[
16,
26
],
[
26,
27
],
[
10,
28
],
[
28,
29
],
[
28,
30
],
[
30,
31
],
[
31,
32
],
[
32,
33
],
[
32,
34
],
[
34,
35
],
[
31,
36
],
[
28,
37
],
[
37,
38
],
[
10,
39
],
[
39,
40
],
[
39,
41
],
[
41,
42
],
[
42,
43
],
[
43,
44
],
[
43,
45
],
[
45,
46
],
[
42,
47
],
[
47,
48
],
[
48,
49
],
[
47,
50
],
[
39,
51
],
[
51,
52
],
[
10,
53
],
[
53,
54
],
[
53,
55
],
[
55,
56
],
[
56,
57
],
[
57,
58
],
[
57,
59
],
[
59,
60
],
[
10,
61
],
[
61,
62
],
[
61,
63
],
[
63,
64
],
[
64,
65
],
[
65,
66
],
[
66,
67
],
[
65,
68
],
[
68,
69
],
[
0,
70
],
[
164,
71
],
[
164,
72
],
[
72,
73
],
[
72,
74
],
[
74,
75
],
[
75,
76
],
[
75,
77
],
[
74,
78
],
[
78,
79
],
[
78,
80
],
[
74,
81
],
[
81,
82
],
[
81,
83
],
[
83,
84
],
[
84,
85
],
[
85,
86
],
[
86,
87
],
[
83,
88
],
[
74,
89
],
[
89,
90
],
[
89,
91
],
[
89,
92
],
[
93,
93
],
[
93,
94
],
[
94,
95
],
[
95,
96
],
[
96,
97
],
[
95,
98
],
[
94,
99
],
[
99,
100
],
[
100,
101
],
[
101,
102
],
[
100,
103
],
[
103,
104
],
[
104,
105
],
[
105,
106
],
[
103,
107
],
[
107,
108
],
[
108,
109
],
[
94,
110
],
[
110,
111
],
[
111,
112
],
[
112,
113
],
[
111,
114
],
[
110,
115
],
[
115,
116
],
[
116,
117
],
[
117,
118
],
[
116,
119
],
[
119,
120
],
[
120,
121
],
[
121,
122
],
[
119,
123
],
[
123,
124
],
[
124,
125
],
[
110,
126
],
[
126,
127
],
[
127,
128
],
[
128,
129
],
[
127,
130
],
[
126,
131
],
[
131,
132
],
[
132,
133
],
[
132,
134
],
[
134,
135
],
[
135,
136
],
[
131,
137
],
[
137,
138
],
[
137,
139
],
[
139,
140
],
[
140,
141
],
[
131,
142
],
[
142,
143
],
[
143,
144
],
[
142,
145
],
[
145,
146
],
[
145,
147
],
[
126,
148
],
[
148,
149
],
[
149,
150
],
[
150,
151
],
[
149,
152
],
[
74,
153
],
[
153,
154
],
[
154,
155
],
[
155,
156
],
[
155,
157
],
[
153,
158
],
[
158,
159
],
[
159,
160
],
[
72,
161
],
[
161,
162
],
[
0,
163
],
[
163,
164
],
[
163,
165
]
] | [
"import java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\n\nclass Stack {\n\tString[] stack;\n\tint index;\n\tpublic Stack(int size) {\n\t\tindex = 0;\n\t\tstack = new String[size];\n\t}\n\n\tpublic void put(String target) {\n\t\tstack[index++] = target;\n\t}\n\n\tpublic void put(int target) {\n\t\tstack[index++] = String.valueOf(target);\n\t}\n\n\tpublic String get() {\n\t\treturn stack[--index];\n\t}\n\n\tpublic int getNum() {\n\t\treturn Integer.parseInt(get());\n\n\t}\n}\npublic class Main {\n\n\tpublic static void main(String[] args) throws IOException {\n\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tStack stack = new Stack(200);\n\t\tString[] strs = br.readLine().split(\" \");\n\t\tfor (String target : strs) {\n\t\t\tif (\"*\".equals(target)) {\n\t\t\tstack.put(stack.getNum() * stack.getNum());\n\t\t\t} else if (\"+\".equals(target)) {\n\t\t\t\tstack.put(stack.getNum() + stack.getNum());\n\t\t\t} else if (\"-\".equals(target)) {\n\t\t\t\tint b = stack.getNum();\n\t\t\t\tint a = stack.getNum();\n\t\t\t\tstack.put(a - b);\n\t\t\t} else {\n\t\t\t\tstack.put(target);\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(stack.get());\n\t}\n}",
"import java.io.BufferedReader;",
"BufferedReader",
"java.io",
"import java.io.IOException;",
"IOException",
"java.io",
"import java.io.InputStreamReader;",
"InputStreamReader",
"java.io",
"class Stack {\n\tString[] stack;\n\tint index;\n\tpublic Stack(int size) {\n\t\tindex = 0;\n\t\tstack = new String[size];\n\t}\n\n\tpublic void put(String target) {\n\t\tstack[index++] = target;\n\t}\n\n\tpublic void put(int target) {\n\t\tstack[index++] = String.valueOf(target);\n\t}\n\n\tpublic String get() {\n\t\treturn stack[--index];\n\t}\n\n\tpublic int getNum() {\n\t\treturn Integer.parseInt(get());\n\n\t}\n}",
"Stack",
"String[] stack;",
"stack",
"int index;",
"index",
"public Stack(int size) {\n\t\tindex = 0;\n\t\tstack = new String[size];\n\t}",
"Stack",
"{\n\t\tindex = 0;\n\t\tstack = new String[size];\n\t}",
"index = 0",
"index",
"0",
"stack = new String[size]",
"stack",
"new String[size]",
"size",
"int size",
"size",
"public void put(String target) {\n\t\tstack[index++] = target;\n\t}",
"put",
"{\n\t\tstack[index++] = target;\n\t}",
"stack[index++] = target",
"stack[index++]",
"stack",
"index++",
"index",
"target",
"String target",
"target",
"public void put(int target) {\n\t\tstack[index++] = String.valueOf(target);\n\t}",
"put",
"{\n\t\tstack[index++] = String.valueOf(target);\n\t}",
"stack[index++] = String.valueOf(target)",
"stack[index++]",
"stack",
"index++",
"index",
"String.valueOf(target)",
"String.valueOf",
"String",
"target",
"int target",
"target",
"public String get() {\n\t\treturn stack[--index];\n\t}",
"get",
"{\n\t\treturn stack[--index];\n\t}",
"return stack[--index];",
"stack[--index]",
"stack",
"--index",
"index",
"public int getNum() {\n\t\treturn Integer.parseInt(get());\n\n\t}",
"getNum",
"{\n\t\treturn Integer.parseInt(get());\n\n\t}",
"return Integer.parseInt(get());",
"Integer.parseInt(get())",
"Integer.parseInt",
"Integer",
"get()",
"get",
"public class Main {\n\n\tpublic static void main(String[] args) throws IOException {\n\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tStack stack = new Stack(200);\n\t\tString[] strs = br.readLine().split(\" \");\n\t\tfor (String target : strs) {\n\t\t\tif (\"*\".equals(target)) {\n\t\t\tstack.put(stack.getNum() * stack.getNum());\n\t\t\t} else if (\"+\".equals(target)) {\n\t\t\t\tstack.put(stack.getNum() + stack.getNum());\n\t\t\t} else if (\"-\".equals(target)) {\n\t\t\t\tint b = stack.getNum();\n\t\t\t\tint a = stack.getNum();\n\t\t\t\tstack.put(a - b);\n\t\t\t} else {\n\t\t\t\tstack.put(target);\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(stack.get());\n\t}\n}",
"Main",
"public static void main(String[] args) throws IOException {\n\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tStack stack = new Stack(200);\n\t\tString[] strs = br.readLine().split(\" \");\n\t\tfor (String target : strs) {\n\t\t\tif (\"*\".equals(target)) {\n\t\t\tstack.put(stack.getNum() * stack.getNum());\n\t\t\t} else if (\"+\".equals(target)) {\n\t\t\t\tstack.put(stack.getNum() + stack.getNum());\n\t\t\t} else if (\"-\".equals(target)) {\n\t\t\t\tint b = stack.getNum();\n\t\t\t\tint a = stack.getNum();\n\t\t\t\tstack.put(a - b);\n\t\t\t} else {\n\t\t\t\tstack.put(target);\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(stack.get());\n\t}",
"main",
"{\n\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tStack stack = new Stack(200);\n\t\tString[] strs = br.readLine().split(\" \");\n\t\tfor (String target : strs) {\n\t\t\tif (\"*\".equals(target)) {\n\t\t\tstack.put(stack.getNum() * stack.getNum());\n\t\t\t} else if (\"+\".equals(target)) {\n\t\t\t\tstack.put(stack.getNum() + stack.getNum());\n\t\t\t} else if (\"-\".equals(target)) {\n\t\t\t\tint b = stack.getNum();\n\t\t\t\tint a = stack.getNum();\n\t\t\t\tstack.put(a - b);\n\t\t\t} else {\n\t\t\t\tstack.put(target);\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(stack.get());\n\t}",
"BufferedReader br = new BufferedReader(new InputStreamReader(System.in));",
"br",
"new BufferedReader(new InputStreamReader(System.in))",
"Stack stack = new Stack(200);",
"stack",
"new Stack(200)",
"String[] strs = br.readLine().split(\" \");",
"strs",
"br.readLine().split(\" \")",
"br.readLine().split",
"br.readLine()",
"br.readLine",
"br",
"\" \"",
"for (String target : strs) {\n\t\t\tif (\"*\".equals(target)) {\n\t\t\tstack.put(stack.getNum() * stack.getNum());\n\t\t\t} else if (\"+\".equals(target)) {\n\t\t\t\tstack.put(stack.getNum() + stack.getNum());\n\t\t\t} else if (\"-\".equals(target)) {\n\t\t\t\tint b = stack.getNum();\n\t\t\t\tint a = stack.getNum();\n\t\t\t\tstack.put(a - b);\n\t\t\t} else {\n\t\t\t\tstack.put(target);\n\t\t\t}\n\t\t}",
"String target",
"strs",
"{\n\t\t\tif (\"*\".equals(target)) {\n\t\t\tstack.put(stack.getNum() * stack.getNum());\n\t\t\t} else if (\"+\".equals(target)) {\n\t\t\t\tstack.put(stack.getNum() + stack.getNum());\n\t\t\t} else if (\"-\".equals(target)) {\n\t\t\t\tint b = stack.getNum();\n\t\t\t\tint a = stack.getNum();\n\t\t\t\tstack.put(a - b);\n\t\t\t} else {\n\t\t\t\tstack.put(target);\n\t\t\t}\n\t\t}",
"{\n\t\t\tif (\"*\".equals(target)) {\n\t\t\tstack.put(stack.getNum() * stack.getNum());\n\t\t\t} else if (\"+\".equals(target)) {\n\t\t\t\tstack.put(stack.getNum() + stack.getNum());\n\t\t\t} else if (\"-\".equals(target)) {\n\t\t\t\tint b = stack.getNum();\n\t\t\t\tint a = stack.getNum();\n\t\t\t\tstack.put(a - b);\n\t\t\t} else {\n\t\t\t\tstack.put(target);\n\t\t\t}\n\t\t}",
"if (\"*\".equals(target)) {\n\t\t\tstack.put(stack.getNum() * stack.getNum());\n\t\t\t} else if (\"+\".equals(target)) {\n\t\t\t\tstack.put(stack.getNum() + stack.getNum());\n\t\t\t} else if (\"-\".equals(target)) {\n\t\t\t\tint b = stack.getNum();\n\t\t\t\tint a = stack.getNum();\n\t\t\t\tstack.put(a - b);\n\t\t\t} else {\n\t\t\t\tstack.put(target);\n\t\t\t}",
"\"*\".equals(target)",
"\"*\".equals",
"\"*\"",
"target",
"{\n\t\t\tstack.put(stack.getNum() * stack.getNum());\n\t\t\t}",
"stack.put(stack.getNum() * stack.getNum())",
"stack.put",
"stack",
"stack.getNum() * stack.getNum()",
"stack.getNum()",
"stack.getNum",
"stack",
"stack.getNum()",
"stack.getNum",
"stack",
"if (\"+\".equals(target)) {\n\t\t\t\tstack.put(stack.getNum() + stack.getNum());\n\t\t\t} else if (\"-\".equals(target)) {\n\t\t\t\tint b = stack.getNum();\n\t\t\t\tint a = stack.getNum();\n\t\t\t\tstack.put(a - b);\n\t\t\t} else {\n\t\t\t\tstack.put(target);\n\t\t\t}",
"\"+\".equals(target)",
"\"+\".equals",
"\"+\"",
"target",
"{\n\t\t\t\tstack.put(stack.getNum() + stack.getNum());\n\t\t\t}",
"stack.put(stack.getNum() + stack.getNum())",
"stack.put",
"stack",
"stack.getNum() + stack.getNum()",
"stack.getNum()",
"stack.getNum",
"stack",
"stack.getNum()",
"stack.getNum",
"stack",
"if (\"-\".equals(target)) {\n\t\t\t\tint b = stack.getNum();\n\t\t\t\tint a = stack.getNum();\n\t\t\t\tstack.put(a - b);\n\t\t\t} else {\n\t\t\t\tstack.put(target);\n\t\t\t}",
"\"-\".equals(target)",
"\"-\".equals",
"\"-\"",
"target",
"{\n\t\t\t\tint b = stack.getNum();\n\t\t\t\tint a = stack.getNum();\n\t\t\t\tstack.put(a - b);\n\t\t\t}",
"int b = stack.getNum();",
"b",
"stack.getNum()",
"stack.getNum",
"stack",
"int a = stack.getNum();",
"a",
"stack.getNum()",
"stack.getNum",
"stack",
"stack.put(a - b)",
"stack.put",
"stack",
"a - b",
"a",
"b",
"{\n\t\t\t\tstack.put(target);\n\t\t\t}",
"stack.put(target)",
"stack.put",
"stack",
"target",
"System.out.println(stack.get())",
"System.out.println",
"System.out",
"System",
"System.out",
"stack.get()",
"stack.get",
"stack",
"String[] args",
"args",
"public class Main {\n\n\tpublic static void main(String[] args) throws IOException {\n\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tStack stack = new Stack(200);\n\t\tString[] strs = br.readLine().split(\" \");\n\t\tfor (String target : strs) {\n\t\t\tif (\"*\".equals(target)) {\n\t\t\tstack.put(stack.getNum() * stack.getNum());\n\t\t\t} else if (\"+\".equals(target)) {\n\t\t\t\tstack.put(stack.getNum() + stack.getNum());\n\t\t\t} else if (\"-\".equals(target)) {\n\t\t\t\tint b = stack.getNum();\n\t\t\t\tint a = stack.getNum();\n\t\t\t\tstack.put(a - b);\n\t\t\t} else {\n\t\t\t\tstack.put(target);\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(stack.get());\n\t}\n}",
"public class Main {\n\n\tpublic static void main(String[] args) throws IOException {\n\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tStack stack = new Stack(200);\n\t\tString[] strs = br.readLine().split(\" \");\n\t\tfor (String target : strs) {\n\t\t\tif (\"*\".equals(target)) {\n\t\t\tstack.put(stack.getNum() * stack.getNum());\n\t\t\t} else if (\"+\".equals(target)) {\n\t\t\t\tstack.put(stack.getNum() + stack.getNum());\n\t\t\t} else if (\"-\".equals(target)) {\n\t\t\t\tint b = stack.getNum();\n\t\t\t\tint a = stack.getNum();\n\t\t\t\tstack.put(a - b);\n\t\t\t} else {\n\t\t\t\tstack.put(target);\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(stack.get());\n\t}\n}",
"Main"
] | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
class Stack {
String[] stack;
int index;
public Stack(int size) {
index = 0;
stack = new String[size];
}
public void put(String target) {
stack[index++] = target;
}
public void put(int target) {
stack[index++] = String.valueOf(target);
}
public String get() {
return stack[--index];
}
public int getNum() {
return Integer.parseInt(get());
}
}
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
Stack stack = new Stack(200);
String[] strs = br.readLine().split(" ");
for (String target : strs) {
if ("*".equals(target)) {
stack.put(stack.getNum() * stack.getNum());
} else if ("+".equals(target)) {
stack.put(stack.getNum() + stack.getNum());
} else if ("-".equals(target)) {
int b = stack.getNum();
int a = stack.getNum();
stack.put(a - b);
} else {
stack.put(target);
}
}
System.out.println(stack.get());
}
} |
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
17,
41,
13,
17,
41,
13,
20,
41,
13,
4,
18,
4,
18,
13,
17,
41,
13,
20,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
30,
14,
4,
18,
18,
13,
13,
17,
30,
0,
13,
4,
18,
13,
0,
13,
4,
18,
13,
4,
18,
13,
2,
13,
13,
14,
4,
18,
18,
13,
13,
17,
30,
0,
13,
4,
18,
13,
0,
13,
4,
18,
13,
4,
18,
13,
2,
13,
13,
14,
4,
18,
18,
13,
13,
17,
30,
0,
13,
4,
18,
13,
0,
13,
4,
18,
13,
4,
18,
13,
2,
13,
13,
30,
4,
18,
13,
4,
18,
13,
18,
13,
13,
4,
18,
18,
13,
13,
4,
18,
13,
23,
13,
6,
13,
41,
13,
41,
13,
12,
13,
30,
0,
13,
20,
13,
0,
13,
17,
23,
13,
12,
13,
30,
29,
18,
13,
40,
13,
12,
13,
30,
0,
18,
13,
40,
13,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
180,
11
],
[
180,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
15,
17
],
[
14,
18
],
[
18,
19
],
[
18,
20
],
[
14,
21
],
[
21,
22
],
[
21,
23
],
[
14,
24
],
[
24,
25
],
[
24,
26
],
[
26,
27
],
[
27,
28
],
[
28,
29
],
[
29,
30
],
[
26,
31
],
[
14,
32
],
[
32,
33
],
[
32,
34
],
[
14,
35
],
[
35,
36
],
[
36,
37
],
[
37,
38
],
[
37,
39
],
[
35,
40
],
[
40,
41
],
[
40,
42
],
[
42,
43
],
[
42,
44
],
[
35,
45
],
[
45,
46
],
[
46,
47
],
[
35,
48
],
[
49,
49
],
[
49,
50
],
[
50,
51
],
[
51,
52
],
[
52,
53
],
[
53,
54
],
[
53,
55
],
[
51,
56
],
[
50,
57
],
[
57,
58
],
[
58,
59
],
[
58,
60
],
[
60,
61
],
[
61,
62
],
[
57,
63
],
[
63,
64
],
[
63,
65
],
[
65,
66
],
[
66,
67
],
[
57,
68
],
[
68,
69
],
[
69,
70
],
[
68,
71
],
[
71,
72
],
[
71,
73
],
[
50,
74
],
[
74,
75
],
[
75,
76
],
[
76,
77
],
[
77,
78
],
[
77,
79
],
[
75,
80
],
[
74,
81
],
[
81,
82
],
[
82,
83
],
[
82,
84
],
[
84,
85
],
[
85,
86
],
[
81,
87
],
[
87,
88
],
[
87,
89
],
[
89,
90
],
[
90,
91
],
[
81,
92
],
[
92,
93
],
[
93,
94
],
[
92,
95
],
[
95,
96
],
[
95,
97
],
[
74,
98
],
[
98,
99
],
[
99,
100
],
[
100,
101
],
[
101,
102
],
[
101,
103
],
[
99,
104
],
[
98,
105
],
[
105,
106
],
[
106,
107
],
[
106,
108
],
[
108,
109
],
[
109,
110
],
[
105,
111
],
[
111,
112
],
[
111,
113
],
[
113,
114
],
[
114,
115
],
[
105,
116
],
[
116,
117
],
[
117,
118
],
[
116,
119
],
[
119,
120
],
[
119,
121
],
[
98,
122
],
[
122,
123
],
[
123,
124
],
[
124,
125
],
[
123,
126
],
[
126,
127
],
[
127,
128
],
[
126,
129
],
[
129,
130
],
[
129,
131
],
[
14,
132
],
[
132,
133
],
[
133,
134
],
[
134,
135
],
[
134,
136
],
[
132,
137
],
[
137,
138
],
[
138,
139
],
[
12,
140
],
[
140,
141
],
[
0,
142
],
[
142,
143
],
[
142,
144
],
[
144,
145
],
[
142,
146
],
[
146,
147
],
[
142,
148
],
[
148,
149
],
[
148,
150
],
[
150,
151
],
[
151,
152
],
[
151,
153
],
[
150,
155
],
[
155,
156
],
[
155,
157
],
[
148,
158
],
[
158,
159
],
[
142,
160
],
[
160,
161
],
[
160,
162
],
[
162,
163
],
[
163,
164
],
[
164,
165
],
[
164,
166
],
[
166,
167
],
[
142,
168
],
[
168,
169
],
[
168,
170
],
[
170,
171
],
[
171,
172
],
[
172,
173
],
[
172,
174
],
[
174,
175
],
[
171,
176
],
[
168,
177
],
[
177,
178
],
[
0,
179
],
[
179,
180
],
[
179,
181
]
] | [
"import java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\n\npublic class Main{\n\n\tpublic static void main(String[] args) throws IOException {\n\t\tint num1 = 0;\n\t\tint num2 = 0;\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tString strArray[] = (br.readLine()).split(\" \");\n\t\tStack stack = new Stack(strArray.length);\n\t\tfor(int i = 0;i < strArray.length; i++){\n\t\t\tif(strArray[i].equals(\"+\")){\n\t\t\t\tnum1 = stack.pop();\n\t\t\t\tnum2 = stack.pop();\n\t\t\t\tstack.push(num1 + num2);\n\t\t\t}\n\t\t\telse if(strArray[i].equals(\"*\")){\n\t\t\t\tnum1 = stack.pop();\n\t\t\t\tnum2 = stack.pop();\n\t\t\t\tstack.push(num1 * num2);\n\t\t\t}\n\t\t\telse if(strArray[i].equals(\"-\")){\n\t\t\t\tnum1 = stack.pop();\n\t\t\t\tnum2 = stack.pop();\n\t\t\t\tstack.push(num2 - num1);\n\t\t\t}\n\t\t\telse{\n\t\t\t\tstack.push(Integer.parseInt(strArray[i]));\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(stack.pop());\n\t}\n\n}\n\nclass Stack{\n\tprivate int top;\n\tprivate int stack[];\n\n\tStack(int size){\n\t\tstack = new int [size];\n\t\ttop = 0;\n\t}\n\n\tpublic int pop(){\n\t\treturn stack[--top];\n\t}\n\n\tpublic void push(int num){\n\t\tstack[top++] = num;\n\t}\n}",
"import java.io.BufferedReader;",
"BufferedReader",
"java.io",
"import java.io.IOException;",
"IOException",
"java.io",
"import java.io.InputStreamReader;",
"InputStreamReader",
"java.io",
"public class Main{\n\n\tpublic static void main(String[] args) throws IOException {\n\t\tint num1 = 0;\n\t\tint num2 = 0;\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tString strArray[] = (br.readLine()).split(\" \");\n\t\tStack stack = new Stack(strArray.length);\n\t\tfor(int i = 0;i < strArray.length; i++){\n\t\t\tif(strArray[i].equals(\"+\")){\n\t\t\t\tnum1 = stack.pop();\n\t\t\t\tnum2 = stack.pop();\n\t\t\t\tstack.push(num1 + num2);\n\t\t\t}\n\t\t\telse if(strArray[i].equals(\"*\")){\n\t\t\t\tnum1 = stack.pop();\n\t\t\t\tnum2 = stack.pop();\n\t\t\t\tstack.push(num1 * num2);\n\t\t\t}\n\t\t\telse if(strArray[i].equals(\"-\")){\n\t\t\t\tnum1 = stack.pop();\n\t\t\t\tnum2 = stack.pop();\n\t\t\t\tstack.push(num2 - num1);\n\t\t\t}\n\t\t\telse{\n\t\t\t\tstack.push(Integer.parseInt(strArray[i]));\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(stack.pop());\n\t}\n\n}",
"Main",
"public static void main(String[] args) throws IOException {\n\t\tint num1 = 0;\n\t\tint num2 = 0;\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tString strArray[] = (br.readLine()).split(\" \");\n\t\tStack stack = new Stack(strArray.length);\n\t\tfor(int i = 0;i < strArray.length; i++){\n\t\t\tif(strArray[i].equals(\"+\")){\n\t\t\t\tnum1 = stack.pop();\n\t\t\t\tnum2 = stack.pop();\n\t\t\t\tstack.push(num1 + num2);\n\t\t\t}\n\t\t\telse if(strArray[i].equals(\"*\")){\n\t\t\t\tnum1 = stack.pop();\n\t\t\t\tnum2 = stack.pop();\n\t\t\t\tstack.push(num1 * num2);\n\t\t\t}\n\t\t\telse if(strArray[i].equals(\"-\")){\n\t\t\t\tnum1 = stack.pop();\n\t\t\t\tnum2 = stack.pop();\n\t\t\t\tstack.push(num2 - num1);\n\t\t\t}\n\t\t\telse{\n\t\t\t\tstack.push(Integer.parseInt(strArray[i]));\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(stack.pop());\n\t}",
"main",
"{\n\t\tint num1 = 0;\n\t\tint num2 = 0;\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tString strArray[] = (br.readLine()).split(\" \");\n\t\tStack stack = new Stack(strArray.length);\n\t\tfor(int i = 0;i < strArray.length; i++){\n\t\t\tif(strArray[i].equals(\"+\")){\n\t\t\t\tnum1 = stack.pop();\n\t\t\t\tnum2 = stack.pop();\n\t\t\t\tstack.push(num1 + num2);\n\t\t\t}\n\t\t\telse if(strArray[i].equals(\"*\")){\n\t\t\t\tnum1 = stack.pop();\n\t\t\t\tnum2 = stack.pop();\n\t\t\t\tstack.push(num1 * num2);\n\t\t\t}\n\t\t\telse if(strArray[i].equals(\"-\")){\n\t\t\t\tnum1 = stack.pop();\n\t\t\t\tnum2 = stack.pop();\n\t\t\t\tstack.push(num2 - num1);\n\t\t\t}\n\t\t\telse{\n\t\t\t\tstack.push(Integer.parseInt(strArray[i]));\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(stack.pop());\n\t}",
"int num1 = 0;",
"num1",
"0",
"int num2 = 0;",
"num2",
"0",
"BufferedReader br = new BufferedReader(new InputStreamReader(System.in));",
"br",
"new BufferedReader(new InputStreamReader(System.in))",
"String strArray[] = (br.readLine()).split(\" \");",
"strArray",
"(br.readLine()).split(\" \")",
"(br.readLine()).split",
"(br.readLine())",
"br.readLine",
"br",
"\" \"",
"Stack stack = new Stack(strArray.length);",
"stack",
"new Stack(strArray.length)",
"for(int i = 0;i < strArray.length; i++){\n\t\t\tif(strArray[i].equals(\"+\")){\n\t\t\t\tnum1 = stack.pop();\n\t\t\t\tnum2 = stack.pop();\n\t\t\t\tstack.push(num1 + num2);\n\t\t\t}\n\t\t\telse if(strArray[i].equals(\"*\")){\n\t\t\t\tnum1 = stack.pop();\n\t\t\t\tnum2 = stack.pop();\n\t\t\t\tstack.push(num1 * num2);\n\t\t\t}\n\t\t\telse if(strArray[i].equals(\"-\")){\n\t\t\t\tnum1 = stack.pop();\n\t\t\t\tnum2 = stack.pop();\n\t\t\t\tstack.push(num2 - num1);\n\t\t\t}\n\t\t\telse{\n\t\t\t\tstack.push(Integer.parseInt(strArray[i]));\n\t\t\t}\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < strArray.length",
"i",
"strArray.length",
"strArray",
"strArray.length",
"i++",
"i++",
"i",
"{\n\t\t\tif(strArray[i].equals(\"+\")){\n\t\t\t\tnum1 = stack.pop();\n\t\t\t\tnum2 = stack.pop();\n\t\t\t\tstack.push(num1 + num2);\n\t\t\t}\n\t\t\telse if(strArray[i].equals(\"*\")){\n\t\t\t\tnum1 = stack.pop();\n\t\t\t\tnum2 = stack.pop();\n\t\t\t\tstack.push(num1 * num2);\n\t\t\t}\n\t\t\telse if(strArray[i].equals(\"-\")){\n\t\t\t\tnum1 = stack.pop();\n\t\t\t\tnum2 = stack.pop();\n\t\t\t\tstack.push(num2 - num1);\n\t\t\t}\n\t\t\telse{\n\t\t\t\tstack.push(Integer.parseInt(strArray[i]));\n\t\t\t}\n\t\t}",
"{\n\t\t\tif(strArray[i].equals(\"+\")){\n\t\t\t\tnum1 = stack.pop();\n\t\t\t\tnum2 = stack.pop();\n\t\t\t\tstack.push(num1 + num2);\n\t\t\t}\n\t\t\telse if(strArray[i].equals(\"*\")){\n\t\t\t\tnum1 = stack.pop();\n\t\t\t\tnum2 = stack.pop();\n\t\t\t\tstack.push(num1 * num2);\n\t\t\t}\n\t\t\telse if(strArray[i].equals(\"-\")){\n\t\t\t\tnum1 = stack.pop();\n\t\t\t\tnum2 = stack.pop();\n\t\t\t\tstack.push(num2 - num1);\n\t\t\t}\n\t\t\telse{\n\t\t\t\tstack.push(Integer.parseInt(strArray[i]));\n\t\t\t}\n\t\t}",
"if(strArray[i].equals(\"+\")){\n\t\t\t\tnum1 = stack.pop();\n\t\t\t\tnum2 = stack.pop();\n\t\t\t\tstack.push(num1 + num2);\n\t\t\t}\n\t\t\telse if(strArray[i].equals(\"*\")){\n\t\t\t\tnum1 = stack.pop();\n\t\t\t\tnum2 = stack.pop();\n\t\t\t\tstack.push(num1 * num2);\n\t\t\t}\n\t\t\telse if(strArray[i].equals(\"-\")){\n\t\t\t\tnum1 = stack.pop();\n\t\t\t\tnum2 = stack.pop();\n\t\t\t\tstack.push(num2 - num1);\n\t\t\t}\n\t\t\telse{\n\t\t\t\tstack.push(Integer.parseInt(strArray[i]));\n\t\t\t}",
"strArray[i].equals(\"+\")",
"strArray[i].equals",
"strArray[i]",
"strArray",
"i",
"\"+\"",
"{\n\t\t\t\tnum1 = stack.pop();\n\t\t\t\tnum2 = stack.pop();\n\t\t\t\tstack.push(num1 + num2);\n\t\t\t}",
"num1 = stack.pop()",
"num1",
"stack.pop()",
"stack.pop",
"stack",
"num2 = stack.pop()",
"num2",
"stack.pop()",
"stack.pop",
"stack",
"stack.push(num1 + num2)",
"stack.push",
"stack",
"num1 + num2",
"num1",
"num2",
"if(strArray[i].equals(\"*\")){\n\t\t\t\tnum1 = stack.pop();\n\t\t\t\tnum2 = stack.pop();\n\t\t\t\tstack.push(num1 * num2);\n\t\t\t}\n\t\t\telse if(strArray[i].equals(\"-\")){\n\t\t\t\tnum1 = stack.pop();\n\t\t\t\tnum2 = stack.pop();\n\t\t\t\tstack.push(num2 - num1);\n\t\t\t}\n\t\t\telse{\n\t\t\t\tstack.push(Integer.parseInt(strArray[i]));\n\t\t\t}",
"strArray[i].equals(\"*\")",
"strArray[i].equals",
"strArray[i]",
"strArray",
"i",
"\"*\"",
"{\n\t\t\t\tnum1 = stack.pop();\n\t\t\t\tnum2 = stack.pop();\n\t\t\t\tstack.push(num1 * num2);\n\t\t\t}",
"num1 = stack.pop()",
"num1",
"stack.pop()",
"stack.pop",
"stack",
"num2 = stack.pop()",
"num2",
"stack.pop()",
"stack.pop",
"stack",
"stack.push(num1 * num2)",
"stack.push",
"stack",
"num1 * num2",
"num1",
"num2",
"if(strArray[i].equals(\"-\")){\n\t\t\t\tnum1 = stack.pop();\n\t\t\t\tnum2 = stack.pop();\n\t\t\t\tstack.push(num2 - num1);\n\t\t\t}\n\t\t\telse{\n\t\t\t\tstack.push(Integer.parseInt(strArray[i]));\n\t\t\t}",
"strArray[i].equals(\"-\")",
"strArray[i].equals",
"strArray[i]",
"strArray",
"i",
"\"-\"",
"{\n\t\t\t\tnum1 = stack.pop();\n\t\t\t\tnum2 = stack.pop();\n\t\t\t\tstack.push(num2 - num1);\n\t\t\t}",
"num1 = stack.pop()",
"num1",
"stack.pop()",
"stack.pop",
"stack",
"num2 = stack.pop()",
"num2",
"stack.pop()",
"stack.pop",
"stack",
"stack.push(num2 - num1)",
"stack.push",
"stack",
"num2 - num1",
"num2",
"num1",
"{\n\t\t\t\tstack.push(Integer.parseInt(strArray[i]));\n\t\t\t}",
"stack.push(Integer.parseInt(strArray[i]))",
"stack.push",
"stack",
"Integer.parseInt(strArray[i])",
"Integer.parseInt",
"Integer",
"strArray[i]",
"strArray",
"i",
"System.out.println(stack.pop())",
"System.out.println",
"System.out",
"System",
"System.out",
"stack.pop()",
"stack.pop",
"stack",
"String[] args",
"args",
"class Stack{\n\tprivate int top;\n\tprivate int stack[];\n\n\tStack(int size){\n\t\tstack = new int [size];\n\t\ttop = 0;\n\t}\n\n\tpublic int pop(){\n\t\treturn stack[--top];\n\t}\n\n\tpublic void push(int num){\n\t\tstack[top++] = num;\n\t}\n}",
"Stack",
"private int top;",
"top",
"private int stack[];",
"stack",
"Stack(int size){\n\t\tstack = new int [size];\n\t\ttop = 0;\n\t}",
"Stack",
"{\n\t\tstack = new int [size];\n\t\ttop = 0;\n\t}",
"stack = new int [size]",
"stack",
"new int [size]",
"size",
"top = 0",
"top",
"0",
"int size",
"size",
"public int pop(){\n\t\treturn stack[--top];\n\t}",
"pop",
"{\n\t\treturn stack[--top];\n\t}",
"return stack[--top];",
"stack[--top]",
"stack",
"--top",
"top",
"public void push(int num){\n\t\tstack[top++] = num;\n\t}",
"push",
"{\n\t\tstack[top++] = num;\n\t}",
"stack[top++] = num",
"stack[top++]",
"stack",
"top++",
"top",
"num",
"int num",
"num",
"public class Main{\n\n\tpublic static void main(String[] args) throws IOException {\n\t\tint num1 = 0;\n\t\tint num2 = 0;\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tString strArray[] = (br.readLine()).split(\" \");\n\t\tStack stack = new Stack(strArray.length);\n\t\tfor(int i = 0;i < strArray.length; i++){\n\t\t\tif(strArray[i].equals(\"+\")){\n\t\t\t\tnum1 = stack.pop();\n\t\t\t\tnum2 = stack.pop();\n\t\t\t\tstack.push(num1 + num2);\n\t\t\t}\n\t\t\telse if(strArray[i].equals(\"*\")){\n\t\t\t\tnum1 = stack.pop();\n\t\t\t\tnum2 = stack.pop();\n\t\t\t\tstack.push(num1 * num2);\n\t\t\t}\n\t\t\telse if(strArray[i].equals(\"-\")){\n\t\t\t\tnum1 = stack.pop();\n\t\t\t\tnum2 = stack.pop();\n\t\t\t\tstack.push(num2 - num1);\n\t\t\t}\n\t\t\telse{\n\t\t\t\tstack.push(Integer.parseInt(strArray[i]));\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(stack.pop());\n\t}\n\n}",
"public class Main{\n\n\tpublic static void main(String[] args) throws IOException {\n\t\tint num1 = 0;\n\t\tint num2 = 0;\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tString strArray[] = (br.readLine()).split(\" \");\n\t\tStack stack = new Stack(strArray.length);\n\t\tfor(int i = 0;i < strArray.length; i++){\n\t\t\tif(strArray[i].equals(\"+\")){\n\t\t\t\tnum1 = stack.pop();\n\t\t\t\tnum2 = stack.pop();\n\t\t\t\tstack.push(num1 + num2);\n\t\t\t}\n\t\t\telse if(strArray[i].equals(\"*\")){\n\t\t\t\tnum1 = stack.pop();\n\t\t\t\tnum2 = stack.pop();\n\t\t\t\tstack.push(num1 * num2);\n\t\t\t}\n\t\t\telse if(strArray[i].equals(\"-\")){\n\t\t\t\tnum1 = stack.pop();\n\t\t\t\tnum2 = stack.pop();\n\t\t\t\tstack.push(num2 - num1);\n\t\t\t}\n\t\t\telse{\n\t\t\t\tstack.push(Integer.parseInt(strArray[i]));\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(stack.pop());\n\t}\n\n}",
"Main"
] | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Main{
public static void main(String[] args) throws IOException {
int num1 = 0;
int num2 = 0;
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String strArray[] = (br.readLine()).split(" ");
Stack stack = new Stack(strArray.length);
for(int i = 0;i < strArray.length; i++){
if(strArray[i].equals("+")){
num1 = stack.pop();
num2 = stack.pop();
stack.push(num1 + num2);
}
else if(strArray[i].equals("*")){
num1 = stack.pop();
num2 = stack.pop();
stack.push(num1 * num2);
}
else if(strArray[i].equals("-")){
num1 = stack.pop();
num2 = stack.pop();
stack.push(num2 - num1);
}
else{
stack.push(Integer.parseInt(strArray[i]));
}
}
System.out.println(stack.pop());
}
}
class Stack{
private int top;
private int stack[];
Stack(int size){
stack = new int [size];
top = 0;
}
public int pop(){
return stack[--top];
}
public void push(int num){
stack[top++] = num;
}
} |
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
4,
18,
13,
17,
41,
13,
20,
41,
13,
17,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
30,
14,
4,
18,
18,
13,
13,
17,
30,
0,
13,
4,
18,
13,
0,
13,
4,
18,
13,
4,
18,
13,
2,
13,
13,
9,
14,
4,
18,
18,
13,
13,
17,
30,
0,
13,
4,
18,
13,
0,
13,
4,
18,
13,
4,
18,
13,
2,
13,
13,
9,
14,
4,
18,
18,
13,
13,
17,
30,
0,
13,
4,
18,
13,
0,
13,
4,
18,
13,
4,
18,
13,
2,
13,
13,
9,
14,
4,
18,
18,
13,
13,
17,
30,
0,
13,
4,
18,
13,
0,
13,
4,
18,
13,
4,
18,
13,
2,
13,
13,
9,
4,
18,
13,
4,
18,
13,
18,
13,
13,
4,
18,
18,
13,
13,
4,
18,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
10,
11
],
[
10,
12
],
[
0,
13
],
[
173,
14
],
[
173,
15
],
[
15,
16
],
[
15,
17
],
[
17,
18
],
[
18,
19
],
[
18,
20
],
[
17,
21
],
[
21,
22
],
[
21,
23
],
[
23,
24
],
[
24,
25
],
[
25,
26
],
[
26,
27
],
[
23,
28
],
[
17,
29
],
[
29,
30
],
[
29,
31
],
[
17,
32
],
[
32,
33
],
[
32,
34
],
[
17,
35
],
[
35,
36
],
[
35,
37
],
[
17,
38
],
[
38,
39
],
[
39,
40
],
[
40,
41
],
[
40,
42
],
[
38,
43
],
[
43,
44
],
[
43,
45
],
[
45,
46
],
[
45,
47
],
[
38,
48
],
[
48,
49
],
[
49,
50
],
[
38,
51
],
[
52,
52
],
[
52,
53
],
[
53,
54
],
[
54,
55
],
[
55,
56
],
[
56,
57
],
[
56,
58
],
[
54,
59
],
[
53,
60
],
[
60,
61
],
[
61,
62
],
[
61,
63
],
[
63,
64
],
[
64,
65
],
[
60,
66
],
[
66,
67
],
[
66,
68
],
[
68,
69
],
[
69,
70
],
[
60,
71
],
[
71,
72
],
[
72,
73
],
[
71,
74
],
[
74,
75
],
[
74,
76
],
[
60,
77
],
[
52,
78
],
[
78,
79
],
[
79,
80
],
[
80,
81
],
[
81,
82
],
[
81,
83
],
[
79,
84
],
[
78,
85
],
[
85,
86
],
[
86,
87
],
[
86,
88
],
[
88,
89
],
[
89,
90
],
[
85,
91
],
[
91,
92
],
[
91,
93
],
[
93,
94
],
[
94,
95
],
[
85,
96
],
[
96,
97
],
[
97,
98
],
[
96,
99
],
[
99,
100
],
[
99,
101
],
[
85,
102
],
[
52,
103
],
[
103,
104
],
[
104,
105
],
[
105,
106
],
[
106,
107
],
[
106,
108
],
[
104,
109
],
[
103,
110
],
[
110,
111
],
[
111,
112
],
[
111,
113
],
[
113,
114
],
[
114,
115
],
[
110,
116
],
[
116,
117
],
[
116,
118
],
[
118,
119
],
[
119,
120
],
[
110,
121
],
[
121,
122
],
[
122,
123
],
[
121,
124
],
[
124,
125
],
[
124,
126
],
[
110,
127
],
[
52,
128
],
[
128,
129
],
[
129,
130
],
[
130,
131
],
[
131,
132
],
[
131,
133
],
[
129,
134
],
[
128,
135
],
[
135,
136
],
[
136,
137
],
[
136,
138
],
[
138,
139
],
[
139,
140
],
[
135,
141
],
[
141,
142
],
[
141,
143
],
[
143,
144
],
[
144,
145
],
[
135,
146
],
[
146,
147
],
[
147,
148
],
[
146,
149
],
[
149,
150
],
[
149,
151
],
[
135,
152
],
[
52,
153
],
[
153,
154
],
[
154,
155
],
[
153,
156
],
[
156,
157
],
[
157,
158
],
[
156,
159
],
[
159,
160
],
[
159,
161
],
[
17,
162
],
[
162,
163
],
[
163,
164
],
[
164,
165
],
[
164,
166
],
[
162,
167
],
[
167,
168
],
[
168,
169
],
[
15,
170
],
[
170,
171
],
[
0,
172
],
[
172,
173
],
[
172,
174
]
] | [
"import java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\nimport java.util.Stack;\n\npublic class Main {\n\n public static void main(String args[]) throws IOException {\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n String[] stringArray = br.readLine().split(\"\\\\s\");\n\n Stack<Integer> que = new Stack<Integer>();\n int a = 0;\n int b = 0;\n for (int i = 0; i < stringArray.length; i++) {\n if (stringArray[i].equals(\"+\")) {\n a = que.pop();\n b = que.pop();\n que.add(b + a);\n continue;\n }\n if (stringArray[i].equals(\"-\")) {\n a = que.pop();\n b = que.pop();\n que.add(b - a);\n continue;\n }\n if (stringArray[i].equals(\"*\")) {\n a = que.pop();\n b = que.pop();\n que.add(b * a);\n continue;\n }\n if (stringArray[i].equals(\"/\")) {\n a = que.pop();\n b = que.pop();\n que.add(b / a);\n continue;\n }\n // 演算子以外はstackに登録する\n que.push(Integer.parseInt(stringArray[i]));\n }\n System.out.println(que.pop());\n }\n}",
"import java.io.BufferedReader;",
"BufferedReader",
"java.io",
"import java.io.IOException;",
"IOException",
"java.io",
"import java.io.InputStreamReader;",
"InputStreamReader",
"java.io",
"import java.util.Stack;",
"Stack",
"java.util",
"public class Main {\n\n public static void main(String args[]) throws IOException {\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n String[] stringArray = br.readLine().split(\"\\\\s\");\n\n Stack<Integer> que = new Stack<Integer>();\n int a = 0;\n int b = 0;\n for (int i = 0; i < stringArray.length; i++) {\n if (stringArray[i].equals(\"+\")) {\n a = que.pop();\n b = que.pop();\n que.add(b + a);\n continue;\n }\n if (stringArray[i].equals(\"-\")) {\n a = que.pop();\n b = que.pop();\n que.add(b - a);\n continue;\n }\n if (stringArray[i].equals(\"*\")) {\n a = que.pop();\n b = que.pop();\n que.add(b * a);\n continue;\n }\n if (stringArray[i].equals(\"/\")) {\n a = que.pop();\n b = que.pop();\n que.add(b / a);\n continue;\n }\n // 演算子以外はstackに登録する\n que.push(Integer.parseInt(stringArray[i]));\n }\n System.out.println(que.pop());\n }\n}",
"Main",
"public static void main(String args[]) throws IOException {\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n String[] stringArray = br.readLine().split(\"\\\\s\");\n\n Stack<Integer> que = new Stack<Integer>();\n int a = 0;\n int b = 0;\n for (int i = 0; i < stringArray.length; i++) {\n if (stringArray[i].equals(\"+\")) {\n a = que.pop();\n b = que.pop();\n que.add(b + a);\n continue;\n }\n if (stringArray[i].equals(\"-\")) {\n a = que.pop();\n b = que.pop();\n que.add(b - a);\n continue;\n }\n if (stringArray[i].equals(\"*\")) {\n a = que.pop();\n b = que.pop();\n que.add(b * a);\n continue;\n }\n if (stringArray[i].equals(\"/\")) {\n a = que.pop();\n b = que.pop();\n que.add(b / a);\n continue;\n }\n // 演算子以外はstackに登録する\n que.push(Integer.parseInt(stringArray[i]));\n }\n System.out.println(que.pop());\n }",
"main",
"{\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n String[] stringArray = br.readLine().split(\"\\\\s\");\n\n Stack<Integer> que = new Stack<Integer>();\n int a = 0;\n int b = 0;\n for (int i = 0; i < stringArray.length; i++) {\n if (stringArray[i].equals(\"+\")) {\n a = que.pop();\n b = que.pop();\n que.add(b + a);\n continue;\n }\n if (stringArray[i].equals(\"-\")) {\n a = que.pop();\n b = que.pop();\n que.add(b - a);\n continue;\n }\n if (stringArray[i].equals(\"*\")) {\n a = que.pop();\n b = que.pop();\n que.add(b * a);\n continue;\n }\n if (stringArray[i].equals(\"/\")) {\n a = que.pop();\n b = que.pop();\n que.add(b / a);\n continue;\n }\n // 演算子以外はstackに登録する\n que.push(Integer.parseInt(stringArray[i]));\n }\n System.out.println(que.pop());\n }",
"BufferedReader br = new BufferedReader(new InputStreamReader(System.in));",
"br",
"new BufferedReader(new InputStreamReader(System.in))",
"String[] stringArray = br.readLine().split(\"\\\\s\");",
"stringArray",
"br.readLine().split(\"\\\\s\")",
"br.readLine().split",
"br.readLine()",
"br.readLine",
"br",
"\"\\\\s\"",
"Stack<Integer> que = new Stack<Integer>();",
"que",
"new Stack<Integer>()",
"int a = 0;",
"a",
"0",
"int b = 0;",
"b",
"0",
"for (int i = 0; i < stringArray.length; i++) {\n if (stringArray[i].equals(\"+\")) {\n a = que.pop();\n b = que.pop();\n que.add(b + a);\n continue;\n }\n if (stringArray[i].equals(\"-\")) {\n a = que.pop();\n b = que.pop();\n que.add(b - a);\n continue;\n }\n if (stringArray[i].equals(\"*\")) {\n a = que.pop();\n b = que.pop();\n que.add(b * a);\n continue;\n }\n if (stringArray[i].equals(\"/\")) {\n a = que.pop();\n b = que.pop();\n que.add(b / a);\n continue;\n }\n // 演算子以外はstackに登録する\n que.push(Integer.parseInt(stringArray[i]));\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < stringArray.length",
"i",
"stringArray.length",
"stringArray",
"stringArray.length",
"i++",
"i++",
"i",
"{\n if (stringArray[i].equals(\"+\")) {\n a = que.pop();\n b = que.pop();\n que.add(b + a);\n continue;\n }\n if (stringArray[i].equals(\"-\")) {\n a = que.pop();\n b = que.pop();\n que.add(b - a);\n continue;\n }\n if (stringArray[i].equals(\"*\")) {\n a = que.pop();\n b = que.pop();\n que.add(b * a);\n continue;\n }\n if (stringArray[i].equals(\"/\")) {\n a = que.pop();\n b = que.pop();\n que.add(b / a);\n continue;\n }\n // 演算子以外はstackに登録する\n que.push(Integer.parseInt(stringArray[i]));\n }",
"{\n if (stringArray[i].equals(\"+\")) {\n a = que.pop();\n b = que.pop();\n que.add(b + a);\n continue;\n }\n if (stringArray[i].equals(\"-\")) {\n a = que.pop();\n b = que.pop();\n que.add(b - a);\n continue;\n }\n if (stringArray[i].equals(\"*\")) {\n a = que.pop();\n b = que.pop();\n que.add(b * a);\n continue;\n }\n if (stringArray[i].equals(\"/\")) {\n a = que.pop();\n b = que.pop();\n que.add(b / a);\n continue;\n }\n // 演算子以外はstackに登録する\n que.push(Integer.parseInt(stringArray[i]));\n }",
"if (stringArray[i].equals(\"+\")) {\n a = que.pop();\n b = que.pop();\n que.add(b + a);\n continue;\n }",
"stringArray[i].equals(\"+\")",
"stringArray[i].equals",
"stringArray[i]",
"stringArray",
"i",
"\"+\"",
"{\n a = que.pop();\n b = que.pop();\n que.add(b + a);\n continue;\n }",
"a = que.pop()",
"a",
"que.pop()",
"que.pop",
"que",
"b = que.pop()",
"b",
"que.pop()",
"que.pop",
"que",
"que.add(b + a)",
"que.add",
"que",
"b + a",
"b",
"a",
"continue;",
"if (stringArray[i].equals(\"-\")) {\n a = que.pop();\n b = que.pop();\n que.add(b - a);\n continue;\n }",
"stringArray[i].equals(\"-\")",
"stringArray[i].equals",
"stringArray[i]",
"stringArray",
"i",
"\"-\"",
"{\n a = que.pop();\n b = que.pop();\n que.add(b - a);\n continue;\n }",
"a = que.pop()",
"a",
"que.pop()",
"que.pop",
"que",
"b = que.pop()",
"b",
"que.pop()",
"que.pop",
"que",
"que.add(b - a)",
"que.add",
"que",
"b - a",
"b",
"a",
"continue;",
"if (stringArray[i].equals(\"*\")) {\n a = que.pop();\n b = que.pop();\n que.add(b * a);\n continue;\n }",
"stringArray[i].equals(\"*\")",
"stringArray[i].equals",
"stringArray[i]",
"stringArray",
"i",
"\"*\"",
"{\n a = que.pop();\n b = que.pop();\n que.add(b * a);\n continue;\n }",
"a = que.pop()",
"a",
"que.pop()",
"que.pop",
"que",
"b = que.pop()",
"b",
"que.pop()",
"que.pop",
"que",
"que.add(b * a)",
"que.add",
"que",
"b * a",
"b",
"a",
"continue;",
"if (stringArray[i].equals(\"/\")) {\n a = que.pop();\n b = que.pop();\n que.add(b / a);\n continue;\n }",
"stringArray[i].equals(\"/\")",
"stringArray[i].equals",
"stringArray[i]",
"stringArray",
"i",
"\"/\"",
"{\n a = que.pop();\n b = que.pop();\n que.add(b / a);\n continue;\n }",
"a = que.pop()",
"a",
"que.pop()",
"que.pop",
"que",
"b = que.pop()",
"b",
"que.pop()",
"que.pop",
"que",
"que.add(b / a)",
"que.add",
"que",
"b / a",
"b",
"a",
"continue;",
"que.push(Integer.parseInt(stringArray[i]))",
"que.push",
"que",
"Integer.parseInt(stringArray[i])",
"Integer.parseInt",
"Integer",
"stringArray[i]",
"stringArray",
"i",
"System.out.println(que.pop())",
"System.out.println",
"System.out",
"System",
"System.out",
"que.pop()",
"que.pop",
"que",
"String args[]",
"args",
"public class Main {\n\n public static void main(String args[]) throws IOException {\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n String[] stringArray = br.readLine().split(\"\\\\s\");\n\n Stack<Integer> que = new Stack<Integer>();\n int a = 0;\n int b = 0;\n for (int i = 0; i < stringArray.length; i++) {\n if (stringArray[i].equals(\"+\")) {\n a = que.pop();\n b = que.pop();\n que.add(b + a);\n continue;\n }\n if (stringArray[i].equals(\"-\")) {\n a = que.pop();\n b = que.pop();\n que.add(b - a);\n continue;\n }\n if (stringArray[i].equals(\"*\")) {\n a = que.pop();\n b = que.pop();\n que.add(b * a);\n continue;\n }\n if (stringArray[i].equals(\"/\")) {\n a = que.pop();\n b = que.pop();\n que.add(b / a);\n continue;\n }\n // 演算子以外はstackに登録する\n que.push(Integer.parseInt(stringArray[i]));\n }\n System.out.println(que.pop());\n }\n}",
"public class Main {\n\n public static void main(String args[]) throws IOException {\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n String[] stringArray = br.readLine().split(\"\\\\s\");\n\n Stack<Integer> que = new Stack<Integer>();\n int a = 0;\n int b = 0;\n for (int i = 0; i < stringArray.length; i++) {\n if (stringArray[i].equals(\"+\")) {\n a = que.pop();\n b = que.pop();\n que.add(b + a);\n continue;\n }\n if (stringArray[i].equals(\"-\")) {\n a = que.pop();\n b = que.pop();\n que.add(b - a);\n continue;\n }\n if (stringArray[i].equals(\"*\")) {\n a = que.pop();\n b = que.pop();\n que.add(b * a);\n continue;\n }\n if (stringArray[i].equals(\"/\")) {\n a = que.pop();\n b = que.pop();\n que.add(b / a);\n continue;\n }\n // 演算子以外はstackに登録する\n que.push(Integer.parseInt(stringArray[i]));\n }\n System.out.println(que.pop());\n }\n}",
"Main"
] | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Stack;
public class Main {
public static void main(String args[]) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String[] stringArray = br.readLine().split("\\s");
Stack<Integer> que = new Stack<Integer>();
int a = 0;
int b = 0;
for (int i = 0; i < stringArray.length; i++) {
if (stringArray[i].equals("+")) {
a = que.pop();
b = que.pop();
que.add(b + a);
continue;
}
if (stringArray[i].equals("-")) {
a = que.pop();
b = que.pop();
que.add(b - a);
continue;
}
if (stringArray[i].equals("*")) {
a = que.pop();
b = que.pop();
que.add(b * a);
continue;
}
if (stringArray[i].equals("/")) {
a = que.pop();
b = que.pop();
que.add(b / a);
continue;
}
// 演算子以外はstackに登録する
que.push(Integer.parseInt(stringArray[i]));
}
System.out.println(que.pop());
}
} |
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
20,
4,
18,
18,
13,
13,
4,
18,
13,
23,
13,
6,
13,
41,
13,
41,
13,
17,
12,
13,
30,
0,
18,
36,
13,
13,
23,
13,
12,
13,
30,
0,
18,
13,
13,
13,
40,
13,
23,
13,
12,
13,
30,
40,
13,
29,
18,
13,
13,
6,
13,
41,
13,
41,
13,
41,
13,
41,
13,
41,
13,
41,
13,
12,
13,
30,
0,
18,
36,
13,
13,
23,
13,
12,
13,
30,
41,
13,
0,
13,
20,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
30,
0,
13,
18,
13,
13,
14,
4,
18,
13,
17,
30,
0,
13,
4,
18,
13,
0,
13,
4,
18,
13,
0,
13,
2,
13,
13,
4,
18,
13,
13,
14,
4,
18,
13,
17,
30,
0,
13,
4,
18,
13,
0,
13,
4,
18,
13,
0,
13,
2,
13,
13,
4,
18,
13,
13,
14,
4,
18,
13,
17,
30,
0,
13,
4,
18,
13,
0,
13,
4,
18,
13,
0,
13,
2,
13,
13,
4,
18,
13,
13,
30,
0,
13,
4,
18,
13,
18,
13,
13,
4,
18,
13,
13,
29,
4,
18,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
214,
11
],
[
214,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
15,
17
],
[
14,
18
],
[
18,
19
],
[
18,
20
],
[
14,
21
],
[
21,
22
],
[
22,
23
],
[
23,
24
],
[
23,
25
],
[
21,
26
],
[
26,
27
],
[
27,
28
],
[
12,
29
],
[
29,
30
],
[
0,
31
],
[
31,
32
],
[
31,
33
],
[
33,
34
],
[
31,
35
],
[
35,
36
],
[
35,
37
],
[
31,
38
],
[
38,
39
],
[
38,
40
],
[
40,
41
],
[
41,
42
],
[
42,
43
],
[
42,
44
],
[
41,
45
],
[
38,
46
],
[
46,
47
],
[
31,
48
],
[
48,
49
],
[
48,
50
],
[
50,
51
],
[
51,
52
],
[
52,
53
],
[
52,
54
],
[
51,
55
],
[
50,
56
],
[
56,
57
],
[
48,
58
],
[
58,
59
],
[
31,
60
],
[
60,
61
],
[
60,
62
],
[
62,
63
],
[
63,
64
],
[
62,
65
],
[
65,
66
],
[
66,
67
],
[
66,
68
],
[
0,
69
],
[
69,
70
],
[
69,
71
],
[
71,
72
],
[
69,
73
],
[
73,
74
],
[
69,
75
],
[
75,
76
],
[
69,
77
],
[
77,
78
],
[
69,
79
],
[
79,
80
],
[
69,
81
],
[
81,
82
],
[
69,
83
],
[
83,
84
],
[
83,
85
],
[
85,
86
],
[
86,
87
],
[
87,
88
],
[
87,
89
],
[
86,
90
],
[
83,
91
],
[
91,
92
],
[
69,
93
],
[
93,
94
],
[
93,
95
],
[
95,
96
],
[
96,
97
],
[
95,
98
],
[
98,
99
],
[
98,
100
],
[
95,
101
],
[
101,
102
],
[
102,
103
],
[
103,
104
],
[
103,
105
],
[
101,
106
],
[
106,
107
],
[
106,
108
],
[
108,
109
],
[
108,
110
],
[
101,
111
],
[
111,
112
],
[
112,
113
],
[
101,
114
],
[
115,
115
],
[
115,
116
],
[
116,
117
],
[
116,
118
],
[
118,
119
],
[
118,
120
],
[
115,
121
],
[
121,
122
],
[
122,
123
],
[
123,
124
],
[
122,
125
],
[
121,
126
],
[
126,
127
],
[
127,
128
],
[
127,
129
],
[
129,
130
],
[
130,
131
],
[
126,
132
],
[
132,
133
],
[
132,
134
],
[
134,
135
],
[
135,
136
],
[
126,
137
],
[
137,
138
],
[
137,
139
],
[
139,
140
],
[
139,
141
],
[
126,
142
],
[
142,
143
],
[
143,
144
],
[
142,
145
],
[
121,
146
],
[
146,
147
],
[
147,
148
],
[
148,
149
],
[
147,
150
],
[
146,
151
],
[
151,
152
],
[
152,
153
],
[
152,
154
],
[
154,
155
],
[
155,
156
],
[
151,
157
],
[
157,
158
],
[
157,
159
],
[
159,
160
],
[
160,
161
],
[
151,
162
],
[
162,
163
],
[
162,
164
],
[
164,
165
],
[
164,
166
],
[
151,
167
],
[
167,
168
],
[
168,
169
],
[
167,
170
],
[
146,
171
],
[
171,
172
],
[
172,
173
],
[
173,
174
],
[
172,
175
],
[
171,
176
],
[
176,
177
],
[
177,
178
],
[
177,
179
],
[
179,
180
],
[
180,
181
],
[
176,
182
],
[
182,
183
],
[
182,
184
],
[
184,
185
],
[
185,
186
],
[
176,
187
],
[
187,
188
],
[
187,
189
],
[
189,
190
],
[
189,
191
],
[
176,
192
],
[
192,
193
],
[
193,
194
],
[
192,
195
],
[
171,
196
],
[
196,
197
],
[
197,
198
],
[
197,
199
],
[
199,
200
],
[
200,
201
],
[
199,
202
],
[
202,
203
],
[
202,
204
],
[
196,
205
],
[
205,
206
],
[
206,
207
],
[
205,
208
],
[
95,
209
],
[
209,
210
],
[
210,
211
],
[
211,
212
],
[
0,
213
],
[
213,
214
],
[
213,
215
]
] | [
"import java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\n\npublic class Main {\n\tpublic static void main(String[] args) throws IOException {\n\t\tBufferedReader in = new BufferedReader(new InputStreamReader(System.in));\n\t\tStackControler readDataArr = new StackControler(in.readLine()\n\t\t\t\t.split(\" \"));\n\t\tSystem.out.println(readDataArr.calcData());\n\t}\n}\n\nclass Stack {\n\tprivate int[] stack;\n\tprivate static int pointer = 0;\n\n\tStack(int[] stack) {\n\t\tthis.stack = stack;\n\t}\n\n\tpublic void push(int data) {\n\t\tstack[pointer] = data;\n\t\tpointer++;\n\t}\n\n\tpublic int pop() {\n\t\tpointer--;\n\t\treturn stack[pointer];\n\t}\n\n}\n\nclass StackControler {\n\tprivate Stack stack;\n\tprivate String[] readData;\n\tprivate int operand2, operand1, result, strToIntData;\n\n\tStackControler(String[] readData) {\n\t\tthis.readData = readData;\n\t}\n\n\tpublic int calcData() {\n\t\tString tempStrData;\n\t\tstack = new Stack(new int[100]);\n\t\tfor (int i = 0; i < readData.length; i++) {\n\t\t\ttempStrData = readData[i];\n\n\t\t\tif (tempStrData.equals(\"+\")) {\n\t\t\t\toperand1 = stack.pop();\n\t\t\t\toperand2 = stack.pop();\n\t\t\t\tresult = operand2 + operand1;\n\t\t\t\tstack.push(result);\n\t\t\t} else if (tempStrData.equals(\"-\")) {\n\t\t\t\toperand1 = stack.pop();\n\t\t\t\toperand2 = stack.pop();\n\t\t\t\tresult = operand2 - operand1;\n\t\t\t\tstack.push(result);\n\t\t\t} else if (tempStrData.equals(\"*\")) {\n\t\t\t\toperand1 = stack.pop();\n\t\t\t\toperand2 = stack.pop();\n\t\t\t\tresult = operand2 * operand1;\n\t\t\t\tstack.push(result);\n\t\t\t} else {\n\t\t\t\tstrToIntData = Integer.parseInt(readData[i]);\n\t\t\t\tstack.push(strToIntData);\n\t\t\t}\n\t\t}\n\t\treturn stack.pop();\n\t}\n}",
"import java.io.BufferedReader;",
"BufferedReader",
"java.io",
"import java.io.IOException;",
"IOException",
"java.io",
"import java.io.InputStreamReader;",
"InputStreamReader",
"java.io",
"public class Main {\n\tpublic static void main(String[] args) throws IOException {\n\t\tBufferedReader in = new BufferedReader(new InputStreamReader(System.in));\n\t\tStackControler readDataArr = new StackControler(in.readLine()\n\t\t\t\t.split(\" \"));\n\t\tSystem.out.println(readDataArr.calcData());\n\t}\n}",
"Main",
"public static void main(String[] args) throws IOException {\n\t\tBufferedReader in = new BufferedReader(new InputStreamReader(System.in));\n\t\tStackControler readDataArr = new StackControler(in.readLine()\n\t\t\t\t.split(\" \"));\n\t\tSystem.out.println(readDataArr.calcData());\n\t}",
"main",
"{\n\t\tBufferedReader in = new BufferedReader(new InputStreamReader(System.in));\n\t\tStackControler readDataArr = new StackControler(in.readLine()\n\t\t\t\t.split(\" \"));\n\t\tSystem.out.println(readDataArr.calcData());\n\t}",
"BufferedReader in = new BufferedReader(new InputStreamReader(System.in));",
"in",
"new BufferedReader(new InputStreamReader(System.in))",
"StackControler readDataArr = new StackControler(in.readLine()\n\t\t\t\t.split(\" \"));",
"readDataArr",
"new StackControler(in.readLine()\n\t\t\t\t.split(\" \"))",
"System.out.println(readDataArr.calcData())",
"System.out.println",
"System.out",
"System",
"System.out",
"readDataArr.calcData()",
"readDataArr.calcData",
"readDataArr",
"String[] args",
"args",
"class Stack {\n\tprivate int[] stack;\n\tprivate static int pointer = 0;\n\n\tStack(int[] stack) {\n\t\tthis.stack = stack;\n\t}\n\n\tpublic void push(int data) {\n\t\tstack[pointer] = data;\n\t\tpointer++;\n\t}\n\n\tpublic int pop() {\n\t\tpointer--;\n\t\treturn stack[pointer];\n\t}\n\n}",
"Stack",
"private int[] stack;",
"stack",
"private static int pointer = 0;",
"pointer",
"0",
"Stack(int[] stack) {\n\t\tthis.stack = stack;\n\t}",
"Stack",
"{\n\t\tthis.stack = stack;\n\t}",
"this.stack = stack",
"this.stack",
"this",
"this.stack",
"stack",
"int[] stack",
"stack",
"public void push(int data) {\n\t\tstack[pointer] = data;\n\t\tpointer++;\n\t}",
"push",
"{\n\t\tstack[pointer] = data;\n\t\tpointer++;\n\t}",
"stack[pointer] = data",
"stack[pointer]",
"stack",
"pointer",
"data",
"pointer++",
"pointer",
"int data",
"data",
"public int pop() {\n\t\tpointer--;\n\t\treturn stack[pointer];\n\t}",
"pop",
"{\n\t\tpointer--;\n\t\treturn stack[pointer];\n\t}",
"pointer--",
"pointer",
"return stack[pointer];",
"stack[pointer]",
"stack",
"pointer",
"class StackControler {\n\tprivate Stack stack;\n\tprivate String[] readData;\n\tprivate int operand2, operand1, result, strToIntData;\n\n\tStackControler(String[] readData) {\n\t\tthis.readData = readData;\n\t}\n\n\tpublic int calcData() {\n\t\tString tempStrData;\n\t\tstack = new Stack(new int[100]);\n\t\tfor (int i = 0; i < readData.length; i++) {\n\t\t\ttempStrData = readData[i];\n\n\t\t\tif (tempStrData.equals(\"+\")) {\n\t\t\t\toperand1 = stack.pop();\n\t\t\t\toperand2 = stack.pop();\n\t\t\t\tresult = operand2 + operand1;\n\t\t\t\tstack.push(result);\n\t\t\t} else if (tempStrData.equals(\"-\")) {\n\t\t\t\toperand1 = stack.pop();\n\t\t\t\toperand2 = stack.pop();\n\t\t\t\tresult = operand2 - operand1;\n\t\t\t\tstack.push(result);\n\t\t\t} else if (tempStrData.equals(\"*\")) {\n\t\t\t\toperand1 = stack.pop();\n\t\t\t\toperand2 = stack.pop();\n\t\t\t\tresult = operand2 * operand1;\n\t\t\t\tstack.push(result);\n\t\t\t} else {\n\t\t\t\tstrToIntData = Integer.parseInt(readData[i]);\n\t\t\t\tstack.push(strToIntData);\n\t\t\t}\n\t\t}\n\t\treturn stack.pop();\n\t}\n}",
"StackControler",
"private Stack stack;",
"stack",
"private String[] readData;",
"readData",
"private int operand2",
"operand2",
"operand1",
"operand1",
"result",
"result",
"strToIntData;",
"strToIntData",
"StackControler(String[] readData) {\n\t\tthis.readData = readData;\n\t}",
"StackControler",
"{\n\t\tthis.readData = readData;\n\t}",
"this.readData = readData",
"this.readData",
"this",
"this.readData",
"readData",
"String[] readData",
"readData",
"public int calcData() {\n\t\tString tempStrData;\n\t\tstack = new Stack(new int[100]);\n\t\tfor (int i = 0; i < readData.length; i++) {\n\t\t\ttempStrData = readData[i];\n\n\t\t\tif (tempStrData.equals(\"+\")) {\n\t\t\t\toperand1 = stack.pop();\n\t\t\t\toperand2 = stack.pop();\n\t\t\t\tresult = operand2 + operand1;\n\t\t\t\tstack.push(result);\n\t\t\t} else if (tempStrData.equals(\"-\")) {\n\t\t\t\toperand1 = stack.pop();\n\t\t\t\toperand2 = stack.pop();\n\t\t\t\tresult = operand2 - operand1;\n\t\t\t\tstack.push(result);\n\t\t\t} else if (tempStrData.equals(\"*\")) {\n\t\t\t\toperand1 = stack.pop();\n\t\t\t\toperand2 = stack.pop();\n\t\t\t\tresult = operand2 * operand1;\n\t\t\t\tstack.push(result);\n\t\t\t} else {\n\t\t\t\tstrToIntData = Integer.parseInt(readData[i]);\n\t\t\t\tstack.push(strToIntData);\n\t\t\t}\n\t\t}\n\t\treturn stack.pop();\n\t}",
"calcData",
"{\n\t\tString tempStrData;\n\t\tstack = new Stack(new int[100]);\n\t\tfor (int i = 0; i < readData.length; i++) {\n\t\t\ttempStrData = readData[i];\n\n\t\t\tif (tempStrData.equals(\"+\")) {\n\t\t\t\toperand1 = stack.pop();\n\t\t\t\toperand2 = stack.pop();\n\t\t\t\tresult = operand2 + operand1;\n\t\t\t\tstack.push(result);\n\t\t\t} else if (tempStrData.equals(\"-\")) {\n\t\t\t\toperand1 = stack.pop();\n\t\t\t\toperand2 = stack.pop();\n\t\t\t\tresult = operand2 - operand1;\n\t\t\t\tstack.push(result);\n\t\t\t} else if (tempStrData.equals(\"*\")) {\n\t\t\t\toperand1 = stack.pop();\n\t\t\t\toperand2 = stack.pop();\n\t\t\t\tresult = operand2 * operand1;\n\t\t\t\tstack.push(result);\n\t\t\t} else {\n\t\t\t\tstrToIntData = Integer.parseInt(readData[i]);\n\t\t\t\tstack.push(strToIntData);\n\t\t\t}\n\t\t}\n\t\treturn stack.pop();\n\t}",
"String tempStrData;",
"tempStrData",
"stack = new Stack(new int[100])",
"stack",
"new Stack(new int[100])",
"for (int i = 0; i < readData.length; i++) {\n\t\t\ttempStrData = readData[i];\n\n\t\t\tif (tempStrData.equals(\"+\")) {\n\t\t\t\toperand1 = stack.pop();\n\t\t\t\toperand2 = stack.pop();\n\t\t\t\tresult = operand2 + operand1;\n\t\t\t\tstack.push(result);\n\t\t\t} else if (tempStrData.equals(\"-\")) {\n\t\t\t\toperand1 = stack.pop();\n\t\t\t\toperand2 = stack.pop();\n\t\t\t\tresult = operand2 - operand1;\n\t\t\t\tstack.push(result);\n\t\t\t} else if (tempStrData.equals(\"*\")) {\n\t\t\t\toperand1 = stack.pop();\n\t\t\t\toperand2 = stack.pop();\n\t\t\t\tresult = operand2 * operand1;\n\t\t\t\tstack.push(result);\n\t\t\t} else {\n\t\t\t\tstrToIntData = Integer.parseInt(readData[i]);\n\t\t\t\tstack.push(strToIntData);\n\t\t\t}\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < readData.length",
"i",
"readData.length",
"readData",
"readData.length",
"i++",
"i++",
"i",
"{\n\t\t\ttempStrData = readData[i];\n\n\t\t\tif (tempStrData.equals(\"+\")) {\n\t\t\t\toperand1 = stack.pop();\n\t\t\t\toperand2 = stack.pop();\n\t\t\t\tresult = operand2 + operand1;\n\t\t\t\tstack.push(result);\n\t\t\t} else if (tempStrData.equals(\"-\")) {\n\t\t\t\toperand1 = stack.pop();\n\t\t\t\toperand2 = stack.pop();\n\t\t\t\tresult = operand2 - operand1;\n\t\t\t\tstack.push(result);\n\t\t\t} else if (tempStrData.equals(\"*\")) {\n\t\t\t\toperand1 = stack.pop();\n\t\t\t\toperand2 = stack.pop();\n\t\t\t\tresult = operand2 * operand1;\n\t\t\t\tstack.push(result);\n\t\t\t} else {\n\t\t\t\tstrToIntData = Integer.parseInt(readData[i]);\n\t\t\t\tstack.push(strToIntData);\n\t\t\t}\n\t\t}",
"{\n\t\t\ttempStrData = readData[i];\n\n\t\t\tif (tempStrData.equals(\"+\")) {\n\t\t\t\toperand1 = stack.pop();\n\t\t\t\toperand2 = stack.pop();\n\t\t\t\tresult = operand2 + operand1;\n\t\t\t\tstack.push(result);\n\t\t\t} else if (tempStrData.equals(\"-\")) {\n\t\t\t\toperand1 = stack.pop();\n\t\t\t\toperand2 = stack.pop();\n\t\t\t\tresult = operand2 - operand1;\n\t\t\t\tstack.push(result);\n\t\t\t} else if (tempStrData.equals(\"*\")) {\n\t\t\t\toperand1 = stack.pop();\n\t\t\t\toperand2 = stack.pop();\n\t\t\t\tresult = operand2 * operand1;\n\t\t\t\tstack.push(result);\n\t\t\t} else {\n\t\t\t\tstrToIntData = Integer.parseInt(readData[i]);\n\t\t\t\tstack.push(strToIntData);\n\t\t\t}\n\t\t}",
"tempStrData = readData[i]",
"tempStrData",
"readData[i]",
"readData",
"i",
"if (tempStrData.equals(\"+\")) {\n\t\t\t\toperand1 = stack.pop();\n\t\t\t\toperand2 = stack.pop();\n\t\t\t\tresult = operand2 + operand1;\n\t\t\t\tstack.push(result);\n\t\t\t} else if (tempStrData.equals(\"-\")) {\n\t\t\t\toperand1 = stack.pop();\n\t\t\t\toperand2 = stack.pop();\n\t\t\t\tresult = operand2 - operand1;\n\t\t\t\tstack.push(result);\n\t\t\t} else if (tempStrData.equals(\"*\")) {\n\t\t\t\toperand1 = stack.pop();\n\t\t\t\toperand2 = stack.pop();\n\t\t\t\tresult = operand2 * operand1;\n\t\t\t\tstack.push(result);\n\t\t\t} else {\n\t\t\t\tstrToIntData = Integer.parseInt(readData[i]);\n\t\t\t\tstack.push(strToIntData);\n\t\t\t}",
"tempStrData.equals(\"+\")",
"tempStrData.equals",
"tempStrData",
"\"+\"",
"{\n\t\t\t\toperand1 = stack.pop();\n\t\t\t\toperand2 = stack.pop();\n\t\t\t\tresult = operand2 + operand1;\n\t\t\t\tstack.push(result);\n\t\t\t}",
"operand1 = stack.pop()",
"operand1",
"stack.pop()",
"stack.pop",
"stack",
"operand2 = stack.pop()",
"operand2",
"stack.pop()",
"stack.pop",
"stack",
"result = operand2 + operand1",
"result",
"operand2 + operand1",
"operand2",
"operand1",
"stack.push(result)",
"stack.push",
"stack",
"result",
"if (tempStrData.equals(\"-\")) {\n\t\t\t\toperand1 = stack.pop();\n\t\t\t\toperand2 = stack.pop();\n\t\t\t\tresult = operand2 - operand1;\n\t\t\t\tstack.push(result);\n\t\t\t} else if (tempStrData.equals(\"*\")) {\n\t\t\t\toperand1 = stack.pop();\n\t\t\t\toperand2 = stack.pop();\n\t\t\t\tresult = operand2 * operand1;\n\t\t\t\tstack.push(result);\n\t\t\t} else {\n\t\t\t\tstrToIntData = Integer.parseInt(readData[i]);\n\t\t\t\tstack.push(strToIntData);\n\t\t\t}",
"tempStrData.equals(\"-\")",
"tempStrData.equals",
"tempStrData",
"\"-\"",
"{\n\t\t\t\toperand1 = stack.pop();\n\t\t\t\toperand2 = stack.pop();\n\t\t\t\tresult = operand2 - operand1;\n\t\t\t\tstack.push(result);\n\t\t\t}",
"operand1 = stack.pop()",
"operand1",
"stack.pop()",
"stack.pop",
"stack",
"operand2 = stack.pop()",
"operand2",
"stack.pop()",
"stack.pop",
"stack",
"result = operand2 - operand1",
"result",
"operand2 - operand1",
"operand2",
"operand1",
"stack.push(result)",
"stack.push",
"stack",
"result",
"if (tempStrData.equals(\"*\")) {\n\t\t\t\toperand1 = stack.pop();\n\t\t\t\toperand2 = stack.pop();\n\t\t\t\tresult = operand2 * operand1;\n\t\t\t\tstack.push(result);\n\t\t\t} else {\n\t\t\t\tstrToIntData = Integer.parseInt(readData[i]);\n\t\t\t\tstack.push(strToIntData);\n\t\t\t}",
"tempStrData.equals(\"*\")",
"tempStrData.equals",
"tempStrData",
"\"*\"",
"{\n\t\t\t\toperand1 = stack.pop();\n\t\t\t\toperand2 = stack.pop();\n\t\t\t\tresult = operand2 * operand1;\n\t\t\t\tstack.push(result);\n\t\t\t}",
"operand1 = stack.pop()",
"operand1",
"stack.pop()",
"stack.pop",
"stack",
"operand2 = stack.pop()",
"operand2",
"stack.pop()",
"stack.pop",
"stack",
"result = operand2 * operand1",
"result",
"operand2 * operand1",
"operand2",
"operand1",
"stack.push(result)",
"stack.push",
"stack",
"result",
"{\n\t\t\t\tstrToIntData = Integer.parseInt(readData[i]);\n\t\t\t\tstack.push(strToIntData);\n\t\t\t}",
"strToIntData = Integer.parseInt(readData[i])",
"strToIntData",
"Integer.parseInt(readData[i])",
"Integer.parseInt",
"Integer",
"readData[i]",
"readData",
"i",
"stack.push(strToIntData)",
"stack.push",
"stack",
"strToIntData",
"return stack.pop();",
"stack.pop()",
"stack.pop",
"stack",
"public class Main {\n\tpublic static void main(String[] args) throws IOException {\n\t\tBufferedReader in = new BufferedReader(new InputStreamReader(System.in));\n\t\tStackControler readDataArr = new StackControler(in.readLine()\n\t\t\t\t.split(\" \"));\n\t\tSystem.out.println(readDataArr.calcData());\n\t}\n}",
"public class Main {\n\tpublic static void main(String[] args) throws IOException {\n\t\tBufferedReader in = new BufferedReader(new InputStreamReader(System.in));\n\t\tStackControler readDataArr = new StackControler(in.readLine()\n\t\t\t\t.split(\" \"));\n\t\tSystem.out.println(readDataArr.calcData());\n\t}\n}",
"Main"
] | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
StackControler readDataArr = new StackControler(in.readLine()
.split(" "));
System.out.println(readDataArr.calcData());
}
}
class Stack {
private int[] stack;
private static int pointer = 0;
Stack(int[] stack) {
this.stack = stack;
}
public void push(int data) {
stack[pointer] = data;
pointer++;
}
public int pop() {
pointer--;
return stack[pointer];
}
}
class StackControler {
private Stack stack;
private String[] readData;
private int operand2, operand1, result, strToIntData;
StackControler(String[] readData) {
this.readData = readData;
}
public int calcData() {
String tempStrData;
stack = new Stack(new int[100]);
for (int i = 0; i < readData.length; i++) {
tempStrData = readData[i];
if (tempStrData.equals("+")) {
operand1 = stack.pop();
operand2 = stack.pop();
result = operand2 + operand1;
stack.push(result);
} else if (tempStrData.equals("-")) {
operand1 = stack.pop();
operand2 = stack.pop();
result = operand2 - operand1;
stack.push(result);
} else if (tempStrData.equals("*")) {
operand1 = stack.pop();
operand2 = stack.pop();
result = operand2 * operand1;
stack.push(result);
} else {
strToIntData = Integer.parseInt(readData[i]);
stack.push(strToIntData);
}
}
return stack.pop();
}
} |
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
20,
28,
13,
4,
18,
4,
18,
13,
17,
30,
30,
14,
4,
18,
17,
13,
30,
4,
18,
13,
2,
4,
18,
13,
4,
18,
13,
14,
4,
18,
17,
13,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
4,
18,
13,
2,
13,
13,
14,
4,
18,
17,
13,
30,
4,
18,
13,
2,
4,
18,
13,
4,
18,
13,
30,
4,
18,
13,
4,
18,
13,
13,
4,
18,
18,
13,
13,
4,
18,
13,
23,
13,
6,
13,
41,
13,
12,
13,
30,
0,
13,
20,
23,
13,
12,
13,
30,
41,
13,
18,
13,
13,
0,
13,
18,
13,
13,
29,
13,
6,
13,
41,
13,
41,
13,
12,
13,
30,
0,
18,
36,
13,
13,
0,
18,
36,
13,
13,
23,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
154,
11
],
[
154,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
15,
17
],
[
14,
18
],
[
18,
19
],
[
18,
20
],
[
14,
21
],
[
21,
22
],
[
21,
23
],
[
23,
24
],
[
24,
25
],
[
25,
26
],
[
26,
27
],
[
23,
28
],
[
21,
29
],
[
30,
30
],
[
30,
31
],
[
31,
32
],
[
32,
33
],
[
33,
34
],
[
32,
35
],
[
31,
36
],
[
36,
37
],
[
37,
38
],
[
38,
39
],
[
37,
40
],
[
40,
41
],
[
41,
42
],
[
42,
43
],
[
40,
44
],
[
44,
45
],
[
45,
46
],
[
31,
47
],
[
47,
48
],
[
48,
49
],
[
49,
50
],
[
48,
51
],
[
47,
52
],
[
52,
53
],
[
53,
54
],
[
53,
55
],
[
55,
56
],
[
56,
57
],
[
52,
58
],
[
58,
59
],
[
58,
60
],
[
60,
61
],
[
61,
62
],
[
52,
63
],
[
63,
64
],
[
64,
65
],
[
63,
66
],
[
66,
67
],
[
66,
68
],
[
47,
69
],
[
69,
70
],
[
70,
71
],
[
71,
72
],
[
70,
73
],
[
69,
74
],
[
74,
75
],
[
75,
76
],
[
76,
77
],
[
75,
78
],
[
78,
79
],
[
79,
80
],
[
80,
81
],
[
78,
82
],
[
82,
83
],
[
83,
84
],
[
69,
85
],
[
85,
86
],
[
86,
87
],
[
87,
88
],
[
86,
89
],
[
89,
90
],
[
90,
91
],
[
89,
92
],
[
14,
93
],
[
93,
94
],
[
94,
95
],
[
95,
96
],
[
95,
97
],
[
93,
98
],
[
98,
99
],
[
99,
100
],
[
12,
101
],
[
101,
102
],
[
154,
103
],
[
103,
104
],
[
103,
105
],
[
105,
106
],
[
103,
107
],
[
107,
108
],
[
107,
109
],
[
109,
110
],
[
110,
111
],
[
110,
112
],
[
107,
113
],
[
113,
114
],
[
103,
115
],
[
115,
116
],
[
115,
117
],
[
117,
118
],
[
118,
119
],
[
118,
120
],
[
120,
121
],
[
120,
122
],
[
117,
123
],
[
123,
124
],
[
123,
125
],
[
125,
126
],
[
125,
127
],
[
117,
128
],
[
128,
129
],
[
103,
130
],
[
130,
131
],
[
130,
132
],
[
132,
133
],
[
130,
134
],
[
134,
135
],
[
130,
136
],
[
136,
137
],
[
136,
138
],
[
138,
139
],
[
139,
140
],
[
140,
141
],
[
140,
142
],
[
139,
143
],
[
138,
144
],
[
144,
145
],
[
145,
146
],
[
145,
147
],
[
144,
148
],
[
136,
149
],
[
149,
150
],
[
136,
151
],
[
151,
152
],
[
0,
153
],
[
153,
154
],
[
153,
155
]
] | [
"import java.util.ArrayList;\nimport java.util.List;\nimport java.util.Scanner;\n\npublic class Main {\n public static void main(String[] args) {\n Scanner scanner = new Scanner(System.in);\n Stack stack = new Stack();\n for (String s : scanner.nextLine().split(\" \")) {\n if (\"+\".equals(s)) {\n stack.push(stack.pop() + stack.pop());\n } else if (\"-\".equals(s)) {\n int i1 = stack.pop();\n int i2 = stack.pop();\n stack.push(i2 - i1);\n } else if (\"*\".equals(s)) {\n stack.push(stack.pop() * stack.pop());\n } else {\n stack.push(Integer.parseInt(s));\n }\n }\n System.out.println(stack.pop());\n }\n\n private static class Stack {\n private static class Node {\n int i;\n Node next;\n\n public Node(int i, Node next) {\n this.i = i;\n this.next = next;\n }\n }\n\n Node top;\n\n public void push(int i) {\n top = new Node(i, top);\n }\n\n public int pop() {\n int i = top.i;\n top = top.next;\n return i;\n }\n }\n}",
"import java.util.ArrayList;",
"ArrayList",
"java.util",
"import java.util.List;",
"List",
"java.util",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n public static void main(String[] args) {\n Scanner scanner = new Scanner(System.in);\n Stack stack = new Stack();\n for (String s : scanner.nextLine().split(\" \")) {\n if (\"+\".equals(s)) {\n stack.push(stack.pop() + stack.pop());\n } else if (\"-\".equals(s)) {\n int i1 = stack.pop();\n int i2 = stack.pop();\n stack.push(i2 - i1);\n } else if (\"*\".equals(s)) {\n stack.push(stack.pop() * stack.pop());\n } else {\n stack.push(Integer.parseInt(s));\n }\n }\n System.out.println(stack.pop());\n }\n\n private static class Stack {\n private static class Node {\n int i;\n Node next;\n\n public Node(int i, Node next) {\n this.i = i;\n this.next = next;\n }\n }\n\n Node top;\n\n public void push(int i) {\n top = new Node(i, top);\n }\n\n public int pop() {\n int i = top.i;\n top = top.next;\n return i;\n }\n }\n}",
"Main",
"public static void main(String[] args) {\n Scanner scanner = new Scanner(System.in);\n Stack stack = new Stack();\n for (String s : scanner.nextLine().split(\" \")) {\n if (\"+\".equals(s)) {\n stack.push(stack.pop() + stack.pop());\n } else if (\"-\".equals(s)) {\n int i1 = stack.pop();\n int i2 = stack.pop();\n stack.push(i2 - i1);\n } else if (\"*\".equals(s)) {\n stack.push(stack.pop() * stack.pop());\n } else {\n stack.push(Integer.parseInt(s));\n }\n }\n System.out.println(stack.pop());\n }",
"main",
"{\n Scanner scanner = new Scanner(System.in);\n Stack stack = new Stack();\n for (String s : scanner.nextLine().split(\" \")) {\n if (\"+\".equals(s)) {\n stack.push(stack.pop() + stack.pop());\n } else if (\"-\".equals(s)) {\n int i1 = stack.pop();\n int i2 = stack.pop();\n stack.push(i2 - i1);\n } else if (\"*\".equals(s)) {\n stack.push(stack.pop() * stack.pop());\n } else {\n stack.push(Integer.parseInt(s));\n }\n }\n System.out.println(stack.pop());\n }",
"Scanner scanner = new Scanner(System.in);",
"scanner",
"new Scanner(System.in)",
"Stack stack = new Stack();",
"stack",
"new Stack()",
"for (String s : scanner.nextLine().split(\" \")) {\n if (\"+\".equals(s)) {\n stack.push(stack.pop() + stack.pop());\n } else if (\"-\".equals(s)) {\n int i1 = stack.pop();\n int i2 = stack.pop();\n stack.push(i2 - i1);\n } else if (\"*\".equals(s)) {\n stack.push(stack.pop() * stack.pop());\n } else {\n stack.push(Integer.parseInt(s));\n }\n }",
"String s",
"scanner.nextLine().split(\" \")",
"scanner.nextLine().split",
"scanner.nextLine()",
"scanner.nextLine",
"scanner",
"\" \"",
"{\n if (\"+\".equals(s)) {\n stack.push(stack.pop() + stack.pop());\n } else if (\"-\".equals(s)) {\n int i1 = stack.pop();\n int i2 = stack.pop();\n stack.push(i2 - i1);\n } else if (\"*\".equals(s)) {\n stack.push(stack.pop() * stack.pop());\n } else {\n stack.push(Integer.parseInt(s));\n }\n }",
"{\n if (\"+\".equals(s)) {\n stack.push(stack.pop() + stack.pop());\n } else if (\"-\".equals(s)) {\n int i1 = stack.pop();\n int i2 = stack.pop();\n stack.push(i2 - i1);\n } else if (\"*\".equals(s)) {\n stack.push(stack.pop() * stack.pop());\n } else {\n stack.push(Integer.parseInt(s));\n }\n }",
"if (\"+\".equals(s)) {\n stack.push(stack.pop() + stack.pop());\n } else if (\"-\".equals(s)) {\n int i1 = stack.pop();\n int i2 = stack.pop();\n stack.push(i2 - i1);\n } else if (\"*\".equals(s)) {\n stack.push(stack.pop() * stack.pop());\n } else {\n stack.push(Integer.parseInt(s));\n }",
"\"+\".equals(s)",
"\"+\".equals",
"\"+\"",
"s",
"{\n stack.push(stack.pop() + stack.pop());\n }",
"stack.push(stack.pop() + stack.pop())",
"stack.push",
"stack",
"stack.pop() + stack.pop()",
"stack.pop()",
"stack.pop",
"stack",
"stack.pop()",
"stack.pop",
"stack",
"if (\"-\".equals(s)) {\n int i1 = stack.pop();\n int i2 = stack.pop();\n stack.push(i2 - i1);\n } else if (\"*\".equals(s)) {\n stack.push(stack.pop() * stack.pop());\n } else {\n stack.push(Integer.parseInt(s));\n }",
"\"-\".equals(s)",
"\"-\".equals",
"\"-\"",
"s",
"{\n int i1 = stack.pop();\n int i2 = stack.pop();\n stack.push(i2 - i1);\n }",
"int i1 = stack.pop();",
"i1",
"stack.pop()",
"stack.pop",
"stack",
"int i2 = stack.pop();",
"i2",
"stack.pop()",
"stack.pop",
"stack",
"stack.push(i2 - i1)",
"stack.push",
"stack",
"i2 - i1",
"i2",
"i1",
"if (\"*\".equals(s)) {\n stack.push(stack.pop() * stack.pop());\n } else {\n stack.push(Integer.parseInt(s));\n }",
"\"*\".equals(s)",
"\"*\".equals",
"\"*\"",
"s",
"{\n stack.push(stack.pop() * stack.pop());\n }",
"stack.push(stack.pop() * stack.pop())",
"stack.push",
"stack",
"stack.pop() * stack.pop()",
"stack.pop()",
"stack.pop",
"stack",
"stack.pop()",
"stack.pop",
"stack",
"{\n stack.push(Integer.parseInt(s));\n }",
"stack.push(Integer.parseInt(s))",
"stack.push",
"stack",
"Integer.parseInt(s)",
"Integer.parseInt",
"Integer",
"s",
"System.out.println(stack.pop())",
"System.out.println",
"System.out",
"System",
"System.out",
"stack.pop()",
"stack.pop",
"stack",
"String[] args",
"args",
"private static class Stack {\n private static class Node {\n int i;\n Node next;\n\n public Node(int i, Node next) {\n this.i = i;\n this.next = next;\n }\n }\n\n Node top;\n\n public void push(int i) {\n top = new Node(i, top);\n }\n\n public int pop() {\n int i = top.i;\n top = top.next;\n return i;\n }\n }",
"Stack",
"Node top;",
"top",
"public void push(int i) {\n top = new Node(i, top);\n }",
"push",
"{\n top = new Node(i, top);\n }",
"top = new Node(i, top)",
"top",
"new Node(i, top)",
"int i",
"i",
"public int pop() {\n int i = top.i;\n top = top.next;\n return i;\n }",
"pop",
"{\n int i = top.i;\n top = top.next;\n return i;\n }",
"int i = top.i;",
"i",
"top.i",
"top",
"top.i",
"top = top.next",
"top",
"top.next",
"top",
"top.next",
"return i;",
"i",
"private static class Node {\n int i;\n Node next;\n\n public Node(int i, Node next) {\n this.i = i;\n this.next = next;\n }\n }",
"Node",
"int i;",
"i",
"Node next;",
"next",
"public Node(int i, Node next) {\n this.i = i;\n this.next = next;\n }",
"Node",
"{\n this.i = i;\n this.next = next;\n }",
"this.i = i",
"this.i",
"this",
"this.i",
"i",
"this.next = next",
"this.next",
"this",
"this.next",
"next",
"int i",
"i",
"Node next",
"next",
"public class Main {\n public static void main(String[] args) {\n Scanner scanner = new Scanner(System.in);\n Stack stack = new Stack();\n for (String s : scanner.nextLine().split(\" \")) {\n if (\"+\".equals(s)) {\n stack.push(stack.pop() + stack.pop());\n } else if (\"-\".equals(s)) {\n int i1 = stack.pop();\n int i2 = stack.pop();\n stack.push(i2 - i1);\n } else if (\"*\".equals(s)) {\n stack.push(stack.pop() * stack.pop());\n } else {\n stack.push(Integer.parseInt(s));\n }\n }\n System.out.println(stack.pop());\n }\n\n private static class Stack {\n private static class Node {\n int i;\n Node next;\n\n public Node(int i, Node next) {\n this.i = i;\n this.next = next;\n }\n }\n\n Node top;\n\n public void push(int i) {\n top = new Node(i, top);\n }\n\n public int pop() {\n int i = top.i;\n top = top.next;\n return i;\n }\n }\n}",
"public class Main {\n public static void main(String[] args) {\n Scanner scanner = new Scanner(System.in);\n Stack stack = new Stack();\n for (String s : scanner.nextLine().split(\" \")) {\n if (\"+\".equals(s)) {\n stack.push(stack.pop() + stack.pop());\n } else if (\"-\".equals(s)) {\n int i1 = stack.pop();\n int i2 = stack.pop();\n stack.push(i2 - i1);\n } else if (\"*\".equals(s)) {\n stack.push(stack.pop() * stack.pop());\n } else {\n stack.push(Integer.parseInt(s));\n }\n }\n System.out.println(stack.pop());\n }\n\n private static class Stack {\n private static class Node {\n int i;\n Node next;\n\n public Node(int i, Node next) {\n this.i = i;\n this.next = next;\n }\n }\n\n Node top;\n\n public void push(int i) {\n top = new Node(i, top);\n }\n\n public int pop() {\n int i = top.i;\n top = top.next;\n return i;\n }\n }\n}",
"Main"
] | import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
Stack stack = new Stack();
for (String s : scanner.nextLine().split(" ")) {
if ("+".equals(s)) {
stack.push(stack.pop() + stack.pop());
} else if ("-".equals(s)) {
int i1 = stack.pop();
int i2 = stack.pop();
stack.push(i2 - i1);
} else if ("*".equals(s)) {
stack.push(stack.pop() * stack.pop());
} else {
stack.push(Integer.parseInt(s));
}
}
System.out.println(stack.pop());
}
private static class Stack {
private static class Node {
int i;
Node next;
public Node(int i, Node next) {
this.i = i;
this.next = next;
}
}
Node top;
public void push(int i) {
top = new Node(i, top);
}
public int pop() {
int i = top.i;
top = top.next;
return i;
}
}
} |
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
12,
13,
30,
41,
13,
20,
4,
18,
13,
23,
13,
12,
13,
30,
41,
13,
17,
38,
5,
13,
30,
4,
18,
13,
30,
14,
2,
13,
17,
30,
38,
5,
13,
30,
4,
18,
13,
30,
4,
18,
13,
30,
0,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
17,
41,
13,
20,
28,
13,
13,
30,
30,
14,
4,
18,
17,
13,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
4,
18,
13,
2,
13,
13,
14,
4,
18,
17,
13,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
4,
18,
13,
2,
13,
13,
14,
4,
18,
17,
13,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
4,
18,
13,
2,
13,
13,
30,
4,
18,
13,
4,
18,
13,
13,
4,
18,
18,
13,
13,
4,
18,
13,
6,
13,
41,
13,
17,
41,
13,
20,
13,
41,
13,
17,
12,
13,
30,
12,
13,
30,
14,
4,
13,
30,
37,
20,
40,
13,
0,
18,
13,
13,
13,
23,
13,
12,
13,
30,
14,
4,
13,
30,
37,
20,
40,
13,
29,
18,
13,
2,
13,
17,
12,
13,
30,
29,
2,
13,
17,
12,
13,
30,
29,
2,
13,
17,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
226,
11
],
[
226,
12
],
[
12,
13
],
[
12,
14
],
[
226,
15
],
[
15,
16
],
[
15,
17
],
[
17,
18
],
[
18,
19
],
[
18,
20
],
[
17,
21
],
[
21,
22
],
[
22,
23
],
[
15,
24
],
[
24,
25
],
[
226,
26
],
[
26,
27
],
[
26,
28
],
[
28,
29
],
[
29,
30
],
[
29,
31
],
[
28,
32
],
[
32,
33
],
[
33,
34
],
[
33,
35
],
[
35,
36
],
[
36,
37
],
[
37,
38
],
[
32,
39
],
[
39,
40
],
[
40,
41
],
[
41,
42
],
[
41,
43
],
[
40,
44
],
[
44,
45
],
[
45,
46
],
[
46,
47
],
[
46,
48
],
[
48,
49
],
[
49,
50
],
[
50,
51
],
[
45,
52
],
[
52,
53
],
[
53,
54
],
[
54,
55
],
[
32,
56
],
[
56,
57
],
[
57,
58
],
[
57,
59
],
[
56,
60
],
[
60,
61
],
[
60,
62
],
[
62,
63
],
[
63,
64
],
[
56,
65
],
[
65,
66
],
[
65,
67
],
[
67,
68
],
[
68,
69
],
[
67,
70
],
[
56,
71
],
[
71,
72
],
[
71,
73
],
[
56,
74
],
[
74,
75
],
[
74,
76
],
[
74,
77
],
[
78,
78
],
[
78,
79
],
[
79,
80
],
[
80,
81
],
[
81,
82
],
[
80,
83
],
[
79,
84
],
[
84,
85
],
[
85,
86
],
[
85,
87
],
[
87,
88
],
[
88,
89
],
[
84,
90
],
[
90,
91
],
[
90,
92
],
[
92,
93
],
[
93,
94
],
[
84,
95
],
[
95,
96
],
[
96,
97
],
[
95,
98
],
[
98,
99
],
[
98,
100
],
[
79,
101
],
[
101,
102
],
[
102,
103
],
[
103,
104
],
[
102,
105
],
[
101,
106
],
[
106,
107
],
[
107,
108
],
[
107,
109
],
[
109,
110
],
[
110,
111
],
[
106,
112
],
[
112,
113
],
[
112,
114
],
[
114,
115
],
[
115,
116
],
[
106,
117
],
[
117,
118
],
[
118,
119
],
[
117,
120
],
[
120,
121
],
[
120,
122
],
[
101,
123
],
[
123,
124
],
[
124,
125
],
[
125,
126
],
[
124,
127
],
[
123,
128
],
[
128,
129
],
[
129,
130
],
[
129,
131
],
[
131,
132
],
[
132,
133
],
[
128,
134
],
[
134,
135
],
[
134,
136
],
[
136,
137
],
[
137,
138
],
[
128,
139
],
[
139,
140
],
[
140,
141
],
[
139,
142
],
[
142,
143
],
[
142,
144
],
[
123,
145
],
[
145,
146
],
[
146,
147
],
[
147,
148
],
[
146,
149
],
[
149,
150
],
[
150,
151
],
[
149,
152
],
[
56,
153
],
[
153,
154
],
[
154,
155
],
[
155,
156
],
[
155,
157
],
[
153,
158
],
[
158,
159
],
[
159,
160
],
[
226,
161
],
[
161,
162
],
[
161,
163
],
[
163,
164
],
[
163,
165
],
[
161,
166
],
[
166,
167
],
[
166,
168
],
[
161,
170
],
[
170,
171
],
[
170,
172
],
[
161,
173
],
[
173,
174
],
[
173,
175
],
[
161,
176
],
[
176,
177
],
[
176,
178
],
[
178,
179
],
[
179,
180
],
[
180,
181
],
[
179,
182
],
[
182,
183
],
[
183,
184
],
[
178,
185
],
[
185,
186
],
[
178,
187
],
[
187,
188
],
[
188,
189
],
[
188,
190
],
[
187,
191
],
[
176,
192
],
[
192,
193
],
[
161,
194
],
[
194,
195
],
[
194,
196
],
[
196,
197
],
[
197,
198
],
[
198,
199
],
[
197,
200
],
[
200,
201
],
[
201,
202
],
[
196,
203
],
[
203,
204
],
[
196,
205
],
[
205,
206
],
[
206,
207
],
[
206,
208
],
[
208,
209
],
[
208,
210
],
[
161,
211
],
[
211,
212
],
[
211,
213
],
[
213,
214
],
[
214,
215
],
[
215,
216
],
[
215,
217
],
[
161,
218
],
[
218,
219
],
[
218,
220
],
[
220,
221
],
[
221,
222
],
[
222,
223
],
[
222,
224
],
[
0,
225
],
[
225,
226
],
[
225,
227
]
] | [
"import java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\n\npublic class Main {\n public Main() {\n }\n\n public static void main(String[] args ) {\n \t\tMain main = new Main();\n \t\tmain.exec();\n }\n\n public void exec() {\n BufferedReader bf = null;\n try{\n bf = new BufferedReader(new InputStreamReader(System.in));\n String line = bf.readLine();\n String[] values = line.split(\" \");\n\n MyStack mys = new MyStack();\n for( String value : values ) {\n if( \"+\".equals(value)) {\n int right = mys.pop();\n int left = mys.pop();\n mys.push(left+right);\n } else if ( \"-\".equals(value) ) {\n int right = mys.pop();\n int left = mys.pop();\n mys.push(left-right);\n } else if ( \"*\".equals(value) ) {\n int right = mys.pop();\n int left = mys.pop();\n mys.push(left*right);\n } else {\n mys.push(Integer.parseInt(value));\n }\n }\n\n System.out.println(mys.pop());\n } catch (IOException e) {\n\t\t\t// TODO 自動生成された catch ブロック\n\t\t\te.printStackTrace();\n\t\t}\n finally{\n if( bf != null ) {\n try {\n\t\t\t\t\tbf.close();\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t// TODO 自動生成された catch ブロック\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n }\n }\n }\n\n public class MyStack {\n public static final int MAX = 1000;\n int[] values = new int[MAX];\n int index = 0;\n\n public MyStack() {}\n\n void push( int val ) {\n if( isFull() ) {\n throw new RuntimeException(\"MyStack is Full.\");\n }\n\n index++;\n values[index] = val;\n }\n\n int pop() {\n if( isEmpty() ) {\n throw new RuntimeException(\"MyStack is Empty.\");\n }\n\n index--;\n return values[index+1];\n }\n\n boolean isEmpty() {\n return index <= 0;\n }\n\n boolean isFull() {\n return index >= 1000;\n }\n }\n}",
"import java.io.BufferedReader;",
"BufferedReader",
"java.io",
"import java.io.IOException;",
"IOException",
"java.io",
"import java.io.InputStreamReader;",
"InputStreamReader",
"java.io",
"public class Main {\n public Main() {\n }\n\n public static void main(String[] args ) {\n \t\tMain main = new Main();\n \t\tmain.exec();\n }\n\n public void exec() {\n BufferedReader bf = null;\n try{\n bf = new BufferedReader(new InputStreamReader(System.in));\n String line = bf.readLine();\n String[] values = line.split(\" \");\n\n MyStack mys = new MyStack();\n for( String value : values ) {\n if( \"+\".equals(value)) {\n int right = mys.pop();\n int left = mys.pop();\n mys.push(left+right);\n } else if ( \"-\".equals(value) ) {\n int right = mys.pop();\n int left = mys.pop();\n mys.push(left-right);\n } else if ( \"*\".equals(value) ) {\n int right = mys.pop();\n int left = mys.pop();\n mys.push(left*right);\n } else {\n mys.push(Integer.parseInt(value));\n }\n }\n\n System.out.println(mys.pop());\n } catch (IOException e) {\n\t\t\t// TODO 自動生成された catch ブロック\n\t\t\te.printStackTrace();\n\t\t}\n finally{\n if( bf != null ) {\n try {\n\t\t\t\t\tbf.close();\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t// TODO 自動生成された catch ブロック\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n }\n }\n }\n\n public class MyStack {\n public static final int MAX = 1000;\n int[] values = new int[MAX];\n int index = 0;\n\n public MyStack() {}\n\n void push( int val ) {\n if( isFull() ) {\n throw new RuntimeException(\"MyStack is Full.\");\n }\n\n index++;\n values[index] = val;\n }\n\n int pop() {\n if( isEmpty() ) {\n throw new RuntimeException(\"MyStack is Empty.\");\n }\n\n index--;\n return values[index+1];\n }\n\n boolean isEmpty() {\n return index <= 0;\n }\n\n boolean isFull() {\n return index >= 1000;\n }\n }\n}",
"Main",
"public Main() {\n }",
"Main",
"{\n }",
"public static void main(String[] args ) {\n \t\tMain main = new Main();\n \t\tmain.exec();\n }",
"main",
"{\n \t\tMain main = new Main();\n \t\tmain.exec();\n }",
"Main main = new Main();",
"main",
"new Main()",
"main.exec()",
"main.exec",
"main",
"String[] args",
"args",
"public void exec() {\n BufferedReader bf = null;\n try{\n bf = new BufferedReader(new InputStreamReader(System.in));\n String line = bf.readLine();\n String[] values = line.split(\" \");\n\n MyStack mys = new MyStack();\n for( String value : values ) {\n if( \"+\".equals(value)) {\n int right = mys.pop();\n int left = mys.pop();\n mys.push(left+right);\n } else if ( \"-\".equals(value) ) {\n int right = mys.pop();\n int left = mys.pop();\n mys.push(left-right);\n } else if ( \"*\".equals(value) ) {\n int right = mys.pop();\n int left = mys.pop();\n mys.push(left*right);\n } else {\n mys.push(Integer.parseInt(value));\n }\n }\n\n System.out.println(mys.pop());\n } catch (IOException e) {\n\t\t\t// TODO 自動生成された catch ブロック\n\t\t\te.printStackTrace();\n\t\t}\n finally{\n if( bf != null ) {\n try {\n\t\t\t\t\tbf.close();\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t// TODO 自動生成された catch ブロック\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n }\n }\n }",
"exec",
"{\n BufferedReader bf = null;\n try{\n bf = new BufferedReader(new InputStreamReader(System.in));\n String line = bf.readLine();\n String[] values = line.split(\" \");\n\n MyStack mys = new MyStack();\n for( String value : values ) {\n if( \"+\".equals(value)) {\n int right = mys.pop();\n int left = mys.pop();\n mys.push(left+right);\n } else if ( \"-\".equals(value) ) {\n int right = mys.pop();\n int left = mys.pop();\n mys.push(left-right);\n } else if ( \"*\".equals(value) ) {\n int right = mys.pop();\n int left = mys.pop();\n mys.push(left*right);\n } else {\n mys.push(Integer.parseInt(value));\n }\n }\n\n System.out.println(mys.pop());\n } catch (IOException e) {\n\t\t\t// TODO 自動生成された catch ブロック\n\t\t\te.printStackTrace();\n\t\t}\n finally{\n if( bf != null ) {\n try {\n\t\t\t\t\tbf.close();\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t// TODO 自動生成された catch ブロック\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n }\n }\n }",
"BufferedReader bf = null;",
"bf",
"null",
"try{\n bf = new BufferedReader(new InputStreamReader(System.in));\n String line = bf.readLine();\n String[] values = line.split(\" \");\n\n MyStack mys = new MyStack();\n for( String value : values ) {\n if( \"+\".equals(value)) {\n int right = mys.pop();\n int left = mys.pop();\n mys.push(left+right);\n } else if ( \"-\".equals(value) ) {\n int right = mys.pop();\n int left = mys.pop();\n mys.push(left-right);\n } else if ( \"*\".equals(value) ) {\n int right = mys.pop();\n int left = mys.pop();\n mys.push(left*right);\n } else {\n mys.push(Integer.parseInt(value));\n }\n }\n\n System.out.println(mys.pop());\n } catch (IOException e) {\n\t\t\t// TODO 自動生成された catch ブロック\n\t\t\te.printStackTrace();\n\t\t}\n finally{\n if( bf != null ) {\n try {\n\t\t\t\t\tbf.close();\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t// TODO 自動生成された catch ブロック\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n }\n }",
"catch (IOException e) {\n\t\t\t// TODO 自動生成された catch ブロック\n\t\t\te.printStackTrace();\n\t\t}",
"IOException e",
"{\n\t\t\t// TODO 自動生成された catch ブロック\n\t\t\te.printStackTrace();\n\t\t}",
"e.printStackTrace()",
"e.printStackTrace",
"e",
"{\n if( bf != null ) {\n try {\n\t\t\t\t\tbf.close();\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t// TODO 自動生成された catch ブロック\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n }\n }",
"if( bf != null ) {\n try {\n\t\t\t\t\tbf.close();\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t// TODO 自動生成された catch ブロック\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n }",
"bf != null",
"bf",
"null",
"{\n try {\n\t\t\t\t\tbf.close();\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t// TODO 自動生成された catch ブロック\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n }",
"try {\n\t\t\t\t\tbf.close();\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t// TODO 自動生成された catch ブロック\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}",
"catch (IOException e) {\n\t\t\t\t\t// TODO 自動生成された catch ブロック\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}",
"IOException e",
"{\n\t\t\t\t\t// TODO 自動生成された catch ブロック\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}",
"e.printStackTrace()",
"e.printStackTrace",
"e",
"{\n\t\t\t\t\tbf.close();\n\t\t\t\t}",
"bf.close()",
"bf.close",
"bf",
"{\n bf = new BufferedReader(new InputStreamReader(System.in));\n String line = bf.readLine();\n String[] values = line.split(\" \");\n\n MyStack mys = new MyStack();\n for( String value : values ) {\n if( \"+\".equals(value)) {\n int right = mys.pop();\n int left = mys.pop();\n mys.push(left+right);\n } else if ( \"-\".equals(value) ) {\n int right = mys.pop();\n int left = mys.pop();\n mys.push(left-right);\n } else if ( \"*\".equals(value) ) {\n int right = mys.pop();\n int left = mys.pop();\n mys.push(left*right);\n } else {\n mys.push(Integer.parseInt(value));\n }\n }\n\n System.out.println(mys.pop());\n }",
"bf = new BufferedReader(new InputStreamReader(System.in))",
"bf",
"new BufferedReader(new InputStreamReader(System.in))",
"String line = bf.readLine();",
"line",
"bf.readLine()",
"bf.readLine",
"bf",
"String[] values = line.split(\" \");",
"values",
"line.split(\" \")",
"line.split",
"line",
"\" \"",
"MyStack mys = new MyStack();",
"mys",
"new MyStack()",
"for( String value : values ) {\n if( \"+\".equals(value)) {\n int right = mys.pop();\n int left = mys.pop();\n mys.push(left+right);\n } else if ( \"-\".equals(value) ) {\n int right = mys.pop();\n int left = mys.pop();\n mys.push(left-right);\n } else if ( \"*\".equals(value) ) {\n int right = mys.pop();\n int left = mys.pop();\n mys.push(left*right);\n } else {\n mys.push(Integer.parseInt(value));\n }\n }",
"String value",
"values",
"{\n if( \"+\".equals(value)) {\n int right = mys.pop();\n int left = mys.pop();\n mys.push(left+right);\n } else if ( \"-\".equals(value) ) {\n int right = mys.pop();\n int left = mys.pop();\n mys.push(left-right);\n } else if ( \"*\".equals(value) ) {\n int right = mys.pop();\n int left = mys.pop();\n mys.push(left*right);\n } else {\n mys.push(Integer.parseInt(value));\n }\n }",
"{\n if( \"+\".equals(value)) {\n int right = mys.pop();\n int left = mys.pop();\n mys.push(left+right);\n } else if ( \"-\".equals(value) ) {\n int right = mys.pop();\n int left = mys.pop();\n mys.push(left-right);\n } else if ( \"*\".equals(value) ) {\n int right = mys.pop();\n int left = mys.pop();\n mys.push(left*right);\n } else {\n mys.push(Integer.parseInt(value));\n }\n }",
"if( \"+\".equals(value)) {\n int right = mys.pop();\n int left = mys.pop();\n mys.push(left+right);\n } else if ( \"-\".equals(value) ) {\n int right = mys.pop();\n int left = mys.pop();\n mys.push(left-right);\n } else if ( \"*\".equals(value) ) {\n int right = mys.pop();\n int left = mys.pop();\n mys.push(left*right);\n } else {\n mys.push(Integer.parseInt(value));\n }",
"\"+\".equals(value)",
"\"+\".equals",
"\"+\"",
"value",
"{\n int right = mys.pop();\n int left = mys.pop();\n mys.push(left+right);\n }",
"int right = mys.pop();",
"right",
"mys.pop()",
"mys.pop",
"mys",
"int left = mys.pop();",
"left",
"mys.pop()",
"mys.pop",
"mys",
"mys.push(left+right)",
"mys.push",
"mys",
"left+right",
"left",
"right",
"if ( \"-\".equals(value) ) {\n int right = mys.pop();\n int left = mys.pop();\n mys.push(left-right);\n } else if ( \"*\".equals(value) ) {\n int right = mys.pop();\n int left = mys.pop();\n mys.push(left*right);\n } else {\n mys.push(Integer.parseInt(value));\n }",
"\"-\".equals(value)",
"\"-\".equals",
"\"-\"",
"value",
"{\n int right = mys.pop();\n int left = mys.pop();\n mys.push(left-right);\n }",
"int right = mys.pop();",
"right",
"mys.pop()",
"mys.pop",
"mys",
"int left = mys.pop();",
"left",
"mys.pop()",
"mys.pop",
"mys",
"mys.push(left-right)",
"mys.push",
"mys",
"left-right",
"left",
"right",
"if ( \"*\".equals(value) ) {\n int right = mys.pop();\n int left = mys.pop();\n mys.push(left*right);\n } else {\n mys.push(Integer.parseInt(value));\n }",
"\"*\".equals(value)",
"\"*\".equals",
"\"*\"",
"value",
"{\n int right = mys.pop();\n int left = mys.pop();\n mys.push(left*right);\n }",
"int right = mys.pop();",
"right",
"mys.pop()",
"mys.pop",
"mys",
"int left = mys.pop();",
"left",
"mys.pop()",
"mys.pop",
"mys",
"mys.push(left*right)",
"mys.push",
"mys",
"left*right",
"left",
"right",
"{\n mys.push(Integer.parseInt(value));\n }",
"mys.push(Integer.parseInt(value))",
"mys.push",
"mys",
"Integer.parseInt(value)",
"Integer.parseInt",
"Integer",
"value",
"System.out.println(mys.pop())",
"System.out.println",
"System.out",
"System",
"System.out",
"mys.pop()",
"mys.pop",
"mys",
"public class MyStack {\n public static final int MAX = 1000;\n int[] values = new int[MAX];\n int index = 0;\n\n public MyStack() {}\n\n void push( int val ) {\n if( isFull() ) {\n throw new RuntimeException(\"MyStack is Full.\");\n }\n\n index++;\n values[index] = val;\n }\n\n int pop() {\n if( isEmpty() ) {\n throw new RuntimeException(\"MyStack is Empty.\");\n }\n\n index--;\n return values[index+1];\n }\n\n boolean isEmpty() {\n return index <= 0;\n }\n\n boolean isFull() {\n return index >= 1000;\n }\n }",
"MyStack",
"public static final int MAX = 1000;",
"MAX",
"1000",
"int[] values = new int[MAX];",
"values",
"new int[MAX]",
"MAX",
"int index = 0;",
"index",
"0",
"public MyStack() {}",
"MyStack",
"{}",
"void push( int val ) {\n if( isFull() ) {\n throw new RuntimeException(\"MyStack is Full.\");\n }\n\n index++;\n values[index] = val;\n }",
"push",
"{\n if( isFull() ) {\n throw new RuntimeException(\"MyStack is Full.\");\n }\n\n index++;\n values[index] = val;\n }",
"if( isFull() ) {\n throw new RuntimeException(\"MyStack is Full.\");\n }",
"isFull()",
"isFull",
"{\n throw new RuntimeException(\"MyStack is Full.\");\n }",
"throw new RuntimeException(\"MyStack is Full.\");",
"new RuntimeException(\"MyStack is Full.\")",
"index++",
"index",
"values[index] = val",
"values[index]",
"values",
"index",
"val",
"int val",
"val",
"int pop() {\n if( isEmpty() ) {\n throw new RuntimeException(\"MyStack is Empty.\");\n }\n\n index--;\n return values[index+1];\n }",
"pop",
"{\n if( isEmpty() ) {\n throw new RuntimeException(\"MyStack is Empty.\");\n }\n\n index--;\n return values[index+1];\n }",
"if( isEmpty() ) {\n throw new RuntimeException(\"MyStack is Empty.\");\n }",
"isEmpty()",
"isEmpty",
"{\n throw new RuntimeException(\"MyStack is Empty.\");\n }",
"throw new RuntimeException(\"MyStack is Empty.\");",
"new RuntimeException(\"MyStack is Empty.\")",
"index--",
"index",
"return values[index+1];",
"values[index+1]",
"values",
"index+1",
"index",
"1",
"boolean isEmpty() {\n return index <= 0;\n }",
"isEmpty",
"{\n return index <= 0;\n }",
"return index <= 0;",
"index <= 0",
"index",
"0",
"boolean isFull() {\n return index >= 1000;\n }",
"isFull",
"{\n return index >= 1000;\n }",
"return index >= 1000;",
"index >= 1000",
"index",
"1000",
"public class Main {\n public Main() {\n }\n\n public static void main(String[] args ) {\n \t\tMain main = new Main();\n \t\tmain.exec();\n }\n\n public void exec() {\n BufferedReader bf = null;\n try{\n bf = new BufferedReader(new InputStreamReader(System.in));\n String line = bf.readLine();\n String[] values = line.split(\" \");\n\n MyStack mys = new MyStack();\n for( String value : values ) {\n if( \"+\".equals(value)) {\n int right = mys.pop();\n int left = mys.pop();\n mys.push(left+right);\n } else if ( \"-\".equals(value) ) {\n int right = mys.pop();\n int left = mys.pop();\n mys.push(left-right);\n } else if ( \"*\".equals(value) ) {\n int right = mys.pop();\n int left = mys.pop();\n mys.push(left*right);\n } else {\n mys.push(Integer.parseInt(value));\n }\n }\n\n System.out.println(mys.pop());\n } catch (IOException e) {\n\t\t\t// TODO 自動生成された catch ブロック\n\t\t\te.printStackTrace();\n\t\t}\n finally{\n if( bf != null ) {\n try {\n\t\t\t\t\tbf.close();\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t// TODO 自動生成された catch ブロック\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n }\n }\n }\n\n public class MyStack {\n public static final int MAX = 1000;\n int[] values = new int[MAX];\n int index = 0;\n\n public MyStack() {}\n\n void push( int val ) {\n if( isFull() ) {\n throw new RuntimeException(\"MyStack is Full.\");\n }\n\n index++;\n values[index] = val;\n }\n\n int pop() {\n if( isEmpty() ) {\n throw new RuntimeException(\"MyStack is Empty.\");\n }\n\n index--;\n return values[index+1];\n }\n\n boolean isEmpty() {\n return index <= 0;\n }\n\n boolean isFull() {\n return index >= 1000;\n }\n }\n}",
"public class Main {\n public Main() {\n }\n\n public static void main(String[] args ) {\n \t\tMain main = new Main();\n \t\tmain.exec();\n }\n\n public void exec() {\n BufferedReader bf = null;\n try{\n bf = new BufferedReader(new InputStreamReader(System.in));\n String line = bf.readLine();\n String[] values = line.split(\" \");\n\n MyStack mys = new MyStack();\n for( String value : values ) {\n if( \"+\".equals(value)) {\n int right = mys.pop();\n int left = mys.pop();\n mys.push(left+right);\n } else if ( \"-\".equals(value) ) {\n int right = mys.pop();\n int left = mys.pop();\n mys.push(left-right);\n } else if ( \"*\".equals(value) ) {\n int right = mys.pop();\n int left = mys.pop();\n mys.push(left*right);\n } else {\n mys.push(Integer.parseInt(value));\n }\n }\n\n System.out.println(mys.pop());\n } catch (IOException e) {\n\t\t\t// TODO 自動生成された catch ブロック\n\t\t\te.printStackTrace();\n\t\t}\n finally{\n if( bf != null ) {\n try {\n\t\t\t\t\tbf.close();\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t// TODO 自動生成された catch ブロック\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n }\n }\n }\n\n public class MyStack {\n public static final int MAX = 1000;\n int[] values = new int[MAX];\n int index = 0;\n\n public MyStack() {}\n\n void push( int val ) {\n if( isFull() ) {\n throw new RuntimeException(\"MyStack is Full.\");\n }\n\n index++;\n values[index] = val;\n }\n\n int pop() {\n if( isEmpty() ) {\n throw new RuntimeException(\"MyStack is Empty.\");\n }\n\n index--;\n return values[index+1];\n }\n\n boolean isEmpty() {\n return index <= 0;\n }\n\n boolean isFull() {\n return index >= 1000;\n }\n }\n}",
"Main"
] | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Main {
public Main() {
}
public static void main(String[] args ) {
Main main = new Main();
main.exec();
}
public void exec() {
BufferedReader bf = null;
try{
bf = new BufferedReader(new InputStreamReader(System.in));
String line = bf.readLine();
String[] values = line.split(" ");
MyStack mys = new MyStack();
for( String value : values ) {
if( "+".equals(value)) {
int right = mys.pop();
int left = mys.pop();
mys.push(left+right);
} else if ( "-".equals(value) ) {
int right = mys.pop();
int left = mys.pop();
mys.push(left-right);
} else if ( "*".equals(value) ) {
int right = mys.pop();
int left = mys.pop();
mys.push(left*right);
} else {
mys.push(Integer.parseInt(value));
}
}
System.out.println(mys.pop());
} catch (IOException e) {
// TODO 自動生成された catch ブロック
e.printStackTrace();
}
finally{
if( bf != null ) {
try {
bf.close();
} catch (IOException e) {
// TODO 自動生成された catch ブロック
e.printStackTrace();
}
}
}
}
public class MyStack {
public static final int MAX = 1000;
int[] values = new int[MAX];
int index = 0;
public MyStack() {}
void push( int val ) {
if( isFull() ) {
throw new RuntimeException("MyStack is Full.");
}
index++;
values[index] = val;
}
int pop() {
if( isEmpty() ) {
throw new RuntimeException("MyStack is Empty.");
}
index--;
return values[index+1];
}
boolean isEmpty() {
return index <= 0;
}
boolean isFull() {
return index >= 1000;
}
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
20,
42,
4,
18,
13,
30,
4,
18,
13,
4,
18,
13,
41,
13,
20,
41,
13,
17,
41,
13,
17,
42,
2,
4,
18,
13,
17,
30,
14,
4,
18,
4,
18,
13,
17,
17,
30,
0,
13,
4,
18,
13,
2,
4,
18,
13,
17,
0,
13,
4,
18,
13,
2,
4,
18,
13,
17,
4,
18,
13,
2,
13,
13,
4,
18,
13,
17,
14,
4,
18,
4,
18,
13,
17,
17,
30,
0,
13,
4,
18,
13,
2,
4,
18,
13,
17,
0,
13,
4,
18,
13,
2,
4,
18,
13,
17,
4,
18,
13,
2,
13,
13,
4,
18,
13,
17,
14,
4,
18,
4,
18,
13,
17,
17,
30,
0,
13,
4,
18,
13,
2,
4,
18,
13,
17,
0,
13,
4,
18,
13,
2,
4,
18,
13,
17,
4,
18,
13,
2,
13,
13,
4,
18,
13,
17,
30,
4,
18,
13,
4,
13,
4,
18,
13,
17,
4,
18,
18,
13,
13,
4,
18,
13,
17,
23,
13,
12,
13,
30,
29,
4,
18,
13,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
191,
5
],
[
191,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
8,
15
],
[
15,
16
],
[
16,
17
],
[
17,
18
],
[
15,
19
],
[
19,
20
],
[
20,
21
],
[
21,
22
],
[
20,
23
],
[
23,
24
],
[
24,
25
],
[
8,
26
],
[
26,
27
],
[
26,
28
],
[
8,
29
],
[
29,
30
],
[
29,
31
],
[
8,
32
],
[
32,
33
],
[
32,
34
],
[
8,
35
],
[
35,
36
],
[
36,
37
],
[
37,
38
],
[
38,
39
],
[
36,
40
],
[
35,
41
],
[
41,
42
],
[
42,
43
],
[
43,
44
],
[
44,
45
],
[
45,
46
],
[
46,
47
],
[
45,
48
],
[
43,
49
],
[
42,
50
],
[
50,
51
],
[
51,
52
],
[
51,
53
],
[
53,
54
],
[
54,
55
],
[
53,
56
],
[
56,
57
],
[
57,
58
],
[
58,
59
],
[
56,
60
],
[
50,
61
],
[
61,
62
],
[
61,
63
],
[
63,
64
],
[
64,
65
],
[
63,
66
],
[
66,
67
],
[
67,
68
],
[
68,
69
],
[
66,
70
],
[
50,
71
],
[
71,
72
],
[
72,
73
],
[
71,
74
],
[
74,
75
],
[
74,
76
],
[
50,
77
],
[
77,
78
],
[
78,
79
],
[
77,
80
],
[
42,
81
],
[
81,
82
],
[
82,
83
],
[
83,
84
],
[
84,
85
],
[
85,
86
],
[
84,
87
],
[
82,
88
],
[
81,
89
],
[
89,
90
],
[
90,
91
],
[
90,
92
],
[
92,
93
],
[
93,
94
],
[
92,
95
],
[
95,
96
],
[
96,
97
],
[
97,
98
],
[
95,
99
],
[
89,
100
],
[
100,
101
],
[
100,
102
],
[
102,
103
],
[
103,
104
],
[
102,
105
],
[
105,
106
],
[
106,
107
],
[
107,
108
],
[
105,
109
],
[
89,
110
],
[
110,
111
],
[
111,
112
],
[
110,
113
],
[
113,
114
],
[
113,
115
],
[
89,
116
],
[
116,
117
],
[
117,
118
],
[
116,
119
],
[
81,
120
],
[
120,
121
],
[
121,
122
],
[
122,
123
],
[
123,
124
],
[
124,
125
],
[
123,
126
],
[
121,
127
],
[
120,
128
],
[
128,
129
],
[
129,
130
],
[
129,
131
],
[
131,
132
],
[
132,
133
],
[
131,
134
],
[
134,
135
],
[
135,
136
],
[
136,
137
],
[
134,
138
],
[
128,
139
],
[
139,
140
],
[
139,
141
],
[
141,
142
],
[
142,
143
],
[
141,
144
],
[
144,
145
],
[
145,
146
],
[
146,
147
],
[
144,
148
],
[
128,
149
],
[
149,
150
],
[
150,
151
],
[
149,
152
],
[
152,
153
],
[
152,
154
],
[
128,
155
],
[
155,
156
],
[
156,
157
],
[
155,
158
],
[
120,
159
],
[
159,
160
],
[
160,
161
],
[
161,
162
],
[
160,
163
],
[
163,
164
],
[
163,
165
],
[
165,
166
],
[
166,
167
],
[
165,
168
],
[
8,
169
],
[
169,
170
],
[
170,
171
],
[
171,
172
],
[
171,
173
],
[
169,
174
],
[
174,
175
],
[
175,
176
],
[
174,
177
],
[
6,
178
],
[
178,
179
],
[
191,
180
],
[
180,
181
],
[
180,
182
],
[
182,
183
],
[
183,
184
],
[
184,
185
],
[
185,
186
],
[
184,
187
],
[
180,
188
],
[
188,
189
],
[
0,
190
],
[
190,
191
],
[
190,
192
]
] | [
"import java.util.*;\npublic class Main {\n\n\t/**\n\t * @param args\n\t */\n\tpublic static void main(String[] args) {\n\t\tScanner s = new Scanner(System.in);\n\t\tArrayList<String> expr = new ArrayList<String>();\n\t\twhile(s.hasNext()){\n\t\t\texpr.add(s.next());\n\t\t}\n\n\t\tArrayList<Integer> buffer = new ArrayList<Integer>();\n\t\tInteger left = 0;\n\t\tInteger right = 0;\n\t\twhile(expr.size() > 0){\n\t\t\tif(expr.get(0).equals(\"+\")){\n\t\t\t\tright = buffer.remove(buffer.size() - 1);\n\t\t\t\tleft = buffer.remove(buffer.size() - 1);\n\n\t\t\t\tbuffer.add(left + right);\n\t\t\t\texpr.remove(0);\n\t\t\t}\n\t\t\telse if(expr.get(0).equals(\"-\")){\n\t\t\t\tright = buffer.remove(buffer.size() - 1);\n\t\t\t\tleft = buffer.remove(buffer.size() - 1);\n\n\t\t\t\tbuffer.add(left - right);\n\t\t\t\texpr.remove(0);\n\t\t\t}\n\t\t\telse if(expr.get(0).equals(\"*\")){\n\t\t\t\tright = buffer.remove(buffer.size() - 1);\n\t\t\t\tleft = buffer.remove(buffer.size() - 1);\n\n\t\t\t\tbuffer.add(left * right);\n\t\t\t\texpr.remove(0);\n\t\t\t}\n\t\t\telse{\n\t\t\t\tbuffer.add(toi(expr.remove(0)));\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(buffer.get(0));\n\t}\n\tprivate static Integer toi(String b){\n\t\treturn Integer.parseInt(b);\n\t}\n\n}",
"import java.util.*;",
"util.*",
"java",
"public class Main {\n\n\t/**\n\t * @param args\n\t */\n\tpublic static void main(String[] args) {\n\t\tScanner s = new Scanner(System.in);\n\t\tArrayList<String> expr = new ArrayList<String>();\n\t\twhile(s.hasNext()){\n\t\t\texpr.add(s.next());\n\t\t}\n\n\t\tArrayList<Integer> buffer = new ArrayList<Integer>();\n\t\tInteger left = 0;\n\t\tInteger right = 0;\n\t\twhile(expr.size() > 0){\n\t\t\tif(expr.get(0).equals(\"+\")){\n\t\t\t\tright = buffer.remove(buffer.size() - 1);\n\t\t\t\tleft = buffer.remove(buffer.size() - 1);\n\n\t\t\t\tbuffer.add(left + right);\n\t\t\t\texpr.remove(0);\n\t\t\t}\n\t\t\telse if(expr.get(0).equals(\"-\")){\n\t\t\t\tright = buffer.remove(buffer.size() - 1);\n\t\t\t\tleft = buffer.remove(buffer.size() - 1);\n\n\t\t\t\tbuffer.add(left - right);\n\t\t\t\texpr.remove(0);\n\t\t\t}\n\t\t\telse if(expr.get(0).equals(\"*\")){\n\t\t\t\tright = buffer.remove(buffer.size() - 1);\n\t\t\t\tleft = buffer.remove(buffer.size() - 1);\n\n\t\t\t\tbuffer.add(left * right);\n\t\t\t\texpr.remove(0);\n\t\t\t}\n\t\t\telse{\n\t\t\t\tbuffer.add(toi(expr.remove(0)));\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(buffer.get(0));\n\t}\n\tprivate static Integer toi(String b){\n\t\treturn Integer.parseInt(b);\n\t}\n\n}",
"Main",
"/**\n\t * @param args\n\t */\n\tpublic static void main(String[] args) {\n\t\tScanner s = new Scanner(System.in);\n\t\tArrayList<String> expr = new ArrayList<String>();\n\t\twhile(s.hasNext()){\n\t\t\texpr.add(s.next());\n\t\t}\n\n\t\tArrayList<Integer> buffer = new ArrayList<Integer>();\n\t\tInteger left = 0;\n\t\tInteger right = 0;\n\t\twhile(expr.size() > 0){\n\t\t\tif(expr.get(0).equals(\"+\")){\n\t\t\t\tright = buffer.remove(buffer.size() - 1);\n\t\t\t\tleft = buffer.remove(buffer.size() - 1);\n\n\t\t\t\tbuffer.add(left + right);\n\t\t\t\texpr.remove(0);\n\t\t\t}\n\t\t\telse if(expr.get(0).equals(\"-\")){\n\t\t\t\tright = buffer.remove(buffer.size() - 1);\n\t\t\t\tleft = buffer.remove(buffer.size() - 1);\n\n\t\t\t\tbuffer.add(left - right);\n\t\t\t\texpr.remove(0);\n\t\t\t}\n\t\t\telse if(expr.get(0).equals(\"*\")){\n\t\t\t\tright = buffer.remove(buffer.size() - 1);\n\t\t\t\tleft = buffer.remove(buffer.size() - 1);\n\n\t\t\t\tbuffer.add(left * right);\n\t\t\t\texpr.remove(0);\n\t\t\t}\n\t\t\telse{\n\t\t\t\tbuffer.add(toi(expr.remove(0)));\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(buffer.get(0));\n\t}",
"main",
"{\n\t\tScanner s = new Scanner(System.in);\n\t\tArrayList<String> expr = new ArrayList<String>();\n\t\twhile(s.hasNext()){\n\t\t\texpr.add(s.next());\n\t\t}\n\n\t\tArrayList<Integer> buffer = new ArrayList<Integer>();\n\t\tInteger left = 0;\n\t\tInteger right = 0;\n\t\twhile(expr.size() > 0){\n\t\t\tif(expr.get(0).equals(\"+\")){\n\t\t\t\tright = buffer.remove(buffer.size() - 1);\n\t\t\t\tleft = buffer.remove(buffer.size() - 1);\n\n\t\t\t\tbuffer.add(left + right);\n\t\t\t\texpr.remove(0);\n\t\t\t}\n\t\t\telse if(expr.get(0).equals(\"-\")){\n\t\t\t\tright = buffer.remove(buffer.size() - 1);\n\t\t\t\tleft = buffer.remove(buffer.size() - 1);\n\n\t\t\t\tbuffer.add(left - right);\n\t\t\t\texpr.remove(0);\n\t\t\t}\n\t\t\telse if(expr.get(0).equals(\"*\")){\n\t\t\t\tright = buffer.remove(buffer.size() - 1);\n\t\t\t\tleft = buffer.remove(buffer.size() - 1);\n\n\t\t\t\tbuffer.add(left * right);\n\t\t\t\texpr.remove(0);\n\t\t\t}\n\t\t\telse{\n\t\t\t\tbuffer.add(toi(expr.remove(0)));\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(buffer.get(0));\n\t}",
"Scanner s = new Scanner(System.in);",
"s",
"new Scanner(System.in)",
"ArrayList<String> expr = new ArrayList<String>();",
"expr",
"new ArrayList<String>()",
"while(s.hasNext()){\n\t\t\texpr.add(s.next());\n\t\t}",
"s.hasNext()",
"s.hasNext",
"s",
"{\n\t\t\texpr.add(s.next());\n\t\t}",
"expr.add(s.next())",
"expr.add",
"expr",
"s.next()",
"s.next",
"s",
"ArrayList<Integer> buffer = new ArrayList<Integer>();",
"buffer",
"new ArrayList<Integer>()",
"Integer left = 0;",
"left",
"0",
"Integer right = 0;",
"right",
"0",
"while(expr.size() > 0){\n\t\t\tif(expr.get(0).equals(\"+\")){\n\t\t\t\tright = buffer.remove(buffer.size() - 1);\n\t\t\t\tleft = buffer.remove(buffer.size() - 1);\n\n\t\t\t\tbuffer.add(left + right);\n\t\t\t\texpr.remove(0);\n\t\t\t}\n\t\t\telse if(expr.get(0).equals(\"-\")){\n\t\t\t\tright = buffer.remove(buffer.size() - 1);\n\t\t\t\tleft = buffer.remove(buffer.size() - 1);\n\n\t\t\t\tbuffer.add(left - right);\n\t\t\t\texpr.remove(0);\n\t\t\t}\n\t\t\telse if(expr.get(0).equals(\"*\")){\n\t\t\t\tright = buffer.remove(buffer.size() - 1);\n\t\t\t\tleft = buffer.remove(buffer.size() - 1);\n\n\t\t\t\tbuffer.add(left * right);\n\t\t\t\texpr.remove(0);\n\t\t\t}\n\t\t\telse{\n\t\t\t\tbuffer.add(toi(expr.remove(0)));\n\t\t\t}\n\t\t}",
"expr.size() > 0",
"expr.size()",
"expr.size",
"expr",
"0",
"{\n\t\t\tif(expr.get(0).equals(\"+\")){\n\t\t\t\tright = buffer.remove(buffer.size() - 1);\n\t\t\t\tleft = buffer.remove(buffer.size() - 1);\n\n\t\t\t\tbuffer.add(left + right);\n\t\t\t\texpr.remove(0);\n\t\t\t}\n\t\t\telse if(expr.get(0).equals(\"-\")){\n\t\t\t\tright = buffer.remove(buffer.size() - 1);\n\t\t\t\tleft = buffer.remove(buffer.size() - 1);\n\n\t\t\t\tbuffer.add(left - right);\n\t\t\t\texpr.remove(0);\n\t\t\t}\n\t\t\telse if(expr.get(0).equals(\"*\")){\n\t\t\t\tright = buffer.remove(buffer.size() - 1);\n\t\t\t\tleft = buffer.remove(buffer.size() - 1);\n\n\t\t\t\tbuffer.add(left * right);\n\t\t\t\texpr.remove(0);\n\t\t\t}\n\t\t\telse{\n\t\t\t\tbuffer.add(toi(expr.remove(0)));\n\t\t\t}\n\t\t}",
"if(expr.get(0).equals(\"+\")){\n\t\t\t\tright = buffer.remove(buffer.size() - 1);\n\t\t\t\tleft = buffer.remove(buffer.size() - 1);\n\n\t\t\t\tbuffer.add(left + right);\n\t\t\t\texpr.remove(0);\n\t\t\t}\n\t\t\telse if(expr.get(0).equals(\"-\")){\n\t\t\t\tright = buffer.remove(buffer.size() - 1);\n\t\t\t\tleft = buffer.remove(buffer.size() - 1);\n\n\t\t\t\tbuffer.add(left - right);\n\t\t\t\texpr.remove(0);\n\t\t\t}\n\t\t\telse if(expr.get(0).equals(\"*\")){\n\t\t\t\tright = buffer.remove(buffer.size() - 1);\n\t\t\t\tleft = buffer.remove(buffer.size() - 1);\n\n\t\t\t\tbuffer.add(left * right);\n\t\t\t\texpr.remove(0);\n\t\t\t}\n\t\t\telse{\n\t\t\t\tbuffer.add(toi(expr.remove(0)));\n\t\t\t}",
"expr.get(0).equals(\"+\")",
"expr.get(0).equals",
"expr.get(0)",
"expr.get",
"expr",
"0",
"\"+\"",
"{\n\t\t\t\tright = buffer.remove(buffer.size() - 1);\n\t\t\t\tleft = buffer.remove(buffer.size() - 1);\n\n\t\t\t\tbuffer.add(left + right);\n\t\t\t\texpr.remove(0);\n\t\t\t}",
"right = buffer.remove(buffer.size() - 1)",
"right",
"buffer.remove(buffer.size() - 1)",
"buffer.remove",
"buffer",
"buffer.size() - 1",
"buffer.size()",
"buffer.size",
"buffer",
"1",
"left = buffer.remove(buffer.size() - 1)",
"left",
"buffer.remove(buffer.size() - 1)",
"buffer.remove",
"buffer",
"buffer.size() - 1",
"buffer.size()",
"buffer.size",
"buffer",
"1",
"buffer.add(left + right)",
"buffer.add",
"buffer",
"left + right",
"left",
"right",
"expr.remove(0)",
"expr.remove",
"expr",
"0",
"if(expr.get(0).equals(\"-\")){\n\t\t\t\tright = buffer.remove(buffer.size() - 1);\n\t\t\t\tleft = buffer.remove(buffer.size() - 1);\n\n\t\t\t\tbuffer.add(left - right);\n\t\t\t\texpr.remove(0);\n\t\t\t}\n\t\t\telse if(expr.get(0).equals(\"*\")){\n\t\t\t\tright = buffer.remove(buffer.size() - 1);\n\t\t\t\tleft = buffer.remove(buffer.size() - 1);\n\n\t\t\t\tbuffer.add(left * right);\n\t\t\t\texpr.remove(0);\n\t\t\t}\n\t\t\telse{\n\t\t\t\tbuffer.add(toi(expr.remove(0)));\n\t\t\t}",
"expr.get(0).equals(\"-\")",
"expr.get(0).equals",
"expr.get(0)",
"expr.get",
"expr",
"0",
"\"-\"",
"{\n\t\t\t\tright = buffer.remove(buffer.size() - 1);\n\t\t\t\tleft = buffer.remove(buffer.size() - 1);\n\n\t\t\t\tbuffer.add(left - right);\n\t\t\t\texpr.remove(0);\n\t\t\t}",
"right = buffer.remove(buffer.size() - 1)",
"right",
"buffer.remove(buffer.size() - 1)",
"buffer.remove",
"buffer",
"buffer.size() - 1",
"buffer.size()",
"buffer.size",
"buffer",
"1",
"left = buffer.remove(buffer.size() - 1)",
"left",
"buffer.remove(buffer.size() - 1)",
"buffer.remove",
"buffer",
"buffer.size() - 1",
"buffer.size()",
"buffer.size",
"buffer",
"1",
"buffer.add(left - right)",
"buffer.add",
"buffer",
"left - right",
"left",
"right",
"expr.remove(0)",
"expr.remove",
"expr",
"0",
"if(expr.get(0).equals(\"*\")){\n\t\t\t\tright = buffer.remove(buffer.size() - 1);\n\t\t\t\tleft = buffer.remove(buffer.size() - 1);\n\n\t\t\t\tbuffer.add(left * right);\n\t\t\t\texpr.remove(0);\n\t\t\t}\n\t\t\telse{\n\t\t\t\tbuffer.add(toi(expr.remove(0)));\n\t\t\t}",
"expr.get(0).equals(\"*\")",
"expr.get(0).equals",
"expr.get(0)",
"expr.get",
"expr",
"0",
"\"*\"",
"{\n\t\t\t\tright = buffer.remove(buffer.size() - 1);\n\t\t\t\tleft = buffer.remove(buffer.size() - 1);\n\n\t\t\t\tbuffer.add(left * right);\n\t\t\t\texpr.remove(0);\n\t\t\t}",
"right = buffer.remove(buffer.size() - 1)",
"right",
"buffer.remove(buffer.size() - 1)",
"buffer.remove",
"buffer",
"buffer.size() - 1",
"buffer.size()",
"buffer.size",
"buffer",
"1",
"left = buffer.remove(buffer.size() - 1)",
"left",
"buffer.remove(buffer.size() - 1)",
"buffer.remove",
"buffer",
"buffer.size() - 1",
"buffer.size()",
"buffer.size",
"buffer",
"1",
"buffer.add(left * right)",
"buffer.add",
"buffer",
"left * right",
"left",
"right",
"expr.remove(0)",
"expr.remove",
"expr",
"0",
"{\n\t\t\t\tbuffer.add(toi(expr.remove(0)));\n\t\t\t}",
"buffer.add(toi(expr.remove(0)))",
"buffer.add",
"buffer",
"toi(expr.remove(0))",
"toi",
"expr.remove(0)",
"expr.remove",
"expr",
"0",
"System.out.println(buffer.get(0))",
"System.out.println",
"System.out",
"System",
"System.out",
"buffer.get(0)",
"buffer.get",
"buffer",
"0",
"String[] args",
"args",
"private static Integer toi(String b){\n\t\treturn Integer.parseInt(b);\n\t}",
"toi",
"{\n\t\treturn Integer.parseInt(b);\n\t}",
"return Integer.parseInt(b);",
"Integer.parseInt(b)",
"Integer.parseInt",
"Integer",
"b",
"String b",
"b",
"public class Main {\n\n\t/**\n\t * @param args\n\t */\n\tpublic static void main(String[] args) {\n\t\tScanner s = new Scanner(System.in);\n\t\tArrayList<String> expr = new ArrayList<String>();\n\t\twhile(s.hasNext()){\n\t\t\texpr.add(s.next());\n\t\t}\n\n\t\tArrayList<Integer> buffer = new ArrayList<Integer>();\n\t\tInteger left = 0;\n\t\tInteger right = 0;\n\t\twhile(expr.size() > 0){\n\t\t\tif(expr.get(0).equals(\"+\")){\n\t\t\t\tright = buffer.remove(buffer.size() - 1);\n\t\t\t\tleft = buffer.remove(buffer.size() - 1);\n\n\t\t\t\tbuffer.add(left + right);\n\t\t\t\texpr.remove(0);\n\t\t\t}\n\t\t\telse if(expr.get(0).equals(\"-\")){\n\t\t\t\tright = buffer.remove(buffer.size() - 1);\n\t\t\t\tleft = buffer.remove(buffer.size() - 1);\n\n\t\t\t\tbuffer.add(left - right);\n\t\t\t\texpr.remove(0);\n\t\t\t}\n\t\t\telse if(expr.get(0).equals(\"*\")){\n\t\t\t\tright = buffer.remove(buffer.size() - 1);\n\t\t\t\tleft = buffer.remove(buffer.size() - 1);\n\n\t\t\t\tbuffer.add(left * right);\n\t\t\t\texpr.remove(0);\n\t\t\t}\n\t\t\telse{\n\t\t\t\tbuffer.add(toi(expr.remove(0)));\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(buffer.get(0));\n\t}\n\tprivate static Integer toi(String b){\n\t\treturn Integer.parseInt(b);\n\t}\n\n}",
"public class Main {\n\n\t/**\n\t * @param args\n\t */\n\tpublic static void main(String[] args) {\n\t\tScanner s = new Scanner(System.in);\n\t\tArrayList<String> expr = new ArrayList<String>();\n\t\twhile(s.hasNext()){\n\t\t\texpr.add(s.next());\n\t\t}\n\n\t\tArrayList<Integer> buffer = new ArrayList<Integer>();\n\t\tInteger left = 0;\n\t\tInteger right = 0;\n\t\twhile(expr.size() > 0){\n\t\t\tif(expr.get(0).equals(\"+\")){\n\t\t\t\tright = buffer.remove(buffer.size() - 1);\n\t\t\t\tleft = buffer.remove(buffer.size() - 1);\n\n\t\t\t\tbuffer.add(left + right);\n\t\t\t\texpr.remove(0);\n\t\t\t}\n\t\t\telse if(expr.get(0).equals(\"-\")){\n\t\t\t\tright = buffer.remove(buffer.size() - 1);\n\t\t\t\tleft = buffer.remove(buffer.size() - 1);\n\n\t\t\t\tbuffer.add(left - right);\n\t\t\t\texpr.remove(0);\n\t\t\t}\n\t\t\telse if(expr.get(0).equals(\"*\")){\n\t\t\t\tright = buffer.remove(buffer.size() - 1);\n\t\t\t\tleft = buffer.remove(buffer.size() - 1);\n\n\t\t\t\tbuffer.add(left * right);\n\t\t\t\texpr.remove(0);\n\t\t\t}\n\t\t\telse{\n\t\t\t\tbuffer.add(toi(expr.remove(0)));\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(buffer.get(0));\n\t}\n\tprivate static Integer toi(String b){\n\t\treturn Integer.parseInt(b);\n\t}\n\n}",
"Main"
] | import java.util.*;
public class Main {
/**
* @param args
*/
public static void main(String[] args) {
Scanner s = new Scanner(System.in);
ArrayList<String> expr = new ArrayList<String>();
while(s.hasNext()){
expr.add(s.next());
}
ArrayList<Integer> buffer = new ArrayList<Integer>();
Integer left = 0;
Integer right = 0;
while(expr.size() > 0){
if(expr.get(0).equals("+")){
right = buffer.remove(buffer.size() - 1);
left = buffer.remove(buffer.size() - 1);
buffer.add(left + right);
expr.remove(0);
}
else if(expr.get(0).equals("-")){
right = buffer.remove(buffer.size() - 1);
left = buffer.remove(buffer.size() - 1);
buffer.add(left - right);
expr.remove(0);
}
else if(expr.get(0).equals("*")){
right = buffer.remove(buffer.size() - 1);
left = buffer.remove(buffer.size() - 1);
buffer.add(left * right);
expr.remove(0);
}
else{
buffer.add(toi(expr.remove(0)));
}
}
System.out.println(buffer.get(0));
}
private static Integer toi(String b){
return Integer.parseInt(b);
}
} |
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
20,
4,
18,
18,
13,
13,
4,
18,
13,
23,
13,
6,
13,
41,
13,
41,
13,
20,
17,
41,
13,
12,
13,
30,
0,
18,
36,
13,
13,
23,
13,
12,
13,
30,
0,
13,
20,
18,
13,
13,
23,
13,
12,
13,
30,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
30,
14,
2,
4,
18,
18,
13,
13,
17,
17,
30,
0,
18,
13,
2,
13,
17,
2,
18,
13,
2,
13,
17,
18,
13,
2,
13,
17,
0,
13,
17,
14,
2,
4,
18,
18,
13,
13,
17,
17,
30,
0,
18,
13,
2,
13,
17,
2,
18,
13,
2,
13,
17,
18,
13,
2,
13,
17,
0,
13,
17,
14,
2,
4,
18,
18,
13,
13,
17,
17,
30,
0,
18,
13,
2,
13,
17,
2,
18,
13,
2,
13,
17,
18,
13,
2,
13,
17,
0,
13,
17,
30,
0,
18,
13,
13,
4,
18,
13,
18,
13,
13,
40,
13,
0,
13,
18,
13,
17,
29,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
194,
11
],
[
194,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
15,
17
],
[
14,
18
],
[
18,
19
],
[
18,
20
],
[
14,
21
],
[
21,
22
],
[
22,
23
],
[
23,
24
],
[
23,
25
],
[
21,
26
],
[
26,
27
],
[
27,
28
],
[
12,
29
],
[
29,
30
],
[
0,
31
],
[
31,
32
],
[
31,
33
],
[
33,
34
],
[
31,
35
],
[
35,
36
],
[
35,
37
],
[
31,
39
],
[
39,
40
],
[
31,
41
],
[
41,
42
],
[
41,
43
],
[
43,
44
],
[
44,
45
],
[
45,
46
],
[
45,
47
],
[
44,
48
],
[
41,
49
],
[
49,
50
],
[
31,
51
],
[
51,
52
],
[
51,
53
],
[
53,
54
],
[
54,
55
],
[
54,
56
],
[
57,
58
],
[
57,
59
],
[
51,
60
],
[
60,
61
],
[
31,
62
],
[
62,
63
],
[
62,
64
],
[
64,
65
],
[
65,
66
],
[
65,
67
],
[
64,
68
],
[
68,
69
],
[
69,
70
],
[
70,
71
],
[
70,
72
],
[
68,
73
],
[
73,
74
],
[
73,
75
],
[
75,
76
],
[
75,
77
],
[
68,
78
],
[
78,
79
],
[
79,
80
],
[
68,
81
],
[
82,
82
],
[
82,
83
],
[
83,
84
],
[
84,
85
],
[
85,
86
],
[
86,
87
],
[
87,
88
],
[
87,
89
],
[
85,
90
],
[
84,
91
],
[
83,
92
],
[
92,
93
],
[
93,
94
],
[
94,
95
],
[
94,
96
],
[
96,
97
],
[
96,
98
],
[
93,
99
],
[
99,
100
],
[
100,
101
],
[
100,
102
],
[
102,
103
],
[
102,
104
],
[
99,
105
],
[
105,
106
],
[
105,
107
],
[
107,
108
],
[
107,
109
],
[
92,
110
],
[
110,
111
],
[
110,
112
],
[
83,
113
],
[
113,
114
],
[
114,
115
],
[
115,
116
],
[
116,
117
],
[
117,
118
],
[
117,
119
],
[
115,
120
],
[
114,
121
],
[
113,
122
],
[
122,
123
],
[
123,
124
],
[
124,
125
],
[
124,
126
],
[
126,
127
],
[
126,
128
],
[
123,
129
],
[
129,
130
],
[
130,
131
],
[
130,
132
],
[
132,
133
],
[
132,
134
],
[
129,
135
],
[
135,
136
],
[
135,
137
],
[
137,
138
],
[
137,
139
],
[
122,
140
],
[
140,
141
],
[
140,
142
],
[
113,
143
],
[
143,
144
],
[
144,
145
],
[
145,
146
],
[
146,
147
],
[
147,
148
],
[
147,
149
],
[
145,
150
],
[
144,
151
],
[
143,
152
],
[
152,
153
],
[
153,
154
],
[
154,
155
],
[
154,
156
],
[
156,
157
],
[
156,
158
],
[
153,
159
],
[
159,
160
],
[
160,
161
],
[
160,
162
],
[
162,
163
],
[
162,
164
],
[
159,
165
],
[
165,
166
],
[
165,
167
],
[
167,
168
],
[
167,
169
],
[
152,
170
],
[
170,
171
],
[
170,
172
],
[
143,
173
],
[
173,
174
],
[
174,
175
],
[
175,
176
],
[
175,
177
],
[
174,
178
],
[
178,
179
],
[
179,
180
],
[
178,
181
],
[
181,
182
],
[
181,
183
],
[
173,
184
],
[
184,
185
],
[
64,
186
],
[
186,
187
],
[
186,
188
],
[
188,
189
],
[
188,
190
],
[
64,
191
],
[
191,
192
],
[
0,
193
],
[
193,
194
],
[
193,
195
]
] | [
"import java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\n\npublic class Main {\n\tpublic static void main(String[] args) throws IOException {\n\t\tBufferedReader in = new BufferedReader(new InputStreamReader(System.in));\n\t\tStackSub createDataArr = new StackSub(in.readLine().split(\" \"));\n\t\tSystem.out.println(createDataArr.calcData());\n\t}\n}\n\nclass StackSub {\n\tprivate String[] readData;\n\tprivate int[] stack = new int[100];\n\tprivate int ans;\n\n\tStackSub(String[] readData) {\n\t\tthis.readData = readData;\n\t}\n\n\tvoid createData(String[] criateDataArr) {\n\t\treadData = new String[criateDataArr.length];\n\t}\n\n\tint calcData() {\n\t\tint stackNum = 0;\n\t\tfor (int i = 0; i < readData.length; i++) {\n\t\t\tif (readData[i].charAt(0) == '+') {\n\t\t\t\tstack[stackNum - 2] = stack[stackNum - 2] + stack[stackNum - 1];\n\t\t\t\tstackNum -= 1;\n\t\t\t} else if (readData[i].charAt(0) == '-') {\n\t\t\t\tstack[stackNum - 2] = stack[stackNum - 2] - stack[stackNum - 1];\n\t\t\t\tstackNum -= 1;\n\t\t\t} else if (readData[i].charAt(0) == '*') {\n\t\t\t\tstack[stackNum - 2] = stack[stackNum - 2] * stack[stackNum - 1];\n\t\t\t\tstackNum -= 1;\n\t\t\t} else {\n\t\t\t\tstack[stackNum] = Integer.parseInt(readData[i]);\n\t\t\t\tstackNum++;\n\t\t\t}\n\t\t}\n\t\tans = stack[0];\n\t\treturn ans;\n\t}\n}",
"import java.io.BufferedReader;",
"BufferedReader",
"java.io",
"import java.io.IOException;",
"IOException",
"java.io",
"import java.io.InputStreamReader;",
"InputStreamReader",
"java.io",
"public class Main {\n\tpublic static void main(String[] args) throws IOException {\n\t\tBufferedReader in = new BufferedReader(new InputStreamReader(System.in));\n\t\tStackSub createDataArr = new StackSub(in.readLine().split(\" \"));\n\t\tSystem.out.println(createDataArr.calcData());\n\t}\n}",
"Main",
"public static void main(String[] args) throws IOException {\n\t\tBufferedReader in = new BufferedReader(new InputStreamReader(System.in));\n\t\tStackSub createDataArr = new StackSub(in.readLine().split(\" \"));\n\t\tSystem.out.println(createDataArr.calcData());\n\t}",
"main",
"{\n\t\tBufferedReader in = new BufferedReader(new InputStreamReader(System.in));\n\t\tStackSub createDataArr = new StackSub(in.readLine().split(\" \"));\n\t\tSystem.out.println(createDataArr.calcData());\n\t}",
"BufferedReader in = new BufferedReader(new InputStreamReader(System.in));",
"in",
"new BufferedReader(new InputStreamReader(System.in))",
"StackSub createDataArr = new StackSub(in.readLine().split(\" \"));",
"createDataArr",
"new StackSub(in.readLine().split(\" \"))",
"System.out.println(createDataArr.calcData())",
"System.out.println",
"System.out",
"System",
"System.out",
"createDataArr.calcData()",
"createDataArr.calcData",
"createDataArr",
"String[] args",
"args",
"class StackSub {\n\tprivate String[] readData;\n\tprivate int[] stack = new int[100];\n\tprivate int ans;\n\n\tStackSub(String[] readData) {\n\t\tthis.readData = readData;\n\t}\n\n\tvoid createData(String[] criateDataArr) {\n\t\treadData = new String[criateDataArr.length];\n\t}\n\n\tint calcData() {\n\t\tint stackNum = 0;\n\t\tfor (int i = 0; i < readData.length; i++) {\n\t\t\tif (readData[i].charAt(0) == '+') {\n\t\t\t\tstack[stackNum - 2] = stack[stackNum - 2] + stack[stackNum - 1];\n\t\t\t\tstackNum -= 1;\n\t\t\t} else if (readData[i].charAt(0) == '-') {\n\t\t\t\tstack[stackNum - 2] = stack[stackNum - 2] - stack[stackNum - 1];\n\t\t\t\tstackNum -= 1;\n\t\t\t} else if (readData[i].charAt(0) == '*') {\n\t\t\t\tstack[stackNum - 2] = stack[stackNum - 2] * stack[stackNum - 1];\n\t\t\t\tstackNum -= 1;\n\t\t\t} else {\n\t\t\t\tstack[stackNum] = Integer.parseInt(readData[i]);\n\t\t\t\tstackNum++;\n\t\t\t}\n\t\t}\n\t\tans = stack[0];\n\t\treturn ans;\n\t}\n}",
"StackSub",
"private String[] readData;",
"readData",
"private int[] stack = new int[100];",
"stack",
"new int[100]",
"100",
"private int ans;",
"ans",
"StackSub(String[] readData) {\n\t\tthis.readData = readData;\n\t}",
"StackSub",
"{\n\t\tthis.readData = readData;\n\t}",
"this.readData = readData",
"this.readData",
"this",
"this.readData",
"readData",
"String[] readData",
"readData",
"void createData(String[] criateDataArr) {\n\t\treadData = new String[criateDataArr.length];\n\t}",
"createData",
"{\n\t\treadData = new String[criateDataArr.length];\n\t}",
"readData = new String[criateDataArr.length]",
"readData",
"new String[criateDataArr.length]",
"criateDataArr.length",
"criateDataArr",
"criateDataArr.length",
"String[] criateDataArr",
"criateDataArr",
"int calcData() {\n\t\tint stackNum = 0;\n\t\tfor (int i = 0; i < readData.length; i++) {\n\t\t\tif (readData[i].charAt(0) == '+') {\n\t\t\t\tstack[stackNum - 2] = stack[stackNum - 2] + stack[stackNum - 1];\n\t\t\t\tstackNum -= 1;\n\t\t\t} else if (readData[i].charAt(0) == '-') {\n\t\t\t\tstack[stackNum - 2] = stack[stackNum - 2] - stack[stackNum - 1];\n\t\t\t\tstackNum -= 1;\n\t\t\t} else if (readData[i].charAt(0) == '*') {\n\t\t\t\tstack[stackNum - 2] = stack[stackNum - 2] * stack[stackNum - 1];\n\t\t\t\tstackNum -= 1;\n\t\t\t} else {\n\t\t\t\tstack[stackNum] = Integer.parseInt(readData[i]);\n\t\t\t\tstackNum++;\n\t\t\t}\n\t\t}\n\t\tans = stack[0];\n\t\treturn ans;\n\t}",
"calcData",
"{\n\t\tint stackNum = 0;\n\t\tfor (int i = 0; i < readData.length; i++) {\n\t\t\tif (readData[i].charAt(0) == '+') {\n\t\t\t\tstack[stackNum - 2] = stack[stackNum - 2] + stack[stackNum - 1];\n\t\t\t\tstackNum -= 1;\n\t\t\t} else if (readData[i].charAt(0) == '-') {\n\t\t\t\tstack[stackNum - 2] = stack[stackNum - 2] - stack[stackNum - 1];\n\t\t\t\tstackNum -= 1;\n\t\t\t} else if (readData[i].charAt(0) == '*') {\n\t\t\t\tstack[stackNum - 2] = stack[stackNum - 2] * stack[stackNum - 1];\n\t\t\t\tstackNum -= 1;\n\t\t\t} else {\n\t\t\t\tstack[stackNum] = Integer.parseInt(readData[i]);\n\t\t\t\tstackNum++;\n\t\t\t}\n\t\t}\n\t\tans = stack[0];\n\t\treturn ans;\n\t}",
"int stackNum = 0;",
"stackNum",
"0",
"for (int i = 0; i < readData.length; i++) {\n\t\t\tif (readData[i].charAt(0) == '+') {\n\t\t\t\tstack[stackNum - 2] = stack[stackNum - 2] + stack[stackNum - 1];\n\t\t\t\tstackNum -= 1;\n\t\t\t} else if (readData[i].charAt(0) == '-') {\n\t\t\t\tstack[stackNum - 2] = stack[stackNum - 2] - stack[stackNum - 1];\n\t\t\t\tstackNum -= 1;\n\t\t\t} else if (readData[i].charAt(0) == '*') {\n\t\t\t\tstack[stackNum - 2] = stack[stackNum - 2] * stack[stackNum - 1];\n\t\t\t\tstackNum -= 1;\n\t\t\t} else {\n\t\t\t\tstack[stackNum] = Integer.parseInt(readData[i]);\n\t\t\t\tstackNum++;\n\t\t\t}\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < readData.length",
"i",
"readData.length",
"readData",
"readData.length",
"i++",
"i++",
"i",
"{\n\t\t\tif (readData[i].charAt(0) == '+') {\n\t\t\t\tstack[stackNum - 2] = stack[stackNum - 2] + stack[stackNum - 1];\n\t\t\t\tstackNum -= 1;\n\t\t\t} else if (readData[i].charAt(0) == '-') {\n\t\t\t\tstack[stackNum - 2] = stack[stackNum - 2] - stack[stackNum - 1];\n\t\t\t\tstackNum -= 1;\n\t\t\t} else if (readData[i].charAt(0) == '*') {\n\t\t\t\tstack[stackNum - 2] = stack[stackNum - 2] * stack[stackNum - 1];\n\t\t\t\tstackNum -= 1;\n\t\t\t} else {\n\t\t\t\tstack[stackNum] = Integer.parseInt(readData[i]);\n\t\t\t\tstackNum++;\n\t\t\t}\n\t\t}",
"{\n\t\t\tif (readData[i].charAt(0) == '+') {\n\t\t\t\tstack[stackNum - 2] = stack[stackNum - 2] + stack[stackNum - 1];\n\t\t\t\tstackNum -= 1;\n\t\t\t} else if (readData[i].charAt(0) == '-') {\n\t\t\t\tstack[stackNum - 2] = stack[stackNum - 2] - stack[stackNum - 1];\n\t\t\t\tstackNum -= 1;\n\t\t\t} else if (readData[i].charAt(0) == '*') {\n\t\t\t\tstack[stackNum - 2] = stack[stackNum - 2] * stack[stackNum - 1];\n\t\t\t\tstackNum -= 1;\n\t\t\t} else {\n\t\t\t\tstack[stackNum] = Integer.parseInt(readData[i]);\n\t\t\t\tstackNum++;\n\t\t\t}\n\t\t}",
"if (readData[i].charAt(0) == '+') {\n\t\t\t\tstack[stackNum - 2] = stack[stackNum - 2] + stack[stackNum - 1];\n\t\t\t\tstackNum -= 1;\n\t\t\t} else if (readData[i].charAt(0) == '-') {\n\t\t\t\tstack[stackNum - 2] = stack[stackNum - 2] - stack[stackNum - 1];\n\t\t\t\tstackNum -= 1;\n\t\t\t} else if (readData[i].charAt(0) == '*') {\n\t\t\t\tstack[stackNum - 2] = stack[stackNum - 2] * stack[stackNum - 1];\n\t\t\t\tstackNum -= 1;\n\t\t\t} else {\n\t\t\t\tstack[stackNum] = Integer.parseInt(readData[i]);\n\t\t\t\tstackNum++;\n\t\t\t}",
"readData[i].charAt(0) == '+'",
"readData[i].charAt(0)",
"readData[i].charAt",
"readData[i]",
"readData",
"i",
"0",
"'+'",
"{\n\t\t\t\tstack[stackNum - 2] = stack[stackNum - 2] + stack[stackNum - 1];\n\t\t\t\tstackNum -= 1;\n\t\t\t}",
"stack[stackNum - 2] = stack[stackNum - 2] + stack[stackNum - 1]",
"stack[stackNum - 2]",
"stack",
"stackNum - 2",
"stackNum",
"2",
"stack[stackNum - 2] + stack[stackNum - 1]",
"stack[stackNum - 2]",
"stack",
"stackNum - 2",
"stackNum",
"2",
"stack[stackNum - 1]",
"stack",
"stackNum - 1",
"stackNum",
"1",
"stackNum -= 1",
"stackNum",
"1",
"if (readData[i].charAt(0) == '-') {\n\t\t\t\tstack[stackNum - 2] = stack[stackNum - 2] - stack[stackNum - 1];\n\t\t\t\tstackNum -= 1;\n\t\t\t} else if (readData[i].charAt(0) == '*') {\n\t\t\t\tstack[stackNum - 2] = stack[stackNum - 2] * stack[stackNum - 1];\n\t\t\t\tstackNum -= 1;\n\t\t\t} else {\n\t\t\t\tstack[stackNum] = Integer.parseInt(readData[i]);\n\t\t\t\tstackNum++;\n\t\t\t}",
"readData[i].charAt(0) == '-'",
"readData[i].charAt(0)",
"readData[i].charAt",
"readData[i]",
"readData",
"i",
"0",
"'-'",
"{\n\t\t\t\tstack[stackNum - 2] = stack[stackNum - 2] - stack[stackNum - 1];\n\t\t\t\tstackNum -= 1;\n\t\t\t}",
"stack[stackNum - 2] = stack[stackNum - 2] - stack[stackNum - 1]",
"stack[stackNum - 2]",
"stack",
"stackNum - 2",
"stackNum",
"2",
"stack[stackNum - 2] - stack[stackNum - 1]",
"stack[stackNum - 2]",
"stack",
"stackNum - 2",
"stackNum",
"2",
"stack[stackNum - 1]",
"stack",
"stackNum - 1",
"stackNum",
"1",
"stackNum -= 1",
"stackNum",
"1",
"if (readData[i].charAt(0) == '*') {\n\t\t\t\tstack[stackNum - 2] = stack[stackNum - 2] * stack[stackNum - 1];\n\t\t\t\tstackNum -= 1;\n\t\t\t} else {\n\t\t\t\tstack[stackNum] = Integer.parseInt(readData[i]);\n\t\t\t\tstackNum++;\n\t\t\t}",
"readData[i].charAt(0) == '*'",
"readData[i].charAt(0)",
"readData[i].charAt",
"readData[i]",
"readData",
"i",
"0",
"'*'",
"{\n\t\t\t\tstack[stackNum - 2] = stack[stackNum - 2] * stack[stackNum - 1];\n\t\t\t\tstackNum -= 1;\n\t\t\t}",
"stack[stackNum - 2] = stack[stackNum - 2] * stack[stackNum - 1]",
"stack[stackNum - 2]",
"stack",
"stackNum - 2",
"stackNum",
"2",
"stack[stackNum - 2] * stack[stackNum - 1]",
"stack[stackNum - 2]",
"stack",
"stackNum - 2",
"stackNum",
"2",
"stack[stackNum - 1]",
"stack",
"stackNum - 1",
"stackNum",
"1",
"stackNum -= 1",
"stackNum",
"1",
"{\n\t\t\t\tstack[stackNum] = Integer.parseInt(readData[i]);\n\t\t\t\tstackNum++;\n\t\t\t}",
"stack[stackNum] = Integer.parseInt(readData[i])",
"stack[stackNum]",
"stack",
"stackNum",
"Integer.parseInt(readData[i])",
"Integer.parseInt",
"Integer",
"readData[i]",
"readData",
"i",
"stackNum++",
"stackNum",
"ans = stack[0]",
"ans",
"stack[0]",
"stack",
"0",
"return ans;",
"ans",
"public class Main {\n\tpublic static void main(String[] args) throws IOException {\n\t\tBufferedReader in = new BufferedReader(new InputStreamReader(System.in));\n\t\tStackSub createDataArr = new StackSub(in.readLine().split(\" \"));\n\t\tSystem.out.println(createDataArr.calcData());\n\t}\n}",
"public class Main {\n\tpublic static void main(String[] args) throws IOException {\n\t\tBufferedReader in = new BufferedReader(new InputStreamReader(System.in));\n\t\tStackSub createDataArr = new StackSub(in.readLine().split(\" \"));\n\t\tSystem.out.println(createDataArr.calcData());\n\t}\n}",
"Main"
] | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
StackSub createDataArr = new StackSub(in.readLine().split(" "));
System.out.println(createDataArr.calcData());
}
}
class StackSub {
private String[] readData;
private int[] stack = new int[100];
private int ans;
StackSub(String[] readData) {
this.readData = readData;
}
void createData(String[] criateDataArr) {
readData = new String[criateDataArr.length];
}
int calcData() {
int stackNum = 0;
for (int i = 0; i < readData.length; i++) {
if (readData[i].charAt(0) == '+') {
stack[stackNum - 2] = stack[stackNum - 2] + stack[stackNum - 1];
stackNum -= 1;
} else if (readData[i].charAt(0) == '-') {
stack[stackNum - 2] = stack[stackNum - 2] - stack[stackNum - 1];
stackNum -= 1;
} else if (readData[i].charAt(0) == '*') {
stack[stackNum - 2] = stack[stackNum - 2] * stack[stackNum - 1];
stackNum -= 1;
} else {
stack[stackNum] = Integer.parseInt(readData[i]);
stackNum++;
}
}
ans = stack[0];
return ans;
}
} |
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
4,
18,
18,
13,
13,
4,
13,
13,
23,
13,
12,
13,
30,
38,
5,
13,
30,
29,
17,
30,
4,
18,
13,
13,
29,
17,
23,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
17,
41,
13,
41,
13,
41,
13,
17,
28,
13,
13,
30,
30,
14,
4,
18,
13,
17,
30,
0,
13,
4,
18,
13,
0,
13,
4,
18,
13,
4,
18,
13,
2,
13,
13,
14,
4,
18,
13,
17,
30,
0,
13,
4,
18,
13,
0,
13,
4,
18,
13,
4,
18,
13,
2,
13,
13,
14,
4,
18,
13,
17,
30,
0,
13,
4,
18,
13,
0,
13,
4,
18,
13,
4,
18,
13,
2,
13,
13,
30,
4,
18,
13,
4,
18,
13,
13,
29,
4,
18,
13,
23,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
10,
11
],
[
10,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
15,
17
],
[
14,
18
],
[
18,
19
],
[
18,
20
],
[
20,
21
],
[
21,
22
],
[
14,
23
],
[
23,
24
],
[
24,
25
],
[
25,
26
],
[
25,
27
],
[
23,
28
],
[
28,
29
],
[
28,
30
],
[
12,
31
],
[
31,
32
],
[
10,
33
],
[
33,
34
],
[
33,
35
],
[
35,
36
],
[
36,
37
],
[
37,
38
],
[
37,
39
],
[
39,
40
],
[
40,
41
],
[
36,
42
],
[
42,
43
],
[
43,
44
],
[
44,
45
],
[
43,
46
],
[
42,
47
],
[
47,
48
],
[
33,
49
],
[
49,
50
],
[
10,
51
],
[
51,
52
],
[
51,
53
],
[
53,
54
],
[
54,
55
],
[
54,
56
],
[
53,
57
],
[
57,
58
],
[
57,
59
],
[
59,
60
],
[
60,
61
],
[
59,
62
],
[
53,
63
],
[
63,
64
],
[
53,
65
],
[
65,
66
],
[
53,
67
],
[
67,
68
],
[
67,
69
],
[
53,
70
],
[
70,
71
],
[
70,
72
],
[
70,
73
],
[
74,
74
],
[
74,
75
],
[
75,
76
],
[
76,
77
],
[
77,
78
],
[
76,
79
],
[
75,
80
],
[
80,
81
],
[
81,
82
],
[
81,
83
],
[
83,
84
],
[
84,
85
],
[
80,
86
],
[
86,
87
],
[
86,
88
],
[
88,
89
],
[
89,
90
],
[
80,
91
],
[
91,
92
],
[
92,
93
],
[
91,
94
],
[
94,
95
],
[
94,
96
],
[
75,
97
],
[
97,
98
],
[
98,
99
],
[
99,
100
],
[
98,
101
],
[
97,
102
],
[
102,
103
],
[
103,
104
],
[
103,
105
],
[
105,
106
],
[
106,
107
],
[
102,
108
],
[
108,
109
],
[
108,
110
],
[
110,
111
],
[
111,
112
],
[
102,
113
],
[
113,
114
],
[
114,
115
],
[
113,
116
],
[
116,
117
],
[
116,
118
],
[
97,
119
],
[
119,
120
],
[
120,
121
],
[
121,
122
],
[
120,
123
],
[
119,
124
],
[
124,
125
],
[
125,
126
],
[
125,
127
],
[
127,
128
],
[
128,
129
],
[
124,
130
],
[
130,
131
],
[
130,
132
],
[
132,
133
],
[
133,
134
],
[
124,
135
],
[
135,
136
],
[
136,
137
],
[
135,
138
],
[
138,
139
],
[
138,
140
],
[
119,
141
],
[
141,
142
],
[
142,
143
],
[
143,
144
],
[
142,
145
],
[
145,
146
],
[
146,
147
],
[
145,
148
],
[
53,
149
],
[
149,
150
],
[
150,
151
],
[
151,
152
],
[
51,
153
],
[
153,
154
]
] | [
"import java.util.Scanner;\nimport java.util.Deque;\nimport java.util.ArrayDeque;\n\nclass Main {\n public static void main(String... args) {\n Scanner sc = new Scanner(System.in);\n\n String input = sc.nextLine();\n\n System.out.println(calc(input));\n }\n\n public static boolean inputIsOperand(String input) {\n try {\n Integer.parseInt(input);\n return true;\n\n } catch (NumberFormatException e) {\n return false;\n }\n }\n\n public static int calc(String input) {\n Deque<Integer> operand = new ArrayDeque<Integer>(100000);\n String[] inputs = input.split(\" \");\n\n int operand1, operand2;\n int result = 0;\n\n for (String str : inputs) {\n\n if (str.equals(\"+\")) {\n operand1 = operand.removeFirst();\n operand2 = operand.removeFirst();\n operand.offerFirst(operand2 + operand1);\n\n } else if (str.equals(\"-\")) {\n operand1 = operand.removeFirst();\n operand2 = operand.removeFirst();\n operand.offerFirst(operand2 - operand1);\n\n } else if (str.equals(\"*\")) {\n operand1 = operand.removeFirst();\n operand2 = operand.removeFirst();\n operand.offerFirst(operand2 * operand1);\n\n } else {\n operand.offerFirst(Integer.parseInt(str));\n }\n }\n\n return operand.removeFirst();\n }\n}\n",
"import java.util.Scanner;",
"Scanner",
"java.util",
"import java.util.Deque;",
"Deque",
"java.util",
"import java.util.ArrayDeque;",
"ArrayDeque",
"java.util",
"class Main {\n public static void main(String... args) {\n Scanner sc = new Scanner(System.in);\n\n String input = sc.nextLine();\n\n System.out.println(calc(input));\n }\n\n public static boolean inputIsOperand(String input) {\n try {\n Integer.parseInt(input);\n return true;\n\n } catch (NumberFormatException e) {\n return false;\n }\n }\n\n public static int calc(String input) {\n Deque<Integer> operand = new ArrayDeque<Integer>(100000);\n String[] inputs = input.split(\" \");\n\n int operand1, operand2;\n int result = 0;\n\n for (String str : inputs) {\n\n if (str.equals(\"+\")) {\n operand1 = operand.removeFirst();\n operand2 = operand.removeFirst();\n operand.offerFirst(operand2 + operand1);\n\n } else if (str.equals(\"-\")) {\n operand1 = operand.removeFirst();\n operand2 = operand.removeFirst();\n operand.offerFirst(operand2 - operand1);\n\n } else if (str.equals(\"*\")) {\n operand1 = operand.removeFirst();\n operand2 = operand.removeFirst();\n operand.offerFirst(operand2 * operand1);\n\n } else {\n operand.offerFirst(Integer.parseInt(str));\n }\n }\n\n return operand.removeFirst();\n }\n}",
"Main",
"public static void main(String... args) {\n Scanner sc = new Scanner(System.in);\n\n String input = sc.nextLine();\n\n System.out.println(calc(input));\n }",
"main",
"{\n Scanner sc = new Scanner(System.in);\n\n String input = sc.nextLine();\n\n System.out.println(calc(input));\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"String input = sc.nextLine();",
"input",
"sc.nextLine()",
"sc.nextLine",
"sc",
"System.out.println(calc(input))",
"System.out.println",
"System.out",
"System",
"System.out",
"calc(input)",
"calc",
"input",
"String... args",
"args",
"public static boolean inputIsOperand(String input) {\n try {\n Integer.parseInt(input);\n return true;\n\n } catch (NumberFormatException e) {\n return false;\n }\n }",
"inputIsOperand",
"{\n try {\n Integer.parseInt(input);\n return true;\n\n } catch (NumberFormatException e) {\n return false;\n }\n }",
"try {\n Integer.parseInt(input);\n return true;\n\n } catch (NumberFormatException e) {\n return false;\n }",
"catch (NumberFormatException e) {\n return false;\n }",
"NumberFormatException e",
"{\n return false;\n }",
"return false;",
"false",
"{\n Integer.parseInt(input);\n return true;\n\n }",
"Integer.parseInt(input)",
"Integer.parseInt",
"Integer",
"input",
"return true;",
"true",
"String input",
"input",
"public static int calc(String input) {\n Deque<Integer> operand = new ArrayDeque<Integer>(100000);\n String[] inputs = input.split(\" \");\n\n int operand1, operand2;\n int result = 0;\n\n for (String str : inputs) {\n\n if (str.equals(\"+\")) {\n operand1 = operand.removeFirst();\n operand2 = operand.removeFirst();\n operand.offerFirst(operand2 + operand1);\n\n } else if (str.equals(\"-\")) {\n operand1 = operand.removeFirst();\n operand2 = operand.removeFirst();\n operand.offerFirst(operand2 - operand1);\n\n } else if (str.equals(\"*\")) {\n operand1 = operand.removeFirst();\n operand2 = operand.removeFirst();\n operand.offerFirst(operand2 * operand1);\n\n } else {\n operand.offerFirst(Integer.parseInt(str));\n }\n }\n\n return operand.removeFirst();\n }",
"calc",
"{\n Deque<Integer> operand = new ArrayDeque<Integer>(100000);\n String[] inputs = input.split(\" \");\n\n int operand1, operand2;\n int result = 0;\n\n for (String str : inputs) {\n\n if (str.equals(\"+\")) {\n operand1 = operand.removeFirst();\n operand2 = operand.removeFirst();\n operand.offerFirst(operand2 + operand1);\n\n } else if (str.equals(\"-\")) {\n operand1 = operand.removeFirst();\n operand2 = operand.removeFirst();\n operand.offerFirst(operand2 - operand1);\n\n } else if (str.equals(\"*\")) {\n operand1 = operand.removeFirst();\n operand2 = operand.removeFirst();\n operand.offerFirst(operand2 * operand1);\n\n } else {\n operand.offerFirst(Integer.parseInt(str));\n }\n }\n\n return operand.removeFirst();\n }",
"Deque<Integer> operand = new ArrayDeque<Integer>(100000);",
"operand",
"new ArrayDeque<Integer>(100000)",
"String[] inputs = input.split(\" \");",
"inputs",
"input.split(\" \")",
"input.split",
"input",
"\" \"",
"int operand1",
"operand1",
"operand2;",
"operand2",
"int result = 0;",
"result",
"0",
"for (String str : inputs) {\n\n if (str.equals(\"+\")) {\n operand1 = operand.removeFirst();\n operand2 = operand.removeFirst();\n operand.offerFirst(operand2 + operand1);\n\n } else if (str.equals(\"-\")) {\n operand1 = operand.removeFirst();\n operand2 = operand.removeFirst();\n operand.offerFirst(operand2 - operand1);\n\n } else if (str.equals(\"*\")) {\n operand1 = operand.removeFirst();\n operand2 = operand.removeFirst();\n operand.offerFirst(operand2 * operand1);\n\n } else {\n operand.offerFirst(Integer.parseInt(str));\n }\n }",
"String str",
"inputs",
"{\n\n if (str.equals(\"+\")) {\n operand1 = operand.removeFirst();\n operand2 = operand.removeFirst();\n operand.offerFirst(operand2 + operand1);\n\n } else if (str.equals(\"-\")) {\n operand1 = operand.removeFirst();\n operand2 = operand.removeFirst();\n operand.offerFirst(operand2 - operand1);\n\n } else if (str.equals(\"*\")) {\n operand1 = operand.removeFirst();\n operand2 = operand.removeFirst();\n operand.offerFirst(operand2 * operand1);\n\n } else {\n operand.offerFirst(Integer.parseInt(str));\n }\n }",
"{\n\n if (str.equals(\"+\")) {\n operand1 = operand.removeFirst();\n operand2 = operand.removeFirst();\n operand.offerFirst(operand2 + operand1);\n\n } else if (str.equals(\"-\")) {\n operand1 = operand.removeFirst();\n operand2 = operand.removeFirst();\n operand.offerFirst(operand2 - operand1);\n\n } else if (str.equals(\"*\")) {\n operand1 = operand.removeFirst();\n operand2 = operand.removeFirst();\n operand.offerFirst(operand2 * operand1);\n\n } else {\n operand.offerFirst(Integer.parseInt(str));\n }\n }",
"if (str.equals(\"+\")) {\n operand1 = operand.removeFirst();\n operand2 = operand.removeFirst();\n operand.offerFirst(operand2 + operand1);\n\n } else if (str.equals(\"-\")) {\n operand1 = operand.removeFirst();\n operand2 = operand.removeFirst();\n operand.offerFirst(operand2 - operand1);\n\n } else if (str.equals(\"*\")) {\n operand1 = operand.removeFirst();\n operand2 = operand.removeFirst();\n operand.offerFirst(operand2 * operand1);\n\n } else {\n operand.offerFirst(Integer.parseInt(str));\n }",
"str.equals(\"+\")",
"str.equals",
"str",
"\"+\"",
"{\n operand1 = operand.removeFirst();\n operand2 = operand.removeFirst();\n operand.offerFirst(operand2 + operand1);\n\n }",
"operand1 = operand.removeFirst()",
"operand1",
"operand.removeFirst()",
"operand.removeFirst",
"operand",
"operand2 = operand.removeFirst()",
"operand2",
"operand.removeFirst()",
"operand.removeFirst",
"operand",
"operand.offerFirst(operand2 + operand1)",
"operand.offerFirst",
"operand",
"operand2 + operand1",
"operand2",
"operand1",
"if (str.equals(\"-\")) {\n operand1 = operand.removeFirst();\n operand2 = operand.removeFirst();\n operand.offerFirst(operand2 - operand1);\n\n } else if (str.equals(\"*\")) {\n operand1 = operand.removeFirst();\n operand2 = operand.removeFirst();\n operand.offerFirst(operand2 * operand1);\n\n } else {\n operand.offerFirst(Integer.parseInt(str));\n }",
"str.equals(\"-\")",
"str.equals",
"str",
"\"-\"",
"{\n operand1 = operand.removeFirst();\n operand2 = operand.removeFirst();\n operand.offerFirst(operand2 - operand1);\n\n }",
"operand1 = operand.removeFirst()",
"operand1",
"operand.removeFirst()",
"operand.removeFirst",
"operand",
"operand2 = operand.removeFirst()",
"operand2",
"operand.removeFirst()",
"operand.removeFirst",
"operand",
"operand.offerFirst(operand2 - operand1)",
"operand.offerFirst",
"operand",
"operand2 - operand1",
"operand2",
"operand1",
"if (str.equals(\"*\")) {\n operand1 = operand.removeFirst();\n operand2 = operand.removeFirst();\n operand.offerFirst(operand2 * operand1);\n\n } else {\n operand.offerFirst(Integer.parseInt(str));\n }",
"str.equals(\"*\")",
"str.equals",
"str",
"\"*\"",
"{\n operand1 = operand.removeFirst();\n operand2 = operand.removeFirst();\n operand.offerFirst(operand2 * operand1);\n\n }",
"operand1 = operand.removeFirst()",
"operand1",
"operand.removeFirst()",
"operand.removeFirst",
"operand",
"operand2 = operand.removeFirst()",
"operand2",
"operand.removeFirst()",
"operand.removeFirst",
"operand",
"operand.offerFirst(operand2 * operand1)",
"operand.offerFirst",
"operand",
"operand2 * operand1",
"operand2",
"operand1",
"{\n operand.offerFirst(Integer.parseInt(str));\n }",
"operand.offerFirst(Integer.parseInt(str))",
"operand.offerFirst",
"operand",
"Integer.parseInt(str)",
"Integer.parseInt",
"Integer",
"str",
"return operand.removeFirst();",
"operand.removeFirst()",
"operand.removeFirst",
"operand",
"String input",
"input"
] | import java.util.Scanner;
import java.util.Deque;
import java.util.ArrayDeque;
class Main {
public static void main(String... args) {
Scanner sc = new Scanner(System.in);
String input = sc.nextLine();
System.out.println(calc(input));
}
public static boolean inputIsOperand(String input) {
try {
Integer.parseInt(input);
return true;
} catch (NumberFormatException e) {
return false;
}
}
public static int calc(String input) {
Deque<Integer> operand = new ArrayDeque<Integer>(100000);
String[] inputs = input.split(" ");
int operand1, operand2;
int result = 0;
for (String str : inputs) {
if (str.equals("+")) {
operand1 = operand.removeFirst();
operand2 = operand.removeFirst();
operand.offerFirst(operand2 + operand1);
} else if (str.equals("-")) {
operand1 = operand.removeFirst();
operand2 = operand.removeFirst();
operand.offerFirst(operand2 - operand1);
} else if (str.equals("*")) {
operand1 = operand.removeFirst();
operand2 = operand.removeFirst();
operand.offerFirst(operand2 * operand1);
} else {
operand.offerFirst(Integer.parseInt(str));
}
}
return operand.removeFirst();
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
41,
13,
20,
41,
13,
41,
13,
12,
13,
30,
14,
2,
4,
18,
13,
17,
17,
29,
2,
13,
13,
14,
2,
4,
18,
13,
17,
17,
29,
2,
13,
13,
29,
2,
13,
13,
23,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
0,
13,
20,
42,
4,
18,
13,
30,
14,
4,
18,
13,
4,
18,
13,
4,
18,
13,
30,
0,
13,
4,
18,
13,
0,
13,
4,
18,
13,
4,
18,
13,
4,
13,
4,
18,
13,
4,
18,
18,
13,
13,
4,
18,
13,
23,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
10,
11
],
[
10,
12
],
[
12,
13
],
[
12,
14
],
[
10,
15
],
[
15,
16
],
[
10,
17
],
[
17,
18
],
[
10,
19
],
[
19,
20
],
[
19,
21
],
[
21,
22
],
[
22,
23
],
[
23,
24
],
[
24,
25
],
[
25,
26
],
[
24,
27
],
[
23,
28
],
[
22,
29
],
[
29,
30
],
[
30,
31
],
[
30,
32
],
[
22,
33
],
[
33,
34
],
[
34,
35
],
[
35,
36
],
[
36,
37
],
[
35,
38
],
[
34,
39
],
[
33,
40
],
[
40,
41
],
[
41,
42
],
[
41,
43
],
[
21,
44
],
[
44,
45
],
[
45,
46
],
[
45,
47
],
[
19,
48
],
[
48,
49
],
[
10,
50
],
[
50,
51
],
[
50,
52
],
[
52,
53
],
[
53,
54
],
[
53,
55
],
[
52,
56
],
[
56,
57
],
[
56,
58
],
[
58,
59
],
[
59,
60
],
[
52,
61
],
[
61,
62
],
[
61,
63
],
[
52,
64
],
[
64,
65
],
[
65,
66
],
[
66,
67
],
[
64,
68
],
[
68,
69
],
[
69,
70
],
[
70,
71
],
[
71,
72
],
[
69,
73
],
[
73,
74
],
[
74,
75
],
[
73,
76
],
[
76,
77
],
[
77,
78
],
[
69,
79
],
[
79,
80
],
[
80,
81
],
[
80,
82
],
[
82,
83
],
[
83,
84
],
[
79,
85
],
[
85,
86
],
[
85,
87
],
[
87,
88
],
[
88,
89
],
[
79,
90
],
[
90,
91
],
[
91,
92
],
[
90,
93
],
[
93,
94
],
[
93,
95
],
[
95,
96
],
[
96,
97
],
[
52,
98
],
[
98,
99
],
[
99,
100
],
[
100,
101
],
[
100,
102
],
[
98,
103
],
[
103,
104
],
[
104,
105
],
[
50,
106
],
[
106,
107
]
] | [
"import java.util.Scanner;\nimport java.util.Stack;\nimport java.io.*;\n\nclass Main {\n static Stack<Integer> ans = new Stack<>();\n static int a;\n static int b;\n\n private static int compute(String s){\n if (s.charAt(0) == '+') return b + a;\n else if ( s.charAt(0) == '-') return b - a;\n\n return b * a;\n }\n\n public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n String s = sc.nextLine();\n sc = new Scanner(s);\n\n while(sc.hasNext()){\n if(sc.hasNextInt())\n ans.push(sc.nextInt());\n else{\n a = ans.pop();\n b = ans.pop();\n ans.push(compute(sc.next()));\n }\n }\n System.out.println(ans.pop());\n }\n}\n",
"import java.util.Scanner;",
"Scanner",
"java.util",
"import java.util.Stack;",
"Stack",
"java.util",
"import java.io.*;",
"io.*",
"java",
"class Main {\n static Stack<Integer> ans = new Stack<>();\n static int a;\n static int b;\n\n private static int compute(String s){\n if (s.charAt(0) == '+') return b + a;\n else if ( s.charAt(0) == '-') return b - a;\n\n return b * a;\n }\n\n public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n String s = sc.nextLine();\n sc = new Scanner(s);\n\n while(sc.hasNext()){\n if(sc.hasNextInt())\n ans.push(sc.nextInt());\n else{\n a = ans.pop();\n b = ans.pop();\n ans.push(compute(sc.next()));\n }\n }\n System.out.println(ans.pop());\n }\n}",
"Main",
"static Stack<Integer> ans = new Stack<>();",
"ans",
"new Stack<>()",
"static int a;",
"a",
"static int b;",
"b",
"private static int compute(String s){\n if (s.charAt(0) == '+') return b + a;\n else if ( s.charAt(0) == '-') return b - a;\n\n return b * a;\n }",
"compute",
"{\n if (s.charAt(0) == '+') return b + a;\n else if ( s.charAt(0) == '-') return b - a;\n\n return b * a;\n }",
"if (s.charAt(0) == '+') return b + a;\n else if ( s.charAt(0) == '-') return b - a;",
"s.charAt(0) == '+'",
"s.charAt(0)",
"s.charAt",
"s",
"0",
"'+'",
"return b + a;",
"b + a",
"b",
"a",
"if ( s.charAt(0) == '-') return b - a;",
"s.charAt(0) == '-'",
"s.charAt(0)",
"s.charAt",
"s",
"0",
"'-'",
"return b - a;",
"b - a",
"b",
"a",
"return b * a;",
"b * a",
"b",
"a",
"String s",
"s",
"public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n String s = sc.nextLine();\n sc = new Scanner(s);\n\n while(sc.hasNext()){\n if(sc.hasNextInt())\n ans.push(sc.nextInt());\n else{\n a = ans.pop();\n b = ans.pop();\n ans.push(compute(sc.next()));\n }\n }\n System.out.println(ans.pop());\n }",
"main",
"{\n Scanner sc = new Scanner(System.in);\n String s = sc.nextLine();\n sc = new Scanner(s);\n\n while(sc.hasNext()){\n if(sc.hasNextInt())\n ans.push(sc.nextInt());\n else{\n a = ans.pop();\n b = ans.pop();\n ans.push(compute(sc.next()));\n }\n }\n System.out.println(ans.pop());\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"String s = sc.nextLine();",
"s",
"sc.nextLine()",
"sc.nextLine",
"sc",
"sc = new Scanner(s)",
"sc",
"new Scanner(s)",
"while(sc.hasNext()){\n if(sc.hasNextInt())\n ans.push(sc.nextInt());\n else{\n a = ans.pop();\n b = ans.pop();\n ans.push(compute(sc.next()));\n }\n }",
"sc.hasNext()",
"sc.hasNext",
"sc",
"{\n if(sc.hasNextInt())\n ans.push(sc.nextInt());\n else{\n a = ans.pop();\n b = ans.pop();\n ans.push(compute(sc.next()));\n }\n }",
"if(sc.hasNextInt())\n ans.push(sc.nextInt());\n else{\n a = ans.pop();\n b = ans.pop();\n ans.push(compute(sc.next()));\n }",
"sc.hasNextInt()",
"sc.hasNextInt",
"sc",
"ans.push(sc.nextInt())",
"ans.push",
"ans",
"sc.nextInt()",
"sc.nextInt",
"sc",
"{\n a = ans.pop();\n b = ans.pop();\n ans.push(compute(sc.next()));\n }",
"a = ans.pop()",
"a",
"ans.pop()",
"ans.pop",
"ans",
"b = ans.pop()",
"b",
"ans.pop()",
"ans.pop",
"ans",
"ans.push(compute(sc.next()))",
"ans.push",
"ans",
"compute(sc.next())",
"compute",
"sc.next()",
"sc.next",
"sc",
"System.out.println(ans.pop())",
"System.out.println",
"System.out",
"System",
"System.out",
"ans.pop()",
"ans.pop",
"ans",
"String[] args",
"args"
] | import java.util.Scanner;
import java.util.Stack;
import java.io.*;
class Main {
static Stack<Integer> ans = new Stack<>();
static int a;
static int b;
private static int compute(String s){
if (s.charAt(0) == '+') return b + a;
else if ( s.charAt(0) == '-') return b - a;
return b * a;
}
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
String s = sc.nextLine();
sc = new Scanner(s);
while(sc.hasNext()){
if(sc.hasNextInt())
ans.push(sc.nextInt());
else{
a = ans.pop();
b = ans.pop();
ans.push(compute(sc.next()));
}
}
System.out.println(ans.pop());
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
41,
13,
20,
17,
41,
13,
20,
17,
41,
13,
20,
17,
41,
13,
17,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
20,
41,
13,
17,
42,
4,
18,
13,
30,
0,
18,
13,
13,
4,
18,
13,
40,
13,
41,
13,
17,
42,
2,
18,
13,
13,
17,
30,
41,
13,
18,
13,
13,
14,
4,
18,
13,
17,
30,
4,
13,
17,
14,
4,
18,
13,
17,
30,
4,
13,
17,
14,
4,
18,
13,
17,
30,
4,
13,
17,
30,
41,
13,
4,
18,
13,
13,
4,
13,
13,
40,
13,
4,
18,
18,
13,
13,
18,
13,
17,
23,
13,
12,
13,
30,
41,
13,
41,
13,
18,
13,
17,
41,
13,
18,
13,
17,
14,
2,
13,
17,
30,
0,
13,
2,
13,
13,
14,
2,
13,
17,
30,
0,
13,
2,
13,
13,
30,
0,
13,
2,
13,
13,
11,
1,
41,
13,
17,
2,
13,
2,
18,
13,
13,
17,
1,
40,
13,
30,
30,
0,
18,
13,
13,
18,
13,
13,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
2,
13,
17,
18,
13,
13,
0,
18,
13,
17,
13,
23,
13,
12,
13,
30,
11,
1,
41,
13,
17,
2,
13,
2,
18,
13,
13,
17,
1,
40,
13,
30,
30,
0,
18,
13,
13,
18,
13,
13,
11,
1,
41,
13,
17,
2,
13,
2,
18,
13,
13,
17,
1,
40,
13,
30,
30,
0,
18,
13,
2,
13,
17,
18,
13,
13,
0,
18,
13,
17,
13,
23,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
10,
11
],
[
10,
12
],
[
0,
13
],
[
13,
14
],
[
13,
15
],
[
15,
16
],
[
15,
17
],
[
13,
19
],
[
19,
20
],
[
19,
21
],
[
13,
23
],
[
23,
24
],
[
23,
25
],
[
13,
27
],
[
27,
28
],
[
27,
29
],
[
13,
30
],
[
30,
31
],
[
30,
32
],
[
32,
33
],
[
33,
34
],
[
33,
35
],
[
32,
36
],
[
36,
37
],
[
36,
38
],
[
38,
39
],
[
39,
40
],
[
32,
41
],
[
41,
42
],
[
41,
43
],
[
32,
44
],
[
44,
45
],
[
44,
46
],
[
32,
47
],
[
47,
48
],
[
48,
49
],
[
49,
50
],
[
47,
51
],
[
51,
52
],
[
52,
53
],
[
53,
54
],
[
53,
55
],
[
52,
56
],
[
56,
57
],
[
57,
58
],
[
51,
59
],
[
59,
60
],
[
32,
61
],
[
61,
62
],
[
61,
63
],
[
32,
64
],
[
64,
65
],
[
65,
66
],
[
66,
67
],
[
66,
68
],
[
65,
69
],
[
64,
70
],
[
70,
71
],
[
71,
72
],
[
71,
73
],
[
73,
74
],
[
73,
75
],
[
70,
76
],
[
76,
77
],
[
77,
78
],
[
78,
79
],
[
77,
80
],
[
76,
81
],
[
81,
82
],
[
82,
83
],
[
82,
84
],
[
76,
85
],
[
85,
86
],
[
86,
87
],
[
87,
88
],
[
86,
89
],
[
85,
90
],
[
90,
91
],
[
91,
92
],
[
91,
93
],
[
85,
94
],
[
94,
95
],
[
95,
96
],
[
96,
97
],
[
95,
98
],
[
94,
99
],
[
99,
100
],
[
100,
101
],
[
100,
102
],
[
94,
103
],
[
103,
104
],
[
104,
105
],
[
104,
106
],
[
106,
107
],
[
107,
108
],
[
106,
109
],
[
103,
110
],
[
110,
111
],
[
110,
112
],
[
70,
113
],
[
113,
114
],
[
32,
115
],
[
115,
116
],
[
116,
117
],
[
117,
118
],
[
117,
119
],
[
115,
120
],
[
120,
121
],
[
120,
122
],
[
30,
123
],
[
123,
124
],
[
13,
125
],
[
125,
126
],
[
125,
127
],
[
127,
128
],
[
128,
129
],
[
127,
130
],
[
130,
131
],
[
130,
132
],
[
132,
133
],
[
132,
134
],
[
127,
135
],
[
135,
136
],
[
135,
137
],
[
137,
138
],
[
137,
139
],
[
127,
140
],
[
140,
141
],
[
141,
142
],
[
141,
143
],
[
140,
144
],
[
144,
145
],
[
145,
146
],
[
145,
147
],
[
147,
148
],
[
147,
149
],
[
140,
150
],
[
150,
151
],
[
151,
152
],
[
151,
153
],
[
150,
154
],
[
154,
155
],
[
155,
156
],
[
155,
157
],
[
157,
158
],
[
157,
159
],
[
150,
160
],
[
160,
161
],
[
161,
162
],
[
161,
163
],
[
163,
164
],
[
163,
165
],
[
127,
166
],
[
166,
167
],
[
167,
168
],
[
168,
169
],
[
168,
170
],
[
166,
171
],
[
171,
172
],
[
171,
173
],
[
173,
174
],
[
174,
175
],
[
174,
176
],
[
173,
177
],
[
166,
178
],
[
178,
179
],
[
179,
180
],
[
166,
181
],
[
182,
182
],
[
182,
183
],
[
183,
184
],
[
184,
185
],
[
184,
186
],
[
183,
187
],
[
187,
188
],
[
187,
189
],
[
127,
190
],
[
190,
191
],
[
191,
192
],
[
192,
193
],
[
192,
194
],
[
190,
195
],
[
195,
196
],
[
195,
197
],
[
197,
198
],
[
197,
199
],
[
190,
200
],
[
200,
201
],
[
201,
202
],
[
190,
203
],
[
204,
204
],
[
204,
205
],
[
205,
206
],
[
206,
207
],
[
206,
208
],
[
208,
209
],
[
208,
210
],
[
205,
211
],
[
211,
212
],
[
211,
213
],
[
127,
214
],
[
214,
215
],
[
215,
216
],
[
215,
217
],
[
214,
218
],
[
125,
219
],
[
219,
220
],
[
13,
221
],
[
221,
222
],
[
221,
223
],
[
223,
224
],
[
224,
225
],
[
225,
226
],
[
226,
227
],
[
226,
228
],
[
224,
229
],
[
229,
230
],
[
229,
231
],
[
231,
232
],
[
232,
233
],
[
232,
234
],
[
231,
235
],
[
224,
236
],
[
236,
237
],
[
237,
238
],
[
224,
239
],
[
240,
240
],
[
240,
241
],
[
241,
242
],
[
242,
243
],
[
242,
244
],
[
241,
245
],
[
245,
246
],
[
245,
247
],
[
223,
248
],
[
248,
249
],
[
249,
250
],
[
250,
251
],
[
250,
252
],
[
248,
253
],
[
253,
254
],
[
253,
255
],
[
255,
256
],
[
256,
257
],
[
256,
258
],
[
255,
259
],
[
248,
260
],
[
260,
261
],
[
261,
262
],
[
248,
263
],
[
264,
264
],
[
264,
265
],
[
265,
266
],
[
266,
267
],
[
266,
268
],
[
268,
269
],
[
268,
270
],
[
265,
271
],
[
271,
272
],
[
271,
273
],
[
223,
274
],
[
274,
275
],
[
275,
276
],
[
275,
277
],
[
274,
278
],
[
221,
279
],
[
279,
280
]
] | [
"import java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\nimport java.util.*;\n\n\nclass Main {\n\t//計算用array\n\tstatic int[] array = new int[101];\n\tstatic int[] temporary = new int[102];\n\t//ただ読み込むのみ\n\tstatic String[] read = new String[300];\n\t//計算用arrayのindex\n\tstatic int count = 0;\n\t\n\tpublic static void main(String[] args) throws IOException{\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\t\n\t\t\tString string = br.readLine();\n\t\t\tStringTokenizer tokenizer = new StringTokenizer(string,\" \");\n\t\t\t//一度すべて読み込んでしまう\n\t\t\tint i = 0;\n\t\t\twhile (tokenizer.hasMoreTokens()) {\n\t\t\t\tread[i] = tokenizer.nextToken();\n\t\t\t\ti++;\n\t\t\t}\n\t\t\t\n\t\t\tint j =0;\n\t\t\twhile(read[j]!=null){\n\t\t\t\t\n\t\t\t\tString next = read[j];\n\t\t\t\tif(next.equals(\"+\")){\n\t\t\t\t\tpopcalc(0);\n\t\t\t\t}else if(next.equals(\"-\")){\n\t\t\t\t\tpopcalc(1);\n\t\t\t\t}else if (next.equals(\"*\")) {\n\t\t\t\t\tpopcalc(2);\n\t\t\t\t}else{\n\t\t\t\t\tint number = Integer.parseInt(next);\n\t\t\t\t\tpush(number);\n\t\t\t\t}\n\t\t\t\n\t\t\t\tj++;\n\t\t\t}\n\t\t\t\n\t\tSystem.out.println(array[0]);\n\t}\n\n\t\n\t//popメソッド\n\tpublic static void popcalc(int judge) {\n\t//上から2個とる、1つずつずらす、計算結果をpushする。\n\t\tint answer;\n\t\tint first = array[0];\n\t\tint second = array[1];\n\t\t\n\t\t//先に計算\n\t\tif(judge == 0){\n\t\t\t//足し算\n\t\t\t//System.out.println(\"たしざん\");\n\t\t\tanswer=first+second;\n\t\t}else if (judge == 1) {\n\t\t\t//引き算\n\t\t\tanswer=second-first;\n\t\t}else{\n\t\t\tanswer=first*second;\n\t\t}\n\t\t//コピー\n\t\tfor(int i=0;i<array.length-1;i++){\n\t\t\ttemporary[i] = array[i];\n\t\t}\n\t\tfor(int i=2;i<array.length;i++){\n\t\t\tarray[i-1]=temporary[i];\n\t\t}\n\t\tarray[0]=answer;\n\t}\n\t\n\t\n\t//pushメソッド\n\tpublic static void push(int number){\n\t\t//numberを0番目に、それぞれ一個ずつずらしていく\n\t\t\n\t\t//同じ配列を複製\n\t\tfor(int i=0;i<array.length-1;i++){\n\t\t\ttemporary[i] = array[i];\n\t\t}\n\t\tfor(int i =0;i<array.length-1;i++){\n\t\t\tarray[i+1] = temporary[i];\n\t\t}\n\t\tarray[0]=number;\n\t}\n}",
"import java.io.BufferedReader;",
"BufferedReader",
"java.io",
"import java.io.IOException;",
"IOException",
"java.io",
"import java.io.InputStreamReader;",
"InputStreamReader",
"java.io",
"import java.util.*;",
"util.*",
"java",
"class Main {\n\t//計算用array\n\tstatic int[] array = new int[101];\n\tstatic int[] temporary = new int[102];\n\t//ただ読み込むのみ\n\tstatic String[] read = new String[300];\n\t//計算用arrayのindex\n\tstatic int count = 0;\n\t\n\tpublic static void main(String[] args) throws IOException{\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\t\n\t\t\tString string = br.readLine();\n\t\t\tStringTokenizer tokenizer = new StringTokenizer(string,\" \");\n\t\t\t//一度すべて読み込んでしまう\n\t\t\tint i = 0;\n\t\t\twhile (tokenizer.hasMoreTokens()) {\n\t\t\t\tread[i] = tokenizer.nextToken();\n\t\t\t\ti++;\n\t\t\t}\n\t\t\t\n\t\t\tint j =0;\n\t\t\twhile(read[j]!=null){\n\t\t\t\t\n\t\t\t\tString next = read[j];\n\t\t\t\tif(next.equals(\"+\")){\n\t\t\t\t\tpopcalc(0);\n\t\t\t\t}else if(next.equals(\"-\")){\n\t\t\t\t\tpopcalc(1);\n\t\t\t\t}else if (next.equals(\"*\")) {\n\t\t\t\t\tpopcalc(2);\n\t\t\t\t}else{\n\t\t\t\t\tint number = Integer.parseInt(next);\n\t\t\t\t\tpush(number);\n\t\t\t\t}\n\t\t\t\n\t\t\t\tj++;\n\t\t\t}\n\t\t\t\n\t\tSystem.out.println(array[0]);\n\t}\n\n\t\n\t//popメソッド\n\tpublic static void popcalc(int judge) {\n\t//上から2個とる、1つずつずらす、計算結果をpushする。\n\t\tint answer;\n\t\tint first = array[0];\n\t\tint second = array[1];\n\t\t\n\t\t//先に計算\n\t\tif(judge == 0){\n\t\t\t//足し算\n\t\t\t//System.out.println(\"たしざん\");\n\t\t\tanswer=first+second;\n\t\t}else if (judge == 1) {\n\t\t\t//引き算\n\t\t\tanswer=second-first;\n\t\t}else{\n\t\t\tanswer=first*second;\n\t\t}\n\t\t//コピー\n\t\tfor(int i=0;i<array.length-1;i++){\n\t\t\ttemporary[i] = array[i];\n\t\t}\n\t\tfor(int i=2;i<array.length;i++){\n\t\t\tarray[i-1]=temporary[i];\n\t\t}\n\t\tarray[0]=answer;\n\t}\n\t\n\t\n\t//pushメソッド\n\tpublic static void push(int number){\n\t\t//numberを0番目に、それぞれ一個ずつずらしていく\n\t\t\n\t\t//同じ配列を複製\n\t\tfor(int i=0;i<array.length-1;i++){\n\t\t\ttemporary[i] = array[i];\n\t\t}\n\t\tfor(int i =0;i<array.length-1;i++){\n\t\t\tarray[i+1] = temporary[i];\n\t\t}\n\t\tarray[0]=number;\n\t}\n}",
"Main",
"//計算用array\n\tstatic int[] array = new int[101];",
"array",
"new int[101]",
"101",
"static int[] temporary = new int[102];",
"temporary",
"new int[102]",
"102",
"//ただ読み込むのみ\n\tstatic String[] read = new String[300];",
"read",
"new String[300]",
"300",
"//計算用arrayのindex\n\tstatic int count = 0;",
"count",
"0",
"public static void main(String[] args) throws IOException{\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\t\n\t\t\tString string = br.readLine();\n\t\t\tStringTokenizer tokenizer = new StringTokenizer(string,\" \");\n\t\t\t//一度すべて読み込んでしまう\n\t\t\tint i = 0;\n\t\t\twhile (tokenizer.hasMoreTokens()) {\n\t\t\t\tread[i] = tokenizer.nextToken();\n\t\t\t\ti++;\n\t\t\t}\n\t\t\t\n\t\t\tint j =0;\n\t\t\twhile(read[j]!=null){\n\t\t\t\t\n\t\t\t\tString next = read[j];\n\t\t\t\tif(next.equals(\"+\")){\n\t\t\t\t\tpopcalc(0);\n\t\t\t\t}else if(next.equals(\"-\")){\n\t\t\t\t\tpopcalc(1);\n\t\t\t\t}else if (next.equals(\"*\")) {\n\t\t\t\t\tpopcalc(2);\n\t\t\t\t}else{\n\t\t\t\t\tint number = Integer.parseInt(next);\n\t\t\t\t\tpush(number);\n\t\t\t\t}\n\t\t\t\n\t\t\t\tj++;\n\t\t\t}\n\t\t\t\n\t\tSystem.out.println(array[0]);\n\t}",
"main",
"{\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\t\n\t\t\tString string = br.readLine();\n\t\t\tStringTokenizer tokenizer = new StringTokenizer(string,\" \");\n\t\t\t//一度すべて読み込んでしまう\n\t\t\tint i = 0;\n\t\t\twhile (tokenizer.hasMoreTokens()) {\n\t\t\t\tread[i] = tokenizer.nextToken();\n\t\t\t\ti++;\n\t\t\t}\n\t\t\t\n\t\t\tint j =0;\n\t\t\twhile(read[j]!=null){\n\t\t\t\t\n\t\t\t\tString next = read[j];\n\t\t\t\tif(next.equals(\"+\")){\n\t\t\t\t\tpopcalc(0);\n\t\t\t\t}else if(next.equals(\"-\")){\n\t\t\t\t\tpopcalc(1);\n\t\t\t\t}else if (next.equals(\"*\")) {\n\t\t\t\t\tpopcalc(2);\n\t\t\t\t}else{\n\t\t\t\t\tint number = Integer.parseInt(next);\n\t\t\t\t\tpush(number);\n\t\t\t\t}\n\t\t\t\n\t\t\t\tj++;\n\t\t\t}\n\t\t\t\n\t\tSystem.out.println(array[0]);\n\t}",
"BufferedReader br = new BufferedReader(new InputStreamReader(System.in));",
"br",
"new BufferedReader(new InputStreamReader(System.in))",
"String string = br.readLine();",
"string",
"br.readLine()",
"br.readLine",
"br",
"StringTokenizer tokenizer = new StringTokenizer(string,\" \");",
"tokenizer",
"new StringTokenizer(string,\" \")",
"int i = 0;",
"i",
"0",
"while (tokenizer.hasMoreTokens()) {\n\t\t\t\tread[i] = tokenizer.nextToken();\n\t\t\t\ti++;\n\t\t\t}",
"tokenizer.hasMoreTokens()",
"tokenizer.hasMoreTokens",
"tokenizer",
"{\n\t\t\t\tread[i] = tokenizer.nextToken();\n\t\t\t\ti++;\n\t\t\t}",
"read[i] = tokenizer.nextToken()",
"read[i]",
"read",
"i",
"tokenizer.nextToken()",
"tokenizer.nextToken",
"tokenizer",
"i++",
"i",
"int j =0;",
"j",
"0",
"while(read[j]!=null){\n\t\t\t\t\n\t\t\t\tString next = read[j];\n\t\t\t\tif(next.equals(\"+\")){\n\t\t\t\t\tpopcalc(0);\n\t\t\t\t}else if(next.equals(\"-\")){\n\t\t\t\t\tpopcalc(1);\n\t\t\t\t}else if (next.equals(\"*\")) {\n\t\t\t\t\tpopcalc(2);\n\t\t\t\t}else{\n\t\t\t\t\tint number = Integer.parseInt(next);\n\t\t\t\t\tpush(number);\n\t\t\t\t}\n\t\t\t\n\t\t\t\tj++;\n\t\t\t}",
"read[j]!=null",
"read[j]",
"read",
"j",
"null",
"{\n\t\t\t\t\n\t\t\t\tString next = read[j];\n\t\t\t\tif(next.equals(\"+\")){\n\t\t\t\t\tpopcalc(0);\n\t\t\t\t}else if(next.equals(\"-\")){\n\t\t\t\t\tpopcalc(1);\n\t\t\t\t}else if (next.equals(\"*\")) {\n\t\t\t\t\tpopcalc(2);\n\t\t\t\t}else{\n\t\t\t\t\tint number = Integer.parseInt(next);\n\t\t\t\t\tpush(number);\n\t\t\t\t}\n\t\t\t\n\t\t\t\tj++;\n\t\t\t}",
"String next = read[j];",
"next",
"read[j]",
"read",
"j",
"if(next.equals(\"+\")){\n\t\t\t\t\tpopcalc(0);\n\t\t\t\t}else if(next.equals(\"-\")){\n\t\t\t\t\tpopcalc(1);\n\t\t\t\t}else if (next.equals(\"*\")) {\n\t\t\t\t\tpopcalc(2);\n\t\t\t\t}else{\n\t\t\t\t\tint number = Integer.parseInt(next);\n\t\t\t\t\tpush(number);\n\t\t\t\t}",
"next.equals(\"+\")",
"next.equals",
"next",
"\"+\"",
"{\n\t\t\t\t\tpopcalc(0);\n\t\t\t\t}",
"popcalc(0)",
"popcalc",
"0",
"if(next.equals(\"-\")){\n\t\t\t\t\tpopcalc(1);\n\t\t\t\t}else if (next.equals(\"*\")) {\n\t\t\t\t\tpopcalc(2);\n\t\t\t\t}else{\n\t\t\t\t\tint number = Integer.parseInt(next);\n\t\t\t\t\tpush(number);\n\t\t\t\t}",
"next.equals(\"-\")",
"next.equals",
"next",
"\"-\"",
"{\n\t\t\t\t\tpopcalc(1);\n\t\t\t\t}",
"popcalc(1)",
"popcalc",
"1",
"if (next.equals(\"*\")) {\n\t\t\t\t\tpopcalc(2);\n\t\t\t\t}else{\n\t\t\t\t\tint number = Integer.parseInt(next);\n\t\t\t\t\tpush(number);\n\t\t\t\t}",
"next.equals(\"*\")",
"next.equals",
"next",
"\"*\"",
"{\n\t\t\t\t\tpopcalc(2);\n\t\t\t\t}",
"popcalc(2)",
"popcalc",
"2",
"{\n\t\t\t\t\tint number = Integer.parseInt(next);\n\t\t\t\t\tpush(number);\n\t\t\t\t}",
"int number = Integer.parseInt(next);",
"number",
"Integer.parseInt(next)",
"Integer.parseInt",
"Integer",
"next",
"push(number)",
"push",
"number",
"j++",
"j",
"System.out.println(array[0])",
"System.out.println",
"System.out",
"System",
"System.out",
"array[0]",
"array",
"0",
"String[] args",
"args",
"//popメソッド\n\tpublic static void popcalc(int judge) {\n\t//上から2個とる、1つずつずらす、計算結果をpushする。\n\t\tint answer;\n\t\tint first = array[0];\n\t\tint second = array[1];\n\t\t\n\t\t//先に計算\n\t\tif(judge == 0){\n\t\t\t//足し算\n\t\t\t//System.out.println(\"たしざん\");\n\t\t\tanswer=first+second;\n\t\t}else if (judge == 1) {\n\t\t\t//引き算\n\t\t\tanswer=second-first;\n\t\t}else{\n\t\t\tanswer=first*second;\n\t\t}\n\t\t//コピー\n\t\tfor(int i=0;i<array.length-1;i++){\n\t\t\ttemporary[i] = array[i];\n\t\t}\n\t\tfor(int i=2;i<array.length;i++){\n\t\t\tarray[i-1]=temporary[i];\n\t\t}\n\t\tarray[0]=answer;\n\t}",
"popcalc",
"{\n\t//上から2個とる、1つずつずらす、計算結果をpushする。\n\t\tint answer;\n\t\tint first = array[0];\n\t\tint second = array[1];\n\t\t\n\t\t//先に計算\n\t\tif(judge == 0){\n\t\t\t//足し算\n\t\t\t//System.out.println(\"たしざん\");\n\t\t\tanswer=first+second;\n\t\t}else if (judge == 1) {\n\t\t\t//引き算\n\t\t\tanswer=second-first;\n\t\t}else{\n\t\t\tanswer=first*second;\n\t\t}\n\t\t//コピー\n\t\tfor(int i=0;i<array.length-1;i++){\n\t\t\ttemporary[i] = array[i];\n\t\t}\n\t\tfor(int i=2;i<array.length;i++){\n\t\t\tarray[i-1]=temporary[i];\n\t\t}\n\t\tarray[0]=answer;\n\t}",
"int answer;",
"answer",
"int first = array[0];",
"first",
"array[0]",
"array",
"0",
"int second = array[1];",
"second",
"array[1]",
"array",
"1",
"if(judge == 0){\n\t\t\t//足し算\n\t\t\t//System.out.println(\"たしざん\");\n\t\t\tanswer=first+second;\n\t\t}else if (judge == 1) {\n\t\t\t//引き算\n\t\t\tanswer=second-first;\n\t\t}else{\n\t\t\tanswer=first*second;\n\t\t}",
"judge == 0",
"judge",
"0",
"{\n\t\t\t//足し算\n\t\t\t//System.out.println(\"たしざん\");\n\t\t\tanswer=first+second;\n\t\t}",
"answer=first+second",
"answer",
"first+second",
"first",
"second",
"if (judge == 1) {\n\t\t\t//引き算\n\t\t\tanswer=second-first;\n\t\t}else{\n\t\t\tanswer=first*second;\n\t\t}",
"judge == 1",
"judge",
"1",
"{\n\t\t\t//引き算\n\t\t\tanswer=second-first;\n\t\t}",
"answer=second-first",
"answer",
"second-first",
"second",
"first",
"{\n\t\t\tanswer=first*second;\n\t\t}",
"answer=first*second",
"answer",
"first*second",
"first",
"second",
"for(int i=0;i<array.length-1;i++){\n\t\t\ttemporary[i] = array[i];\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<array.length-1",
"i",
"array.length-1",
"array.length",
"array",
"array.length",
"1",
"i++",
"i++",
"i",
"{\n\t\t\ttemporary[i] = array[i];\n\t\t}",
"{\n\t\t\ttemporary[i] = array[i];\n\t\t}",
"temporary[i] = array[i]",
"temporary[i]",
"temporary",
"i",
"array[i]",
"array",
"i",
"for(int i=2;i<array.length;i++){\n\t\t\tarray[i-1]=temporary[i];\n\t\t}",
"int i=2;",
"int i=2;",
"i",
"2",
"i<array.length",
"i",
"array.length",
"array",
"array.length",
"i++",
"i++",
"i",
"{\n\t\t\tarray[i-1]=temporary[i];\n\t\t}",
"{\n\t\t\tarray[i-1]=temporary[i];\n\t\t}",
"array[i-1]=temporary[i]",
"array[i-1]",
"array",
"i-1",
"i",
"1",
"temporary[i]",
"temporary",
"i",
"array[0]=answer",
"array[0]",
"array",
"0",
"answer",
"int judge",
"judge",
"//pushメソッド\n\tpublic static void push(int number){\n\t\t//numberを0番目に、それぞれ一個ずつずらしていく\n\t\t\n\t\t//同じ配列を複製\n\t\tfor(int i=0;i<array.length-1;i++){\n\t\t\ttemporary[i] = array[i];\n\t\t}\n\t\tfor(int i =0;i<array.length-1;i++){\n\t\t\tarray[i+1] = temporary[i];\n\t\t}\n\t\tarray[0]=number;\n\t}",
"push",
"{\n\t\t//numberを0番目に、それぞれ一個ずつずらしていく\n\t\t\n\t\t//同じ配列を複製\n\t\tfor(int i=0;i<array.length-1;i++){\n\t\t\ttemporary[i] = array[i];\n\t\t}\n\t\tfor(int i =0;i<array.length-1;i++){\n\t\t\tarray[i+1] = temporary[i];\n\t\t}\n\t\tarray[0]=number;\n\t}",
"for(int i=0;i<array.length-1;i++){\n\t\t\ttemporary[i] = array[i];\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<array.length-1",
"i",
"array.length-1",
"array.length",
"array",
"array.length",
"1",
"i++",
"i++",
"i",
"{\n\t\t\ttemporary[i] = array[i];\n\t\t}",
"{\n\t\t\ttemporary[i] = array[i];\n\t\t}",
"temporary[i] = array[i]",
"temporary[i]",
"temporary",
"i",
"array[i]",
"array",
"i",
"for(int i =0;i<array.length-1;i++){\n\t\t\tarray[i+1] = temporary[i];\n\t\t}",
"int i =0;",
"int i =0;",
"i",
"0",
"i<array.length-1",
"i",
"array.length-1",
"array.length",
"array",
"array.length",
"1",
"i++",
"i++",
"i",
"{\n\t\t\tarray[i+1] = temporary[i];\n\t\t}",
"{\n\t\t\tarray[i+1] = temporary[i];\n\t\t}",
"array[i+1] = temporary[i]",
"array[i+1]",
"array",
"i+1",
"i",
"1",
"temporary[i]",
"temporary",
"i",
"array[0]=number",
"array[0]",
"array",
"0",
"number",
"int number",
"number"
] | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;
class Main {
//計算用array
static int[] array = new int[101];
static int[] temporary = new int[102];
//ただ読み込むのみ
static String[] read = new String[300];
//計算用arrayのindex
static int count = 0;
public static void main(String[] args) throws IOException{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String string = br.readLine();
StringTokenizer tokenizer = new StringTokenizer(string," ");
//一度すべて読み込んでしまう
int i = 0;
while (tokenizer.hasMoreTokens()) {
read[i] = tokenizer.nextToken();
i++;
}
int j =0;
while(read[j]!=null){
String next = read[j];
if(next.equals("+")){
popcalc(0);
}else if(next.equals("-")){
popcalc(1);
}else if (next.equals("*")) {
popcalc(2);
}else{
int number = Integer.parseInt(next);
push(number);
}
j++;
}
System.out.println(array[0]);
}
//popメソッド
public static void popcalc(int judge) {
//上から2個とる、1つずつずらす、計算結果をpushする。
int answer;
int first = array[0];
int second = array[1];
//先に計算
if(judge == 0){
//足し算
//System.out.println("たしざん");
answer=first+second;
}else if (judge == 1) {
//引き算
answer=second-first;
}else{
answer=first*second;
}
//コピー
for(int i=0;i<array.length-1;i++){
temporary[i] = array[i];
}
for(int i=2;i<array.length;i++){
array[i-1]=temporary[i];
}
array[0]=answer;
}
//pushメソッド
public static void push(int number){
//numberを0番目に、それぞれ一個ずつずらしていく
//同じ配列を複製
for(int i=0;i<array.length-1;i++){
temporary[i] = array[i];
}
for(int i =0;i<array.length-1;i++){
array[i+1] = temporary[i];
}
array[0]=number;
}
} |
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
20,
41,
13,
17,
42,
4,
18,
13,
30,
14,
4,
18,
13,
30,
4,
18,
13,
4,
18,
13,
30,
41,
13,
4,
18,
13,
14,
4,
18,
13,
17,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
0,
13,
2,
13,
13,
4,
18,
13,
13,
14,
4,
18,
13,
17,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
0,
13,
2,
13,
13,
4,
18,
13,
13,
14,
4,
18,
13,
17,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
0,
13,
2,
13,
13,
4,
18,
13,
13,
14,
4,
18,
13,
17,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
0,
13,
2,
13,
13,
4,
18,
13,
13,
4,
18,
18,
13,
13,
13,
4,
18,
13,
4,
18,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
166,
8
],
[
166,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
12,
14
],
[
11,
15
],
[
15,
16
],
[
15,
17
],
[
11,
18
],
[
18,
19
],
[
18,
20
],
[
20,
21
],
[
21,
22
],
[
11,
23
],
[
23,
24
],
[
23,
25
],
[
11,
26
],
[
26,
27
],
[
26,
28
],
[
11,
29
],
[
29,
30
],
[
30,
31
],
[
31,
32
],
[
29,
33
],
[
33,
34
],
[
34,
35
],
[
35,
36
],
[
36,
37
],
[
34,
38
],
[
38,
39
],
[
39,
40
],
[
40,
41
],
[
39,
42
],
[
42,
43
],
[
43,
44
],
[
34,
45
],
[
45,
46
],
[
46,
47
],
[
46,
48
],
[
48,
49
],
[
49,
50
],
[
45,
51
],
[
51,
52
],
[
52,
53
],
[
53,
54
],
[
52,
55
],
[
51,
56
],
[
56,
57
],
[
57,
58
],
[
57,
59
],
[
59,
60
],
[
60,
61
],
[
56,
62
],
[
62,
63
],
[
62,
64
],
[
64,
65
],
[
65,
66
],
[
56,
67
],
[
67,
68
],
[
67,
69
],
[
69,
70
],
[
69,
71
],
[
56,
72
],
[
72,
73
],
[
73,
74
],
[
72,
75
],
[
51,
76
],
[
76,
77
],
[
77,
78
],
[
78,
79
],
[
77,
80
],
[
76,
81
],
[
81,
82
],
[
82,
83
],
[
82,
84
],
[
84,
85
],
[
85,
86
],
[
81,
87
],
[
87,
88
],
[
87,
89
],
[
89,
90
],
[
90,
91
],
[
81,
92
],
[
92,
93
],
[
92,
94
],
[
94,
95
],
[
94,
96
],
[
81,
97
],
[
97,
98
],
[
98,
99
],
[
97,
100
],
[
76,
101
],
[
101,
102
],
[
102,
103
],
[
103,
104
],
[
102,
105
],
[
101,
106
],
[
106,
107
],
[
107,
108
],
[
107,
109
],
[
109,
110
],
[
110,
111
],
[
106,
112
],
[
112,
113
],
[
112,
114
],
[
114,
115
],
[
115,
116
],
[
106,
117
],
[
117,
118
],
[
117,
119
],
[
119,
120
],
[
119,
121
],
[
106,
122
],
[
122,
123
],
[
123,
124
],
[
122,
125
],
[
101,
126
],
[
126,
127
],
[
127,
128
],
[
128,
129
],
[
127,
130
],
[
126,
131
],
[
131,
132
],
[
132,
133
],
[
132,
134
],
[
134,
135
],
[
135,
136
],
[
131,
137
],
[
137,
138
],
[
137,
139
],
[
139,
140
],
[
140,
141
],
[
131,
142
],
[
142,
143
],
[
142,
144
],
[
144,
145
],
[
144,
146
],
[
131,
147
],
[
147,
148
],
[
148,
149
],
[
147,
150
],
[
11,
151
],
[
151,
152
],
[
152,
153
],
[
153,
154
],
[
153,
155
],
[
151,
156
],
[
11,
157
],
[
157,
158
],
[
158,
159
],
[
11,
160
],
[
160,
161
],
[
161,
162
],
[
9,
163
],
[
163,
164
],
[
0,
165
],
[
165,
166
],
[
165,
167
]
] | [
"\nimport java.util.Scanner;\nimport java.util.Stack;\n\npublic class Main {\n\tpublic static void main(String[] args) {\n\t\t// TODO Auto-generated method stub\n\t\tScanner in = new Scanner(System.in);\n\t\tStack<Integer> pol = new Stack<Integer>();\n\t\tString start = in.nextLine();\n\t\tScanner in2 = new Scanner(start);\n\t\tint total = 0;\n\t\twhile(in2.hasNext()) {\n\t\t\tif(in2.hasNextInt()) {\n\t\t\t\tpol.push(in2.nextInt());\n\t\t\t} else {\n\t\t\t\tString op = in2.next();\n\t\t\t\tif(op.equals(\"+\")) {\n\t\t\t\t\tint second = pol.pop();\n\t\t\t\t\tint first = pol.pop();\n\t\t\t\t\ttotal = first + second;\n\t\t\t\t\tpol.push(total);\n\t\t\t\t} else if(op.equals(\"-\")) {\n\t\t\t\t\tint second = pol.pop();\n\t\t\t\t\tint first = pol.pop();\n\t\t\t\t\ttotal = first - second;\n\t\t\t\t\tpol.push(total);\n\t\t\t\t} else if(op.equals(\"*\")) {\n\t\t\t\t\tint second = pol.pop();\n\t\t\t\t\tint first = pol.pop();\n\t\t\t\t\ttotal = first * second;\n\t\t\t\t\tpol.push(total);\n\t\t\t\t} else if(op.equals(\"/\")) {\n\t\t\t\t\tint second = pol.pop();\n\t\t\t\t\tint first = pol.pop();\n\t\t\t\t\ttotal = first / second;\n\t\t\t\t\tpol.push(total);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(total);\n\t\tin.close();\n\t\tin2.close();\n\t}\n}\n",
"import java.util.Scanner;",
"Scanner",
"java.util",
"import java.util.Stack;",
"Stack",
"java.util",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\t// TODO Auto-generated method stub\n\t\tScanner in = new Scanner(System.in);\n\t\tStack<Integer> pol = new Stack<Integer>();\n\t\tString start = in.nextLine();\n\t\tScanner in2 = new Scanner(start);\n\t\tint total = 0;\n\t\twhile(in2.hasNext()) {\n\t\t\tif(in2.hasNextInt()) {\n\t\t\t\tpol.push(in2.nextInt());\n\t\t\t} else {\n\t\t\t\tString op = in2.next();\n\t\t\t\tif(op.equals(\"+\")) {\n\t\t\t\t\tint second = pol.pop();\n\t\t\t\t\tint first = pol.pop();\n\t\t\t\t\ttotal = first + second;\n\t\t\t\t\tpol.push(total);\n\t\t\t\t} else if(op.equals(\"-\")) {\n\t\t\t\t\tint second = pol.pop();\n\t\t\t\t\tint first = pol.pop();\n\t\t\t\t\ttotal = first - second;\n\t\t\t\t\tpol.push(total);\n\t\t\t\t} else if(op.equals(\"*\")) {\n\t\t\t\t\tint second = pol.pop();\n\t\t\t\t\tint first = pol.pop();\n\t\t\t\t\ttotal = first * second;\n\t\t\t\t\tpol.push(total);\n\t\t\t\t} else if(op.equals(\"/\")) {\n\t\t\t\t\tint second = pol.pop();\n\t\t\t\t\tint first = pol.pop();\n\t\t\t\t\ttotal = first / second;\n\t\t\t\t\tpol.push(total);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(total);\n\t\tin.close();\n\t\tin2.close();\n\t}\n}",
"Main",
"public static void main(String[] args) {\n\t\t// TODO Auto-generated method stub\n\t\tScanner in = new Scanner(System.in);\n\t\tStack<Integer> pol = new Stack<Integer>();\n\t\tString start = in.nextLine();\n\t\tScanner in2 = new Scanner(start);\n\t\tint total = 0;\n\t\twhile(in2.hasNext()) {\n\t\t\tif(in2.hasNextInt()) {\n\t\t\t\tpol.push(in2.nextInt());\n\t\t\t} else {\n\t\t\t\tString op = in2.next();\n\t\t\t\tif(op.equals(\"+\")) {\n\t\t\t\t\tint second = pol.pop();\n\t\t\t\t\tint first = pol.pop();\n\t\t\t\t\ttotal = first + second;\n\t\t\t\t\tpol.push(total);\n\t\t\t\t} else if(op.equals(\"-\")) {\n\t\t\t\t\tint second = pol.pop();\n\t\t\t\t\tint first = pol.pop();\n\t\t\t\t\ttotal = first - second;\n\t\t\t\t\tpol.push(total);\n\t\t\t\t} else if(op.equals(\"*\")) {\n\t\t\t\t\tint second = pol.pop();\n\t\t\t\t\tint first = pol.pop();\n\t\t\t\t\ttotal = first * second;\n\t\t\t\t\tpol.push(total);\n\t\t\t\t} else if(op.equals(\"/\")) {\n\t\t\t\t\tint second = pol.pop();\n\t\t\t\t\tint first = pol.pop();\n\t\t\t\t\ttotal = first / second;\n\t\t\t\t\tpol.push(total);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(total);\n\t\tin.close();\n\t\tin2.close();\n\t}",
"main",
"{\n\t\t// TODO Auto-generated method stub\n\t\tScanner in = new Scanner(System.in);\n\t\tStack<Integer> pol = new Stack<Integer>();\n\t\tString start = in.nextLine();\n\t\tScanner in2 = new Scanner(start);\n\t\tint total = 0;\n\t\twhile(in2.hasNext()) {\n\t\t\tif(in2.hasNextInt()) {\n\t\t\t\tpol.push(in2.nextInt());\n\t\t\t} else {\n\t\t\t\tString op = in2.next();\n\t\t\t\tif(op.equals(\"+\")) {\n\t\t\t\t\tint second = pol.pop();\n\t\t\t\t\tint first = pol.pop();\n\t\t\t\t\ttotal = first + second;\n\t\t\t\t\tpol.push(total);\n\t\t\t\t} else if(op.equals(\"-\")) {\n\t\t\t\t\tint second = pol.pop();\n\t\t\t\t\tint first = pol.pop();\n\t\t\t\t\ttotal = first - second;\n\t\t\t\t\tpol.push(total);\n\t\t\t\t} else if(op.equals(\"*\")) {\n\t\t\t\t\tint second = pol.pop();\n\t\t\t\t\tint first = pol.pop();\n\t\t\t\t\ttotal = first * second;\n\t\t\t\t\tpol.push(total);\n\t\t\t\t} else if(op.equals(\"/\")) {\n\t\t\t\t\tint second = pol.pop();\n\t\t\t\t\tint first = pol.pop();\n\t\t\t\t\ttotal = first / second;\n\t\t\t\t\tpol.push(total);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(total);\n\t\tin.close();\n\t\tin2.close();\n\t}",
"Scanner in = new Scanner(System.in);",
"in",
"new Scanner(System.in)",
"Stack<Integer> pol = new Stack<Integer>();",
"pol",
"new Stack<Integer>()",
"String start = in.nextLine();",
"start",
"in.nextLine()",
"in.nextLine",
"in",
"Scanner in2 = new Scanner(start);",
"in2",
"new Scanner(start)",
"int total = 0;",
"total",
"0",
"while(in2.hasNext()) {\n\t\t\tif(in2.hasNextInt()) {\n\t\t\t\tpol.push(in2.nextInt());\n\t\t\t} else {\n\t\t\t\tString op = in2.next();\n\t\t\t\tif(op.equals(\"+\")) {\n\t\t\t\t\tint second = pol.pop();\n\t\t\t\t\tint first = pol.pop();\n\t\t\t\t\ttotal = first + second;\n\t\t\t\t\tpol.push(total);\n\t\t\t\t} else if(op.equals(\"-\")) {\n\t\t\t\t\tint second = pol.pop();\n\t\t\t\t\tint first = pol.pop();\n\t\t\t\t\ttotal = first - second;\n\t\t\t\t\tpol.push(total);\n\t\t\t\t} else if(op.equals(\"*\")) {\n\t\t\t\t\tint second = pol.pop();\n\t\t\t\t\tint first = pol.pop();\n\t\t\t\t\ttotal = first * second;\n\t\t\t\t\tpol.push(total);\n\t\t\t\t} else if(op.equals(\"/\")) {\n\t\t\t\t\tint second = pol.pop();\n\t\t\t\t\tint first = pol.pop();\n\t\t\t\t\ttotal = first / second;\n\t\t\t\t\tpol.push(total);\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"in2.hasNext()",
"in2.hasNext",
"in2",
"{\n\t\t\tif(in2.hasNextInt()) {\n\t\t\t\tpol.push(in2.nextInt());\n\t\t\t} else {\n\t\t\t\tString op = in2.next();\n\t\t\t\tif(op.equals(\"+\")) {\n\t\t\t\t\tint second = pol.pop();\n\t\t\t\t\tint first = pol.pop();\n\t\t\t\t\ttotal = first + second;\n\t\t\t\t\tpol.push(total);\n\t\t\t\t} else if(op.equals(\"-\")) {\n\t\t\t\t\tint second = pol.pop();\n\t\t\t\t\tint first = pol.pop();\n\t\t\t\t\ttotal = first - second;\n\t\t\t\t\tpol.push(total);\n\t\t\t\t} else if(op.equals(\"*\")) {\n\t\t\t\t\tint second = pol.pop();\n\t\t\t\t\tint first = pol.pop();\n\t\t\t\t\ttotal = first * second;\n\t\t\t\t\tpol.push(total);\n\t\t\t\t} else if(op.equals(\"/\")) {\n\t\t\t\t\tint second = pol.pop();\n\t\t\t\t\tint first = pol.pop();\n\t\t\t\t\ttotal = first / second;\n\t\t\t\t\tpol.push(total);\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"if(in2.hasNextInt()) {\n\t\t\t\tpol.push(in2.nextInt());\n\t\t\t} else {\n\t\t\t\tString op = in2.next();\n\t\t\t\tif(op.equals(\"+\")) {\n\t\t\t\t\tint second = pol.pop();\n\t\t\t\t\tint first = pol.pop();\n\t\t\t\t\ttotal = first + second;\n\t\t\t\t\tpol.push(total);\n\t\t\t\t} else if(op.equals(\"-\")) {\n\t\t\t\t\tint second = pol.pop();\n\t\t\t\t\tint first = pol.pop();\n\t\t\t\t\ttotal = first - second;\n\t\t\t\t\tpol.push(total);\n\t\t\t\t} else if(op.equals(\"*\")) {\n\t\t\t\t\tint second = pol.pop();\n\t\t\t\t\tint first = pol.pop();\n\t\t\t\t\ttotal = first * second;\n\t\t\t\t\tpol.push(total);\n\t\t\t\t} else if(op.equals(\"/\")) {\n\t\t\t\t\tint second = pol.pop();\n\t\t\t\t\tint first = pol.pop();\n\t\t\t\t\ttotal = first / second;\n\t\t\t\t\tpol.push(total);\n\t\t\t\t}\n\t\t\t}",
"in2.hasNextInt()",
"in2.hasNextInt",
"in2",
"{\n\t\t\t\tpol.push(in2.nextInt());\n\t\t\t}",
"pol.push(in2.nextInt())",
"pol.push",
"pol",
"in2.nextInt()",
"in2.nextInt",
"in2",
"{\n\t\t\t\tString op = in2.next();\n\t\t\t\tif(op.equals(\"+\")) {\n\t\t\t\t\tint second = pol.pop();\n\t\t\t\t\tint first = pol.pop();\n\t\t\t\t\ttotal = first + second;\n\t\t\t\t\tpol.push(total);\n\t\t\t\t} else if(op.equals(\"-\")) {\n\t\t\t\t\tint second = pol.pop();\n\t\t\t\t\tint first = pol.pop();\n\t\t\t\t\ttotal = first - second;\n\t\t\t\t\tpol.push(total);\n\t\t\t\t} else if(op.equals(\"*\")) {\n\t\t\t\t\tint second = pol.pop();\n\t\t\t\t\tint first = pol.pop();\n\t\t\t\t\ttotal = first * second;\n\t\t\t\t\tpol.push(total);\n\t\t\t\t} else if(op.equals(\"/\")) {\n\t\t\t\t\tint second = pol.pop();\n\t\t\t\t\tint first = pol.pop();\n\t\t\t\t\ttotal = first / second;\n\t\t\t\t\tpol.push(total);\n\t\t\t\t}\n\t\t\t}",
"String op = in2.next();",
"op",
"in2.next()",
"in2.next",
"in2",
"if(op.equals(\"+\")) {\n\t\t\t\t\tint second = pol.pop();\n\t\t\t\t\tint first = pol.pop();\n\t\t\t\t\ttotal = first + second;\n\t\t\t\t\tpol.push(total);\n\t\t\t\t} else if(op.equals(\"-\")) {\n\t\t\t\t\tint second = pol.pop();\n\t\t\t\t\tint first = pol.pop();\n\t\t\t\t\ttotal = first - second;\n\t\t\t\t\tpol.push(total);\n\t\t\t\t} else if(op.equals(\"*\")) {\n\t\t\t\t\tint second = pol.pop();\n\t\t\t\t\tint first = pol.pop();\n\t\t\t\t\ttotal = first * second;\n\t\t\t\t\tpol.push(total);\n\t\t\t\t} else if(op.equals(\"/\")) {\n\t\t\t\t\tint second = pol.pop();\n\t\t\t\t\tint first = pol.pop();\n\t\t\t\t\ttotal = first / second;\n\t\t\t\t\tpol.push(total);\n\t\t\t\t}",
"op.equals(\"+\")",
"op.equals",
"op",
"\"+\"",
"{\n\t\t\t\t\tint second = pol.pop();\n\t\t\t\t\tint first = pol.pop();\n\t\t\t\t\ttotal = first + second;\n\t\t\t\t\tpol.push(total);\n\t\t\t\t}",
"int second = pol.pop();",
"second",
"pol.pop()",
"pol.pop",
"pol",
"int first = pol.pop();",
"first",
"pol.pop()",
"pol.pop",
"pol",
"total = first + second",
"total",
"first + second",
"first",
"second",
"pol.push(total)",
"pol.push",
"pol",
"total",
"if(op.equals(\"-\")) {\n\t\t\t\t\tint second = pol.pop();\n\t\t\t\t\tint first = pol.pop();\n\t\t\t\t\ttotal = first - second;\n\t\t\t\t\tpol.push(total);\n\t\t\t\t} else if(op.equals(\"*\")) {\n\t\t\t\t\tint second = pol.pop();\n\t\t\t\t\tint first = pol.pop();\n\t\t\t\t\ttotal = first * second;\n\t\t\t\t\tpol.push(total);\n\t\t\t\t} else if(op.equals(\"/\")) {\n\t\t\t\t\tint second = pol.pop();\n\t\t\t\t\tint first = pol.pop();\n\t\t\t\t\ttotal = first / second;\n\t\t\t\t\tpol.push(total);\n\t\t\t\t}",
"op.equals(\"-\")",
"op.equals",
"op",
"\"-\"",
"{\n\t\t\t\t\tint second = pol.pop();\n\t\t\t\t\tint first = pol.pop();\n\t\t\t\t\ttotal = first - second;\n\t\t\t\t\tpol.push(total);\n\t\t\t\t}",
"int second = pol.pop();",
"second",
"pol.pop()",
"pol.pop",
"pol",
"int first = pol.pop();",
"first",
"pol.pop()",
"pol.pop",
"pol",
"total = first - second",
"total",
"first - second",
"first",
"second",
"pol.push(total)",
"pol.push",
"pol",
"total",
"if(op.equals(\"*\")) {\n\t\t\t\t\tint second = pol.pop();\n\t\t\t\t\tint first = pol.pop();\n\t\t\t\t\ttotal = first * second;\n\t\t\t\t\tpol.push(total);\n\t\t\t\t} else if(op.equals(\"/\")) {\n\t\t\t\t\tint second = pol.pop();\n\t\t\t\t\tint first = pol.pop();\n\t\t\t\t\ttotal = first / second;\n\t\t\t\t\tpol.push(total);\n\t\t\t\t}",
"op.equals(\"*\")",
"op.equals",
"op",
"\"*\"",
"{\n\t\t\t\t\tint second = pol.pop();\n\t\t\t\t\tint first = pol.pop();\n\t\t\t\t\ttotal = first * second;\n\t\t\t\t\tpol.push(total);\n\t\t\t\t}",
"int second = pol.pop();",
"second",
"pol.pop()",
"pol.pop",
"pol",
"int first = pol.pop();",
"first",
"pol.pop()",
"pol.pop",
"pol",
"total = first * second",
"total",
"first * second",
"first",
"second",
"pol.push(total)",
"pol.push",
"pol",
"total",
"if(op.equals(\"/\")) {\n\t\t\t\t\tint second = pol.pop();\n\t\t\t\t\tint first = pol.pop();\n\t\t\t\t\ttotal = first / second;\n\t\t\t\t\tpol.push(total);\n\t\t\t\t}",
"op.equals(\"/\")",
"op.equals",
"op",
"\"/\"",
"{\n\t\t\t\t\tint second = pol.pop();\n\t\t\t\t\tint first = pol.pop();\n\t\t\t\t\ttotal = first / second;\n\t\t\t\t\tpol.push(total);\n\t\t\t\t}",
"int second = pol.pop();",
"second",
"pol.pop()",
"pol.pop",
"pol",
"int first = pol.pop();",
"first",
"pol.pop()",
"pol.pop",
"pol",
"total = first / second",
"total",
"first / second",
"first",
"second",
"pol.push(total)",
"pol.push",
"pol",
"total",
"System.out.println(total)",
"System.out.println",
"System.out",
"System",
"System.out",
"total",
"in.close()",
"in.close",
"in",
"in2.close()",
"in2.close",
"in2",
"String[] args",
"args",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\t// TODO Auto-generated method stub\n\t\tScanner in = new Scanner(System.in);\n\t\tStack<Integer> pol = new Stack<Integer>();\n\t\tString start = in.nextLine();\n\t\tScanner in2 = new Scanner(start);\n\t\tint total = 0;\n\t\twhile(in2.hasNext()) {\n\t\t\tif(in2.hasNextInt()) {\n\t\t\t\tpol.push(in2.nextInt());\n\t\t\t} else {\n\t\t\t\tString op = in2.next();\n\t\t\t\tif(op.equals(\"+\")) {\n\t\t\t\t\tint second = pol.pop();\n\t\t\t\t\tint first = pol.pop();\n\t\t\t\t\ttotal = first + second;\n\t\t\t\t\tpol.push(total);\n\t\t\t\t} else if(op.equals(\"-\")) {\n\t\t\t\t\tint second = pol.pop();\n\t\t\t\t\tint first = pol.pop();\n\t\t\t\t\ttotal = first - second;\n\t\t\t\t\tpol.push(total);\n\t\t\t\t} else if(op.equals(\"*\")) {\n\t\t\t\t\tint second = pol.pop();\n\t\t\t\t\tint first = pol.pop();\n\t\t\t\t\ttotal = first * second;\n\t\t\t\t\tpol.push(total);\n\t\t\t\t} else if(op.equals(\"/\")) {\n\t\t\t\t\tint second = pol.pop();\n\t\t\t\t\tint first = pol.pop();\n\t\t\t\t\ttotal = first / second;\n\t\t\t\t\tpol.push(total);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(total);\n\t\tin.close();\n\t\tin2.close();\n\t}\n}",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\t// TODO Auto-generated method stub\n\t\tScanner in = new Scanner(System.in);\n\t\tStack<Integer> pol = new Stack<Integer>();\n\t\tString start = in.nextLine();\n\t\tScanner in2 = new Scanner(start);\n\t\tint total = 0;\n\t\twhile(in2.hasNext()) {\n\t\t\tif(in2.hasNextInt()) {\n\t\t\t\tpol.push(in2.nextInt());\n\t\t\t} else {\n\t\t\t\tString op = in2.next();\n\t\t\t\tif(op.equals(\"+\")) {\n\t\t\t\t\tint second = pol.pop();\n\t\t\t\t\tint first = pol.pop();\n\t\t\t\t\ttotal = first + second;\n\t\t\t\t\tpol.push(total);\n\t\t\t\t} else if(op.equals(\"-\")) {\n\t\t\t\t\tint second = pol.pop();\n\t\t\t\t\tint first = pol.pop();\n\t\t\t\t\ttotal = first - second;\n\t\t\t\t\tpol.push(total);\n\t\t\t\t} else if(op.equals(\"*\")) {\n\t\t\t\t\tint second = pol.pop();\n\t\t\t\t\tint first = pol.pop();\n\t\t\t\t\ttotal = first * second;\n\t\t\t\t\tpol.push(total);\n\t\t\t\t} else if(op.equals(\"/\")) {\n\t\t\t\t\tint second = pol.pop();\n\t\t\t\t\tint first = pol.pop();\n\t\t\t\t\ttotal = first / second;\n\t\t\t\t\tpol.push(total);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(total);\n\t\tin.close();\n\t\tin2.close();\n\t}\n}",
"Main"
] |
import java.util.Scanner;
import java.util.Stack;
public class Main {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner in = new Scanner(System.in);
Stack<Integer> pol = new Stack<Integer>();
String start = in.nextLine();
Scanner in2 = new Scanner(start);
int total = 0;
while(in2.hasNext()) {
if(in2.hasNextInt()) {
pol.push(in2.nextInt());
} else {
String op = in2.next();
if(op.equals("+")) {
int second = pol.pop();
int first = pol.pop();
total = first + second;
pol.push(total);
} else if(op.equals("-")) {
int second = pol.pop();
int first = pol.pop();
total = first - second;
pol.push(total);
} else if(op.equals("*")) {
int second = pol.pop();
int first = pol.pop();
total = first * second;
pol.push(total);
} else if(op.equals("/")) {
int second = pol.pop();
int first = pol.pop();
total = first / second;
pol.push(total);
}
}
}
System.out.println(total);
in.close();
in2.close();
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
4,
18,
13,
4,
18,
18,
13,
13,
4,
13,
13,
23,
13,
12,
13,
30,
41,
13,
4,
18,
13,
17,
41,
13,
20,
28,
13,
13,
30,
30,
14,
4,
18,
13,
17,
30,
4,
18,
13,
13,
14,
4,
18,
13,
17,
30,
41,
13,
4,
18,
13,
4,
18,
13,
41,
13,
4,
18,
13,
4,
18,
13,
4,
18,
13,
4,
18,
13,
2,
13,
13,
14,
4,
18,
13,
17,
30,
41,
13,
4,
18,
13,
4,
18,
13,
41,
13,
4,
18,
13,
4,
18,
13,
4,
18,
13,
4,
18,
13,
2,
13,
13,
14,
4,
18,
13,
17,
30,
41,
13,
4,
18,
13,
4,
18,
13,
41,
13,
4,
18,
13,
4,
18,
13,
4,
18,
13,
4,
18,
13,
2,
13,
13,
29,
4,
18,
13,
4,
18,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
163,
8
],
[
163,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
12,
14
],
[
11,
15
],
[
15,
16
],
[
15,
17
],
[
17,
18
],
[
18,
19
],
[
11,
20
],
[
20,
21
],
[
21,
22
],
[
11,
23
],
[
23,
24
],
[
24,
25
],
[
25,
26
],
[
25,
27
],
[
23,
28
],
[
28,
29
],
[
28,
30
],
[
9,
31
],
[
31,
32
],
[
163,
33
],
[
33,
34
],
[
33,
35
],
[
35,
36
],
[
36,
37
],
[
36,
38
],
[
38,
39
],
[
39,
40
],
[
38,
41
],
[
35,
42
],
[
42,
43
],
[
42,
44
],
[
35,
45
],
[
45,
46
],
[
45,
47
],
[
45,
48
],
[
49,
49
],
[
49,
50
],
[
50,
51
],
[
51,
52
],
[
52,
53
],
[
51,
54
],
[
50,
55
],
[
55,
56
],
[
56,
57
],
[
57,
58
],
[
56,
59
],
[
50,
60
],
[
60,
61
],
[
61,
62
],
[
62,
63
],
[
61,
64
],
[
60,
65
],
[
65,
66
],
[
66,
67
],
[
66,
68
],
[
68,
69
],
[
69,
70
],
[
68,
71
],
[
71,
72
],
[
72,
73
],
[
65,
74
],
[
74,
75
],
[
74,
76
],
[
76,
77
],
[
77,
78
],
[
76,
79
],
[
79,
80
],
[
80,
81
],
[
65,
82
],
[
82,
83
],
[
83,
84
],
[
82,
85
],
[
85,
86
],
[
86,
87
],
[
85,
88
],
[
88,
89
],
[
88,
90
],
[
60,
91
],
[
91,
92
],
[
92,
93
],
[
93,
94
],
[
92,
95
],
[
91,
96
],
[
96,
97
],
[
97,
98
],
[
97,
99
],
[
99,
100
],
[
100,
101
],
[
99,
102
],
[
102,
103
],
[
103,
104
],
[
96,
105
],
[
105,
106
],
[
105,
107
],
[
107,
108
],
[
108,
109
],
[
107,
110
],
[
110,
111
],
[
111,
112
],
[
96,
113
],
[
113,
114
],
[
114,
115
],
[
113,
116
],
[
116,
117
],
[
117,
118
],
[
116,
119
],
[
119,
120
],
[
119,
121
],
[
91,
122
],
[
122,
123
],
[
123,
124
],
[
124,
125
],
[
123,
126
],
[
122,
127
],
[
127,
128
],
[
128,
129
],
[
128,
130
],
[
130,
131
],
[
131,
132
],
[
130,
133
],
[
133,
134
],
[
134,
135
],
[
127,
136
],
[
136,
137
],
[
136,
138
],
[
138,
139
],
[
139,
140
],
[
138,
141
],
[
141,
142
],
[
142,
143
],
[
127,
144
],
[
144,
145
],
[
145,
146
],
[
144,
147
],
[
147,
148
],
[
148,
149
],
[
147,
150
],
[
150,
151
],
[
150,
152
],
[
35,
153
],
[
153,
154
],
[
154,
155
],
[
155,
156
],
[
154,
157
],
[
157,
158
],
[
158,
159
],
[
33,
160
],
[
160,
161
],
[
0,
162
],
[
162,
163
],
[
162,
164
]
] | [
"import java.util.LinkedList;\nimport java.util.Scanner;\n\npublic class Main {\n public static void main(String[] arg) {\n Scanner sc = new Scanner(System.in);\n String line = sc.nextLine();\n sc.close();\n System.out.println(compute(line));\n }\n\n private static int compute(String line) {\n String[] elements = line.split(\" \");\n LinkedList<String> stack = new LinkedList<>();\n for (String element : elements) {\n if (element.matches(\"[0-9]+\")) {\n stack.push(element);\n } else if (element.equals(\"+\")) {\n int a = Integer.valueOf(stack.poll());\n int b = Integer.valueOf(stack.poll());\n stack.push(String.valueOf(b + a));\n } else if (element.equals(\"-\")) {\n int a = Integer.valueOf(stack.poll());\n int b = Integer.valueOf(stack.poll());\n stack.push(String.valueOf(b - a));\n } else if (element.equals(\"*\")) {\n int a = Integer.valueOf(stack.poll());\n int b = Integer.valueOf(stack.poll());\n stack.push(String.valueOf(b * a));\n }\n }\n return Integer.valueOf(stack.poll());\n }\n}",
"import java.util.LinkedList;",
"LinkedList",
"java.util",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n public static void main(String[] arg) {\n Scanner sc = new Scanner(System.in);\n String line = sc.nextLine();\n sc.close();\n System.out.println(compute(line));\n }\n\n private static int compute(String line) {\n String[] elements = line.split(\" \");\n LinkedList<String> stack = new LinkedList<>();\n for (String element : elements) {\n if (element.matches(\"[0-9]+\")) {\n stack.push(element);\n } else if (element.equals(\"+\")) {\n int a = Integer.valueOf(stack.poll());\n int b = Integer.valueOf(stack.poll());\n stack.push(String.valueOf(b + a));\n } else if (element.equals(\"-\")) {\n int a = Integer.valueOf(stack.poll());\n int b = Integer.valueOf(stack.poll());\n stack.push(String.valueOf(b - a));\n } else if (element.equals(\"*\")) {\n int a = Integer.valueOf(stack.poll());\n int b = Integer.valueOf(stack.poll());\n stack.push(String.valueOf(b * a));\n }\n }\n return Integer.valueOf(stack.poll());\n }\n}",
"Main",
"public static void main(String[] arg) {\n Scanner sc = new Scanner(System.in);\n String line = sc.nextLine();\n sc.close();\n System.out.println(compute(line));\n }",
"main",
"{\n Scanner sc = new Scanner(System.in);\n String line = sc.nextLine();\n sc.close();\n System.out.println(compute(line));\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"String line = sc.nextLine();",
"line",
"sc.nextLine()",
"sc.nextLine",
"sc",
"sc.close()",
"sc.close",
"sc",
"System.out.println(compute(line))",
"System.out.println",
"System.out",
"System",
"System.out",
"compute(line)",
"compute",
"line",
"String[] arg",
"arg",
"private static int compute(String line) {\n String[] elements = line.split(\" \");\n LinkedList<String> stack = new LinkedList<>();\n for (String element : elements) {\n if (element.matches(\"[0-9]+\")) {\n stack.push(element);\n } else if (element.equals(\"+\")) {\n int a = Integer.valueOf(stack.poll());\n int b = Integer.valueOf(stack.poll());\n stack.push(String.valueOf(b + a));\n } else if (element.equals(\"-\")) {\n int a = Integer.valueOf(stack.poll());\n int b = Integer.valueOf(stack.poll());\n stack.push(String.valueOf(b - a));\n } else if (element.equals(\"*\")) {\n int a = Integer.valueOf(stack.poll());\n int b = Integer.valueOf(stack.poll());\n stack.push(String.valueOf(b * a));\n }\n }\n return Integer.valueOf(stack.poll());\n }",
"compute",
"{\n String[] elements = line.split(\" \");\n LinkedList<String> stack = new LinkedList<>();\n for (String element : elements) {\n if (element.matches(\"[0-9]+\")) {\n stack.push(element);\n } else if (element.equals(\"+\")) {\n int a = Integer.valueOf(stack.poll());\n int b = Integer.valueOf(stack.poll());\n stack.push(String.valueOf(b + a));\n } else if (element.equals(\"-\")) {\n int a = Integer.valueOf(stack.poll());\n int b = Integer.valueOf(stack.poll());\n stack.push(String.valueOf(b - a));\n } else if (element.equals(\"*\")) {\n int a = Integer.valueOf(stack.poll());\n int b = Integer.valueOf(stack.poll());\n stack.push(String.valueOf(b * a));\n }\n }\n return Integer.valueOf(stack.poll());\n }",
"String[] elements = line.split(\" \");",
"elements",
"line.split(\" \")",
"line.split",
"line",
"\" \"",
"LinkedList<String> stack = new LinkedList<>();",
"stack",
"new LinkedList<>()",
"for (String element : elements) {\n if (element.matches(\"[0-9]+\")) {\n stack.push(element);\n } else if (element.equals(\"+\")) {\n int a = Integer.valueOf(stack.poll());\n int b = Integer.valueOf(stack.poll());\n stack.push(String.valueOf(b + a));\n } else if (element.equals(\"-\")) {\n int a = Integer.valueOf(stack.poll());\n int b = Integer.valueOf(stack.poll());\n stack.push(String.valueOf(b - a));\n } else if (element.equals(\"*\")) {\n int a = Integer.valueOf(stack.poll());\n int b = Integer.valueOf(stack.poll());\n stack.push(String.valueOf(b * a));\n }\n }",
"String element",
"elements",
"{\n if (element.matches(\"[0-9]+\")) {\n stack.push(element);\n } else if (element.equals(\"+\")) {\n int a = Integer.valueOf(stack.poll());\n int b = Integer.valueOf(stack.poll());\n stack.push(String.valueOf(b + a));\n } else if (element.equals(\"-\")) {\n int a = Integer.valueOf(stack.poll());\n int b = Integer.valueOf(stack.poll());\n stack.push(String.valueOf(b - a));\n } else if (element.equals(\"*\")) {\n int a = Integer.valueOf(stack.poll());\n int b = Integer.valueOf(stack.poll());\n stack.push(String.valueOf(b * a));\n }\n }",
"{\n if (element.matches(\"[0-9]+\")) {\n stack.push(element);\n } else if (element.equals(\"+\")) {\n int a = Integer.valueOf(stack.poll());\n int b = Integer.valueOf(stack.poll());\n stack.push(String.valueOf(b + a));\n } else if (element.equals(\"-\")) {\n int a = Integer.valueOf(stack.poll());\n int b = Integer.valueOf(stack.poll());\n stack.push(String.valueOf(b - a));\n } else if (element.equals(\"*\")) {\n int a = Integer.valueOf(stack.poll());\n int b = Integer.valueOf(stack.poll());\n stack.push(String.valueOf(b * a));\n }\n }",
"if (element.matches(\"[0-9]+\")) {\n stack.push(element);\n } else if (element.equals(\"+\")) {\n int a = Integer.valueOf(stack.poll());\n int b = Integer.valueOf(stack.poll());\n stack.push(String.valueOf(b + a));\n } else if (element.equals(\"-\")) {\n int a = Integer.valueOf(stack.poll());\n int b = Integer.valueOf(stack.poll());\n stack.push(String.valueOf(b - a));\n } else if (element.equals(\"*\")) {\n int a = Integer.valueOf(stack.poll());\n int b = Integer.valueOf(stack.poll());\n stack.push(String.valueOf(b * a));\n }",
"element.matches(\"[0-9]+\")",
"element.matches",
"element",
"\"[0-9]+\"",
"{\n stack.push(element);\n }",
"stack.push(element)",
"stack.push",
"stack",
"element",
"if (element.equals(\"+\")) {\n int a = Integer.valueOf(stack.poll());\n int b = Integer.valueOf(stack.poll());\n stack.push(String.valueOf(b + a));\n } else if (element.equals(\"-\")) {\n int a = Integer.valueOf(stack.poll());\n int b = Integer.valueOf(stack.poll());\n stack.push(String.valueOf(b - a));\n } else if (element.equals(\"*\")) {\n int a = Integer.valueOf(stack.poll());\n int b = Integer.valueOf(stack.poll());\n stack.push(String.valueOf(b * a));\n }",
"element.equals(\"+\")",
"element.equals",
"element",
"\"+\"",
"{\n int a = Integer.valueOf(stack.poll());\n int b = Integer.valueOf(stack.poll());\n stack.push(String.valueOf(b + a));\n }",
"int a = Integer.valueOf(stack.poll());",
"a",
"Integer.valueOf(stack.poll())",
"Integer.valueOf",
"Integer",
"stack.poll()",
"stack.poll",
"stack",
"int b = Integer.valueOf(stack.poll());",
"b",
"Integer.valueOf(stack.poll())",
"Integer.valueOf",
"Integer",
"stack.poll()",
"stack.poll",
"stack",
"stack.push(String.valueOf(b + a))",
"stack.push",
"stack",
"String.valueOf(b + a)",
"String.valueOf",
"String",
"b + a",
"b",
"a",
"if (element.equals(\"-\")) {\n int a = Integer.valueOf(stack.poll());\n int b = Integer.valueOf(stack.poll());\n stack.push(String.valueOf(b - a));\n } else if (element.equals(\"*\")) {\n int a = Integer.valueOf(stack.poll());\n int b = Integer.valueOf(stack.poll());\n stack.push(String.valueOf(b * a));\n }",
"element.equals(\"-\")",
"element.equals",
"element",
"\"-\"",
"{\n int a = Integer.valueOf(stack.poll());\n int b = Integer.valueOf(stack.poll());\n stack.push(String.valueOf(b - a));\n }",
"int a = Integer.valueOf(stack.poll());",
"a",
"Integer.valueOf(stack.poll())",
"Integer.valueOf",
"Integer",
"stack.poll()",
"stack.poll",
"stack",
"int b = Integer.valueOf(stack.poll());",
"b",
"Integer.valueOf(stack.poll())",
"Integer.valueOf",
"Integer",
"stack.poll()",
"stack.poll",
"stack",
"stack.push(String.valueOf(b - a))",
"stack.push",
"stack",
"String.valueOf(b - a)",
"String.valueOf",
"String",
"b - a",
"b",
"a",
"if (element.equals(\"*\")) {\n int a = Integer.valueOf(stack.poll());\n int b = Integer.valueOf(stack.poll());\n stack.push(String.valueOf(b * a));\n }",
"element.equals(\"*\")",
"element.equals",
"element",
"\"*\"",
"{\n int a = Integer.valueOf(stack.poll());\n int b = Integer.valueOf(stack.poll());\n stack.push(String.valueOf(b * a));\n }",
"int a = Integer.valueOf(stack.poll());",
"a",
"Integer.valueOf(stack.poll())",
"Integer.valueOf",
"Integer",
"stack.poll()",
"stack.poll",
"stack",
"int b = Integer.valueOf(stack.poll());",
"b",
"Integer.valueOf(stack.poll())",
"Integer.valueOf",
"Integer",
"stack.poll()",
"stack.poll",
"stack",
"stack.push(String.valueOf(b * a))",
"stack.push",
"stack",
"String.valueOf(b * a)",
"String.valueOf",
"String",
"b * a",
"b",
"a",
"return Integer.valueOf(stack.poll());",
"Integer.valueOf(stack.poll())",
"Integer.valueOf",
"Integer",
"stack.poll()",
"stack.poll",
"stack",
"String line",
"line",
"public class Main {\n public static void main(String[] arg) {\n Scanner sc = new Scanner(System.in);\n String line = sc.nextLine();\n sc.close();\n System.out.println(compute(line));\n }\n\n private static int compute(String line) {\n String[] elements = line.split(\" \");\n LinkedList<String> stack = new LinkedList<>();\n for (String element : elements) {\n if (element.matches(\"[0-9]+\")) {\n stack.push(element);\n } else if (element.equals(\"+\")) {\n int a = Integer.valueOf(stack.poll());\n int b = Integer.valueOf(stack.poll());\n stack.push(String.valueOf(b + a));\n } else if (element.equals(\"-\")) {\n int a = Integer.valueOf(stack.poll());\n int b = Integer.valueOf(stack.poll());\n stack.push(String.valueOf(b - a));\n } else if (element.equals(\"*\")) {\n int a = Integer.valueOf(stack.poll());\n int b = Integer.valueOf(stack.poll());\n stack.push(String.valueOf(b * a));\n }\n }\n return Integer.valueOf(stack.poll());\n }\n}",
"public class Main {\n public static void main(String[] arg) {\n Scanner sc = new Scanner(System.in);\n String line = sc.nextLine();\n sc.close();\n System.out.println(compute(line));\n }\n\n private static int compute(String line) {\n String[] elements = line.split(\" \");\n LinkedList<String> stack = new LinkedList<>();\n for (String element : elements) {\n if (element.matches(\"[0-9]+\")) {\n stack.push(element);\n } else if (element.equals(\"+\")) {\n int a = Integer.valueOf(stack.poll());\n int b = Integer.valueOf(stack.poll());\n stack.push(String.valueOf(b + a));\n } else if (element.equals(\"-\")) {\n int a = Integer.valueOf(stack.poll());\n int b = Integer.valueOf(stack.poll());\n stack.push(String.valueOf(b - a));\n } else if (element.equals(\"*\")) {\n int a = Integer.valueOf(stack.poll());\n int b = Integer.valueOf(stack.poll());\n stack.push(String.valueOf(b * a));\n }\n }\n return Integer.valueOf(stack.poll());\n }\n}",
"Main"
] | import java.util.LinkedList;
import java.util.Scanner;
public class Main {
public static void main(String[] arg) {
Scanner sc = new Scanner(System.in);
String line = sc.nextLine();
sc.close();
System.out.println(compute(line));
}
private static int compute(String line) {
String[] elements = line.split(" ");
LinkedList<String> stack = new LinkedList<>();
for (String element : elements) {
if (element.matches("[0-9]+")) {
stack.push(element);
} else if (element.equals("+")) {
int a = Integer.valueOf(stack.poll());
int b = Integer.valueOf(stack.poll());
stack.push(String.valueOf(b + a));
} else if (element.equals("-")) {
int a = Integer.valueOf(stack.poll());
int b = Integer.valueOf(stack.poll());
stack.push(String.valueOf(b - a));
} else if (element.equals("*")) {
int a = Integer.valueOf(stack.poll());
int b = Integer.valueOf(stack.poll());
stack.push(String.valueOf(b * a));
}
}
return Integer.valueOf(stack.poll());
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
20,
41,
13,
17,
42,
4,
18,
13,
30,
41,
13,
4,
18,
13,
14,
2,
4,
18,
13,
17,
17,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
4,
18,
13,
2,
13,
13,
14,
2,
4,
18,
13,
17,
17,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
4,
18,
13,
2,
13,
13,
14,
2,
4,
18,
13,
17,
17,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
4,
18,
13,
2,
13,
13,
30,
41,
13,
4,
18,
13,
13,
4,
18,
13,
13,
4,
18,
18,
13,
13,
4,
18,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
128,
11
],
[
128,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
15,
17
],
[
14,
18
],
[
18,
19
],
[
18,
20
],
[
14,
21
],
[
21,
22
],
[
21,
23
],
[
14,
24
],
[
24,
25
],
[
25,
26
],
[
26,
27
],
[
24,
28
],
[
28,
29
],
[
29,
30
],
[
29,
31
],
[
31,
32
],
[
32,
33
],
[
28,
34
],
[
34,
35
],
[
35,
36
],
[
36,
37
],
[
37,
38
],
[
36,
39
],
[
35,
40
],
[
34,
41
],
[
41,
42
],
[
42,
43
],
[
42,
44
],
[
44,
45
],
[
45,
46
],
[
41,
47
],
[
47,
48
],
[
47,
49
],
[
49,
50
],
[
50,
51
],
[
41,
52
],
[
52,
53
],
[
53,
54
],
[
52,
55
],
[
55,
56
],
[
55,
57
],
[
34,
58
],
[
58,
59
],
[
59,
60
],
[
60,
61
],
[
61,
62
],
[
60,
63
],
[
59,
64
],
[
58,
65
],
[
65,
66
],
[
66,
67
],
[
66,
68
],
[
68,
69
],
[
69,
70
],
[
65,
71
],
[
71,
72
],
[
71,
73
],
[
73,
74
],
[
74,
75
],
[
65,
76
],
[
76,
77
],
[
77,
78
],
[
76,
79
],
[
79,
80
],
[
79,
81
],
[
58,
82
],
[
82,
83
],
[
83,
84
],
[
84,
85
],
[
85,
86
],
[
84,
87
],
[
83,
88
],
[
82,
89
],
[
89,
90
],
[
90,
91
],
[
90,
92
],
[
92,
93
],
[
93,
94
],
[
89,
95
],
[
95,
96
],
[
95,
97
],
[
97,
98
],
[
98,
99
],
[
89,
100
],
[
100,
101
],
[
101,
102
],
[
100,
103
],
[
103,
104
],
[
103,
105
],
[
82,
106
],
[
106,
107
],
[
107,
108
],
[
107,
109
],
[
109,
110
],
[
110,
111
],
[
109,
112
],
[
106,
113
],
[
113,
114
],
[
114,
115
],
[
113,
116
],
[
14,
117
],
[
117,
118
],
[
118,
119
],
[
119,
120
],
[
119,
121
],
[
117,
122
],
[
122,
123
],
[
123,
124
],
[
12,
125
],
[
125,
126
],
[
0,
127
],
[
127,
128
],
[
127,
129
]
] | [
"\nimport java.util.ArrayDeque;\nimport java.util.Deque;\nimport java.util.Scanner;\n\npublic class Main {\n\n public static void main(String[] args) {\n\t// write your code here\n Scanner scanner=new Scanner(System.in);\n Deque<Integer> deque=new ArrayDeque<>();\n int count=0;\n while(scanner.hasNext()){\n String input=scanner.next();\n //count++;\n //System.out.println(String.format(\"%d:%s\",count,input));\n if(input.charAt(0)=='*'){\n int x=deque.removeFirst();\n int y=deque.removeFirst();\n deque.addFirst(x*y);\n }else if(input.charAt(0)=='+'){\n int x=deque.removeFirst();\n int y=deque.removeFirst();\n deque.addFirst(x+y);\n\n }else if(input.charAt(0)=='-'){\n int x=deque.removeFirst();\n int y=deque.removeFirst();\n deque.addFirst(y-x);\n\n }else{\n int i=Integer.parseInt(input);\n deque.addFirst(i);\n }\n }\n //System.out.println(deque);\n System.out.println(deque.removeFirst());\n }\n}\n",
"import java.util.ArrayDeque;",
"ArrayDeque",
"java.util",
"import java.util.Deque;",
"Deque",
"java.util",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\n public static void main(String[] args) {\n\t// write your code here\n Scanner scanner=new Scanner(System.in);\n Deque<Integer> deque=new ArrayDeque<>();\n int count=0;\n while(scanner.hasNext()){\n String input=scanner.next();\n //count++;\n //System.out.println(String.format(\"%d:%s\",count,input));\n if(input.charAt(0)=='*'){\n int x=deque.removeFirst();\n int y=deque.removeFirst();\n deque.addFirst(x*y);\n }else if(input.charAt(0)=='+'){\n int x=deque.removeFirst();\n int y=deque.removeFirst();\n deque.addFirst(x+y);\n\n }else if(input.charAt(0)=='-'){\n int x=deque.removeFirst();\n int y=deque.removeFirst();\n deque.addFirst(y-x);\n\n }else{\n int i=Integer.parseInt(input);\n deque.addFirst(i);\n }\n }\n //System.out.println(deque);\n System.out.println(deque.removeFirst());\n }\n}",
"Main",
"public static void main(String[] args) {\n\t// write your code here\n Scanner scanner=new Scanner(System.in);\n Deque<Integer> deque=new ArrayDeque<>();\n int count=0;\n while(scanner.hasNext()){\n String input=scanner.next();\n //count++;\n //System.out.println(String.format(\"%d:%s\",count,input));\n if(input.charAt(0)=='*'){\n int x=deque.removeFirst();\n int y=deque.removeFirst();\n deque.addFirst(x*y);\n }else if(input.charAt(0)=='+'){\n int x=deque.removeFirst();\n int y=deque.removeFirst();\n deque.addFirst(x+y);\n\n }else if(input.charAt(0)=='-'){\n int x=deque.removeFirst();\n int y=deque.removeFirst();\n deque.addFirst(y-x);\n\n }else{\n int i=Integer.parseInt(input);\n deque.addFirst(i);\n }\n }\n //System.out.println(deque);\n System.out.println(deque.removeFirst());\n }",
"main",
"{\n\t// write your code here\n Scanner scanner=new Scanner(System.in);\n Deque<Integer> deque=new ArrayDeque<>();\n int count=0;\n while(scanner.hasNext()){\n String input=scanner.next();\n //count++;\n //System.out.println(String.format(\"%d:%s\",count,input));\n if(input.charAt(0)=='*'){\n int x=deque.removeFirst();\n int y=deque.removeFirst();\n deque.addFirst(x*y);\n }else if(input.charAt(0)=='+'){\n int x=deque.removeFirst();\n int y=deque.removeFirst();\n deque.addFirst(x+y);\n\n }else if(input.charAt(0)=='-'){\n int x=deque.removeFirst();\n int y=deque.removeFirst();\n deque.addFirst(y-x);\n\n }else{\n int i=Integer.parseInt(input);\n deque.addFirst(i);\n }\n }\n //System.out.println(deque);\n System.out.println(deque.removeFirst());\n }",
"Scanner scanner=new Scanner(System.in);",
"scanner",
"new Scanner(System.in)",
"Deque<Integer> deque=new ArrayDeque<>();",
"deque",
"new ArrayDeque<>()",
"int count=0;",
"count",
"0",
"while(scanner.hasNext()){\n String input=scanner.next();\n //count++;\n //System.out.println(String.format(\"%d:%s\",count,input));\n if(input.charAt(0)=='*'){\n int x=deque.removeFirst();\n int y=deque.removeFirst();\n deque.addFirst(x*y);\n }else if(input.charAt(0)=='+'){\n int x=deque.removeFirst();\n int y=deque.removeFirst();\n deque.addFirst(x+y);\n\n }else if(input.charAt(0)=='-'){\n int x=deque.removeFirst();\n int y=deque.removeFirst();\n deque.addFirst(y-x);\n\n }else{\n int i=Integer.parseInt(input);\n deque.addFirst(i);\n }\n }",
"scanner.hasNext()",
"scanner.hasNext",
"scanner",
"{\n String input=scanner.next();\n //count++;\n //System.out.println(String.format(\"%d:%s\",count,input));\n if(input.charAt(0)=='*'){\n int x=deque.removeFirst();\n int y=deque.removeFirst();\n deque.addFirst(x*y);\n }else if(input.charAt(0)=='+'){\n int x=deque.removeFirst();\n int y=deque.removeFirst();\n deque.addFirst(x+y);\n\n }else if(input.charAt(0)=='-'){\n int x=deque.removeFirst();\n int y=deque.removeFirst();\n deque.addFirst(y-x);\n\n }else{\n int i=Integer.parseInt(input);\n deque.addFirst(i);\n }\n }",
"String input=scanner.next();",
"input",
"scanner.next()",
"scanner.next",
"scanner",
"if(input.charAt(0)=='*'){\n int x=deque.removeFirst();\n int y=deque.removeFirst();\n deque.addFirst(x*y);\n }else if(input.charAt(0)=='+'){\n int x=deque.removeFirst();\n int y=deque.removeFirst();\n deque.addFirst(x+y);\n\n }else if(input.charAt(0)=='-'){\n int x=deque.removeFirst();\n int y=deque.removeFirst();\n deque.addFirst(y-x);\n\n }else{\n int i=Integer.parseInt(input);\n deque.addFirst(i);\n }",
"input.charAt(0)=='*'",
"input.charAt(0)",
"input.charAt",
"input",
"0",
"'*'",
"{\n int x=deque.removeFirst();\n int y=deque.removeFirst();\n deque.addFirst(x*y);\n }",
"int x=deque.removeFirst();",
"x",
"deque.removeFirst()",
"deque.removeFirst",
"deque",
"int y=deque.removeFirst();",
"y",
"deque.removeFirst()",
"deque.removeFirst",
"deque",
"deque.addFirst(x*y)",
"deque.addFirst",
"deque",
"x*y",
"x",
"y",
"if(input.charAt(0)=='+'){\n int x=deque.removeFirst();\n int y=deque.removeFirst();\n deque.addFirst(x+y);\n\n }else if(input.charAt(0)=='-'){\n int x=deque.removeFirst();\n int y=deque.removeFirst();\n deque.addFirst(y-x);\n\n }else{\n int i=Integer.parseInt(input);\n deque.addFirst(i);\n }",
"input.charAt(0)=='+'",
"input.charAt(0)",
"input.charAt",
"input",
"0",
"'+'",
"{\n int x=deque.removeFirst();\n int y=deque.removeFirst();\n deque.addFirst(x+y);\n\n }",
"int x=deque.removeFirst();",
"x",
"deque.removeFirst()",
"deque.removeFirst",
"deque",
"int y=deque.removeFirst();",
"y",
"deque.removeFirst()",
"deque.removeFirst",
"deque",
"deque.addFirst(x+y)",
"deque.addFirst",
"deque",
"x+y",
"x",
"y",
"if(input.charAt(0)=='-'){\n int x=deque.removeFirst();\n int y=deque.removeFirst();\n deque.addFirst(y-x);\n\n }else{\n int i=Integer.parseInt(input);\n deque.addFirst(i);\n }",
"input.charAt(0)=='-'",
"input.charAt(0)",
"input.charAt",
"input",
"0",
"'-'",
"{\n int x=deque.removeFirst();\n int y=deque.removeFirst();\n deque.addFirst(y-x);\n\n }",
"int x=deque.removeFirst();",
"x",
"deque.removeFirst()",
"deque.removeFirst",
"deque",
"int y=deque.removeFirst();",
"y",
"deque.removeFirst()",
"deque.removeFirst",
"deque",
"deque.addFirst(y-x)",
"deque.addFirst",
"deque",
"y-x",
"y",
"x",
"{\n int i=Integer.parseInt(input);\n deque.addFirst(i);\n }",
"int i=Integer.parseInt(input);",
"i",
"Integer.parseInt(input)",
"Integer.parseInt",
"Integer",
"input",
"deque.addFirst(i)",
"deque.addFirst",
"deque",
"i",
"System.out.println(deque.removeFirst())",
"System.out.println",
"System.out",
"System",
"System.out",
"deque.removeFirst()",
"deque.removeFirst",
"deque",
"String[] args",
"args",
"public class Main {\n\n public static void main(String[] args) {\n\t// write your code here\n Scanner scanner=new Scanner(System.in);\n Deque<Integer> deque=new ArrayDeque<>();\n int count=0;\n while(scanner.hasNext()){\n String input=scanner.next();\n //count++;\n //System.out.println(String.format(\"%d:%s\",count,input));\n if(input.charAt(0)=='*'){\n int x=deque.removeFirst();\n int y=deque.removeFirst();\n deque.addFirst(x*y);\n }else if(input.charAt(0)=='+'){\n int x=deque.removeFirst();\n int y=deque.removeFirst();\n deque.addFirst(x+y);\n\n }else if(input.charAt(0)=='-'){\n int x=deque.removeFirst();\n int y=deque.removeFirst();\n deque.addFirst(y-x);\n\n }else{\n int i=Integer.parseInt(input);\n deque.addFirst(i);\n }\n }\n //System.out.println(deque);\n System.out.println(deque.removeFirst());\n }\n}",
"public class Main {\n\n public static void main(String[] args) {\n\t// write your code here\n Scanner scanner=new Scanner(System.in);\n Deque<Integer> deque=new ArrayDeque<>();\n int count=0;\n while(scanner.hasNext()){\n String input=scanner.next();\n //count++;\n //System.out.println(String.format(\"%d:%s\",count,input));\n if(input.charAt(0)=='*'){\n int x=deque.removeFirst();\n int y=deque.removeFirst();\n deque.addFirst(x*y);\n }else if(input.charAt(0)=='+'){\n int x=deque.removeFirst();\n int y=deque.removeFirst();\n deque.addFirst(x+y);\n\n }else if(input.charAt(0)=='-'){\n int x=deque.removeFirst();\n int y=deque.removeFirst();\n deque.addFirst(y-x);\n\n }else{\n int i=Integer.parseInt(input);\n deque.addFirst(i);\n }\n }\n //System.out.println(deque);\n System.out.println(deque.removeFirst());\n }\n}",
"Main"
] |
import java.util.ArrayDeque;
import java.util.Deque;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
// write your code here
Scanner scanner=new Scanner(System.in);
Deque<Integer> deque=new ArrayDeque<>();
int count=0;
while(scanner.hasNext()){
String input=scanner.next();
//count++;
//System.out.println(String.format("%d:%s",count,input));
if(input.charAt(0)=='*'){
int x=deque.removeFirst();
int y=deque.removeFirst();
deque.addFirst(x*y);
}else if(input.charAt(0)=='+'){
int x=deque.removeFirst();
int y=deque.removeFirst();
deque.addFirst(x+y);
}else if(input.charAt(0)=='-'){
int x=deque.removeFirst();
int y=deque.removeFirst();
deque.addFirst(y-x);
}else{
int i=Integer.parseInt(input);
deque.addFirst(i);
}
}
//System.out.println(deque);
System.out.println(deque.removeFirst());
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
41,
13,
17,
41,
13,
41,
13,
12,
13,
30,
0,
13,
20,
13,
0,
13,
17,
12,
13,
30,
0,
13,
17,
12,
13,
30,
14,
4,
13,
30,
4,
18,
18,
13,
13,
17,
29,
0,
18,
13,
40,
13,
13,
23,
13,
12,
13,
30,
14,
4,
13,
30,
4,
18,
18,
13,
13,
17,
29,
17,
29,
18,
13,
40,
13,
12,
13,
30,
29,
2,
13,
17,
12,
13,
30,
29,
2,
13,
2,
13,
17,
12,
13,
30,
41,
13,
4,
18,
36,
14,
4,
13,
13,
30,
29,
4,
18,
13,
13,
41,
13,
4,
13,
41,
13,
4,
13,
35,
13,
34,
17,
1,
29,
2,
13,
13,
34,
17,
1,
29,
2,
13,
13,
34,
17,
1,
29,
2,
13,
13,
29,
17,
12,
13,
30,
38,
5,
13,
30,
29,
17,
30,
4,
18,
13,
13,
29,
17,
23,
13,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
4,
18,
13,
17,
41,
13,
20,
28,
13,
13,
30,
30,
4,
18,
13,
13,
42,
2,
18,
13,
13,
17,
30,
4,
18,
13,
4,
18,
13,
4,
18,
13,
4,
18,
18,
13,
13,
4,
18,
13,
23,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
10,
11
],
[
10,
12
],
[
12,
13
],
[
12,
14
],
[
10,
15
],
[
15,
16
],
[
10,
17
],
[
17,
18
],
[
10,
19
],
[
19,
20
],
[
19,
21
],
[
21,
22
],
[
22,
23
],
[
22,
24
],
[
21,
26
],
[
26,
27
],
[
26,
28
],
[
10,
29
],
[
29,
30
],
[
29,
31
],
[
31,
32
],
[
32,
33
],
[
32,
34
],
[
10,
35
],
[
35,
36
],
[
35,
37
],
[
37,
38
],
[
38,
39
],
[
39,
40
],
[
38,
41
],
[
41,
42
],
[
42,
43
],
[
43,
44
],
[
44,
45
],
[
44,
46
],
[
42,
47
],
[
41,
48
],
[
37,
49
],
[
49,
50
],
[
50,
51
],
[
50,
52
],
[
52,
53
],
[
49,
54
],
[
35,
55
],
[
55,
56
],
[
10,
57
],
[
57,
58
],
[
57,
59
],
[
59,
60
],
[
60,
61
],
[
61,
62
],
[
60,
63
],
[
63,
64
],
[
64,
65
],
[
65,
66
],
[
66,
67
],
[
66,
68
],
[
64,
69
],
[
63,
70
],
[
70,
71
],
[
59,
72
],
[
72,
73
],
[
73,
74
],
[
73,
75
],
[
75,
76
],
[
10,
77
],
[
77,
78
],
[
77,
79
],
[
79,
80
],
[
80,
81
],
[
81,
82
],
[
81,
83
],
[
10,
84
],
[
84,
85
],
[
84,
86
],
[
86,
87
],
[
87,
88
],
[
88,
89
],
[
88,
90
],
[
90,
91
],
[
90,
92
],
[
10,
93
],
[
93,
94
],
[
93,
95
],
[
95,
96
],
[
96,
97
],
[
96,
98
],
[
98,
99
],
[
99,
100
],
[
95,
101
],
[
101,
102
],
[
102,
103
],
[
102,
104
],
[
101,
105
],
[
105,
106
],
[
106,
107
],
[
107,
108
],
[
108,
109
],
[
107,
110
],
[
95,
111
],
[
111,
112
],
[
111,
113
],
[
113,
114
],
[
95,
115
],
[
115,
116
],
[
115,
117
],
[
117,
118
],
[
95,
119
],
[
119,
120
],
[
119,
121
],
[
121,
122
],
[
121,
123
],
[
123,
124
],
[
124,
125
],
[
125,
126
],
[
125,
127
],
[
119,
128
],
[
128,
129
],
[
128,
130
],
[
130,
131
],
[
131,
132
],
[
132,
133
],
[
132,
134
],
[
119,
135
],
[
135,
136
],
[
135,
137
],
[
137,
138
],
[
138,
139
],
[
139,
140
],
[
139,
141
],
[
95,
142
],
[
142,
143
],
[
10,
144
],
[
144,
145
],
[
144,
146
],
[
146,
147
],
[
147,
148
],
[
148,
149
],
[
148,
150
],
[
150,
151
],
[
151,
152
],
[
147,
153
],
[
153,
154
],
[
154,
155
],
[
155,
156
],
[
154,
157
],
[
153,
158
],
[
158,
159
],
[
144,
160
],
[
160,
161
],
[
0,
162
],
[
162,
163
],
[
162,
164
],
[
164,
165
],
[
164,
166
],
[
166,
167
],
[
167,
168
],
[
167,
169
],
[
166,
170
],
[
170,
171
],
[
170,
172
],
[
172,
173
],
[
173,
174
],
[
174,
175
],
[
175,
176
],
[
172,
177
],
[
166,
178
],
[
178,
179
],
[
178,
180
],
[
166,
181
],
[
181,
182
],
[
181,
183
],
[
181,
184
],
[
185,
185
],
[
185,
186
],
[
186,
187
],
[
187,
188
],
[
186,
189
],
[
166,
190
],
[
190,
191
],
[
191,
192
],
[
192,
193
],
[
192,
194
],
[
191,
195
],
[
190,
196
],
[
196,
197
],
[
197,
198
],
[
198,
199
],
[
197,
200
],
[
200,
201
],
[
201,
202
],
[
200,
203
],
[
203,
204
],
[
204,
205
],
[
166,
206
],
[
206,
207
],
[
207,
208
],
[
208,
209
],
[
208,
210
],
[
206,
211
],
[
211,
212
],
[
212,
213
],
[
164,
214
],
[
214,
215
]
] | [
"import java.io.IOException;\nimport java.io.InputStreamReader;\nimport java.io.BufferedReader;\n\nclass myStack {\n // s[0]には常に何も入れない実装\n int size = 200;\n String[] s;\n int top;\n\n myStack() {\n s = new String[size];\n top = 0;\n }\n\n void initialize() {\n top = 0;\n }\n\n void push(String x) {\n if (isFull()) {\n System.err.println(\"stack overflow!\");\n return;\n }\n\n s[++top] = x;\n }\n\n String pop() {\n if (isEmpty()) {\n System.err.println(\"stack is empty!\");\n return null;\n }\n return s[top--];\n }\n\n boolean isEmpty() {\n return (top == 0);\n }\n\n boolean isFull() {\n return (top >= size - 1);\n }\n\n int eval() {\n String val = this.pop();\n if (isNumber(val)) {\n return Integer.parseInt(val);\n }\n\n int b = eval();\n int a = eval();\n\n switch (val) {\n case \"+\":\n return a + b;\n case \"-\":\n return a - b;\n case \"*\":\n return a * b;\n } \n\n return 0; // unreachable\n }\n\n boolean isNumber(String x) {\n try {\n Integer.parseInt(x);\n return true;\n } catch (NumberFormatException e) {\n return false;\n }\n }\n\n}\n\nclass Main {\n public static void main(String[] args) throws IOException{\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\n String[] input = br.readLine().split(\" \");\n myStack ms = new myStack();\n\n for (String s : input) {\n ms.push(s);\n }\n\n // evaluate\n while (ms.top != 1) {\n ms.push(String.valueOf(ms.eval()));\n }\n\n System.out.println(ms.pop());\n }\n}",
"import java.io.IOException;",
"IOException",
"java.io",
"import java.io.InputStreamReader;",
"InputStreamReader",
"java.io",
"import java.io.BufferedReader;",
"BufferedReader",
"java.io",
"class myStack {\n // s[0]には常に何も入れない実装\n int size = 200;\n String[] s;\n int top;\n\n myStack() {\n s = new String[size];\n top = 0;\n }\n\n void initialize() {\n top = 0;\n }\n\n void push(String x) {\n if (isFull()) {\n System.err.println(\"stack overflow!\");\n return;\n }\n\n s[++top] = x;\n }\n\n String pop() {\n if (isEmpty()) {\n System.err.println(\"stack is empty!\");\n return null;\n }\n return s[top--];\n }\n\n boolean isEmpty() {\n return (top == 0);\n }\n\n boolean isFull() {\n return (top >= size - 1);\n }\n\n int eval() {\n String val = this.pop();\n if (isNumber(val)) {\n return Integer.parseInt(val);\n }\n\n int b = eval();\n int a = eval();\n\n switch (val) {\n case \"+\":\n return a + b;\n case \"-\":\n return a - b;\n case \"*\":\n return a * b;\n } \n\n return 0; // unreachable\n }\n\n boolean isNumber(String x) {\n try {\n Integer.parseInt(x);\n return true;\n } catch (NumberFormatException e) {\n return false;\n }\n }\n\n}",
"myStack",
"// s[0]には常に何も入れない実装\n int size = 200;",
"size",
"200",
"String[] s;",
"s",
"int top;",
"top",
"myStack() {\n s = new String[size];\n top = 0;\n }",
"myStack",
"{\n s = new String[size];\n top = 0;\n }",
"s = new String[size]",
"s",
"new String[size]",
"size",
"top = 0",
"top",
"0",
"void initialize() {\n top = 0;\n }",
"initialize",
"{\n top = 0;\n }",
"top = 0",
"top",
"0",
"void push(String x) {\n if (isFull()) {\n System.err.println(\"stack overflow!\");\n return;\n }\n\n s[++top] = x;\n }",
"push",
"{\n if (isFull()) {\n System.err.println(\"stack overflow!\");\n return;\n }\n\n s[++top] = x;\n }",
"if (isFull()) {\n System.err.println(\"stack overflow!\");\n return;\n }",
"isFull()",
"isFull",
"{\n System.err.println(\"stack overflow!\");\n return;\n }",
"System.err.println(\"stack overflow!\")",
"System.err.println",
"System.err",
"System",
"System.err",
"\"stack overflow!\"",
"return;",
"s[++top] = x",
"s[++top]",
"s",
"++top",
"top",
"x",
"String x",
"x",
"String pop() {\n if (isEmpty()) {\n System.err.println(\"stack is empty!\");\n return null;\n }\n return s[top--];\n }",
"pop",
"{\n if (isEmpty()) {\n System.err.println(\"stack is empty!\");\n return null;\n }\n return s[top--];\n }",
"if (isEmpty()) {\n System.err.println(\"stack is empty!\");\n return null;\n }",
"isEmpty()",
"isEmpty",
"{\n System.err.println(\"stack is empty!\");\n return null;\n }",
"System.err.println(\"stack is empty!\")",
"System.err.println",
"System.err",
"System",
"System.err",
"\"stack is empty!\"",
"return null;",
"null",
"return s[top--];",
"s[top--]",
"s",
"top--",
"top",
"boolean isEmpty() {\n return (top == 0);\n }",
"isEmpty",
"{\n return (top == 0);\n }",
"return (top == 0);",
"(top == 0)",
"top",
"0",
"boolean isFull() {\n return (top >= size - 1);\n }",
"isFull",
"{\n return (top >= size - 1);\n }",
"return (top >= size - 1);",
"(top >= size - 1)",
"top",
"size - 1",
"size",
"1",
"int eval() {\n String val = this.pop();\n if (isNumber(val)) {\n return Integer.parseInt(val);\n }\n\n int b = eval();\n int a = eval();\n\n switch (val) {\n case \"+\":\n return a + b;\n case \"-\":\n return a - b;\n case \"*\":\n return a * b;\n } \n\n return 0; // unreachable\n }",
"eval",
"{\n String val = this.pop();\n if (isNumber(val)) {\n return Integer.parseInt(val);\n }\n\n int b = eval();\n int a = eval();\n\n switch (val) {\n case \"+\":\n return a + b;\n case \"-\":\n return a - b;\n case \"*\":\n return a * b;\n } \n\n return 0; // unreachable\n }",
"String val = this.pop();",
"val",
"this.pop()",
"this.pop",
"this",
"if (isNumber(val)) {\n return Integer.parseInt(val);\n }",
"isNumber(val)",
"isNumber",
"val",
"{\n return Integer.parseInt(val);\n }",
"return Integer.parseInt(val);",
"Integer.parseInt(val)",
"Integer.parseInt",
"Integer",
"val",
"int b = eval();",
"b",
"eval()",
"eval",
"int a = eval();",
"a",
"eval()",
"eval",
"switch (val) {\n case \"+\":\n return a + b;\n case \"-\":\n return a - b;\n case \"*\":\n return a * b;\n }",
"val",
"case \"+\":",
"\"+\"",
"case \"+\":",
"return a + b;",
"a + b",
"a",
"b",
"case \"-\":",
"\"-\"",
"case \"-\":",
"return a - b;",
"a - b",
"a",
"b",
"case \"*\":",
"\"*\"",
"case \"*\":",
"return a * b;",
"a * b",
"a",
"b",
"return 0; // unreachable",
"0",
"boolean isNumber(String x) {\n try {\n Integer.parseInt(x);\n return true;\n } catch (NumberFormatException e) {\n return false;\n }\n }",
"isNumber",
"{\n try {\n Integer.parseInt(x);\n return true;\n } catch (NumberFormatException e) {\n return false;\n }\n }",
"try {\n Integer.parseInt(x);\n return true;\n } catch (NumberFormatException e) {\n return false;\n }",
"catch (NumberFormatException e) {\n return false;\n }",
"NumberFormatException e",
"{\n return false;\n }",
"return false;",
"false",
"{\n Integer.parseInt(x);\n return true;\n }",
"Integer.parseInt(x)",
"Integer.parseInt",
"Integer",
"x",
"return true;",
"true",
"String x",
"x",
"class Main {\n public static void main(String[] args) throws IOException{\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\n String[] input = br.readLine().split(\" \");\n myStack ms = new myStack();\n\n for (String s : input) {\n ms.push(s);\n }\n\n // evaluate\n while (ms.top != 1) {\n ms.push(String.valueOf(ms.eval()));\n }\n\n System.out.println(ms.pop());\n }\n}",
"Main",
"public static void main(String[] args) throws IOException{\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\n String[] input = br.readLine().split(\" \");\n myStack ms = new myStack();\n\n for (String s : input) {\n ms.push(s);\n }\n\n // evaluate\n while (ms.top != 1) {\n ms.push(String.valueOf(ms.eval()));\n }\n\n System.out.println(ms.pop());\n }",
"main",
"{\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\n String[] input = br.readLine().split(\" \");\n myStack ms = new myStack();\n\n for (String s : input) {\n ms.push(s);\n }\n\n // evaluate\n while (ms.top != 1) {\n ms.push(String.valueOf(ms.eval()));\n }\n\n System.out.println(ms.pop());\n }",
"BufferedReader br = new BufferedReader(new InputStreamReader(System.in));",
"br",
"new BufferedReader(new InputStreamReader(System.in))",
"String[] input = br.readLine().split(\" \");",
"input",
"br.readLine().split(\" \")",
"br.readLine().split",
"br.readLine()",
"br.readLine",
"br",
"\" \"",
"myStack ms = new myStack();",
"ms",
"new myStack()",
"for (String s : input) {\n ms.push(s);\n }",
"String s",
"input",
"{\n ms.push(s);\n }",
"{\n ms.push(s);\n }",
"ms.push(s)",
"ms.push",
"ms",
"s",
"while (ms.top != 1) {\n ms.push(String.valueOf(ms.eval()));\n }",
"ms.top != 1",
"ms.top",
"ms",
"ms.top",
"1",
"{\n ms.push(String.valueOf(ms.eval()));\n }",
"ms.push(String.valueOf(ms.eval()))",
"ms.push",
"ms",
"String.valueOf(ms.eval())",
"String.valueOf",
"String",
"ms.eval()",
"ms.eval",
"ms",
"System.out.println(ms.pop())",
"System.out.println",
"System.out",
"System",
"System.out",
"ms.pop()",
"ms.pop",
"ms",
"String[] args",
"args"
] | import java.io.IOException;
import java.io.InputStreamReader;
import java.io.BufferedReader;
class myStack {
// s[0]には常に何も入れない実装
int size = 200;
String[] s;
int top;
myStack() {
s = new String[size];
top = 0;
}
void initialize() {
top = 0;
}
void push(String x) {
if (isFull()) {
System.err.println("stack overflow!");
return;
}
s[++top] = x;
}
String pop() {
if (isEmpty()) {
System.err.println("stack is empty!");
return null;
}
return s[top--];
}
boolean isEmpty() {
return (top == 0);
}
boolean isFull() {
return (top >= size - 1);
}
int eval() {
String val = this.pop();
if (isNumber(val)) {
return Integer.parseInt(val);
}
int b = eval();
int a = eval();
switch (val) {
case "+":
return a + b;
case "-":
return a - b;
case "*":
return a * b;
}
return 0; // unreachable
}
boolean isNumber(String x) {
try {
Integer.parseInt(x);
return true;
} catch (NumberFormatException e) {
return false;
}
}
}
class Main {
public static void main(String[] args) throws IOException{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String[] input = br.readLine().split(" ");
myStack ms = new myStack();
for (String s : input) {
ms.push(s);
}
// evaluate
while (ms.top != 1) {
ms.push(String.valueOf(ms.eval()));
}
System.out.println(ms.pop());
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
4,
13,
4,
18,
18,
13,
13,
13,
23,
13,
12,
13,
30,
41,
13,
20,
41,
13,
20,
41,
13,
41,
13,
4,
18,
4,
18,
13,
17,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
30,
14,
2,
4,
18,
18,
13,
13,
17,
17,
30,
4,
18,
13,
4,
18,
13,
18,
13,
13,
30,
14,
4,
18,
18,
13,
13,
17,
30,
0,
13,
2,
4,
18,
13,
2,
4,
18,
13,
17,
4,
18,
13,
2,
4,
18,
13,
17,
14,
2,
4,
18,
13,
17,
30,
4,
18,
13,
2,
4,
18,
13,
17,
4,
18,
13,
2,
4,
18,
13,
17,
4,
18,
13,
4,
18,
13,
13,
14,
4,
18,
18,
13,
13,
17,
30,
0,
13,
2,
4,
18,
13,
2,
4,
18,
13,
17,
4,
18,
13,
2,
4,
18,
13,
17,
14,
2,
4,
18,
13,
17,
30,
4,
18,
13,
2,
4,
18,
13,
17,
4,
18,
13,
2,
4,
18,
13,
17,
4,
18,
13,
4,
18,
13,
13,
14,
4,
18,
18,
13,
13,
17,
30,
0,
13,
2,
4,
18,
13,
2,
4,
18,
13,
17,
4,
18,
13,
2,
4,
18,
13,
17,
14,
2,
4,
18,
13,
17,
30,
4,
18,
13,
2,
4,
18,
13,
17,
4,
18,
13,
2,
4,
18,
13,
17,
4,
18,
13,
4,
18,
13,
13,
29,
4,
18,
13,
2,
4,
18,
13,
17,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
10,
11
],
[
10,
12
],
[
0,
13
],
[
265,
14
],
[
265,
15
],
[
15,
16
],
[
15,
17
],
[
17,
18
],
[
18,
19
],
[
18,
20
],
[
20,
21
],
[
17,
22
],
[
22,
23
],
[
23,
24
],
[
24,
25
],
[
24,
26
],
[
22,
27
],
[
15,
28
],
[
28,
29
],
[
265,
30
],
[
30,
31
],
[
30,
32
],
[
32,
33
],
[
33,
34
],
[
33,
35
],
[
32,
36
],
[
36,
37
],
[
36,
38
],
[
32,
39
],
[
39,
40
],
[
32,
41
],
[
41,
42
],
[
41,
43
],
[
43,
44
],
[
44,
45
],
[
45,
46
],
[
46,
47
],
[
43,
48
],
[
32,
49
],
[
49,
50
],
[
50,
51
],
[
51,
52
],
[
51,
53
],
[
49,
54
],
[
54,
55
],
[
54,
56
],
[
56,
57
],
[
56,
58
],
[
49,
59
],
[
59,
60
],
[
60,
61
],
[
49,
62
],
[
63,
63
],
[
63,
64
],
[
64,
65
],
[
65,
66
],
[
66,
67
],
[
67,
68
],
[
68,
69
],
[
68,
70
],
[
66,
71
],
[
65,
72
],
[
64,
73
],
[
73,
74
],
[
74,
75
],
[
75,
76
],
[
74,
77
],
[
77,
78
],
[
78,
79
],
[
77,
80
],
[
80,
81
],
[
80,
82
],
[
64,
83
],
[
83,
84
],
[
84,
85
],
[
85,
86
],
[
86,
87
],
[
87,
88
],
[
87,
89
],
[
85,
90
],
[
84,
91
],
[
91,
92
],
[
92,
93
],
[
92,
94
],
[
94,
95
],
[
95,
96
],
[
96,
97
],
[
95,
98
],
[
98,
99
],
[
99,
100
],
[
100,
101
],
[
98,
102
],
[
94,
103
],
[
103,
104
],
[
104,
105
],
[
103,
106
],
[
106,
107
],
[
107,
108
],
[
108,
109
],
[
106,
110
],
[
91,
111
],
[
111,
112
],
[
112,
113
],
[
113,
114
],
[
114,
115
],
[
112,
116
],
[
111,
117
],
[
117,
118
],
[
118,
119
],
[
119,
120
],
[
118,
121
],
[
121,
122
],
[
122,
123
],
[
123,
124
],
[
121,
125
],
[
117,
126
],
[
126,
127
],
[
127,
128
],
[
126,
129
],
[
129,
130
],
[
130,
131
],
[
131,
132
],
[
129,
133
],
[
111,
134
],
[
134,
135
],
[
135,
136
],
[
91,
137
],
[
137,
138
],
[
138,
139
],
[
137,
140
],
[
84,
141
],
[
141,
142
],
[
142,
143
],
[
143,
144
],
[
144,
145
],
[
144,
146
],
[
142,
147
],
[
141,
148
],
[
148,
149
],
[
149,
150
],
[
149,
151
],
[
151,
152
],
[
152,
153
],
[
153,
154
],
[
152,
155
],
[
155,
156
],
[
156,
157
],
[
157,
158
],
[
155,
159
],
[
151,
160
],
[
160,
161
],
[
161,
162
],
[
160,
163
],
[
163,
164
],
[
164,
165
],
[
165,
166
],
[
163,
167
],
[
148,
168
],
[
168,
169
],
[
169,
170
],
[
170,
171
],
[
171,
172
],
[
169,
173
],
[
168,
174
],
[
174,
175
],
[
175,
176
],
[
176,
177
],
[
175,
178
],
[
178,
179
],
[
179,
180
],
[
180,
181
],
[
178,
182
],
[
174,
183
],
[
183,
184
],
[
184,
185
],
[
183,
186
],
[
186,
187
],
[
187,
188
],
[
188,
189
],
[
186,
190
],
[
168,
191
],
[
191,
192
],
[
192,
193
],
[
148,
194
],
[
194,
195
],
[
195,
196
],
[
194,
197
],
[
141,
198
],
[
198,
199
],
[
199,
200
],
[
200,
201
],
[
201,
202
],
[
201,
203
],
[
199,
204
],
[
198,
205
],
[
205,
206
],
[
206,
207
],
[
206,
208
],
[
208,
209
],
[
209,
210
],
[
210,
211
],
[
209,
212
],
[
212,
213
],
[
213,
214
],
[
214,
215
],
[
212,
216
],
[
208,
217
],
[
217,
218
],
[
218,
219
],
[
217,
220
],
[
220,
221
],
[
221,
222
],
[
222,
223
],
[
220,
224
],
[
205,
225
],
[
225,
226
],
[
226,
227
],
[
227,
228
],
[
228,
229
],
[
226,
230
],
[
225,
231
],
[
231,
232
],
[
232,
233
],
[
233,
234
],
[
232,
235
],
[
235,
236
],
[
236,
237
],
[
237,
238
],
[
235,
239
],
[
231,
240
],
[
240,
241
],
[
241,
242
],
[
240,
243
],
[
243,
244
],
[
244,
245
],
[
245,
246
],
[
243,
247
],
[
225,
248
],
[
248,
249
],
[
249,
250
],
[
205,
251
],
[
251,
252
],
[
252,
253
],
[
251,
254
],
[
32,
255
],
[
255,
256
],
[
256,
257
],
[
257,
258
],
[
256,
259
],
[
259,
260
],
[
260,
261
],
[
261,
262
],
[
259,
263
],
[
0,
264
],
[
264,
265
],
[
264,
266
]
] | [
"import java.io.BufferedReader;\nimport java.io.InputStreamReader;\nimport java.util.List;\nimport java.util.ArrayList;\n\n/*Question\n/???????????????????¨???????????????????????????????????????????????¨???°????????°??????????????°??????????¨???°???????¨??????§??????\n/????????°????????¬?????????????¨??????§?¨???°???????????°??? (1+2)*(5+4) ?????????????????????????¨??????§??? 1 2 + 5 4 + * ??¨?¨???°???????????????\n/???????????????????¨??????§?????????????¨??????§????????¨????????¬??§???????????§???????????¨????????????????????????????????????\n/???????????????????¨??????§?????????????????°???????¨???????????????????????????????????????? \n*/\n\n/*Input\n/???????????°??????????????????????????????????????£?¶?????????????????????????????????????????????????????????????????????????????????§???????????????????????????????????? \n*/\n\npublic class Main {\n\tpublic static void main(String[] args) throws Exception {\n\t\tint i = Calc();\n\t\tSystem.out.println(i);\n\t}\n\n\t/*Calc????????????\n\t/Unicode????????????????????§?????°???????¨???????????????§???????????§????????§??????????????°???????¨???????????????????\n\t/??°?????????x??????????????????\n\t/??°?????????????????????????????????????¨??????????????????????x?????????????????¨???????????§?¨????????????°??????\n\t/?¨??????????????????????2?????´???????????????????????????????????????????????\\??????????????????????¶?????????????\n\t*/\n\n\tstatic int Calc() throws Exception {\n\t\tBufferedReader sc = new BufferedReader(new InputStreamReader(System.in));\n\t\t//???????????????????????°???????´????????????????????´???¨\n\t\tList<Integer> x = new ArrayList<Integer>();\n\t\t//???????????£??¨\n\t\tint t;\n\t\t//??\\???\n\t\tString[] s = sc.readLine().split(\" \");\n\t\t//?¨??????????????????°???????????????????????????\n\t\tfor (int i = 0;i < s.length;i++){\n\t\t\tif (s[i].compareToIgnoreCase(\"-\") > 0) {\n\t\t\t\tx.add(Integer.parseInt(s[i]));\n\t\t\t}else {\n\t\t\t\tif(s[i].equals(\"*\")){\n\t\t\t\t\tt = (x.get(x.size()-2)*x.get(x.size()-1));\n\t\t\t\t\tif (x.size() > 2) {\n\t\t\t\t\t\tx.remove(x.size()-1);\n\t\t\t\t\t\tx.remove(x.size()-1);\n\t\t\t\t\t}else x.clear();\n\t\t\t\t\tx.add(t);\n\t\t\t\t}else if(s[i].equals(\"+\")){\n\t\t\t\t\tt = (x.get(x.size()-2)+x.get(x.size()-1));\n\t\t\t\t\tif (x.size() > 2) {\n\t\t\t\t\t\tx.remove(x.size()-1);\n\t\t\t\t\t\tx.remove(x.size()-1);\n\t\t\t\t\t}else x.clear();\n\t\t\t\t\tx.add(t);\n\t\t\t\t}else if(s[i].equals(\"-\")){\n\t\t\t\t\tt = (x.get(x.size()-2)-x.get(x.size()-1));\n\t\t\t\t\tif (x.size() > 2) {\n\t\t\t\t\t\tx.remove(x.size()-1);\n\t\t\t\t\t\tx.remove(x.size()-1);\n\t\t\t\t\t}else x.clear();\n\t\t\t\t\tx.add(t);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn x.get(x.size()-1);\n\t}\n}",
"import java.io.BufferedReader;",
"BufferedReader",
"java.io",
"import java.io.InputStreamReader;",
"InputStreamReader",
"java.io",
"import java.util.List;",
"List",
"java.util",
"import java.util.ArrayList;",
"ArrayList",
"java.util",
"public class Main {\n\tpublic static void main(String[] args) throws Exception {\n\t\tint i = Calc();\n\t\tSystem.out.println(i);\n\t}\n\n\t/*Calc????????????\n\t/Unicode????????????????????§?????°???????¨???????????????§???????????§????????§??????????????°???????¨???????????????????\n\t/??°?????????x??????????????????\n\t/??°?????????????????????????????????????¨??????????????????????x?????????????????¨???????????§?¨????????????°??????\n\t/?¨??????????????????????2?????´???????????????????????????????????????????????\\??????????????????????¶?????????????\n\t*/\n\n\tstatic int Calc() throws Exception {\n\t\tBufferedReader sc = new BufferedReader(new InputStreamReader(System.in));\n\t\t//???????????????????????°???????´????????????????????´???¨\n\t\tList<Integer> x = new ArrayList<Integer>();\n\t\t//???????????£??¨\n\t\tint t;\n\t\t//??\\???\n\t\tString[] s = sc.readLine().split(\" \");\n\t\t//?¨??????????????????°???????????????????????????\n\t\tfor (int i = 0;i < s.length;i++){\n\t\t\tif (s[i].compareToIgnoreCase(\"-\") > 0) {\n\t\t\t\tx.add(Integer.parseInt(s[i]));\n\t\t\t}else {\n\t\t\t\tif(s[i].equals(\"*\")){\n\t\t\t\t\tt = (x.get(x.size()-2)*x.get(x.size()-1));\n\t\t\t\t\tif (x.size() > 2) {\n\t\t\t\t\t\tx.remove(x.size()-1);\n\t\t\t\t\t\tx.remove(x.size()-1);\n\t\t\t\t\t}else x.clear();\n\t\t\t\t\tx.add(t);\n\t\t\t\t}else if(s[i].equals(\"+\")){\n\t\t\t\t\tt = (x.get(x.size()-2)+x.get(x.size()-1));\n\t\t\t\t\tif (x.size() > 2) {\n\t\t\t\t\t\tx.remove(x.size()-1);\n\t\t\t\t\t\tx.remove(x.size()-1);\n\t\t\t\t\t}else x.clear();\n\t\t\t\t\tx.add(t);\n\t\t\t\t}else if(s[i].equals(\"-\")){\n\t\t\t\t\tt = (x.get(x.size()-2)-x.get(x.size()-1));\n\t\t\t\t\tif (x.size() > 2) {\n\t\t\t\t\t\tx.remove(x.size()-1);\n\t\t\t\t\t\tx.remove(x.size()-1);\n\t\t\t\t\t}else x.clear();\n\t\t\t\t\tx.add(t);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn x.get(x.size()-1);\n\t}\n}",
"Main",
"public static void main(String[] args) throws Exception {\n\t\tint i = Calc();\n\t\tSystem.out.println(i);\n\t}",
"main",
"{\n\t\tint i = Calc();\n\t\tSystem.out.println(i);\n\t}",
"int i = Calc();",
"i",
"Calc()",
"Calc",
"System.out.println(i)",
"System.out.println",
"System.out",
"System",
"System.out",
"i",
"String[] args",
"args",
"static int Calc() throws Exception {\n\t\tBufferedReader sc = new BufferedReader(new InputStreamReader(System.in));\n\t\t//???????????????????????°???????´????????????????????´???¨\n\t\tList<Integer> x = new ArrayList<Integer>();\n\t\t//???????????£??¨\n\t\tint t;\n\t\t//??\\???\n\t\tString[] s = sc.readLine().split(\" \");\n\t\t//?¨??????????????????°???????????????????????????\n\t\tfor (int i = 0;i < s.length;i++){\n\t\t\tif (s[i].compareToIgnoreCase(\"-\") > 0) {\n\t\t\t\tx.add(Integer.parseInt(s[i]));\n\t\t\t}else {\n\t\t\t\tif(s[i].equals(\"*\")){\n\t\t\t\t\tt = (x.get(x.size()-2)*x.get(x.size()-1));\n\t\t\t\t\tif (x.size() > 2) {\n\t\t\t\t\t\tx.remove(x.size()-1);\n\t\t\t\t\t\tx.remove(x.size()-1);\n\t\t\t\t\t}else x.clear();\n\t\t\t\t\tx.add(t);\n\t\t\t\t}else if(s[i].equals(\"+\")){\n\t\t\t\t\tt = (x.get(x.size()-2)+x.get(x.size()-1));\n\t\t\t\t\tif (x.size() > 2) {\n\t\t\t\t\t\tx.remove(x.size()-1);\n\t\t\t\t\t\tx.remove(x.size()-1);\n\t\t\t\t\t}else x.clear();\n\t\t\t\t\tx.add(t);\n\t\t\t\t}else if(s[i].equals(\"-\")){\n\t\t\t\t\tt = (x.get(x.size()-2)-x.get(x.size()-1));\n\t\t\t\t\tif (x.size() > 2) {\n\t\t\t\t\t\tx.remove(x.size()-1);\n\t\t\t\t\t\tx.remove(x.size()-1);\n\t\t\t\t\t}else x.clear();\n\t\t\t\t\tx.add(t);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn x.get(x.size()-1);\n\t}",
"Calc",
"{\n\t\tBufferedReader sc = new BufferedReader(new InputStreamReader(System.in));\n\t\t//???????????????????????°???????´????????????????????´???¨\n\t\tList<Integer> x = new ArrayList<Integer>();\n\t\t//???????????£??¨\n\t\tint t;\n\t\t//??\\???\n\t\tString[] s = sc.readLine().split(\" \");\n\t\t//?¨??????????????????°???????????????????????????\n\t\tfor (int i = 0;i < s.length;i++){\n\t\t\tif (s[i].compareToIgnoreCase(\"-\") > 0) {\n\t\t\t\tx.add(Integer.parseInt(s[i]));\n\t\t\t}else {\n\t\t\t\tif(s[i].equals(\"*\")){\n\t\t\t\t\tt = (x.get(x.size()-2)*x.get(x.size()-1));\n\t\t\t\t\tif (x.size() > 2) {\n\t\t\t\t\t\tx.remove(x.size()-1);\n\t\t\t\t\t\tx.remove(x.size()-1);\n\t\t\t\t\t}else x.clear();\n\t\t\t\t\tx.add(t);\n\t\t\t\t}else if(s[i].equals(\"+\")){\n\t\t\t\t\tt = (x.get(x.size()-2)+x.get(x.size()-1));\n\t\t\t\t\tif (x.size() > 2) {\n\t\t\t\t\t\tx.remove(x.size()-1);\n\t\t\t\t\t\tx.remove(x.size()-1);\n\t\t\t\t\t}else x.clear();\n\t\t\t\t\tx.add(t);\n\t\t\t\t}else if(s[i].equals(\"-\")){\n\t\t\t\t\tt = (x.get(x.size()-2)-x.get(x.size()-1));\n\t\t\t\t\tif (x.size() > 2) {\n\t\t\t\t\t\tx.remove(x.size()-1);\n\t\t\t\t\t\tx.remove(x.size()-1);\n\t\t\t\t\t}else x.clear();\n\t\t\t\t\tx.add(t);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn x.get(x.size()-1);\n\t}",
"BufferedReader sc = new BufferedReader(new InputStreamReader(System.in));",
"sc",
"new BufferedReader(new InputStreamReader(System.in))",
"List<Integer> x = new ArrayList<Integer>();",
"x",
"new ArrayList<Integer>()",
"int t;",
"t",
"String[] s = sc.readLine().split(\" \");",
"s",
"sc.readLine().split(\" \")",
"sc.readLine().split",
"sc.readLine()",
"sc.readLine",
"sc",
"\" \"",
"for (int i = 0;i < s.length;i++){\n\t\t\tif (s[i].compareToIgnoreCase(\"-\") > 0) {\n\t\t\t\tx.add(Integer.parseInt(s[i]));\n\t\t\t}else {\n\t\t\t\tif(s[i].equals(\"*\")){\n\t\t\t\t\tt = (x.get(x.size()-2)*x.get(x.size()-1));\n\t\t\t\t\tif (x.size() > 2) {\n\t\t\t\t\t\tx.remove(x.size()-1);\n\t\t\t\t\t\tx.remove(x.size()-1);\n\t\t\t\t\t}else x.clear();\n\t\t\t\t\tx.add(t);\n\t\t\t\t}else if(s[i].equals(\"+\")){\n\t\t\t\t\tt = (x.get(x.size()-2)+x.get(x.size()-1));\n\t\t\t\t\tif (x.size() > 2) {\n\t\t\t\t\t\tx.remove(x.size()-1);\n\t\t\t\t\t\tx.remove(x.size()-1);\n\t\t\t\t\t}else x.clear();\n\t\t\t\t\tx.add(t);\n\t\t\t\t}else if(s[i].equals(\"-\")){\n\t\t\t\t\tt = (x.get(x.size()-2)-x.get(x.size()-1));\n\t\t\t\t\tif (x.size() > 2) {\n\t\t\t\t\t\tx.remove(x.size()-1);\n\t\t\t\t\t\tx.remove(x.size()-1);\n\t\t\t\t\t}else x.clear();\n\t\t\t\t\tx.add(t);\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < s.length",
"i",
"s.length",
"s",
"s.length",
"i++",
"i++",
"i",
"{\n\t\t\tif (s[i].compareToIgnoreCase(\"-\") > 0) {\n\t\t\t\tx.add(Integer.parseInt(s[i]));\n\t\t\t}else {\n\t\t\t\tif(s[i].equals(\"*\")){\n\t\t\t\t\tt = (x.get(x.size()-2)*x.get(x.size()-1));\n\t\t\t\t\tif (x.size() > 2) {\n\t\t\t\t\t\tx.remove(x.size()-1);\n\t\t\t\t\t\tx.remove(x.size()-1);\n\t\t\t\t\t}else x.clear();\n\t\t\t\t\tx.add(t);\n\t\t\t\t}else if(s[i].equals(\"+\")){\n\t\t\t\t\tt = (x.get(x.size()-2)+x.get(x.size()-1));\n\t\t\t\t\tif (x.size() > 2) {\n\t\t\t\t\t\tx.remove(x.size()-1);\n\t\t\t\t\t\tx.remove(x.size()-1);\n\t\t\t\t\t}else x.clear();\n\t\t\t\t\tx.add(t);\n\t\t\t\t}else if(s[i].equals(\"-\")){\n\t\t\t\t\tt = (x.get(x.size()-2)-x.get(x.size()-1));\n\t\t\t\t\tif (x.size() > 2) {\n\t\t\t\t\t\tx.remove(x.size()-1);\n\t\t\t\t\t\tx.remove(x.size()-1);\n\t\t\t\t\t}else x.clear();\n\t\t\t\t\tx.add(t);\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"{\n\t\t\tif (s[i].compareToIgnoreCase(\"-\") > 0) {\n\t\t\t\tx.add(Integer.parseInt(s[i]));\n\t\t\t}else {\n\t\t\t\tif(s[i].equals(\"*\")){\n\t\t\t\t\tt = (x.get(x.size()-2)*x.get(x.size()-1));\n\t\t\t\t\tif (x.size() > 2) {\n\t\t\t\t\t\tx.remove(x.size()-1);\n\t\t\t\t\t\tx.remove(x.size()-1);\n\t\t\t\t\t}else x.clear();\n\t\t\t\t\tx.add(t);\n\t\t\t\t}else if(s[i].equals(\"+\")){\n\t\t\t\t\tt = (x.get(x.size()-2)+x.get(x.size()-1));\n\t\t\t\t\tif (x.size() > 2) {\n\t\t\t\t\t\tx.remove(x.size()-1);\n\t\t\t\t\t\tx.remove(x.size()-1);\n\t\t\t\t\t}else x.clear();\n\t\t\t\t\tx.add(t);\n\t\t\t\t}else if(s[i].equals(\"-\")){\n\t\t\t\t\tt = (x.get(x.size()-2)-x.get(x.size()-1));\n\t\t\t\t\tif (x.size() > 2) {\n\t\t\t\t\t\tx.remove(x.size()-1);\n\t\t\t\t\t\tx.remove(x.size()-1);\n\t\t\t\t\t}else x.clear();\n\t\t\t\t\tx.add(t);\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"if (s[i].compareToIgnoreCase(\"-\") > 0) {\n\t\t\t\tx.add(Integer.parseInt(s[i]));\n\t\t\t}else {\n\t\t\t\tif(s[i].equals(\"*\")){\n\t\t\t\t\tt = (x.get(x.size()-2)*x.get(x.size()-1));\n\t\t\t\t\tif (x.size() > 2) {\n\t\t\t\t\t\tx.remove(x.size()-1);\n\t\t\t\t\t\tx.remove(x.size()-1);\n\t\t\t\t\t}else x.clear();\n\t\t\t\t\tx.add(t);\n\t\t\t\t}else if(s[i].equals(\"+\")){\n\t\t\t\t\tt = (x.get(x.size()-2)+x.get(x.size()-1));\n\t\t\t\t\tif (x.size() > 2) {\n\t\t\t\t\t\tx.remove(x.size()-1);\n\t\t\t\t\t\tx.remove(x.size()-1);\n\t\t\t\t\t}else x.clear();\n\t\t\t\t\tx.add(t);\n\t\t\t\t}else if(s[i].equals(\"-\")){\n\t\t\t\t\tt = (x.get(x.size()-2)-x.get(x.size()-1));\n\t\t\t\t\tif (x.size() > 2) {\n\t\t\t\t\t\tx.remove(x.size()-1);\n\t\t\t\t\t\tx.remove(x.size()-1);\n\t\t\t\t\t}else x.clear();\n\t\t\t\t\tx.add(t);\n\t\t\t\t}\n\t\t\t}",
"s[i].compareToIgnoreCase(\"-\") > 0",
"s[i].compareToIgnoreCase(\"-\")",
"s[i].compareToIgnoreCase",
"s[i]",
"s",
"i",
"\"-\"",
"0",
"{\n\t\t\t\tx.add(Integer.parseInt(s[i]));\n\t\t\t}",
"x.add(Integer.parseInt(s[i]))",
"x.add",
"x",
"Integer.parseInt(s[i])",
"Integer.parseInt",
"Integer",
"s[i]",
"s",
"i",
"{\n\t\t\t\tif(s[i].equals(\"*\")){\n\t\t\t\t\tt = (x.get(x.size()-2)*x.get(x.size()-1));\n\t\t\t\t\tif (x.size() > 2) {\n\t\t\t\t\t\tx.remove(x.size()-1);\n\t\t\t\t\t\tx.remove(x.size()-1);\n\t\t\t\t\t}else x.clear();\n\t\t\t\t\tx.add(t);\n\t\t\t\t}else if(s[i].equals(\"+\")){\n\t\t\t\t\tt = (x.get(x.size()-2)+x.get(x.size()-1));\n\t\t\t\t\tif (x.size() > 2) {\n\t\t\t\t\t\tx.remove(x.size()-1);\n\t\t\t\t\t\tx.remove(x.size()-1);\n\t\t\t\t\t}else x.clear();\n\t\t\t\t\tx.add(t);\n\t\t\t\t}else if(s[i].equals(\"-\")){\n\t\t\t\t\tt = (x.get(x.size()-2)-x.get(x.size()-1));\n\t\t\t\t\tif (x.size() > 2) {\n\t\t\t\t\t\tx.remove(x.size()-1);\n\t\t\t\t\t\tx.remove(x.size()-1);\n\t\t\t\t\t}else x.clear();\n\t\t\t\t\tx.add(t);\n\t\t\t\t}\n\t\t\t}",
"if(s[i].equals(\"*\")){\n\t\t\t\t\tt = (x.get(x.size()-2)*x.get(x.size()-1));\n\t\t\t\t\tif (x.size() > 2) {\n\t\t\t\t\t\tx.remove(x.size()-1);\n\t\t\t\t\t\tx.remove(x.size()-1);\n\t\t\t\t\t}else x.clear();\n\t\t\t\t\tx.add(t);\n\t\t\t\t}else if(s[i].equals(\"+\")){\n\t\t\t\t\tt = (x.get(x.size()-2)+x.get(x.size()-1));\n\t\t\t\t\tif (x.size() > 2) {\n\t\t\t\t\t\tx.remove(x.size()-1);\n\t\t\t\t\t\tx.remove(x.size()-1);\n\t\t\t\t\t}else x.clear();\n\t\t\t\t\tx.add(t);\n\t\t\t\t}else if(s[i].equals(\"-\")){\n\t\t\t\t\tt = (x.get(x.size()-2)-x.get(x.size()-1));\n\t\t\t\t\tif (x.size() > 2) {\n\t\t\t\t\t\tx.remove(x.size()-1);\n\t\t\t\t\t\tx.remove(x.size()-1);\n\t\t\t\t\t}else x.clear();\n\t\t\t\t\tx.add(t);\n\t\t\t\t}",
"s[i].equals(\"*\")",
"s[i].equals",
"s[i]",
"s",
"i",
"\"*\"",
"{\n\t\t\t\t\tt = (x.get(x.size()-2)*x.get(x.size()-1));\n\t\t\t\t\tif (x.size() > 2) {\n\t\t\t\t\t\tx.remove(x.size()-1);\n\t\t\t\t\t\tx.remove(x.size()-1);\n\t\t\t\t\t}else x.clear();\n\t\t\t\t\tx.add(t);\n\t\t\t\t}",
"t = (x.get(x.size()-2)*x.get(x.size()-1))",
"t",
"(x.get(x.size()-2)*x.get(x.size()-1))",
"x.get(x.size()-2)",
"x.get",
"x",
"x.size()-2",
"x.size()",
"x.size",
"x",
"2",
"x.get(x.size()-1)",
"x.get",
"x",
"x.size()-1",
"x.size()",
"x.size",
"x",
"1",
"if (x.size() > 2) {\n\t\t\t\t\t\tx.remove(x.size()-1);\n\t\t\t\t\t\tx.remove(x.size()-1);\n\t\t\t\t\t}else x.clear();",
"x.size() > 2",
"x.size()",
"x.size",
"x",
"2",
"{\n\t\t\t\t\t\tx.remove(x.size()-1);\n\t\t\t\t\t\tx.remove(x.size()-1);\n\t\t\t\t\t}",
"x.remove(x.size()-1)",
"x.remove",
"x",
"x.size()-1",
"x.size()",
"x.size",
"x",
"1",
"x.remove(x.size()-1)",
"x.remove",
"x",
"x.size()-1",
"x.size()",
"x.size",
"x",
"1",
"x.clear()",
"x.clear",
"x",
"x.add(t)",
"x.add",
"x",
"t",
"if(s[i].equals(\"+\")){\n\t\t\t\t\tt = (x.get(x.size()-2)+x.get(x.size()-1));\n\t\t\t\t\tif (x.size() > 2) {\n\t\t\t\t\t\tx.remove(x.size()-1);\n\t\t\t\t\t\tx.remove(x.size()-1);\n\t\t\t\t\t}else x.clear();\n\t\t\t\t\tx.add(t);\n\t\t\t\t}else if(s[i].equals(\"-\")){\n\t\t\t\t\tt = (x.get(x.size()-2)-x.get(x.size()-1));\n\t\t\t\t\tif (x.size() > 2) {\n\t\t\t\t\t\tx.remove(x.size()-1);\n\t\t\t\t\t\tx.remove(x.size()-1);\n\t\t\t\t\t}else x.clear();\n\t\t\t\t\tx.add(t);\n\t\t\t\t}",
"s[i].equals(\"+\")",
"s[i].equals",
"s[i]",
"s",
"i",
"\"+\"",
"{\n\t\t\t\t\tt = (x.get(x.size()-2)+x.get(x.size()-1));\n\t\t\t\t\tif (x.size() > 2) {\n\t\t\t\t\t\tx.remove(x.size()-1);\n\t\t\t\t\t\tx.remove(x.size()-1);\n\t\t\t\t\t}else x.clear();\n\t\t\t\t\tx.add(t);\n\t\t\t\t}",
"t = (x.get(x.size()-2)+x.get(x.size()-1))",
"t",
"(x.get(x.size()-2)+x.get(x.size()-1))",
"x.get(x.size()-2)",
"x.get",
"x",
"x.size()-2",
"x.size()",
"x.size",
"x",
"2",
"x.get(x.size()-1)",
"x.get",
"x",
"x.size()-1",
"x.size()",
"x.size",
"x",
"1",
"if (x.size() > 2) {\n\t\t\t\t\t\tx.remove(x.size()-1);\n\t\t\t\t\t\tx.remove(x.size()-1);\n\t\t\t\t\t}else x.clear();",
"x.size() > 2",
"x.size()",
"x.size",
"x",
"2",
"{\n\t\t\t\t\t\tx.remove(x.size()-1);\n\t\t\t\t\t\tx.remove(x.size()-1);\n\t\t\t\t\t}",
"x.remove(x.size()-1)",
"x.remove",
"x",
"x.size()-1",
"x.size()",
"x.size",
"x",
"1",
"x.remove(x.size()-1)",
"x.remove",
"x",
"x.size()-1",
"x.size()",
"x.size",
"x",
"1",
"x.clear()",
"x.clear",
"x",
"x.add(t)",
"x.add",
"x",
"t",
"if(s[i].equals(\"-\")){\n\t\t\t\t\tt = (x.get(x.size()-2)-x.get(x.size()-1));\n\t\t\t\t\tif (x.size() > 2) {\n\t\t\t\t\t\tx.remove(x.size()-1);\n\t\t\t\t\t\tx.remove(x.size()-1);\n\t\t\t\t\t}else x.clear();\n\t\t\t\t\tx.add(t);\n\t\t\t\t}",
"s[i].equals(\"-\")",
"s[i].equals",
"s[i]",
"s",
"i",
"\"-\"",
"{\n\t\t\t\t\tt = (x.get(x.size()-2)-x.get(x.size()-1));\n\t\t\t\t\tif (x.size() > 2) {\n\t\t\t\t\t\tx.remove(x.size()-1);\n\t\t\t\t\t\tx.remove(x.size()-1);\n\t\t\t\t\t}else x.clear();\n\t\t\t\t\tx.add(t);\n\t\t\t\t}",
"t = (x.get(x.size()-2)-x.get(x.size()-1))",
"t",
"(x.get(x.size()-2)-x.get(x.size()-1))",
"x.get(x.size()-2)",
"x.get",
"x",
"x.size()-2",
"x.size()",
"x.size",
"x",
"2",
"x.get(x.size()-1)",
"x.get",
"x",
"x.size()-1",
"x.size()",
"x.size",
"x",
"1",
"if (x.size() > 2) {\n\t\t\t\t\t\tx.remove(x.size()-1);\n\t\t\t\t\t\tx.remove(x.size()-1);\n\t\t\t\t\t}else x.clear();",
"x.size() > 2",
"x.size()",
"x.size",
"x",
"2",
"{\n\t\t\t\t\t\tx.remove(x.size()-1);\n\t\t\t\t\t\tx.remove(x.size()-1);\n\t\t\t\t\t}",
"x.remove(x.size()-1)",
"x.remove",
"x",
"x.size()-1",
"x.size()",
"x.size",
"x",
"1",
"x.remove(x.size()-1)",
"x.remove",
"x",
"x.size()-1",
"x.size()",
"x.size",
"x",
"1",
"x.clear()",
"x.clear",
"x",
"x.add(t)",
"x.add",
"x",
"t",
"return x.get(x.size()-1);",
"x.get(x.size()-1)",
"x.get",
"x",
"x.size()-1",
"x.size()",
"x.size",
"x",
"1",
"public class Main {\n\tpublic static void main(String[] args) throws Exception {\n\t\tint i = Calc();\n\t\tSystem.out.println(i);\n\t}\n\n\t/*Calc????????????\n\t/Unicode????????????????????§?????°???????¨???????????????§???????????§????????§??????????????°???????¨???????????????????\n\t/??°?????????x??????????????????\n\t/??°?????????????????????????????????????¨??????????????????????x?????????????????¨???????????§?¨????????????°??????\n\t/?¨??????????????????????2?????´???????????????????????????????????????????????\\??????????????????????¶?????????????\n\t*/\n\n\tstatic int Calc() throws Exception {\n\t\tBufferedReader sc = new BufferedReader(new InputStreamReader(System.in));\n\t\t//???????????????????????°???????´????????????????????´???¨\n\t\tList<Integer> x = new ArrayList<Integer>();\n\t\t//???????????£??¨\n\t\tint t;\n\t\t//??\\???\n\t\tString[] s = sc.readLine().split(\" \");\n\t\t//?¨??????????????????°???????????????????????????\n\t\tfor (int i = 0;i < s.length;i++){\n\t\t\tif (s[i].compareToIgnoreCase(\"-\") > 0) {\n\t\t\t\tx.add(Integer.parseInt(s[i]));\n\t\t\t}else {\n\t\t\t\tif(s[i].equals(\"*\")){\n\t\t\t\t\tt = (x.get(x.size()-2)*x.get(x.size()-1));\n\t\t\t\t\tif (x.size() > 2) {\n\t\t\t\t\t\tx.remove(x.size()-1);\n\t\t\t\t\t\tx.remove(x.size()-1);\n\t\t\t\t\t}else x.clear();\n\t\t\t\t\tx.add(t);\n\t\t\t\t}else if(s[i].equals(\"+\")){\n\t\t\t\t\tt = (x.get(x.size()-2)+x.get(x.size()-1));\n\t\t\t\t\tif (x.size() > 2) {\n\t\t\t\t\t\tx.remove(x.size()-1);\n\t\t\t\t\t\tx.remove(x.size()-1);\n\t\t\t\t\t}else x.clear();\n\t\t\t\t\tx.add(t);\n\t\t\t\t}else if(s[i].equals(\"-\")){\n\t\t\t\t\tt = (x.get(x.size()-2)-x.get(x.size()-1));\n\t\t\t\t\tif (x.size() > 2) {\n\t\t\t\t\t\tx.remove(x.size()-1);\n\t\t\t\t\t\tx.remove(x.size()-1);\n\t\t\t\t\t}else x.clear();\n\t\t\t\t\tx.add(t);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn x.get(x.size()-1);\n\t}\n}",
"public class Main {\n\tpublic static void main(String[] args) throws Exception {\n\t\tint i = Calc();\n\t\tSystem.out.println(i);\n\t}\n\n\t/*Calc????????????\n\t/Unicode????????????????????§?????°???????¨???????????????§???????????§????????§??????????????°???????¨???????????????????\n\t/??°?????????x??????????????????\n\t/??°?????????????????????????????????????¨??????????????????????x?????????????????¨???????????§?¨????????????°??????\n\t/?¨??????????????????????2?????´???????????????????????????????????????????????\\??????????????????????¶?????????????\n\t*/\n\n\tstatic int Calc() throws Exception {\n\t\tBufferedReader sc = new BufferedReader(new InputStreamReader(System.in));\n\t\t//???????????????????????°???????´????????????????????´???¨\n\t\tList<Integer> x = new ArrayList<Integer>();\n\t\t//???????????£??¨\n\t\tint t;\n\t\t//??\\???\n\t\tString[] s = sc.readLine().split(\" \");\n\t\t//?¨??????????????????°???????????????????????????\n\t\tfor (int i = 0;i < s.length;i++){\n\t\t\tif (s[i].compareToIgnoreCase(\"-\") > 0) {\n\t\t\t\tx.add(Integer.parseInt(s[i]));\n\t\t\t}else {\n\t\t\t\tif(s[i].equals(\"*\")){\n\t\t\t\t\tt = (x.get(x.size()-2)*x.get(x.size()-1));\n\t\t\t\t\tif (x.size() > 2) {\n\t\t\t\t\t\tx.remove(x.size()-1);\n\t\t\t\t\t\tx.remove(x.size()-1);\n\t\t\t\t\t}else x.clear();\n\t\t\t\t\tx.add(t);\n\t\t\t\t}else if(s[i].equals(\"+\")){\n\t\t\t\t\tt = (x.get(x.size()-2)+x.get(x.size()-1));\n\t\t\t\t\tif (x.size() > 2) {\n\t\t\t\t\t\tx.remove(x.size()-1);\n\t\t\t\t\t\tx.remove(x.size()-1);\n\t\t\t\t\t}else x.clear();\n\t\t\t\t\tx.add(t);\n\t\t\t\t}else if(s[i].equals(\"-\")){\n\t\t\t\t\tt = (x.get(x.size()-2)-x.get(x.size()-1));\n\t\t\t\t\tif (x.size() > 2) {\n\t\t\t\t\t\tx.remove(x.size()-1);\n\t\t\t\t\t\tx.remove(x.size()-1);\n\t\t\t\t\t}else x.clear();\n\t\t\t\t\tx.add(t);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn x.get(x.size()-1);\n\t}\n}",
"Main"
] | import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.List;
import java.util.ArrayList;
/*Question
/???????????????????¨???????????????????????????????????????????????¨???°????????°??????????????°??????????¨???°???????¨??????§??????
/????????°????????¬?????????????¨??????§?¨???°???????????°??? (1+2)*(5+4) ?????????????????????????¨??????§??? 1 2 + 5 4 + * ??¨?¨???°???????????????
/???????????????????¨??????§?????????????¨??????§????????¨????????¬??§???????????§???????????¨????????????????????????????????????
/???????????????????¨??????§?????????????????°???????¨????????????????????????????????????????
*/
/*Input
/???????????°??????????????????????????????????????£?¶?????????????????????????????????????????????????????????????????????????????????§????????????????????????????????????
*/
public class Main {
public static void main(String[] args) throws Exception {
int i = Calc();
System.out.println(i);
}
/*Calc????????????
/Unicode????????????????????§?????°???????¨???????????????§???????????§????????§??????????????°???????¨???????????????????
/??°?????????x??????????????????
/??°?????????????????????????????????????¨??????????????????????x?????????????????¨???????????§?¨????????????°??????
/?¨??????????????????????2?????´???????????????????????????????????????????????\??????????????????????¶?????????????
*/
static int Calc() throws Exception {
BufferedReader sc = new BufferedReader(new InputStreamReader(System.in));
//???????????????????????°???????´????????????????????´???¨
List<Integer> x = new ArrayList<Integer>();
//???????????£??¨
int t;
//??\???
String[] s = sc.readLine().split(" ");
//?¨??????????????????°???????????????????????????
for (int i = 0;i < s.length;i++){
if (s[i].compareToIgnoreCase("-") > 0) {
x.add(Integer.parseInt(s[i]));
}else {
if(s[i].equals("*")){
t = (x.get(x.size()-2)*x.get(x.size()-1));
if (x.size() > 2) {
x.remove(x.size()-1);
x.remove(x.size()-1);
}else x.clear();
x.add(t);
}else if(s[i].equals("+")){
t = (x.get(x.size()-2)+x.get(x.size()-1));
if (x.size() > 2) {
x.remove(x.size()-1);
x.remove(x.size()-1);
}else x.clear();
x.add(t);
}else if(s[i].equals("-")){
t = (x.get(x.size()-2)-x.get(x.size()-1));
if (x.size() > 2) {
x.remove(x.size()-1);
x.remove(x.size()-1);
}else x.clear();
x.add(t);
}
}
}
return x.get(x.size()-1);
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
20,
42,
4,
18,
13,
30,
41,
13,
4,
18,
13,
14,
4,
18,
13,
17,
30,
41,
13,
2,
4,
18,
13,
4,
18,
13,
4,
18,
13,
13,
14,
4,
18,
13,
17,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
2,
13,
13,
4,
18,
13,
13,
14,
4,
18,
13,
17,
30,
41,
13,
2,
4,
18,
13,
4,
18,
13,
4,
18,
13,
13,
30,
4,
18,
13,
4,
18,
13,
13,
4,
18,
18,
13,
13,
4,
18,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
107,
5
],
[
107,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
8,
15
],
[
15,
16
],
[
16,
17
],
[
17,
18
],
[
15,
19
],
[
19,
20
],
[
20,
21
],
[
20,
22
],
[
22,
23
],
[
23,
24
],
[
19,
25
],
[
25,
26
],
[
26,
27
],
[
27,
28
],
[
26,
29
],
[
25,
30
],
[
30,
31
],
[
31,
32
],
[
31,
33
],
[
33,
34
],
[
34,
35
],
[
35,
36
],
[
33,
37
],
[
37,
38
],
[
38,
39
],
[
30,
40
],
[
40,
41
],
[
41,
42
],
[
40,
43
],
[
25,
44
],
[
44,
45
],
[
45,
46
],
[
46,
47
],
[
45,
48
],
[
44,
49
],
[
49,
50
],
[
50,
51
],
[
50,
52
],
[
52,
53
],
[
53,
54
],
[
49,
55
],
[
55,
56
],
[
55,
57
],
[
57,
58
],
[
58,
59
],
[
49,
60
],
[
60,
61
],
[
60,
62
],
[
62,
63
],
[
62,
64
],
[
49,
65
],
[
65,
66
],
[
66,
67
],
[
65,
68
],
[
44,
69
],
[
69,
70
],
[
70,
71
],
[
71,
72
],
[
70,
73
],
[
69,
74
],
[
74,
75
],
[
75,
76
],
[
75,
77
],
[
77,
78
],
[
78,
79
],
[
79,
80
],
[
77,
81
],
[
81,
82
],
[
82,
83
],
[
74,
84
],
[
84,
85
],
[
85,
86
],
[
84,
87
],
[
69,
88
],
[
88,
89
],
[
89,
90
],
[
90,
91
],
[
89,
92
],
[
92,
93
],
[
93,
94
],
[
92,
95
],
[
8,
96
],
[
96,
97
],
[
97,
98
],
[
98,
99
],
[
98,
100
],
[
96,
101
],
[
101,
102
],
[
102,
103
],
[
6,
104
],
[
104,
105
],
[
0,
106
],
[
106,
107
],
[
106,
108
]
] | [
"import java.util.*;\n\npublic class Main {\n public static void main(String[] args) throws Exception {\n // Your code here!\n Scanner sc = new Scanner(System.in);\n Deque<Integer> stack = new ArrayDeque<Integer>();\n\n while(sc.hasNext()) {\n String n = sc.next();\n if (n.equals(\"+\")){\n int a = stack.pop()+stack.pop();\n stack.push(a);\n } else if (n.equals(\"-\")){\n int x = stack.pop();\n int y = stack.pop();\n int a = y-x;\n stack.push(a);\n } else if (n.equals(\"*\")) {\n int a = stack.pop()*stack.pop();\n stack.push(a);\n } else {\n stack.push(Integer.parseInt(n));\n }\n \n }\n System.out.println(stack.pop());\n \n }\n}\n",
"import java.util.*;",
"util.*",
"java",
"public class Main {\n public static void main(String[] args) throws Exception {\n // Your code here!\n Scanner sc = new Scanner(System.in);\n Deque<Integer> stack = new ArrayDeque<Integer>();\n\n while(sc.hasNext()) {\n String n = sc.next();\n if (n.equals(\"+\")){\n int a = stack.pop()+stack.pop();\n stack.push(a);\n } else if (n.equals(\"-\")){\n int x = stack.pop();\n int y = stack.pop();\n int a = y-x;\n stack.push(a);\n } else if (n.equals(\"*\")) {\n int a = stack.pop()*stack.pop();\n stack.push(a);\n } else {\n stack.push(Integer.parseInt(n));\n }\n \n }\n System.out.println(stack.pop());\n \n }\n}",
"Main",
"public static void main(String[] args) throws Exception {\n // Your code here!\n Scanner sc = new Scanner(System.in);\n Deque<Integer> stack = new ArrayDeque<Integer>();\n\n while(sc.hasNext()) {\n String n = sc.next();\n if (n.equals(\"+\")){\n int a = stack.pop()+stack.pop();\n stack.push(a);\n } else if (n.equals(\"-\")){\n int x = stack.pop();\n int y = stack.pop();\n int a = y-x;\n stack.push(a);\n } else if (n.equals(\"*\")) {\n int a = stack.pop()*stack.pop();\n stack.push(a);\n } else {\n stack.push(Integer.parseInt(n));\n }\n \n }\n System.out.println(stack.pop());\n \n }",
"main",
"{\n // Your code here!\n Scanner sc = new Scanner(System.in);\n Deque<Integer> stack = new ArrayDeque<Integer>();\n\n while(sc.hasNext()) {\n String n = sc.next();\n if (n.equals(\"+\")){\n int a = stack.pop()+stack.pop();\n stack.push(a);\n } else if (n.equals(\"-\")){\n int x = stack.pop();\n int y = stack.pop();\n int a = y-x;\n stack.push(a);\n } else if (n.equals(\"*\")) {\n int a = stack.pop()*stack.pop();\n stack.push(a);\n } else {\n stack.push(Integer.parseInt(n));\n }\n \n }\n System.out.println(stack.pop());\n \n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"Deque<Integer> stack = new ArrayDeque<Integer>();",
"stack",
"new ArrayDeque<Integer>()",
"while(sc.hasNext()) {\n String n = sc.next();\n if (n.equals(\"+\")){\n int a = stack.pop()+stack.pop();\n stack.push(a);\n } else if (n.equals(\"-\")){\n int x = stack.pop();\n int y = stack.pop();\n int a = y-x;\n stack.push(a);\n } else if (n.equals(\"*\")) {\n int a = stack.pop()*stack.pop();\n stack.push(a);\n } else {\n stack.push(Integer.parseInt(n));\n }\n \n }",
"sc.hasNext()",
"sc.hasNext",
"sc",
"{\n String n = sc.next();\n if (n.equals(\"+\")){\n int a = stack.pop()+stack.pop();\n stack.push(a);\n } else if (n.equals(\"-\")){\n int x = stack.pop();\n int y = stack.pop();\n int a = y-x;\n stack.push(a);\n } else if (n.equals(\"*\")) {\n int a = stack.pop()*stack.pop();\n stack.push(a);\n } else {\n stack.push(Integer.parseInt(n));\n }\n \n }",
"String n = sc.next();",
"n",
"sc.next()",
"sc.next",
"sc",
"if (n.equals(\"+\")){\n int a = stack.pop()+stack.pop();\n stack.push(a);\n } else if (n.equals(\"-\")){\n int x = stack.pop();\n int y = stack.pop();\n int a = y-x;\n stack.push(a);\n } else if (n.equals(\"*\")) {\n int a = stack.pop()*stack.pop();\n stack.push(a);\n } else {\n stack.push(Integer.parseInt(n));\n }",
"n.equals(\"+\")",
"n.equals",
"n",
"\"+\"",
"{\n int a = stack.pop()+stack.pop();\n stack.push(a);\n }",
"int a = stack.pop()+stack.pop();",
"a",
"stack.pop()+stack.pop()",
"stack.pop()",
"stack.pop",
"stack",
"stack.pop()",
"stack.pop",
"stack",
"stack.push(a)",
"stack.push",
"stack",
"a",
"if (n.equals(\"-\")){\n int x = stack.pop();\n int y = stack.pop();\n int a = y-x;\n stack.push(a);\n } else if (n.equals(\"*\")) {\n int a = stack.pop()*stack.pop();\n stack.push(a);\n } else {\n stack.push(Integer.parseInt(n));\n }",
"n.equals(\"-\")",
"n.equals",
"n",
"\"-\"",
"{\n int x = stack.pop();\n int y = stack.pop();\n int a = y-x;\n stack.push(a);\n }",
"int x = stack.pop();",
"x",
"stack.pop()",
"stack.pop",
"stack",
"int y = stack.pop();",
"y",
"stack.pop()",
"stack.pop",
"stack",
"int a = y-x;",
"a",
"y-x",
"y",
"x",
"stack.push(a)",
"stack.push",
"stack",
"a",
"if (n.equals(\"*\")) {\n int a = stack.pop()*stack.pop();\n stack.push(a);\n } else {\n stack.push(Integer.parseInt(n));\n }",
"n.equals(\"*\")",
"n.equals",
"n",
"\"*\"",
"{\n int a = stack.pop()*stack.pop();\n stack.push(a);\n }",
"int a = stack.pop()*stack.pop();",
"a",
"stack.pop()*stack.pop()",
"stack.pop()",
"stack.pop",
"stack",
"stack.pop()",
"stack.pop",
"stack",
"stack.push(a)",
"stack.push",
"stack",
"a",
"{\n stack.push(Integer.parseInt(n));\n }",
"stack.push(Integer.parseInt(n))",
"stack.push",
"stack",
"Integer.parseInt(n)",
"Integer.parseInt",
"Integer",
"n",
"System.out.println(stack.pop())",
"System.out.println",
"System.out",
"System",
"System.out",
"stack.pop()",
"stack.pop",
"stack",
"String[] args",
"args",
"public class Main {\n public static void main(String[] args) throws Exception {\n // Your code here!\n Scanner sc = new Scanner(System.in);\n Deque<Integer> stack = new ArrayDeque<Integer>();\n\n while(sc.hasNext()) {\n String n = sc.next();\n if (n.equals(\"+\")){\n int a = stack.pop()+stack.pop();\n stack.push(a);\n } else if (n.equals(\"-\")){\n int x = stack.pop();\n int y = stack.pop();\n int a = y-x;\n stack.push(a);\n } else if (n.equals(\"*\")) {\n int a = stack.pop()*stack.pop();\n stack.push(a);\n } else {\n stack.push(Integer.parseInt(n));\n }\n \n }\n System.out.println(stack.pop());\n \n }\n}",
"public class Main {\n public static void main(String[] args) throws Exception {\n // Your code here!\n Scanner sc = new Scanner(System.in);\n Deque<Integer> stack = new ArrayDeque<Integer>();\n\n while(sc.hasNext()) {\n String n = sc.next();\n if (n.equals(\"+\")){\n int a = stack.pop()+stack.pop();\n stack.push(a);\n } else if (n.equals(\"-\")){\n int x = stack.pop();\n int y = stack.pop();\n int a = y-x;\n stack.push(a);\n } else if (n.equals(\"*\")) {\n int a = stack.pop()*stack.pop();\n stack.push(a);\n } else {\n stack.push(Integer.parseInt(n));\n }\n \n }\n System.out.println(stack.pop());\n \n }\n}",
"Main"
] | import java.util.*;
public class Main {
public static void main(String[] args) throws Exception {
// Your code here!
Scanner sc = new Scanner(System.in);
Deque<Integer> stack = new ArrayDeque<Integer>();
while(sc.hasNext()) {
String n = sc.next();
if (n.equals("+")){
int a = stack.pop()+stack.pop();
stack.push(a);
} else if (n.equals("-")){
int x = stack.pop();
int y = stack.pop();
int a = y-x;
stack.push(a);
} else if (n.equals("*")) {
int a = stack.pop()*stack.pop();
stack.push(a);
} else {
stack.push(Integer.parseInt(n));
}
}
System.out.println(stack.pop());
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
20,
42,
4,
18,
13,
30,
14,
4,
18,
13,
30,
4,
18,
13,
4,
18,
13,
30,
41,
13,
4,
18,
13,
14,
4,
18,
13,
17,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
4,
18,
13,
2,
13,
13,
14,
4,
18,
13,
17,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
4,
18,
13,
2,
13,
13,
14,
4,
18,
13,
17,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
4,
18,
13,
2,
13,
13,
41,
13,
4,
18,
13,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
120,
8
],
[
120,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
12,
14
],
[
11,
15
],
[
15,
16
],
[
15,
17
],
[
11,
18
],
[
18,
19
],
[
19,
20
],
[
20,
21
],
[
18,
22
],
[
22,
23
],
[
23,
24
],
[
24,
25
],
[
25,
26
],
[
23,
27
],
[
27,
28
],
[
28,
29
],
[
29,
30
],
[
28,
31
],
[
31,
32
],
[
32,
33
],
[
23,
34
],
[
34,
35
],
[
35,
36
],
[
35,
37
],
[
37,
38
],
[
38,
39
],
[
34,
40
],
[
40,
41
],
[
41,
42
],
[
42,
43
],
[
41,
44
],
[
40,
45
],
[
45,
46
],
[
46,
47
],
[
46,
48
],
[
48,
49
],
[
49,
50
],
[
45,
51
],
[
51,
52
],
[
51,
53
],
[
53,
54
],
[
54,
55
],
[
45,
56
],
[
56,
57
],
[
57,
58
],
[
56,
59
],
[
59,
60
],
[
59,
61
],
[
40,
62
],
[
62,
63
],
[
63,
64
],
[
64,
65
],
[
63,
66
],
[
62,
67
],
[
67,
68
],
[
68,
69
],
[
68,
70
],
[
70,
71
],
[
71,
72
],
[
67,
73
],
[
73,
74
],
[
73,
75
],
[
75,
76
],
[
76,
77
],
[
67,
78
],
[
78,
79
],
[
79,
80
],
[
78,
81
],
[
81,
82
],
[
81,
83
],
[
62,
84
],
[
84,
85
],
[
85,
86
],
[
86,
87
],
[
85,
88
],
[
84,
89
],
[
89,
90
],
[
90,
91
],
[
90,
92
],
[
92,
93
],
[
93,
94
],
[
89,
95
],
[
95,
96
],
[
95,
97
],
[
97,
98
],
[
98,
99
],
[
89,
100
],
[
100,
101
],
[
101,
102
],
[
100,
103
],
[
103,
104
],
[
103,
105
],
[
11,
106
],
[
106,
107
],
[
106,
108
],
[
108,
109
],
[
109,
110
],
[
11,
111
],
[
111,
112
],
[
112,
113
],
[
113,
114
],
[
113,
115
],
[
111,
116
],
[
9,
117
],
[
117,
118
],
[
0,
119
],
[
119,
120
],
[
119,
121
]
] | [
"import java.io.*; \nimport java.util.*; \npublic class Main {\n\t\n\t\n\tpublic static void main(String[] args) {\n\t\tScanner in = new Scanner(System.in);\n\t\tStack<Integer> s = new Stack<>();\n\t\twhile (in.hasNext()) {\n\t\t\tif (in.hasNextInt()) {\n\t\t\t\ts.push(in.nextInt());\n\t\t\t}\n\t\t\telse {\n\t\t\t\tString str = in.next();\n\t\t\t\n\t\t\t\tif(str.equals(\"+\")) {\n\t\t\t\t\tint a = s.pop();\n\t\t\t\t\tint b = s.pop();\n\t\t\t\t\ts.push(a + b);\n\t\t\t\t}\n\t\t\t\telse if(str.equals(\"*\")) {\n\t\t\t\t\tint a = s.pop();\n\t\t\t\t\tint b = s.pop();\n\t\t\t\t\ts.push(a * b);\n\t\t\t\t}\n\t\t\t\telse if(str.equals(\"-\")) {\n\t\t\t\t\tint a = s.pop();\n\t\t\t\t\tint b = s.pop();\n\t\t\t\t\ts.push(b - a);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tint result = s.pop();\n\t\tSystem.out.println(result);\n\t}\n}\n",
"import java.io.*;",
"io.*",
"java",
"import java.util.*;",
"util.*",
"java",
"public class Main {\n\t\n\t\n\tpublic static void main(String[] args) {\n\t\tScanner in = new Scanner(System.in);\n\t\tStack<Integer> s = new Stack<>();\n\t\twhile (in.hasNext()) {\n\t\t\tif (in.hasNextInt()) {\n\t\t\t\ts.push(in.nextInt());\n\t\t\t}\n\t\t\telse {\n\t\t\t\tString str = in.next();\n\t\t\t\n\t\t\t\tif(str.equals(\"+\")) {\n\t\t\t\t\tint a = s.pop();\n\t\t\t\t\tint b = s.pop();\n\t\t\t\t\ts.push(a + b);\n\t\t\t\t}\n\t\t\t\telse if(str.equals(\"*\")) {\n\t\t\t\t\tint a = s.pop();\n\t\t\t\t\tint b = s.pop();\n\t\t\t\t\ts.push(a * b);\n\t\t\t\t}\n\t\t\t\telse if(str.equals(\"-\")) {\n\t\t\t\t\tint a = s.pop();\n\t\t\t\t\tint b = s.pop();\n\t\t\t\t\ts.push(b - a);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tint result = s.pop();\n\t\tSystem.out.println(result);\n\t}\n}",
"Main",
"public static void main(String[] args) {\n\t\tScanner in = new Scanner(System.in);\n\t\tStack<Integer> s = new Stack<>();\n\t\twhile (in.hasNext()) {\n\t\t\tif (in.hasNextInt()) {\n\t\t\t\ts.push(in.nextInt());\n\t\t\t}\n\t\t\telse {\n\t\t\t\tString str = in.next();\n\t\t\t\n\t\t\t\tif(str.equals(\"+\")) {\n\t\t\t\t\tint a = s.pop();\n\t\t\t\t\tint b = s.pop();\n\t\t\t\t\ts.push(a + b);\n\t\t\t\t}\n\t\t\t\telse if(str.equals(\"*\")) {\n\t\t\t\t\tint a = s.pop();\n\t\t\t\t\tint b = s.pop();\n\t\t\t\t\ts.push(a * b);\n\t\t\t\t}\n\t\t\t\telse if(str.equals(\"-\")) {\n\t\t\t\t\tint a = s.pop();\n\t\t\t\t\tint b = s.pop();\n\t\t\t\t\ts.push(b - a);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tint result = s.pop();\n\t\tSystem.out.println(result);\n\t}",
"main",
"{\n\t\tScanner in = new Scanner(System.in);\n\t\tStack<Integer> s = new Stack<>();\n\t\twhile (in.hasNext()) {\n\t\t\tif (in.hasNextInt()) {\n\t\t\t\ts.push(in.nextInt());\n\t\t\t}\n\t\t\telse {\n\t\t\t\tString str = in.next();\n\t\t\t\n\t\t\t\tif(str.equals(\"+\")) {\n\t\t\t\t\tint a = s.pop();\n\t\t\t\t\tint b = s.pop();\n\t\t\t\t\ts.push(a + b);\n\t\t\t\t}\n\t\t\t\telse if(str.equals(\"*\")) {\n\t\t\t\t\tint a = s.pop();\n\t\t\t\t\tint b = s.pop();\n\t\t\t\t\ts.push(a * b);\n\t\t\t\t}\n\t\t\t\telse if(str.equals(\"-\")) {\n\t\t\t\t\tint a = s.pop();\n\t\t\t\t\tint b = s.pop();\n\t\t\t\t\ts.push(b - a);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tint result = s.pop();\n\t\tSystem.out.println(result);\n\t}",
"Scanner in = new Scanner(System.in);",
"in",
"new Scanner(System.in)",
"Stack<Integer> s = new Stack<>();",
"s",
"new Stack<>()",
"while (in.hasNext()) {\n\t\t\tif (in.hasNextInt()) {\n\t\t\t\ts.push(in.nextInt());\n\t\t\t}\n\t\t\telse {\n\t\t\t\tString str = in.next();\n\t\t\t\n\t\t\t\tif(str.equals(\"+\")) {\n\t\t\t\t\tint a = s.pop();\n\t\t\t\t\tint b = s.pop();\n\t\t\t\t\ts.push(a + b);\n\t\t\t\t}\n\t\t\t\telse if(str.equals(\"*\")) {\n\t\t\t\t\tint a = s.pop();\n\t\t\t\t\tint b = s.pop();\n\t\t\t\t\ts.push(a * b);\n\t\t\t\t}\n\t\t\t\telse if(str.equals(\"-\")) {\n\t\t\t\t\tint a = s.pop();\n\t\t\t\t\tint b = s.pop();\n\t\t\t\t\ts.push(b - a);\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"in.hasNext()",
"in.hasNext",
"in",
"{\n\t\t\tif (in.hasNextInt()) {\n\t\t\t\ts.push(in.nextInt());\n\t\t\t}\n\t\t\telse {\n\t\t\t\tString str = in.next();\n\t\t\t\n\t\t\t\tif(str.equals(\"+\")) {\n\t\t\t\t\tint a = s.pop();\n\t\t\t\t\tint b = s.pop();\n\t\t\t\t\ts.push(a + b);\n\t\t\t\t}\n\t\t\t\telse if(str.equals(\"*\")) {\n\t\t\t\t\tint a = s.pop();\n\t\t\t\t\tint b = s.pop();\n\t\t\t\t\ts.push(a * b);\n\t\t\t\t}\n\t\t\t\telse if(str.equals(\"-\")) {\n\t\t\t\t\tint a = s.pop();\n\t\t\t\t\tint b = s.pop();\n\t\t\t\t\ts.push(b - a);\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"if (in.hasNextInt()) {\n\t\t\t\ts.push(in.nextInt());\n\t\t\t}\n\t\t\telse {\n\t\t\t\tString str = in.next();\n\t\t\t\n\t\t\t\tif(str.equals(\"+\")) {\n\t\t\t\t\tint a = s.pop();\n\t\t\t\t\tint b = s.pop();\n\t\t\t\t\ts.push(a + b);\n\t\t\t\t}\n\t\t\t\telse if(str.equals(\"*\")) {\n\t\t\t\t\tint a = s.pop();\n\t\t\t\t\tint b = s.pop();\n\t\t\t\t\ts.push(a * b);\n\t\t\t\t}\n\t\t\t\telse if(str.equals(\"-\")) {\n\t\t\t\t\tint a = s.pop();\n\t\t\t\t\tint b = s.pop();\n\t\t\t\t\ts.push(b - a);\n\t\t\t\t}\n\t\t\t}",
"in.hasNextInt()",
"in.hasNextInt",
"in",
"{\n\t\t\t\ts.push(in.nextInt());\n\t\t\t}",
"s.push(in.nextInt())",
"s.push",
"s",
"in.nextInt()",
"in.nextInt",
"in",
"{\n\t\t\t\tString str = in.next();\n\t\t\t\n\t\t\t\tif(str.equals(\"+\")) {\n\t\t\t\t\tint a = s.pop();\n\t\t\t\t\tint b = s.pop();\n\t\t\t\t\ts.push(a + b);\n\t\t\t\t}\n\t\t\t\telse if(str.equals(\"*\")) {\n\t\t\t\t\tint a = s.pop();\n\t\t\t\t\tint b = s.pop();\n\t\t\t\t\ts.push(a * b);\n\t\t\t\t}\n\t\t\t\telse if(str.equals(\"-\")) {\n\t\t\t\t\tint a = s.pop();\n\t\t\t\t\tint b = s.pop();\n\t\t\t\t\ts.push(b - a);\n\t\t\t\t}\n\t\t\t}",
"String str = in.next();",
"str",
"in.next()",
"in.next",
"in",
"if(str.equals(\"+\")) {\n\t\t\t\t\tint a = s.pop();\n\t\t\t\t\tint b = s.pop();\n\t\t\t\t\ts.push(a + b);\n\t\t\t\t}\n\t\t\t\telse if(str.equals(\"*\")) {\n\t\t\t\t\tint a = s.pop();\n\t\t\t\t\tint b = s.pop();\n\t\t\t\t\ts.push(a * b);\n\t\t\t\t}\n\t\t\t\telse if(str.equals(\"-\")) {\n\t\t\t\t\tint a = s.pop();\n\t\t\t\t\tint b = s.pop();\n\t\t\t\t\ts.push(b - a);\n\t\t\t\t}",
"str.equals(\"+\")",
"str.equals",
"str",
"\"+\"",
"{\n\t\t\t\t\tint a = s.pop();\n\t\t\t\t\tint b = s.pop();\n\t\t\t\t\ts.push(a + b);\n\t\t\t\t}",
"int a = s.pop();",
"a",
"s.pop()",
"s.pop",
"s",
"int b = s.pop();",
"b",
"s.pop()",
"s.pop",
"s",
"s.push(a + b)",
"s.push",
"s",
"a + b",
"a",
"b",
"if(str.equals(\"*\")) {\n\t\t\t\t\tint a = s.pop();\n\t\t\t\t\tint b = s.pop();\n\t\t\t\t\ts.push(a * b);\n\t\t\t\t}\n\t\t\t\telse if(str.equals(\"-\")) {\n\t\t\t\t\tint a = s.pop();\n\t\t\t\t\tint b = s.pop();\n\t\t\t\t\ts.push(b - a);\n\t\t\t\t}",
"str.equals(\"*\")",
"str.equals",
"str",
"\"*\"",
"{\n\t\t\t\t\tint a = s.pop();\n\t\t\t\t\tint b = s.pop();\n\t\t\t\t\ts.push(a * b);\n\t\t\t\t}",
"int a = s.pop();",
"a",
"s.pop()",
"s.pop",
"s",
"int b = s.pop();",
"b",
"s.pop()",
"s.pop",
"s",
"s.push(a * b)",
"s.push",
"s",
"a * b",
"a",
"b",
"if(str.equals(\"-\")) {\n\t\t\t\t\tint a = s.pop();\n\t\t\t\t\tint b = s.pop();\n\t\t\t\t\ts.push(b - a);\n\t\t\t\t}",
"str.equals(\"-\")",
"str.equals",
"str",
"\"-\"",
"{\n\t\t\t\t\tint a = s.pop();\n\t\t\t\t\tint b = s.pop();\n\t\t\t\t\ts.push(b - a);\n\t\t\t\t}",
"int a = s.pop();",
"a",
"s.pop()",
"s.pop",
"s",
"int b = s.pop();",
"b",
"s.pop()",
"s.pop",
"s",
"s.push(b - a)",
"s.push",
"s",
"b - a",
"b",
"a",
"int result = s.pop();",
"result",
"s.pop()",
"s.pop",
"s",
"System.out.println(result)",
"System.out.println",
"System.out",
"System",
"System.out",
"result",
"String[] args",
"args",
"public class Main {\n\t\n\t\n\tpublic static void main(String[] args) {\n\t\tScanner in = new Scanner(System.in);\n\t\tStack<Integer> s = new Stack<>();\n\t\twhile (in.hasNext()) {\n\t\t\tif (in.hasNextInt()) {\n\t\t\t\ts.push(in.nextInt());\n\t\t\t}\n\t\t\telse {\n\t\t\t\tString str = in.next();\n\t\t\t\n\t\t\t\tif(str.equals(\"+\")) {\n\t\t\t\t\tint a = s.pop();\n\t\t\t\t\tint b = s.pop();\n\t\t\t\t\ts.push(a + b);\n\t\t\t\t}\n\t\t\t\telse if(str.equals(\"*\")) {\n\t\t\t\t\tint a = s.pop();\n\t\t\t\t\tint b = s.pop();\n\t\t\t\t\ts.push(a * b);\n\t\t\t\t}\n\t\t\t\telse if(str.equals(\"-\")) {\n\t\t\t\t\tint a = s.pop();\n\t\t\t\t\tint b = s.pop();\n\t\t\t\t\ts.push(b - a);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tint result = s.pop();\n\t\tSystem.out.println(result);\n\t}\n}",
"public class Main {\n\t\n\t\n\tpublic static void main(String[] args) {\n\t\tScanner in = new Scanner(System.in);\n\t\tStack<Integer> s = new Stack<>();\n\t\twhile (in.hasNext()) {\n\t\t\tif (in.hasNextInt()) {\n\t\t\t\ts.push(in.nextInt());\n\t\t\t}\n\t\t\telse {\n\t\t\t\tString str = in.next();\n\t\t\t\n\t\t\t\tif(str.equals(\"+\")) {\n\t\t\t\t\tint a = s.pop();\n\t\t\t\t\tint b = s.pop();\n\t\t\t\t\ts.push(a + b);\n\t\t\t\t}\n\t\t\t\telse if(str.equals(\"*\")) {\n\t\t\t\t\tint a = s.pop();\n\t\t\t\t\tint b = s.pop();\n\t\t\t\t\ts.push(a * b);\n\t\t\t\t}\n\t\t\t\telse if(str.equals(\"-\")) {\n\t\t\t\t\tint a = s.pop();\n\t\t\t\t\tint b = s.pop();\n\t\t\t\t\ts.push(b - a);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tint result = s.pop();\n\t\tSystem.out.println(result);\n\t}\n}",
"Main"
] | import java.io.*;
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
Stack<Integer> s = new Stack<>();
while (in.hasNext()) {
if (in.hasNextInt()) {
s.push(in.nextInt());
}
else {
String str = in.next();
if(str.equals("+")) {
int a = s.pop();
int b = s.pop();
s.push(a + b);
}
else if(str.equals("*")) {
int a = s.pop();
int b = s.pop();
s.push(a * b);
}
else if(str.equals("-")) {
int a = s.pop();
int b = s.pop();
s.push(b - a);
}
}
}
int result = s.pop();
System.out.println(result);
}
}
|
[
7,
15,
13,
17,
6,
13,
41,
13,
20,
17,
41,
13,
12,
13,
30,
0,
18,
36,
13,
17,
12,
13,
30,
14,
4,
18,
36,
29,
17,
30,
0,
18,
18,
36,
13,
40,
13,
13,
29,
17,
23,
13,
12,
13,
30,
29,
18,
18,
36,
13,
40,
13,
12,
13,
30,
29,
2,
13,
17,
12,
13,
30,
29,
2,
13,
17,
12,
13,
30,
41,
13,
20,
41,
13,
41,
13,
41,
13,
41,
13,
20,
42,
4,
18,
13,
30,
41,
13,
4,
18,
13,
14,
2,
2,
4,
18,
13,
17,
4,
18,
13,
17,
4,
18,
13,
17,
30,
0,
13,
4,
18,
13,
4,
18,
13,
0,
13,
4,
18,
13,
4,
18,
13,
14,
4,
18,
13,
17,
0,
13,
2,
13,
13,
14,
4,
18,
13,
17,
0,
13,
2,
13,
13,
0,
13,
2,
13,
13,
4,
18,
13,
4,
18,
13,
13,
30,
4,
18,
13,
13,
4,
18,
18,
13,
13,
4,
18,
13,
23,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
6,
7
],
[
6,
8
],
[
4,
10
],
[
10,
11
],
[
4,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
16,
17
],
[
16,
18
],
[
15,
19
],
[
4,
20
],
[
20,
21
],
[
20,
22
],
[
22,
23
],
[
23,
24
],
[
24,
25
],
[
25,
26
],
[
23,
27
],
[
27,
28
],
[
23,
29
],
[
29,
30
],
[
30,
31
],
[
31,
32
],
[
32,
33
],
[
32,
34
],
[
31,
35
],
[
35,
36
],
[
30,
37
],
[
29,
38
],
[
38,
39
],
[
20,
40
],
[
40,
41
],
[
4,
42
],
[
42,
43
],
[
42,
44
],
[
44,
45
],
[
45,
46
],
[
46,
47
],
[
47,
48
],
[
47,
49
],
[
46,
50
],
[
50,
51
],
[
4,
52
],
[
52,
53
],
[
52,
54
],
[
54,
55
],
[
55,
56
],
[
56,
57
],
[
56,
58
],
[
4,
59
],
[
59,
60
],
[
59,
61
],
[
61,
62
],
[
62,
63
],
[
63,
64
],
[
63,
65
],
[
4,
66
],
[
66,
67
],
[
66,
68
],
[
68,
69
],
[
69,
70
],
[
69,
71
],
[
68,
72
],
[
72,
73
],
[
68,
74
],
[
74,
75
],
[
68,
76
],
[
76,
77
],
[
68,
78
],
[
78,
79
],
[
78,
80
],
[
68,
81
],
[
81,
82
],
[
82,
83
],
[
83,
84
],
[
81,
85
],
[
85,
86
],
[
86,
87
],
[
86,
88
],
[
88,
89
],
[
89,
90
],
[
85,
91
],
[
91,
92
],
[
93,
93
],
[
93,
94
],
[
94,
95
],
[
95,
96
],
[
94,
97
],
[
93,
98
],
[
98,
99
],
[
99,
100
],
[
98,
101
],
[
93,
102
],
[
102,
103
],
[
103,
104
],
[
102,
105
],
[
91,
106
],
[
106,
107
],
[
107,
108
],
[
107,
109
],
[
109,
110
],
[
110,
111
],
[
109,
112
],
[
112,
113
],
[
113,
114
],
[
106,
115
],
[
115,
116
],
[
115,
117
],
[
117,
118
],
[
118,
119
],
[
117,
120
],
[
120,
121
],
[
121,
122
],
[
106,
123
],
[
123,
124
],
[
124,
125
],
[
125,
126
],
[
124,
127
],
[
123,
128
],
[
128,
129
],
[
128,
130
],
[
130,
131
],
[
130,
132
],
[
123,
133
],
[
133,
134
],
[
134,
135
],
[
135,
136
],
[
134,
137
],
[
133,
138
],
[
138,
139
],
[
138,
140
],
[
140,
141
],
[
140,
142
],
[
133,
143
],
[
143,
144
],
[
143,
145
],
[
145,
146
],
[
145,
147
],
[
106,
148
],
[
148,
149
],
[
149,
150
],
[
148,
151
],
[
151,
152
],
[
152,
153
],
[
151,
154
],
[
91,
155
],
[
155,
156
],
[
156,
157
],
[
157,
158
],
[
156,
159
],
[
68,
160
],
[
160,
161
],
[
161,
162
],
[
162,
163
],
[
162,
164
],
[
160,
165
],
[
165,
166
],
[
166,
167
],
[
66,
168
],
[
168,
169
]
] | [
"import java.util.Scanner;\n\nclass Main{\n String[] data = new String[200];\n int num;\n\n Main(){\n this.num = 0;\n }\n\n boolean push(String c){\n if(this.isFull())\n return false;\n else{\n this.data[++num] = c;\n return true;\n }\n }\n\n String pop(){\n return this.data[num--];\n }\n\n boolean isFull(){\n return num == 199;\n }\n\n boolean isEmpty(){\n return num == 0;\n }\n\n\n public static void main(String[] args){\n Scanner stdIn = new Scanner(System.in);\n int ans;\n int ope1, ope2;\n Main stack = new Main();\n\n while(stdIn.hasNext()){\n String input = stdIn.next();\n if(input.equals(\"+\") || input.equals(\"-\") || input.equals(\"*\")){\n ope2 = Integer.parseInt(stack.pop());\n ope1 = Integer.parseInt(stack.pop());\n if(input.equals(\"+\"))\n ans = ope1 + ope2;\n else if(input.equals(\"-\"))\n ans = ope1 - ope2;\n else\n ans = ope1 * ope2;\n stack.push(Integer.toString(ans));\n }\n else{\n stack.push(input);\n }\n }\n\n \n System.out.println(stack.pop());\n }\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"class Main{\n String[] data = new String[200];\n int num;\n\n Main(){\n this.num = 0;\n }\n\n boolean push(String c){\n if(this.isFull())\n return false;\n else{\n this.data[++num] = c;\n return true;\n }\n }\n\n String pop(){\n return this.data[num--];\n }\n\n boolean isFull(){\n return num == 199;\n }\n\n boolean isEmpty(){\n return num == 0;\n }\n\n\n public static void main(String[] args){\n Scanner stdIn = new Scanner(System.in);\n int ans;\n int ope1, ope2;\n Main stack = new Main();\n\n while(stdIn.hasNext()){\n String input = stdIn.next();\n if(input.equals(\"+\") || input.equals(\"-\") || input.equals(\"*\")){\n ope2 = Integer.parseInt(stack.pop());\n ope1 = Integer.parseInt(stack.pop());\n if(input.equals(\"+\"))\n ans = ope1 + ope2;\n else if(input.equals(\"-\"))\n ans = ope1 - ope2;\n else\n ans = ope1 * ope2;\n stack.push(Integer.toString(ans));\n }\n else{\n stack.push(input);\n }\n }\n\n \n System.out.println(stack.pop());\n }\n}",
"Main",
"String[] data = new String[200];",
"data",
"new String[200]",
"200",
"int num;",
"num",
"Main(){\n this.num = 0;\n }",
"Main",
"{\n this.num = 0;\n }",
"this.num = 0",
"this.num",
"this",
"this.num",
"0",
"boolean push(String c){\n if(this.isFull())\n return false;\n else{\n this.data[++num] = c;\n return true;\n }\n }",
"push",
"{\n if(this.isFull())\n return false;\n else{\n this.data[++num] = c;\n return true;\n }\n }",
"if(this.isFull())\n return false;\n else{\n this.data[++num] = c;\n return true;\n }",
"this.isFull()",
"this.isFull",
"this",
"return false;",
"false",
"{\n this.data[++num] = c;\n return true;\n }",
"this.data[++num] = c",
"this.data[++num]",
"this.data",
"this",
"this.data",
"++num",
"num",
"c",
"return true;",
"true",
"String c",
"c",
"String pop(){\n return this.data[num--];\n }",
"pop",
"{\n return this.data[num--];\n }",
"return this.data[num--];",
"this.data[num--]",
"this.data",
"this",
"this.data",
"num--",
"num",
"boolean isFull(){\n return num == 199;\n }",
"isFull",
"{\n return num == 199;\n }",
"return num == 199;",
"num == 199",
"num",
"199",
"boolean isEmpty(){\n return num == 0;\n }",
"isEmpty",
"{\n return num == 0;\n }",
"return num == 0;",
"num == 0",
"num",
"0",
"public static void main(String[] args){\n Scanner stdIn = new Scanner(System.in);\n int ans;\n int ope1, ope2;\n Main stack = new Main();\n\n while(stdIn.hasNext()){\n String input = stdIn.next();\n if(input.equals(\"+\") || input.equals(\"-\") || input.equals(\"*\")){\n ope2 = Integer.parseInt(stack.pop());\n ope1 = Integer.parseInt(stack.pop());\n if(input.equals(\"+\"))\n ans = ope1 + ope2;\n else if(input.equals(\"-\"))\n ans = ope1 - ope2;\n else\n ans = ope1 * ope2;\n stack.push(Integer.toString(ans));\n }\n else{\n stack.push(input);\n }\n }\n\n \n System.out.println(stack.pop());\n }",
"main",
"{\n Scanner stdIn = new Scanner(System.in);\n int ans;\n int ope1, ope2;\n Main stack = new Main();\n\n while(stdIn.hasNext()){\n String input = stdIn.next();\n if(input.equals(\"+\") || input.equals(\"-\") || input.equals(\"*\")){\n ope2 = Integer.parseInt(stack.pop());\n ope1 = Integer.parseInt(stack.pop());\n if(input.equals(\"+\"))\n ans = ope1 + ope2;\n else if(input.equals(\"-\"))\n ans = ope1 - ope2;\n else\n ans = ope1 * ope2;\n stack.push(Integer.toString(ans));\n }\n else{\n stack.push(input);\n }\n }\n\n \n System.out.println(stack.pop());\n }",
"Scanner stdIn = new Scanner(System.in);",
"stdIn",
"new Scanner(System.in)",
"int ans;",
"ans",
"int ope1",
"ope1",
"ope2;",
"ope2",
"Main stack = new Main();",
"stack",
"new Main()",
"while(stdIn.hasNext()){\n String input = stdIn.next();\n if(input.equals(\"+\") || input.equals(\"-\") || input.equals(\"*\")){\n ope2 = Integer.parseInt(stack.pop());\n ope1 = Integer.parseInt(stack.pop());\n if(input.equals(\"+\"))\n ans = ope1 + ope2;\n else if(input.equals(\"-\"))\n ans = ope1 - ope2;\n else\n ans = ope1 * ope2;\n stack.push(Integer.toString(ans));\n }\n else{\n stack.push(input);\n }\n }",
"stdIn.hasNext()",
"stdIn.hasNext",
"stdIn",
"{\n String input = stdIn.next();\n if(input.equals(\"+\") || input.equals(\"-\") || input.equals(\"*\")){\n ope2 = Integer.parseInt(stack.pop());\n ope1 = Integer.parseInt(stack.pop());\n if(input.equals(\"+\"))\n ans = ope1 + ope2;\n else if(input.equals(\"-\"))\n ans = ope1 - ope2;\n else\n ans = ope1 * ope2;\n stack.push(Integer.toString(ans));\n }\n else{\n stack.push(input);\n }\n }",
"String input = stdIn.next();",
"input",
"stdIn.next()",
"stdIn.next",
"stdIn",
"if(input.equals(\"+\") || input.equals(\"-\") || input.equals(\"*\")){\n ope2 = Integer.parseInt(stack.pop());\n ope1 = Integer.parseInt(stack.pop());\n if(input.equals(\"+\"))\n ans = ope1 + ope2;\n else if(input.equals(\"-\"))\n ans = ope1 - ope2;\n else\n ans = ope1 * ope2;\n stack.push(Integer.toString(ans));\n }\n else{\n stack.push(input);\n }",
"input.equals(\"+\") || input.equals(\"-\") || input.equals(\"*\")",
"input.equals(\"+\") || input.equals(\"-\") || input.equals(\"*\")",
"input.equals(\"+\")",
"input.equals",
"input",
"\"+\"",
"input.equals(\"-\")",
"input.equals",
"input",
"\"-\"",
"input.equals(\"*\")",
"input.equals",
"input",
"\"*\"",
"{\n ope2 = Integer.parseInt(stack.pop());\n ope1 = Integer.parseInt(stack.pop());\n if(input.equals(\"+\"))\n ans = ope1 + ope2;\n else if(input.equals(\"-\"))\n ans = ope1 - ope2;\n else\n ans = ope1 * ope2;\n stack.push(Integer.toString(ans));\n }",
"ope2 = Integer.parseInt(stack.pop())",
"ope2",
"Integer.parseInt(stack.pop())",
"Integer.parseInt",
"Integer",
"stack.pop()",
"stack.pop",
"stack",
"ope1 = Integer.parseInt(stack.pop())",
"ope1",
"Integer.parseInt(stack.pop())",
"Integer.parseInt",
"Integer",
"stack.pop()",
"stack.pop",
"stack",
"if(input.equals(\"+\"))\n ans = ope1 + ope2;\n else if(input.equals(\"-\"))\n ans = ope1 - ope2;\n else\n ans = ope1 * ope2;",
"input.equals(\"+\")",
"input.equals",
"input",
"\"+\"",
"ans = ope1 + ope2",
"ans",
"ope1 + ope2",
"ope1",
"ope2",
"if(input.equals(\"-\"))\n ans = ope1 - ope2;\n else\n ans = ope1 * ope2;",
"input.equals(\"-\")",
"input.equals",
"input",
"\"-\"",
"ans = ope1 - ope2",
"ans",
"ope1 - ope2",
"ope1",
"ope2",
"ans = ope1 * ope2",
"ans",
"ope1 * ope2",
"ope1",
"ope2",
"stack.push(Integer.toString(ans))",
"stack.push",
"stack",
"Integer.toString(ans)",
"Integer.toString",
"Integer",
"ans",
"{\n stack.push(input);\n }",
"stack.push(input)",
"stack.push",
"stack",
"input",
"System.out.println(stack.pop())",
"System.out.println",
"System.out",
"System",
"System.out",
"stack.pop()",
"stack.pop",
"stack",
"String[] args",
"args"
] | import java.util.Scanner;
class Main{
String[] data = new String[200];
int num;
Main(){
this.num = 0;
}
boolean push(String c){
if(this.isFull())
return false;
else{
this.data[++num] = c;
return true;
}
}
String pop(){
return this.data[num--];
}
boolean isFull(){
return num == 199;
}
boolean isEmpty(){
return num == 0;
}
public static void main(String[] args){
Scanner stdIn = new Scanner(System.in);
int ans;
int ope1, ope2;
Main stack = new Main();
while(stdIn.hasNext()){
String input = stdIn.next();
if(input.equals("+") || input.equals("-") || input.equals("*")){
ope2 = Integer.parseInt(stack.pop());
ope1 = Integer.parseInt(stack.pop());
if(input.equals("+"))
ans = ope1 + ope2;
else if(input.equals("-"))
ans = ope1 - ope2;
else
ans = ope1 * ope2;
stack.push(Integer.toString(ans));
}
else{
stack.push(input);
}
}
System.out.println(stack.pop());
}
} |
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
20,
42,
4,
18,
13,
30,
41,
13,
4,
18,
13,
35,
13,
34,
17,
30,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
4,
18,
13,
2,
13,
13,
3,
34,
17,
30,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
4,
18,
13,
2,
13,
13,
3,
34,
17,
30,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
4,
18,
13,
2,
13,
13,
3,
34,
30,
30,
4,
18,
13,
4,
18,
13,
13,
3,
4,
18,
18,
13,
13,
4,
18,
13,
12,
13,
30,
4,
18,
20,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
121,
8
],
[
121,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
12,
14
],
[
11,
15
],
[
15,
16
],
[
15,
17
],
[
11,
18
],
[
18,
19
],
[
19,
20
],
[
20,
21
],
[
18,
22
],
[
22,
23
],
[
23,
24
],
[
23,
25
],
[
25,
26
],
[
26,
27
],
[
22,
28
],
[
28,
29
],
[
28,
30
],
[
30,
31
],
[
30,
32
],
[
32,
33
],
[
33,
34
],
[
34,
35
],
[
34,
36
],
[
36,
37
],
[
37,
38
],
[
33,
39
],
[
39,
40
],
[
39,
41
],
[
41,
42
],
[
42,
43
],
[
33,
44
],
[
44,
45
],
[
45,
46
],
[
44,
47
],
[
47,
48
],
[
47,
49
],
[
33,
50
],
[
28,
51
],
[
51,
52
],
[
51,
53
],
[
53,
54
],
[
54,
55
],
[
55,
56
],
[
55,
57
],
[
57,
58
],
[
58,
59
],
[
54,
60
],
[
60,
61
],
[
60,
62
],
[
62,
63
],
[
63,
64
],
[
54,
65
],
[
65,
66
],
[
66,
67
],
[
65,
68
],
[
68,
69
],
[
68,
70
],
[
54,
71
],
[
28,
72
],
[
72,
73
],
[
72,
74
],
[
74,
75
],
[
75,
76
],
[
76,
77
],
[
76,
78
],
[
78,
79
],
[
79,
80
],
[
75,
81
],
[
81,
82
],
[
81,
83
],
[
83,
84
],
[
84,
85
],
[
75,
86
],
[
86,
87
],
[
87,
88
],
[
86,
89
],
[
89,
90
],
[
89,
91
],
[
75,
92
],
[
28,
93
],
[
93,
94
],
[
94,
95
],
[
95,
96
],
[
96,
97
],
[
97,
98
],
[
96,
99
],
[
99,
100
],
[
100,
101
],
[
99,
102
],
[
95,
103
],
[
11,
104
],
[
104,
105
],
[
105,
106
],
[
106,
107
],
[
106,
108
],
[
104,
109
],
[
109,
110
],
[
110,
111
],
[
121,
112
],
[
112,
113
],
[
112,
114
],
[
114,
115
],
[
115,
116
],
[
116,
117
],
[
112,
118
],
[
118,
119
],
[
0,
120
],
[
120,
121
],
[
120,
122
]
] | [
"import java.util.Scanner;\nimport java.util.Stack;\n\npublic class Main {\n\tvoid run() {\n\t\tScanner scan = new Scanner(System.in);\n\t\tStack<Integer> stack = new Stack<Integer>();\n\t\twhile (scan.hasNext()) {\n\t\t\tString token = scan.next();\n\t\t\tswitch (token) {\n\t\t\tcase \"+\": {\n\t\t\t\tint v1 = stack.pop();\n\t\t\t\tint v2 = stack.pop();\n\t\t\t\tstack.push(v2 + v1);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase \"-\": {\n\t\t\t\tint v1 = stack.pop();\n\t\t\t\tint v2 = stack.pop();\n\t\t\t\tstack.push(v2 - v1);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase \"*\": {\n\t\t\t\tint v1 = stack.pop();\n\t\t\t\tint v2 = stack.pop();\n\t\t\t\tstack.push(v2 * v1);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tdefault: {\n\t\t\t\tstack.push(Integer.valueOf(token));\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(stack.pop());\n\t}\n\tpublic static void main(String[] args) {\n\t\tnew Main().run();\n\t}\n}\n",
"import java.util.Scanner;",
"Scanner",
"java.util",
"import java.util.Stack;",
"Stack",
"java.util",
"public class Main {\n\tvoid run() {\n\t\tScanner scan = new Scanner(System.in);\n\t\tStack<Integer> stack = new Stack<Integer>();\n\t\twhile (scan.hasNext()) {\n\t\t\tString token = scan.next();\n\t\t\tswitch (token) {\n\t\t\tcase \"+\": {\n\t\t\t\tint v1 = stack.pop();\n\t\t\t\tint v2 = stack.pop();\n\t\t\t\tstack.push(v2 + v1);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase \"-\": {\n\t\t\t\tint v1 = stack.pop();\n\t\t\t\tint v2 = stack.pop();\n\t\t\t\tstack.push(v2 - v1);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase \"*\": {\n\t\t\t\tint v1 = stack.pop();\n\t\t\t\tint v2 = stack.pop();\n\t\t\t\tstack.push(v2 * v1);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tdefault: {\n\t\t\t\tstack.push(Integer.valueOf(token));\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(stack.pop());\n\t}\n\tpublic static void main(String[] args) {\n\t\tnew Main().run();\n\t}\n}",
"Main",
"void run() {\n\t\tScanner scan = new Scanner(System.in);\n\t\tStack<Integer> stack = new Stack<Integer>();\n\t\twhile (scan.hasNext()) {\n\t\t\tString token = scan.next();\n\t\t\tswitch (token) {\n\t\t\tcase \"+\": {\n\t\t\t\tint v1 = stack.pop();\n\t\t\t\tint v2 = stack.pop();\n\t\t\t\tstack.push(v2 + v1);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase \"-\": {\n\t\t\t\tint v1 = stack.pop();\n\t\t\t\tint v2 = stack.pop();\n\t\t\t\tstack.push(v2 - v1);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase \"*\": {\n\t\t\t\tint v1 = stack.pop();\n\t\t\t\tint v2 = stack.pop();\n\t\t\t\tstack.push(v2 * v1);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tdefault: {\n\t\t\t\tstack.push(Integer.valueOf(token));\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(stack.pop());\n\t}",
"run",
"{\n\t\tScanner scan = new Scanner(System.in);\n\t\tStack<Integer> stack = new Stack<Integer>();\n\t\twhile (scan.hasNext()) {\n\t\t\tString token = scan.next();\n\t\t\tswitch (token) {\n\t\t\tcase \"+\": {\n\t\t\t\tint v1 = stack.pop();\n\t\t\t\tint v2 = stack.pop();\n\t\t\t\tstack.push(v2 + v1);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase \"-\": {\n\t\t\t\tint v1 = stack.pop();\n\t\t\t\tint v2 = stack.pop();\n\t\t\t\tstack.push(v2 - v1);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase \"*\": {\n\t\t\t\tint v1 = stack.pop();\n\t\t\t\tint v2 = stack.pop();\n\t\t\t\tstack.push(v2 * v1);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tdefault: {\n\t\t\t\tstack.push(Integer.valueOf(token));\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(stack.pop());\n\t}",
"Scanner scan = new Scanner(System.in);",
"scan",
"new Scanner(System.in)",
"Stack<Integer> stack = new Stack<Integer>();",
"stack",
"new Stack<Integer>()",
"while (scan.hasNext()) {\n\t\t\tString token = scan.next();\n\t\t\tswitch (token) {\n\t\t\tcase \"+\": {\n\t\t\t\tint v1 = stack.pop();\n\t\t\t\tint v2 = stack.pop();\n\t\t\t\tstack.push(v2 + v1);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase \"-\": {\n\t\t\t\tint v1 = stack.pop();\n\t\t\t\tint v2 = stack.pop();\n\t\t\t\tstack.push(v2 - v1);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase \"*\": {\n\t\t\t\tint v1 = stack.pop();\n\t\t\t\tint v2 = stack.pop();\n\t\t\t\tstack.push(v2 * v1);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tdefault: {\n\t\t\t\tstack.push(Integer.valueOf(token));\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t}\n\t\t}",
"scan.hasNext()",
"scan.hasNext",
"scan",
"{\n\t\t\tString token = scan.next();\n\t\t\tswitch (token) {\n\t\t\tcase \"+\": {\n\t\t\t\tint v1 = stack.pop();\n\t\t\t\tint v2 = stack.pop();\n\t\t\t\tstack.push(v2 + v1);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase \"-\": {\n\t\t\t\tint v1 = stack.pop();\n\t\t\t\tint v2 = stack.pop();\n\t\t\t\tstack.push(v2 - v1);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase \"*\": {\n\t\t\t\tint v1 = stack.pop();\n\t\t\t\tint v2 = stack.pop();\n\t\t\t\tstack.push(v2 * v1);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tdefault: {\n\t\t\t\tstack.push(Integer.valueOf(token));\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t}\n\t\t}",
"String token = scan.next();",
"token",
"scan.next()",
"scan.next",
"scan",
"switch (token) {\n\t\t\tcase \"+\": {\n\t\t\t\tint v1 = stack.pop();\n\t\t\t\tint v2 = stack.pop();\n\t\t\t\tstack.push(v2 + v1);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase \"-\": {\n\t\t\t\tint v1 = stack.pop();\n\t\t\t\tint v2 = stack.pop();\n\t\t\t\tstack.push(v2 - v1);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase \"*\": {\n\t\t\t\tint v1 = stack.pop();\n\t\t\t\tint v2 = stack.pop();\n\t\t\t\tstack.push(v2 * v1);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tdefault: {\n\t\t\t\tstack.push(Integer.valueOf(token));\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t}",
"token",
"case \"+\":",
"\"+\"",
"case \"+\":",
"{\n\t\t\t\tint v1 = stack.pop();\n\t\t\t\tint v2 = stack.pop();\n\t\t\t\tstack.push(v2 + v1);\n\t\t\t\tbreak;\n\t\t\t}",
"int v1 = stack.pop();",
"v1",
"stack.pop()",
"stack.pop",
"stack",
"int v2 = stack.pop();",
"v2",
"stack.pop()",
"stack.pop",
"stack",
"stack.push(v2 + v1)",
"stack.push",
"stack",
"v2 + v1",
"v2",
"v1",
"break;",
"case \"-\":",
"\"-\"",
"case \"-\":",
"{\n\t\t\t\tint v1 = stack.pop();\n\t\t\t\tint v2 = stack.pop();\n\t\t\t\tstack.push(v2 - v1);\n\t\t\t\tbreak;\n\t\t\t}",
"int v1 = stack.pop();",
"v1",
"stack.pop()",
"stack.pop",
"stack",
"int v2 = stack.pop();",
"v2",
"stack.pop()",
"stack.pop",
"stack",
"stack.push(v2 - v1)",
"stack.push",
"stack",
"v2 - v1",
"v2",
"v1",
"break;",
"case \"*\":",
"\"*\"",
"case \"*\":",
"{\n\t\t\t\tint v1 = stack.pop();\n\t\t\t\tint v2 = stack.pop();\n\t\t\t\tstack.push(v2 * v1);\n\t\t\t\tbreak;\n\t\t\t}",
"int v1 = stack.pop();",
"v1",
"stack.pop()",
"stack.pop",
"stack",
"int v2 = stack.pop();",
"v2",
"stack.pop()",
"stack.pop",
"stack",
"stack.push(v2 * v1)",
"stack.push",
"stack",
"v2 * v1",
"v2",
"v1",
"break;",
"default:",
"default:",
"{\n\t\t\t\tstack.push(Integer.valueOf(token));\n\t\t\t\tbreak;\n\t\t\t}",
"stack.push(Integer.valueOf(token))",
"stack.push",
"stack",
"Integer.valueOf(token)",
"Integer.valueOf",
"Integer",
"token",
"break;",
"System.out.println(stack.pop())",
"System.out.println",
"System.out",
"System",
"System.out",
"stack.pop()",
"stack.pop",
"stack",
"public static void main(String[] args) {\n\t\tnew Main().run();\n\t}",
"main",
"{\n\t\tnew Main().run();\n\t}",
"new Main().run()",
"new Main().run",
"new Main()",
"String[] args",
"args",
"public class Main {\n\tvoid run() {\n\t\tScanner scan = new Scanner(System.in);\n\t\tStack<Integer> stack = new Stack<Integer>();\n\t\twhile (scan.hasNext()) {\n\t\t\tString token = scan.next();\n\t\t\tswitch (token) {\n\t\t\tcase \"+\": {\n\t\t\t\tint v1 = stack.pop();\n\t\t\t\tint v2 = stack.pop();\n\t\t\t\tstack.push(v2 + v1);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase \"-\": {\n\t\t\t\tint v1 = stack.pop();\n\t\t\t\tint v2 = stack.pop();\n\t\t\t\tstack.push(v2 - v1);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase \"*\": {\n\t\t\t\tint v1 = stack.pop();\n\t\t\t\tint v2 = stack.pop();\n\t\t\t\tstack.push(v2 * v1);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tdefault: {\n\t\t\t\tstack.push(Integer.valueOf(token));\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(stack.pop());\n\t}\n\tpublic static void main(String[] args) {\n\t\tnew Main().run();\n\t}\n}",
"public class Main {\n\tvoid run() {\n\t\tScanner scan = new Scanner(System.in);\n\t\tStack<Integer> stack = new Stack<Integer>();\n\t\twhile (scan.hasNext()) {\n\t\t\tString token = scan.next();\n\t\t\tswitch (token) {\n\t\t\tcase \"+\": {\n\t\t\t\tint v1 = stack.pop();\n\t\t\t\tint v2 = stack.pop();\n\t\t\t\tstack.push(v2 + v1);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase \"-\": {\n\t\t\t\tint v1 = stack.pop();\n\t\t\t\tint v2 = stack.pop();\n\t\t\t\tstack.push(v2 - v1);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase \"*\": {\n\t\t\t\tint v1 = stack.pop();\n\t\t\t\tint v2 = stack.pop();\n\t\t\t\tstack.push(v2 * v1);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tdefault: {\n\t\t\t\tstack.push(Integer.valueOf(token));\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(stack.pop());\n\t}\n\tpublic static void main(String[] args) {\n\t\tnew Main().run();\n\t}\n}",
"Main"
] | import java.util.Scanner;
import java.util.Stack;
public class Main {
void run() {
Scanner scan = new Scanner(System.in);
Stack<Integer> stack = new Stack<Integer>();
while (scan.hasNext()) {
String token = scan.next();
switch (token) {
case "+": {
int v1 = stack.pop();
int v2 = stack.pop();
stack.push(v2 + v1);
break;
}
case "-": {
int v1 = stack.pop();
int v2 = stack.pop();
stack.push(v2 - v1);
break;
}
case "*": {
int v1 = stack.pop();
int v2 = stack.pop();
stack.push(v2 * v1);
break;
}
default: {
stack.push(Integer.valueOf(token));
break;
}
}
}
System.out.println(stack.pop());
}
public static void main(String[] args) {
new Main().run();
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
41,
13,
17,
41,
13,
20,
17,
12,
13,
30,
41,
13,
20,
41,
13,
20,
41,
13,
4,
18,
4,
18,
13,
17,
28,
13,
13,
30,
30,
14,
4,
18,
13,
17,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
4,
18,
13,
2,
13,
13,
14,
4,
18,
13,
17,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
4,
18,
13,
2,
13,
13,
14,
4,
18,
13,
17,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
4,
18,
13,
2,
13,
13,
30,
4,
18,
13,
4,
18,
13,
13,
4,
18,
18,
13,
13,
4,
18,
13,
23,
13,
12,
13,
30,
40,
13,
0,
18,
13,
13,
13,
23,
13,
12,
13,
30,
40,
13,
29,
18,
13,
2,
13,
17,
6,
13,
41,
13,
17,
41,
13,
17,
12,
13,
30,
0,
13,
20,
0,
13,
17,
23,
13,
12,
13,
30,
14,
2,
2,
13,
17,
40,
4,
18,
13,
30,
38,
5,
13,
30,
37,
20,
30,
0,
13,
20,
29,
4,
18,
13,
12,
13,
30,
14,
2,
2,
13,
17,
40,
4,
18,
13,
30,
38,
5,
13,
30,
37,
20,
30,
29,
4,
18,
13,
29,
4,
18,
13,
17,
12,
13,
30,
29,
4,
18,
13,
4,
13,
12,
13,
30,
29,
4,
18,
13,
4,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
239,
8
],
[
239,
9
],
[
9,
10
],
[
9,
11
],
[
239,
12
],
[
12,
13
],
[
12,
14
],
[
239,
16
],
[
16,
17
],
[
16,
18
],
[
18,
19
],
[
19,
20
],
[
19,
21
],
[
18,
22
],
[
22,
23
],
[
22,
24
],
[
18,
25
],
[
25,
26
],
[
25,
27
],
[
27,
28
],
[
28,
29
],
[
29,
30
],
[
30,
31
],
[
27,
32
],
[
18,
33
],
[
33,
34
],
[
33,
35
],
[
33,
36
],
[
37,
37
],
[
37,
38
],
[
38,
39
],
[
39,
40
],
[
40,
41
],
[
39,
42
],
[
38,
43
],
[
43,
44
],
[
44,
45
],
[
44,
46
],
[
46,
47
],
[
47,
48
],
[
43,
49
],
[
49,
50
],
[
49,
51
],
[
51,
52
],
[
52,
53
],
[
43,
54
],
[
54,
55
],
[
55,
56
],
[
54,
57
],
[
57,
58
],
[
57,
59
],
[
38,
60
],
[
60,
61
],
[
61,
62
],
[
62,
63
],
[
61,
64
],
[
60,
65
],
[
65,
66
],
[
66,
67
],
[
66,
68
],
[
68,
69
],
[
69,
70
],
[
65,
71
],
[
71,
72
],
[
71,
73
],
[
73,
74
],
[
74,
75
],
[
65,
76
],
[
76,
77
],
[
77,
78
],
[
76,
79
],
[
79,
80
],
[
79,
81
],
[
60,
82
],
[
82,
83
],
[
83,
84
],
[
84,
85
],
[
83,
86
],
[
82,
87
],
[
87,
88
],
[
88,
89
],
[
88,
90
],
[
90,
91
],
[
91,
92
],
[
87,
93
],
[
93,
94
],
[
93,
95
],
[
95,
96
],
[
96,
97
],
[
87,
98
],
[
98,
99
],
[
99,
100
],
[
98,
101
],
[
101,
102
],
[
101,
103
],
[
82,
104
],
[
104,
105
],
[
105,
106
],
[
106,
107
],
[
105,
108
],
[
108,
109
],
[
109,
110
],
[
108,
111
],
[
18,
112
],
[
112,
113
],
[
113,
114
],
[
114,
115
],
[
114,
116
],
[
112,
117
],
[
117,
118
],
[
118,
119
],
[
16,
120
],
[
120,
121
],
[
239,
122
],
[
122,
123
],
[
122,
124
],
[
124,
125
],
[
125,
126
],
[
124,
127
],
[
127,
128
],
[
128,
129
],
[
128,
130
],
[
127,
131
],
[
122,
132
],
[
132,
133
],
[
239,
134
],
[
134,
135
],
[
134,
136
],
[
136,
137
],
[
137,
138
],
[
136,
139
],
[
139,
140
],
[
140,
141
],
[
140,
142
],
[
142,
143
],
[
142,
144
],
[
239,
145
],
[
145,
146
],
[
145,
147
],
[
147,
148
],
[
147,
149
],
[
145,
150
],
[
150,
151
],
[
150,
152
],
[
145,
153
],
[
153,
154
],
[
153,
155
],
[
155,
156
],
[
156,
157
],
[
156,
158
],
[
155,
159
],
[
159,
160
],
[
159,
161
],
[
153,
162
],
[
162,
163
],
[
145,
164
],
[
164,
165
],
[
164,
166
],
[
166,
167
],
[
167,
168
],
[
168,
169
],
[
169,
170
],
[
169,
171
],
[
168,
172
],
[
172,
173
],
[
173,
174
],
[
174,
175
],
[
167,
176
],
[
176,
177
],
[
177,
178
],
[
178,
179
],
[
178,
180
],
[
180,
181
],
[
181,
182
],
[
177,
183
],
[
183,
184
],
[
184,
185
],
[
184,
186
],
[
166,
187
],
[
187,
188
],
[
188,
189
],
[
189,
190
],
[
145,
191
],
[
191,
192
],
[
191,
193
],
[
193,
194
],
[
194,
195
],
[
195,
196
],
[
196,
197
],
[
196,
198
],
[
195,
199
],
[
199,
200
],
[
200,
201
],
[
201,
202
],
[
194,
203
],
[
203,
204
],
[
204,
205
],
[
205,
206
],
[
205,
207
],
[
207,
208
],
[
208,
209
],
[
204,
210
],
[
210,
211
],
[
211,
212
],
[
212,
213
],
[
213,
214
],
[
193,
215
],
[
215,
216
],
[
216,
217
],
[
217,
218
],
[
216,
219
],
[
145,
220
],
[
220,
221
],
[
220,
222
],
[
222,
223
],
[
223,
224
],
[
224,
225
],
[
225,
226
],
[
224,
227
],
[
227,
228
],
[
145,
229
],
[
229,
230
],
[
229,
231
],
[
231,
232
],
[
232,
233
],
[
233,
234
],
[
234,
235
],
[
233,
236
],
[
236,
237
],
[
0,
238
],
[
238,
239
],
[
238,
240
]
] | [
"import java.io.*;\nimport java.util.*;\n\npublic class Main {\n // 要素数 最後の位置\n public static int top = 0;\n public static int[] stack = new int[200];\n\n public static void main(String[] args) throws Exception {\n FastScanner sc = new FastScanner(System.in);\n ArrayDeque<Integer> st = new ArrayDeque<>();\n String[] inputStr = sc.nextLine().split(\" \");\n\n\n // stack を 使うやり方\n for(String str : inputStr){\n if(str.equals(\"+\")){\n int a = st.pop();\n int b = st.pop();\n st.push(a + b);\n }else if(str.equals(\"-\")){\n int a = st.pop();\n int b = st.pop();\n st.push(b - a);\n }else if(str.equals(\"*\")){\n int a = st.pop();\n int b = st.pop();\n st.push(a * b);\n }else{\n st.push(Integer.parseInt(str));\n }\n }\n System.out.println(st.pop());\n\n\n // stackを再現するやり方\n\n /*\n for(String str : inputStr){\n if(str.equals(\"+\")){\n int a = pop();\n int b = pop();\n push(a + b);\n }else if(str.equals(\"-\")){\n int a = pop();\n int b = pop();\n push(b - a);\n }else if(str.equals(\"*\")){\n int a = pop();\n int b = pop();\n push(a * b);\n }else{\n push(Integer.parseInt(str));\n }\n }\n System.out.println(pop());\n \n */\n\n\n\n }\n public static void push(int x){\n top++;\n stack[top] = x;\n }\n public static int pop(){\n top--;\n return stack[top+1];\n }\n\n\n static class FastScanner {\n private BufferedReader reader = null;\n private StringTokenizer tokenizer = null;\n\n public FastScanner(InputStream in) {\n reader = new BufferedReader(new InputStreamReader(in));\n tokenizer = null;\n }\n\n public String next() {\n if (tokenizer == null || !tokenizer.hasMoreTokens()) {\n try {\n tokenizer = new StringTokenizer(reader.readLine());\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }\n return tokenizer.nextToken();\n }\n\n public String nextLine() {\n if (tokenizer == null || !tokenizer.hasMoreTokens()) {\n try {\n return reader.readLine();\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }\n\n return tokenizer.nextToken(\"\\n\");\n }\n\n public long nextLong() {\n return Long.parseLong(next());\n }\n\n public long nextInt() {\n return Integer.parseInt(next());\n }\n\n }\n}",
"import java.io.*;",
"io.*",
"java",
"import java.util.*;",
"util.*",
"java",
"public class Main {\n // 要素数 最後の位置\n public static int top = 0;\n public static int[] stack = new int[200];\n\n public static void main(String[] args) throws Exception {\n FastScanner sc = new FastScanner(System.in);\n ArrayDeque<Integer> st = new ArrayDeque<>();\n String[] inputStr = sc.nextLine().split(\" \");\n\n\n // stack を 使うやり方\n for(String str : inputStr){\n if(str.equals(\"+\")){\n int a = st.pop();\n int b = st.pop();\n st.push(a + b);\n }else if(str.equals(\"-\")){\n int a = st.pop();\n int b = st.pop();\n st.push(b - a);\n }else if(str.equals(\"*\")){\n int a = st.pop();\n int b = st.pop();\n st.push(a * b);\n }else{\n st.push(Integer.parseInt(str));\n }\n }\n System.out.println(st.pop());\n\n\n // stackを再現するやり方\n\n /*\n for(String str : inputStr){\n if(str.equals(\"+\")){\n int a = pop();\n int b = pop();\n push(a + b);\n }else if(str.equals(\"-\")){\n int a = pop();\n int b = pop();\n push(b - a);\n }else if(str.equals(\"*\")){\n int a = pop();\n int b = pop();\n push(a * b);\n }else{\n push(Integer.parseInt(str));\n }\n }\n System.out.println(pop());\n \n */\n\n\n\n }\n public static void push(int x){\n top++;\n stack[top] = x;\n }\n public static int pop(){\n top--;\n return stack[top+1];\n }\n\n\n static class FastScanner {\n private BufferedReader reader = null;\n private StringTokenizer tokenizer = null;\n\n public FastScanner(InputStream in) {\n reader = new BufferedReader(new InputStreamReader(in));\n tokenizer = null;\n }\n\n public String next() {\n if (tokenizer == null || !tokenizer.hasMoreTokens()) {\n try {\n tokenizer = new StringTokenizer(reader.readLine());\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }\n return tokenizer.nextToken();\n }\n\n public String nextLine() {\n if (tokenizer == null || !tokenizer.hasMoreTokens()) {\n try {\n return reader.readLine();\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }\n\n return tokenizer.nextToken(\"\\n\");\n }\n\n public long nextLong() {\n return Long.parseLong(next());\n }\n\n public long nextInt() {\n return Integer.parseInt(next());\n }\n\n }\n}",
"Main",
"// 要素数 最後の位置\n public static int top = 0;",
"top",
"0",
"public static int[] stack = new int[200];",
"stack",
"new int[200]",
"200",
"public static void main(String[] args) throws Exception {\n FastScanner sc = new FastScanner(System.in);\n ArrayDeque<Integer> st = new ArrayDeque<>();\n String[] inputStr = sc.nextLine().split(\" \");\n\n\n // stack を 使うやり方\n for(String str : inputStr){\n if(str.equals(\"+\")){\n int a = st.pop();\n int b = st.pop();\n st.push(a + b);\n }else if(str.equals(\"-\")){\n int a = st.pop();\n int b = st.pop();\n st.push(b - a);\n }else if(str.equals(\"*\")){\n int a = st.pop();\n int b = st.pop();\n st.push(a * b);\n }else{\n st.push(Integer.parseInt(str));\n }\n }\n System.out.println(st.pop());\n\n\n // stackを再現するやり方\n\n /*\n for(String str : inputStr){\n if(str.equals(\"+\")){\n int a = pop();\n int b = pop();\n push(a + b);\n }else if(str.equals(\"-\")){\n int a = pop();\n int b = pop();\n push(b - a);\n }else if(str.equals(\"*\")){\n int a = pop();\n int b = pop();\n push(a * b);\n }else{\n push(Integer.parseInt(str));\n }\n }\n System.out.println(pop());\n \n */\n\n\n\n }",
"main",
"{\n FastScanner sc = new FastScanner(System.in);\n ArrayDeque<Integer> st = new ArrayDeque<>();\n String[] inputStr = sc.nextLine().split(\" \");\n\n\n // stack を 使うやり方\n for(String str : inputStr){\n if(str.equals(\"+\")){\n int a = st.pop();\n int b = st.pop();\n st.push(a + b);\n }else if(str.equals(\"-\")){\n int a = st.pop();\n int b = st.pop();\n st.push(b - a);\n }else if(str.equals(\"*\")){\n int a = st.pop();\n int b = st.pop();\n st.push(a * b);\n }else{\n st.push(Integer.parseInt(str));\n }\n }\n System.out.println(st.pop());\n\n\n // stackを再現するやり方\n\n /*\n for(String str : inputStr){\n if(str.equals(\"+\")){\n int a = pop();\n int b = pop();\n push(a + b);\n }else if(str.equals(\"-\")){\n int a = pop();\n int b = pop();\n push(b - a);\n }else if(str.equals(\"*\")){\n int a = pop();\n int b = pop();\n push(a * b);\n }else{\n push(Integer.parseInt(str));\n }\n }\n System.out.println(pop());\n \n */\n\n\n\n }",
"FastScanner sc = new FastScanner(System.in);",
"sc",
"new FastScanner(System.in)",
"ArrayDeque<Integer> st = new ArrayDeque<>();",
"st",
"new ArrayDeque<>()",
"String[] inputStr = sc.nextLine().split(\" \");",
"inputStr",
"sc.nextLine().split(\" \")",
"sc.nextLine().split",
"sc.nextLine()",
"sc.nextLine",
"sc",
"\" \"",
"for(String str : inputStr){\n if(str.equals(\"+\")){\n int a = st.pop();\n int b = st.pop();\n st.push(a + b);\n }else if(str.equals(\"-\")){\n int a = st.pop();\n int b = st.pop();\n st.push(b - a);\n }else if(str.equals(\"*\")){\n int a = st.pop();\n int b = st.pop();\n st.push(a * b);\n }else{\n st.push(Integer.parseInt(str));\n }\n }",
"String str",
"inputStr",
"{\n if(str.equals(\"+\")){\n int a = st.pop();\n int b = st.pop();\n st.push(a + b);\n }else if(str.equals(\"-\")){\n int a = st.pop();\n int b = st.pop();\n st.push(b - a);\n }else if(str.equals(\"*\")){\n int a = st.pop();\n int b = st.pop();\n st.push(a * b);\n }else{\n st.push(Integer.parseInt(str));\n }\n }",
"{\n if(str.equals(\"+\")){\n int a = st.pop();\n int b = st.pop();\n st.push(a + b);\n }else if(str.equals(\"-\")){\n int a = st.pop();\n int b = st.pop();\n st.push(b - a);\n }else if(str.equals(\"*\")){\n int a = st.pop();\n int b = st.pop();\n st.push(a * b);\n }else{\n st.push(Integer.parseInt(str));\n }\n }",
"if(str.equals(\"+\")){\n int a = st.pop();\n int b = st.pop();\n st.push(a + b);\n }else if(str.equals(\"-\")){\n int a = st.pop();\n int b = st.pop();\n st.push(b - a);\n }else if(str.equals(\"*\")){\n int a = st.pop();\n int b = st.pop();\n st.push(a * b);\n }else{\n st.push(Integer.parseInt(str));\n }",
"str.equals(\"+\")",
"str.equals",
"str",
"\"+\"",
"{\n int a = st.pop();\n int b = st.pop();\n st.push(a + b);\n }",
"int a = st.pop();",
"a",
"st.pop()",
"st.pop",
"st",
"int b = st.pop();",
"b",
"st.pop()",
"st.pop",
"st",
"st.push(a + b)",
"st.push",
"st",
"a + b",
"a",
"b",
"if(str.equals(\"-\")){\n int a = st.pop();\n int b = st.pop();\n st.push(b - a);\n }else if(str.equals(\"*\")){\n int a = st.pop();\n int b = st.pop();\n st.push(a * b);\n }else{\n st.push(Integer.parseInt(str));\n }",
"str.equals(\"-\")",
"str.equals",
"str",
"\"-\"",
"{\n int a = st.pop();\n int b = st.pop();\n st.push(b - a);\n }",
"int a = st.pop();",
"a",
"st.pop()",
"st.pop",
"st",
"int b = st.pop();",
"b",
"st.pop()",
"st.pop",
"st",
"st.push(b - a)",
"st.push",
"st",
"b - a",
"b",
"a",
"if(str.equals(\"*\")){\n int a = st.pop();\n int b = st.pop();\n st.push(a * b);\n }else{\n st.push(Integer.parseInt(str));\n }",
"str.equals(\"*\")",
"str.equals",
"str",
"\"*\"",
"{\n int a = st.pop();\n int b = st.pop();\n st.push(a * b);\n }",
"int a = st.pop();",
"a",
"st.pop()",
"st.pop",
"st",
"int b = st.pop();",
"b",
"st.pop()",
"st.pop",
"st",
"st.push(a * b)",
"st.push",
"st",
"a * b",
"a",
"b",
"{\n st.push(Integer.parseInt(str));\n }",
"st.push(Integer.parseInt(str))",
"st.push",
"st",
"Integer.parseInt(str)",
"Integer.parseInt",
"Integer",
"str",
"System.out.println(st.pop())",
"System.out.println",
"System.out",
"System",
"System.out",
"st.pop()",
"st.pop",
"st",
"String[] args",
"args",
"public static void push(int x){\n top++;\n stack[top] = x;\n }",
"push",
"{\n top++;\n stack[top] = x;\n }",
"top++",
"top",
"stack[top] = x",
"stack[top]",
"stack",
"top",
"x",
"int x",
"x",
"public static int pop(){\n top--;\n return stack[top+1];\n }",
"pop",
"{\n top--;\n return stack[top+1];\n }",
"top--",
"top",
"return stack[top+1];",
"stack[top+1]",
"stack",
"top+1",
"top",
"1",
"static class FastScanner {\n private BufferedReader reader = null;\n private StringTokenizer tokenizer = null;\n\n public FastScanner(InputStream in) {\n reader = new BufferedReader(new InputStreamReader(in));\n tokenizer = null;\n }\n\n public String next() {\n if (tokenizer == null || !tokenizer.hasMoreTokens()) {\n try {\n tokenizer = new StringTokenizer(reader.readLine());\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }\n return tokenizer.nextToken();\n }\n\n public String nextLine() {\n if (tokenizer == null || !tokenizer.hasMoreTokens()) {\n try {\n return reader.readLine();\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }\n\n return tokenizer.nextToken(\"\\n\");\n }\n\n public long nextLong() {\n return Long.parseLong(next());\n }\n\n public long nextInt() {\n return Integer.parseInt(next());\n }\n\n }",
"FastScanner",
"private BufferedReader reader = null;",
"reader",
"null",
"private StringTokenizer tokenizer = null;",
"tokenizer",
"null",
"public FastScanner(InputStream in) {\n reader = new BufferedReader(new InputStreamReader(in));\n tokenizer = null;\n }",
"FastScanner",
"{\n reader = new BufferedReader(new InputStreamReader(in));\n tokenizer = null;\n }",
"reader = new BufferedReader(new InputStreamReader(in))",
"reader",
"new BufferedReader(new InputStreamReader(in))",
"tokenizer = null",
"tokenizer",
"null",
"InputStream in",
"in",
"public String next() {\n if (tokenizer == null || !tokenizer.hasMoreTokens()) {\n try {\n tokenizer = new StringTokenizer(reader.readLine());\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }\n return tokenizer.nextToken();\n }",
"next",
"{\n if (tokenizer == null || !tokenizer.hasMoreTokens()) {\n try {\n tokenizer = new StringTokenizer(reader.readLine());\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }\n return tokenizer.nextToken();\n }",
"if (tokenizer == null || !tokenizer.hasMoreTokens()) {\n try {\n tokenizer = new StringTokenizer(reader.readLine());\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }",
"tokenizer == null || !tokenizer.hasMoreTokens()",
"tokenizer == null",
"tokenizer",
"null",
"!tokenizer.hasMoreTokens()",
"tokenizer.hasMoreTokens()",
"tokenizer.hasMoreTokens",
"tokenizer",
"{\n try {\n tokenizer = new StringTokenizer(reader.readLine());\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }",
"try {\n tokenizer = new StringTokenizer(reader.readLine());\n } catch (IOException e) {\n throw new RuntimeException(e);\n }",
"catch (IOException e) {\n throw new RuntimeException(e);\n }",
"IOException e",
"{\n throw new RuntimeException(e);\n }",
"throw new RuntimeException(e);",
"new RuntimeException(e)",
"{\n tokenizer = new StringTokenizer(reader.readLine());\n }",
"tokenizer = new StringTokenizer(reader.readLine())",
"tokenizer",
"new StringTokenizer(reader.readLine())",
"return tokenizer.nextToken();",
"tokenizer.nextToken()",
"tokenizer.nextToken",
"tokenizer",
"public String nextLine() {\n if (tokenizer == null || !tokenizer.hasMoreTokens()) {\n try {\n return reader.readLine();\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }\n\n return tokenizer.nextToken(\"\\n\");\n }",
"nextLine",
"{\n if (tokenizer == null || !tokenizer.hasMoreTokens()) {\n try {\n return reader.readLine();\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }\n\n return tokenizer.nextToken(\"\\n\");\n }",
"if (tokenizer == null || !tokenizer.hasMoreTokens()) {\n try {\n return reader.readLine();\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }",
"tokenizer == null || !tokenizer.hasMoreTokens()",
"tokenizer == null",
"tokenizer",
"null",
"!tokenizer.hasMoreTokens()",
"tokenizer.hasMoreTokens()",
"tokenizer.hasMoreTokens",
"tokenizer",
"{\n try {\n return reader.readLine();\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }",
"try {\n return reader.readLine();\n } catch (IOException e) {\n throw new RuntimeException(e);\n }",
"catch (IOException e) {\n throw new RuntimeException(e);\n }",
"IOException e",
"{\n throw new RuntimeException(e);\n }",
"throw new RuntimeException(e);",
"new RuntimeException(e)",
"{\n return reader.readLine();\n }",
"return reader.readLine();",
"reader.readLine()",
"reader.readLine",
"reader",
"return tokenizer.nextToken(\"\\n\");",
"tokenizer.nextToken(\"\\n\")",
"tokenizer.nextToken",
"tokenizer",
"\"\\n\"",
"public long nextLong() {\n return Long.parseLong(next());\n }",
"nextLong",
"{\n return Long.parseLong(next());\n }",
"return Long.parseLong(next());",
"Long.parseLong(next())",
"Long.parseLong",
"Long",
"next()",
"next",
"public long nextInt() {\n return Integer.parseInt(next());\n }",
"nextInt",
"{\n return Integer.parseInt(next());\n }",
"return Integer.parseInt(next());",
"Integer.parseInt(next())",
"Integer.parseInt",
"Integer",
"next()",
"next",
"public class Main {\n // 要素数 最後の位置\n public static int top = 0;\n public static int[] stack = new int[200];\n\n public static void main(String[] args) throws Exception {\n FastScanner sc = new FastScanner(System.in);\n ArrayDeque<Integer> st = new ArrayDeque<>();\n String[] inputStr = sc.nextLine().split(\" \");\n\n\n // stack を 使うやり方\n for(String str : inputStr){\n if(str.equals(\"+\")){\n int a = st.pop();\n int b = st.pop();\n st.push(a + b);\n }else if(str.equals(\"-\")){\n int a = st.pop();\n int b = st.pop();\n st.push(b - a);\n }else if(str.equals(\"*\")){\n int a = st.pop();\n int b = st.pop();\n st.push(a * b);\n }else{\n st.push(Integer.parseInt(str));\n }\n }\n System.out.println(st.pop());\n\n\n // stackを再現するやり方\n\n /*\n for(String str : inputStr){\n if(str.equals(\"+\")){\n int a = pop();\n int b = pop();\n push(a + b);\n }else if(str.equals(\"-\")){\n int a = pop();\n int b = pop();\n push(b - a);\n }else if(str.equals(\"*\")){\n int a = pop();\n int b = pop();\n push(a * b);\n }else{\n push(Integer.parseInt(str));\n }\n }\n System.out.println(pop());\n \n */\n\n\n\n }\n public static void push(int x){\n top++;\n stack[top] = x;\n }\n public static int pop(){\n top--;\n return stack[top+1];\n }\n\n\n static class FastScanner {\n private BufferedReader reader = null;\n private StringTokenizer tokenizer = null;\n\n public FastScanner(InputStream in) {\n reader = new BufferedReader(new InputStreamReader(in));\n tokenizer = null;\n }\n\n public String next() {\n if (tokenizer == null || !tokenizer.hasMoreTokens()) {\n try {\n tokenizer = new StringTokenizer(reader.readLine());\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }\n return tokenizer.nextToken();\n }\n\n public String nextLine() {\n if (tokenizer == null || !tokenizer.hasMoreTokens()) {\n try {\n return reader.readLine();\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }\n\n return tokenizer.nextToken(\"\\n\");\n }\n\n public long nextLong() {\n return Long.parseLong(next());\n }\n\n public long nextInt() {\n return Integer.parseInt(next());\n }\n\n }\n}",
"public class Main {\n // 要素数 最後の位置\n public static int top = 0;\n public static int[] stack = new int[200];\n\n public static void main(String[] args) throws Exception {\n FastScanner sc = new FastScanner(System.in);\n ArrayDeque<Integer> st = new ArrayDeque<>();\n String[] inputStr = sc.nextLine().split(\" \");\n\n\n // stack を 使うやり方\n for(String str : inputStr){\n if(str.equals(\"+\")){\n int a = st.pop();\n int b = st.pop();\n st.push(a + b);\n }else if(str.equals(\"-\")){\n int a = st.pop();\n int b = st.pop();\n st.push(b - a);\n }else if(str.equals(\"*\")){\n int a = st.pop();\n int b = st.pop();\n st.push(a * b);\n }else{\n st.push(Integer.parseInt(str));\n }\n }\n System.out.println(st.pop());\n\n\n // stackを再現するやり方\n\n /*\n for(String str : inputStr){\n if(str.equals(\"+\")){\n int a = pop();\n int b = pop();\n push(a + b);\n }else if(str.equals(\"-\")){\n int a = pop();\n int b = pop();\n push(b - a);\n }else if(str.equals(\"*\")){\n int a = pop();\n int b = pop();\n push(a * b);\n }else{\n push(Integer.parseInt(str));\n }\n }\n System.out.println(pop());\n \n */\n\n\n\n }\n public static void push(int x){\n top++;\n stack[top] = x;\n }\n public static int pop(){\n top--;\n return stack[top+1];\n }\n\n\n static class FastScanner {\n private BufferedReader reader = null;\n private StringTokenizer tokenizer = null;\n\n public FastScanner(InputStream in) {\n reader = new BufferedReader(new InputStreamReader(in));\n tokenizer = null;\n }\n\n public String next() {\n if (tokenizer == null || !tokenizer.hasMoreTokens()) {\n try {\n tokenizer = new StringTokenizer(reader.readLine());\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }\n return tokenizer.nextToken();\n }\n\n public String nextLine() {\n if (tokenizer == null || !tokenizer.hasMoreTokens()) {\n try {\n return reader.readLine();\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }\n\n return tokenizer.nextToken(\"\\n\");\n }\n\n public long nextLong() {\n return Long.parseLong(next());\n }\n\n public long nextInt() {\n return Integer.parseInt(next());\n }\n\n }\n}",
"Main"
] | import java.io.*;
import java.util.*;
public class Main {
// 要素数 最後の位置
public static int top = 0;
public static int[] stack = new int[200];
public static void main(String[] args) throws Exception {
FastScanner sc = new FastScanner(System.in);
ArrayDeque<Integer> st = new ArrayDeque<>();
String[] inputStr = sc.nextLine().split(" ");
// stack を 使うやり方
for(String str : inputStr){
if(str.equals("+")){
int a = st.pop();
int b = st.pop();
st.push(a + b);
}else if(str.equals("-")){
int a = st.pop();
int b = st.pop();
st.push(b - a);
}else if(str.equals("*")){
int a = st.pop();
int b = st.pop();
st.push(a * b);
}else{
st.push(Integer.parseInt(str));
}
}
System.out.println(st.pop());
// stackを再現するやり方
/*
for(String str : inputStr){
if(str.equals("+")){
int a = pop();
int b = pop();
push(a + b);
}else if(str.equals("-")){
int a = pop();
int b = pop();
push(b - a);
}else if(str.equals("*")){
int a = pop();
int b = pop();
push(a * b);
}else{
push(Integer.parseInt(str));
}
}
System.out.println(pop());
*/
}
public static void push(int x){
top++;
stack[top] = x;
}
public static int pop(){
top--;
return stack[top+1];
}
static class FastScanner {
private BufferedReader reader = null;
private StringTokenizer tokenizer = null;
public FastScanner(InputStream in) {
reader = new BufferedReader(new InputStreamReader(in));
tokenizer = null;
}
public String next() {
if (tokenizer == null || !tokenizer.hasMoreTokens()) {
try {
tokenizer = new StringTokenizer(reader.readLine());
} catch (IOException e) {
throw new RuntimeException(e);
}
}
return tokenizer.nextToken();
}
public String nextLine() {
if (tokenizer == null || !tokenizer.hasMoreTokens()) {
try {
return reader.readLine();
} catch (IOException e) {
throw new RuntimeException(e);
}
}
return tokenizer.nextToken("\n");
}
public long nextLong() {
return Long.parseLong(next());
}
public long nextInt() {
return Integer.parseInt(next());
}
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
41,
13,
17,
41,
13,
20,
17,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
4,
18,
13,
17,
41,
13,
41,
13,
41,
13,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
30,
0,
13,
18,
13,
13,
35,
13,
34,
17,
1,
0,
13,
4,
13,
0,
13,
4,
13,
4,
13,
2,
13,
13,
3,
34,
17,
1,
0,
13,
4,
13,
0,
13,
4,
13,
4,
13,
2,
13,
13,
3,
34,
17,
1,
0,
13,
4,
13,
0,
13,
4,
13,
4,
13,
2,
13,
13,
3,
34,
1,
4,
13,
4,
18,
13,
13,
4,
18,
18,
13,
13,
4,
13,
23,
13,
12,
13,
30,
40,
13,
0,
18,
13,
13,
13,
23,
13,
12,
13,
30,
40,
13,
29,
18,
13,
2,
13,
17,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
10,
11
],
[
10,
12
],
[
0,
13
],
[
156,
14
],
[
156,
15
],
[
15,
16
],
[
15,
17
],
[
156,
18
],
[
18,
19
],
[
18,
20
],
[
156,
22
],
[
22,
23
],
[
22,
24
],
[
24,
25
],
[
25,
26
],
[
25,
27
],
[
24,
28
],
[
28,
29
],
[
28,
30
],
[
30,
31
],
[
31,
32
],
[
32,
33
],
[
33,
34
],
[
30,
35
],
[
24,
36
],
[
36,
37
],
[
24,
38
],
[
38,
39
],
[
24,
40
],
[
40,
41
],
[
24,
42
],
[
42,
43
],
[
43,
44
],
[
44,
45
],
[
44,
46
],
[
42,
47
],
[
47,
48
],
[
47,
49
],
[
49,
50
],
[
49,
51
],
[
42,
52
],
[
52,
53
],
[
53,
54
],
[
42,
55
],
[
56,
56
],
[
56,
57
],
[
57,
58
],
[
57,
59
],
[
59,
60
],
[
59,
61
],
[
56,
62
],
[
62,
63
],
[
62,
64
],
[
64,
65
],
[
64,
66
],
[
66,
67
],
[
67,
68
],
[
67,
69
],
[
69,
70
],
[
66,
71
],
[
71,
72
],
[
71,
73
],
[
73,
74
],
[
66,
75
],
[
75,
76
],
[
75,
77
],
[
77,
78
],
[
77,
79
],
[
66,
80
],
[
62,
81
],
[
81,
82
],
[
81,
83
],
[
83,
84
],
[
84,
85
],
[
84,
86
],
[
86,
87
],
[
83,
88
],
[
88,
89
],
[
88,
90
],
[
90,
91
],
[
83,
92
],
[
92,
93
],
[
92,
94
],
[
94,
95
],
[
94,
96
],
[
83,
97
],
[
62,
98
],
[
98,
99
],
[
98,
100
],
[
100,
101
],
[
101,
102
],
[
101,
103
],
[
103,
104
],
[
100,
105
],
[
105,
106
],
[
105,
107
],
[
107,
108
],
[
100,
109
],
[
109,
110
],
[
109,
111
],
[
111,
112
],
[
111,
113
],
[
100,
114
],
[
62,
115
],
[
115,
116
],
[
116,
117
],
[
117,
118
],
[
117,
119
],
[
119,
120
],
[
120,
121
],
[
119,
122
],
[
24,
123
],
[
123,
124
],
[
124,
125
],
[
125,
126
],
[
125,
127
],
[
123,
128
],
[
128,
129
],
[
22,
130
],
[
130,
131
],
[
156,
132
],
[
132,
133
],
[
132,
134
],
[
134,
135
],
[
135,
136
],
[
134,
137
],
[
137,
138
],
[
138,
139
],
[
138,
140
],
[
137,
141
],
[
132,
142
],
[
142,
143
],
[
156,
144
],
[
144,
145
],
[
144,
146
],
[
146,
147
],
[
147,
148
],
[
146,
149
],
[
149,
150
],
[
150,
151
],
[
150,
152
],
[
152,
153
],
[
152,
154
],
[
0,
155
],
[
155,
156
],
[
155,
157
]
] | [
"import java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\nimport java.util.*;\n\npublic class Main {\n static int top = 0;\n static int[] S = new int[1000];\n public static void main(String[] args) throws IOException {\n //Scanner sc = new Scanner(System.in);\n //int N = sc.nextInt();\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n //System.out.println(br.readLine());\n String[] inputChar = br.readLine().split(\" \");\n\n String s;\n int a, b;\n for (int i = 0; i < inputChar.length; i++) {\n s = inputChar[i];\n switch (s){\n case \"+\":\n a = pop();\n b = pop();\n push(a + b);\n break;\n\n case \"-\":\n a = pop();\n b = pop();\n push(b-a);\n break;\n\n case \"*\":\n a = pop();\n b = pop();\n push(a * b);\n break;\n\n default:\n push(Integer.parseInt(s));\n }\n }\n\n System.out.println(pop());\n\n }\n\n static void push(int x) {\n top++;\n S[top] = x;\n }\n\n static int pop() {\n top--;\n return S[top + 1];\n }\n}\n",
"import java.io.BufferedReader;",
"BufferedReader",
"java.io",
"import java.io.IOException;",
"IOException",
"java.io",
"import java.io.InputStreamReader;",
"InputStreamReader",
"java.io",
"import java.util.*;",
"util.*",
"java",
"public class Main {\n static int top = 0;\n static int[] S = new int[1000];\n public static void main(String[] args) throws IOException {\n //Scanner sc = new Scanner(System.in);\n //int N = sc.nextInt();\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n //System.out.println(br.readLine());\n String[] inputChar = br.readLine().split(\" \");\n\n String s;\n int a, b;\n for (int i = 0; i < inputChar.length; i++) {\n s = inputChar[i];\n switch (s){\n case \"+\":\n a = pop();\n b = pop();\n push(a + b);\n break;\n\n case \"-\":\n a = pop();\n b = pop();\n push(b-a);\n break;\n\n case \"*\":\n a = pop();\n b = pop();\n push(a * b);\n break;\n\n default:\n push(Integer.parseInt(s));\n }\n }\n\n System.out.println(pop());\n\n }\n\n static void push(int x) {\n top++;\n S[top] = x;\n }\n\n static int pop() {\n top--;\n return S[top + 1];\n }\n}",
"Main",
"static int top = 0;",
"top",
"0",
"static int[] S = new int[1000];",
"S",
"new int[1000]",
"1000",
"public static void main(String[] args) throws IOException {\n //Scanner sc = new Scanner(System.in);\n //int N = sc.nextInt();\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n //System.out.println(br.readLine());\n String[] inputChar = br.readLine().split(\" \");\n\n String s;\n int a, b;\n for (int i = 0; i < inputChar.length; i++) {\n s = inputChar[i];\n switch (s){\n case \"+\":\n a = pop();\n b = pop();\n push(a + b);\n break;\n\n case \"-\":\n a = pop();\n b = pop();\n push(b-a);\n break;\n\n case \"*\":\n a = pop();\n b = pop();\n push(a * b);\n break;\n\n default:\n push(Integer.parseInt(s));\n }\n }\n\n System.out.println(pop());\n\n }",
"main",
"{\n //Scanner sc = new Scanner(System.in);\n //int N = sc.nextInt();\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n //System.out.println(br.readLine());\n String[] inputChar = br.readLine().split(\" \");\n\n String s;\n int a, b;\n for (int i = 0; i < inputChar.length; i++) {\n s = inputChar[i];\n switch (s){\n case \"+\":\n a = pop();\n b = pop();\n push(a + b);\n break;\n\n case \"-\":\n a = pop();\n b = pop();\n push(b-a);\n break;\n\n case \"*\":\n a = pop();\n b = pop();\n push(a * b);\n break;\n\n default:\n push(Integer.parseInt(s));\n }\n }\n\n System.out.println(pop());\n\n }",
"BufferedReader br = new BufferedReader(new InputStreamReader(System.in));",
"br",
"new BufferedReader(new InputStreamReader(System.in))",
"String[] inputChar = br.readLine().split(\" \");",
"inputChar",
"br.readLine().split(\" \")",
"br.readLine().split",
"br.readLine()",
"br.readLine",
"br",
"\" \"",
"String s;",
"s",
"int a",
"a",
"b;",
"b",
"for (int i = 0; i < inputChar.length; i++) {\n s = inputChar[i];\n switch (s){\n case \"+\":\n a = pop();\n b = pop();\n push(a + b);\n break;\n\n case \"-\":\n a = pop();\n b = pop();\n push(b-a);\n break;\n\n case \"*\":\n a = pop();\n b = pop();\n push(a * b);\n break;\n\n default:\n push(Integer.parseInt(s));\n }\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < inputChar.length",
"i",
"inputChar.length",
"inputChar",
"inputChar.length",
"i++",
"i++",
"i",
"{\n s = inputChar[i];\n switch (s){\n case \"+\":\n a = pop();\n b = pop();\n push(a + b);\n break;\n\n case \"-\":\n a = pop();\n b = pop();\n push(b-a);\n break;\n\n case \"*\":\n a = pop();\n b = pop();\n push(a * b);\n break;\n\n default:\n push(Integer.parseInt(s));\n }\n }",
"{\n s = inputChar[i];\n switch (s){\n case \"+\":\n a = pop();\n b = pop();\n push(a + b);\n break;\n\n case \"-\":\n a = pop();\n b = pop();\n push(b-a);\n break;\n\n case \"*\":\n a = pop();\n b = pop();\n push(a * b);\n break;\n\n default:\n push(Integer.parseInt(s));\n }\n }",
"s = inputChar[i]",
"s",
"inputChar[i]",
"inputChar",
"i",
"switch (s){\n case \"+\":\n a = pop();\n b = pop();\n push(a + b);\n break;\n\n case \"-\":\n a = pop();\n b = pop();\n push(b-a);\n break;\n\n case \"*\":\n a = pop();\n b = pop();\n push(a * b);\n break;\n\n default:\n push(Integer.parseInt(s));\n }",
"s",
"case \"+\":",
"\"+\"",
"case \"+\":",
"a = pop()",
"a",
"pop()",
"pop",
"b = pop()",
"b",
"pop()",
"pop",
"push(a + b)",
"push",
"a + b",
"a",
"b",
"break;",
"case \"-\":",
"\"-\"",
"case \"-\":",
"a = pop()",
"a",
"pop()",
"pop",
"b = pop()",
"b",
"pop()",
"pop",
"push(b-a)",
"push",
"b-a",
"b",
"a",
"break;",
"case \"*\":",
"\"*\"",
"case \"*\":",
"a = pop()",
"a",
"pop()",
"pop",
"b = pop()",
"b",
"pop()",
"pop",
"push(a * b)",
"push",
"a * b",
"a",
"b",
"break;",
"default:",
"default:",
"push(Integer.parseInt(s))",
"push",
"Integer.parseInt(s)",
"Integer.parseInt",
"Integer",
"s",
"System.out.println(pop())",
"System.out.println",
"System.out",
"System",
"System.out",
"pop()",
"pop",
"String[] args",
"args",
"static void push(int x) {\n top++;\n S[top] = x;\n }",
"push",
"{\n top++;\n S[top] = x;\n }",
"top++",
"top",
"S[top] = x",
"S[top]",
"S",
"top",
"x",
"int x",
"x",
"static int pop() {\n top--;\n return S[top + 1];\n }",
"pop",
"{\n top--;\n return S[top + 1];\n }",
"top--",
"top",
"return S[top + 1];",
"S[top + 1]",
"S",
"top + 1",
"top",
"1",
"public class Main {\n static int top = 0;\n static int[] S = new int[1000];\n public static void main(String[] args) throws IOException {\n //Scanner sc = new Scanner(System.in);\n //int N = sc.nextInt();\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n //System.out.println(br.readLine());\n String[] inputChar = br.readLine().split(\" \");\n\n String s;\n int a, b;\n for (int i = 0; i < inputChar.length; i++) {\n s = inputChar[i];\n switch (s){\n case \"+\":\n a = pop();\n b = pop();\n push(a + b);\n break;\n\n case \"-\":\n a = pop();\n b = pop();\n push(b-a);\n break;\n\n case \"*\":\n a = pop();\n b = pop();\n push(a * b);\n break;\n\n default:\n push(Integer.parseInt(s));\n }\n }\n\n System.out.println(pop());\n\n }\n\n static void push(int x) {\n top++;\n S[top] = x;\n }\n\n static int pop() {\n top--;\n return S[top + 1];\n }\n}",
"public class Main {\n static int top = 0;\n static int[] S = new int[1000];\n public static void main(String[] args) throws IOException {\n //Scanner sc = new Scanner(System.in);\n //int N = sc.nextInt();\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n //System.out.println(br.readLine());\n String[] inputChar = br.readLine().split(\" \");\n\n String s;\n int a, b;\n for (int i = 0; i < inputChar.length; i++) {\n s = inputChar[i];\n switch (s){\n case \"+\":\n a = pop();\n b = pop();\n push(a + b);\n break;\n\n case \"-\":\n a = pop();\n b = pop();\n push(b-a);\n break;\n\n case \"*\":\n a = pop();\n b = pop();\n push(a * b);\n break;\n\n default:\n push(Integer.parseInt(s));\n }\n }\n\n System.out.println(pop());\n\n }\n\n static void push(int x) {\n top++;\n S[top] = x;\n }\n\n static int pop() {\n top--;\n return S[top + 1];\n }\n}",
"Main"
] | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;
public class Main {
static int top = 0;
static int[] S = new int[1000];
public static void main(String[] args) throws IOException {
//Scanner sc = new Scanner(System.in);
//int N = sc.nextInt();
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
//System.out.println(br.readLine());
String[] inputChar = br.readLine().split(" ");
String s;
int a, b;
for (int i = 0; i < inputChar.length; i++) {
s = inputChar[i];
switch (s){
case "+":
a = pop();
b = pop();
push(a + b);
break;
case "-":
a = pop();
b = pop();
push(b-a);
break;
case "*":
a = pop();
b = pop();
push(a * b);
break;
default:
push(Integer.parseInt(s));
}
}
System.out.println(pop());
}
static void push(int x) {
top++;
S[top] = x;
}
static int pop() {
top--;
return S[top + 1];
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
4,
18,
13,
17,
4,
18,
13,
41,
13,
17,
41,
13,
20,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
30,
38,
5,
13,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
14,
4,
18,
18,
13,
13,
17,
30,
0,
13,
2,
13,
13,
14,
4,
18,
18,
13,
13,
17,
30,
0,
13,
2,
13,
13,
30,
0,
13,
2,
13,
13,
4,
18,
13,
13,
30,
4,
18,
13,
4,
18,
13,
18,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
113,
5
],
[
113,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
16,
17
],
[
17,
18
],
[
14,
19
],
[
8,
20
],
[
20,
21
],
[
21,
22
],
[
8,
23
],
[
23,
24
],
[
23,
25
],
[
8,
26
],
[
26,
27
],
[
26,
28
],
[
8,
29
],
[
29,
30
],
[
30,
31
],
[
31,
32
],
[
31,
33
],
[
29,
34
],
[
34,
35
],
[
34,
36
],
[
36,
37
],
[
36,
38
],
[
29,
39
],
[
39,
40
],
[
40,
41
],
[
29,
42
],
[
43,
43
],
[
43,
44
],
[
44,
45
],
[
45,
46
],
[
45,
47
],
[
47,
48
],
[
48,
49
],
[
48,
50
],
[
50,
51
],
[
51,
52
],
[
47,
53
],
[
53,
54
],
[
53,
55
],
[
55,
56
],
[
56,
57
],
[
47,
58
],
[
58,
59
],
[
59,
60
],
[
60,
61
],
[
61,
62
],
[
61,
63
],
[
59,
64
],
[
58,
65
],
[
65,
66
],
[
66,
67
],
[
66,
68
],
[
68,
69
],
[
68,
70
],
[
58,
71
],
[
71,
72
],
[
72,
73
],
[
73,
74
],
[
74,
75
],
[
74,
76
],
[
72,
77
],
[
71,
78
],
[
78,
79
],
[
79,
80
],
[
79,
81
],
[
81,
82
],
[
81,
83
],
[
71,
84
],
[
84,
85
],
[
85,
86
],
[
85,
87
],
[
87,
88
],
[
87,
89
],
[
47,
90
],
[
90,
91
],
[
91,
92
],
[
90,
93
],
[
44,
94
],
[
94,
95
],
[
95,
96
],
[
96,
97
],
[
95,
98
],
[
98,
99
],
[
99,
100
],
[
98,
101
],
[
101,
102
],
[
101,
103
],
[
8,
104
],
[
104,
105
],
[
105,
106
],
[
106,
107
],
[
106,
108
],
[
104,
109
],
[
6,
110
],
[
110,
111
],
[
0,
112
],
[
112,
113
],
[
112,
114
]
] | [
"import java.util.*;\n\npublic class Main{\n public static void main(String[] args) {\n Scanner in = new Scanner(System.in);\n String[] input = in.nextLine().split(\" \");\n in.close();\n\n int result = 0;\n \n Stack<Integer> numbers = new Stack<Integer>();\n \n for (int i = 0; i < input.length; i++) {\n try {\n numbers.push(Integer.parseInt(input[i]));\n } catch(Exception e) {\n //pop last two from stack and compute\n int second = numbers.pop();\n int first = numbers.pop();\n \n // evaluate based on operator\n if (input[i].equals(\"+\")) {\n result = first + second;\n } else if (input[i].equals(\"-\")) {\n result = first - second;\n } else {\n result = first * second;\n }\n numbers.push(result);\n }\n }\n // print results\n System.out.println(result);\n }\n}",
"import java.util.*;",
"util.*",
"java",
"public class Main{\n public static void main(String[] args) {\n Scanner in = new Scanner(System.in);\n String[] input = in.nextLine().split(\" \");\n in.close();\n\n int result = 0;\n \n Stack<Integer> numbers = new Stack<Integer>();\n \n for (int i = 0; i < input.length; i++) {\n try {\n numbers.push(Integer.parseInt(input[i]));\n } catch(Exception e) {\n //pop last two from stack and compute\n int second = numbers.pop();\n int first = numbers.pop();\n \n // evaluate based on operator\n if (input[i].equals(\"+\")) {\n result = first + second;\n } else if (input[i].equals(\"-\")) {\n result = first - second;\n } else {\n result = first * second;\n }\n numbers.push(result);\n }\n }\n // print results\n System.out.println(result);\n }\n}",
"Main",
"public static void main(String[] args) {\n Scanner in = new Scanner(System.in);\n String[] input = in.nextLine().split(\" \");\n in.close();\n\n int result = 0;\n \n Stack<Integer> numbers = new Stack<Integer>();\n \n for (int i = 0; i < input.length; i++) {\n try {\n numbers.push(Integer.parseInt(input[i]));\n } catch(Exception e) {\n //pop last two from stack and compute\n int second = numbers.pop();\n int first = numbers.pop();\n \n // evaluate based on operator\n if (input[i].equals(\"+\")) {\n result = first + second;\n } else if (input[i].equals(\"-\")) {\n result = first - second;\n } else {\n result = first * second;\n }\n numbers.push(result);\n }\n }\n // print results\n System.out.println(result);\n }",
"main",
"{\n Scanner in = new Scanner(System.in);\n String[] input = in.nextLine().split(\" \");\n in.close();\n\n int result = 0;\n \n Stack<Integer> numbers = new Stack<Integer>();\n \n for (int i = 0; i < input.length; i++) {\n try {\n numbers.push(Integer.parseInt(input[i]));\n } catch(Exception e) {\n //pop last two from stack and compute\n int second = numbers.pop();\n int first = numbers.pop();\n \n // evaluate based on operator\n if (input[i].equals(\"+\")) {\n result = first + second;\n } else if (input[i].equals(\"-\")) {\n result = first - second;\n } else {\n result = first * second;\n }\n numbers.push(result);\n }\n }\n // print results\n System.out.println(result);\n }",
"Scanner in = new Scanner(System.in);",
"in",
"new Scanner(System.in)",
"String[] input = in.nextLine().split(\" \");",
"input",
"in.nextLine().split(\" \")",
"in.nextLine().split",
"in.nextLine()",
"in.nextLine",
"in",
"\" \"",
"in.close()",
"in.close",
"in",
"int result = 0;",
"result",
"0",
"Stack<Integer> numbers = new Stack<Integer>();",
"numbers",
"new Stack<Integer>()",
"for (int i = 0; i < input.length; i++) {\n try {\n numbers.push(Integer.parseInt(input[i]));\n } catch(Exception e) {\n //pop last two from stack and compute\n int second = numbers.pop();\n int first = numbers.pop();\n \n // evaluate based on operator\n if (input[i].equals(\"+\")) {\n result = first + second;\n } else if (input[i].equals(\"-\")) {\n result = first - second;\n } else {\n result = first * second;\n }\n numbers.push(result);\n }\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < input.length",
"i",
"input.length",
"input",
"input.length",
"i++",
"i++",
"i",
"{\n try {\n numbers.push(Integer.parseInt(input[i]));\n } catch(Exception e) {\n //pop last two from stack and compute\n int second = numbers.pop();\n int first = numbers.pop();\n \n // evaluate based on operator\n if (input[i].equals(\"+\")) {\n result = first + second;\n } else if (input[i].equals(\"-\")) {\n result = first - second;\n } else {\n result = first * second;\n }\n numbers.push(result);\n }\n }",
"{\n try {\n numbers.push(Integer.parseInt(input[i]));\n } catch(Exception e) {\n //pop last two from stack and compute\n int second = numbers.pop();\n int first = numbers.pop();\n \n // evaluate based on operator\n if (input[i].equals(\"+\")) {\n result = first + second;\n } else if (input[i].equals(\"-\")) {\n result = first - second;\n } else {\n result = first * second;\n }\n numbers.push(result);\n }\n }",
"try {\n numbers.push(Integer.parseInt(input[i]));\n } catch(Exception e) {\n //pop last two from stack and compute\n int second = numbers.pop();\n int first = numbers.pop();\n \n // evaluate based on operator\n if (input[i].equals(\"+\")) {\n result = first + second;\n } else if (input[i].equals(\"-\")) {\n result = first - second;\n } else {\n result = first * second;\n }\n numbers.push(result);\n }",
"catch(Exception e) {\n //pop last two from stack and compute\n int second = numbers.pop();\n int first = numbers.pop();\n \n // evaluate based on operator\n if (input[i].equals(\"+\")) {\n result = first + second;\n } else if (input[i].equals(\"-\")) {\n result = first - second;\n } else {\n result = first * second;\n }\n numbers.push(result);\n }",
"Exception e",
"{\n //pop last two from stack and compute\n int second = numbers.pop();\n int first = numbers.pop();\n \n // evaluate based on operator\n if (input[i].equals(\"+\")) {\n result = first + second;\n } else if (input[i].equals(\"-\")) {\n result = first - second;\n } else {\n result = first * second;\n }\n numbers.push(result);\n }",
"int second = numbers.pop();",
"second",
"numbers.pop()",
"numbers.pop",
"numbers",
"int first = numbers.pop();",
"first",
"numbers.pop()",
"numbers.pop",
"numbers",
"if (input[i].equals(\"+\")) {\n result = first + second;\n } else if (input[i].equals(\"-\")) {\n result = first - second;\n } else {\n result = first * second;\n }",
"input[i].equals(\"+\")",
"input[i].equals",
"input[i]",
"input",
"i",
"\"+\"",
"{\n result = first + second;\n }",
"result = first + second",
"result",
"first + second",
"first",
"second",
"if (input[i].equals(\"-\")) {\n result = first - second;\n } else {\n result = first * second;\n }",
"input[i].equals(\"-\")",
"input[i].equals",
"input[i]",
"input",
"i",
"\"-\"",
"{\n result = first - second;\n }",
"result = first - second",
"result",
"first - second",
"first",
"second",
"{\n result = first * second;\n }",
"result = first * second",
"result",
"first * second",
"first",
"second",
"numbers.push(result)",
"numbers.push",
"numbers",
"result",
"{\n numbers.push(Integer.parseInt(input[i]));\n }",
"numbers.push(Integer.parseInt(input[i]))",
"numbers.push",
"numbers",
"Integer.parseInt(input[i])",
"Integer.parseInt",
"Integer",
"input[i]",
"input",
"i",
"System.out.println(result)",
"System.out.println",
"System.out",
"System",
"System.out",
"result",
"String[] args",
"args",
"public class Main{\n public static void main(String[] args) {\n Scanner in = new Scanner(System.in);\n String[] input = in.nextLine().split(\" \");\n in.close();\n\n int result = 0;\n \n Stack<Integer> numbers = new Stack<Integer>();\n \n for (int i = 0; i < input.length; i++) {\n try {\n numbers.push(Integer.parseInt(input[i]));\n } catch(Exception e) {\n //pop last two from stack and compute\n int second = numbers.pop();\n int first = numbers.pop();\n \n // evaluate based on operator\n if (input[i].equals(\"+\")) {\n result = first + second;\n } else if (input[i].equals(\"-\")) {\n result = first - second;\n } else {\n result = first * second;\n }\n numbers.push(result);\n }\n }\n // print results\n System.out.println(result);\n }\n}",
"public class Main{\n public static void main(String[] args) {\n Scanner in = new Scanner(System.in);\n String[] input = in.nextLine().split(\" \");\n in.close();\n\n int result = 0;\n \n Stack<Integer> numbers = new Stack<Integer>();\n \n for (int i = 0; i < input.length; i++) {\n try {\n numbers.push(Integer.parseInt(input[i]));\n } catch(Exception e) {\n //pop last two from stack and compute\n int second = numbers.pop();\n int first = numbers.pop();\n \n // evaluate based on operator\n if (input[i].equals(\"+\")) {\n result = first + second;\n } else if (input[i].equals(\"-\")) {\n result = first - second;\n } else {\n result = first * second;\n }\n numbers.push(result);\n }\n }\n // print results\n System.out.println(result);\n }\n}",
"Main"
] | import java.util.*;
public class Main{
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
String[] input = in.nextLine().split(" ");
in.close();
int result = 0;
Stack<Integer> numbers = new Stack<Integer>();
for (int i = 0; i < input.length; i++) {
try {
numbers.push(Integer.parseInt(input[i]));
} catch(Exception e) {
//pop last two from stack and compute
int second = numbers.pop();
int first = numbers.pop();
// evaluate based on operator
if (input[i].equals("+")) {
result = first + second;
} else if (input[i].equals("-")) {
result = first - second;
} else {
result = first * second;
}
numbers.push(result);
}
}
// print results
System.out.println(result);
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
20,
41,
13,
4,
18,
4,
18,
13,
17,
41,
13,
41,
13,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
30,
35,
18,
13,
13,
34,
17,
1,
0,
13,
4,
18,
13,
0,
13,
4,
18,
13,
4,
18,
13,
2,
13,
13,
3,
34,
17,
1,
0,
13,
4,
18,
13,
0,
13,
4,
18,
13,
4,
18,
13,
2,
13,
13,
3,
34,
17,
1,
0,
13,
4,
18,
13,
0,
13,
4,
18,
13,
4,
18,
13,
2,
13,
13,
3,
34,
1,
4,
18,
13,
4,
18,
13,
18,
13,
13,
3,
4,
18,
18,
13,
13,
4,
18,
13,
23,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
10,
11
],
[
10,
12
],
[
0,
13
],
[
13,
14
],
[
13,
15
],
[
15,
16
],
[
15,
17
],
[
17,
18
],
[
18,
19
],
[
18,
20
],
[
17,
21
],
[
21,
22
],
[
21,
23
],
[
17,
24
],
[
24,
25
],
[
24,
26
],
[
26,
27
],
[
27,
28
],
[
28,
29
],
[
29,
30
],
[
26,
31
],
[
17,
32
],
[
32,
33
],
[
17,
34
],
[
34,
35
],
[
17,
36
],
[
36,
37
],
[
37,
38
],
[
38,
39
],
[
38,
40
],
[
36,
41
],
[
41,
42
],
[
41,
43
],
[
43,
44
],
[
43,
45
],
[
36,
46
],
[
46,
47
],
[
47,
48
],
[
36,
49
],
[
50,
50
],
[
50,
51
],
[
51,
52
],
[
52,
53
],
[
52,
54
],
[
51,
55
],
[
55,
56
],
[
55,
57
],
[
57,
58
],
[
58,
59
],
[
58,
60
],
[
60,
61
],
[
61,
62
],
[
57,
63
],
[
63,
64
],
[
63,
65
],
[
65,
66
],
[
66,
67
],
[
57,
68
],
[
68,
69
],
[
69,
70
],
[
68,
71
],
[
71,
72
],
[
71,
73
],
[
57,
74
],
[
51,
75
],
[
75,
76
],
[
75,
77
],
[
77,
78
],
[
78,
79
],
[
78,
80
],
[
80,
81
],
[
81,
82
],
[
77,
83
],
[
83,
84
],
[
83,
85
],
[
85,
86
],
[
86,
87
],
[
77,
88
],
[
88,
89
],
[
89,
90
],
[
88,
91
],
[
91,
92
],
[
91,
93
],
[
77,
94
],
[
51,
95
],
[
95,
96
],
[
95,
97
],
[
97,
98
],
[
98,
99
],
[
98,
100
],
[
100,
101
],
[
101,
102
],
[
97,
103
],
[
103,
104
],
[
103,
105
],
[
105,
106
],
[
106,
107
],
[
97,
108
],
[
108,
109
],
[
109,
110
],
[
108,
111
],
[
111,
112
],
[
111,
113
],
[
97,
114
],
[
51,
115
],
[
115,
116
],
[
116,
117
],
[
117,
118
],
[
118,
119
],
[
117,
120
],
[
120,
121
],
[
121,
122
],
[
120,
123
],
[
123,
124
],
[
123,
125
],
[
116,
126
],
[
17,
127
],
[
127,
128
],
[
128,
129
],
[
129,
130
],
[
129,
131
],
[
127,
132
],
[
132,
133
],
[
133,
134
],
[
15,
135
],
[
135,
136
]
] | [
"import java.util.Scanner;\nimport java.util.Arrays;\nimport java.util.Deque;\nimport java.util.ArrayDeque;\n\nclass Main{\n\tpublic static void main(String[] args)throws Exception{\n\t\tScanner scanner = new Scanner(System.in);\n\t\tDeque<Integer> stack = new ArrayDeque<>();\n\t\tString[] line = scanner.nextLine().split(\" \");\n\t\tint a,b;\n\n\t\tfor(int i = 0; i < line.length; i++){\n\t\t\tswitch(line[i]){\n\t\t\t\tcase \"+\":\n\t\t\t\t\ta = stack.pollLast();\n\t\t\t\t\tb = stack.pollLast();\n\t\t\t\t\tstack.offer(b + a);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase \"-\":\n\t\t\t\t\ta = stack.pollLast();\n\t\t\t\t\tb = stack.pollLast();\n\t\t\t\t\tstack.offer(b - a);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase \"*\":\n\t\t\t\t\ta = stack.pollLast();\n\t\t\t\t\tb = stack.pollLast();\n\t\t\t\t\tstack.offer(b * a);\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault :\n\t\t\t\t\tstack.offer(Integer.parseInt(line[i]));\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.println(stack.poll());\n\t}\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"import java.util.Arrays;",
"Arrays",
"java.util",
"import java.util.Deque;",
"Deque",
"java.util",
"import java.util.ArrayDeque;",
"ArrayDeque",
"java.util",
"class Main{\n\tpublic static void main(String[] args)throws Exception{\n\t\tScanner scanner = new Scanner(System.in);\n\t\tDeque<Integer> stack = new ArrayDeque<>();\n\t\tString[] line = scanner.nextLine().split(\" \");\n\t\tint a,b;\n\n\t\tfor(int i = 0; i < line.length; i++){\n\t\t\tswitch(line[i]){\n\t\t\t\tcase \"+\":\n\t\t\t\t\ta = stack.pollLast();\n\t\t\t\t\tb = stack.pollLast();\n\t\t\t\t\tstack.offer(b + a);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase \"-\":\n\t\t\t\t\ta = stack.pollLast();\n\t\t\t\t\tb = stack.pollLast();\n\t\t\t\t\tstack.offer(b - a);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase \"*\":\n\t\t\t\t\ta = stack.pollLast();\n\t\t\t\t\tb = stack.pollLast();\n\t\t\t\t\tstack.offer(b * a);\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault :\n\t\t\t\t\tstack.offer(Integer.parseInt(line[i]));\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.println(stack.poll());\n\t}\n}",
"Main",
"public static void main(String[] args)throws Exception{\n\t\tScanner scanner = new Scanner(System.in);\n\t\tDeque<Integer> stack = new ArrayDeque<>();\n\t\tString[] line = scanner.nextLine().split(\" \");\n\t\tint a,b;\n\n\t\tfor(int i = 0; i < line.length; i++){\n\t\t\tswitch(line[i]){\n\t\t\t\tcase \"+\":\n\t\t\t\t\ta = stack.pollLast();\n\t\t\t\t\tb = stack.pollLast();\n\t\t\t\t\tstack.offer(b + a);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase \"-\":\n\t\t\t\t\ta = stack.pollLast();\n\t\t\t\t\tb = stack.pollLast();\n\t\t\t\t\tstack.offer(b - a);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase \"*\":\n\t\t\t\t\ta = stack.pollLast();\n\t\t\t\t\tb = stack.pollLast();\n\t\t\t\t\tstack.offer(b * a);\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault :\n\t\t\t\t\tstack.offer(Integer.parseInt(line[i]));\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.println(stack.poll());\n\t}",
"main",
"{\n\t\tScanner scanner = new Scanner(System.in);\n\t\tDeque<Integer> stack = new ArrayDeque<>();\n\t\tString[] line = scanner.nextLine().split(\" \");\n\t\tint a,b;\n\n\t\tfor(int i = 0; i < line.length; i++){\n\t\t\tswitch(line[i]){\n\t\t\t\tcase \"+\":\n\t\t\t\t\ta = stack.pollLast();\n\t\t\t\t\tb = stack.pollLast();\n\t\t\t\t\tstack.offer(b + a);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase \"-\":\n\t\t\t\t\ta = stack.pollLast();\n\t\t\t\t\tb = stack.pollLast();\n\t\t\t\t\tstack.offer(b - a);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase \"*\":\n\t\t\t\t\ta = stack.pollLast();\n\t\t\t\t\tb = stack.pollLast();\n\t\t\t\t\tstack.offer(b * a);\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault :\n\t\t\t\t\tstack.offer(Integer.parseInt(line[i]));\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.println(stack.poll());\n\t}",
"Scanner scanner = new Scanner(System.in);",
"scanner",
"new Scanner(System.in)",
"Deque<Integer> stack = new ArrayDeque<>();",
"stack",
"new ArrayDeque<>()",
"String[] line = scanner.nextLine().split(\" \");",
"line",
"scanner.nextLine().split(\" \")",
"scanner.nextLine().split",
"scanner.nextLine()",
"scanner.nextLine",
"scanner",
"\" \"",
"int a",
"a",
"b;",
"b",
"for(int i = 0; i < line.length; i++){\n\t\t\tswitch(line[i]){\n\t\t\t\tcase \"+\":\n\t\t\t\t\ta = stack.pollLast();\n\t\t\t\t\tb = stack.pollLast();\n\t\t\t\t\tstack.offer(b + a);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase \"-\":\n\t\t\t\t\ta = stack.pollLast();\n\t\t\t\t\tb = stack.pollLast();\n\t\t\t\t\tstack.offer(b - a);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase \"*\":\n\t\t\t\t\ta = stack.pollLast();\n\t\t\t\t\tb = stack.pollLast();\n\t\t\t\t\tstack.offer(b * a);\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault :\n\t\t\t\t\tstack.offer(Integer.parseInt(line[i]));\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < line.length",
"i",
"line.length",
"line",
"line.length",
"i++",
"i++",
"i",
"{\n\t\t\tswitch(line[i]){\n\t\t\t\tcase \"+\":\n\t\t\t\t\ta = stack.pollLast();\n\t\t\t\t\tb = stack.pollLast();\n\t\t\t\t\tstack.offer(b + a);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase \"-\":\n\t\t\t\t\ta = stack.pollLast();\n\t\t\t\t\tb = stack.pollLast();\n\t\t\t\t\tstack.offer(b - a);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase \"*\":\n\t\t\t\t\ta = stack.pollLast();\n\t\t\t\t\tb = stack.pollLast();\n\t\t\t\t\tstack.offer(b * a);\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault :\n\t\t\t\t\tstack.offer(Integer.parseInt(line[i]));\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}",
"{\n\t\t\tswitch(line[i]){\n\t\t\t\tcase \"+\":\n\t\t\t\t\ta = stack.pollLast();\n\t\t\t\t\tb = stack.pollLast();\n\t\t\t\t\tstack.offer(b + a);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase \"-\":\n\t\t\t\t\ta = stack.pollLast();\n\t\t\t\t\tb = stack.pollLast();\n\t\t\t\t\tstack.offer(b - a);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase \"*\":\n\t\t\t\t\ta = stack.pollLast();\n\t\t\t\t\tb = stack.pollLast();\n\t\t\t\t\tstack.offer(b * a);\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault :\n\t\t\t\t\tstack.offer(Integer.parseInt(line[i]));\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}",
"switch(line[i]){\n\t\t\t\tcase \"+\":\n\t\t\t\t\ta = stack.pollLast();\n\t\t\t\t\tb = stack.pollLast();\n\t\t\t\t\tstack.offer(b + a);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase \"-\":\n\t\t\t\t\ta = stack.pollLast();\n\t\t\t\t\tb = stack.pollLast();\n\t\t\t\t\tstack.offer(b - a);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase \"*\":\n\t\t\t\t\ta = stack.pollLast();\n\t\t\t\t\tb = stack.pollLast();\n\t\t\t\t\tstack.offer(b * a);\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault :\n\t\t\t\t\tstack.offer(Integer.parseInt(line[i]));\n\t\t\t\t\tbreak;\n\t\t\t}",
"line[i]",
"line",
"i",
"case \"+\":",
"\"+\"",
"case \"+\":",
"a = stack.pollLast()",
"a",
"stack.pollLast()",
"stack.pollLast",
"stack",
"b = stack.pollLast()",
"b",
"stack.pollLast()",
"stack.pollLast",
"stack",
"stack.offer(b + a)",
"stack.offer",
"stack",
"b + a",
"b",
"a",
"break;",
"case \"-\":",
"\"-\"",
"case \"-\":",
"a = stack.pollLast()",
"a",
"stack.pollLast()",
"stack.pollLast",
"stack",
"b = stack.pollLast()",
"b",
"stack.pollLast()",
"stack.pollLast",
"stack",
"stack.offer(b - a)",
"stack.offer",
"stack",
"b - a",
"b",
"a",
"break;",
"case \"*\":",
"\"*\"",
"case \"*\":",
"a = stack.pollLast()",
"a",
"stack.pollLast()",
"stack.pollLast",
"stack",
"b = stack.pollLast()",
"b",
"stack.pollLast()",
"stack.pollLast",
"stack",
"stack.offer(b * a)",
"stack.offer",
"stack",
"b * a",
"b",
"a",
"break;",
"default :",
"default :",
"stack.offer(Integer.parseInt(line[i]))",
"stack.offer",
"stack",
"Integer.parseInt(line[i])",
"Integer.parseInt",
"Integer",
"line[i]",
"line",
"i",
"break;",
"System.out.println(stack.poll())",
"System.out.println",
"System.out",
"System",
"System.out",
"stack.poll()",
"stack.poll",
"stack",
"String[] args",
"args"
] | import java.util.Scanner;
import java.util.Arrays;
import java.util.Deque;
import java.util.ArrayDeque;
class Main{
public static void main(String[] args)throws Exception{
Scanner scanner = new Scanner(System.in);
Deque<Integer> stack = new ArrayDeque<>();
String[] line = scanner.nextLine().split(" ");
int a,b;
for(int i = 0; i < line.length; i++){
switch(line[i]){
case "+":
a = stack.pollLast();
b = stack.pollLast();
stack.offer(b + a);
break;
case "-":
a = stack.pollLast();
b = stack.pollLast();
stack.offer(b - a);
break;
case "*":
a = stack.pollLast();
b = stack.pollLast();
stack.offer(b * a);
break;
default :
stack.offer(Integer.parseInt(line[i]));
break;
}
}
System.out.println(stack.poll());
}
} |
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
41,
13,
41,
13,
41,
13,
41,
13,
4,
18,
13,
17,
41,
13,
20,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
30,
14,
2,
2,
4,
18,
18,
13,
13,
17,
4,
18,
18,
13,
13,
17,
4,
18,
18,
13,
13,
17,
30,
0,
13,
4,
18,
13,
0,
13,
4,
18,
13,
0,
13,
4,
18,
13,
13,
0,
13,
4,
18,
13,
13,
14,
4,
18,
18,
13,
13,
17,
30,
0,
13,
2,
13,
13,
4,
18,
13,
4,
18,
13,
13,
14,
4,
18,
18,
13,
13,
17,
30,
0,
13,
2,
13,
13,
4,
18,
13,
4,
18,
13,
13,
14,
4,
18,
18,
13,
13,
17,
30,
0,
13,
2,
13,
13,
4,
18,
13,
4,
18,
13,
13,
30,
4,
18,
13,
18,
13,
13,
4,
18,
18,
13,
13,
4,
18,
13,
4,
18,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
177,
8
],
[
177,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
12,
14
],
[
11,
15
],
[
15,
16
],
[
15,
17
],
[
17,
18
],
[
18,
19
],
[
11,
20
],
[
20,
21
],
[
11,
22
],
[
22,
23
],
[
11,
24
],
[
24,
25
],
[
11,
26
],
[
26,
27
],
[
11,
28
],
[
28,
29
],
[
28,
30
],
[
30,
31
],
[
31,
32
],
[
30,
33
],
[
11,
34
],
[
34,
35
],
[
34,
36
],
[
11,
37
],
[
37,
38
],
[
38,
39
],
[
39,
40
],
[
39,
41
],
[
37,
42
],
[
42,
43
],
[
42,
44
],
[
44,
45
],
[
44,
46
],
[
37,
47
],
[
47,
48
],
[
48,
49
],
[
37,
50
],
[
51,
51
],
[
51,
52
],
[
52,
53
],
[
54,
54
],
[
54,
55
],
[
55,
56
],
[
56,
57
],
[
57,
58
],
[
57,
59
],
[
55,
60
],
[
54,
61
],
[
61,
62
],
[
62,
63
],
[
63,
64
],
[
63,
65
],
[
61,
66
],
[
54,
67
],
[
67,
68
],
[
68,
69
],
[
69,
70
],
[
69,
71
],
[
67,
72
],
[
52,
73
],
[
73,
74
],
[
74,
75
],
[
74,
76
],
[
76,
77
],
[
77,
78
],
[
73,
79
],
[
79,
80
],
[
79,
81
],
[
81,
82
],
[
82,
83
],
[
73,
84
],
[
84,
85
],
[
84,
86
],
[
86,
87
],
[
87,
88
],
[
86,
89
],
[
73,
90
],
[
90,
91
],
[
90,
92
],
[
92,
93
],
[
93,
94
],
[
92,
95
],
[
73,
96
],
[
96,
97
],
[
97,
98
],
[
98,
99
],
[
99,
100
],
[
99,
101
],
[
97,
102
],
[
96,
103
],
[
103,
104
],
[
104,
105
],
[
104,
106
],
[
106,
107
],
[
106,
108
],
[
103,
109
],
[
109,
110
],
[
110,
111
],
[
109,
112
],
[
112,
113
],
[
113,
114
],
[
112,
115
],
[
96,
116
],
[
116,
117
],
[
117,
118
],
[
118,
119
],
[
119,
120
],
[
119,
121
],
[
117,
122
],
[
116,
123
],
[
123,
124
],
[
124,
125
],
[
124,
126
],
[
126,
127
],
[
126,
128
],
[
123,
129
],
[
129,
130
],
[
130,
131
],
[
129,
132
],
[
132,
133
],
[
133,
134
],
[
132,
135
],
[
116,
136
],
[
136,
137
],
[
137,
138
],
[
138,
139
],
[
139,
140
],
[
139,
141
],
[
137,
142
],
[
136,
143
],
[
143,
144
],
[
144,
145
],
[
144,
146
],
[
146,
147
],
[
146,
148
],
[
143,
149
],
[
149,
150
],
[
150,
151
],
[
149,
152
],
[
152,
153
],
[
153,
154
],
[
152,
155
],
[
52,
156
],
[
156,
157
],
[
157,
158
],
[
158,
159
],
[
157,
160
],
[
160,
161
],
[
160,
162
],
[
11,
163
],
[
163,
164
],
[
164,
165
],
[
165,
166
],
[
165,
167
],
[
163,
168
],
[
168,
169
],
[
169,
170
],
[
11,
171
],
[
171,
172
],
[
172,
173
],
[
9,
174
],
[
174,
175
],
[
0,
176
],
[
176,
177
],
[
176,
178
]
] | [
"import java.util.Scanner;\nimport java.util.Stack;\n\npublic class Main {\n\n\t\n\tpublic static void main(String argv[]) {\n\n Scanner in = new Scanner(System.in);\n String str = in.nextLine();\n String num1,num2;\n int n1,n2;\n String[] tokens = str.split(\" \");\n \n Stack<String> stack = new Stack<>();\n for(int i=0; i<tokens.length; i++)\n {\n \tif(tokens[i].equals(\"+\") || tokens[i].equals(\"-\") || tokens[i].equals(\"*\"))\n \t{\n \t\tnum2 = stack.pop();\n \t\tnum1 = stack.pop();\n \t\tn1 = Integer.parseInt(num1);\n \t\tn2 = Integer.parseInt(num2);\n \t\tif(tokens[i].equals(\"+\")) \n \t\t{\n \t\t\tn1 = n1 + n2;\n \t\t\tstack.push(Integer.toString(n1));\n \t\t}\n \t\telse if(tokens[i].equals(\"-\"))\n \t\t{\n \t\t\tn1 = n1 - n2;\n \t\t\tstack.push(Integer.toString(n1));\n \t\t}\n \t\telse if(tokens[i].equals(\"*\"))\n \t\t{\n \t\t\tn1 = n1 * n2;\n \t\t\tstack.push(Integer.toString(n1));\n \t\t}\n \t}\n \telse\n \t{\n \t\tstack.push(tokens[i]);\n \t} \t\t\n }\n \n System.out.println(stack.pop());\n in.close();\n }\n}\n",
"import java.util.Scanner;",
"Scanner",
"java.util",
"import java.util.Stack;",
"Stack",
"java.util",
"public class Main {\n\n\t\n\tpublic static void main(String argv[]) {\n\n Scanner in = new Scanner(System.in);\n String str = in.nextLine();\n String num1,num2;\n int n1,n2;\n String[] tokens = str.split(\" \");\n \n Stack<String> stack = new Stack<>();\n for(int i=0; i<tokens.length; i++)\n {\n \tif(tokens[i].equals(\"+\") || tokens[i].equals(\"-\") || tokens[i].equals(\"*\"))\n \t{\n \t\tnum2 = stack.pop();\n \t\tnum1 = stack.pop();\n \t\tn1 = Integer.parseInt(num1);\n \t\tn2 = Integer.parseInt(num2);\n \t\tif(tokens[i].equals(\"+\")) \n \t\t{\n \t\t\tn1 = n1 + n2;\n \t\t\tstack.push(Integer.toString(n1));\n \t\t}\n \t\telse if(tokens[i].equals(\"-\"))\n \t\t{\n \t\t\tn1 = n1 - n2;\n \t\t\tstack.push(Integer.toString(n1));\n \t\t}\n \t\telse if(tokens[i].equals(\"*\"))\n \t\t{\n \t\t\tn1 = n1 * n2;\n \t\t\tstack.push(Integer.toString(n1));\n \t\t}\n \t}\n \telse\n \t{\n \t\tstack.push(tokens[i]);\n \t} \t\t\n }\n \n System.out.println(stack.pop());\n in.close();\n }\n}",
"Main",
"public static void main(String argv[]) {\n\n Scanner in = new Scanner(System.in);\n String str = in.nextLine();\n String num1,num2;\n int n1,n2;\n String[] tokens = str.split(\" \");\n \n Stack<String> stack = new Stack<>();\n for(int i=0; i<tokens.length; i++)\n {\n \tif(tokens[i].equals(\"+\") || tokens[i].equals(\"-\") || tokens[i].equals(\"*\"))\n \t{\n \t\tnum2 = stack.pop();\n \t\tnum1 = stack.pop();\n \t\tn1 = Integer.parseInt(num1);\n \t\tn2 = Integer.parseInt(num2);\n \t\tif(tokens[i].equals(\"+\")) \n \t\t{\n \t\t\tn1 = n1 + n2;\n \t\t\tstack.push(Integer.toString(n1));\n \t\t}\n \t\telse if(tokens[i].equals(\"-\"))\n \t\t{\n \t\t\tn1 = n1 - n2;\n \t\t\tstack.push(Integer.toString(n1));\n \t\t}\n \t\telse if(tokens[i].equals(\"*\"))\n \t\t{\n \t\t\tn1 = n1 * n2;\n \t\t\tstack.push(Integer.toString(n1));\n \t\t}\n \t}\n \telse\n \t{\n \t\tstack.push(tokens[i]);\n \t} \t\t\n }\n \n System.out.println(stack.pop());\n in.close();\n }",
"main",
"{\n\n Scanner in = new Scanner(System.in);\n String str = in.nextLine();\n String num1,num2;\n int n1,n2;\n String[] tokens = str.split(\" \");\n \n Stack<String> stack = new Stack<>();\n for(int i=0; i<tokens.length; i++)\n {\n \tif(tokens[i].equals(\"+\") || tokens[i].equals(\"-\") || tokens[i].equals(\"*\"))\n \t{\n \t\tnum2 = stack.pop();\n \t\tnum1 = stack.pop();\n \t\tn1 = Integer.parseInt(num1);\n \t\tn2 = Integer.parseInt(num2);\n \t\tif(tokens[i].equals(\"+\")) \n \t\t{\n \t\t\tn1 = n1 + n2;\n \t\t\tstack.push(Integer.toString(n1));\n \t\t}\n \t\telse if(tokens[i].equals(\"-\"))\n \t\t{\n \t\t\tn1 = n1 - n2;\n \t\t\tstack.push(Integer.toString(n1));\n \t\t}\n \t\telse if(tokens[i].equals(\"*\"))\n \t\t{\n \t\t\tn1 = n1 * n2;\n \t\t\tstack.push(Integer.toString(n1));\n \t\t}\n \t}\n \telse\n \t{\n \t\tstack.push(tokens[i]);\n \t} \t\t\n }\n \n System.out.println(stack.pop());\n in.close();\n }",
"Scanner in = new Scanner(System.in);",
"in",
"new Scanner(System.in)",
"String str = in.nextLine();",
"str",
"in.nextLine()",
"in.nextLine",
"in",
"String num1",
"num1",
"num2;",
"num2",
"int n1",
"n1",
"n2;",
"n2",
"String[] tokens = str.split(\" \");",
"tokens",
"str.split(\" \")",
"str.split",
"str",
"\" \"",
"Stack<String> stack = new Stack<>();",
"stack",
"new Stack<>()",
"for(int i=0; i<tokens.length; i++)\n {\n \tif(tokens[i].equals(\"+\") || tokens[i].equals(\"-\") || tokens[i].equals(\"*\"))\n \t{\n \t\tnum2 = stack.pop();\n \t\tnum1 = stack.pop();\n \t\tn1 = Integer.parseInt(num1);\n \t\tn2 = Integer.parseInt(num2);\n \t\tif(tokens[i].equals(\"+\")) \n \t\t{\n \t\t\tn1 = n1 + n2;\n \t\t\tstack.push(Integer.toString(n1));\n \t\t}\n \t\telse if(tokens[i].equals(\"-\"))\n \t\t{\n \t\t\tn1 = n1 - n2;\n \t\t\tstack.push(Integer.toString(n1));\n \t\t}\n \t\telse if(tokens[i].equals(\"*\"))\n \t\t{\n \t\t\tn1 = n1 * n2;\n \t\t\tstack.push(Integer.toString(n1));\n \t\t}\n \t}\n \telse\n \t{\n \t\tstack.push(tokens[i]);\n \t} \t\t\n }",
"int i=0;",
"int i=0;",
"i",
"0",
"i<tokens.length",
"i",
"tokens.length",
"tokens",
"tokens.length",
"i++",
"i++",
"i",
"{\n \tif(tokens[i].equals(\"+\") || tokens[i].equals(\"-\") || tokens[i].equals(\"*\"))\n \t{\n \t\tnum2 = stack.pop();\n \t\tnum1 = stack.pop();\n \t\tn1 = Integer.parseInt(num1);\n \t\tn2 = Integer.parseInt(num2);\n \t\tif(tokens[i].equals(\"+\")) \n \t\t{\n \t\t\tn1 = n1 + n2;\n \t\t\tstack.push(Integer.toString(n1));\n \t\t}\n \t\telse if(tokens[i].equals(\"-\"))\n \t\t{\n \t\t\tn1 = n1 - n2;\n \t\t\tstack.push(Integer.toString(n1));\n \t\t}\n \t\telse if(tokens[i].equals(\"*\"))\n \t\t{\n \t\t\tn1 = n1 * n2;\n \t\t\tstack.push(Integer.toString(n1));\n \t\t}\n \t}\n \telse\n \t{\n \t\tstack.push(tokens[i]);\n \t} \t\t\n }",
"{\n \tif(tokens[i].equals(\"+\") || tokens[i].equals(\"-\") || tokens[i].equals(\"*\"))\n \t{\n \t\tnum2 = stack.pop();\n \t\tnum1 = stack.pop();\n \t\tn1 = Integer.parseInt(num1);\n \t\tn2 = Integer.parseInt(num2);\n \t\tif(tokens[i].equals(\"+\")) \n \t\t{\n \t\t\tn1 = n1 + n2;\n \t\t\tstack.push(Integer.toString(n1));\n \t\t}\n \t\telse if(tokens[i].equals(\"-\"))\n \t\t{\n \t\t\tn1 = n1 - n2;\n \t\t\tstack.push(Integer.toString(n1));\n \t\t}\n \t\telse if(tokens[i].equals(\"*\"))\n \t\t{\n \t\t\tn1 = n1 * n2;\n \t\t\tstack.push(Integer.toString(n1));\n \t\t}\n \t}\n \telse\n \t{\n \t\tstack.push(tokens[i]);\n \t} \t\t\n }",
"if(tokens[i].equals(\"+\") || tokens[i].equals(\"-\") || tokens[i].equals(\"*\"))\n \t{\n \t\tnum2 = stack.pop();\n \t\tnum1 = stack.pop();\n \t\tn1 = Integer.parseInt(num1);\n \t\tn2 = Integer.parseInt(num2);\n \t\tif(tokens[i].equals(\"+\")) \n \t\t{\n \t\t\tn1 = n1 + n2;\n \t\t\tstack.push(Integer.toString(n1));\n \t\t}\n \t\telse if(tokens[i].equals(\"-\"))\n \t\t{\n \t\t\tn1 = n1 - n2;\n \t\t\tstack.push(Integer.toString(n1));\n \t\t}\n \t\telse if(tokens[i].equals(\"*\"))\n \t\t{\n \t\t\tn1 = n1 * n2;\n \t\t\tstack.push(Integer.toString(n1));\n \t\t}\n \t}\n \telse\n \t{\n \t\tstack.push(tokens[i]);\n \t}",
"tokens[i].equals(\"+\") || tokens[i].equals(\"-\") || tokens[i].equals(\"*\")",
"tokens[i].equals(\"+\") || tokens[i].equals(\"-\") || tokens[i].equals(\"*\")",
"tokens[i].equals(\"+\")",
"tokens[i].equals",
"tokens[i]",
"tokens",
"i",
"\"+\"",
"tokens[i].equals(\"-\")",
"tokens[i].equals",
"tokens[i]",
"tokens",
"i",
"\"-\"",
"tokens[i].equals(\"*\")",
"tokens[i].equals",
"tokens[i]",
"tokens",
"i",
"\"*\"",
"{\n \t\tnum2 = stack.pop();\n \t\tnum1 = stack.pop();\n \t\tn1 = Integer.parseInt(num1);\n \t\tn2 = Integer.parseInt(num2);\n \t\tif(tokens[i].equals(\"+\")) \n \t\t{\n \t\t\tn1 = n1 + n2;\n \t\t\tstack.push(Integer.toString(n1));\n \t\t}\n \t\telse if(tokens[i].equals(\"-\"))\n \t\t{\n \t\t\tn1 = n1 - n2;\n \t\t\tstack.push(Integer.toString(n1));\n \t\t}\n \t\telse if(tokens[i].equals(\"*\"))\n \t\t{\n \t\t\tn1 = n1 * n2;\n \t\t\tstack.push(Integer.toString(n1));\n \t\t}\n \t}",
"num2 = stack.pop()",
"num2",
"stack.pop()",
"stack.pop",
"stack",
"num1 = stack.pop()",
"num1",
"stack.pop()",
"stack.pop",
"stack",
"n1 = Integer.parseInt(num1)",
"n1",
"Integer.parseInt(num1)",
"Integer.parseInt",
"Integer",
"num1",
"n2 = Integer.parseInt(num2)",
"n2",
"Integer.parseInt(num2)",
"Integer.parseInt",
"Integer",
"num2",
"if(tokens[i].equals(\"+\")) \n \t\t{\n \t\t\tn1 = n1 + n2;\n \t\t\tstack.push(Integer.toString(n1));\n \t\t}\n \t\telse if(tokens[i].equals(\"-\"))\n \t\t{\n \t\t\tn1 = n1 - n2;\n \t\t\tstack.push(Integer.toString(n1));\n \t\t}\n \t\telse if(tokens[i].equals(\"*\"))\n \t\t{\n \t\t\tn1 = n1 * n2;\n \t\t\tstack.push(Integer.toString(n1));\n \t\t}",
"tokens[i].equals(\"+\")",
"tokens[i].equals",
"tokens[i]",
"tokens",
"i",
"\"+\"",
"{\n \t\t\tn1 = n1 + n2;\n \t\t\tstack.push(Integer.toString(n1));\n \t\t}",
"n1 = n1 + n2",
"n1",
"n1 + n2",
"n1",
"n2",
"stack.push(Integer.toString(n1))",
"stack.push",
"stack",
"Integer.toString(n1)",
"Integer.toString",
"Integer",
"n1",
"if(tokens[i].equals(\"-\"))\n \t\t{\n \t\t\tn1 = n1 - n2;\n \t\t\tstack.push(Integer.toString(n1));\n \t\t}\n \t\telse if(tokens[i].equals(\"*\"))\n \t\t{\n \t\t\tn1 = n1 * n2;\n \t\t\tstack.push(Integer.toString(n1));\n \t\t}",
"tokens[i].equals(\"-\")",
"tokens[i].equals",
"tokens[i]",
"tokens",
"i",
"\"-\"",
"{\n \t\t\tn1 = n1 - n2;\n \t\t\tstack.push(Integer.toString(n1));\n \t\t}",
"n1 = n1 - n2",
"n1",
"n1 - n2",
"n1",
"n2",
"stack.push(Integer.toString(n1))",
"stack.push",
"stack",
"Integer.toString(n1)",
"Integer.toString",
"Integer",
"n1",
"if(tokens[i].equals(\"*\"))\n \t\t{\n \t\t\tn1 = n1 * n2;\n \t\t\tstack.push(Integer.toString(n1));\n \t\t}",
"tokens[i].equals(\"*\")",
"tokens[i].equals",
"tokens[i]",
"tokens",
"i",
"\"*\"",
"{\n \t\t\tn1 = n1 * n2;\n \t\t\tstack.push(Integer.toString(n1));\n \t\t}",
"n1 = n1 * n2",
"n1",
"n1 * n2",
"n1",
"n2",
"stack.push(Integer.toString(n1))",
"stack.push",
"stack",
"Integer.toString(n1)",
"Integer.toString",
"Integer",
"n1",
"{\n \t\tstack.push(tokens[i]);\n \t}",
"stack.push(tokens[i])",
"stack.push",
"stack",
"tokens[i]",
"tokens",
"i",
"System.out.println(stack.pop())",
"System.out.println",
"System.out",
"System",
"System.out",
"stack.pop()",
"stack.pop",
"stack",
"in.close()",
"in.close",
"in",
"String argv[]",
"argv",
"public class Main {\n\n\t\n\tpublic static void main(String argv[]) {\n\n Scanner in = new Scanner(System.in);\n String str = in.nextLine();\n String num1,num2;\n int n1,n2;\n String[] tokens = str.split(\" \");\n \n Stack<String> stack = new Stack<>();\n for(int i=0; i<tokens.length; i++)\n {\n \tif(tokens[i].equals(\"+\") || tokens[i].equals(\"-\") || tokens[i].equals(\"*\"))\n \t{\n \t\tnum2 = stack.pop();\n \t\tnum1 = stack.pop();\n \t\tn1 = Integer.parseInt(num1);\n \t\tn2 = Integer.parseInt(num2);\n \t\tif(tokens[i].equals(\"+\")) \n \t\t{\n \t\t\tn1 = n1 + n2;\n \t\t\tstack.push(Integer.toString(n1));\n \t\t}\n \t\telse if(tokens[i].equals(\"-\"))\n \t\t{\n \t\t\tn1 = n1 - n2;\n \t\t\tstack.push(Integer.toString(n1));\n \t\t}\n \t\telse if(tokens[i].equals(\"*\"))\n \t\t{\n \t\t\tn1 = n1 * n2;\n \t\t\tstack.push(Integer.toString(n1));\n \t\t}\n \t}\n \telse\n \t{\n \t\tstack.push(tokens[i]);\n \t} \t\t\n }\n \n System.out.println(stack.pop());\n in.close();\n }\n}",
"public class Main {\n\n\t\n\tpublic static void main(String argv[]) {\n\n Scanner in = new Scanner(System.in);\n String str = in.nextLine();\n String num1,num2;\n int n1,n2;\n String[] tokens = str.split(\" \");\n \n Stack<String> stack = new Stack<>();\n for(int i=0; i<tokens.length; i++)\n {\n \tif(tokens[i].equals(\"+\") || tokens[i].equals(\"-\") || tokens[i].equals(\"*\"))\n \t{\n \t\tnum2 = stack.pop();\n \t\tnum1 = stack.pop();\n \t\tn1 = Integer.parseInt(num1);\n \t\tn2 = Integer.parseInt(num2);\n \t\tif(tokens[i].equals(\"+\")) \n \t\t{\n \t\t\tn1 = n1 + n2;\n \t\t\tstack.push(Integer.toString(n1));\n \t\t}\n \t\telse if(tokens[i].equals(\"-\"))\n \t\t{\n \t\t\tn1 = n1 - n2;\n \t\t\tstack.push(Integer.toString(n1));\n \t\t}\n \t\telse if(tokens[i].equals(\"*\"))\n \t\t{\n \t\t\tn1 = n1 * n2;\n \t\t\tstack.push(Integer.toString(n1));\n \t\t}\n \t}\n \telse\n \t{\n \t\tstack.push(tokens[i]);\n \t} \t\t\n }\n \n System.out.println(stack.pop());\n in.close();\n }\n}",
"Main"
] | import java.util.Scanner;
import java.util.Stack;
public class Main {
public static void main(String argv[]) {
Scanner in = new Scanner(System.in);
String str = in.nextLine();
String num1,num2;
int n1,n2;
String[] tokens = str.split(" ");
Stack<String> stack = new Stack<>();
for(int i=0; i<tokens.length; i++)
{
if(tokens[i].equals("+") || tokens[i].equals("-") || tokens[i].equals("*"))
{
num2 = stack.pop();
num1 = stack.pop();
n1 = Integer.parseInt(num1);
n2 = Integer.parseInt(num2);
if(tokens[i].equals("+"))
{
n1 = n1 + n2;
stack.push(Integer.toString(n1));
}
else if(tokens[i].equals("-"))
{
n1 = n1 - n2;
stack.push(Integer.toString(n1));
}
else if(tokens[i].equals("*"))
{
n1 = n1 * n2;
stack.push(Integer.toString(n1));
}
}
else
{
stack.push(tokens[i]);
}
}
System.out.println(stack.pop());
in.close();
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
41,
13,
41,
13,
41,
13,
12,
13,
30,
4,
18,
20,
23,
13,
12,
13,
30,
0,
13,
20,
0,
13,
20,
42,
4,
18,
13,
30,
0,
13,
4,
18,
13,
35,
13,
34,
17,
1,
34,
17,
1,
34,
17,
1,
4,
18,
13,
4,
18,
4,
13,
4,
18,
13,
4,
18,
13,
4,
18,
13,
4,
18,
13,
13,
3,
34,
1,
4,
18,
13,
13,
4,
18,
18,
13,
13,
4,
18,
13,
4,
18,
13,
12,
13,
30,
35,
13,
34,
17,
1,
29,
2,
13,
13,
34,
17,
1,
29,
2,
13,
13,
34,
17,
1,
29,
2,
13,
13,
29,
17,
23,
13,
23,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
129,
11
],
[
129,
12
],
[
12,
13
],
[
129,
14
],
[
14,
15
],
[
129,
16
],
[
16,
17
],
[
129,
18
],
[
18,
19
],
[
18,
20
],
[
20,
21
],
[
21,
22
],
[
22,
23
],
[
18,
24
],
[
24,
25
],
[
129,
26
],
[
26,
27
],
[
26,
28
],
[
28,
29
],
[
29,
30
],
[
29,
31
],
[
28,
32
],
[
32,
33
],
[
32,
34
],
[
28,
35
],
[
35,
36
],
[
36,
37
],
[
37,
38
],
[
35,
39
],
[
39,
40
],
[
40,
41
],
[
40,
42
],
[
42,
43
],
[
43,
44
],
[
39,
45
],
[
45,
46
],
[
45,
47
],
[
47,
48
],
[
47,
49
],
[
45,
50
],
[
50,
51
],
[
50,
52
],
[
45,
53
],
[
53,
54
],
[
53,
55
],
[
55,
56
],
[
56,
57
],
[
57,
58
],
[
56,
59
],
[
59,
60
],
[
60,
61
],
[
61,
62
],
[
61,
63
],
[
63,
64
],
[
64,
65
],
[
63,
66
],
[
66,
67
],
[
67,
68
],
[
61,
69
],
[
69,
70
],
[
70,
71
],
[
69,
72
],
[
72,
73
],
[
73,
74
],
[
61,
75
],
[
55,
76
],
[
45,
77
],
[
77,
78
],
[
78,
79
],
[
79,
80
],
[
80,
81
],
[
79,
82
],
[
28,
83
],
[
83,
84
],
[
84,
85
],
[
85,
86
],
[
85,
87
],
[
83,
88
],
[
88,
89
],
[
89,
90
],
[
28,
91
],
[
91,
92
],
[
92,
93
],
[
129,
94
],
[
94,
95
],
[
94,
96
],
[
96,
97
],
[
97,
98
],
[
97,
99
],
[
99,
100
],
[
99,
101
],
[
101,
102
],
[
102,
103
],
[
103,
104
],
[
103,
105
],
[
97,
106
],
[
106,
107
],
[
106,
108
],
[
108,
109
],
[
109,
110
],
[
110,
111
],
[
110,
112
],
[
97,
113
],
[
113,
114
],
[
113,
115
],
[
115,
116
],
[
116,
117
],
[
117,
118
],
[
117,
119
],
[
96,
120
],
[
120,
121
],
[
94,
122
],
[
122,
123
],
[
94,
124
],
[
124,
125
],
[
94,
126
],
[
126,
127
],
[
0,
128
],
[
128,
129
],
[
128,
130
]
] | [
"import java.util.Deque;\nimport java.util.LinkedList;\nimport java.util.Scanner;\n\npublic class Main{\n\n\tpublic static void main(String args[]){\n\t\tnew Main().mainrun();\n\t}\n\n\tprivate Scanner scan;\n\tprivate Deque<String> d;\n\tprivate String str;\n\n\tprivate void mainrun() {\n\t\tscan = new Scanner(System.in);\n\n\t\td = new LinkedList<>();\n\n\t\twhile(scan.hasNext()) {\n\t\t\tstr = scan.next();\n\n\t\t\tswitch(str) {\n\t\t\tcase \"+\":\n\t\t\tcase \"-\":\n\t\t\tcase \"*\":\n\t\t\t\td.push(Calculation(Long.parseLong(d.pop()),\n\t\t\t\t\t\t\t\t Long.parseLong(d.pop()),\n\t\t\t\t\t\t\t\t str).toString());\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\td.push(str);\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.println(d.pop());\n\t\tscan.close();\n\t}\n\n\tprivate Long Calculation(long x,long y,String c) {\n\t\tswitch(c) {\n\t\tcase \"+\":\n\t\t\treturn y + x;\n\t\tcase \"-\":\n\t\t\treturn y - x;\n\t\tcase \"*\":\n\t\t\treturn y * x;\n\t\t}\n\t\treturn (long) 0;\n\t}\n}\n",
"import java.util.Deque;",
"Deque",
"java.util",
"import java.util.LinkedList;",
"LinkedList",
"java.util",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main{\n\n\tpublic static void main(String args[]){\n\t\tnew Main().mainrun();\n\t}\n\n\tprivate Scanner scan;\n\tprivate Deque<String> d;\n\tprivate String str;\n\n\tprivate void mainrun() {\n\t\tscan = new Scanner(System.in);\n\n\t\td = new LinkedList<>();\n\n\t\twhile(scan.hasNext()) {\n\t\t\tstr = scan.next();\n\n\t\t\tswitch(str) {\n\t\t\tcase \"+\":\n\t\t\tcase \"-\":\n\t\t\tcase \"*\":\n\t\t\t\td.push(Calculation(Long.parseLong(d.pop()),\n\t\t\t\t\t\t\t\t Long.parseLong(d.pop()),\n\t\t\t\t\t\t\t\t str).toString());\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\td.push(str);\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.println(d.pop());\n\t\tscan.close();\n\t}\n\n\tprivate Long Calculation(long x,long y,String c) {\n\t\tswitch(c) {\n\t\tcase \"+\":\n\t\t\treturn y + x;\n\t\tcase \"-\":\n\t\t\treturn y - x;\n\t\tcase \"*\":\n\t\t\treturn y * x;\n\t\t}\n\t\treturn (long) 0;\n\t}\n}",
"Main",
"private Scanner scan;",
"scan",
"private Deque<String> d;",
"d",
"private String str;",
"str",
"public static void main(String args[]){\n\t\tnew Main().mainrun();\n\t}",
"main",
"{\n\t\tnew Main().mainrun();\n\t}",
"new Main().mainrun()",
"new Main().mainrun",
"new Main()",
"String args[]",
"args",
"private void mainrun() {\n\t\tscan = new Scanner(System.in);\n\n\t\td = new LinkedList<>();\n\n\t\twhile(scan.hasNext()) {\n\t\t\tstr = scan.next();\n\n\t\t\tswitch(str) {\n\t\t\tcase \"+\":\n\t\t\tcase \"-\":\n\t\t\tcase \"*\":\n\t\t\t\td.push(Calculation(Long.parseLong(d.pop()),\n\t\t\t\t\t\t\t\t Long.parseLong(d.pop()),\n\t\t\t\t\t\t\t\t str).toString());\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\td.push(str);\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.println(d.pop());\n\t\tscan.close();\n\t}",
"mainrun",
"{\n\t\tscan = new Scanner(System.in);\n\n\t\td = new LinkedList<>();\n\n\t\twhile(scan.hasNext()) {\n\t\t\tstr = scan.next();\n\n\t\t\tswitch(str) {\n\t\t\tcase \"+\":\n\t\t\tcase \"-\":\n\t\t\tcase \"*\":\n\t\t\t\td.push(Calculation(Long.parseLong(d.pop()),\n\t\t\t\t\t\t\t\t Long.parseLong(d.pop()),\n\t\t\t\t\t\t\t\t str).toString());\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\td.push(str);\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.println(d.pop());\n\t\tscan.close();\n\t}",
"scan = new Scanner(System.in)",
"scan",
"new Scanner(System.in)",
"d = new LinkedList<>()",
"d",
"new LinkedList<>()",
"while(scan.hasNext()) {\n\t\t\tstr = scan.next();\n\n\t\t\tswitch(str) {\n\t\t\tcase \"+\":\n\t\t\tcase \"-\":\n\t\t\tcase \"*\":\n\t\t\t\td.push(Calculation(Long.parseLong(d.pop()),\n\t\t\t\t\t\t\t\t Long.parseLong(d.pop()),\n\t\t\t\t\t\t\t\t str).toString());\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\td.push(str);\n\t\t\t}\n\t\t}",
"scan.hasNext()",
"scan.hasNext",
"scan",
"{\n\t\t\tstr = scan.next();\n\n\t\t\tswitch(str) {\n\t\t\tcase \"+\":\n\t\t\tcase \"-\":\n\t\t\tcase \"*\":\n\t\t\t\td.push(Calculation(Long.parseLong(d.pop()),\n\t\t\t\t\t\t\t\t Long.parseLong(d.pop()),\n\t\t\t\t\t\t\t\t str).toString());\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\td.push(str);\n\t\t\t}\n\t\t}",
"str = scan.next()",
"str",
"scan.next()",
"scan.next",
"scan",
"switch(str) {\n\t\t\tcase \"+\":\n\t\t\tcase \"-\":\n\t\t\tcase \"*\":\n\t\t\t\td.push(Calculation(Long.parseLong(d.pop()),\n\t\t\t\t\t\t\t\t Long.parseLong(d.pop()),\n\t\t\t\t\t\t\t\t str).toString());\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\td.push(str);\n\t\t\t}",
"str",
"case \"+\":",
"\"+\"",
"case \"+\":",
"case \"-\":",
"\"-\"",
"case \"-\":",
"case \"*\":",
"\"*\"",
"case \"*\":",
"d.push(Calculation(Long.parseLong(d.pop()),\n\t\t\t\t\t\t\t\t Long.parseLong(d.pop()),\n\t\t\t\t\t\t\t\t str).toString())",
"d.push",
"d",
"Calculation(Long.parseLong(d.pop()),\n\t\t\t\t\t\t\t\t Long.parseLong(d.pop()),\n\t\t\t\t\t\t\t\t str).toString()",
"Calculation(Long.parseLong(d.pop()),\n\t\t\t\t\t\t\t\t Long.parseLong(d.pop()),\n\t\t\t\t\t\t\t\t str).toString",
"Calculation(Long.parseLong(d.pop()),\n\t\t\t\t\t\t\t\t Long.parseLong(d.pop()),\n\t\t\t\t\t\t\t\t str)",
"Calculation",
"Long.parseLong(d.pop())",
"Long.parseLong",
"Long",
"d.pop()",
"d.pop",
"d",
"Long.parseLong(d.pop())",
"Long.parseLong",
"Long",
"d.pop()",
"d.pop",
"d",
"str",
"break;",
"default:",
"default:",
"d.push(str)",
"d.push",
"d",
"str",
"System.out.println(d.pop())",
"System.out.println",
"System.out",
"System",
"System.out",
"d.pop()",
"d.pop",
"d",
"scan.close()",
"scan.close",
"scan",
"private Long Calculation(long x,long y,String c) {\n\t\tswitch(c) {\n\t\tcase \"+\":\n\t\t\treturn y + x;\n\t\tcase \"-\":\n\t\t\treturn y - x;\n\t\tcase \"*\":\n\t\t\treturn y * x;\n\t\t}\n\t\treturn (long) 0;\n\t}",
"Calculation",
"{\n\t\tswitch(c) {\n\t\tcase \"+\":\n\t\t\treturn y + x;\n\t\tcase \"-\":\n\t\t\treturn y - x;\n\t\tcase \"*\":\n\t\t\treturn y * x;\n\t\t}\n\t\treturn (long) 0;\n\t}",
"switch(c) {\n\t\tcase \"+\":\n\t\t\treturn y + x;\n\t\tcase \"-\":\n\t\t\treturn y - x;\n\t\tcase \"*\":\n\t\t\treturn y * x;\n\t\t}",
"c",
"case \"+\":",
"\"+\"",
"case \"+\":",
"return y + x;",
"y + x",
"y",
"x",
"case \"-\":",
"\"-\"",
"case \"-\":",
"return y - x;",
"y - x",
"y",
"x",
"case \"*\":",
"\"*\"",
"case \"*\":",
"return y * x;",
"y * x",
"y",
"x",
"return (long) 0;",
"(long) 0",
"long x",
"x",
"long y",
"y",
"String c",
"c",
"public class Main{\n\n\tpublic static void main(String args[]){\n\t\tnew Main().mainrun();\n\t}\n\n\tprivate Scanner scan;\n\tprivate Deque<String> d;\n\tprivate String str;\n\n\tprivate void mainrun() {\n\t\tscan = new Scanner(System.in);\n\n\t\td = new LinkedList<>();\n\n\t\twhile(scan.hasNext()) {\n\t\t\tstr = scan.next();\n\n\t\t\tswitch(str) {\n\t\t\tcase \"+\":\n\t\t\tcase \"-\":\n\t\t\tcase \"*\":\n\t\t\t\td.push(Calculation(Long.parseLong(d.pop()),\n\t\t\t\t\t\t\t\t Long.parseLong(d.pop()),\n\t\t\t\t\t\t\t\t str).toString());\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\td.push(str);\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.println(d.pop());\n\t\tscan.close();\n\t}\n\n\tprivate Long Calculation(long x,long y,String c) {\n\t\tswitch(c) {\n\t\tcase \"+\":\n\t\t\treturn y + x;\n\t\tcase \"-\":\n\t\t\treturn y - x;\n\t\tcase \"*\":\n\t\t\treturn y * x;\n\t\t}\n\t\treturn (long) 0;\n\t}\n}",
"public class Main{\n\n\tpublic static void main(String args[]){\n\t\tnew Main().mainrun();\n\t}\n\n\tprivate Scanner scan;\n\tprivate Deque<String> d;\n\tprivate String str;\n\n\tprivate void mainrun() {\n\t\tscan = new Scanner(System.in);\n\n\t\td = new LinkedList<>();\n\n\t\twhile(scan.hasNext()) {\n\t\t\tstr = scan.next();\n\n\t\t\tswitch(str) {\n\t\t\tcase \"+\":\n\t\t\tcase \"-\":\n\t\t\tcase \"*\":\n\t\t\t\td.push(Calculation(Long.parseLong(d.pop()),\n\t\t\t\t\t\t\t\t Long.parseLong(d.pop()),\n\t\t\t\t\t\t\t\t str).toString());\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\td.push(str);\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.println(d.pop());\n\t\tscan.close();\n\t}\n\n\tprivate Long Calculation(long x,long y,String c) {\n\t\tswitch(c) {\n\t\tcase \"+\":\n\t\t\treturn y + x;\n\t\tcase \"-\":\n\t\t\treturn y - x;\n\t\tcase \"*\":\n\t\t\treturn y * x;\n\t\t}\n\t\treturn (long) 0;\n\t}\n}",
"Main"
] | import java.util.Deque;
import java.util.LinkedList;
import java.util.Scanner;
public class Main{
public static void main(String args[]){
new Main().mainrun();
}
private Scanner scan;
private Deque<String> d;
private String str;
private void mainrun() {
scan = new Scanner(System.in);
d = new LinkedList<>();
while(scan.hasNext()) {
str = scan.next();
switch(str) {
case "+":
case "-":
case "*":
d.push(Calculation(Long.parseLong(d.pop()),
Long.parseLong(d.pop()),
str).toString());
break;
default:
d.push(str);
}
}
System.out.println(d.pop());
scan.close();
}
private Long Calculation(long x,long y,String c) {
switch(c) {
case "+":
return y + x;
case "-":
return y - x;
case "*":
return y * x;
}
return (long) 0;
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
4,
13,
23,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
4,
18,
13,
17,
4,
18,
13,
41,
13,
20,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
30,
41,
13,
18,
13,
13,
41,
13,
41,
13,
35,
13,
34,
17,
1,
0,
13,
4,
18,
13,
2,
4,
18,
13,
17,
0,
13,
4,
18,
13,
2,
4,
18,
13,
17,
41,
13,
2,
13,
13,
4,
18,
13,
2,
4,
18,
13,
17,
4,
18,
13,
2,
4,
18,
13,
17,
4,
18,
13,
13,
3,
34,
17,
1,
0,
13,
4,
18,
13,
2,
4,
18,
13,
17,
0,
13,
4,
18,
13,
2,
4,
18,
13,
17,
41,
13,
2,
13,
13,
4,
18,
13,
2,
4,
18,
13,
17,
4,
18,
13,
2,
4,
18,
13,
17,
4,
18,
13,
13,
3,
34,
17,
1,
0,
13,
4,
18,
13,
2,
4,
18,
13,
17,
0,
13,
4,
18,
13,
2,
4,
18,
13,
17,
41,
13,
2,
13,
13,
4,
18,
13,
2,
4,
18,
13,
17,
4,
18,
13,
2,
4,
18,
13,
17,
4,
18,
13,
13,
3,
34,
1,
4,
18,
13,
4,
18,
13,
13,
3,
4,
18,
18,
13,
13,
4,
18,
13,
17,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
226,
5
],
[
226,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
6,
11
],
[
11,
12
],
[
226,
13
],
[
13,
14
],
[
13,
15
],
[
15,
16
],
[
16,
17
],
[
16,
18
],
[
15,
19
],
[
19,
20
],
[
19,
21
],
[
21,
22
],
[
22,
23
],
[
23,
24
],
[
24,
25
],
[
21,
26
],
[
15,
27
],
[
27,
28
],
[
28,
29
],
[
15,
30
],
[
30,
31
],
[
30,
32
],
[
15,
33
],
[
33,
34
],
[
34,
35
],
[
35,
36
],
[
35,
37
],
[
33,
38
],
[
38,
39
],
[
38,
40
],
[
40,
41
],
[
40,
42
],
[
33,
43
],
[
43,
44
],
[
44,
45
],
[
33,
46
],
[
47,
47
],
[
47,
48
],
[
48,
49
],
[
48,
50
],
[
50,
51
],
[
50,
52
],
[
47,
53
],
[
53,
54
],
[
47,
55
],
[
55,
56
],
[
47,
57
],
[
57,
58
],
[
57,
59
],
[
59,
60
],
[
59,
61
],
[
61,
62
],
[
62,
63
],
[
62,
64
],
[
64,
65
],
[
65,
66
],
[
64,
67
],
[
67,
68
],
[
68,
69
],
[
69,
70
],
[
67,
71
],
[
61,
72
],
[
72,
73
],
[
72,
74
],
[
74,
75
],
[
75,
76
],
[
74,
77
],
[
77,
78
],
[
78,
79
],
[
79,
80
],
[
77,
81
],
[
61,
82
],
[
82,
83
],
[
82,
84
],
[
84,
85
],
[
84,
86
],
[
61,
87
],
[
87,
88
],
[
88,
89
],
[
87,
90
],
[
90,
91
],
[
91,
92
],
[
92,
93
],
[
90,
94
],
[
61,
95
],
[
95,
96
],
[
96,
97
],
[
95,
98
],
[
98,
99
],
[
99,
100
],
[
100,
101
],
[
98,
102
],
[
61,
103
],
[
103,
104
],
[
104,
105
],
[
103,
106
],
[
61,
107
],
[
57,
108
],
[
108,
109
],
[
108,
110
],
[
110,
111
],
[
111,
112
],
[
111,
113
],
[
113,
114
],
[
114,
115
],
[
113,
116
],
[
116,
117
],
[
117,
118
],
[
118,
119
],
[
116,
120
],
[
110,
121
],
[
121,
122
],
[
121,
123
],
[
123,
124
],
[
124,
125
],
[
123,
126
],
[
126,
127
],
[
127,
128
],
[
128,
129
],
[
126,
130
],
[
110,
131
],
[
131,
132
],
[
131,
133
],
[
133,
134
],
[
133,
135
],
[
110,
136
],
[
136,
137
],
[
137,
138
],
[
136,
139
],
[
139,
140
],
[
140,
141
],
[
141,
142
],
[
139,
143
],
[
110,
144
],
[
144,
145
],
[
145,
146
],
[
144,
147
],
[
147,
148
],
[
148,
149
],
[
149,
150
],
[
147,
151
],
[
110,
152
],
[
152,
153
],
[
153,
154
],
[
152,
155
],
[
110,
156
],
[
57,
157
],
[
157,
158
],
[
157,
159
],
[
159,
160
],
[
160,
161
],
[
160,
162
],
[
162,
163
],
[
163,
164
],
[
162,
165
],
[
165,
166
],
[
166,
167
],
[
167,
168
],
[
165,
169
],
[
159,
170
],
[
170,
171
],
[
170,
172
],
[
172,
173
],
[
173,
174
],
[
172,
175
],
[
175,
176
],
[
176,
177
],
[
177,
178
],
[
175,
179
],
[
159,
180
],
[
180,
181
],
[
180,
182
],
[
182,
183
],
[
182,
184
],
[
159,
185
],
[
185,
186
],
[
186,
187
],
[
185,
188
],
[
188,
189
],
[
189,
190
],
[
190,
191
],
[
188,
192
],
[
159,
193
],
[
193,
194
],
[
194,
195
],
[
193,
196
],
[
196,
197
],
[
197,
198
],
[
198,
199
],
[
196,
200
],
[
159,
201
],
[
201,
202
],
[
202,
203
],
[
201,
204
],
[
159,
205
],
[
57,
206
],
[
206,
207
],
[
207,
208
],
[
208,
209
],
[
209,
210
],
[
208,
211
],
[
211,
212
],
[
212,
213
],
[
211,
214
],
[
207,
215
],
[
15,
216
],
[
216,
217
],
[
217,
218
],
[
218,
219
],
[
218,
220
],
[
216,
221
],
[
221,
222
],
[
222,
223
],
[
221,
224
],
[
0,
225
],
[
225,
226
],
[
225,
227
]
] | [
"import java.util.*;\n\npublic class Main {\n public static void main(String[] args) {\n aldl_1_3_a();\n }\n\n static void aldl_1_3_a() {\n Scanner sc = new Scanner(System.in);\n String[] data = sc.nextLine().split(\" \");\n sc.close();\n\n ArrayList<Integer> stack = new ArrayList<Integer>();\n\n for (int i = 0; i < data.length; i++) {\n String value = data[i];\n int first, second;\n\n switch (value) {\n case \"+\":\n first = stack.get(stack.size() - 2);\n second = stack.get(stack.size() - 1);\n int a = first + second;\n stack.remove(stack.size() - 1);\n stack.remove(stack.size() - 1);\n stack.add(a);\n break;\n case \"-\":\n first = stack.get(stack.size() - 2);\n second = stack.get(stack.size() - 1);\n int b = first - second;\n stack.remove(stack.size() - 1);\n stack.remove(stack.size() - 1);\n stack.add(b);\n break;\n case \"*\":\n first = stack.get(stack.size() - 2);\n second = stack.get(stack.size() - 1);\n int c = first * second;\n stack.remove(stack.size() - 1);\n stack.remove(stack.size() - 1);\n stack.add(c);\n break;\n default:\n stack.add(Integer.parseInt(value));\n break;\n }\n }\n System.out.println(stack.get(0));\n }\n}",
"import java.util.*;",
"util.*",
"java",
"public class Main {\n public static void main(String[] args) {\n aldl_1_3_a();\n }\n\n static void aldl_1_3_a() {\n Scanner sc = new Scanner(System.in);\n String[] data = sc.nextLine().split(\" \");\n sc.close();\n\n ArrayList<Integer> stack = new ArrayList<Integer>();\n\n for (int i = 0; i < data.length; i++) {\n String value = data[i];\n int first, second;\n\n switch (value) {\n case \"+\":\n first = stack.get(stack.size() - 2);\n second = stack.get(stack.size() - 1);\n int a = first + second;\n stack.remove(stack.size() - 1);\n stack.remove(stack.size() - 1);\n stack.add(a);\n break;\n case \"-\":\n first = stack.get(stack.size() - 2);\n second = stack.get(stack.size() - 1);\n int b = first - second;\n stack.remove(stack.size() - 1);\n stack.remove(stack.size() - 1);\n stack.add(b);\n break;\n case \"*\":\n first = stack.get(stack.size() - 2);\n second = stack.get(stack.size() - 1);\n int c = first * second;\n stack.remove(stack.size() - 1);\n stack.remove(stack.size() - 1);\n stack.add(c);\n break;\n default:\n stack.add(Integer.parseInt(value));\n break;\n }\n }\n System.out.println(stack.get(0));\n }\n}",
"Main",
"public static void main(String[] args) {\n aldl_1_3_a();\n }",
"main",
"{\n aldl_1_3_a();\n }",
"aldl_1_3_a()",
"aldl_1_3_a",
"String[] args",
"args",
"static void aldl_1_3_a() {\n Scanner sc = new Scanner(System.in);\n String[] data = sc.nextLine().split(\" \");\n sc.close();\n\n ArrayList<Integer> stack = new ArrayList<Integer>();\n\n for (int i = 0; i < data.length; i++) {\n String value = data[i];\n int first, second;\n\n switch (value) {\n case \"+\":\n first = stack.get(stack.size() - 2);\n second = stack.get(stack.size() - 1);\n int a = first + second;\n stack.remove(stack.size() - 1);\n stack.remove(stack.size() - 1);\n stack.add(a);\n break;\n case \"-\":\n first = stack.get(stack.size() - 2);\n second = stack.get(stack.size() - 1);\n int b = first - second;\n stack.remove(stack.size() - 1);\n stack.remove(stack.size() - 1);\n stack.add(b);\n break;\n case \"*\":\n first = stack.get(stack.size() - 2);\n second = stack.get(stack.size() - 1);\n int c = first * second;\n stack.remove(stack.size() - 1);\n stack.remove(stack.size() - 1);\n stack.add(c);\n break;\n default:\n stack.add(Integer.parseInt(value));\n break;\n }\n }\n System.out.println(stack.get(0));\n }",
"aldl_1_3_a",
"{\n Scanner sc = new Scanner(System.in);\n String[] data = sc.nextLine().split(\" \");\n sc.close();\n\n ArrayList<Integer> stack = new ArrayList<Integer>();\n\n for (int i = 0; i < data.length; i++) {\n String value = data[i];\n int first, second;\n\n switch (value) {\n case \"+\":\n first = stack.get(stack.size() - 2);\n second = stack.get(stack.size() - 1);\n int a = first + second;\n stack.remove(stack.size() - 1);\n stack.remove(stack.size() - 1);\n stack.add(a);\n break;\n case \"-\":\n first = stack.get(stack.size() - 2);\n second = stack.get(stack.size() - 1);\n int b = first - second;\n stack.remove(stack.size() - 1);\n stack.remove(stack.size() - 1);\n stack.add(b);\n break;\n case \"*\":\n first = stack.get(stack.size() - 2);\n second = stack.get(stack.size() - 1);\n int c = first * second;\n stack.remove(stack.size() - 1);\n stack.remove(stack.size() - 1);\n stack.add(c);\n break;\n default:\n stack.add(Integer.parseInt(value));\n break;\n }\n }\n System.out.println(stack.get(0));\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"String[] data = sc.nextLine().split(\" \");",
"data",
"sc.nextLine().split(\" \")",
"sc.nextLine().split",
"sc.nextLine()",
"sc.nextLine",
"sc",
"\" \"",
"sc.close()",
"sc.close",
"sc",
"ArrayList<Integer> stack = new ArrayList<Integer>();",
"stack",
"new ArrayList<Integer>()",
"for (int i = 0; i < data.length; i++) {\n String value = data[i];\n int first, second;\n\n switch (value) {\n case \"+\":\n first = stack.get(stack.size() - 2);\n second = stack.get(stack.size() - 1);\n int a = first + second;\n stack.remove(stack.size() - 1);\n stack.remove(stack.size() - 1);\n stack.add(a);\n break;\n case \"-\":\n first = stack.get(stack.size() - 2);\n second = stack.get(stack.size() - 1);\n int b = first - second;\n stack.remove(stack.size() - 1);\n stack.remove(stack.size() - 1);\n stack.add(b);\n break;\n case \"*\":\n first = stack.get(stack.size() - 2);\n second = stack.get(stack.size() - 1);\n int c = first * second;\n stack.remove(stack.size() - 1);\n stack.remove(stack.size() - 1);\n stack.add(c);\n break;\n default:\n stack.add(Integer.parseInt(value));\n break;\n }\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < data.length",
"i",
"data.length",
"data",
"data.length",
"i++",
"i++",
"i",
"{\n String value = data[i];\n int first, second;\n\n switch (value) {\n case \"+\":\n first = stack.get(stack.size() - 2);\n second = stack.get(stack.size() - 1);\n int a = first + second;\n stack.remove(stack.size() - 1);\n stack.remove(stack.size() - 1);\n stack.add(a);\n break;\n case \"-\":\n first = stack.get(stack.size() - 2);\n second = stack.get(stack.size() - 1);\n int b = first - second;\n stack.remove(stack.size() - 1);\n stack.remove(stack.size() - 1);\n stack.add(b);\n break;\n case \"*\":\n first = stack.get(stack.size() - 2);\n second = stack.get(stack.size() - 1);\n int c = first * second;\n stack.remove(stack.size() - 1);\n stack.remove(stack.size() - 1);\n stack.add(c);\n break;\n default:\n stack.add(Integer.parseInt(value));\n break;\n }\n }",
"{\n String value = data[i];\n int first, second;\n\n switch (value) {\n case \"+\":\n first = stack.get(stack.size() - 2);\n second = stack.get(stack.size() - 1);\n int a = first + second;\n stack.remove(stack.size() - 1);\n stack.remove(stack.size() - 1);\n stack.add(a);\n break;\n case \"-\":\n first = stack.get(stack.size() - 2);\n second = stack.get(stack.size() - 1);\n int b = first - second;\n stack.remove(stack.size() - 1);\n stack.remove(stack.size() - 1);\n stack.add(b);\n break;\n case \"*\":\n first = stack.get(stack.size() - 2);\n second = stack.get(stack.size() - 1);\n int c = first * second;\n stack.remove(stack.size() - 1);\n stack.remove(stack.size() - 1);\n stack.add(c);\n break;\n default:\n stack.add(Integer.parseInt(value));\n break;\n }\n }",
"String value = data[i];",
"value",
"data[i]",
"data",
"i",
"int first",
"first",
"second;",
"second",
"switch (value) {\n case \"+\":\n first = stack.get(stack.size() - 2);\n second = stack.get(stack.size() - 1);\n int a = first + second;\n stack.remove(stack.size() - 1);\n stack.remove(stack.size() - 1);\n stack.add(a);\n break;\n case \"-\":\n first = stack.get(stack.size() - 2);\n second = stack.get(stack.size() - 1);\n int b = first - second;\n stack.remove(stack.size() - 1);\n stack.remove(stack.size() - 1);\n stack.add(b);\n break;\n case \"*\":\n first = stack.get(stack.size() - 2);\n second = stack.get(stack.size() - 1);\n int c = first * second;\n stack.remove(stack.size() - 1);\n stack.remove(stack.size() - 1);\n stack.add(c);\n break;\n default:\n stack.add(Integer.parseInt(value));\n break;\n }",
"value",
"case \"+\":",
"\"+\"",
"case \"+\":",
"first = stack.get(stack.size() - 2)",
"first",
"stack.get(stack.size() - 2)",
"stack.get",
"stack",
"stack.size() - 2",
"stack.size()",
"stack.size",
"stack",
"2",
"second = stack.get(stack.size() - 1)",
"second",
"stack.get(stack.size() - 1)",
"stack.get",
"stack",
"stack.size() - 1",
"stack.size()",
"stack.size",
"stack",
"1",
"int a = first + second;",
"a",
"first + second",
"first",
"second",
"stack.remove(stack.size() - 1)",
"stack.remove",
"stack",
"stack.size() - 1",
"stack.size()",
"stack.size",
"stack",
"1",
"stack.remove(stack.size() - 1)",
"stack.remove",
"stack",
"stack.size() - 1",
"stack.size()",
"stack.size",
"stack",
"1",
"stack.add(a)",
"stack.add",
"stack",
"a",
"break;",
"case \"-\":",
"\"-\"",
"case \"-\":",
"first = stack.get(stack.size() - 2)",
"first",
"stack.get(stack.size() - 2)",
"stack.get",
"stack",
"stack.size() - 2",
"stack.size()",
"stack.size",
"stack",
"2",
"second = stack.get(stack.size() - 1)",
"second",
"stack.get(stack.size() - 1)",
"stack.get",
"stack",
"stack.size() - 1",
"stack.size()",
"stack.size",
"stack",
"1",
"int b = first - second;",
"b",
"first - second",
"first",
"second",
"stack.remove(stack.size() - 1)",
"stack.remove",
"stack",
"stack.size() - 1",
"stack.size()",
"stack.size",
"stack",
"1",
"stack.remove(stack.size() - 1)",
"stack.remove",
"stack",
"stack.size() - 1",
"stack.size()",
"stack.size",
"stack",
"1",
"stack.add(b)",
"stack.add",
"stack",
"b",
"break;",
"case \"*\":",
"\"*\"",
"case \"*\":",
"first = stack.get(stack.size() - 2)",
"first",
"stack.get(stack.size() - 2)",
"stack.get",
"stack",
"stack.size() - 2",
"stack.size()",
"stack.size",
"stack",
"2",
"second = stack.get(stack.size() - 1)",
"second",
"stack.get(stack.size() - 1)",
"stack.get",
"stack",
"stack.size() - 1",
"stack.size()",
"stack.size",
"stack",
"1",
"int c = first * second;",
"c",
"first * second",
"first",
"second",
"stack.remove(stack.size() - 1)",
"stack.remove",
"stack",
"stack.size() - 1",
"stack.size()",
"stack.size",
"stack",
"1",
"stack.remove(stack.size() - 1)",
"stack.remove",
"stack",
"stack.size() - 1",
"stack.size()",
"stack.size",
"stack",
"1",
"stack.add(c)",
"stack.add",
"stack",
"c",
"break;",
"default:",
"default:",
"stack.add(Integer.parseInt(value))",
"stack.add",
"stack",
"Integer.parseInt(value)",
"Integer.parseInt",
"Integer",
"value",
"break;",
"System.out.println(stack.get(0))",
"System.out.println",
"System.out",
"System",
"System.out",
"stack.get(0)",
"stack.get",
"stack",
"0",
"public class Main {\n public static void main(String[] args) {\n aldl_1_3_a();\n }\n\n static void aldl_1_3_a() {\n Scanner sc = new Scanner(System.in);\n String[] data = sc.nextLine().split(\" \");\n sc.close();\n\n ArrayList<Integer> stack = new ArrayList<Integer>();\n\n for (int i = 0; i < data.length; i++) {\n String value = data[i];\n int first, second;\n\n switch (value) {\n case \"+\":\n first = stack.get(stack.size() - 2);\n second = stack.get(stack.size() - 1);\n int a = first + second;\n stack.remove(stack.size() - 1);\n stack.remove(stack.size() - 1);\n stack.add(a);\n break;\n case \"-\":\n first = stack.get(stack.size() - 2);\n second = stack.get(stack.size() - 1);\n int b = first - second;\n stack.remove(stack.size() - 1);\n stack.remove(stack.size() - 1);\n stack.add(b);\n break;\n case \"*\":\n first = stack.get(stack.size() - 2);\n second = stack.get(stack.size() - 1);\n int c = first * second;\n stack.remove(stack.size() - 1);\n stack.remove(stack.size() - 1);\n stack.add(c);\n break;\n default:\n stack.add(Integer.parseInt(value));\n break;\n }\n }\n System.out.println(stack.get(0));\n }\n}",
"public class Main {\n public static void main(String[] args) {\n aldl_1_3_a();\n }\n\n static void aldl_1_3_a() {\n Scanner sc = new Scanner(System.in);\n String[] data = sc.nextLine().split(\" \");\n sc.close();\n\n ArrayList<Integer> stack = new ArrayList<Integer>();\n\n for (int i = 0; i < data.length; i++) {\n String value = data[i];\n int first, second;\n\n switch (value) {\n case \"+\":\n first = stack.get(stack.size() - 2);\n second = stack.get(stack.size() - 1);\n int a = first + second;\n stack.remove(stack.size() - 1);\n stack.remove(stack.size() - 1);\n stack.add(a);\n break;\n case \"-\":\n first = stack.get(stack.size() - 2);\n second = stack.get(stack.size() - 1);\n int b = first - second;\n stack.remove(stack.size() - 1);\n stack.remove(stack.size() - 1);\n stack.add(b);\n break;\n case \"*\":\n first = stack.get(stack.size() - 2);\n second = stack.get(stack.size() - 1);\n int c = first * second;\n stack.remove(stack.size() - 1);\n stack.remove(stack.size() - 1);\n stack.add(c);\n break;\n default:\n stack.add(Integer.parseInt(value));\n break;\n }\n }\n System.out.println(stack.get(0));\n }\n}",
"Main"
] | import java.util.*;
public class Main {
public static void main(String[] args) {
aldl_1_3_a();
}
static void aldl_1_3_a() {
Scanner sc = new Scanner(System.in);
String[] data = sc.nextLine().split(" ");
sc.close();
ArrayList<Integer> stack = new ArrayList<Integer>();
for (int i = 0; i < data.length; i++) {
String value = data[i];
int first, second;
switch (value) {
case "+":
first = stack.get(stack.size() - 2);
second = stack.get(stack.size() - 1);
int a = first + second;
stack.remove(stack.size() - 1);
stack.remove(stack.size() - 1);
stack.add(a);
break;
case "-":
first = stack.get(stack.size() - 2);
second = stack.get(stack.size() - 1);
int b = first - second;
stack.remove(stack.size() - 1);
stack.remove(stack.size() - 1);
stack.add(b);
break;
case "*":
first = stack.get(stack.size() - 2);
second = stack.get(stack.size() - 1);
int c = first * second;
stack.remove(stack.size() - 1);
stack.remove(stack.size() - 1);
stack.add(c);
break;
default:
stack.add(Integer.parseInt(value));
break;
}
}
System.out.println(stack.get(0));
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
4,
18,
13,
17,
41,
13,
20,
28,
13,
13,
30,
30,
41,
13,
4,
18,
13,
17,
14,
2,
2,
2,
13,
17,
2,
13,
17,
2,
13,
17,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
14,
2,
13,
17,
30,
0,
13,
13,
14,
2,
13,
17,
30,
0,
13,
13,
30,
0,
13,
13,
4,
18,
13,
13,
30,
4,
18,
13,
4,
18,
13,
13,
4,
18,
18,
13,
13,
4,
18,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
100,
5
],
[
100,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
16,
17
],
[
17,
18
],
[
14,
19
],
[
8,
20
],
[
20,
21
],
[
20,
22
],
[
8,
23
],
[
23,
24
],
[
23,
25
],
[
23,
26
],
[
27,
27
],
[
27,
28
],
[
28,
29
],
[
28,
30
],
[
30,
31
],
[
31,
32
],
[
30,
33
],
[
27,
34
],
[
34,
35
],
[
36,
36
],
[
36,
37
],
[
37,
38
],
[
37,
39
],
[
36,
40
],
[
40,
41
],
[
40,
42
],
[
36,
43
],
[
43,
44
],
[
43,
45
],
[
34,
46
],
[
46,
47
],
[
47,
48
],
[
47,
49
],
[
49,
50
],
[
50,
51
],
[
46,
52
],
[
52,
53
],
[
52,
54
],
[
54,
55
],
[
55,
56
],
[
46,
57
],
[
57,
58
],
[
58,
59
],
[
58,
60
],
[
57,
61
],
[
61,
62
],
[
62,
63
],
[
62,
64
],
[
57,
65
],
[
65,
66
],
[
66,
67
],
[
66,
68
],
[
65,
69
],
[
69,
70
],
[
70,
71
],
[
70,
72
],
[
65,
73
],
[
73,
74
],
[
74,
75
],
[
74,
76
],
[
46,
77
],
[
77,
78
],
[
78,
79
],
[
77,
80
],
[
34,
81
],
[
81,
82
],
[
82,
83
],
[
83,
84
],
[
82,
85
],
[
85,
86
],
[
86,
87
],
[
85,
88
],
[
8,
89
],
[
89,
90
],
[
90,
91
],
[
91,
92
],
[
91,
93
],
[
89,
94
],
[
94,
95
],
[
95,
96
],
[
6,
97
],
[
97,
98
],
[
0,
99
],
[
99,
100
],
[
99,
101
]
] | [
"import java.util.*;\n\npublic class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n String[] line = sc.nextLine().split(\" \");\n ArrayDeque<Integer> stack = new ArrayDeque<>();\n for (String x : line) {\n char c = x.charAt(0);\n if (c == '+' || c == '-' || c == '*') {\n int second = stack.pop();\n int first = stack.pop();\n if (c == '+') {\n first += second;\n } else if (c == '-') {\n first -= second;\n } else {\n first *= second;\n }\n stack.push(first);\n } else {\n stack.push(Integer.parseInt(x));\n }\n }\n System.out.println(stack.pop());\n }\n}",
"import java.util.*;",
"util.*",
"java",
"public class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n String[] line = sc.nextLine().split(\" \");\n ArrayDeque<Integer> stack = new ArrayDeque<>();\n for (String x : line) {\n char c = x.charAt(0);\n if (c == '+' || c == '-' || c == '*') {\n int second = stack.pop();\n int first = stack.pop();\n if (c == '+') {\n first += second;\n } else if (c == '-') {\n first -= second;\n } else {\n first *= second;\n }\n stack.push(first);\n } else {\n stack.push(Integer.parseInt(x));\n }\n }\n System.out.println(stack.pop());\n }\n}",
"Main",
"public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n String[] line = sc.nextLine().split(\" \");\n ArrayDeque<Integer> stack = new ArrayDeque<>();\n for (String x : line) {\n char c = x.charAt(0);\n if (c == '+' || c == '-' || c == '*') {\n int second = stack.pop();\n int first = stack.pop();\n if (c == '+') {\n first += second;\n } else if (c == '-') {\n first -= second;\n } else {\n first *= second;\n }\n stack.push(first);\n } else {\n stack.push(Integer.parseInt(x));\n }\n }\n System.out.println(stack.pop());\n }",
"main",
"{\n Scanner sc = new Scanner(System.in);\n String[] line = sc.nextLine().split(\" \");\n ArrayDeque<Integer> stack = new ArrayDeque<>();\n for (String x : line) {\n char c = x.charAt(0);\n if (c == '+' || c == '-' || c == '*') {\n int second = stack.pop();\n int first = stack.pop();\n if (c == '+') {\n first += second;\n } else if (c == '-') {\n first -= second;\n } else {\n first *= second;\n }\n stack.push(first);\n } else {\n stack.push(Integer.parseInt(x));\n }\n }\n System.out.println(stack.pop());\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"String[] line = sc.nextLine().split(\" \");",
"line",
"sc.nextLine().split(\" \")",
"sc.nextLine().split",
"sc.nextLine()",
"sc.nextLine",
"sc",
"\" \"",
"ArrayDeque<Integer> stack = new ArrayDeque<>();",
"stack",
"new ArrayDeque<>()",
"for (String x : line) {\n char c = x.charAt(0);\n if (c == '+' || c == '-' || c == '*') {\n int second = stack.pop();\n int first = stack.pop();\n if (c == '+') {\n first += second;\n } else if (c == '-') {\n first -= second;\n } else {\n first *= second;\n }\n stack.push(first);\n } else {\n stack.push(Integer.parseInt(x));\n }\n }",
"String x",
"line",
"{\n char c = x.charAt(0);\n if (c == '+' || c == '-' || c == '*') {\n int second = stack.pop();\n int first = stack.pop();\n if (c == '+') {\n first += second;\n } else if (c == '-') {\n first -= second;\n } else {\n first *= second;\n }\n stack.push(first);\n } else {\n stack.push(Integer.parseInt(x));\n }\n }",
"{\n char c = x.charAt(0);\n if (c == '+' || c == '-' || c == '*') {\n int second = stack.pop();\n int first = stack.pop();\n if (c == '+') {\n first += second;\n } else if (c == '-') {\n first -= second;\n } else {\n first *= second;\n }\n stack.push(first);\n } else {\n stack.push(Integer.parseInt(x));\n }\n }",
"char c = x.charAt(0);",
"c",
"x.charAt(0)",
"x.charAt",
"x",
"0",
"if (c == '+' || c == '-' || c == '*') {\n int second = stack.pop();\n int first = stack.pop();\n if (c == '+') {\n first += second;\n } else if (c == '-') {\n first -= second;\n } else {\n first *= second;\n }\n stack.push(first);\n } else {\n stack.push(Integer.parseInt(x));\n }",
"c == '+' || c == '-' || c == '*'",
"c == '+' || c == '-' || c == '*'",
"c == '+'",
"c",
"'+'",
"c == '-'",
"c",
"'-'",
"c == '*'",
"c",
"'*'",
"{\n int second = stack.pop();\n int first = stack.pop();\n if (c == '+') {\n first += second;\n } else if (c == '-') {\n first -= second;\n } else {\n first *= second;\n }\n stack.push(first);\n }",
"int second = stack.pop();",
"second",
"stack.pop()",
"stack.pop",
"stack",
"int first = stack.pop();",
"first",
"stack.pop()",
"stack.pop",
"stack",
"if (c == '+') {\n first += second;\n } else if (c == '-') {\n first -= second;\n } else {\n first *= second;\n }",
"c == '+'",
"c",
"'+'",
"{\n first += second;\n }",
"first += second",
"first",
"second",
"if (c == '-') {\n first -= second;\n } else {\n first *= second;\n }",
"c == '-'",
"c",
"'-'",
"{\n first -= second;\n }",
"first -= second",
"first",
"second",
"{\n first *= second;\n }",
"first *= second",
"first",
"second",
"stack.push(first)",
"stack.push",
"stack",
"first",
"{\n stack.push(Integer.parseInt(x));\n }",
"stack.push(Integer.parseInt(x))",
"stack.push",
"stack",
"Integer.parseInt(x)",
"Integer.parseInt",
"Integer",
"x",
"System.out.println(stack.pop())",
"System.out.println",
"System.out",
"System",
"System.out",
"stack.pop()",
"stack.pop",
"stack",
"String[] args",
"args",
"public class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n String[] line = sc.nextLine().split(\" \");\n ArrayDeque<Integer> stack = new ArrayDeque<>();\n for (String x : line) {\n char c = x.charAt(0);\n if (c == '+' || c == '-' || c == '*') {\n int second = stack.pop();\n int first = stack.pop();\n if (c == '+') {\n first += second;\n } else if (c == '-') {\n first -= second;\n } else {\n first *= second;\n }\n stack.push(first);\n } else {\n stack.push(Integer.parseInt(x));\n }\n }\n System.out.println(stack.pop());\n }\n}",
"public class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n String[] line = sc.nextLine().split(\" \");\n ArrayDeque<Integer> stack = new ArrayDeque<>();\n for (String x : line) {\n char c = x.charAt(0);\n if (c == '+' || c == '-' || c == '*') {\n int second = stack.pop();\n int first = stack.pop();\n if (c == '+') {\n first += second;\n } else if (c == '-') {\n first -= second;\n } else {\n first *= second;\n }\n stack.push(first);\n } else {\n stack.push(Integer.parseInt(x));\n }\n }\n System.out.println(stack.pop());\n }\n}",
"Main"
] | import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String[] line = sc.nextLine().split(" ");
ArrayDeque<Integer> stack = new ArrayDeque<>();
for (String x : line) {
char c = x.charAt(0);
if (c == '+' || c == '-' || c == '*') {
int second = stack.pop();
int first = stack.pop();
if (c == '+') {
first += second;
} else if (c == '-') {
first -= second;
} else {
first *= second;
}
stack.push(first);
} else {
stack.push(Integer.parseInt(x));
}
}
System.out.println(stack.pop());
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
20,
41,
13,
20,
4,
18,
13,
42,
4,
18,
13,
30,
14,
4,
18,
13,
30,
4,
18,
13,
4,
18,
13,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
14,
4,
18,
13,
17,
30,
4,
18,
13,
2,
13,
13,
14,
4,
18,
13,
17,
30,
4,
18,
13,
2,
13,
13,
30,
4,
18,
13,
2,
13,
13,
4,
18,
13,
4,
18,
18,
13,
13,
4,
18,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
98,
5
],
[
98,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
8,
15
],
[
15,
16
],
[
15,
17
],
[
8,
18
],
[
18,
19
],
[
19,
20
],
[
8,
21
],
[
21,
22
],
[
22,
23
],
[
23,
24
],
[
21,
25
],
[
25,
26
],
[
26,
27
],
[
27,
28
],
[
28,
29
],
[
26,
30
],
[
30,
31
],
[
31,
32
],
[
32,
33
],
[
31,
34
],
[
34,
35
],
[
35,
36
],
[
26,
37
],
[
37,
38
],
[
38,
39
],
[
38,
40
],
[
40,
41
],
[
41,
42
],
[
37,
43
],
[
43,
44
],
[
43,
45
],
[
45,
46
],
[
46,
47
],
[
37,
48
],
[
48,
49
],
[
48,
50
],
[
50,
51
],
[
51,
52
],
[
37,
53
],
[
53,
54
],
[
54,
55
],
[
55,
56
],
[
54,
57
],
[
53,
58
],
[
58,
59
],
[
59,
60
],
[
60,
61
],
[
59,
62
],
[
62,
63
],
[
62,
64
],
[
53,
65
],
[
65,
66
],
[
66,
67
],
[
67,
68
],
[
66,
69
],
[
65,
70
],
[
70,
71
],
[
71,
72
],
[
72,
73
],
[
71,
74
],
[
74,
75
],
[
74,
76
],
[
65,
77
],
[
77,
78
],
[
78,
79
],
[
79,
80
],
[
78,
81
],
[
81,
82
],
[
81,
83
],
[
8,
84
],
[
84,
85
],
[
85,
86
],
[
8,
87
],
[
87,
88
],
[
88,
89
],
[
89,
90
],
[
89,
91
],
[
87,
92
],
[
92,
93
],
[
93,
94
],
[
6,
95
],
[
95,
96
],
[
0,
97
],
[
97,
98
],
[
97,
99
]
] | [
"import java.util.*;\n\npublic class Main {\n\tpublic static void main(String[] args) {\n\t\tStack<Long> stack = new Stack<Long>();\n\t\tScanner scanner0 = new Scanner(System.in);\n\t\tScanner scanner = new Scanner(scanner0.nextLine());\n\t\tscanner0.close();\n\t\t\n\t\twhile (scanner.hasNext()) {\n\t\t\tif (scanner.hasNextLong()) {\n\t\t\t\tstack.push(scanner.nextLong());\n\t\t\t} else {\n\t\t\t\tlong operand2 = stack.pop();\n\t\t\t\tlong operand1 = stack.pop();\n\t\t\t\tString operator = scanner.next();\n\t\t\t\t\n\t\t\t\tif (operator.equals(\"+\")) {\n\t\t\t\t\tstack.push(operand1 + operand2);\n\t\t\t\t} else if (operator.equals(\"-\")) {\n\t\t\t\t\tstack.push(operand1 - operand2);\n\t\t\t\t} else {\n\t\t\t\t\tstack.push(operand1 * operand2);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\t\t\n\t\tscanner.close();\n\t\t\n\t\tSystem.out.println(stack.pop());\n\t}\n} \n",
"import java.util.*;",
"util.*",
"java",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tStack<Long> stack = new Stack<Long>();\n\t\tScanner scanner0 = new Scanner(System.in);\n\t\tScanner scanner = new Scanner(scanner0.nextLine());\n\t\tscanner0.close();\n\t\t\n\t\twhile (scanner.hasNext()) {\n\t\t\tif (scanner.hasNextLong()) {\n\t\t\t\tstack.push(scanner.nextLong());\n\t\t\t} else {\n\t\t\t\tlong operand2 = stack.pop();\n\t\t\t\tlong operand1 = stack.pop();\n\t\t\t\tString operator = scanner.next();\n\t\t\t\t\n\t\t\t\tif (operator.equals(\"+\")) {\n\t\t\t\t\tstack.push(operand1 + operand2);\n\t\t\t\t} else if (operator.equals(\"-\")) {\n\t\t\t\t\tstack.push(operand1 - operand2);\n\t\t\t\t} else {\n\t\t\t\t\tstack.push(operand1 * operand2);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\t\t\n\t\tscanner.close();\n\t\t\n\t\tSystem.out.println(stack.pop());\n\t}\n}",
"Main",
"public static void main(String[] args) {\n\t\tStack<Long> stack = new Stack<Long>();\n\t\tScanner scanner0 = new Scanner(System.in);\n\t\tScanner scanner = new Scanner(scanner0.nextLine());\n\t\tscanner0.close();\n\t\t\n\t\twhile (scanner.hasNext()) {\n\t\t\tif (scanner.hasNextLong()) {\n\t\t\t\tstack.push(scanner.nextLong());\n\t\t\t} else {\n\t\t\t\tlong operand2 = stack.pop();\n\t\t\t\tlong operand1 = stack.pop();\n\t\t\t\tString operator = scanner.next();\n\t\t\t\t\n\t\t\t\tif (operator.equals(\"+\")) {\n\t\t\t\t\tstack.push(operand1 + operand2);\n\t\t\t\t} else if (operator.equals(\"-\")) {\n\t\t\t\t\tstack.push(operand1 - operand2);\n\t\t\t\t} else {\n\t\t\t\t\tstack.push(operand1 * operand2);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\t\t\n\t\tscanner.close();\n\t\t\n\t\tSystem.out.println(stack.pop());\n\t}",
"main",
"{\n\t\tStack<Long> stack = new Stack<Long>();\n\t\tScanner scanner0 = new Scanner(System.in);\n\t\tScanner scanner = new Scanner(scanner0.nextLine());\n\t\tscanner0.close();\n\t\t\n\t\twhile (scanner.hasNext()) {\n\t\t\tif (scanner.hasNextLong()) {\n\t\t\t\tstack.push(scanner.nextLong());\n\t\t\t} else {\n\t\t\t\tlong operand2 = stack.pop();\n\t\t\t\tlong operand1 = stack.pop();\n\t\t\t\tString operator = scanner.next();\n\t\t\t\t\n\t\t\t\tif (operator.equals(\"+\")) {\n\t\t\t\t\tstack.push(operand1 + operand2);\n\t\t\t\t} else if (operator.equals(\"-\")) {\n\t\t\t\t\tstack.push(operand1 - operand2);\n\t\t\t\t} else {\n\t\t\t\t\tstack.push(operand1 * operand2);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\t\t\n\t\tscanner.close();\n\t\t\n\t\tSystem.out.println(stack.pop());\n\t}",
"Stack<Long> stack = new Stack<Long>();",
"stack",
"new Stack<Long>()",
"Scanner scanner0 = new Scanner(System.in);",
"scanner0",
"new Scanner(System.in)",
"Scanner scanner = new Scanner(scanner0.nextLine());",
"scanner",
"new Scanner(scanner0.nextLine())",
"scanner0.close()",
"scanner0.close",
"scanner0",
"while (scanner.hasNext()) {\n\t\t\tif (scanner.hasNextLong()) {\n\t\t\t\tstack.push(scanner.nextLong());\n\t\t\t} else {\n\t\t\t\tlong operand2 = stack.pop();\n\t\t\t\tlong operand1 = stack.pop();\n\t\t\t\tString operator = scanner.next();\n\t\t\t\t\n\t\t\t\tif (operator.equals(\"+\")) {\n\t\t\t\t\tstack.push(operand1 + operand2);\n\t\t\t\t} else if (operator.equals(\"-\")) {\n\t\t\t\t\tstack.push(operand1 - operand2);\n\t\t\t\t} else {\n\t\t\t\t\tstack.push(operand1 * operand2);\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"scanner.hasNext()",
"scanner.hasNext",
"scanner",
"{\n\t\t\tif (scanner.hasNextLong()) {\n\t\t\t\tstack.push(scanner.nextLong());\n\t\t\t} else {\n\t\t\t\tlong operand2 = stack.pop();\n\t\t\t\tlong operand1 = stack.pop();\n\t\t\t\tString operator = scanner.next();\n\t\t\t\t\n\t\t\t\tif (operator.equals(\"+\")) {\n\t\t\t\t\tstack.push(operand1 + operand2);\n\t\t\t\t} else if (operator.equals(\"-\")) {\n\t\t\t\t\tstack.push(operand1 - operand2);\n\t\t\t\t} else {\n\t\t\t\t\tstack.push(operand1 * operand2);\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"if (scanner.hasNextLong()) {\n\t\t\t\tstack.push(scanner.nextLong());\n\t\t\t} else {\n\t\t\t\tlong operand2 = stack.pop();\n\t\t\t\tlong operand1 = stack.pop();\n\t\t\t\tString operator = scanner.next();\n\t\t\t\t\n\t\t\t\tif (operator.equals(\"+\")) {\n\t\t\t\t\tstack.push(operand1 + operand2);\n\t\t\t\t} else if (operator.equals(\"-\")) {\n\t\t\t\t\tstack.push(operand1 - operand2);\n\t\t\t\t} else {\n\t\t\t\t\tstack.push(operand1 * operand2);\n\t\t\t\t}\n\t\t\t}",
"scanner.hasNextLong()",
"scanner.hasNextLong",
"scanner",
"{\n\t\t\t\tstack.push(scanner.nextLong());\n\t\t\t}",
"stack.push(scanner.nextLong())",
"stack.push",
"stack",
"scanner.nextLong()",
"scanner.nextLong",
"scanner",
"{\n\t\t\t\tlong operand2 = stack.pop();\n\t\t\t\tlong operand1 = stack.pop();\n\t\t\t\tString operator = scanner.next();\n\t\t\t\t\n\t\t\t\tif (operator.equals(\"+\")) {\n\t\t\t\t\tstack.push(operand1 + operand2);\n\t\t\t\t} else if (operator.equals(\"-\")) {\n\t\t\t\t\tstack.push(operand1 - operand2);\n\t\t\t\t} else {\n\t\t\t\t\tstack.push(operand1 * operand2);\n\t\t\t\t}\n\t\t\t}",
"long operand2 = stack.pop();",
"operand2",
"stack.pop()",
"stack.pop",
"stack",
"long operand1 = stack.pop();",
"operand1",
"stack.pop()",
"stack.pop",
"stack",
"String operator = scanner.next();",
"operator",
"scanner.next()",
"scanner.next",
"scanner",
"if (operator.equals(\"+\")) {\n\t\t\t\t\tstack.push(operand1 + operand2);\n\t\t\t\t} else if (operator.equals(\"-\")) {\n\t\t\t\t\tstack.push(operand1 - operand2);\n\t\t\t\t} else {\n\t\t\t\t\tstack.push(operand1 * operand2);\n\t\t\t\t}",
"operator.equals(\"+\")",
"operator.equals",
"operator",
"\"+\"",
"{\n\t\t\t\t\tstack.push(operand1 + operand2);\n\t\t\t\t}",
"stack.push(operand1 + operand2)",
"stack.push",
"stack",
"operand1 + operand2",
"operand1",
"operand2",
"if (operator.equals(\"-\")) {\n\t\t\t\t\tstack.push(operand1 - operand2);\n\t\t\t\t} else {\n\t\t\t\t\tstack.push(operand1 * operand2);\n\t\t\t\t}",
"operator.equals(\"-\")",
"operator.equals",
"operator",
"\"-\"",
"{\n\t\t\t\t\tstack.push(operand1 - operand2);\n\t\t\t\t}",
"stack.push(operand1 - operand2)",
"stack.push",
"stack",
"operand1 - operand2",
"operand1",
"operand2",
"{\n\t\t\t\t\tstack.push(operand1 * operand2);\n\t\t\t\t}",
"stack.push(operand1 * operand2)",
"stack.push",
"stack",
"operand1 * operand2",
"operand1",
"operand2",
"scanner.close()",
"scanner.close",
"scanner",
"System.out.println(stack.pop())",
"System.out.println",
"System.out",
"System",
"System.out",
"stack.pop()",
"stack.pop",
"stack",
"String[] args",
"args",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tStack<Long> stack = new Stack<Long>();\n\t\tScanner scanner0 = new Scanner(System.in);\n\t\tScanner scanner = new Scanner(scanner0.nextLine());\n\t\tscanner0.close();\n\t\t\n\t\twhile (scanner.hasNext()) {\n\t\t\tif (scanner.hasNextLong()) {\n\t\t\t\tstack.push(scanner.nextLong());\n\t\t\t} else {\n\t\t\t\tlong operand2 = stack.pop();\n\t\t\t\tlong operand1 = stack.pop();\n\t\t\t\tString operator = scanner.next();\n\t\t\t\t\n\t\t\t\tif (operator.equals(\"+\")) {\n\t\t\t\t\tstack.push(operand1 + operand2);\n\t\t\t\t} else if (operator.equals(\"-\")) {\n\t\t\t\t\tstack.push(operand1 - operand2);\n\t\t\t\t} else {\n\t\t\t\t\tstack.push(operand1 * operand2);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\t\t\n\t\tscanner.close();\n\t\t\n\t\tSystem.out.println(stack.pop());\n\t}\n}",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tStack<Long> stack = new Stack<Long>();\n\t\tScanner scanner0 = new Scanner(System.in);\n\t\tScanner scanner = new Scanner(scanner0.nextLine());\n\t\tscanner0.close();\n\t\t\n\t\twhile (scanner.hasNext()) {\n\t\t\tif (scanner.hasNextLong()) {\n\t\t\t\tstack.push(scanner.nextLong());\n\t\t\t} else {\n\t\t\t\tlong operand2 = stack.pop();\n\t\t\t\tlong operand1 = stack.pop();\n\t\t\t\tString operator = scanner.next();\n\t\t\t\t\n\t\t\t\tif (operator.equals(\"+\")) {\n\t\t\t\t\tstack.push(operand1 + operand2);\n\t\t\t\t} else if (operator.equals(\"-\")) {\n\t\t\t\t\tstack.push(operand1 - operand2);\n\t\t\t\t} else {\n\t\t\t\t\tstack.push(operand1 * operand2);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\t\t\n\t\tscanner.close();\n\t\t\n\t\tSystem.out.println(stack.pop());\n\t}\n}",
"Main"
] | import java.util.*;
public class Main {
public static void main(String[] args) {
Stack<Long> stack = new Stack<Long>();
Scanner scanner0 = new Scanner(System.in);
Scanner scanner = new Scanner(scanner0.nextLine());
scanner0.close();
while (scanner.hasNext()) {
if (scanner.hasNextLong()) {
stack.push(scanner.nextLong());
} else {
long operand2 = stack.pop();
long operand1 = stack.pop();
String operator = scanner.next();
if (operator.equals("+")) {
stack.push(operand1 + operand2);
} else if (operator.equals("-")) {
stack.push(operand1 - operand2);
} else {
stack.push(operand1 * operand2);
}
}
}
scanner.close();
System.out.println(stack.pop());
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
4,
18,
13,
17,
41,
13,
20,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
30,
41,
13,
18,
13,
13,
14,
4,
18,
13,
17,
30,
4,
18,
13,
2,
4,
18,
13,
4,
18,
13,
14,
4,
18,
13,
17,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
4,
18,
13,
2,
13,
13,
14,
4,
18,
13,
17,
30,
4,
18,
13,
2,
4,
18,
13,
4,
18,
13,
30,
4,
18,
13,
4,
18,
13,
13,
4,
18,
18,
13,
13,
4,
18,
13,
23,
13,
6,
13,
41,
13,
12,
13,
30,
0,
13,
20,
12,
13,
30,
4,
18,
13,
13,
23,
13,
12,
13,
30,
41,
13,
4,
18,
13,
2,
4,
18,
13,
17,
4,
18,
13,
2,
4,
18,
13,
17,
29,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
10,
11
],
[
10,
12
],
[
0,
13
],
[
167,
14
],
[
167,
15
],
[
15,
16
],
[
15,
17
],
[
17,
18
],
[
18,
19
],
[
18,
20
],
[
17,
21
],
[
21,
22
],
[
21,
23
],
[
23,
24
],
[
24,
25
],
[
25,
26
],
[
26,
27
],
[
23,
28
],
[
17,
29
],
[
29,
30
],
[
29,
31
],
[
17,
32
],
[
32,
33
],
[
33,
34
],
[
34,
35
],
[
34,
36
],
[
32,
37
],
[
37,
38
],
[
37,
39
],
[
39,
40
],
[
39,
41
],
[
32,
42
],
[
42,
43
],
[
43,
44
],
[
32,
45
],
[
46,
46
],
[
46,
47
],
[
47,
48
],
[
47,
49
],
[
49,
50
],
[
49,
51
],
[
46,
52
],
[
52,
53
],
[
53,
54
],
[
54,
55
],
[
53,
56
],
[
52,
57
],
[
57,
58
],
[
58,
59
],
[
59,
60
],
[
58,
61
],
[
61,
62
],
[
62,
63
],
[
63,
64
],
[
61,
65
],
[
65,
66
],
[
66,
67
],
[
52,
68
],
[
68,
69
],
[
69,
70
],
[
70,
71
],
[
69,
72
],
[
68,
73
],
[
73,
74
],
[
74,
75
],
[
74,
76
],
[
76,
77
],
[
77,
78
],
[
73,
79
],
[
79,
80
],
[
79,
81
],
[
81,
82
],
[
82,
83
],
[
73,
84
],
[
84,
85
],
[
85,
86
],
[
84,
87
],
[
87,
88
],
[
87,
89
],
[
68,
90
],
[
90,
91
],
[
91,
92
],
[
92,
93
],
[
91,
94
],
[
90,
95
],
[
95,
96
],
[
96,
97
],
[
97,
98
],
[
96,
99
],
[
99,
100
],
[
100,
101
],
[
101,
102
],
[
99,
103
],
[
103,
104
],
[
104,
105
],
[
90,
106
],
[
106,
107
],
[
107,
108
],
[
108,
109
],
[
107,
110
],
[
110,
111
],
[
111,
112
],
[
110,
113
],
[
17,
114
],
[
114,
115
],
[
115,
116
],
[
116,
117
],
[
116,
118
],
[
114,
119
],
[
119,
120
],
[
120,
121
],
[
15,
122
],
[
122,
123
],
[
0,
124
],
[
124,
125
],
[
124,
126
],
[
126,
127
],
[
124,
128
],
[
128,
129
],
[
128,
130
],
[
130,
131
],
[
131,
132
],
[
131,
133
],
[
124,
134
],
[
134,
135
],
[
134,
136
],
[
136,
137
],
[
137,
138
],
[
138,
139
],
[
137,
140
],
[
134,
141
],
[
141,
142
],
[
124,
143
],
[
143,
144
],
[
143,
145
],
[
145,
146
],
[
146,
147
],
[
146,
148
],
[
148,
149
],
[
149,
150
],
[
148,
151
],
[
151,
152
],
[
152,
153
],
[
153,
154
],
[
151,
155
],
[
145,
156
],
[
156,
157
],
[
157,
158
],
[
156,
159
],
[
159,
160
],
[
160,
161
],
[
161,
162
],
[
159,
163
],
[
145,
164
],
[
164,
165
],
[
0,
166
],
[
166,
167
],
[
166,
168
]
] | [
"import java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\nimport java.util.ArrayList;\n\n\npublic class Main {\n\tpublic static void main(String[] args) throws NumberFormatException, IOException {\n\t\t//????????????????????????\n\t\tBufferedReader bf = new BufferedReader(new InputStreamReader(System.in));\n\t\t\n\t\t//?????????\n\t\tString[] arrayString = bf.readLine().split(\" \");\n\t\t\n\t\t//Stack\n\t\tStack stack=new Stack();\n\t\t\n\t\tfor(int i=0;i<arrayString.length;i++){\n\t\t\tString str=arrayString[i];\n\t\t\tif(str.equals(\"+\")){\n\t\t\t\tstack.push(stack.pop()+stack.pop());\n\t\t\t}else if(str.equals(\"-\")){\n\t\t\t\tint a=stack.pop();\n\t\t\t\tint b=stack.pop();\n\t\t\t\tstack.push(b-a);\n\t\t\t}else if(str.equals(\"*\")){\n\t\t\t\tstack.push(stack.pop()*stack.pop());\n\t\t\t}else{\n\t\t\t\tstack.push(Integer.parseInt(str));\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(stack.pop());\n\t}\n\n}\nclass Stack{\n\tArrayList<Integer> array;\n\t\n\tpublic Stack(){\n\t\tarray=new ArrayList<Integer>();\n\t}\n\t\n\tpublic void push(int i){\n\t\tarray.add(i);\n\t}\n\t\n\tpublic int pop(){\n\t\tint result=array.get(array.size()-1);\n\t\tarray.remove(array.size()-1);\n\t\treturn result;\n\t}\n}",
"import java.io.BufferedReader;",
"BufferedReader",
"java.io",
"import java.io.IOException;",
"IOException",
"java.io",
"import java.io.InputStreamReader;",
"InputStreamReader",
"java.io",
"import java.util.ArrayList;",
"ArrayList",
"java.util",
"public class Main {\n\tpublic static void main(String[] args) throws NumberFormatException, IOException {\n\t\t//????????????????????????\n\t\tBufferedReader bf = new BufferedReader(new InputStreamReader(System.in));\n\t\t\n\t\t//?????????\n\t\tString[] arrayString = bf.readLine().split(\" \");\n\t\t\n\t\t//Stack\n\t\tStack stack=new Stack();\n\t\t\n\t\tfor(int i=0;i<arrayString.length;i++){\n\t\t\tString str=arrayString[i];\n\t\t\tif(str.equals(\"+\")){\n\t\t\t\tstack.push(stack.pop()+stack.pop());\n\t\t\t}else if(str.equals(\"-\")){\n\t\t\t\tint a=stack.pop();\n\t\t\t\tint b=stack.pop();\n\t\t\t\tstack.push(b-a);\n\t\t\t}else if(str.equals(\"*\")){\n\t\t\t\tstack.push(stack.pop()*stack.pop());\n\t\t\t}else{\n\t\t\t\tstack.push(Integer.parseInt(str));\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(stack.pop());\n\t}\n\n}",
"Main",
"public static void main(String[] args) throws NumberFormatException, IOException {\n\t\t//????????????????????????\n\t\tBufferedReader bf = new BufferedReader(new InputStreamReader(System.in));\n\t\t\n\t\t//?????????\n\t\tString[] arrayString = bf.readLine().split(\" \");\n\t\t\n\t\t//Stack\n\t\tStack stack=new Stack();\n\t\t\n\t\tfor(int i=0;i<arrayString.length;i++){\n\t\t\tString str=arrayString[i];\n\t\t\tif(str.equals(\"+\")){\n\t\t\t\tstack.push(stack.pop()+stack.pop());\n\t\t\t}else if(str.equals(\"-\")){\n\t\t\t\tint a=stack.pop();\n\t\t\t\tint b=stack.pop();\n\t\t\t\tstack.push(b-a);\n\t\t\t}else if(str.equals(\"*\")){\n\t\t\t\tstack.push(stack.pop()*stack.pop());\n\t\t\t}else{\n\t\t\t\tstack.push(Integer.parseInt(str));\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(stack.pop());\n\t}",
"main",
"{\n\t\t//????????????????????????\n\t\tBufferedReader bf = new BufferedReader(new InputStreamReader(System.in));\n\t\t\n\t\t//?????????\n\t\tString[] arrayString = bf.readLine().split(\" \");\n\t\t\n\t\t//Stack\n\t\tStack stack=new Stack();\n\t\t\n\t\tfor(int i=0;i<arrayString.length;i++){\n\t\t\tString str=arrayString[i];\n\t\t\tif(str.equals(\"+\")){\n\t\t\t\tstack.push(stack.pop()+stack.pop());\n\t\t\t}else if(str.equals(\"-\")){\n\t\t\t\tint a=stack.pop();\n\t\t\t\tint b=stack.pop();\n\t\t\t\tstack.push(b-a);\n\t\t\t}else if(str.equals(\"*\")){\n\t\t\t\tstack.push(stack.pop()*stack.pop());\n\t\t\t}else{\n\t\t\t\tstack.push(Integer.parseInt(str));\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(stack.pop());\n\t}",
"BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));",
"bf",
"new BufferedReader(new InputStreamReader(System.in))",
"String[] arrayString = bf.readLine().split(\" \");",
"arrayString",
"bf.readLine().split(\" \")",
"bf.readLine().split",
"bf.readLine()",
"bf.readLine",
"bf",
"\" \"",
"Stack stack=new Stack();",
"stack",
"new Stack()",
"for(int i=0;i<arrayString.length;i++){\n\t\t\tString str=arrayString[i];\n\t\t\tif(str.equals(\"+\")){\n\t\t\t\tstack.push(stack.pop()+stack.pop());\n\t\t\t}else if(str.equals(\"-\")){\n\t\t\t\tint a=stack.pop();\n\t\t\t\tint b=stack.pop();\n\t\t\t\tstack.push(b-a);\n\t\t\t}else if(str.equals(\"*\")){\n\t\t\t\tstack.push(stack.pop()*stack.pop());\n\t\t\t}else{\n\t\t\t\tstack.push(Integer.parseInt(str));\n\t\t\t}\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<arrayString.length",
"i",
"arrayString.length",
"arrayString",
"arrayString.length",
"i++",
"i++",
"i",
"{\n\t\t\tString str=arrayString[i];\n\t\t\tif(str.equals(\"+\")){\n\t\t\t\tstack.push(stack.pop()+stack.pop());\n\t\t\t}else if(str.equals(\"-\")){\n\t\t\t\tint a=stack.pop();\n\t\t\t\tint b=stack.pop();\n\t\t\t\tstack.push(b-a);\n\t\t\t}else if(str.equals(\"*\")){\n\t\t\t\tstack.push(stack.pop()*stack.pop());\n\t\t\t}else{\n\t\t\t\tstack.push(Integer.parseInt(str));\n\t\t\t}\n\t\t}",
"{\n\t\t\tString str=arrayString[i];\n\t\t\tif(str.equals(\"+\")){\n\t\t\t\tstack.push(stack.pop()+stack.pop());\n\t\t\t}else if(str.equals(\"-\")){\n\t\t\t\tint a=stack.pop();\n\t\t\t\tint b=stack.pop();\n\t\t\t\tstack.push(b-a);\n\t\t\t}else if(str.equals(\"*\")){\n\t\t\t\tstack.push(stack.pop()*stack.pop());\n\t\t\t}else{\n\t\t\t\tstack.push(Integer.parseInt(str));\n\t\t\t}\n\t\t}",
"String str=arrayString[i];",
"str",
"arrayString[i]",
"arrayString",
"i",
"if(str.equals(\"+\")){\n\t\t\t\tstack.push(stack.pop()+stack.pop());\n\t\t\t}else if(str.equals(\"-\")){\n\t\t\t\tint a=stack.pop();\n\t\t\t\tint b=stack.pop();\n\t\t\t\tstack.push(b-a);\n\t\t\t}else if(str.equals(\"*\")){\n\t\t\t\tstack.push(stack.pop()*stack.pop());\n\t\t\t}else{\n\t\t\t\tstack.push(Integer.parseInt(str));\n\t\t\t}",
"str.equals(\"+\")",
"str.equals",
"str",
"\"+\"",
"{\n\t\t\t\tstack.push(stack.pop()+stack.pop());\n\t\t\t}",
"stack.push(stack.pop()+stack.pop())",
"stack.push",
"stack",
"stack.pop()+stack.pop()",
"stack.pop()",
"stack.pop",
"stack",
"stack.pop()",
"stack.pop",
"stack",
"if(str.equals(\"-\")){\n\t\t\t\tint a=stack.pop();\n\t\t\t\tint b=stack.pop();\n\t\t\t\tstack.push(b-a);\n\t\t\t}else if(str.equals(\"*\")){\n\t\t\t\tstack.push(stack.pop()*stack.pop());\n\t\t\t}else{\n\t\t\t\tstack.push(Integer.parseInt(str));\n\t\t\t}",
"str.equals(\"-\")",
"str.equals",
"str",
"\"-\"",
"{\n\t\t\t\tint a=stack.pop();\n\t\t\t\tint b=stack.pop();\n\t\t\t\tstack.push(b-a);\n\t\t\t}",
"int a=stack.pop();",
"a",
"stack.pop()",
"stack.pop",
"stack",
"int b=stack.pop();",
"b",
"stack.pop()",
"stack.pop",
"stack",
"stack.push(b-a)",
"stack.push",
"stack",
"b-a",
"b",
"a",
"if(str.equals(\"*\")){\n\t\t\t\tstack.push(stack.pop()*stack.pop());\n\t\t\t}else{\n\t\t\t\tstack.push(Integer.parseInt(str));\n\t\t\t}",
"str.equals(\"*\")",
"str.equals",
"str",
"\"*\"",
"{\n\t\t\t\tstack.push(stack.pop()*stack.pop());\n\t\t\t}",
"stack.push(stack.pop()*stack.pop())",
"stack.push",
"stack",
"stack.pop()*stack.pop()",
"stack.pop()",
"stack.pop",
"stack",
"stack.pop()",
"stack.pop",
"stack",
"{\n\t\t\t\tstack.push(Integer.parseInt(str));\n\t\t\t}",
"stack.push(Integer.parseInt(str))",
"stack.push",
"stack",
"Integer.parseInt(str)",
"Integer.parseInt",
"Integer",
"str",
"System.out.println(stack.pop())",
"System.out.println",
"System.out",
"System",
"System.out",
"stack.pop()",
"stack.pop",
"stack",
"String[] args",
"args",
"class Stack{\n\tArrayList<Integer> array;\n\t\n\tpublic Stack(){\n\t\tarray=new ArrayList<Integer>();\n\t}\n\t\n\tpublic void push(int i){\n\t\tarray.add(i);\n\t}\n\t\n\tpublic int pop(){\n\t\tint result=array.get(array.size()-1);\n\t\tarray.remove(array.size()-1);\n\t\treturn result;\n\t}\n}",
"Stack",
"ArrayList<Integer> array;",
"array",
"public Stack(){\n\t\tarray=new ArrayList<Integer>();\n\t}",
"Stack",
"{\n\t\tarray=new ArrayList<Integer>();\n\t}",
"array=new ArrayList<Integer>()",
"array",
"new ArrayList<Integer>()",
"public void push(int i){\n\t\tarray.add(i);\n\t}",
"push",
"{\n\t\tarray.add(i);\n\t}",
"array.add(i)",
"array.add",
"array",
"i",
"int i",
"i",
"public int pop(){\n\t\tint result=array.get(array.size()-1);\n\t\tarray.remove(array.size()-1);\n\t\treturn result;\n\t}",
"pop",
"{\n\t\tint result=array.get(array.size()-1);\n\t\tarray.remove(array.size()-1);\n\t\treturn result;\n\t}",
"int result=array.get(array.size()-1);",
"result",
"array.get(array.size()-1)",
"array.get",
"array",
"array.size()-1",
"array.size()",
"array.size",
"array",
"1",
"array.remove(array.size()-1)",
"array.remove",
"array",
"array.size()-1",
"array.size()",
"array.size",
"array",
"1",
"return result;",
"result",
"public class Main {\n\tpublic static void main(String[] args) throws NumberFormatException, IOException {\n\t\t//????????????????????????\n\t\tBufferedReader bf = new BufferedReader(new InputStreamReader(System.in));\n\t\t\n\t\t//?????????\n\t\tString[] arrayString = bf.readLine().split(\" \");\n\t\t\n\t\t//Stack\n\t\tStack stack=new Stack();\n\t\t\n\t\tfor(int i=0;i<arrayString.length;i++){\n\t\t\tString str=arrayString[i];\n\t\t\tif(str.equals(\"+\")){\n\t\t\t\tstack.push(stack.pop()+stack.pop());\n\t\t\t}else if(str.equals(\"-\")){\n\t\t\t\tint a=stack.pop();\n\t\t\t\tint b=stack.pop();\n\t\t\t\tstack.push(b-a);\n\t\t\t}else if(str.equals(\"*\")){\n\t\t\t\tstack.push(stack.pop()*stack.pop());\n\t\t\t}else{\n\t\t\t\tstack.push(Integer.parseInt(str));\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(stack.pop());\n\t}\n\n}",
"public class Main {\n\tpublic static void main(String[] args) throws NumberFormatException, IOException {\n\t\t//????????????????????????\n\t\tBufferedReader bf = new BufferedReader(new InputStreamReader(System.in));\n\t\t\n\t\t//?????????\n\t\tString[] arrayString = bf.readLine().split(\" \");\n\t\t\n\t\t//Stack\n\t\tStack stack=new Stack();\n\t\t\n\t\tfor(int i=0;i<arrayString.length;i++){\n\t\t\tString str=arrayString[i];\n\t\t\tif(str.equals(\"+\")){\n\t\t\t\tstack.push(stack.pop()+stack.pop());\n\t\t\t}else if(str.equals(\"-\")){\n\t\t\t\tint a=stack.pop();\n\t\t\t\tint b=stack.pop();\n\t\t\t\tstack.push(b-a);\n\t\t\t}else if(str.equals(\"*\")){\n\t\t\t\tstack.push(stack.pop()*stack.pop());\n\t\t\t}else{\n\t\t\t\tstack.push(Integer.parseInt(str));\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(stack.pop());\n\t}\n\n}",
"Main"
] | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
public class Main {
public static void main(String[] args) throws NumberFormatException, IOException {
//????????????????????????
BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
//?????????
String[] arrayString = bf.readLine().split(" ");
//Stack
Stack stack=new Stack();
for(int i=0;i<arrayString.length;i++){
String str=arrayString[i];
if(str.equals("+")){
stack.push(stack.pop()+stack.pop());
}else if(str.equals("-")){
int a=stack.pop();
int b=stack.pop();
stack.push(b-a);
}else if(str.equals("*")){
stack.push(stack.pop()*stack.pop());
}else{
stack.push(Integer.parseInt(str));
}
}
System.out.println(stack.pop());
}
}
class Stack{
ArrayList<Integer> array;
public Stack(){
array=new ArrayList<Integer>();
}
public void push(int i){
array.add(i);
}
public int pop(){
int result=array.get(array.size()-1);
array.remove(array.size()-1);
return result;
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
20,
42,
4,
18,
13,
30,
41,
13,
4,
18,
13,
35,
13,
34,
17,
1,
4,
18,
13,
2,
4,
18,
13,
4,
18,
13,
3,
34,
17,
1,
4,
18,
13,
2,
2,
40,
17,
4,
18,
13,
4,
18,
13,
3,
34,
17,
1,
4,
18,
13,
2,
4,
18,
13,
4,
18,
13,
3,
34,
1,
4,
18,
13,
4,
18,
13,
13,
4,
18,
18,
13,
13,
4,
18,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
92,
5
],
[
92,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
8,
15
],
[
15,
16
],
[
16,
17
],
[
17,
18
],
[
15,
19
],
[
19,
20
],
[
20,
21
],
[
20,
22
],
[
22,
23
],
[
23,
24
],
[
19,
25
],
[
25,
26
],
[
25,
27
],
[
27,
28
],
[
27,
29
],
[
29,
30
],
[
30,
31
],
[
31,
32
],
[
30,
33
],
[
33,
34
],
[
34,
35
],
[
35,
36
],
[
33,
37
],
[
37,
38
],
[
38,
39
],
[
29,
40
],
[
25,
41
],
[
41,
42
],
[
41,
43
],
[
43,
44
],
[
44,
45
],
[
45,
46
],
[
44,
47
],
[
47,
48
],
[
48,
49
],
[
49,
50
],
[
48,
51
],
[
51,
52
],
[
52,
53
],
[
47,
54
],
[
54,
55
],
[
55,
56
],
[
43,
57
],
[
25,
58
],
[
58,
59
],
[
58,
60
],
[
60,
61
],
[
61,
62
],
[
62,
63
],
[
61,
64
],
[
64,
65
],
[
65,
66
],
[
66,
67
],
[
64,
68
],
[
68,
69
],
[
69,
70
],
[
60,
71
],
[
25,
72
],
[
72,
73
],
[
73,
74
],
[
74,
75
],
[
75,
76
],
[
74,
77
],
[
77,
78
],
[
78,
79
],
[
77,
80
],
[
8,
81
],
[
81,
82
],
[
82,
83
],
[
83,
84
],
[
83,
85
],
[
81,
86
],
[
86,
87
],
[
87,
88
],
[
6,
89
],
[
89,
90
],
[
0,
91
],
[
91,
92
],
[
91,
93
]
] | [
"import java.util.*;\n\npublic class Main {\t\n\tpublic static void main(String args[]){\n\t\tScanner sc = new Scanner(System.in);\n\t\t\n\t\tArrayDeque<Integer> s = new ArrayDeque<>();\n\t\t\n\t\twhile(sc.hasNext()){\n\t\t\tString str = sc.next();\n\t\t\t\n\t\t\tswitch(str){\n\t\t\tcase \"+\":\n\t\t\t\ts.push(s.pop() + s.pop());\n\t\t\t\tbreak;\n\t\t\tcase \"-\":\n\t\t\t\ts.push(-1 * s.pop() + s.pop());\n\t\t\t\tbreak;\n\t\t\tcase \"*\":\n\t\t\t\ts.push(s.pop() * s.pop());\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\ts.push(Integer.parseInt(str));\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(s.pop());\n\t}\n\t\n}\n",
"import java.util.*;",
"util.*",
"java",
"public class Main {\t\n\tpublic static void main(String args[]){\n\t\tScanner sc = new Scanner(System.in);\n\t\t\n\t\tArrayDeque<Integer> s = new ArrayDeque<>();\n\t\t\n\t\twhile(sc.hasNext()){\n\t\t\tString str = sc.next();\n\t\t\t\n\t\t\tswitch(str){\n\t\t\tcase \"+\":\n\t\t\t\ts.push(s.pop() + s.pop());\n\t\t\t\tbreak;\n\t\t\tcase \"-\":\n\t\t\t\ts.push(-1 * s.pop() + s.pop());\n\t\t\t\tbreak;\n\t\t\tcase \"*\":\n\t\t\t\ts.push(s.pop() * s.pop());\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\ts.push(Integer.parseInt(str));\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(s.pop());\n\t}\n\t\n}",
"Main",
"public static void main(String args[]){\n\t\tScanner sc = new Scanner(System.in);\n\t\t\n\t\tArrayDeque<Integer> s = new ArrayDeque<>();\n\t\t\n\t\twhile(sc.hasNext()){\n\t\t\tString str = sc.next();\n\t\t\t\n\t\t\tswitch(str){\n\t\t\tcase \"+\":\n\t\t\t\ts.push(s.pop() + s.pop());\n\t\t\t\tbreak;\n\t\t\tcase \"-\":\n\t\t\t\ts.push(-1 * s.pop() + s.pop());\n\t\t\t\tbreak;\n\t\t\tcase \"*\":\n\t\t\t\ts.push(s.pop() * s.pop());\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\ts.push(Integer.parseInt(str));\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(s.pop());\n\t}",
"main",
"{\n\t\tScanner sc = new Scanner(System.in);\n\t\t\n\t\tArrayDeque<Integer> s = new ArrayDeque<>();\n\t\t\n\t\twhile(sc.hasNext()){\n\t\t\tString str = sc.next();\n\t\t\t\n\t\t\tswitch(str){\n\t\t\tcase \"+\":\n\t\t\t\ts.push(s.pop() + s.pop());\n\t\t\t\tbreak;\n\t\t\tcase \"-\":\n\t\t\t\ts.push(-1 * s.pop() + s.pop());\n\t\t\t\tbreak;\n\t\t\tcase \"*\":\n\t\t\t\ts.push(s.pop() * s.pop());\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\ts.push(Integer.parseInt(str));\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(s.pop());\n\t}",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"ArrayDeque<Integer> s = new ArrayDeque<>();",
"s",
"new ArrayDeque<>()",
"while(sc.hasNext()){\n\t\t\tString str = sc.next();\n\t\t\t\n\t\t\tswitch(str){\n\t\t\tcase \"+\":\n\t\t\t\ts.push(s.pop() + s.pop());\n\t\t\t\tbreak;\n\t\t\tcase \"-\":\n\t\t\t\ts.push(-1 * s.pop() + s.pop());\n\t\t\t\tbreak;\n\t\t\tcase \"*\":\n\t\t\t\ts.push(s.pop() * s.pop());\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\ts.push(Integer.parseInt(str));\n\t\t\t}\n\t\t}",
"sc.hasNext()",
"sc.hasNext",
"sc",
"{\n\t\t\tString str = sc.next();\n\t\t\t\n\t\t\tswitch(str){\n\t\t\tcase \"+\":\n\t\t\t\ts.push(s.pop() + s.pop());\n\t\t\t\tbreak;\n\t\t\tcase \"-\":\n\t\t\t\ts.push(-1 * s.pop() + s.pop());\n\t\t\t\tbreak;\n\t\t\tcase \"*\":\n\t\t\t\ts.push(s.pop() * s.pop());\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\ts.push(Integer.parseInt(str));\n\t\t\t}\n\t\t}",
"String str = sc.next();",
"str",
"sc.next()",
"sc.next",
"sc",
"switch(str){\n\t\t\tcase \"+\":\n\t\t\t\ts.push(s.pop() + s.pop());\n\t\t\t\tbreak;\n\t\t\tcase \"-\":\n\t\t\t\ts.push(-1 * s.pop() + s.pop());\n\t\t\t\tbreak;\n\t\t\tcase \"*\":\n\t\t\t\ts.push(s.pop() * s.pop());\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\ts.push(Integer.parseInt(str));\n\t\t\t}",
"str",
"case \"+\":",
"\"+\"",
"case \"+\":",
"s.push(s.pop() + s.pop())",
"s.push",
"s",
"s.pop() + s.pop()",
"s.pop()",
"s.pop",
"s",
"s.pop()",
"s.pop",
"s",
"break;",
"case \"-\":",
"\"-\"",
"case \"-\":",
"s.push(-1 * s.pop() + s.pop())",
"s.push",
"s",
"-1 * s.pop() + s.pop()",
"-1 * s.pop()",
"-1",
"1",
"s.pop()",
"s.pop",
"s",
"s.pop()",
"s.pop",
"s",
"break;",
"case \"*\":",
"\"*\"",
"case \"*\":",
"s.push(s.pop() * s.pop())",
"s.push",
"s",
"s.pop() * s.pop()",
"s.pop()",
"s.pop",
"s",
"s.pop()",
"s.pop",
"s",
"break;",
"default:",
"default:",
"s.push(Integer.parseInt(str))",
"s.push",
"s",
"Integer.parseInt(str)",
"Integer.parseInt",
"Integer",
"str",
"System.out.println(s.pop())",
"System.out.println",
"System.out",
"System",
"System.out",
"s.pop()",
"s.pop",
"s",
"String args[]",
"args",
"public class Main {\t\n\tpublic static void main(String args[]){\n\t\tScanner sc = new Scanner(System.in);\n\t\t\n\t\tArrayDeque<Integer> s = new ArrayDeque<>();\n\t\t\n\t\twhile(sc.hasNext()){\n\t\t\tString str = sc.next();\n\t\t\t\n\t\t\tswitch(str){\n\t\t\tcase \"+\":\n\t\t\t\ts.push(s.pop() + s.pop());\n\t\t\t\tbreak;\n\t\t\tcase \"-\":\n\t\t\t\ts.push(-1 * s.pop() + s.pop());\n\t\t\t\tbreak;\n\t\t\tcase \"*\":\n\t\t\t\ts.push(s.pop() * s.pop());\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\ts.push(Integer.parseInt(str));\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(s.pop());\n\t}\n\t\n}",
"public class Main {\t\n\tpublic static void main(String args[]){\n\t\tScanner sc = new Scanner(System.in);\n\t\t\n\t\tArrayDeque<Integer> s = new ArrayDeque<>();\n\t\t\n\t\twhile(sc.hasNext()){\n\t\t\tString str = sc.next();\n\t\t\t\n\t\t\tswitch(str){\n\t\t\tcase \"+\":\n\t\t\t\ts.push(s.pop() + s.pop());\n\t\t\t\tbreak;\n\t\t\tcase \"-\":\n\t\t\t\ts.push(-1 * s.pop() + s.pop());\n\t\t\t\tbreak;\n\t\t\tcase \"*\":\n\t\t\t\ts.push(s.pop() * s.pop());\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\ts.push(Integer.parseInt(str));\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(s.pop());\n\t}\n\t\n}",
"Main"
] | import java.util.*;
public class Main {
public static void main(String args[]){
Scanner sc = new Scanner(System.in);
ArrayDeque<Integer> s = new ArrayDeque<>();
while(sc.hasNext()){
String str = sc.next();
switch(str){
case "+":
s.push(s.pop() + s.pop());
break;
case "-":
s.push(-1 * s.pop() + s.pop());
break;
case "*":
s.push(s.pop() * s.pop());
break;
default:
s.push(Integer.parseInt(str));
}
}
System.out.println(s.pop());
}
}
|
[
7,
15,
13,
17,
6,
13,
41,
13,
20,
17,
41,
13,
17,
12,
13,
30,
41,
13,
20,
38,
5,
13,
30,
4,
18,
13,
30,
41,
13,
41,
13,
41,
13,
41,
13,
4,
18,
4,
18,
13,
17,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
30,
14,
4,
18,
18,
13,
13,
17,
30,
0,
13,
4,
13,
0,
13,
4,
13,
4,
13,
2,
13,
13,
14,
4,
18,
18,
13,
13,
17,
30,
0,
13,
4,
13,
0,
13,
4,
13,
4,
13,
2,
13,
13,
14,
4,
18,
18,
13,
13,
17,
30,
0,
13,
4,
13,
0,
13,
4,
13,
4,
13,
2,
13,
13,
30,
0,
13,
4,
18,
13,
18,
13,
13,
4,
13,
13,
4,
18,
18,
13,
13,
4,
13,
23,
13,
12,
13,
30,
40,
13,
0,
18,
13,
13,
13,
23,
13,
12,
13,
30,
40,
13,
29,
18,
13,
2,
13,
17
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
6,
7
],
[
6,
8
],
[
4,
10
],
[
10,
11
],
[
10,
12
],
[
4,
13
],
[
13,
14
],
[
13,
15
],
[
15,
16
],
[
16,
17
],
[
16,
18
],
[
15,
19
],
[
19,
20
],
[
20,
21
],
[
20,
22
],
[
22,
23
],
[
23,
24
],
[
24,
25
],
[
19,
26
],
[
26,
27
],
[
27,
28
],
[
26,
29
],
[
29,
30
],
[
26,
31
],
[
31,
32
],
[
26,
33
],
[
33,
34
],
[
33,
35
],
[
35,
36
],
[
36,
37
],
[
37,
38
],
[
38,
39
],
[
35,
40
],
[
26,
41
],
[
41,
42
],
[
42,
43
],
[
43,
44
],
[
43,
45
],
[
41,
46
],
[
46,
47
],
[
46,
48
],
[
48,
49
],
[
48,
50
],
[
41,
51
],
[
51,
52
],
[
52,
53
],
[
41,
54
],
[
55,
55
],
[
55,
56
],
[
56,
57
],
[
57,
58
],
[
58,
59
],
[
59,
60
],
[
59,
61
],
[
57,
62
],
[
56,
63
],
[
63,
64
],
[
64,
65
],
[
64,
66
],
[
66,
67
],
[
63,
68
],
[
68,
69
],
[
68,
70
],
[
70,
71
],
[
63,
72
],
[
72,
73
],
[
72,
74
],
[
74,
75
],
[
74,
76
],
[
56,
77
],
[
77,
78
],
[
78,
79
],
[
79,
80
],
[
80,
81
],
[
80,
82
],
[
78,
83
],
[
77,
84
],
[
84,
85
],
[
85,
86
],
[
85,
87
],
[
87,
88
],
[
84,
89
],
[
89,
90
],
[
89,
91
],
[
91,
92
],
[
84,
93
],
[
93,
94
],
[
93,
95
],
[
95,
96
],
[
95,
97
],
[
77,
98
],
[
98,
99
],
[
99,
100
],
[
100,
101
],
[
101,
102
],
[
101,
103
],
[
99,
104
],
[
98,
105
],
[
105,
106
],
[
106,
107
],
[
106,
108
],
[
108,
109
],
[
105,
110
],
[
110,
111
],
[
110,
112
],
[
112,
113
],
[
105,
114
],
[
114,
115
],
[
114,
116
],
[
116,
117
],
[
116,
118
],
[
98,
119
],
[
119,
120
],
[
120,
121
],
[
120,
122
],
[
122,
123
],
[
123,
124
],
[
122,
125
],
[
125,
126
],
[
125,
127
],
[
119,
128
],
[
128,
129
],
[
128,
130
],
[
26,
131
],
[
131,
132
],
[
132,
133
],
[
133,
134
],
[
133,
135
],
[
131,
136
],
[
136,
137
],
[
13,
138
],
[
138,
139
],
[
4,
140
],
[
140,
141
],
[
140,
142
],
[
142,
143
],
[
143,
144
],
[
142,
145
],
[
145,
146
],
[
146,
147
],
[
146,
148
],
[
145,
149
],
[
140,
150
],
[
150,
151
],
[
4,
152
],
[
152,
153
],
[
152,
154
],
[
154,
155
],
[
155,
156
],
[
154,
157
],
[
157,
158
],
[
158,
159
],
[
158,
160
],
[
160,
161
],
[
160,
162
]
] | [
"// ALDS 1_3_A Stack\nimport java.io.*;\n\n\nclass Main {\n\n static int[] S = new int[1000];\n static int top = 0;\n\n public static void main(String[] args) {\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n try {\n int x;\n int a, b;\n String[] in = br.readLine().split(\" \");\n for (int i = 0; i < in.length; i++) {\n if (in[i].equals(\"+\")) {\n a = pop();\n b = pop();\n push(a + b);\n } else if (in[i].equals(\"-\")) {\n b = pop();\n a = pop();\n push(a - b);\n } else if (in[i].equals(\"*\")) {\n a = pop();\n b = pop();\n push(a * b);\n } else {\n x = Integer.parseInt(in[i]);\n push(x);\n }\n }\n System.out.println(pop());\n }\n catch (Exception e) {\n e.printStackTrace();\n }\n }\n static void push(int x) {\n top++;\n S[top] = x;\n }\n static int pop() {\n top--;\n return S[top + 1];\n }\n}",
"import java.io.*;",
"io.*",
"java",
"class Main {\n\n static int[] S = new int[1000];\n static int top = 0;\n\n public static void main(String[] args) {\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n try {\n int x;\n int a, b;\n String[] in = br.readLine().split(\" \");\n for (int i = 0; i < in.length; i++) {\n if (in[i].equals(\"+\")) {\n a = pop();\n b = pop();\n push(a + b);\n } else if (in[i].equals(\"-\")) {\n b = pop();\n a = pop();\n push(a - b);\n } else if (in[i].equals(\"*\")) {\n a = pop();\n b = pop();\n push(a * b);\n } else {\n x = Integer.parseInt(in[i]);\n push(x);\n }\n }\n System.out.println(pop());\n }\n catch (Exception e) {\n e.printStackTrace();\n }\n }\n static void push(int x) {\n top++;\n S[top] = x;\n }\n static int pop() {\n top--;\n return S[top + 1];\n }\n}",
"Main",
"static int[] S = new int[1000];",
"S",
"new int[1000]",
"1000",
"static int top = 0;",
"top",
"0",
"public static void main(String[] args) {\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n try {\n int x;\n int a, b;\n String[] in = br.readLine().split(\" \");\n for (int i = 0; i < in.length; i++) {\n if (in[i].equals(\"+\")) {\n a = pop();\n b = pop();\n push(a + b);\n } else if (in[i].equals(\"-\")) {\n b = pop();\n a = pop();\n push(a - b);\n } else if (in[i].equals(\"*\")) {\n a = pop();\n b = pop();\n push(a * b);\n } else {\n x = Integer.parseInt(in[i]);\n push(x);\n }\n }\n System.out.println(pop());\n }\n catch (Exception e) {\n e.printStackTrace();\n }\n }",
"main",
"{\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n try {\n int x;\n int a, b;\n String[] in = br.readLine().split(\" \");\n for (int i = 0; i < in.length; i++) {\n if (in[i].equals(\"+\")) {\n a = pop();\n b = pop();\n push(a + b);\n } else if (in[i].equals(\"-\")) {\n b = pop();\n a = pop();\n push(a - b);\n } else if (in[i].equals(\"*\")) {\n a = pop();\n b = pop();\n push(a * b);\n } else {\n x = Integer.parseInt(in[i]);\n push(x);\n }\n }\n System.out.println(pop());\n }\n catch (Exception e) {\n e.printStackTrace();\n }\n }",
"BufferedReader br = new BufferedReader(new InputStreamReader(System.in));",
"br",
"new BufferedReader(new InputStreamReader(System.in))",
"try {\n int x;\n int a, b;\n String[] in = br.readLine().split(\" \");\n for (int i = 0; i < in.length; i++) {\n if (in[i].equals(\"+\")) {\n a = pop();\n b = pop();\n push(a + b);\n } else if (in[i].equals(\"-\")) {\n b = pop();\n a = pop();\n push(a - b);\n } else if (in[i].equals(\"*\")) {\n a = pop();\n b = pop();\n push(a * b);\n } else {\n x = Integer.parseInt(in[i]);\n push(x);\n }\n }\n System.out.println(pop());\n }\n catch (Exception e) {\n e.printStackTrace();\n }",
"catch (Exception e) {\n e.printStackTrace();\n }",
"Exception e",
"{\n e.printStackTrace();\n }",
"e.printStackTrace()",
"e.printStackTrace",
"e",
"{\n int x;\n int a, b;\n String[] in = br.readLine().split(\" \");\n for (int i = 0; i < in.length; i++) {\n if (in[i].equals(\"+\")) {\n a = pop();\n b = pop();\n push(a + b);\n } else if (in[i].equals(\"-\")) {\n b = pop();\n a = pop();\n push(a - b);\n } else if (in[i].equals(\"*\")) {\n a = pop();\n b = pop();\n push(a * b);\n } else {\n x = Integer.parseInt(in[i]);\n push(x);\n }\n }\n System.out.println(pop());\n }",
"int x;",
"x",
"int a",
"a",
"b;",
"b",
"String[] in = br.readLine().split(\" \");",
"in",
"br.readLine().split(\" \")",
"br.readLine().split",
"br.readLine()",
"br.readLine",
"br",
"\" \"",
"for (int i = 0; i < in.length; i++) {\n if (in[i].equals(\"+\")) {\n a = pop();\n b = pop();\n push(a + b);\n } else if (in[i].equals(\"-\")) {\n b = pop();\n a = pop();\n push(a - b);\n } else if (in[i].equals(\"*\")) {\n a = pop();\n b = pop();\n push(a * b);\n } else {\n x = Integer.parseInt(in[i]);\n push(x);\n }\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < in.length",
"i",
"in.length",
"in",
"in.length",
"i++",
"i++",
"i",
"{\n if (in[i].equals(\"+\")) {\n a = pop();\n b = pop();\n push(a + b);\n } else if (in[i].equals(\"-\")) {\n b = pop();\n a = pop();\n push(a - b);\n } else if (in[i].equals(\"*\")) {\n a = pop();\n b = pop();\n push(a * b);\n } else {\n x = Integer.parseInt(in[i]);\n push(x);\n }\n }",
"{\n if (in[i].equals(\"+\")) {\n a = pop();\n b = pop();\n push(a + b);\n } else if (in[i].equals(\"-\")) {\n b = pop();\n a = pop();\n push(a - b);\n } else if (in[i].equals(\"*\")) {\n a = pop();\n b = pop();\n push(a * b);\n } else {\n x = Integer.parseInt(in[i]);\n push(x);\n }\n }",
"if (in[i].equals(\"+\")) {\n a = pop();\n b = pop();\n push(a + b);\n } else if (in[i].equals(\"-\")) {\n b = pop();\n a = pop();\n push(a - b);\n } else if (in[i].equals(\"*\")) {\n a = pop();\n b = pop();\n push(a * b);\n } else {\n x = Integer.parseInt(in[i]);\n push(x);\n }",
"in[i].equals(\"+\")",
"in[i].equals",
"in[i]",
"in",
"i",
"\"+\"",
"{\n a = pop();\n b = pop();\n push(a + b);\n }",
"a = pop()",
"a",
"pop()",
"pop",
"b = pop()",
"b",
"pop()",
"pop",
"push(a + b)",
"push",
"a + b",
"a",
"b",
"if (in[i].equals(\"-\")) {\n b = pop();\n a = pop();\n push(a - b);\n } else if (in[i].equals(\"*\")) {\n a = pop();\n b = pop();\n push(a * b);\n } else {\n x = Integer.parseInt(in[i]);\n push(x);\n }",
"in[i].equals(\"-\")",
"in[i].equals",
"in[i]",
"in",
"i",
"\"-\"",
"{\n b = pop();\n a = pop();\n push(a - b);\n }",
"b = pop()",
"b",
"pop()",
"pop",
"a = pop()",
"a",
"pop()",
"pop",
"push(a - b)",
"push",
"a - b",
"a",
"b",
"if (in[i].equals(\"*\")) {\n a = pop();\n b = pop();\n push(a * b);\n } else {\n x = Integer.parseInt(in[i]);\n push(x);\n }",
"in[i].equals(\"*\")",
"in[i].equals",
"in[i]",
"in",
"i",
"\"*\"",
"{\n a = pop();\n b = pop();\n push(a * b);\n }",
"a = pop()",
"a",
"pop()",
"pop",
"b = pop()",
"b",
"pop()",
"pop",
"push(a * b)",
"push",
"a * b",
"a",
"b",
"{\n x = Integer.parseInt(in[i]);\n push(x);\n }",
"x = Integer.parseInt(in[i])",
"x",
"Integer.parseInt(in[i])",
"Integer.parseInt",
"Integer",
"in[i]",
"in",
"i",
"push(x)",
"push",
"x",
"System.out.println(pop())",
"System.out.println",
"System.out",
"System",
"System.out",
"pop()",
"pop",
"String[] args",
"args",
"static void push(int x) {\n top++;\n S[top] = x;\n }",
"push",
"{\n top++;\n S[top] = x;\n }",
"top++",
"top",
"S[top] = x",
"S[top]",
"S",
"top",
"x",
"int x",
"x",
"static int pop() {\n top--;\n return S[top + 1];\n }",
"pop",
"{\n top--;\n return S[top + 1];\n }",
"top--",
"top",
"return S[top + 1];",
"S[top + 1]",
"S",
"top + 1",
"top",
"1"
] | // ALDS 1_3_A Stack
import java.io.*;
class Main {
static int[] S = new int[1000];
static int top = 0;
public static void main(String[] args) {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
try {
int x;
int a, b;
String[] in = br.readLine().split(" ");
for (int i = 0; i < in.length; i++) {
if (in[i].equals("+")) {
a = pop();
b = pop();
push(a + b);
} else if (in[i].equals("-")) {
b = pop();
a = pop();
push(a - b);
} else if (in[i].equals("*")) {
a = pop();
b = pop();
push(a * b);
} else {
x = Integer.parseInt(in[i]);
push(x);
}
}
System.out.println(pop());
}
catch (Exception e) {
e.printStackTrace();
}
}
static void push(int x) {
top++;
S[top] = x;
}
static int pop() {
top--;
return S[top + 1];
}
} |
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
41,
13,
41,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
4,
18,
13,
17,
41,
13,
18,
13,
13,
0,
13,
17,
0,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
14,
4,
18,
18,
13,
13,
17,
30,
41,
13,
4,
18,
20,
41,
13,
4,
18,
20,
4,
13,
2,
13,
13,
14,
4,
18,
18,
13,
13,
17,
30,
41,
13,
4,
18,
20,
41,
13,
4,
18,
20,
4,
13,
2,
13,
13,
14,
4,
18,
18,
13,
13,
17,
30,
41,
13,
4,
18,
20,
41,
13,
4,
18,
20,
4,
13,
2,
13,
13,
30,
4,
13,
18,
13,
13,
4,
18,
18,
13,
13,
18,
13,
17,
4,
18,
13,
23,
13,
12,
13,
30,
14,
2,
13,
17,
30,
37,
20,
41,
13,
18,
13,
40,
13,
0,
18,
13,
13,
17,
29,
13,
12,
13,
30,
14,
2,
13,
17,
30,
37,
20,
0,
18,
13,
40,
13,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
185,
11
],
[
185,
12
],
[
12,
13
],
[
185,
14
],
[
14,
15
],
[
185,
16
],
[
16,
17
],
[
16,
18
],
[
18,
19
],
[
19,
20
],
[
19,
21
],
[
18,
22
],
[
22,
23
],
[
22,
24
],
[
24,
25
],
[
25,
26
],
[
26,
27
],
[
27,
28
],
[
24,
29
],
[
18,
30
],
[
30,
31
],
[
30,
32
],
[
32,
33
],
[
32,
34
],
[
18,
35
],
[
35,
36
],
[
35,
37
],
[
18,
38
],
[
38,
39
],
[
38,
40
],
[
18,
42
],
[
42,
43
],
[
43,
44
],
[
44,
45
],
[
44,
46
],
[
42,
47
],
[
47,
48
],
[
47,
49
],
[
42,
50
],
[
50,
51
],
[
51,
52
],
[
42,
53
],
[
54,
54
],
[
54,
55
],
[
55,
56
],
[
56,
57
],
[
57,
58
],
[
58,
59
],
[
58,
60
],
[
56,
61
],
[
55,
62
],
[
62,
63
],
[
63,
64
],
[
63,
65
],
[
65,
66
],
[
66,
67
],
[
62,
68
],
[
68,
69
],
[
68,
70
],
[
70,
71
],
[
71,
72
],
[
62,
73
],
[
73,
74
],
[
73,
75
],
[
75,
76
],
[
75,
77
],
[
55,
78
],
[
78,
79
],
[
79,
80
],
[
80,
81
],
[
81,
82
],
[
81,
83
],
[
79,
84
],
[
78,
85
],
[
85,
86
],
[
86,
87
],
[
86,
88
],
[
88,
89
],
[
89,
90
],
[
85,
91
],
[
91,
92
],
[
91,
93
],
[
93,
94
],
[
94,
95
],
[
85,
96
],
[
96,
97
],
[
96,
98
],
[
98,
99
],
[
98,
100
],
[
78,
101
],
[
101,
102
],
[
102,
103
],
[
103,
104
],
[
104,
105
],
[
104,
106
],
[
102,
107
],
[
101,
108
],
[
108,
109
],
[
109,
110
],
[
109,
111
],
[
111,
112
],
[
112,
113
],
[
108,
114
],
[
114,
115
],
[
114,
116
],
[
116,
117
],
[
117,
118
],
[
108,
119
],
[
119,
120
],
[
119,
121
],
[
121,
122
],
[
121,
123
],
[
101,
124
],
[
124,
125
],
[
125,
126
],
[
125,
127
],
[
127,
128
],
[
127,
129
],
[
18,
130
],
[
130,
131
],
[
131,
132
],
[
132,
133
],
[
132,
134
],
[
130,
135
],
[
135,
136
],
[
135,
137
],
[
18,
138
],
[
138,
139
],
[
139,
140
],
[
16,
141
],
[
141,
142
],
[
185,
143
],
[
143,
144
],
[
143,
145
],
[
145,
146
],
[
146,
147
],
[
147,
148
],
[
147,
149
],
[
146,
150
],
[
150,
151
],
[
151,
152
],
[
145,
153
],
[
153,
154
],
[
153,
155
],
[
155,
156
],
[
155,
157
],
[
157,
158
],
[
145,
159
],
[
159,
160
],
[
160,
161
],
[
160,
162
],
[
159,
163
],
[
145,
164
],
[
164,
165
],
[
185,
166
],
[
166,
167
],
[
166,
168
],
[
168,
169
],
[
169,
170
],
[
170,
171
],
[
170,
172
],
[
169,
173
],
[
173,
174
],
[
174,
175
],
[
168,
176
],
[
176,
177
],
[
177,
178
],
[
177,
179
],
[
179,
180
],
[
176,
181
],
[
166,
182
],
[
182,
183
],
[
0,
184
],
[
184,
185
],
[
184,
186
]
] | [
"import java.io.IOException;\nimport java.util.EmptyStackException;\nimport java.util.Scanner;\npublic class Main {\n\n\tprivate static Object stack[];\n\tprivate static int sp;\n\n\tpublic static void main(String[] args) throws IOException{\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tString[] item = sc.nextLine().split(\" \");\n\t\tint x = item.length;\n\n\t\tsp = 0;\n\t\tstack = new Object[x]; // スタックの生成\n\n\t\tfor(int i=0;i<x;i++) {\n\t\t\tif(item[i].equals(\"+\")) {\n\t\t\t\tint b = new Integer(pop().toString()).intValue();\n\t\t\t\tint a = new Integer(pop().toString()).intValue();\n\t\t\t\tpush(a+b);\n\t\t\t}else if(item[i].equals(\"-\")){\n\t\t\t\tint b = new Integer(pop().toString()).intValue();\n\t\t\t\tint a = new Integer(pop().toString()).intValue();\n\t\t\t\tpush(a-b);\n\t\t\t}else if(item[i].equals(\"*\")){\n\t\t\t\tint b = new Integer(pop().toString()).intValue();\n\t\t\t\tint a = new Integer(pop().toString()).intValue();\n\t\t\t\tpush(a*b);\n\t\t\t}else {\n\t\t\t\tpush(item[i]);\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.println(stack[0]);\n\t\tsc.close();\n\t}\n\n\t/*\n\t * スタックから取り出す\n\t */\n\tpublic static Object pop() {\n\t\tif(sp<0) {\n\t\t\tthrow new EmptyStackException();\n\t\t}\n\t\tObject value = stack[--sp];\n\t\tstack[sp] = null;\n\t\treturn value;\n\t}\n\n\t/*\n\t * スタックに追加する\n\t */\n\tpublic static void push(Object x) {\n\t\tif(sp>=200) {\n\t\t\tthrow new IllegalStateException(\"StackOverFlow\");\n\t\t}\n\t\tstack[sp++] = x;\n\t}\n}",
"import java.io.IOException;",
"IOException",
"java.io",
"import java.util.EmptyStackException;",
"EmptyStackException",
"java.util",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\n\tprivate static Object stack[];\n\tprivate static int sp;\n\n\tpublic static void main(String[] args) throws IOException{\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tString[] item = sc.nextLine().split(\" \");\n\t\tint x = item.length;\n\n\t\tsp = 0;\n\t\tstack = new Object[x]; // スタックの生成\n\n\t\tfor(int i=0;i<x;i++) {\n\t\t\tif(item[i].equals(\"+\")) {\n\t\t\t\tint b = new Integer(pop().toString()).intValue();\n\t\t\t\tint a = new Integer(pop().toString()).intValue();\n\t\t\t\tpush(a+b);\n\t\t\t}else if(item[i].equals(\"-\")){\n\t\t\t\tint b = new Integer(pop().toString()).intValue();\n\t\t\t\tint a = new Integer(pop().toString()).intValue();\n\t\t\t\tpush(a-b);\n\t\t\t}else if(item[i].equals(\"*\")){\n\t\t\t\tint b = new Integer(pop().toString()).intValue();\n\t\t\t\tint a = new Integer(pop().toString()).intValue();\n\t\t\t\tpush(a*b);\n\t\t\t}else {\n\t\t\t\tpush(item[i]);\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.println(stack[0]);\n\t\tsc.close();\n\t}\n\n\t/*\n\t * スタックから取り出す\n\t */\n\tpublic static Object pop() {\n\t\tif(sp<0) {\n\t\t\tthrow new EmptyStackException();\n\t\t}\n\t\tObject value = stack[--sp];\n\t\tstack[sp] = null;\n\t\treturn value;\n\t}\n\n\t/*\n\t * スタックに追加する\n\t */\n\tpublic static void push(Object x) {\n\t\tif(sp>=200) {\n\t\t\tthrow new IllegalStateException(\"StackOverFlow\");\n\t\t}\n\t\tstack[sp++] = x;\n\t}\n}",
"Main",
"private static Object stack[];",
"stack",
"private static int sp;",
"sp",
"public static void main(String[] args) throws IOException{\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tString[] item = sc.nextLine().split(\" \");\n\t\tint x = item.length;\n\n\t\tsp = 0;\n\t\tstack = new Object[x]; // スタックの生成\n\n\t\tfor(int i=0;i<x;i++) {\n\t\t\tif(item[i].equals(\"+\")) {\n\t\t\t\tint b = new Integer(pop().toString()).intValue();\n\t\t\t\tint a = new Integer(pop().toString()).intValue();\n\t\t\t\tpush(a+b);\n\t\t\t}else if(item[i].equals(\"-\")){\n\t\t\t\tint b = new Integer(pop().toString()).intValue();\n\t\t\t\tint a = new Integer(pop().toString()).intValue();\n\t\t\t\tpush(a-b);\n\t\t\t}else if(item[i].equals(\"*\")){\n\t\t\t\tint b = new Integer(pop().toString()).intValue();\n\t\t\t\tint a = new Integer(pop().toString()).intValue();\n\t\t\t\tpush(a*b);\n\t\t\t}else {\n\t\t\t\tpush(item[i]);\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.println(stack[0]);\n\t\tsc.close();\n\t}",
"main",
"{\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tString[] item = sc.nextLine().split(\" \");\n\t\tint x = item.length;\n\n\t\tsp = 0;\n\t\tstack = new Object[x]; // スタックの生成\n\n\t\tfor(int i=0;i<x;i++) {\n\t\t\tif(item[i].equals(\"+\")) {\n\t\t\t\tint b = new Integer(pop().toString()).intValue();\n\t\t\t\tint a = new Integer(pop().toString()).intValue();\n\t\t\t\tpush(a+b);\n\t\t\t}else if(item[i].equals(\"-\")){\n\t\t\t\tint b = new Integer(pop().toString()).intValue();\n\t\t\t\tint a = new Integer(pop().toString()).intValue();\n\t\t\t\tpush(a-b);\n\t\t\t}else if(item[i].equals(\"*\")){\n\t\t\t\tint b = new Integer(pop().toString()).intValue();\n\t\t\t\tint a = new Integer(pop().toString()).intValue();\n\t\t\t\tpush(a*b);\n\t\t\t}else {\n\t\t\t\tpush(item[i]);\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.println(stack[0]);\n\t\tsc.close();\n\t}",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"String[] item = sc.nextLine().split(\" \");",
"item",
"sc.nextLine().split(\" \")",
"sc.nextLine().split",
"sc.nextLine()",
"sc.nextLine",
"sc",
"\" \"",
"int x = item.length;",
"x",
"item.length",
"item",
"item.length",
"sp = 0",
"sp",
"0",
"stack = new Object[x]",
"stack",
"new Object[x]",
"x",
"for(int i=0;i<x;i++) {\n\t\t\tif(item[i].equals(\"+\")) {\n\t\t\t\tint b = new Integer(pop().toString()).intValue();\n\t\t\t\tint a = new Integer(pop().toString()).intValue();\n\t\t\t\tpush(a+b);\n\t\t\t}else if(item[i].equals(\"-\")){\n\t\t\t\tint b = new Integer(pop().toString()).intValue();\n\t\t\t\tint a = new Integer(pop().toString()).intValue();\n\t\t\t\tpush(a-b);\n\t\t\t}else if(item[i].equals(\"*\")){\n\t\t\t\tint b = new Integer(pop().toString()).intValue();\n\t\t\t\tint a = new Integer(pop().toString()).intValue();\n\t\t\t\tpush(a*b);\n\t\t\t}else {\n\t\t\t\tpush(item[i]);\n\t\t\t}\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<x",
"i",
"x",
"i++",
"i++",
"i",
"{\n\t\t\tif(item[i].equals(\"+\")) {\n\t\t\t\tint b = new Integer(pop().toString()).intValue();\n\t\t\t\tint a = new Integer(pop().toString()).intValue();\n\t\t\t\tpush(a+b);\n\t\t\t}else if(item[i].equals(\"-\")){\n\t\t\t\tint b = new Integer(pop().toString()).intValue();\n\t\t\t\tint a = new Integer(pop().toString()).intValue();\n\t\t\t\tpush(a-b);\n\t\t\t}else if(item[i].equals(\"*\")){\n\t\t\t\tint b = new Integer(pop().toString()).intValue();\n\t\t\t\tint a = new Integer(pop().toString()).intValue();\n\t\t\t\tpush(a*b);\n\t\t\t}else {\n\t\t\t\tpush(item[i]);\n\t\t\t}\n\t\t}",
"{\n\t\t\tif(item[i].equals(\"+\")) {\n\t\t\t\tint b = new Integer(pop().toString()).intValue();\n\t\t\t\tint a = new Integer(pop().toString()).intValue();\n\t\t\t\tpush(a+b);\n\t\t\t}else if(item[i].equals(\"-\")){\n\t\t\t\tint b = new Integer(pop().toString()).intValue();\n\t\t\t\tint a = new Integer(pop().toString()).intValue();\n\t\t\t\tpush(a-b);\n\t\t\t}else if(item[i].equals(\"*\")){\n\t\t\t\tint b = new Integer(pop().toString()).intValue();\n\t\t\t\tint a = new Integer(pop().toString()).intValue();\n\t\t\t\tpush(a*b);\n\t\t\t}else {\n\t\t\t\tpush(item[i]);\n\t\t\t}\n\t\t}",
"if(item[i].equals(\"+\")) {\n\t\t\t\tint b = new Integer(pop().toString()).intValue();\n\t\t\t\tint a = new Integer(pop().toString()).intValue();\n\t\t\t\tpush(a+b);\n\t\t\t}else if(item[i].equals(\"-\")){\n\t\t\t\tint b = new Integer(pop().toString()).intValue();\n\t\t\t\tint a = new Integer(pop().toString()).intValue();\n\t\t\t\tpush(a-b);\n\t\t\t}else if(item[i].equals(\"*\")){\n\t\t\t\tint b = new Integer(pop().toString()).intValue();\n\t\t\t\tint a = new Integer(pop().toString()).intValue();\n\t\t\t\tpush(a*b);\n\t\t\t}else {\n\t\t\t\tpush(item[i]);\n\t\t\t}",
"item[i].equals(\"+\")",
"item[i].equals",
"item[i]",
"item",
"i",
"\"+\"",
"{\n\t\t\t\tint b = new Integer(pop().toString()).intValue();\n\t\t\t\tint a = new Integer(pop().toString()).intValue();\n\t\t\t\tpush(a+b);\n\t\t\t}",
"int b = new Integer(pop().toString()).intValue();",
"b",
"new Integer(pop().toString()).intValue()",
"new Integer(pop().toString()).intValue",
"new Integer(pop().toString())",
"int a = new Integer(pop().toString()).intValue();",
"a",
"new Integer(pop().toString()).intValue()",
"new Integer(pop().toString()).intValue",
"new Integer(pop().toString())",
"push(a+b)",
"push",
"a+b",
"a",
"b",
"if(item[i].equals(\"-\")){\n\t\t\t\tint b = new Integer(pop().toString()).intValue();\n\t\t\t\tint a = new Integer(pop().toString()).intValue();\n\t\t\t\tpush(a-b);\n\t\t\t}else if(item[i].equals(\"*\")){\n\t\t\t\tint b = new Integer(pop().toString()).intValue();\n\t\t\t\tint a = new Integer(pop().toString()).intValue();\n\t\t\t\tpush(a*b);\n\t\t\t}else {\n\t\t\t\tpush(item[i]);\n\t\t\t}",
"item[i].equals(\"-\")",
"item[i].equals",
"item[i]",
"item",
"i",
"\"-\"",
"{\n\t\t\t\tint b = new Integer(pop().toString()).intValue();\n\t\t\t\tint a = new Integer(pop().toString()).intValue();\n\t\t\t\tpush(a-b);\n\t\t\t}",
"int b = new Integer(pop().toString()).intValue();",
"b",
"new Integer(pop().toString()).intValue()",
"new Integer(pop().toString()).intValue",
"new Integer(pop().toString())",
"int a = new Integer(pop().toString()).intValue();",
"a",
"new Integer(pop().toString()).intValue()",
"new Integer(pop().toString()).intValue",
"new Integer(pop().toString())",
"push(a-b)",
"push",
"a-b",
"a",
"b",
"if(item[i].equals(\"*\")){\n\t\t\t\tint b = new Integer(pop().toString()).intValue();\n\t\t\t\tint a = new Integer(pop().toString()).intValue();\n\t\t\t\tpush(a*b);\n\t\t\t}else {\n\t\t\t\tpush(item[i]);\n\t\t\t}",
"item[i].equals(\"*\")",
"item[i].equals",
"item[i]",
"item",
"i",
"\"*\"",
"{\n\t\t\t\tint b = new Integer(pop().toString()).intValue();\n\t\t\t\tint a = new Integer(pop().toString()).intValue();\n\t\t\t\tpush(a*b);\n\t\t\t}",
"int b = new Integer(pop().toString()).intValue();",
"b",
"new Integer(pop().toString()).intValue()",
"new Integer(pop().toString()).intValue",
"new Integer(pop().toString())",
"int a = new Integer(pop().toString()).intValue();",
"a",
"new Integer(pop().toString()).intValue()",
"new Integer(pop().toString()).intValue",
"new Integer(pop().toString())",
"push(a*b)",
"push",
"a*b",
"a",
"b",
"{\n\t\t\t\tpush(item[i]);\n\t\t\t}",
"push(item[i])",
"push",
"item[i]",
"item",
"i",
"System.out.println(stack[0])",
"System.out.println",
"System.out",
"System",
"System.out",
"stack[0]",
"stack",
"0",
"sc.close()",
"sc.close",
"sc",
"String[] args",
"args",
"/*\n\t * スタックから取り出す\n\t */\n\tpublic static Object pop() {\n\t\tif(sp<0) {\n\t\t\tthrow new EmptyStackException();\n\t\t}\n\t\tObject value = stack[--sp];\n\t\tstack[sp] = null;\n\t\treturn value;\n\t}",
"pop",
"{\n\t\tif(sp<0) {\n\t\t\tthrow new EmptyStackException();\n\t\t}\n\t\tObject value = stack[--sp];\n\t\tstack[sp] = null;\n\t\treturn value;\n\t}",
"if(sp<0) {\n\t\t\tthrow new EmptyStackException();\n\t\t}",
"sp<0",
"sp",
"0",
"{\n\t\t\tthrow new EmptyStackException();\n\t\t}",
"throw new EmptyStackException();",
"new EmptyStackException()",
"Object value = stack[--sp];",
"value",
"stack[--sp]",
"stack",
"--sp",
"sp",
"stack[sp] = null",
"stack[sp]",
"stack",
"sp",
"null",
"return value;",
"value",
"/*\n\t * スタックに追加する\n\t */\n\tpublic static void push(Object x) {\n\t\tif(sp>=200) {\n\t\t\tthrow new IllegalStateException(\"StackOverFlow\");\n\t\t}\n\t\tstack[sp++] = x;\n\t}",
"push",
"{\n\t\tif(sp>=200) {\n\t\t\tthrow new IllegalStateException(\"StackOverFlow\");\n\t\t}\n\t\tstack[sp++] = x;\n\t}",
"if(sp>=200) {\n\t\t\tthrow new IllegalStateException(\"StackOverFlow\");\n\t\t}",
"sp>=200",
"sp",
"200",
"{\n\t\t\tthrow new IllegalStateException(\"StackOverFlow\");\n\t\t}",
"throw new IllegalStateException(\"StackOverFlow\");",
"new IllegalStateException(\"StackOverFlow\")",
"stack[sp++] = x",
"stack[sp++]",
"stack",
"sp++",
"sp",
"x",
"Object x",
"x",
"public class Main {\n\n\tprivate static Object stack[];\n\tprivate static int sp;\n\n\tpublic static void main(String[] args) throws IOException{\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tString[] item = sc.nextLine().split(\" \");\n\t\tint x = item.length;\n\n\t\tsp = 0;\n\t\tstack = new Object[x]; // スタックの生成\n\n\t\tfor(int i=0;i<x;i++) {\n\t\t\tif(item[i].equals(\"+\")) {\n\t\t\t\tint b = new Integer(pop().toString()).intValue();\n\t\t\t\tint a = new Integer(pop().toString()).intValue();\n\t\t\t\tpush(a+b);\n\t\t\t}else if(item[i].equals(\"-\")){\n\t\t\t\tint b = new Integer(pop().toString()).intValue();\n\t\t\t\tint a = new Integer(pop().toString()).intValue();\n\t\t\t\tpush(a-b);\n\t\t\t}else if(item[i].equals(\"*\")){\n\t\t\t\tint b = new Integer(pop().toString()).intValue();\n\t\t\t\tint a = new Integer(pop().toString()).intValue();\n\t\t\t\tpush(a*b);\n\t\t\t}else {\n\t\t\t\tpush(item[i]);\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.println(stack[0]);\n\t\tsc.close();\n\t}\n\n\t/*\n\t * スタックから取り出す\n\t */\n\tpublic static Object pop() {\n\t\tif(sp<0) {\n\t\t\tthrow new EmptyStackException();\n\t\t}\n\t\tObject value = stack[--sp];\n\t\tstack[sp] = null;\n\t\treturn value;\n\t}\n\n\t/*\n\t * スタックに追加する\n\t */\n\tpublic static void push(Object x) {\n\t\tif(sp>=200) {\n\t\t\tthrow new IllegalStateException(\"StackOverFlow\");\n\t\t}\n\t\tstack[sp++] = x;\n\t}\n}",
"public class Main {\n\n\tprivate static Object stack[];\n\tprivate static int sp;\n\n\tpublic static void main(String[] args) throws IOException{\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tString[] item = sc.nextLine().split(\" \");\n\t\tint x = item.length;\n\n\t\tsp = 0;\n\t\tstack = new Object[x]; // スタックの生成\n\n\t\tfor(int i=0;i<x;i++) {\n\t\t\tif(item[i].equals(\"+\")) {\n\t\t\t\tint b = new Integer(pop().toString()).intValue();\n\t\t\t\tint a = new Integer(pop().toString()).intValue();\n\t\t\t\tpush(a+b);\n\t\t\t}else if(item[i].equals(\"-\")){\n\t\t\t\tint b = new Integer(pop().toString()).intValue();\n\t\t\t\tint a = new Integer(pop().toString()).intValue();\n\t\t\t\tpush(a-b);\n\t\t\t}else if(item[i].equals(\"*\")){\n\t\t\t\tint b = new Integer(pop().toString()).intValue();\n\t\t\t\tint a = new Integer(pop().toString()).intValue();\n\t\t\t\tpush(a*b);\n\t\t\t}else {\n\t\t\t\tpush(item[i]);\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.println(stack[0]);\n\t\tsc.close();\n\t}\n\n\t/*\n\t * スタックから取り出す\n\t */\n\tpublic static Object pop() {\n\t\tif(sp<0) {\n\t\t\tthrow new EmptyStackException();\n\t\t}\n\t\tObject value = stack[--sp];\n\t\tstack[sp] = null;\n\t\treturn value;\n\t}\n\n\t/*\n\t * スタックに追加する\n\t */\n\tpublic static void push(Object x) {\n\t\tif(sp>=200) {\n\t\t\tthrow new IllegalStateException(\"StackOverFlow\");\n\t\t}\n\t\tstack[sp++] = x;\n\t}\n}",
"Main"
] | import java.io.IOException;
import java.util.EmptyStackException;
import java.util.Scanner;
public class Main {
private static Object stack[];
private static int sp;
public static void main(String[] args) throws IOException{
Scanner sc = new Scanner(System.in);
String[] item = sc.nextLine().split(" ");
int x = item.length;
sp = 0;
stack = new Object[x]; // スタックの生成
for(int i=0;i<x;i++) {
if(item[i].equals("+")) {
int b = new Integer(pop().toString()).intValue();
int a = new Integer(pop().toString()).intValue();
push(a+b);
}else if(item[i].equals("-")){
int b = new Integer(pop().toString()).intValue();
int a = new Integer(pop().toString()).intValue();
push(a-b);
}else if(item[i].equals("*")){
int b = new Integer(pop().toString()).intValue();
int a = new Integer(pop().toString()).intValue();
push(a*b);
}else {
push(item[i]);
}
}
System.out.println(stack[0]);
sc.close();
}
/*
* スタックから取り出す
*/
public static Object pop() {
if(sp<0) {
throw new EmptyStackException();
}
Object value = stack[--sp];
stack[sp] = null;
return value;
}
/*
* スタックに追加する
*/
public static void push(Object x) {
if(sp>=200) {
throw new IllegalStateException("StackOverFlow");
}
stack[sp++] = x;
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
38,
5,
13,
30,
29,
17,
30,
41,
13,
4,
18,
13,
13,
29,
17,
23,
13,
12,
13,
30,
41,
13,
20,
41,
13,
20,
42,
4,
18,
13,
30,
41,
13,
4,
18,
13,
14,
4,
13,
13,
30,
4,
18,
13,
4,
18,
13,
13,
30,
14,
4,
18,
13,
17,
30,
41,
13,
2,
4,
18,
13,
2,
4,
18,
13,
17,
4,
18,
13,
2,
4,
18,
13,
17,
4,
18,
13,
2,
4,
18,
13,
17,
4,
18,
13,
2,
4,
18,
13,
17,
13,
14,
4,
18,
13,
17,
30,
41,
13,
2,
4,
18,
13,
2,
4,
18,
13,
17,
4,
18,
13,
2,
4,
18,
13,
17,
4,
18,
13,
2,
4,
18,
13,
17,
4,
18,
13,
2,
4,
18,
13,
17,
13,
30,
41,
13,
2,
4,
18,
13,
2,
4,
18,
13,
17,
4,
18,
13,
2,
4,
18,
13,
17,
4,
18,
13,
2,
4,
18,
13,
17,
4,
18,
13,
2,
4,
18,
13,
17,
13,
4,
18,
18,
13,
13,
4,
18,
13,
17,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
191,
5
],
[
191,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
10,
11
],
[
10,
12
],
[
12,
13
],
[
13,
14
],
[
9,
15
],
[
15,
16
],
[
16,
17
],
[
16,
18
],
[
18,
19
],
[
19,
20
],
[
18,
21
],
[
15,
22
],
[
22,
23
],
[
6,
24
],
[
24,
25
],
[
191,
26
],
[
26,
27
],
[
26,
28
],
[
28,
29
],
[
29,
30
],
[
29,
31
],
[
28,
32
],
[
32,
33
],
[
32,
34
],
[
28,
35
],
[
35,
36
],
[
36,
37
],
[
37,
38
],
[
35,
39
],
[
39,
40
],
[
40,
41
],
[
40,
42
],
[
42,
43
],
[
43,
44
],
[
39,
45
],
[
45,
46
],
[
46,
47
],
[
46,
48
],
[
45,
49
],
[
49,
50
],
[
50,
51
],
[
51,
52
],
[
50,
53
],
[
53,
54
],
[
54,
55
],
[
53,
56
],
[
45,
57
],
[
57,
58
],
[
58,
59
],
[
59,
60
],
[
60,
61
],
[
59,
62
],
[
58,
63
],
[
63,
64
],
[
64,
65
],
[
64,
66
],
[
66,
67
],
[
67,
68
],
[
68,
69
],
[
67,
70
],
[
70,
71
],
[
71,
72
],
[
72,
73
],
[
70,
74
],
[
66,
75
],
[
75,
76
],
[
76,
77
],
[
75,
78
],
[
78,
79
],
[
79,
80
],
[
80,
81
],
[
78,
82
],
[
63,
83
],
[
83,
84
],
[
84,
85
],
[
83,
86
],
[
86,
87
],
[
87,
88
],
[
88,
89
],
[
86,
90
],
[
63,
91
],
[
91,
92
],
[
92,
93
],
[
91,
94
],
[
94,
95
],
[
95,
96
],
[
96,
97
],
[
94,
98
],
[
91,
99
],
[
58,
100
],
[
100,
101
],
[
101,
102
],
[
102,
103
],
[
101,
104
],
[
100,
105
],
[
105,
106
],
[
106,
107
],
[
106,
108
],
[
108,
109
],
[
109,
110
],
[
110,
111
],
[
109,
112
],
[
112,
113
],
[
113,
114
],
[
114,
115
],
[
112,
116
],
[
108,
117
],
[
117,
118
],
[
118,
119
],
[
117,
120
],
[
120,
121
],
[
121,
122
],
[
122,
123
],
[
120,
124
],
[
105,
125
],
[
125,
126
],
[
126,
127
],
[
125,
128
],
[
128,
129
],
[
129,
130
],
[
130,
131
],
[
128,
132
],
[
105,
133
],
[
133,
134
],
[
134,
135
],
[
133,
136
],
[
136,
137
],
[
137,
138
],
[
138,
139
],
[
136,
140
],
[
133,
141
],
[
100,
142
],
[
142,
143
],
[
143,
144
],
[
143,
145
],
[
145,
146
],
[
146,
147
],
[
147,
148
],
[
146,
149
],
[
149,
150
],
[
150,
151
],
[
151,
152
],
[
149,
153
],
[
145,
154
],
[
154,
155
],
[
155,
156
],
[
154,
157
],
[
157,
158
],
[
158,
159
],
[
159,
160
],
[
157,
161
],
[
142,
162
],
[
162,
163
],
[
163,
164
],
[
162,
165
],
[
165,
166
],
[
166,
167
],
[
167,
168
],
[
165,
169
],
[
142,
170
],
[
170,
171
],
[
171,
172
],
[
170,
173
],
[
173,
174
],
[
174,
175
],
[
175,
176
],
[
173,
177
],
[
170,
178
],
[
28,
179
],
[
179,
180
],
[
180,
181
],
[
181,
182
],
[
181,
183
],
[
179,
184
],
[
184,
185
],
[
185,
186
],
[
184,
187
],
[
26,
188
],
[
188,
189
],
[
0,
190
],
[
190,
191
],
[
190,
192
]
] | [
"import java.util.*;\n\npublic class Main {\n public static boolean isNum(String s) {\n try {\n int n = Integer.parseInt(s);\n return true;\n } catch(NumberFormatException e) {\n return false;\n }\n }\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n List<Long> stack = new ArrayList<>();\n while(sc.hasNext()) {\n String s = sc.next();\n if(isNum(s)) {\n stack.add(Long.parseLong(s));\n } else {\n if(s.equals(\"+\")) {\n long a = stack.get(stack.size() - 2) + stack.get(stack.size() - 1);\n stack.remove(stack.size() - 1);\n stack.set(stack.size() - 1, a);\n } else if(s.equals(\"-\")) {\n long a = stack.get(stack.size() - 2) - stack.get(stack.size() - 1);\n stack.remove(stack.size() - 1);\n stack.set(stack.size() - 1, a);\n } else {\n long a = stack.get(stack.size() - 1) * stack.get(stack.size() - 2);\n stack.remove(stack.size() - 1);\n stack.set(stack.size() - 1, a);\n }\n }\n }\n System.out.println(stack.get(0));\n }\n}\n",
"import java.util.*;",
"util.*",
"java",
"public class Main {\n public static boolean isNum(String s) {\n try {\n int n = Integer.parseInt(s);\n return true;\n } catch(NumberFormatException e) {\n return false;\n }\n }\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n List<Long> stack = new ArrayList<>();\n while(sc.hasNext()) {\n String s = sc.next();\n if(isNum(s)) {\n stack.add(Long.parseLong(s));\n } else {\n if(s.equals(\"+\")) {\n long a = stack.get(stack.size() - 2) + stack.get(stack.size() - 1);\n stack.remove(stack.size() - 1);\n stack.set(stack.size() - 1, a);\n } else if(s.equals(\"-\")) {\n long a = stack.get(stack.size() - 2) - stack.get(stack.size() - 1);\n stack.remove(stack.size() - 1);\n stack.set(stack.size() - 1, a);\n } else {\n long a = stack.get(stack.size() - 1) * stack.get(stack.size() - 2);\n stack.remove(stack.size() - 1);\n stack.set(stack.size() - 1, a);\n }\n }\n }\n System.out.println(stack.get(0));\n }\n}",
"Main",
"public static boolean isNum(String s) {\n try {\n int n = Integer.parseInt(s);\n return true;\n } catch(NumberFormatException e) {\n return false;\n }\n }",
"isNum",
"{\n try {\n int n = Integer.parseInt(s);\n return true;\n } catch(NumberFormatException e) {\n return false;\n }\n }",
"try {\n int n = Integer.parseInt(s);\n return true;\n } catch(NumberFormatException e) {\n return false;\n }",
"catch(NumberFormatException e) {\n return false;\n }",
"NumberFormatException e",
"{\n return false;\n }",
"return false;",
"false",
"{\n int n = Integer.parseInt(s);\n return true;\n }",
"int n = Integer.parseInt(s);",
"n",
"Integer.parseInt(s)",
"Integer.parseInt",
"Integer",
"s",
"return true;",
"true",
"String s",
"s",
"public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n List<Long> stack = new ArrayList<>();\n while(sc.hasNext()) {\n String s = sc.next();\n if(isNum(s)) {\n stack.add(Long.parseLong(s));\n } else {\n if(s.equals(\"+\")) {\n long a = stack.get(stack.size() - 2) + stack.get(stack.size() - 1);\n stack.remove(stack.size() - 1);\n stack.set(stack.size() - 1, a);\n } else if(s.equals(\"-\")) {\n long a = stack.get(stack.size() - 2) - stack.get(stack.size() - 1);\n stack.remove(stack.size() - 1);\n stack.set(stack.size() - 1, a);\n } else {\n long a = stack.get(stack.size() - 1) * stack.get(stack.size() - 2);\n stack.remove(stack.size() - 1);\n stack.set(stack.size() - 1, a);\n }\n }\n }\n System.out.println(stack.get(0));\n }",
"main",
"{\n Scanner sc = new Scanner(System.in);\n List<Long> stack = new ArrayList<>();\n while(sc.hasNext()) {\n String s = sc.next();\n if(isNum(s)) {\n stack.add(Long.parseLong(s));\n } else {\n if(s.equals(\"+\")) {\n long a = stack.get(stack.size() - 2) + stack.get(stack.size() - 1);\n stack.remove(stack.size() - 1);\n stack.set(stack.size() - 1, a);\n } else if(s.equals(\"-\")) {\n long a = stack.get(stack.size() - 2) - stack.get(stack.size() - 1);\n stack.remove(stack.size() - 1);\n stack.set(stack.size() - 1, a);\n } else {\n long a = stack.get(stack.size() - 1) * stack.get(stack.size() - 2);\n stack.remove(stack.size() - 1);\n stack.set(stack.size() - 1, a);\n }\n }\n }\n System.out.println(stack.get(0));\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"List<Long> stack = new ArrayList<>();",
"stack",
"new ArrayList<>()",
"while(sc.hasNext()) {\n String s = sc.next();\n if(isNum(s)) {\n stack.add(Long.parseLong(s));\n } else {\n if(s.equals(\"+\")) {\n long a = stack.get(stack.size() - 2) + stack.get(stack.size() - 1);\n stack.remove(stack.size() - 1);\n stack.set(stack.size() - 1, a);\n } else if(s.equals(\"-\")) {\n long a = stack.get(stack.size() - 2) - stack.get(stack.size() - 1);\n stack.remove(stack.size() - 1);\n stack.set(stack.size() - 1, a);\n } else {\n long a = stack.get(stack.size() - 1) * stack.get(stack.size() - 2);\n stack.remove(stack.size() - 1);\n stack.set(stack.size() - 1, a);\n }\n }\n }",
"sc.hasNext()",
"sc.hasNext",
"sc",
"{\n String s = sc.next();\n if(isNum(s)) {\n stack.add(Long.parseLong(s));\n } else {\n if(s.equals(\"+\")) {\n long a = stack.get(stack.size() - 2) + stack.get(stack.size() - 1);\n stack.remove(stack.size() - 1);\n stack.set(stack.size() - 1, a);\n } else if(s.equals(\"-\")) {\n long a = stack.get(stack.size() - 2) - stack.get(stack.size() - 1);\n stack.remove(stack.size() - 1);\n stack.set(stack.size() - 1, a);\n } else {\n long a = stack.get(stack.size() - 1) * stack.get(stack.size() - 2);\n stack.remove(stack.size() - 1);\n stack.set(stack.size() - 1, a);\n }\n }\n }",
"String s = sc.next();",
"s",
"sc.next()",
"sc.next",
"sc",
"if(isNum(s)) {\n stack.add(Long.parseLong(s));\n } else {\n if(s.equals(\"+\")) {\n long a = stack.get(stack.size() - 2) + stack.get(stack.size() - 1);\n stack.remove(stack.size() - 1);\n stack.set(stack.size() - 1, a);\n } else if(s.equals(\"-\")) {\n long a = stack.get(stack.size() - 2) - stack.get(stack.size() - 1);\n stack.remove(stack.size() - 1);\n stack.set(stack.size() - 1, a);\n } else {\n long a = stack.get(stack.size() - 1) * stack.get(stack.size() - 2);\n stack.remove(stack.size() - 1);\n stack.set(stack.size() - 1, a);\n }\n }",
"isNum(s)",
"isNum",
"s",
"{\n stack.add(Long.parseLong(s));\n }",
"stack.add(Long.parseLong(s))",
"stack.add",
"stack",
"Long.parseLong(s)",
"Long.parseLong",
"Long",
"s",
"{\n if(s.equals(\"+\")) {\n long a = stack.get(stack.size() - 2) + stack.get(stack.size() - 1);\n stack.remove(stack.size() - 1);\n stack.set(stack.size() - 1, a);\n } else if(s.equals(\"-\")) {\n long a = stack.get(stack.size() - 2) - stack.get(stack.size() - 1);\n stack.remove(stack.size() - 1);\n stack.set(stack.size() - 1, a);\n } else {\n long a = stack.get(stack.size() - 1) * stack.get(stack.size() - 2);\n stack.remove(stack.size() - 1);\n stack.set(stack.size() - 1, a);\n }\n }",
"if(s.equals(\"+\")) {\n long a = stack.get(stack.size() - 2) + stack.get(stack.size() - 1);\n stack.remove(stack.size() - 1);\n stack.set(stack.size() - 1, a);\n } else if(s.equals(\"-\")) {\n long a = stack.get(stack.size() - 2) - stack.get(stack.size() - 1);\n stack.remove(stack.size() - 1);\n stack.set(stack.size() - 1, a);\n } else {\n long a = stack.get(stack.size() - 1) * stack.get(stack.size() - 2);\n stack.remove(stack.size() - 1);\n stack.set(stack.size() - 1, a);\n }",
"s.equals(\"+\")",
"s.equals",
"s",
"\"+\"",
"{\n long a = stack.get(stack.size() - 2) + stack.get(stack.size() - 1);\n stack.remove(stack.size() - 1);\n stack.set(stack.size() - 1, a);\n }",
"long a = stack.get(stack.size() - 2) + stack.get(stack.size() - 1);",
"a",
"stack.get(stack.size() - 2) + stack.get(stack.size() - 1)",
"stack.get(stack.size() - 2)",
"stack.get",
"stack",
"stack.size() - 2",
"stack.size()",
"stack.size",
"stack",
"2",
"stack.get(stack.size() - 1)",
"stack.get",
"stack",
"stack.size() - 1",
"stack.size()",
"stack.size",
"stack",
"1",
"stack.remove(stack.size() - 1)",
"stack.remove",
"stack",
"stack.size() - 1",
"stack.size()",
"stack.size",
"stack",
"1",
"stack.set(stack.size() - 1, a)",
"stack.set",
"stack",
"stack.size() - 1",
"stack.size()",
"stack.size",
"stack",
"1",
"a",
"if(s.equals(\"-\")) {\n long a = stack.get(stack.size() - 2) - stack.get(stack.size() - 1);\n stack.remove(stack.size() - 1);\n stack.set(stack.size() - 1, a);\n } else {\n long a = stack.get(stack.size() - 1) * stack.get(stack.size() - 2);\n stack.remove(stack.size() - 1);\n stack.set(stack.size() - 1, a);\n }",
"s.equals(\"-\")",
"s.equals",
"s",
"\"-\"",
"{\n long a = stack.get(stack.size() - 2) - stack.get(stack.size() - 1);\n stack.remove(stack.size() - 1);\n stack.set(stack.size() - 1, a);\n }",
"long a = stack.get(stack.size() - 2) - stack.get(stack.size() - 1);",
"a",
"stack.get(stack.size() - 2) - stack.get(stack.size() - 1)",
"stack.get(stack.size() - 2)",
"stack.get",
"stack",
"stack.size() - 2",
"stack.size()",
"stack.size",
"stack",
"2",
"stack.get(stack.size() - 1)",
"stack.get",
"stack",
"stack.size() - 1",
"stack.size()",
"stack.size",
"stack",
"1",
"stack.remove(stack.size() - 1)",
"stack.remove",
"stack",
"stack.size() - 1",
"stack.size()",
"stack.size",
"stack",
"1",
"stack.set(stack.size() - 1, a)",
"stack.set",
"stack",
"stack.size() - 1",
"stack.size()",
"stack.size",
"stack",
"1",
"a",
"{\n long a = stack.get(stack.size() - 1) * stack.get(stack.size() - 2);\n stack.remove(stack.size() - 1);\n stack.set(stack.size() - 1, a);\n }",
"long a = stack.get(stack.size() - 1) * stack.get(stack.size() - 2);",
"a",
"stack.get(stack.size() - 1) * stack.get(stack.size() - 2)",
"stack.get(stack.size() - 1)",
"stack.get",
"stack",
"stack.size() - 1",
"stack.size()",
"stack.size",
"stack",
"1",
"stack.get(stack.size() - 2)",
"stack.get",
"stack",
"stack.size() - 2",
"stack.size()",
"stack.size",
"stack",
"2",
"stack.remove(stack.size() - 1)",
"stack.remove",
"stack",
"stack.size() - 1",
"stack.size()",
"stack.size",
"stack",
"1",
"stack.set(stack.size() - 1, a)",
"stack.set",
"stack",
"stack.size() - 1",
"stack.size()",
"stack.size",
"stack",
"1",
"a",
"System.out.println(stack.get(0))",
"System.out.println",
"System.out",
"System",
"System.out",
"stack.get(0)",
"stack.get",
"stack",
"0",
"String[] args",
"args",
"public class Main {\n public static boolean isNum(String s) {\n try {\n int n = Integer.parseInt(s);\n return true;\n } catch(NumberFormatException e) {\n return false;\n }\n }\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n List<Long> stack = new ArrayList<>();\n while(sc.hasNext()) {\n String s = sc.next();\n if(isNum(s)) {\n stack.add(Long.parseLong(s));\n } else {\n if(s.equals(\"+\")) {\n long a = stack.get(stack.size() - 2) + stack.get(stack.size() - 1);\n stack.remove(stack.size() - 1);\n stack.set(stack.size() - 1, a);\n } else if(s.equals(\"-\")) {\n long a = stack.get(stack.size() - 2) - stack.get(stack.size() - 1);\n stack.remove(stack.size() - 1);\n stack.set(stack.size() - 1, a);\n } else {\n long a = stack.get(stack.size() - 1) * stack.get(stack.size() - 2);\n stack.remove(stack.size() - 1);\n stack.set(stack.size() - 1, a);\n }\n }\n }\n System.out.println(stack.get(0));\n }\n}",
"public class Main {\n public static boolean isNum(String s) {\n try {\n int n = Integer.parseInt(s);\n return true;\n } catch(NumberFormatException e) {\n return false;\n }\n }\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n List<Long> stack = new ArrayList<>();\n while(sc.hasNext()) {\n String s = sc.next();\n if(isNum(s)) {\n stack.add(Long.parseLong(s));\n } else {\n if(s.equals(\"+\")) {\n long a = stack.get(stack.size() - 2) + stack.get(stack.size() - 1);\n stack.remove(stack.size() - 1);\n stack.set(stack.size() - 1, a);\n } else if(s.equals(\"-\")) {\n long a = stack.get(stack.size() - 2) - stack.get(stack.size() - 1);\n stack.remove(stack.size() - 1);\n stack.set(stack.size() - 1, a);\n } else {\n long a = stack.get(stack.size() - 1) * stack.get(stack.size() - 2);\n stack.remove(stack.size() - 1);\n stack.set(stack.size() - 1, a);\n }\n }\n }\n System.out.println(stack.get(0));\n }\n}",
"Main"
] | import java.util.*;
public class Main {
public static boolean isNum(String s) {
try {
int n = Integer.parseInt(s);
return true;
} catch(NumberFormatException e) {
return false;
}
}
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
List<Long> stack = new ArrayList<>();
while(sc.hasNext()) {
String s = sc.next();
if(isNum(s)) {
stack.add(Long.parseLong(s));
} else {
if(s.equals("+")) {
long a = stack.get(stack.size() - 2) + stack.get(stack.size() - 1);
stack.remove(stack.size() - 1);
stack.set(stack.size() - 1, a);
} else if(s.equals("-")) {
long a = stack.get(stack.size() - 2) - stack.get(stack.size() - 1);
stack.remove(stack.size() - 1);
stack.set(stack.size() - 1, a);
} else {
long a = stack.get(stack.size() - 1) * stack.get(stack.size() - 2);
stack.remove(stack.size() - 1);
stack.set(stack.size() - 1, a);
}
}
}
System.out.println(stack.get(0));
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
20,
42,
4,
18,
13,
30,
41,
13,
4,
18,
13,
14,
4,
18,
17,
13,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
4,
18,
13,
2,
13,
13,
14,
4,
18,
17,
13,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
4,
18,
13,
2,
13,
13,
14,
4,
18,
17,
13,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
4,
18,
13,
2,
13,
13,
30,
4,
18,
13,
4,
18,
13,
13,
4,
18,
18,
13,
13,
4,
18,
13,
4,
18,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
119,
11
],
[
119,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
15,
17
],
[
14,
18
],
[
18,
19
],
[
18,
20
],
[
14,
21
],
[
21,
22
],
[
22,
23
],
[
23,
24
],
[
21,
25
],
[
25,
26
],
[
26,
27
],
[
26,
28
],
[
28,
29
],
[
29,
30
],
[
25,
31
],
[
31,
32
],
[
32,
33
],
[
33,
34
],
[
32,
35
],
[
31,
36
],
[
36,
37
],
[
37,
38
],
[
37,
39
],
[
39,
40
],
[
40,
41
],
[
36,
42
],
[
42,
43
],
[
42,
44
],
[
44,
45
],
[
45,
46
],
[
36,
47
],
[
47,
48
],
[
48,
49
],
[
47,
50
],
[
50,
51
],
[
50,
52
],
[
31,
53
],
[
53,
54
],
[
54,
55
],
[
55,
56
],
[
54,
57
],
[
53,
58
],
[
58,
59
],
[
59,
60
],
[
59,
61
],
[
61,
62
],
[
62,
63
],
[
58,
64
],
[
64,
65
],
[
64,
66
],
[
66,
67
],
[
67,
68
],
[
58,
69
],
[
69,
70
],
[
70,
71
],
[
69,
72
],
[
72,
73
],
[
72,
74
],
[
53,
75
],
[
75,
76
],
[
76,
77
],
[
77,
78
],
[
76,
79
],
[
75,
80
],
[
80,
81
],
[
81,
82
],
[
81,
83
],
[
83,
84
],
[
84,
85
],
[
80,
86
],
[
86,
87
],
[
86,
88
],
[
88,
89
],
[
89,
90
],
[
80,
91
],
[
91,
92
],
[
92,
93
],
[
91,
94
],
[
94,
95
],
[
94,
96
],
[
75,
97
],
[
97,
98
],
[
98,
99
],
[
99,
100
],
[
98,
101
],
[
101,
102
],
[
102,
103
],
[
101,
104
],
[
14,
105
],
[
105,
106
],
[
106,
107
],
[
107,
108
],
[
107,
109
],
[
105,
110
],
[
110,
111
],
[
111,
112
],
[
14,
113
],
[
113,
114
],
[
114,
115
],
[
12,
116
],
[
116,
117
],
[
0,
118
],
[
118,
119
],
[
118,
120
]
] | [
"import java.util.ArrayDeque;\nimport java.util.Deque;\nimport java.util.Scanner;\n\npublic class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner scan = new Scanner(System.in);\n\t\tDeque<Integer> dc = new ArrayDeque<Integer>();\n \n\t\twhile(scan.hasNext()) {\n\t\t\tString s = scan.next();\n\t\t\tif(\"+\".equals(s)) {\n\t\t\t\tint x = dc.pop();\n\t\t\t\tint y = dc.pop();\n\t\t\t\tdc.push(x+y);\n\t\t\t}\n\t\t\telse if(\"-\".equals(s)) {\n\t\t\t\tint x = dc.pop();\n\t\t\t\tint y = dc.pop();\n\t\t\t\tdc.push(y-x);\n\t\t\t}\n\t\t\telse if(\"*\".equals(s)) {\n\t\t\t\tint x = dc.pop();\n\t\t\t\tint y = dc.pop();\n\t\t\t\tdc.push(x*y);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tdc.push(Integer.valueOf(s));\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(dc.pop());\n\t\tscan.close();\n\t}\n}",
"import java.util.ArrayDeque;",
"ArrayDeque",
"java.util",
"import java.util.Deque;",
"Deque",
"java.util",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner scan = new Scanner(System.in);\n\t\tDeque<Integer> dc = new ArrayDeque<Integer>();\n \n\t\twhile(scan.hasNext()) {\n\t\t\tString s = scan.next();\n\t\t\tif(\"+\".equals(s)) {\n\t\t\t\tint x = dc.pop();\n\t\t\t\tint y = dc.pop();\n\t\t\t\tdc.push(x+y);\n\t\t\t}\n\t\t\telse if(\"-\".equals(s)) {\n\t\t\t\tint x = dc.pop();\n\t\t\t\tint y = dc.pop();\n\t\t\t\tdc.push(y-x);\n\t\t\t}\n\t\t\telse if(\"*\".equals(s)) {\n\t\t\t\tint x = dc.pop();\n\t\t\t\tint y = dc.pop();\n\t\t\t\tdc.push(x*y);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tdc.push(Integer.valueOf(s));\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(dc.pop());\n\t\tscan.close();\n\t}\n}",
"Main",
"public static void main(String[] args) {\n\t\tScanner scan = new Scanner(System.in);\n\t\tDeque<Integer> dc = new ArrayDeque<Integer>();\n \n\t\twhile(scan.hasNext()) {\n\t\t\tString s = scan.next();\n\t\t\tif(\"+\".equals(s)) {\n\t\t\t\tint x = dc.pop();\n\t\t\t\tint y = dc.pop();\n\t\t\t\tdc.push(x+y);\n\t\t\t}\n\t\t\telse if(\"-\".equals(s)) {\n\t\t\t\tint x = dc.pop();\n\t\t\t\tint y = dc.pop();\n\t\t\t\tdc.push(y-x);\n\t\t\t}\n\t\t\telse if(\"*\".equals(s)) {\n\t\t\t\tint x = dc.pop();\n\t\t\t\tint y = dc.pop();\n\t\t\t\tdc.push(x*y);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tdc.push(Integer.valueOf(s));\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(dc.pop());\n\t\tscan.close();\n\t}",
"main",
"{\n\t\tScanner scan = new Scanner(System.in);\n\t\tDeque<Integer> dc = new ArrayDeque<Integer>();\n \n\t\twhile(scan.hasNext()) {\n\t\t\tString s = scan.next();\n\t\t\tif(\"+\".equals(s)) {\n\t\t\t\tint x = dc.pop();\n\t\t\t\tint y = dc.pop();\n\t\t\t\tdc.push(x+y);\n\t\t\t}\n\t\t\telse if(\"-\".equals(s)) {\n\t\t\t\tint x = dc.pop();\n\t\t\t\tint y = dc.pop();\n\t\t\t\tdc.push(y-x);\n\t\t\t}\n\t\t\telse if(\"*\".equals(s)) {\n\t\t\t\tint x = dc.pop();\n\t\t\t\tint y = dc.pop();\n\t\t\t\tdc.push(x*y);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tdc.push(Integer.valueOf(s));\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(dc.pop());\n\t\tscan.close();\n\t}",
"Scanner scan = new Scanner(System.in);",
"scan",
"new Scanner(System.in)",
"Deque<Integer> dc = new ArrayDeque<Integer>();",
"dc",
"new ArrayDeque<Integer>()",
"while(scan.hasNext()) {\n\t\t\tString s = scan.next();\n\t\t\tif(\"+\".equals(s)) {\n\t\t\t\tint x = dc.pop();\n\t\t\t\tint y = dc.pop();\n\t\t\t\tdc.push(x+y);\n\t\t\t}\n\t\t\telse if(\"-\".equals(s)) {\n\t\t\t\tint x = dc.pop();\n\t\t\t\tint y = dc.pop();\n\t\t\t\tdc.push(y-x);\n\t\t\t}\n\t\t\telse if(\"*\".equals(s)) {\n\t\t\t\tint x = dc.pop();\n\t\t\t\tint y = dc.pop();\n\t\t\t\tdc.push(x*y);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tdc.push(Integer.valueOf(s));\n\t\t\t}\n\t\t}",
"scan.hasNext()",
"scan.hasNext",
"scan",
"{\n\t\t\tString s = scan.next();\n\t\t\tif(\"+\".equals(s)) {\n\t\t\t\tint x = dc.pop();\n\t\t\t\tint y = dc.pop();\n\t\t\t\tdc.push(x+y);\n\t\t\t}\n\t\t\telse if(\"-\".equals(s)) {\n\t\t\t\tint x = dc.pop();\n\t\t\t\tint y = dc.pop();\n\t\t\t\tdc.push(y-x);\n\t\t\t}\n\t\t\telse if(\"*\".equals(s)) {\n\t\t\t\tint x = dc.pop();\n\t\t\t\tint y = dc.pop();\n\t\t\t\tdc.push(x*y);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tdc.push(Integer.valueOf(s));\n\t\t\t}\n\t\t}",
"String s = scan.next();",
"s",
"scan.next()",
"scan.next",
"scan",
"if(\"+\".equals(s)) {\n\t\t\t\tint x = dc.pop();\n\t\t\t\tint y = dc.pop();\n\t\t\t\tdc.push(x+y);\n\t\t\t}\n\t\t\telse if(\"-\".equals(s)) {\n\t\t\t\tint x = dc.pop();\n\t\t\t\tint y = dc.pop();\n\t\t\t\tdc.push(y-x);\n\t\t\t}\n\t\t\telse if(\"*\".equals(s)) {\n\t\t\t\tint x = dc.pop();\n\t\t\t\tint y = dc.pop();\n\t\t\t\tdc.push(x*y);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tdc.push(Integer.valueOf(s));\n\t\t\t}",
"\"+\".equals(s)",
"\"+\".equals",
"\"+\"",
"s",
"{\n\t\t\t\tint x = dc.pop();\n\t\t\t\tint y = dc.pop();\n\t\t\t\tdc.push(x+y);\n\t\t\t}",
"int x = dc.pop();",
"x",
"dc.pop()",
"dc.pop",
"dc",
"int y = dc.pop();",
"y",
"dc.pop()",
"dc.pop",
"dc",
"dc.push(x+y)",
"dc.push",
"dc",
"x+y",
"x",
"y",
"if(\"-\".equals(s)) {\n\t\t\t\tint x = dc.pop();\n\t\t\t\tint y = dc.pop();\n\t\t\t\tdc.push(y-x);\n\t\t\t}\n\t\t\telse if(\"*\".equals(s)) {\n\t\t\t\tint x = dc.pop();\n\t\t\t\tint y = dc.pop();\n\t\t\t\tdc.push(x*y);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tdc.push(Integer.valueOf(s));\n\t\t\t}",
"\"-\".equals(s)",
"\"-\".equals",
"\"-\"",
"s",
"{\n\t\t\t\tint x = dc.pop();\n\t\t\t\tint y = dc.pop();\n\t\t\t\tdc.push(y-x);\n\t\t\t}",
"int x = dc.pop();",
"x",
"dc.pop()",
"dc.pop",
"dc",
"int y = dc.pop();",
"y",
"dc.pop()",
"dc.pop",
"dc",
"dc.push(y-x)",
"dc.push",
"dc",
"y-x",
"y",
"x",
"if(\"*\".equals(s)) {\n\t\t\t\tint x = dc.pop();\n\t\t\t\tint y = dc.pop();\n\t\t\t\tdc.push(x*y);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tdc.push(Integer.valueOf(s));\n\t\t\t}",
"\"*\".equals(s)",
"\"*\".equals",
"\"*\"",
"s",
"{\n\t\t\t\tint x = dc.pop();\n\t\t\t\tint y = dc.pop();\n\t\t\t\tdc.push(x*y);\n\t\t\t}",
"int x = dc.pop();",
"x",
"dc.pop()",
"dc.pop",
"dc",
"int y = dc.pop();",
"y",
"dc.pop()",
"dc.pop",
"dc",
"dc.push(x*y)",
"dc.push",
"dc",
"x*y",
"x",
"y",
"{\n\t\t\t\tdc.push(Integer.valueOf(s));\n\t\t\t}",
"dc.push(Integer.valueOf(s))",
"dc.push",
"dc",
"Integer.valueOf(s)",
"Integer.valueOf",
"Integer",
"s",
"System.out.println(dc.pop())",
"System.out.println",
"System.out",
"System",
"System.out",
"dc.pop()",
"dc.pop",
"dc",
"scan.close()",
"scan.close",
"scan",
"String[] args",
"args",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner scan = new Scanner(System.in);\n\t\tDeque<Integer> dc = new ArrayDeque<Integer>();\n \n\t\twhile(scan.hasNext()) {\n\t\t\tString s = scan.next();\n\t\t\tif(\"+\".equals(s)) {\n\t\t\t\tint x = dc.pop();\n\t\t\t\tint y = dc.pop();\n\t\t\t\tdc.push(x+y);\n\t\t\t}\n\t\t\telse if(\"-\".equals(s)) {\n\t\t\t\tint x = dc.pop();\n\t\t\t\tint y = dc.pop();\n\t\t\t\tdc.push(y-x);\n\t\t\t}\n\t\t\telse if(\"*\".equals(s)) {\n\t\t\t\tint x = dc.pop();\n\t\t\t\tint y = dc.pop();\n\t\t\t\tdc.push(x*y);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tdc.push(Integer.valueOf(s));\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(dc.pop());\n\t\tscan.close();\n\t}\n}",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner scan = new Scanner(System.in);\n\t\tDeque<Integer> dc = new ArrayDeque<Integer>();\n \n\t\twhile(scan.hasNext()) {\n\t\t\tString s = scan.next();\n\t\t\tif(\"+\".equals(s)) {\n\t\t\t\tint x = dc.pop();\n\t\t\t\tint y = dc.pop();\n\t\t\t\tdc.push(x+y);\n\t\t\t}\n\t\t\telse if(\"-\".equals(s)) {\n\t\t\t\tint x = dc.pop();\n\t\t\t\tint y = dc.pop();\n\t\t\t\tdc.push(y-x);\n\t\t\t}\n\t\t\telse if(\"*\".equals(s)) {\n\t\t\t\tint x = dc.pop();\n\t\t\t\tint y = dc.pop();\n\t\t\t\tdc.push(x*y);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tdc.push(Integer.valueOf(s));\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(dc.pop());\n\t\tscan.close();\n\t}\n}",
"Main"
] | import java.util.ArrayDeque;
import java.util.Deque;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
Deque<Integer> dc = new ArrayDeque<Integer>();
while(scan.hasNext()) {
String s = scan.next();
if("+".equals(s)) {
int x = dc.pop();
int y = dc.pop();
dc.push(x+y);
}
else if("-".equals(s)) {
int x = dc.pop();
int y = dc.pop();
dc.push(y-x);
}
else if("*".equals(s)) {
int x = dc.pop();
int y = dc.pop();
dc.push(x*y);
}
else {
dc.push(Integer.valueOf(s));
}
}
System.out.println(dc.pop());
scan.close();
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
20,
41,
13,
17,
41,
13,
17,
41,
13,
17,
42,
4,
18,
13,
30,
0,
13,
4,
18,
13,
14,
4,
18,
13,
17,
30,
0,
13,
4,
18,
13,
0,
13,
4,
18,
13,
4,
18,
13,
2,
13,
13,
14,
4,
18,
13,
17,
30,
0,
13,
4,
18,
13,
0,
13,
4,
18,
13,
4,
18,
13,
2,
13,
13,
14,
4,
18,
13,
17,
30,
0,
13,
4,
18,
13,
0,
13,
4,
18,
13,
4,
18,
13,
2,
13,
13,
14,
4,
18,
13,
17,
30,
0,
13,
4,
18,
13,
0,
13,
4,
18,
13,
4,
18,
13,
2,
13,
13,
30,
4,
18,
13,
4,
18,
13,
13,
4,
18,
18,
13,
13,
4,
18,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
147,
11
],
[
147,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
15,
17
],
[
14,
18
],
[
18,
19
],
[
18,
20
],
[
14,
21
],
[
21,
22
],
[
21,
23
],
[
14,
24
],
[
24,
25
],
[
24,
26
],
[
14,
27
],
[
27,
28
],
[
27,
29
],
[
14,
30
],
[
30,
31
],
[
31,
32
],
[
32,
33
],
[
30,
34
],
[
34,
35
],
[
35,
36
],
[
35,
37
],
[
37,
38
],
[
38,
39
],
[
34,
40
],
[
40,
41
],
[
41,
42
],
[
42,
43
],
[
41,
44
],
[
40,
45
],
[
45,
46
],
[
46,
47
],
[
46,
48
],
[
48,
49
],
[
49,
50
],
[
45,
51
],
[
51,
52
],
[
51,
53
],
[
53,
54
],
[
54,
55
],
[
45,
56
],
[
56,
57
],
[
57,
58
],
[
56,
59
],
[
59,
60
],
[
59,
61
],
[
40,
62
],
[
62,
63
],
[
63,
64
],
[
64,
65
],
[
63,
66
],
[
62,
67
],
[
67,
68
],
[
68,
69
],
[
68,
70
],
[
70,
71
],
[
71,
72
],
[
67,
73
],
[
73,
74
],
[
73,
75
],
[
75,
76
],
[
76,
77
],
[
67,
78
],
[
78,
79
],
[
79,
80
],
[
78,
81
],
[
81,
82
],
[
81,
83
],
[
62,
84
],
[
84,
85
],
[
85,
86
],
[
86,
87
],
[
85,
88
],
[
84,
89
],
[
89,
90
],
[
90,
91
],
[
90,
92
],
[
92,
93
],
[
93,
94
],
[
89,
95
],
[
95,
96
],
[
95,
97
],
[
97,
98
],
[
98,
99
],
[
89,
100
],
[
100,
101
],
[
101,
102
],
[
100,
103
],
[
103,
104
],
[
103,
105
],
[
84,
106
],
[
106,
107
],
[
107,
108
],
[
108,
109
],
[
107,
110
],
[
106,
111
],
[
111,
112
],
[
112,
113
],
[
112,
114
],
[
114,
115
],
[
115,
116
],
[
111,
117
],
[
117,
118
],
[
117,
119
],
[
119,
120
],
[
120,
121
],
[
111,
122
],
[
122,
123
],
[
123,
124
],
[
122,
125
],
[
125,
126
],
[
125,
127
],
[
106,
128
],
[
128,
129
],
[
129,
130
],
[
130,
131
],
[
129,
132
],
[
132,
133
],
[
133,
134
],
[
132,
135
],
[
14,
136
],
[
136,
137
],
[
137,
138
],
[
138,
139
],
[
138,
140
],
[
136,
141
],
[
141,
142
],
[
142,
143
],
[
12,
144
],
[
144,
145
],
[
0,
146
],
[
146,
147
],
[
146,
148
]
] | [
"import java.util.Scanner;\nimport java.util.Deque;\nimport java.util.ArrayDeque;\n\npublic class Main{\n public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n Deque<Integer> deq = new ArrayDeque<Integer>();\n String str = \"\";\n int a = 0, b = 0;\n while(sc.hasNext()){\n \tstr = sc.next();\n \tif(str.equals(\"+\")){\n \t\ta = deq.pollLast();\n \t\tb = deq.pollLast();\n \t\tdeq.addLast(a + b);\n \t}else if(str.equals(\"-\")){\n \t\ta = deq.pollLast();\n \t\tb = deq.pollLast();\n \t\tdeq.addLast(b - a);\n \t}else if(str.equals(\"*\")){\n \t\ta = deq.pollLast();\n \t\tb = deq.pollLast();\n \t\tdeq.addLast(a * b);\n \t}else if(str.equals(\"/\")){\n \t\ta = deq.pollLast();\n \t\tb = deq.pollLast();\n \t\tdeq.addLast(b / a);\n \t}else{\n \t\tdeq.addLast(Integer.parseInt(str));\n \t}\n }\n System.out.println(deq.peekLast());\n }\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"import java.util.Deque;",
"Deque",
"java.util",
"import java.util.ArrayDeque;",
"ArrayDeque",
"java.util",
"public class Main{\n public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n Deque<Integer> deq = new ArrayDeque<Integer>();\n String str = \"\";\n int a = 0, b = 0;\n while(sc.hasNext()){\n \tstr = sc.next();\n \tif(str.equals(\"+\")){\n \t\ta = deq.pollLast();\n \t\tb = deq.pollLast();\n \t\tdeq.addLast(a + b);\n \t}else if(str.equals(\"-\")){\n \t\ta = deq.pollLast();\n \t\tb = deq.pollLast();\n \t\tdeq.addLast(b - a);\n \t}else if(str.equals(\"*\")){\n \t\ta = deq.pollLast();\n \t\tb = deq.pollLast();\n \t\tdeq.addLast(a * b);\n \t}else if(str.equals(\"/\")){\n \t\ta = deq.pollLast();\n \t\tb = deq.pollLast();\n \t\tdeq.addLast(b / a);\n \t}else{\n \t\tdeq.addLast(Integer.parseInt(str));\n \t}\n }\n System.out.println(deq.peekLast());\n }\n}",
"Main",
"public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n Deque<Integer> deq = new ArrayDeque<Integer>();\n String str = \"\";\n int a = 0, b = 0;\n while(sc.hasNext()){\n \tstr = sc.next();\n \tif(str.equals(\"+\")){\n \t\ta = deq.pollLast();\n \t\tb = deq.pollLast();\n \t\tdeq.addLast(a + b);\n \t}else if(str.equals(\"-\")){\n \t\ta = deq.pollLast();\n \t\tb = deq.pollLast();\n \t\tdeq.addLast(b - a);\n \t}else if(str.equals(\"*\")){\n \t\ta = deq.pollLast();\n \t\tb = deq.pollLast();\n \t\tdeq.addLast(a * b);\n \t}else if(str.equals(\"/\")){\n \t\ta = deq.pollLast();\n \t\tb = deq.pollLast();\n \t\tdeq.addLast(b / a);\n \t}else{\n \t\tdeq.addLast(Integer.parseInt(str));\n \t}\n }\n System.out.println(deq.peekLast());\n }",
"main",
"{\n Scanner sc = new Scanner(System.in);\n Deque<Integer> deq = new ArrayDeque<Integer>();\n String str = \"\";\n int a = 0, b = 0;\n while(sc.hasNext()){\n \tstr = sc.next();\n \tif(str.equals(\"+\")){\n \t\ta = deq.pollLast();\n \t\tb = deq.pollLast();\n \t\tdeq.addLast(a + b);\n \t}else if(str.equals(\"-\")){\n \t\ta = deq.pollLast();\n \t\tb = deq.pollLast();\n \t\tdeq.addLast(b - a);\n \t}else if(str.equals(\"*\")){\n \t\ta = deq.pollLast();\n \t\tb = deq.pollLast();\n \t\tdeq.addLast(a * b);\n \t}else if(str.equals(\"/\")){\n \t\ta = deq.pollLast();\n \t\tb = deq.pollLast();\n \t\tdeq.addLast(b / a);\n \t}else{\n \t\tdeq.addLast(Integer.parseInt(str));\n \t}\n }\n System.out.println(deq.peekLast());\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"Deque<Integer> deq = new ArrayDeque<Integer>();",
"deq",
"new ArrayDeque<Integer>()",
"String str = \"\";",
"str",
"\"\"",
"int a = 0",
"a",
"0",
"b = 0;",
"b",
"0",
"while(sc.hasNext()){\n \tstr = sc.next();\n \tif(str.equals(\"+\")){\n \t\ta = deq.pollLast();\n \t\tb = deq.pollLast();\n \t\tdeq.addLast(a + b);\n \t}else if(str.equals(\"-\")){\n \t\ta = deq.pollLast();\n \t\tb = deq.pollLast();\n \t\tdeq.addLast(b - a);\n \t}else if(str.equals(\"*\")){\n \t\ta = deq.pollLast();\n \t\tb = deq.pollLast();\n \t\tdeq.addLast(a * b);\n \t}else if(str.equals(\"/\")){\n \t\ta = deq.pollLast();\n \t\tb = deq.pollLast();\n \t\tdeq.addLast(b / a);\n \t}else{\n \t\tdeq.addLast(Integer.parseInt(str));\n \t}\n }",
"sc.hasNext()",
"sc.hasNext",
"sc",
"{\n \tstr = sc.next();\n \tif(str.equals(\"+\")){\n \t\ta = deq.pollLast();\n \t\tb = deq.pollLast();\n \t\tdeq.addLast(a + b);\n \t}else if(str.equals(\"-\")){\n \t\ta = deq.pollLast();\n \t\tb = deq.pollLast();\n \t\tdeq.addLast(b - a);\n \t}else if(str.equals(\"*\")){\n \t\ta = deq.pollLast();\n \t\tb = deq.pollLast();\n \t\tdeq.addLast(a * b);\n \t}else if(str.equals(\"/\")){\n \t\ta = deq.pollLast();\n \t\tb = deq.pollLast();\n \t\tdeq.addLast(b / a);\n \t}else{\n \t\tdeq.addLast(Integer.parseInt(str));\n \t}\n }",
"str = sc.next()",
"str",
"sc.next()",
"sc.next",
"sc",
"if(str.equals(\"+\")){\n \t\ta = deq.pollLast();\n \t\tb = deq.pollLast();\n \t\tdeq.addLast(a + b);\n \t}else if(str.equals(\"-\")){\n \t\ta = deq.pollLast();\n \t\tb = deq.pollLast();\n \t\tdeq.addLast(b - a);\n \t}else if(str.equals(\"*\")){\n \t\ta = deq.pollLast();\n \t\tb = deq.pollLast();\n \t\tdeq.addLast(a * b);\n \t}else if(str.equals(\"/\")){\n \t\ta = deq.pollLast();\n \t\tb = deq.pollLast();\n \t\tdeq.addLast(b / a);\n \t}else{\n \t\tdeq.addLast(Integer.parseInt(str));\n \t}",
"str.equals(\"+\")",
"str.equals",
"str",
"\"+\"",
"{\n \t\ta = deq.pollLast();\n \t\tb = deq.pollLast();\n \t\tdeq.addLast(a + b);\n \t}",
"a = deq.pollLast()",
"a",
"deq.pollLast()",
"deq.pollLast",
"deq",
"b = deq.pollLast()",
"b",
"deq.pollLast()",
"deq.pollLast",
"deq",
"deq.addLast(a + b)",
"deq.addLast",
"deq",
"a + b",
"a",
"b",
"if(str.equals(\"-\")){\n \t\ta = deq.pollLast();\n \t\tb = deq.pollLast();\n \t\tdeq.addLast(b - a);\n \t}else if(str.equals(\"*\")){\n \t\ta = deq.pollLast();\n \t\tb = deq.pollLast();\n \t\tdeq.addLast(a * b);\n \t}else if(str.equals(\"/\")){\n \t\ta = deq.pollLast();\n \t\tb = deq.pollLast();\n \t\tdeq.addLast(b / a);\n \t}else{\n \t\tdeq.addLast(Integer.parseInt(str));\n \t}",
"str.equals(\"-\")",
"str.equals",
"str",
"\"-\"",
"{\n \t\ta = deq.pollLast();\n \t\tb = deq.pollLast();\n \t\tdeq.addLast(b - a);\n \t}",
"a = deq.pollLast()",
"a",
"deq.pollLast()",
"deq.pollLast",
"deq",
"b = deq.pollLast()",
"b",
"deq.pollLast()",
"deq.pollLast",
"deq",
"deq.addLast(b - a)",
"deq.addLast",
"deq",
"b - a",
"b",
"a",
"if(str.equals(\"*\")){\n \t\ta = deq.pollLast();\n \t\tb = deq.pollLast();\n \t\tdeq.addLast(a * b);\n \t}else if(str.equals(\"/\")){\n \t\ta = deq.pollLast();\n \t\tb = deq.pollLast();\n \t\tdeq.addLast(b / a);\n \t}else{\n \t\tdeq.addLast(Integer.parseInt(str));\n \t}",
"str.equals(\"*\")",
"str.equals",
"str",
"\"*\"",
"{\n \t\ta = deq.pollLast();\n \t\tb = deq.pollLast();\n \t\tdeq.addLast(a * b);\n \t}",
"a = deq.pollLast()",
"a",
"deq.pollLast()",
"deq.pollLast",
"deq",
"b = deq.pollLast()",
"b",
"deq.pollLast()",
"deq.pollLast",
"deq",
"deq.addLast(a * b)",
"deq.addLast",
"deq",
"a * b",
"a",
"b",
"if(str.equals(\"/\")){\n \t\ta = deq.pollLast();\n \t\tb = deq.pollLast();\n \t\tdeq.addLast(b / a);\n \t}else{\n \t\tdeq.addLast(Integer.parseInt(str));\n \t}",
"str.equals(\"/\")",
"str.equals",
"str",
"\"/\"",
"{\n \t\ta = deq.pollLast();\n \t\tb = deq.pollLast();\n \t\tdeq.addLast(b / a);\n \t}",
"a = deq.pollLast()",
"a",
"deq.pollLast()",
"deq.pollLast",
"deq",
"b = deq.pollLast()",
"b",
"deq.pollLast()",
"deq.pollLast",
"deq",
"deq.addLast(b / a)",
"deq.addLast",
"deq",
"b / a",
"b",
"a",
"{\n \t\tdeq.addLast(Integer.parseInt(str));\n \t}",
"deq.addLast(Integer.parseInt(str))",
"deq.addLast",
"deq",
"Integer.parseInt(str)",
"Integer.parseInt",
"Integer",
"str",
"System.out.println(deq.peekLast())",
"System.out.println",
"System.out",
"System",
"System.out",
"deq.peekLast()",
"deq.peekLast",
"deq",
"String[] args",
"args",
"public class Main{\n public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n Deque<Integer> deq = new ArrayDeque<Integer>();\n String str = \"\";\n int a = 0, b = 0;\n while(sc.hasNext()){\n \tstr = sc.next();\n \tif(str.equals(\"+\")){\n \t\ta = deq.pollLast();\n \t\tb = deq.pollLast();\n \t\tdeq.addLast(a + b);\n \t}else if(str.equals(\"-\")){\n \t\ta = deq.pollLast();\n \t\tb = deq.pollLast();\n \t\tdeq.addLast(b - a);\n \t}else if(str.equals(\"*\")){\n \t\ta = deq.pollLast();\n \t\tb = deq.pollLast();\n \t\tdeq.addLast(a * b);\n \t}else if(str.equals(\"/\")){\n \t\ta = deq.pollLast();\n \t\tb = deq.pollLast();\n \t\tdeq.addLast(b / a);\n \t}else{\n \t\tdeq.addLast(Integer.parseInt(str));\n \t}\n }\n System.out.println(deq.peekLast());\n }\n}",
"public class Main{\n public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n Deque<Integer> deq = new ArrayDeque<Integer>();\n String str = \"\";\n int a = 0, b = 0;\n while(sc.hasNext()){\n \tstr = sc.next();\n \tif(str.equals(\"+\")){\n \t\ta = deq.pollLast();\n \t\tb = deq.pollLast();\n \t\tdeq.addLast(a + b);\n \t}else if(str.equals(\"-\")){\n \t\ta = deq.pollLast();\n \t\tb = deq.pollLast();\n \t\tdeq.addLast(b - a);\n \t}else if(str.equals(\"*\")){\n \t\ta = deq.pollLast();\n \t\tb = deq.pollLast();\n \t\tdeq.addLast(a * b);\n \t}else if(str.equals(\"/\")){\n \t\ta = deq.pollLast();\n \t\tb = deq.pollLast();\n \t\tdeq.addLast(b / a);\n \t}else{\n \t\tdeq.addLast(Integer.parseInt(str));\n \t}\n }\n System.out.println(deq.peekLast());\n }\n}",
"Main"
] | import java.util.Scanner;
import java.util.Deque;
import java.util.ArrayDeque;
public class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
Deque<Integer> deq = new ArrayDeque<Integer>();
String str = "";
int a = 0, b = 0;
while(sc.hasNext()){
str = sc.next();
if(str.equals("+")){
a = deq.pollLast();
b = deq.pollLast();
deq.addLast(a + b);
}else if(str.equals("-")){
a = deq.pollLast();
b = deq.pollLast();
deq.addLast(b - a);
}else if(str.equals("*")){
a = deq.pollLast();
b = deq.pollLast();
deq.addLast(a * b);
}else if(str.equals("/")){
a = deq.pollLast();
b = deq.pollLast();
deq.addLast(b / a);
}else{
deq.addLast(Integer.parseInt(str));
}
}
System.out.println(deq.peekLast());
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
4,
18,
13,
17,
41,
13,
20,
17,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
30,
41,
13,
40,
17,
14,
4,
13,
18,
13,
13,
30,
41,
13,
18,
13,
2,
13,
17,
41,
13,
18,
13,
2,
13,
17,
14,
4,
18,
18,
13,
13,
17,
30,
0,
13,
2,
13,
13,
14,
4,
18,
18,
13,
13,
17,
30,
0,
13,
2,
13,
13,
14,
4,
18,
18,
13,
13,
17,
30,
0,
13,
2,
13,
13,
0,
13,
17,
30,
0,
13,
4,
18,
13,
18,
13,
13,
0,
18,
13,
40,
13,
13,
4,
18,
18,
13,
13,
18,
13,
17,
23,
13,
12,
13,
30,
14,
2,
2,
4,
18,
13,
17,
4,
18,
13,
17,
4,
18,
13,
17,
30,
29,
17,
29,
17,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
160,
5
],
[
160,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
16,
17
],
[
17,
18
],
[
14,
19
],
[
8,
20
],
[
20,
21
],
[
20,
22
],
[
8,
24
],
[
24,
25
],
[
24,
26
],
[
8,
27
],
[
27,
28
],
[
28,
29
],
[
29,
30
],
[
29,
31
],
[
27,
32
],
[
32,
33
],
[
32,
34
],
[
34,
35
],
[
34,
36
],
[
27,
37
],
[
37,
38
],
[
38,
39
],
[
27,
40
],
[
41,
41
],
[
41,
42
],
[
42,
43
],
[
42,
44
],
[
44,
45
],
[
41,
46
],
[
46,
47
],
[
47,
48
],
[
47,
49
],
[
49,
50
],
[
49,
51
],
[
46,
52
],
[
52,
53
],
[
53,
54
],
[
53,
55
],
[
55,
56
],
[
55,
57
],
[
57,
58
],
[
57,
59
],
[
52,
60
],
[
60,
61
],
[
60,
62
],
[
62,
63
],
[
62,
64
],
[
64,
65
],
[
64,
66
],
[
52,
67
],
[
67,
68
],
[
68,
69
],
[
69,
70
],
[
70,
71
],
[
70,
72
],
[
68,
73
],
[
67,
74
],
[
74,
75
],
[
75,
76
],
[
75,
77
],
[
77,
78
],
[
77,
79
],
[
52,
80
],
[
80,
81
],
[
81,
82
],
[
82,
83
],
[
83,
84
],
[
83,
85
],
[
81,
86
],
[
80,
87
],
[
87,
88
],
[
88,
89
],
[
88,
90
],
[
90,
91
],
[
90,
92
],
[
52,
93
],
[
93,
94
],
[
94,
95
],
[
95,
96
],
[
96,
97
],
[
96,
98
],
[
94,
99
],
[
93,
100
],
[
100,
101
],
[
101,
102
],
[
101,
103
],
[
103,
104
],
[
103,
105
],
[
52,
106
],
[
106,
107
],
[
106,
108
],
[
46,
109
],
[
109,
110
],
[
110,
111
],
[
110,
112
],
[
112,
113
],
[
113,
114
],
[
112,
115
],
[
115,
116
],
[
115,
117
],
[
41,
118
],
[
118,
119
],
[
119,
120
],
[
119,
121
],
[
121,
122
],
[
118,
123
],
[
8,
124
],
[
124,
125
],
[
125,
126
],
[
126,
127
],
[
126,
128
],
[
124,
129
],
[
129,
130
],
[
129,
131
],
[
6,
132
],
[
132,
133
],
[
160,
134
],
[
134,
135
],
[
134,
136
],
[
136,
137
],
[
137,
138
],
[
139,
139
],
[
139,
140
],
[
140,
141
],
[
141,
142
],
[
140,
143
],
[
139,
144
],
[
144,
145
],
[
145,
146
],
[
144,
147
],
[
139,
148
],
[
148,
149
],
[
149,
150
],
[
148,
151
],
[
137,
152
],
[
152,
153
],
[
153,
154
],
[
136,
155
],
[
155,
156
],
[
134,
157
],
[
157,
158
],
[
0,
159
],
[
159,
160
],
[
159,
161
]
] | [
"import java.util.Scanner;\npublic class Main {\n public static void main (String[] args) {\n\tScanner scan = new Scanner(System.in);\n\tString[] inputs = scan.nextLine().split(\" \");\n\tint[] operands = new int[100];\n\tint cursol = 0;\n\tfor (int i = 0; i < inputs.length; i++) {\n\t int n = -1;\n\t if (isOperator(inputs[i])) {\n\t\tint op1 = operands[cursol - 2];\n\t\tint op2 = operands[cursol - 1];\n\t\tif (inputs[i].equals(\"+\")) {\n\t\t n = op1 + op2;\n\t\t}\n\t\tif (inputs[i].equals(\"-\")) {\n\t\t n = op1 - op2;\n\t\t}\n\t\tif (inputs[i].equals(\"*\")) {\n\t\t n = op1 * op2;\n\t\t}\n\t\tcursol -= 2;\n\t }\n\t else {\n\t\tn = Integer.parseInt(inputs[i]);\n\t }\n\t operands[cursol++] = n;\n\t}\n\tSystem.out.println(operands[0]);\n }\n static boolean isOperator (String a) {\n\tif (a.equals(\"+\") || a.equals(\"-\") || a.equals(\"*\")) {\n\t return true;\n\t}\n\treturn false;\n }\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n public static void main (String[] args) {\n\tScanner scan = new Scanner(System.in);\n\tString[] inputs = scan.nextLine().split(\" \");\n\tint[] operands = new int[100];\n\tint cursol = 0;\n\tfor (int i = 0; i < inputs.length; i++) {\n\t int n = -1;\n\t if (isOperator(inputs[i])) {\n\t\tint op1 = operands[cursol - 2];\n\t\tint op2 = operands[cursol - 1];\n\t\tif (inputs[i].equals(\"+\")) {\n\t\t n = op1 + op2;\n\t\t}\n\t\tif (inputs[i].equals(\"-\")) {\n\t\t n = op1 - op2;\n\t\t}\n\t\tif (inputs[i].equals(\"*\")) {\n\t\t n = op1 * op2;\n\t\t}\n\t\tcursol -= 2;\n\t }\n\t else {\n\t\tn = Integer.parseInt(inputs[i]);\n\t }\n\t operands[cursol++] = n;\n\t}\n\tSystem.out.println(operands[0]);\n }\n static boolean isOperator (String a) {\n\tif (a.equals(\"+\") || a.equals(\"-\") || a.equals(\"*\")) {\n\t return true;\n\t}\n\treturn false;\n }\n}",
"Main",
"public static void main (String[] args) {\n\tScanner scan = new Scanner(System.in);\n\tString[] inputs = scan.nextLine().split(\" \");\n\tint[] operands = new int[100];\n\tint cursol = 0;\n\tfor (int i = 0; i < inputs.length; i++) {\n\t int n = -1;\n\t if (isOperator(inputs[i])) {\n\t\tint op1 = operands[cursol - 2];\n\t\tint op2 = operands[cursol - 1];\n\t\tif (inputs[i].equals(\"+\")) {\n\t\t n = op1 + op2;\n\t\t}\n\t\tif (inputs[i].equals(\"-\")) {\n\t\t n = op1 - op2;\n\t\t}\n\t\tif (inputs[i].equals(\"*\")) {\n\t\t n = op1 * op2;\n\t\t}\n\t\tcursol -= 2;\n\t }\n\t else {\n\t\tn = Integer.parseInt(inputs[i]);\n\t }\n\t operands[cursol++] = n;\n\t}\n\tSystem.out.println(operands[0]);\n }",
"main",
"{\n\tScanner scan = new Scanner(System.in);\n\tString[] inputs = scan.nextLine().split(\" \");\n\tint[] operands = new int[100];\n\tint cursol = 0;\n\tfor (int i = 0; i < inputs.length; i++) {\n\t int n = -1;\n\t if (isOperator(inputs[i])) {\n\t\tint op1 = operands[cursol - 2];\n\t\tint op2 = operands[cursol - 1];\n\t\tif (inputs[i].equals(\"+\")) {\n\t\t n = op1 + op2;\n\t\t}\n\t\tif (inputs[i].equals(\"-\")) {\n\t\t n = op1 - op2;\n\t\t}\n\t\tif (inputs[i].equals(\"*\")) {\n\t\t n = op1 * op2;\n\t\t}\n\t\tcursol -= 2;\n\t }\n\t else {\n\t\tn = Integer.parseInt(inputs[i]);\n\t }\n\t operands[cursol++] = n;\n\t}\n\tSystem.out.println(operands[0]);\n }",
"Scanner scan = new Scanner(System.in);",
"scan",
"new Scanner(System.in)",
"String[] inputs = scan.nextLine().split(\" \");",
"inputs",
"scan.nextLine().split(\" \")",
"scan.nextLine().split",
"scan.nextLine()",
"scan.nextLine",
"scan",
"\" \"",
"int[] operands = new int[100];",
"operands",
"new int[100]",
"100",
"int cursol = 0;",
"cursol",
"0",
"for (int i = 0; i < inputs.length; i++) {\n\t int n = -1;\n\t if (isOperator(inputs[i])) {\n\t\tint op1 = operands[cursol - 2];\n\t\tint op2 = operands[cursol - 1];\n\t\tif (inputs[i].equals(\"+\")) {\n\t\t n = op1 + op2;\n\t\t}\n\t\tif (inputs[i].equals(\"-\")) {\n\t\t n = op1 - op2;\n\t\t}\n\t\tif (inputs[i].equals(\"*\")) {\n\t\t n = op1 * op2;\n\t\t}\n\t\tcursol -= 2;\n\t }\n\t else {\n\t\tn = Integer.parseInt(inputs[i]);\n\t }\n\t operands[cursol++] = n;\n\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < inputs.length",
"i",
"inputs.length",
"inputs",
"inputs.length",
"i++",
"i++",
"i",
"{\n\t int n = -1;\n\t if (isOperator(inputs[i])) {\n\t\tint op1 = operands[cursol - 2];\n\t\tint op2 = operands[cursol - 1];\n\t\tif (inputs[i].equals(\"+\")) {\n\t\t n = op1 + op2;\n\t\t}\n\t\tif (inputs[i].equals(\"-\")) {\n\t\t n = op1 - op2;\n\t\t}\n\t\tif (inputs[i].equals(\"*\")) {\n\t\t n = op1 * op2;\n\t\t}\n\t\tcursol -= 2;\n\t }\n\t else {\n\t\tn = Integer.parseInt(inputs[i]);\n\t }\n\t operands[cursol++] = n;\n\t}",
"{\n\t int n = -1;\n\t if (isOperator(inputs[i])) {\n\t\tint op1 = operands[cursol - 2];\n\t\tint op2 = operands[cursol - 1];\n\t\tif (inputs[i].equals(\"+\")) {\n\t\t n = op1 + op2;\n\t\t}\n\t\tif (inputs[i].equals(\"-\")) {\n\t\t n = op1 - op2;\n\t\t}\n\t\tif (inputs[i].equals(\"*\")) {\n\t\t n = op1 * op2;\n\t\t}\n\t\tcursol -= 2;\n\t }\n\t else {\n\t\tn = Integer.parseInt(inputs[i]);\n\t }\n\t operands[cursol++] = n;\n\t}",
"int n = -1;",
"n",
"-1",
"1",
"if (isOperator(inputs[i])) {\n\t\tint op1 = operands[cursol - 2];\n\t\tint op2 = operands[cursol - 1];\n\t\tif (inputs[i].equals(\"+\")) {\n\t\t n = op1 + op2;\n\t\t}\n\t\tif (inputs[i].equals(\"-\")) {\n\t\t n = op1 - op2;\n\t\t}\n\t\tif (inputs[i].equals(\"*\")) {\n\t\t n = op1 * op2;\n\t\t}\n\t\tcursol -= 2;\n\t }\n\t else {\n\t\tn = Integer.parseInt(inputs[i]);\n\t }",
"isOperator(inputs[i])",
"isOperator",
"inputs[i]",
"inputs",
"i",
"{\n\t\tint op1 = operands[cursol - 2];\n\t\tint op2 = operands[cursol - 1];\n\t\tif (inputs[i].equals(\"+\")) {\n\t\t n = op1 + op2;\n\t\t}\n\t\tif (inputs[i].equals(\"-\")) {\n\t\t n = op1 - op2;\n\t\t}\n\t\tif (inputs[i].equals(\"*\")) {\n\t\t n = op1 * op2;\n\t\t}\n\t\tcursol -= 2;\n\t }",
"int op1 = operands[cursol - 2];",
"op1",
"operands[cursol - 2]",
"operands",
"cursol - 2",
"cursol",
"2",
"int op2 = operands[cursol - 1];",
"op2",
"operands[cursol - 1]",
"operands",
"cursol - 1",
"cursol",
"1",
"if (inputs[i].equals(\"+\")) {\n\t\t n = op1 + op2;\n\t\t}",
"inputs[i].equals(\"+\")",
"inputs[i].equals",
"inputs[i]",
"inputs",
"i",
"\"+\"",
"{\n\t\t n = op1 + op2;\n\t\t}",
"n = op1 + op2",
"n",
"op1 + op2",
"op1",
"op2",
"if (inputs[i].equals(\"-\")) {\n\t\t n = op1 - op2;\n\t\t}",
"inputs[i].equals(\"-\")",
"inputs[i].equals",
"inputs[i]",
"inputs",
"i",
"\"-\"",
"{\n\t\t n = op1 - op2;\n\t\t}",
"n = op1 - op2",
"n",
"op1 - op2",
"op1",
"op2",
"if (inputs[i].equals(\"*\")) {\n\t\t n = op1 * op2;\n\t\t}",
"inputs[i].equals(\"*\")",
"inputs[i].equals",
"inputs[i]",
"inputs",
"i",
"\"*\"",
"{\n\t\t n = op1 * op2;\n\t\t}",
"n = op1 * op2",
"n",
"op1 * op2",
"op1",
"op2",
"cursol -= 2",
"cursol",
"2",
"{\n\t\tn = Integer.parseInt(inputs[i]);\n\t }",
"n = Integer.parseInt(inputs[i])",
"n",
"Integer.parseInt(inputs[i])",
"Integer.parseInt",
"Integer",
"inputs[i]",
"inputs",
"i",
"operands[cursol++] = n",
"operands[cursol++]",
"operands",
"cursol++",
"cursol",
"n",
"System.out.println(operands[0])",
"System.out.println",
"System.out",
"System",
"System.out",
"operands[0]",
"operands",
"0",
"String[] args",
"args",
"static boolean isOperator (String a) {\n\tif (a.equals(\"+\") || a.equals(\"-\") || a.equals(\"*\")) {\n\t return true;\n\t}\n\treturn false;\n }",
"isOperator",
"{\n\tif (a.equals(\"+\") || a.equals(\"-\") || a.equals(\"*\")) {\n\t return true;\n\t}\n\treturn false;\n }",
"if (a.equals(\"+\") || a.equals(\"-\") || a.equals(\"*\")) {\n\t return true;\n\t}",
"a.equals(\"+\") || a.equals(\"-\") || a.equals(\"*\")",
"a.equals(\"+\") || a.equals(\"-\") || a.equals(\"*\")",
"a.equals(\"+\")",
"a.equals",
"a",
"\"+\"",
"a.equals(\"-\")",
"a.equals",
"a",
"\"-\"",
"a.equals(\"*\")",
"a.equals",
"a",
"\"*\"",
"{\n\t return true;\n\t}",
"return true;",
"true",
"return false;",
"false",
"String a",
"a",
"public class Main {\n public static void main (String[] args) {\n\tScanner scan = new Scanner(System.in);\n\tString[] inputs = scan.nextLine().split(\" \");\n\tint[] operands = new int[100];\n\tint cursol = 0;\n\tfor (int i = 0; i < inputs.length; i++) {\n\t int n = -1;\n\t if (isOperator(inputs[i])) {\n\t\tint op1 = operands[cursol - 2];\n\t\tint op2 = operands[cursol - 1];\n\t\tif (inputs[i].equals(\"+\")) {\n\t\t n = op1 + op2;\n\t\t}\n\t\tif (inputs[i].equals(\"-\")) {\n\t\t n = op1 - op2;\n\t\t}\n\t\tif (inputs[i].equals(\"*\")) {\n\t\t n = op1 * op2;\n\t\t}\n\t\tcursol -= 2;\n\t }\n\t else {\n\t\tn = Integer.parseInt(inputs[i]);\n\t }\n\t operands[cursol++] = n;\n\t}\n\tSystem.out.println(operands[0]);\n }\n static boolean isOperator (String a) {\n\tif (a.equals(\"+\") || a.equals(\"-\") || a.equals(\"*\")) {\n\t return true;\n\t}\n\treturn false;\n }\n}",
"public class Main {\n public static void main (String[] args) {\n\tScanner scan = new Scanner(System.in);\n\tString[] inputs = scan.nextLine().split(\" \");\n\tint[] operands = new int[100];\n\tint cursol = 0;\n\tfor (int i = 0; i < inputs.length; i++) {\n\t int n = -1;\n\t if (isOperator(inputs[i])) {\n\t\tint op1 = operands[cursol - 2];\n\t\tint op2 = operands[cursol - 1];\n\t\tif (inputs[i].equals(\"+\")) {\n\t\t n = op1 + op2;\n\t\t}\n\t\tif (inputs[i].equals(\"-\")) {\n\t\t n = op1 - op2;\n\t\t}\n\t\tif (inputs[i].equals(\"*\")) {\n\t\t n = op1 * op2;\n\t\t}\n\t\tcursol -= 2;\n\t }\n\t else {\n\t\tn = Integer.parseInt(inputs[i]);\n\t }\n\t operands[cursol++] = n;\n\t}\n\tSystem.out.println(operands[0]);\n }\n static boolean isOperator (String a) {\n\tif (a.equals(\"+\") || a.equals(\"-\") || a.equals(\"*\")) {\n\t return true;\n\t}\n\treturn false;\n }\n}",
"Main"
] | import java.util.Scanner;
public class Main {
public static void main (String[] args) {
Scanner scan = new Scanner(System.in);
String[] inputs = scan.nextLine().split(" ");
int[] operands = new int[100];
int cursol = 0;
for (int i = 0; i < inputs.length; i++) {
int n = -1;
if (isOperator(inputs[i])) {
int op1 = operands[cursol - 2];
int op2 = operands[cursol - 1];
if (inputs[i].equals("+")) {
n = op1 + op2;
}
if (inputs[i].equals("-")) {
n = op1 - op2;
}
if (inputs[i].equals("*")) {
n = op1 * op2;
}
cursol -= 2;
}
else {
n = Integer.parseInt(inputs[i]);
}
operands[cursol++] = n;
}
System.out.println(operands[0]);
}
static boolean isOperator (String a) {
if (a.equals("+") || a.equals("-") || a.equals("*")) {
return true;
}
return false;
}
} |
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
41,
13,
17,
41,
13,
17,
12,
13,
30,
41,
13,
20,
41,
13,
17,
41,
13,
20,
41,
13,
41,
13,
38,
5,
13,
30,
4,
18,
13,
30,
41,
13,
4,
18,
4,
18,
13,
17,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
30,
35,
18,
13,
13,
34,
17,
1,
0,
13,
4,
18,
13,
0,
13,
4,
18,
13,
4,
18,
13,
2,
13,
13,
3,
34,
17,
1,
0,
13,
4,
18,
13,
0,
13,
4,
18,
13,
4,
18,
13,
2,
13,
13,
3,
34,
17,
1,
0,
13,
4,
18,
13,
0,
13,
4,
18,
13,
4,
18,
13,
2,
13,
13,
3,
34,
1,
4,
18,
13,
4,
18,
13,
18,
13,
13,
3,
4,
18,
18,
13,
13,
4,
18,
13,
23,
13,
6,
13,
41,
13,
41,
13,
12,
13,
30,
0,
13,
20,
13,
0,
13,
17,
23,
13,
12,
13,
30,
0,
18,
13,
40,
13,
13,
23,
13,
12,
13,
30,
40,
13,
29,
18,
13,
13,
12,
13,
30,
29,
2,
13,
17,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
197,
11
],
[
197,
12
],
[
12,
13
],
[
12,
14
],
[
197,
15
],
[
15,
16
],
[
15,
17
],
[
197,
18
],
[
18,
19
],
[
18,
20
],
[
20,
21
],
[
21,
22
],
[
21,
23
],
[
20,
24
],
[
24,
25
],
[
24,
26
],
[
20,
27
],
[
27,
28
],
[
27,
29
],
[
20,
30
],
[
30,
31
],
[
20,
32
],
[
32,
33
],
[
20,
34
],
[
34,
35
],
[
35,
36
],
[
35,
37
],
[
37,
38
],
[
38,
39
],
[
39,
40
],
[
34,
41
],
[
41,
42
],
[
42,
43
],
[
42,
44
],
[
44,
45
],
[
45,
46
],
[
46,
47
],
[
47,
48
],
[
44,
49
],
[
41,
50
],
[
50,
51
],
[
51,
52
],
[
52,
53
],
[
52,
54
],
[
50,
55
],
[
55,
56
],
[
55,
57
],
[
57,
58
],
[
57,
59
],
[
50,
60
],
[
60,
61
],
[
61,
62
],
[
50,
63
],
[
64,
64
],
[
64,
65
],
[
65,
66
],
[
66,
67
],
[
66,
68
],
[
65,
69
],
[
69,
70
],
[
69,
71
],
[
71,
72
],
[
72,
73
],
[
72,
74
],
[
74,
75
],
[
75,
76
],
[
71,
77
],
[
77,
78
],
[
77,
79
],
[
79,
80
],
[
80,
81
],
[
71,
82
],
[
82,
83
],
[
83,
84
],
[
82,
85
],
[
85,
86
],
[
85,
87
],
[
71,
88
],
[
65,
89
],
[
89,
90
],
[
89,
91
],
[
91,
92
],
[
92,
93
],
[
92,
94
],
[
94,
95
],
[
95,
96
],
[
91,
97
],
[
97,
98
],
[
97,
99
],
[
99,
100
],
[
100,
101
],
[
91,
102
],
[
102,
103
],
[
103,
104
],
[
102,
105
],
[
105,
106
],
[
105,
107
],
[
91,
108
],
[
65,
109
],
[
109,
110
],
[
109,
111
],
[
111,
112
],
[
112,
113
],
[
112,
114
],
[
114,
115
],
[
115,
116
],
[
111,
117
],
[
117,
118
],
[
117,
119
],
[
119,
120
],
[
120,
121
],
[
111,
122
],
[
122,
123
],
[
123,
124
],
[
122,
125
],
[
125,
126
],
[
125,
127
],
[
111,
128
],
[
65,
129
],
[
129,
130
],
[
130,
131
],
[
131,
132
],
[
132,
133
],
[
131,
134
],
[
134,
135
],
[
135,
136
],
[
134,
137
],
[
137,
138
],
[
137,
139
],
[
130,
140
],
[
41,
141
],
[
141,
142
],
[
142,
143
],
[
143,
144
],
[
143,
145
],
[
141,
146
],
[
146,
147
],
[
147,
148
],
[
18,
149
],
[
149,
150
],
[
0,
151
],
[
151,
152
],
[
151,
153
],
[
153,
154
],
[
151,
155
],
[
155,
156
],
[
151,
157
],
[
157,
158
],
[
157,
159
],
[
159,
160
],
[
160,
161
],
[
160,
162
],
[
159,
164
],
[
164,
165
],
[
164,
166
],
[
157,
167
],
[
167,
168
],
[
151,
169
],
[
169,
170
],
[
169,
171
],
[
171,
172
],
[
172,
173
],
[
173,
174
],
[
173,
175
],
[
175,
176
],
[
172,
177
],
[
169,
178
],
[
178,
179
],
[
151,
180
],
[
180,
181
],
[
180,
182
],
[
182,
183
],
[
183,
184
],
[
182,
185
],
[
185,
186
],
[
186,
187
],
[
186,
188
],
[
151,
189
],
[
189,
190
],
[
189,
191
],
[
191,
192
],
[
192,
193
],
[
193,
194
],
[
193,
195
],
[
0,
196
],
[
196,
197
],
[
196,
198
]
] | [
"import java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\n\npublic class Main {\n\tpublic static final int BIG_NUM = 2000000000;\n\tpublic static final int MOD = 1000000007;\n\n\tpublic static void main(String[] args) {\n\t\t// TODO 自動生成されたメソッド・スタブ\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tfinal int size = 105;\n\t\t\n\t\tStack stack = new Stack(size);\n\t\tint a,b;\n\t\t\n\t\ttry {\n\t\t\tString input_str[] = br.readLine().split(\"\\\\s+\");\n\t\t\tfor(int i=0; i<input_str.length; i++) {\n\t\t\t\tswitch(input_str[i]) {\n\t\t\t\tcase \"+\":\n\t\t\t\t\t\n\t\t\t\t\ta = stack.pop();\n\t\t\t\t\tb = stack.pop();\n\t\t\t\t\tstack.push(a+b);\n\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\tcase \"-\":\n\t\t\t\t\tb = stack.pop();\n\t\t\t\t\ta = stack.pop();\n\t\t\t\t\tstack.push(a-b);\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tcase \"*\":\n\t\t\t\t\ta = stack.pop();\n\t\t\t\t\tb = stack.pop();\n\t\t\t\t\tstack.push(a*b);\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tdefault:\n\t\t\t\t\tstack.push(Integer.parseInt(input_str[i]));\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(stack.pop());\n\t\t} catch (NumberFormatException | IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}\n}\n\nclass Stack {\n\tprivate int num[];\n\tprivate int top;\n\t\n\tStack(int arg_size){\n\t\tnum = new int[arg_size];\n\t\ttop = 0;\n\t}\n\t\n\tpublic void push(int x) {\n\t\tnum[top++] = x;\n\t}\n\t\n\tpublic int pop() {\n\t\ttop--;\n\t\treturn num[top];\n\t}\n\t\n\tpublic boolean isEmpty() {\n\t\treturn top == 0;\n\t}\n}\n",
"import java.io.BufferedReader;",
"BufferedReader",
"java.io",
"import java.io.IOException;",
"IOException",
"java.io",
"import java.io.InputStreamReader;",
"InputStreamReader",
"java.io",
"public class Main {\n\tpublic static final int BIG_NUM = 2000000000;\n\tpublic static final int MOD = 1000000007;\n\n\tpublic static void main(String[] args) {\n\t\t// TODO 自動生成されたメソッド・スタブ\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tfinal int size = 105;\n\t\t\n\t\tStack stack = new Stack(size);\n\t\tint a,b;\n\t\t\n\t\ttry {\n\t\t\tString input_str[] = br.readLine().split(\"\\\\s+\");\n\t\t\tfor(int i=0; i<input_str.length; i++) {\n\t\t\t\tswitch(input_str[i]) {\n\t\t\t\tcase \"+\":\n\t\t\t\t\t\n\t\t\t\t\ta = stack.pop();\n\t\t\t\t\tb = stack.pop();\n\t\t\t\t\tstack.push(a+b);\n\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\tcase \"-\":\n\t\t\t\t\tb = stack.pop();\n\t\t\t\t\ta = stack.pop();\n\t\t\t\t\tstack.push(a-b);\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tcase \"*\":\n\t\t\t\t\ta = stack.pop();\n\t\t\t\t\tb = stack.pop();\n\t\t\t\t\tstack.push(a*b);\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tdefault:\n\t\t\t\t\tstack.push(Integer.parseInt(input_str[i]));\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(stack.pop());\n\t\t} catch (NumberFormatException | IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}\n}",
"Main",
"public static final int BIG_NUM = 2000000000;",
"BIG_NUM",
"2000000000",
"public static final int MOD = 1000000007;",
"MOD",
"1000000007",
"public static void main(String[] args) {\n\t\t// TODO 自動生成されたメソッド・スタブ\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tfinal int size = 105;\n\t\t\n\t\tStack stack = new Stack(size);\n\t\tint a,b;\n\t\t\n\t\ttry {\n\t\t\tString input_str[] = br.readLine().split(\"\\\\s+\");\n\t\t\tfor(int i=0; i<input_str.length; i++) {\n\t\t\t\tswitch(input_str[i]) {\n\t\t\t\tcase \"+\":\n\t\t\t\t\t\n\t\t\t\t\ta = stack.pop();\n\t\t\t\t\tb = stack.pop();\n\t\t\t\t\tstack.push(a+b);\n\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\tcase \"-\":\n\t\t\t\t\tb = stack.pop();\n\t\t\t\t\ta = stack.pop();\n\t\t\t\t\tstack.push(a-b);\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tcase \"*\":\n\t\t\t\t\ta = stack.pop();\n\t\t\t\t\tb = stack.pop();\n\t\t\t\t\tstack.push(a*b);\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tdefault:\n\t\t\t\t\tstack.push(Integer.parseInt(input_str[i]));\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(stack.pop());\n\t\t} catch (NumberFormatException | IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}",
"main",
"{\n\t\t// TODO 自動生成されたメソッド・スタブ\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tfinal int size = 105;\n\t\t\n\t\tStack stack = new Stack(size);\n\t\tint a,b;\n\t\t\n\t\ttry {\n\t\t\tString input_str[] = br.readLine().split(\"\\\\s+\");\n\t\t\tfor(int i=0; i<input_str.length; i++) {\n\t\t\t\tswitch(input_str[i]) {\n\t\t\t\tcase \"+\":\n\t\t\t\t\t\n\t\t\t\t\ta = stack.pop();\n\t\t\t\t\tb = stack.pop();\n\t\t\t\t\tstack.push(a+b);\n\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\tcase \"-\":\n\t\t\t\t\tb = stack.pop();\n\t\t\t\t\ta = stack.pop();\n\t\t\t\t\tstack.push(a-b);\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tcase \"*\":\n\t\t\t\t\ta = stack.pop();\n\t\t\t\t\tb = stack.pop();\n\t\t\t\t\tstack.push(a*b);\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tdefault:\n\t\t\t\t\tstack.push(Integer.parseInt(input_str[i]));\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(stack.pop());\n\t\t} catch (NumberFormatException | IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}",
"BufferedReader br = new BufferedReader(new InputStreamReader(System.in));",
"br",
"new BufferedReader(new InputStreamReader(System.in))",
"final int size = 105;",
"size",
"105",
"Stack stack = new Stack(size);",
"stack",
"new Stack(size)",
"int a",
"a",
"b;",
"b",
"try {\n\t\t\tString input_str[] = br.readLine().split(\"\\\\s+\");\n\t\t\tfor(int i=0; i<input_str.length; i++) {\n\t\t\t\tswitch(input_str[i]) {\n\t\t\t\tcase \"+\":\n\t\t\t\t\t\n\t\t\t\t\ta = stack.pop();\n\t\t\t\t\tb = stack.pop();\n\t\t\t\t\tstack.push(a+b);\n\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\tcase \"-\":\n\t\t\t\t\tb = stack.pop();\n\t\t\t\t\ta = stack.pop();\n\t\t\t\t\tstack.push(a-b);\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tcase \"*\":\n\t\t\t\t\ta = stack.pop();\n\t\t\t\t\tb = stack.pop();\n\t\t\t\t\tstack.push(a*b);\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tdefault:\n\t\t\t\t\tstack.push(Integer.parseInt(input_str[i]));\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(stack.pop());\n\t\t} catch (NumberFormatException | IOException e) {\n\t\t\te.printStackTrace();\n\t\t}",
"catch (NumberFormatException | IOException e) {\n\t\t\te.printStackTrace();\n\t\t}",
"NumberFormatException | IOException e",
"{\n\t\t\te.printStackTrace();\n\t\t}",
"e.printStackTrace()",
"e.printStackTrace",
"e",
"{\n\t\t\tString input_str[] = br.readLine().split(\"\\\\s+\");\n\t\t\tfor(int i=0; i<input_str.length; i++) {\n\t\t\t\tswitch(input_str[i]) {\n\t\t\t\tcase \"+\":\n\t\t\t\t\t\n\t\t\t\t\ta = stack.pop();\n\t\t\t\t\tb = stack.pop();\n\t\t\t\t\tstack.push(a+b);\n\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\tcase \"-\":\n\t\t\t\t\tb = stack.pop();\n\t\t\t\t\ta = stack.pop();\n\t\t\t\t\tstack.push(a-b);\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tcase \"*\":\n\t\t\t\t\ta = stack.pop();\n\t\t\t\t\tb = stack.pop();\n\t\t\t\t\tstack.push(a*b);\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tdefault:\n\t\t\t\t\tstack.push(Integer.parseInt(input_str[i]));\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(stack.pop());\n\t\t}",
"String input_str[] = br.readLine().split(\"\\\\s+\");",
"input_str",
"br.readLine().split(\"\\\\s+\")",
"br.readLine().split",
"br.readLine()",
"br.readLine",
"br",
"\"\\\\s+\"",
"for(int i=0; i<input_str.length; i++) {\n\t\t\t\tswitch(input_str[i]) {\n\t\t\t\tcase \"+\":\n\t\t\t\t\t\n\t\t\t\t\ta = stack.pop();\n\t\t\t\t\tb = stack.pop();\n\t\t\t\t\tstack.push(a+b);\n\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\tcase \"-\":\n\t\t\t\t\tb = stack.pop();\n\t\t\t\t\ta = stack.pop();\n\t\t\t\t\tstack.push(a-b);\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tcase \"*\":\n\t\t\t\t\ta = stack.pop();\n\t\t\t\t\tb = stack.pop();\n\t\t\t\t\tstack.push(a*b);\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tdefault:\n\t\t\t\t\tstack.push(Integer.parseInt(input_str[i]));\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<input_str.length",
"i",
"input_str.length",
"input_str",
"input_str.length",
"i++",
"i++",
"i",
"{\n\t\t\t\tswitch(input_str[i]) {\n\t\t\t\tcase \"+\":\n\t\t\t\t\t\n\t\t\t\t\ta = stack.pop();\n\t\t\t\t\tb = stack.pop();\n\t\t\t\t\tstack.push(a+b);\n\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\tcase \"-\":\n\t\t\t\t\tb = stack.pop();\n\t\t\t\t\ta = stack.pop();\n\t\t\t\t\tstack.push(a-b);\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tcase \"*\":\n\t\t\t\t\ta = stack.pop();\n\t\t\t\t\tb = stack.pop();\n\t\t\t\t\tstack.push(a*b);\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tdefault:\n\t\t\t\t\tstack.push(Integer.parseInt(input_str[i]));\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}",
"{\n\t\t\t\tswitch(input_str[i]) {\n\t\t\t\tcase \"+\":\n\t\t\t\t\t\n\t\t\t\t\ta = stack.pop();\n\t\t\t\t\tb = stack.pop();\n\t\t\t\t\tstack.push(a+b);\n\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\tcase \"-\":\n\t\t\t\t\tb = stack.pop();\n\t\t\t\t\ta = stack.pop();\n\t\t\t\t\tstack.push(a-b);\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tcase \"*\":\n\t\t\t\t\ta = stack.pop();\n\t\t\t\t\tb = stack.pop();\n\t\t\t\t\tstack.push(a*b);\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tdefault:\n\t\t\t\t\tstack.push(Integer.parseInt(input_str[i]));\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}",
"switch(input_str[i]) {\n\t\t\t\tcase \"+\":\n\t\t\t\t\t\n\t\t\t\t\ta = stack.pop();\n\t\t\t\t\tb = stack.pop();\n\t\t\t\t\tstack.push(a+b);\n\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\tcase \"-\":\n\t\t\t\t\tb = stack.pop();\n\t\t\t\t\ta = stack.pop();\n\t\t\t\t\tstack.push(a-b);\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tcase \"*\":\n\t\t\t\t\ta = stack.pop();\n\t\t\t\t\tb = stack.pop();\n\t\t\t\t\tstack.push(a*b);\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tdefault:\n\t\t\t\t\tstack.push(Integer.parseInt(input_str[i]));\n\t\t\t\t\tbreak;\n\t\t\t\t}",
"input_str[i]",
"input_str",
"i",
"case \"+\":",
"\"+\"",
"case \"+\":",
"a = stack.pop()",
"a",
"stack.pop()",
"stack.pop",
"stack",
"b = stack.pop()",
"b",
"stack.pop()",
"stack.pop",
"stack",
"stack.push(a+b)",
"stack.push",
"stack",
"a+b",
"a",
"b",
"break;",
"case \"-\":",
"\"-\"",
"case \"-\":",
"b = stack.pop()",
"b",
"stack.pop()",
"stack.pop",
"stack",
"a = stack.pop()",
"a",
"stack.pop()",
"stack.pop",
"stack",
"stack.push(a-b)",
"stack.push",
"stack",
"a-b",
"a",
"b",
"break;",
"case \"*\":",
"\"*\"",
"case \"*\":",
"a = stack.pop()",
"a",
"stack.pop()",
"stack.pop",
"stack",
"b = stack.pop()",
"b",
"stack.pop()",
"stack.pop",
"stack",
"stack.push(a*b)",
"stack.push",
"stack",
"a*b",
"a",
"b",
"break;",
"default:",
"default:",
"stack.push(Integer.parseInt(input_str[i]))",
"stack.push",
"stack",
"Integer.parseInt(input_str[i])",
"Integer.parseInt",
"Integer",
"input_str[i]",
"input_str",
"i",
"break;",
"System.out.println(stack.pop())",
"System.out.println",
"System.out",
"System",
"System.out",
"stack.pop()",
"stack.pop",
"stack",
"String[] args",
"args",
"class Stack {\n\tprivate int num[];\n\tprivate int top;\n\t\n\tStack(int arg_size){\n\t\tnum = new int[arg_size];\n\t\ttop = 0;\n\t}\n\t\n\tpublic void push(int x) {\n\t\tnum[top++] = x;\n\t}\n\t\n\tpublic int pop() {\n\t\ttop--;\n\t\treturn num[top];\n\t}\n\t\n\tpublic boolean isEmpty() {\n\t\treturn top == 0;\n\t}\n}",
"Stack",
"private int num[];",
"num",
"private int top;",
"top",
"Stack(int arg_size){\n\t\tnum = new int[arg_size];\n\t\ttop = 0;\n\t}",
"Stack",
"{\n\t\tnum = new int[arg_size];\n\t\ttop = 0;\n\t}",
"num = new int[arg_size]",
"num",
"new int[arg_size]",
"arg_size",
"top = 0",
"top",
"0",
"int arg_size",
"arg_size",
"public void push(int x) {\n\t\tnum[top++] = x;\n\t}",
"push",
"{\n\t\tnum[top++] = x;\n\t}",
"num[top++] = x",
"num[top++]",
"num",
"top++",
"top",
"x",
"int x",
"x",
"public int pop() {\n\t\ttop--;\n\t\treturn num[top];\n\t}",
"pop",
"{\n\t\ttop--;\n\t\treturn num[top];\n\t}",
"top--",
"top",
"return num[top];",
"num[top]",
"num",
"top",
"public boolean isEmpty() {\n\t\treturn top == 0;\n\t}",
"isEmpty",
"{\n\t\treturn top == 0;\n\t}",
"return top == 0;",
"top == 0",
"top",
"0",
"public class Main {\n\tpublic static final int BIG_NUM = 2000000000;\n\tpublic static final int MOD = 1000000007;\n\n\tpublic static void main(String[] args) {\n\t\t// TODO 自動生成されたメソッド・スタブ\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tfinal int size = 105;\n\t\t\n\t\tStack stack = new Stack(size);\n\t\tint a,b;\n\t\t\n\t\ttry {\n\t\t\tString input_str[] = br.readLine().split(\"\\\\s+\");\n\t\t\tfor(int i=0; i<input_str.length; i++) {\n\t\t\t\tswitch(input_str[i]) {\n\t\t\t\tcase \"+\":\n\t\t\t\t\t\n\t\t\t\t\ta = stack.pop();\n\t\t\t\t\tb = stack.pop();\n\t\t\t\t\tstack.push(a+b);\n\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\tcase \"-\":\n\t\t\t\t\tb = stack.pop();\n\t\t\t\t\ta = stack.pop();\n\t\t\t\t\tstack.push(a-b);\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tcase \"*\":\n\t\t\t\t\ta = stack.pop();\n\t\t\t\t\tb = stack.pop();\n\t\t\t\t\tstack.push(a*b);\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tdefault:\n\t\t\t\t\tstack.push(Integer.parseInt(input_str[i]));\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(stack.pop());\n\t\t} catch (NumberFormatException | IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}\n}",
"public class Main {\n\tpublic static final int BIG_NUM = 2000000000;\n\tpublic static final int MOD = 1000000007;\n\n\tpublic static void main(String[] args) {\n\t\t// TODO 自動生成されたメソッド・スタブ\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tfinal int size = 105;\n\t\t\n\t\tStack stack = new Stack(size);\n\t\tint a,b;\n\t\t\n\t\ttry {\n\t\t\tString input_str[] = br.readLine().split(\"\\\\s+\");\n\t\t\tfor(int i=0; i<input_str.length; i++) {\n\t\t\t\tswitch(input_str[i]) {\n\t\t\t\tcase \"+\":\n\t\t\t\t\t\n\t\t\t\t\ta = stack.pop();\n\t\t\t\t\tb = stack.pop();\n\t\t\t\t\tstack.push(a+b);\n\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\tcase \"-\":\n\t\t\t\t\tb = stack.pop();\n\t\t\t\t\ta = stack.pop();\n\t\t\t\t\tstack.push(a-b);\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tcase \"*\":\n\t\t\t\t\ta = stack.pop();\n\t\t\t\t\tb = stack.pop();\n\t\t\t\t\tstack.push(a*b);\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tdefault:\n\t\t\t\t\tstack.push(Integer.parseInt(input_str[i]));\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(stack.pop());\n\t\t} catch (NumberFormatException | IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}\n}",
"Main"
] | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Main {
public static final int BIG_NUM = 2000000000;
public static final int MOD = 1000000007;
public static void main(String[] args) {
// TODO 自動生成されたメソッド・スタブ
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
final int size = 105;
Stack stack = new Stack(size);
int a,b;
try {
String input_str[] = br.readLine().split("\\s+");
for(int i=0; i<input_str.length; i++) {
switch(input_str[i]) {
case "+":
a = stack.pop();
b = stack.pop();
stack.push(a+b);
break;
case "-":
b = stack.pop();
a = stack.pop();
stack.push(a-b);
break;
case "*":
a = stack.pop();
b = stack.pop();
stack.push(a*b);
break;
default:
stack.push(Integer.parseInt(input_str[i]));
break;
}
}
System.out.println(stack.pop());
} catch (NumberFormatException | IOException e) {
e.printStackTrace();
}
}
}
class Stack {
private int num[];
private int top;
Stack(int arg_size){
num = new int[arg_size];
top = 0;
}
public void push(int x) {
num[top++] = x;
}
public int pop() {
top--;
return num[top];
}
public boolean isEmpty() {
return top == 0;
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
17,
17,
41,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
4,
18,
13,
17,
13,
40,
17,
1,
0,
13,
2,
4,
18,
13,
17,
13,
17,
30,
30,
40,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
14,
2,
4,
18,
18,
13,
13,
17,
17,
30,
35,
4,
18,
18,
13,
13,
17,
34,
17,
1,
4,
18,
13,
2,
13,
17,
2,
4,
18,
13,
2,
13,
17,
4,
18,
13,
2,
13,
17,
3,
34,
17,
1,
4,
18,
13,
2,
13,
17,
2,
4,
18,
13,
2,
13,
17,
4,
18,
13,
2,
13,
17,
3,
34,
17,
1,
4,
18,
13,
2,
13,
17,
2,
4,
18,
13,
2,
13,
17,
4,
18,
13,
2,
13,
17,
3,
30,
4,
18,
13,
4,
18,
13,
18,
13,
13,
4,
18,
18,
13,
13,
4,
18,
13,
17,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
185,
5
],
[
185,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
8,
15
],
[
15,
16
],
[
15,
17
],
[
17,
18
],
[
18,
19
],
[
8,
20
],
[
20,
21
],
[
20,
22
],
[
22,
23
],
[
23,
24
],
[
22,
25
],
[
22,
26
],
[
8,
27
],
[
27,
28
],
[
8,
29
],
[
29,
30
],
[
29,
31
],
[
8,
32
],
[
32,
33
],
[
33,
34
],
[
34,
35
],
[
34,
36
],
[
32,
37
],
[
37,
38
],
[
38,
39
],
[
39,
40
],
[
38,
41
],
[
38,
42
],
[
37,
43
],
[
43,
44
],
[
32,
45
],
[
45,
46
],
[
46,
47
],
[
46,
48
],
[
48,
49
],
[
49,
50
],
[
50,
51
],
[
49,
52
],
[
49,
53
],
[
48,
54
],
[
32,
55
],
[
56,
56
],
[
56,
57
],
[
57,
58
],
[
8,
59
],
[
59,
60
],
[
60,
61
],
[
61,
62
],
[
61,
63
],
[
59,
64
],
[
64,
65
],
[
64,
66
],
[
59,
67
],
[
67,
68
],
[
68,
69
],
[
59,
70
],
[
71,
71
],
[
71,
72
],
[
72,
73
],
[
72,
74
],
[
74,
75
],
[
75,
76
],
[
71,
77
],
[
77,
78
],
[
78,
79
],
[
79,
80
],
[
80,
81
],
[
81,
82
],
[
81,
83
],
[
79,
84
],
[
78,
85
],
[
77,
86
],
[
86,
87
],
[
87,
88
],
[
88,
89
],
[
89,
90
],
[
90,
91
],
[
90,
92
],
[
88,
93
],
[
87,
94
],
[
94,
95
],
[
94,
96
],
[
96,
97
],
[
97,
98
],
[
98,
99
],
[
97,
100
],
[
100,
101
],
[
100,
102
],
[
97,
103
],
[
103,
104
],
[
104,
105
],
[
105,
106
],
[
104,
107
],
[
107,
108
],
[
107,
109
],
[
103,
110
],
[
110,
111
],
[
111,
112
],
[
110,
113
],
[
113,
114
],
[
113,
115
],
[
96,
116
],
[
87,
117
],
[
117,
118
],
[
117,
119
],
[
119,
120
],
[
120,
121
],
[
121,
122
],
[
120,
123
],
[
123,
124
],
[
123,
125
],
[
120,
126
],
[
126,
127
],
[
127,
128
],
[
128,
129
],
[
127,
130
],
[
130,
131
],
[
130,
132
],
[
126,
133
],
[
133,
134
],
[
134,
135
],
[
133,
136
],
[
136,
137
],
[
136,
138
],
[
119,
139
],
[
87,
140
],
[
140,
141
],
[
140,
142
],
[
142,
143
],
[
143,
144
],
[
144,
145
],
[
143,
146
],
[
146,
147
],
[
146,
148
],
[
143,
149
],
[
149,
150
],
[
150,
151
],
[
151,
152
],
[
150,
153
],
[
153,
154
],
[
153,
155
],
[
149,
156
],
[
156,
157
],
[
157,
158
],
[
156,
159
],
[
159,
160
],
[
159,
161
],
[
142,
162
],
[
77,
163
],
[
163,
164
],
[
164,
165
],
[
165,
166
],
[
164,
167
],
[
167,
168
],
[
168,
169
],
[
167,
170
],
[
170,
171
],
[
170,
172
],
[
8,
173
],
[
173,
174
],
[
174,
175
],
[
175,
176
],
[
175,
177
],
[
173,
178
],
[
178,
179
],
[
179,
180
],
[
178,
181
],
[
6,
182
],
[
182,
183
],
[
0,
184
],
[
184,
185
],
[
184,
186
]
] | [
"import java.util.*;\n\npublic class Main{\n public static void main(String[] args){\n Scanner scan=new Scanner(System.in);\n \n ArrayList<Integer> operand=new ArrayList<Integer>();\n String command=scan.nextLine();\n String[] com1=command.split(\" \",0);\n int osize, comsize=1;\n \n for(int i=0; command.indexOf(\" \",i)!=-1; i=command.indexOf(\" \",i)+1){\n comsize++;\n }\n //System.out.println(comsize+\":\"+Arrays.toString(com1));\n \n for(int i=0; i<comsize; i++){\n osize=operand.size();\n //System.out.println(com1[i]);\n if(com1[i].charAt(0)<'0'){\n switch(com1[i].charAt(0)){\n case '+':\n operand.set(osize-2,operand.get(osize-2)+operand.remove(osize-1));\n break;\n case '-':\n operand.set(osize-2,operand.get(osize-2)-operand.remove(osize-1));\n break;\n case '*':\n operand.set(osize-2,operand.get(osize-2)*operand.remove(osize-1));\n break;\n }\n }else{\n operand.add(Integer.parseInt(com1[i]));\n }\n //System.out.println(operand.size()+\":\"+operand);\n }\n System.out.println(operand.get(0));\n }\n}",
"import java.util.*;",
"util.*",
"java",
"public class Main{\n public static void main(String[] args){\n Scanner scan=new Scanner(System.in);\n \n ArrayList<Integer> operand=new ArrayList<Integer>();\n String command=scan.nextLine();\n String[] com1=command.split(\" \",0);\n int osize, comsize=1;\n \n for(int i=0; command.indexOf(\" \",i)!=-1; i=command.indexOf(\" \",i)+1){\n comsize++;\n }\n //System.out.println(comsize+\":\"+Arrays.toString(com1));\n \n for(int i=0; i<comsize; i++){\n osize=operand.size();\n //System.out.println(com1[i]);\n if(com1[i].charAt(0)<'0'){\n switch(com1[i].charAt(0)){\n case '+':\n operand.set(osize-2,operand.get(osize-2)+operand.remove(osize-1));\n break;\n case '-':\n operand.set(osize-2,operand.get(osize-2)-operand.remove(osize-1));\n break;\n case '*':\n operand.set(osize-2,operand.get(osize-2)*operand.remove(osize-1));\n break;\n }\n }else{\n operand.add(Integer.parseInt(com1[i]));\n }\n //System.out.println(operand.size()+\":\"+operand);\n }\n System.out.println(operand.get(0));\n }\n}",
"Main",
"public static void main(String[] args){\n Scanner scan=new Scanner(System.in);\n \n ArrayList<Integer> operand=new ArrayList<Integer>();\n String command=scan.nextLine();\n String[] com1=command.split(\" \",0);\n int osize, comsize=1;\n \n for(int i=0; command.indexOf(\" \",i)!=-1; i=command.indexOf(\" \",i)+1){\n comsize++;\n }\n //System.out.println(comsize+\":\"+Arrays.toString(com1));\n \n for(int i=0; i<comsize; i++){\n osize=operand.size();\n //System.out.println(com1[i]);\n if(com1[i].charAt(0)<'0'){\n switch(com1[i].charAt(0)){\n case '+':\n operand.set(osize-2,operand.get(osize-2)+operand.remove(osize-1));\n break;\n case '-':\n operand.set(osize-2,operand.get(osize-2)-operand.remove(osize-1));\n break;\n case '*':\n operand.set(osize-2,operand.get(osize-2)*operand.remove(osize-1));\n break;\n }\n }else{\n operand.add(Integer.parseInt(com1[i]));\n }\n //System.out.println(operand.size()+\":\"+operand);\n }\n System.out.println(operand.get(0));\n }",
"main",
"{\n Scanner scan=new Scanner(System.in);\n \n ArrayList<Integer> operand=new ArrayList<Integer>();\n String command=scan.nextLine();\n String[] com1=command.split(\" \",0);\n int osize, comsize=1;\n \n for(int i=0; command.indexOf(\" \",i)!=-1; i=command.indexOf(\" \",i)+1){\n comsize++;\n }\n //System.out.println(comsize+\":\"+Arrays.toString(com1));\n \n for(int i=0; i<comsize; i++){\n osize=operand.size();\n //System.out.println(com1[i]);\n if(com1[i].charAt(0)<'0'){\n switch(com1[i].charAt(0)){\n case '+':\n operand.set(osize-2,operand.get(osize-2)+operand.remove(osize-1));\n break;\n case '-':\n operand.set(osize-2,operand.get(osize-2)-operand.remove(osize-1));\n break;\n case '*':\n operand.set(osize-2,operand.get(osize-2)*operand.remove(osize-1));\n break;\n }\n }else{\n operand.add(Integer.parseInt(com1[i]));\n }\n //System.out.println(operand.size()+\":\"+operand);\n }\n System.out.println(operand.get(0));\n }",
"Scanner scan=new Scanner(System.in);",
"scan",
"new Scanner(System.in)",
"ArrayList<Integer> operand=new ArrayList<Integer>();",
"operand",
"new ArrayList<Integer>()",
"String command=scan.nextLine();",
"command",
"scan.nextLine()",
"scan.nextLine",
"scan",
"String[] com1=command.split(\" \",0);",
"com1",
"command.split(\" \",0)",
"command.split",
"command",
"\" \"",
"0",
"int osize",
"osize",
"comsize=1;",
"comsize",
"1",
"for(int i=0; command.indexOf(\" \",i)!=-1; i=command.indexOf(\" \",i)+1){\n comsize++;\n }",
"int i=0;",
"int i=0;",
"i",
"0",
"command.indexOf(\" \",i)!=-1",
"command.indexOf(\" \",i)",
"command.indexOf",
"command",
"\" \"",
"i",
"-1",
"1",
"i=command.indexOf(\" \",i)+1",
"i=command.indexOf(\" \",i)+1",
"i",
"command.indexOf(\" \",i)+1",
"command.indexOf(\" \",i)",
"command.indexOf",
"command",
"\" \"",
"i",
"1",
"{\n comsize++;\n }",
"{\n comsize++;\n }",
"comsize++",
"comsize",
"for(int i=0; i<comsize; i++){\n osize=operand.size();\n //System.out.println(com1[i]);\n if(com1[i].charAt(0)<'0'){\n switch(com1[i].charAt(0)){\n case '+':\n operand.set(osize-2,operand.get(osize-2)+operand.remove(osize-1));\n break;\n case '-':\n operand.set(osize-2,operand.get(osize-2)-operand.remove(osize-1));\n break;\n case '*':\n operand.set(osize-2,operand.get(osize-2)*operand.remove(osize-1));\n break;\n }\n }else{\n operand.add(Integer.parseInt(com1[i]));\n }\n //System.out.println(operand.size()+\":\"+operand);\n }",
"int i=0;",
"int i=0;",
"i",
"0",
"i<comsize",
"i",
"comsize",
"i++",
"i++",
"i",
"{\n osize=operand.size();\n //System.out.println(com1[i]);\n if(com1[i].charAt(0)<'0'){\n switch(com1[i].charAt(0)){\n case '+':\n operand.set(osize-2,operand.get(osize-2)+operand.remove(osize-1));\n break;\n case '-':\n operand.set(osize-2,operand.get(osize-2)-operand.remove(osize-1));\n break;\n case '*':\n operand.set(osize-2,operand.get(osize-2)*operand.remove(osize-1));\n break;\n }\n }else{\n operand.add(Integer.parseInt(com1[i]));\n }\n //System.out.println(operand.size()+\":\"+operand);\n }",
"{\n osize=operand.size();\n //System.out.println(com1[i]);\n if(com1[i].charAt(0)<'0'){\n switch(com1[i].charAt(0)){\n case '+':\n operand.set(osize-2,operand.get(osize-2)+operand.remove(osize-1));\n break;\n case '-':\n operand.set(osize-2,operand.get(osize-2)-operand.remove(osize-1));\n break;\n case '*':\n operand.set(osize-2,operand.get(osize-2)*operand.remove(osize-1));\n break;\n }\n }else{\n operand.add(Integer.parseInt(com1[i]));\n }\n //System.out.println(operand.size()+\":\"+operand);\n }",
"osize=operand.size()",
"osize",
"operand.size()",
"operand.size",
"operand",
"if(com1[i].charAt(0)<'0'){\n switch(com1[i].charAt(0)){\n case '+':\n operand.set(osize-2,operand.get(osize-2)+operand.remove(osize-1));\n break;\n case '-':\n operand.set(osize-2,operand.get(osize-2)-operand.remove(osize-1));\n break;\n case '*':\n operand.set(osize-2,operand.get(osize-2)*operand.remove(osize-1));\n break;\n }\n }else{\n operand.add(Integer.parseInt(com1[i]));\n }",
"com1[i].charAt(0)<'0'",
"com1[i].charAt(0)",
"com1[i].charAt",
"com1[i]",
"com1",
"i",
"0",
"'0'",
"{\n switch(com1[i].charAt(0)){\n case '+':\n operand.set(osize-2,operand.get(osize-2)+operand.remove(osize-1));\n break;\n case '-':\n operand.set(osize-2,operand.get(osize-2)-operand.remove(osize-1));\n break;\n case '*':\n operand.set(osize-2,operand.get(osize-2)*operand.remove(osize-1));\n break;\n }\n }",
"switch(com1[i].charAt(0)){\n case '+':\n operand.set(osize-2,operand.get(osize-2)+operand.remove(osize-1));\n break;\n case '-':\n operand.set(osize-2,operand.get(osize-2)-operand.remove(osize-1));\n break;\n case '*':\n operand.set(osize-2,operand.get(osize-2)*operand.remove(osize-1));\n break;\n }",
"com1[i].charAt(0)",
"com1[i].charAt",
"com1[i]",
"com1",
"i",
"0",
"case '+':",
"'+'",
"case '+':",
"operand.set(osize-2,operand.get(osize-2)+operand.remove(osize-1))",
"operand.set",
"operand",
"osize-2",
"osize",
"2",
"operand.get(osize-2)+operand.remove(osize-1)",
"operand.get(osize-2)",
"operand.get",
"operand",
"osize-2",
"osize",
"2",
"operand.remove(osize-1)",
"operand.remove",
"operand",
"osize-1",
"osize",
"1",
"break;",
"case '-':",
"'-'",
"case '-':",
"operand.set(osize-2,operand.get(osize-2)-operand.remove(osize-1))",
"operand.set",
"operand",
"osize-2",
"osize",
"2",
"operand.get(osize-2)-operand.remove(osize-1)",
"operand.get(osize-2)",
"operand.get",
"operand",
"osize-2",
"osize",
"2",
"operand.remove(osize-1)",
"operand.remove",
"operand",
"osize-1",
"osize",
"1",
"break;",
"case '*':",
"'*'",
"case '*':",
"operand.set(osize-2,operand.get(osize-2)*operand.remove(osize-1))",
"operand.set",
"operand",
"osize-2",
"osize",
"2",
"operand.get(osize-2)*operand.remove(osize-1)",
"operand.get(osize-2)",
"operand.get",
"operand",
"osize-2",
"osize",
"2",
"operand.remove(osize-1)",
"operand.remove",
"operand",
"osize-1",
"osize",
"1",
"break;",
"{\n operand.add(Integer.parseInt(com1[i]));\n }",
"operand.add(Integer.parseInt(com1[i]))",
"operand.add",
"operand",
"Integer.parseInt(com1[i])",
"Integer.parseInt",
"Integer",
"com1[i]",
"com1",
"i",
"System.out.println(operand.get(0))",
"System.out.println",
"System.out",
"System",
"System.out",
"operand.get(0)",
"operand.get",
"operand",
"0",
"String[] args",
"args",
"public class Main{\n public static void main(String[] args){\n Scanner scan=new Scanner(System.in);\n \n ArrayList<Integer> operand=new ArrayList<Integer>();\n String command=scan.nextLine();\n String[] com1=command.split(\" \",0);\n int osize, comsize=1;\n \n for(int i=0; command.indexOf(\" \",i)!=-1; i=command.indexOf(\" \",i)+1){\n comsize++;\n }\n //System.out.println(comsize+\":\"+Arrays.toString(com1));\n \n for(int i=0; i<comsize; i++){\n osize=operand.size();\n //System.out.println(com1[i]);\n if(com1[i].charAt(0)<'0'){\n switch(com1[i].charAt(0)){\n case '+':\n operand.set(osize-2,operand.get(osize-2)+operand.remove(osize-1));\n break;\n case '-':\n operand.set(osize-2,operand.get(osize-2)-operand.remove(osize-1));\n break;\n case '*':\n operand.set(osize-2,operand.get(osize-2)*operand.remove(osize-1));\n break;\n }\n }else{\n operand.add(Integer.parseInt(com1[i]));\n }\n //System.out.println(operand.size()+\":\"+operand);\n }\n System.out.println(operand.get(0));\n }\n}",
"public class Main{\n public static void main(String[] args){\n Scanner scan=new Scanner(System.in);\n \n ArrayList<Integer> operand=new ArrayList<Integer>();\n String command=scan.nextLine();\n String[] com1=command.split(\" \",0);\n int osize, comsize=1;\n \n for(int i=0; command.indexOf(\" \",i)!=-1; i=command.indexOf(\" \",i)+1){\n comsize++;\n }\n //System.out.println(comsize+\":\"+Arrays.toString(com1));\n \n for(int i=0; i<comsize; i++){\n osize=operand.size();\n //System.out.println(com1[i]);\n if(com1[i].charAt(0)<'0'){\n switch(com1[i].charAt(0)){\n case '+':\n operand.set(osize-2,operand.get(osize-2)+operand.remove(osize-1));\n break;\n case '-':\n operand.set(osize-2,operand.get(osize-2)-operand.remove(osize-1));\n break;\n case '*':\n operand.set(osize-2,operand.get(osize-2)*operand.remove(osize-1));\n break;\n }\n }else{\n operand.add(Integer.parseInt(com1[i]));\n }\n //System.out.println(operand.size()+\":\"+operand);\n }\n System.out.println(operand.get(0));\n }\n}",
"Main"
] | import java.util.*;
public class Main{
public static void main(String[] args){
Scanner scan=new Scanner(System.in);
ArrayList<Integer> operand=new ArrayList<Integer>();
String command=scan.nextLine();
String[] com1=command.split(" ",0);
int osize, comsize=1;
for(int i=0; command.indexOf(" ",i)!=-1; i=command.indexOf(" ",i)+1){
comsize++;
}
//System.out.println(comsize+":"+Arrays.toString(com1));
for(int i=0; i<comsize; i++){
osize=operand.size();
//System.out.println(com1[i]);
if(com1[i].charAt(0)<'0'){
switch(com1[i].charAt(0)){
case '+':
operand.set(osize-2,operand.get(osize-2)+operand.remove(osize-1));
break;
case '-':
operand.set(osize-2,operand.get(osize-2)-operand.remove(osize-1));
break;
case '*':
operand.set(osize-2,operand.get(osize-2)*operand.remove(osize-1));
break;
}
}else{
operand.add(Integer.parseInt(com1[i]));
}
//System.out.println(operand.size()+":"+operand);
}
System.out.println(operand.get(0));
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
41,
13,
41,
13,
41,
13,
20,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
17,
28,
13,
13,
30,
30,
35,
13,
34,
17,
1,
0,
13,
4,
18,
13,
0,
13,
4,
18,
13,
4,
18,
13,
2,
13,
13,
3,
34,
17,
1,
0,
13,
4,
18,
13,
0,
13,
4,
18,
13,
4,
18,
13,
2,
13,
13,
3,
34,
17,
1,
0,
13,
4,
18,
13,
0,
13,
4,
18,
13,
4,
18,
13,
2,
13,
13,
3,
34,
17,
1,
0,
13,
4,
18,
13,
0,
13,
4,
18,
13,
4,
18,
13,
2,
13,
13,
3,
34,
1,
4,
18,
13,
4,
18,
13,
13,
3,
0,
13,
4,
18,
13,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
143,
5
],
[
143,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
8,
11
],
[
11,
12
],
[
8,
13
],
[
13,
14
],
[
8,
15
],
[
15,
16
],
[
15,
17
],
[
8,
18
],
[
18,
19
],
[
18,
20
],
[
8,
21
],
[
21,
22
],
[
21,
23
],
[
23,
24
],
[
24,
25
],
[
8,
26
],
[
26,
27
],
[
26,
28
],
[
28,
29
],
[
29,
30
],
[
28,
31
],
[
8,
32
],
[
32,
33
],
[
32,
34
],
[
32,
35
],
[
36,
36
],
[
36,
37
],
[
37,
38
],
[
37,
39
],
[
39,
40
],
[
39,
41
],
[
41,
42
],
[
42,
43
],
[
42,
44
],
[
44,
45
],
[
45,
46
],
[
41,
47
],
[
47,
48
],
[
47,
49
],
[
49,
50
],
[
50,
51
],
[
41,
52
],
[
52,
53
],
[
53,
54
],
[
52,
55
],
[
55,
56
],
[
55,
57
],
[
41,
58
],
[
37,
59
],
[
59,
60
],
[
59,
61
],
[
61,
62
],
[
62,
63
],
[
62,
64
],
[
64,
65
],
[
65,
66
],
[
61,
67
],
[
67,
68
],
[
67,
69
],
[
69,
70
],
[
70,
71
],
[
61,
72
],
[
72,
73
],
[
73,
74
],
[
72,
75
],
[
75,
76
],
[
75,
77
],
[
61,
78
],
[
37,
79
],
[
79,
80
],
[
79,
81
],
[
81,
82
],
[
82,
83
],
[
82,
84
],
[
84,
85
],
[
85,
86
],
[
81,
87
],
[
87,
88
],
[
87,
89
],
[
89,
90
],
[
90,
91
],
[
81,
92
],
[
92,
93
],
[
93,
94
],
[
92,
95
],
[
95,
96
],
[
95,
97
],
[
81,
98
],
[
37,
99
],
[
99,
100
],
[
99,
101
],
[
101,
102
],
[
102,
103
],
[
102,
104
],
[
104,
105
],
[
105,
106
],
[
101,
107
],
[
107,
108
],
[
107,
109
],
[
109,
110
],
[
110,
111
],
[
101,
112
],
[
112,
113
],
[
113,
114
],
[
112,
115
],
[
115,
116
],
[
115,
117
],
[
101,
118
],
[
37,
119
],
[
119,
120
],
[
120,
121
],
[
121,
122
],
[
122,
123
],
[
121,
124
],
[
124,
125
],
[
125,
126
],
[
124,
127
],
[
120,
128
],
[
8,
129
],
[
129,
130
],
[
129,
131
],
[
131,
132
],
[
132,
133
],
[
8,
134
],
[
134,
135
],
[
135,
136
],
[
136,
137
],
[
136,
138
],
[
134,
139
],
[
6,
140
],
[
140,
141
],
[
0,
142
],
[
142,
143
],
[
142,
144
]
] | [
"import java.util.*;\n\npublic class Main{\n\t\n\tpublic static void main(String[] args) {\n\t\tint val;\n\t\tint val2;\n\t\tint result;\n\t\tScanner in = new Scanner(System.in);\n\t\tStack<Integer> stack = new Stack<>();\n\t\tString expression = in.nextLine();\n\t\tString[] arr = expression.split(\" \");\n\n\t\tfor(String str : arr) {\n\t\t\t\n\t\t\t\n\t\t\tswitch(str) {\n\t\t\tcase \"+\" :\n\t\t\t\tval = stack.pop();\n\t\t\t\tval2 = stack.pop();\n\t\t\t\tstack.push(val + val2);\n\t\t\t\tbreak;\n\t\t\tcase \"-\":\n\t\t\t\tval = stack.pop();\n\t\t\t\tval2 = stack.pop();\n\t\t\t\tstack.push(val2 - val);\n\t\t\t\tbreak;\n\t\t\tcase \"*\":\n\t\t\t\tval = stack.pop();\n\t\t\t\tval2 = stack.pop();\n\t\t\t\tstack.push(val * val2);\t\n\t\t\t\tbreak;\n\t\t\tcase \"/\":\n\t\t\t\tval = stack.pop();\n\t\t\t\tval2 = stack.pop();\n\t\t\t\tstack.push(val2 / val);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tstack.push(Integer.parseInt(str));\n\t\t\t\tbreak;\n\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t}\n\t\t\n\t\tresult = stack.pop();\n\t\tSystem.out.println(result);\n\t\t\t\n\t}\n\t\t\n}",
"import java.util.*;",
"util.*",
"java",
"public class Main{\n\t\n\tpublic static void main(String[] args) {\n\t\tint val;\n\t\tint val2;\n\t\tint result;\n\t\tScanner in = new Scanner(System.in);\n\t\tStack<Integer> stack = new Stack<>();\n\t\tString expression = in.nextLine();\n\t\tString[] arr = expression.split(\" \");\n\n\t\tfor(String str : arr) {\n\t\t\t\n\t\t\t\n\t\t\tswitch(str) {\n\t\t\tcase \"+\" :\n\t\t\t\tval = stack.pop();\n\t\t\t\tval2 = stack.pop();\n\t\t\t\tstack.push(val + val2);\n\t\t\t\tbreak;\n\t\t\tcase \"-\":\n\t\t\t\tval = stack.pop();\n\t\t\t\tval2 = stack.pop();\n\t\t\t\tstack.push(val2 - val);\n\t\t\t\tbreak;\n\t\t\tcase \"*\":\n\t\t\t\tval = stack.pop();\n\t\t\t\tval2 = stack.pop();\n\t\t\t\tstack.push(val * val2);\t\n\t\t\t\tbreak;\n\t\t\tcase \"/\":\n\t\t\t\tval = stack.pop();\n\t\t\t\tval2 = stack.pop();\n\t\t\t\tstack.push(val2 / val);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tstack.push(Integer.parseInt(str));\n\t\t\t\tbreak;\n\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t}\n\t\t\n\t\tresult = stack.pop();\n\t\tSystem.out.println(result);\n\t\t\t\n\t}\n\t\t\n}",
"Main",
"public static void main(String[] args) {\n\t\tint val;\n\t\tint val2;\n\t\tint result;\n\t\tScanner in = new Scanner(System.in);\n\t\tStack<Integer> stack = new Stack<>();\n\t\tString expression = in.nextLine();\n\t\tString[] arr = expression.split(\" \");\n\n\t\tfor(String str : arr) {\n\t\t\t\n\t\t\t\n\t\t\tswitch(str) {\n\t\t\tcase \"+\" :\n\t\t\t\tval = stack.pop();\n\t\t\t\tval2 = stack.pop();\n\t\t\t\tstack.push(val + val2);\n\t\t\t\tbreak;\n\t\t\tcase \"-\":\n\t\t\t\tval = stack.pop();\n\t\t\t\tval2 = stack.pop();\n\t\t\t\tstack.push(val2 - val);\n\t\t\t\tbreak;\n\t\t\tcase \"*\":\n\t\t\t\tval = stack.pop();\n\t\t\t\tval2 = stack.pop();\n\t\t\t\tstack.push(val * val2);\t\n\t\t\t\tbreak;\n\t\t\tcase \"/\":\n\t\t\t\tval = stack.pop();\n\t\t\t\tval2 = stack.pop();\n\t\t\t\tstack.push(val2 / val);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tstack.push(Integer.parseInt(str));\n\t\t\t\tbreak;\n\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t}\n\t\t\n\t\tresult = stack.pop();\n\t\tSystem.out.println(result);\n\t\t\t\n\t}",
"main",
"{\n\t\tint val;\n\t\tint val2;\n\t\tint result;\n\t\tScanner in = new Scanner(System.in);\n\t\tStack<Integer> stack = new Stack<>();\n\t\tString expression = in.nextLine();\n\t\tString[] arr = expression.split(\" \");\n\n\t\tfor(String str : arr) {\n\t\t\t\n\t\t\t\n\t\t\tswitch(str) {\n\t\t\tcase \"+\" :\n\t\t\t\tval = stack.pop();\n\t\t\t\tval2 = stack.pop();\n\t\t\t\tstack.push(val + val2);\n\t\t\t\tbreak;\n\t\t\tcase \"-\":\n\t\t\t\tval = stack.pop();\n\t\t\t\tval2 = stack.pop();\n\t\t\t\tstack.push(val2 - val);\n\t\t\t\tbreak;\n\t\t\tcase \"*\":\n\t\t\t\tval = stack.pop();\n\t\t\t\tval2 = stack.pop();\n\t\t\t\tstack.push(val * val2);\t\n\t\t\t\tbreak;\n\t\t\tcase \"/\":\n\t\t\t\tval = stack.pop();\n\t\t\t\tval2 = stack.pop();\n\t\t\t\tstack.push(val2 / val);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tstack.push(Integer.parseInt(str));\n\t\t\t\tbreak;\n\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t}\n\t\t\n\t\tresult = stack.pop();\n\t\tSystem.out.println(result);\n\t\t\t\n\t}",
"int val;",
"val",
"int val2;",
"val2",
"int result;",
"result",
"Scanner in = new Scanner(System.in);",
"in",
"new Scanner(System.in)",
"Stack<Integer> stack = new Stack<>();",
"stack",
"new Stack<>()",
"String expression = in.nextLine();",
"expression",
"in.nextLine()",
"in.nextLine",
"in",
"String[] arr = expression.split(\" \");",
"arr",
"expression.split(\" \")",
"expression.split",
"expression",
"\" \"",
"for(String str : arr) {\n\t\t\t\n\t\t\t\n\t\t\tswitch(str) {\n\t\t\tcase \"+\" :\n\t\t\t\tval = stack.pop();\n\t\t\t\tval2 = stack.pop();\n\t\t\t\tstack.push(val + val2);\n\t\t\t\tbreak;\n\t\t\tcase \"-\":\n\t\t\t\tval = stack.pop();\n\t\t\t\tval2 = stack.pop();\n\t\t\t\tstack.push(val2 - val);\n\t\t\t\tbreak;\n\t\t\tcase \"*\":\n\t\t\t\tval = stack.pop();\n\t\t\t\tval2 = stack.pop();\n\t\t\t\tstack.push(val * val2);\t\n\t\t\t\tbreak;\n\t\t\tcase \"/\":\n\t\t\t\tval = stack.pop();\n\t\t\t\tval2 = stack.pop();\n\t\t\t\tstack.push(val2 / val);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tstack.push(Integer.parseInt(str));\n\t\t\t\tbreak;\n\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t}",
"String str",
"arr",
"{\n\t\t\t\n\t\t\t\n\t\t\tswitch(str) {\n\t\t\tcase \"+\" :\n\t\t\t\tval = stack.pop();\n\t\t\t\tval2 = stack.pop();\n\t\t\t\tstack.push(val + val2);\n\t\t\t\tbreak;\n\t\t\tcase \"-\":\n\t\t\t\tval = stack.pop();\n\t\t\t\tval2 = stack.pop();\n\t\t\t\tstack.push(val2 - val);\n\t\t\t\tbreak;\n\t\t\tcase \"*\":\n\t\t\t\tval = stack.pop();\n\t\t\t\tval2 = stack.pop();\n\t\t\t\tstack.push(val * val2);\t\n\t\t\t\tbreak;\n\t\t\tcase \"/\":\n\t\t\t\tval = stack.pop();\n\t\t\t\tval2 = stack.pop();\n\t\t\t\tstack.push(val2 / val);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tstack.push(Integer.parseInt(str));\n\t\t\t\tbreak;\n\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t}",
"{\n\t\t\t\n\t\t\t\n\t\t\tswitch(str) {\n\t\t\tcase \"+\" :\n\t\t\t\tval = stack.pop();\n\t\t\t\tval2 = stack.pop();\n\t\t\t\tstack.push(val + val2);\n\t\t\t\tbreak;\n\t\t\tcase \"-\":\n\t\t\t\tval = stack.pop();\n\t\t\t\tval2 = stack.pop();\n\t\t\t\tstack.push(val2 - val);\n\t\t\t\tbreak;\n\t\t\tcase \"*\":\n\t\t\t\tval = stack.pop();\n\t\t\t\tval2 = stack.pop();\n\t\t\t\tstack.push(val * val2);\t\n\t\t\t\tbreak;\n\t\t\tcase \"/\":\n\t\t\t\tval = stack.pop();\n\t\t\t\tval2 = stack.pop();\n\t\t\t\tstack.push(val2 / val);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tstack.push(Integer.parseInt(str));\n\t\t\t\tbreak;\n\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t}",
"switch(str) {\n\t\t\tcase \"+\" :\n\t\t\t\tval = stack.pop();\n\t\t\t\tval2 = stack.pop();\n\t\t\t\tstack.push(val + val2);\n\t\t\t\tbreak;\n\t\t\tcase \"-\":\n\t\t\t\tval = stack.pop();\n\t\t\t\tval2 = stack.pop();\n\t\t\t\tstack.push(val2 - val);\n\t\t\t\tbreak;\n\t\t\tcase \"*\":\n\t\t\t\tval = stack.pop();\n\t\t\t\tval2 = stack.pop();\n\t\t\t\tstack.push(val * val2);\t\n\t\t\t\tbreak;\n\t\t\tcase \"/\":\n\t\t\t\tval = stack.pop();\n\t\t\t\tval2 = stack.pop();\n\t\t\t\tstack.push(val2 / val);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tstack.push(Integer.parseInt(str));\n\t\t\t\tbreak;\n\t\t\t\n\t\t\t}",
"str",
"case \"+\" :",
"\"+\"",
"case \"+\" :",
"val = stack.pop()",
"val",
"stack.pop()",
"stack.pop",
"stack",
"val2 = stack.pop()",
"val2",
"stack.pop()",
"stack.pop",
"stack",
"stack.push(val + val2)",
"stack.push",
"stack",
"val + val2",
"val",
"val2",
"break;",
"case \"-\":",
"\"-\"",
"case \"-\":",
"val = stack.pop()",
"val",
"stack.pop()",
"stack.pop",
"stack",
"val2 = stack.pop()",
"val2",
"stack.pop()",
"stack.pop",
"stack",
"stack.push(val2 - val)",
"stack.push",
"stack",
"val2 - val",
"val2",
"val",
"break;",
"case \"*\":",
"\"*\"",
"case \"*\":",
"val = stack.pop()",
"val",
"stack.pop()",
"stack.pop",
"stack",
"val2 = stack.pop()",
"val2",
"stack.pop()",
"stack.pop",
"stack",
"stack.push(val * val2)",
"stack.push",
"stack",
"val * val2",
"val",
"val2",
"break;",
"case \"/\":",
"\"/\"",
"case \"/\":",
"val = stack.pop()",
"val",
"stack.pop()",
"stack.pop",
"stack",
"val2 = stack.pop()",
"val2",
"stack.pop()",
"stack.pop",
"stack",
"stack.push(val2 / val)",
"stack.push",
"stack",
"val2 / val",
"val2",
"val",
"break;",
"default:",
"default:",
"stack.push(Integer.parseInt(str))",
"stack.push",
"stack",
"Integer.parseInt(str)",
"Integer.parseInt",
"Integer",
"str",
"break;",
"result = stack.pop()",
"result",
"stack.pop()",
"stack.pop",
"stack",
"System.out.println(result)",
"System.out.println",
"System.out",
"System",
"System.out",
"result",
"String[] args",
"args",
"public class Main{\n\t\n\tpublic static void main(String[] args) {\n\t\tint val;\n\t\tint val2;\n\t\tint result;\n\t\tScanner in = new Scanner(System.in);\n\t\tStack<Integer> stack = new Stack<>();\n\t\tString expression = in.nextLine();\n\t\tString[] arr = expression.split(\" \");\n\n\t\tfor(String str : arr) {\n\t\t\t\n\t\t\t\n\t\t\tswitch(str) {\n\t\t\tcase \"+\" :\n\t\t\t\tval = stack.pop();\n\t\t\t\tval2 = stack.pop();\n\t\t\t\tstack.push(val + val2);\n\t\t\t\tbreak;\n\t\t\tcase \"-\":\n\t\t\t\tval = stack.pop();\n\t\t\t\tval2 = stack.pop();\n\t\t\t\tstack.push(val2 - val);\n\t\t\t\tbreak;\n\t\t\tcase \"*\":\n\t\t\t\tval = stack.pop();\n\t\t\t\tval2 = stack.pop();\n\t\t\t\tstack.push(val * val2);\t\n\t\t\t\tbreak;\n\t\t\tcase \"/\":\n\t\t\t\tval = stack.pop();\n\t\t\t\tval2 = stack.pop();\n\t\t\t\tstack.push(val2 / val);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tstack.push(Integer.parseInt(str));\n\t\t\t\tbreak;\n\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t}\n\t\t\n\t\tresult = stack.pop();\n\t\tSystem.out.println(result);\n\t\t\t\n\t}\n\t\t\n}",
"public class Main{\n\t\n\tpublic static void main(String[] args) {\n\t\tint val;\n\t\tint val2;\n\t\tint result;\n\t\tScanner in = new Scanner(System.in);\n\t\tStack<Integer> stack = new Stack<>();\n\t\tString expression = in.nextLine();\n\t\tString[] arr = expression.split(\" \");\n\n\t\tfor(String str : arr) {\n\t\t\t\n\t\t\t\n\t\t\tswitch(str) {\n\t\t\tcase \"+\" :\n\t\t\t\tval = stack.pop();\n\t\t\t\tval2 = stack.pop();\n\t\t\t\tstack.push(val + val2);\n\t\t\t\tbreak;\n\t\t\tcase \"-\":\n\t\t\t\tval = stack.pop();\n\t\t\t\tval2 = stack.pop();\n\t\t\t\tstack.push(val2 - val);\n\t\t\t\tbreak;\n\t\t\tcase \"*\":\n\t\t\t\tval = stack.pop();\n\t\t\t\tval2 = stack.pop();\n\t\t\t\tstack.push(val * val2);\t\n\t\t\t\tbreak;\n\t\t\tcase \"/\":\n\t\t\t\tval = stack.pop();\n\t\t\t\tval2 = stack.pop();\n\t\t\t\tstack.push(val2 / val);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tstack.push(Integer.parseInt(str));\n\t\t\t\tbreak;\n\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t}\n\t\t\n\t\tresult = stack.pop();\n\t\tSystem.out.println(result);\n\t\t\t\n\t}\n\t\t\n}",
"Main"
] | import java.util.*;
public class Main{
public static void main(String[] args) {
int val;
int val2;
int result;
Scanner in = new Scanner(System.in);
Stack<Integer> stack = new Stack<>();
String expression = in.nextLine();
String[] arr = expression.split(" ");
for(String str : arr) {
switch(str) {
case "+" :
val = stack.pop();
val2 = stack.pop();
stack.push(val + val2);
break;
case "-":
val = stack.pop();
val2 = stack.pop();
stack.push(val2 - val);
break;
case "*":
val = stack.pop();
val2 = stack.pop();
stack.push(val * val2);
break;
case "/":
val = stack.pop();
val2 = stack.pop();
stack.push(val2 / val);
break;
default:
stack.push(Integer.parseInt(str));
break;
}
}
result = stack.pop();
System.out.println(result);
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
0,
13,
4,
18,
13,
41,
13,
4,
18,
13,
17,
41,
13,
20,
28,
13,
13,
30,
30,
14,
4,
18,
13,
17,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
2,
13,
13,
4,
18,
13,
13,
14,
4,
18,
13,
17,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
2,
13,
13,
4,
18,
13,
13,
14,
4,
18,
13,
17,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
2,
13,
13,
4,
18,
13,
13,
30,
41,
13,
4,
18,
13,
13,
4,
18,
13,
13,
41,
13,
4,
18,
13,
4,
18,
18,
13,
13,
13,
12,
13,
30,
4,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
144,
11
],
[
144,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
15,
17
],
[
14,
18
],
[
18,
19
],
[
14,
20
],
[
20,
21
],
[
20,
22
],
[
22,
23
],
[
23,
24
],
[
14,
25
],
[
25,
26
],
[
25,
27
],
[
27,
28
],
[
28,
29
],
[
27,
30
],
[
14,
31
],
[
31,
32
],
[
31,
33
],
[
14,
34
],
[
34,
35
],
[
34,
36
],
[
34,
37
],
[
38,
38
],
[
38,
39
],
[
39,
40
],
[
40,
41
],
[
41,
42
],
[
40,
43
],
[
39,
44
],
[
44,
45
],
[
45,
46
],
[
45,
47
],
[
47,
48
],
[
48,
49
],
[
44,
50
],
[
50,
51
],
[
50,
52
],
[
52,
53
],
[
53,
54
],
[
44,
55
],
[
55,
56
],
[
55,
57
],
[
57,
58
],
[
57,
59
],
[
44,
60
],
[
60,
61
],
[
61,
62
],
[
60,
63
],
[
39,
64
],
[
64,
65
],
[
65,
66
],
[
66,
67
],
[
65,
68
],
[
64,
69
],
[
69,
70
],
[
70,
71
],
[
70,
72
],
[
72,
73
],
[
73,
74
],
[
69,
75
],
[
75,
76
],
[
75,
77
],
[
77,
78
],
[
78,
79
],
[
69,
80
],
[
80,
81
],
[
80,
82
],
[
82,
83
],
[
82,
84
],
[
69,
85
],
[
85,
86
],
[
86,
87
],
[
85,
88
],
[
64,
89
],
[
89,
90
],
[
90,
91
],
[
91,
92
],
[
90,
93
],
[
89,
94
],
[
94,
95
],
[
95,
96
],
[
95,
97
],
[
97,
98
],
[
98,
99
],
[
94,
100
],
[
100,
101
],
[
100,
102
],
[
102,
103
],
[
103,
104
],
[
94,
105
],
[
105,
106
],
[
105,
107
],
[
107,
108
],
[
107,
109
],
[
94,
110
],
[
110,
111
],
[
111,
112
],
[
110,
113
],
[
89,
114
],
[
114,
115
],
[
115,
116
],
[
115,
117
],
[
117,
118
],
[
118,
119
],
[
117,
120
],
[
114,
121
],
[
121,
122
],
[
122,
123
],
[
121,
124
],
[
14,
125
],
[
125,
126
],
[
125,
127
],
[
127,
128
],
[
128,
129
],
[
14,
130
],
[
130,
131
],
[
131,
132
],
[
132,
133
],
[
132,
134
],
[
130,
135
],
[
144,
136
],
[
136,
137
],
[
136,
138
],
[
138,
139
],
[
139,
140
],
[
136,
141
],
[
141,
142
],
[
0,
143
],
[
143,
144
],
[
143,
145
]
] | [
"import java.util.Arrays;\nimport java.util.Scanner;\nimport java.util.Stack;\n\npublic class Main {\n \n public static void solve(){\n Scanner scan = new Scanner(System.in);\n String expression;\n \n expression = scan.nextLine();\n String[] symbols = expression.split(\" \");\n Stack<Integer> operands = new Stack<Integer>();\n \n for(String s: symbols){\n if(s.equals(\"+\")){\n int a = operands.pop();\n int b = operands.pop();\n int res = b + a;\n operands.push(res);\n }else if(s.equals(\"-\")){\n int a = operands.pop();\n int b = operands.pop();\n int res = b - a;\n operands.push(res);\n }else if(s.equals(\"*\")){\n int a = operands.pop();\n int b = operands.pop();\n int res = b * a;\n operands.push(res);\n }else{\n int x = (int)Integer.parseInt(s);\n operands.push(x);\n }\n }\n int x = operands.pop();\n System.out.println(x);\n }\n \n public static void main(String[] args) {\n solve();\n }\n \n}\n",
"import java.util.Arrays;",
"Arrays",
"java.util",
"import java.util.Scanner;",
"Scanner",
"java.util",
"import java.util.Stack;",
"Stack",
"java.util",
"public class Main {\n \n public static void solve(){\n Scanner scan = new Scanner(System.in);\n String expression;\n \n expression = scan.nextLine();\n String[] symbols = expression.split(\" \");\n Stack<Integer> operands = new Stack<Integer>();\n \n for(String s: symbols){\n if(s.equals(\"+\")){\n int a = operands.pop();\n int b = operands.pop();\n int res = b + a;\n operands.push(res);\n }else if(s.equals(\"-\")){\n int a = operands.pop();\n int b = operands.pop();\n int res = b - a;\n operands.push(res);\n }else if(s.equals(\"*\")){\n int a = operands.pop();\n int b = operands.pop();\n int res = b * a;\n operands.push(res);\n }else{\n int x = (int)Integer.parseInt(s);\n operands.push(x);\n }\n }\n int x = operands.pop();\n System.out.println(x);\n }\n \n public static void main(String[] args) {\n solve();\n }\n \n}",
"Main",
"public static void solve(){\n Scanner scan = new Scanner(System.in);\n String expression;\n \n expression = scan.nextLine();\n String[] symbols = expression.split(\" \");\n Stack<Integer> operands = new Stack<Integer>();\n \n for(String s: symbols){\n if(s.equals(\"+\")){\n int a = operands.pop();\n int b = operands.pop();\n int res = b + a;\n operands.push(res);\n }else if(s.equals(\"-\")){\n int a = operands.pop();\n int b = operands.pop();\n int res = b - a;\n operands.push(res);\n }else if(s.equals(\"*\")){\n int a = operands.pop();\n int b = operands.pop();\n int res = b * a;\n operands.push(res);\n }else{\n int x = (int)Integer.parseInt(s);\n operands.push(x);\n }\n }\n int x = operands.pop();\n System.out.println(x);\n }",
"solve",
"{\n Scanner scan = new Scanner(System.in);\n String expression;\n \n expression = scan.nextLine();\n String[] symbols = expression.split(\" \");\n Stack<Integer> operands = new Stack<Integer>();\n \n for(String s: symbols){\n if(s.equals(\"+\")){\n int a = operands.pop();\n int b = operands.pop();\n int res = b + a;\n operands.push(res);\n }else if(s.equals(\"-\")){\n int a = operands.pop();\n int b = operands.pop();\n int res = b - a;\n operands.push(res);\n }else if(s.equals(\"*\")){\n int a = operands.pop();\n int b = operands.pop();\n int res = b * a;\n operands.push(res);\n }else{\n int x = (int)Integer.parseInt(s);\n operands.push(x);\n }\n }\n int x = operands.pop();\n System.out.println(x);\n }",
"Scanner scan = new Scanner(System.in);",
"scan",
"new Scanner(System.in)",
"String expression;",
"expression",
"expression = scan.nextLine()",
"expression",
"scan.nextLine()",
"scan.nextLine",
"scan",
"String[] symbols = expression.split(\" \");",
"symbols",
"expression.split(\" \")",
"expression.split",
"expression",
"\" \"",
"Stack<Integer> operands = new Stack<Integer>();",
"operands",
"new Stack<Integer>()",
"for(String s: symbols){\n if(s.equals(\"+\")){\n int a = operands.pop();\n int b = operands.pop();\n int res = b + a;\n operands.push(res);\n }else if(s.equals(\"-\")){\n int a = operands.pop();\n int b = operands.pop();\n int res = b - a;\n operands.push(res);\n }else if(s.equals(\"*\")){\n int a = operands.pop();\n int b = operands.pop();\n int res = b * a;\n operands.push(res);\n }else{\n int x = (int)Integer.parseInt(s);\n operands.push(x);\n }\n }",
"String s",
"symbols",
"{\n if(s.equals(\"+\")){\n int a = operands.pop();\n int b = operands.pop();\n int res = b + a;\n operands.push(res);\n }else if(s.equals(\"-\")){\n int a = operands.pop();\n int b = operands.pop();\n int res = b - a;\n operands.push(res);\n }else if(s.equals(\"*\")){\n int a = operands.pop();\n int b = operands.pop();\n int res = b * a;\n operands.push(res);\n }else{\n int x = (int)Integer.parseInt(s);\n operands.push(x);\n }\n }",
"{\n if(s.equals(\"+\")){\n int a = operands.pop();\n int b = operands.pop();\n int res = b + a;\n operands.push(res);\n }else if(s.equals(\"-\")){\n int a = operands.pop();\n int b = operands.pop();\n int res = b - a;\n operands.push(res);\n }else if(s.equals(\"*\")){\n int a = operands.pop();\n int b = operands.pop();\n int res = b * a;\n operands.push(res);\n }else{\n int x = (int)Integer.parseInt(s);\n operands.push(x);\n }\n }",
"if(s.equals(\"+\")){\n int a = operands.pop();\n int b = operands.pop();\n int res = b + a;\n operands.push(res);\n }else if(s.equals(\"-\")){\n int a = operands.pop();\n int b = operands.pop();\n int res = b - a;\n operands.push(res);\n }else if(s.equals(\"*\")){\n int a = operands.pop();\n int b = operands.pop();\n int res = b * a;\n operands.push(res);\n }else{\n int x = (int)Integer.parseInt(s);\n operands.push(x);\n }",
"s.equals(\"+\")",
"s.equals",
"s",
"\"+\"",
"{\n int a = operands.pop();\n int b = operands.pop();\n int res = b + a;\n operands.push(res);\n }",
"int a = operands.pop();",
"a",
"operands.pop()",
"operands.pop",
"operands",
"int b = operands.pop();",
"b",
"operands.pop()",
"operands.pop",
"operands",
"int res = b + a;",
"res",
"b + a",
"b",
"a",
"operands.push(res)",
"operands.push",
"operands",
"res",
"if(s.equals(\"-\")){\n int a = operands.pop();\n int b = operands.pop();\n int res = b - a;\n operands.push(res);\n }else if(s.equals(\"*\")){\n int a = operands.pop();\n int b = operands.pop();\n int res = b * a;\n operands.push(res);\n }else{\n int x = (int)Integer.parseInt(s);\n operands.push(x);\n }",
"s.equals(\"-\")",
"s.equals",
"s",
"\"-\"",
"{\n int a = operands.pop();\n int b = operands.pop();\n int res = b - a;\n operands.push(res);\n }",
"int a = operands.pop();",
"a",
"operands.pop()",
"operands.pop",
"operands",
"int b = operands.pop();",
"b",
"operands.pop()",
"operands.pop",
"operands",
"int res = b - a;",
"res",
"b - a",
"b",
"a",
"operands.push(res)",
"operands.push",
"operands",
"res",
"if(s.equals(\"*\")){\n int a = operands.pop();\n int b = operands.pop();\n int res = b * a;\n operands.push(res);\n }else{\n int x = (int)Integer.parseInt(s);\n operands.push(x);\n }",
"s.equals(\"*\")",
"s.equals",
"s",
"\"*\"",
"{\n int a = operands.pop();\n int b = operands.pop();\n int res = b * a;\n operands.push(res);\n }",
"int a = operands.pop();",
"a",
"operands.pop()",
"operands.pop",
"operands",
"int b = operands.pop();",
"b",
"operands.pop()",
"operands.pop",
"operands",
"int res = b * a;",
"res",
"b * a",
"b",
"a",
"operands.push(res)",
"operands.push",
"operands",
"res",
"{\n int x = (int)Integer.parseInt(s);\n operands.push(x);\n }",
"int x = (int)Integer.parseInt(s);",
"x",
"(int)Integer.parseInt(s)",
"Integer.parseInt",
"Integer",
"s",
"operands.push(x)",
"operands.push",
"operands",
"x",
"int x = operands.pop();",
"x",
"operands.pop()",
"operands.pop",
"operands",
"System.out.println(x)",
"System.out.println",
"System.out",
"System",
"System.out",
"x",
"public static void main(String[] args) {\n solve();\n }",
"main",
"{\n solve();\n }",
"solve()",
"solve",
"String[] args",
"args",
"public class Main {\n \n public static void solve(){\n Scanner scan = new Scanner(System.in);\n String expression;\n \n expression = scan.nextLine();\n String[] symbols = expression.split(\" \");\n Stack<Integer> operands = new Stack<Integer>();\n \n for(String s: symbols){\n if(s.equals(\"+\")){\n int a = operands.pop();\n int b = operands.pop();\n int res = b + a;\n operands.push(res);\n }else if(s.equals(\"-\")){\n int a = operands.pop();\n int b = operands.pop();\n int res = b - a;\n operands.push(res);\n }else if(s.equals(\"*\")){\n int a = operands.pop();\n int b = operands.pop();\n int res = b * a;\n operands.push(res);\n }else{\n int x = (int)Integer.parseInt(s);\n operands.push(x);\n }\n }\n int x = operands.pop();\n System.out.println(x);\n }\n \n public static void main(String[] args) {\n solve();\n }\n \n}",
"public class Main {\n \n public static void solve(){\n Scanner scan = new Scanner(System.in);\n String expression;\n \n expression = scan.nextLine();\n String[] symbols = expression.split(\" \");\n Stack<Integer> operands = new Stack<Integer>();\n \n for(String s: symbols){\n if(s.equals(\"+\")){\n int a = operands.pop();\n int b = operands.pop();\n int res = b + a;\n operands.push(res);\n }else if(s.equals(\"-\")){\n int a = operands.pop();\n int b = operands.pop();\n int res = b - a;\n operands.push(res);\n }else if(s.equals(\"*\")){\n int a = operands.pop();\n int b = operands.pop();\n int res = b * a;\n operands.push(res);\n }else{\n int x = (int)Integer.parseInt(s);\n operands.push(x);\n }\n }\n int x = operands.pop();\n System.out.println(x);\n }\n \n public static void main(String[] args) {\n solve();\n }\n \n}",
"Main"
] | import java.util.Arrays;
import java.util.Scanner;
import java.util.Stack;
public class Main {
public static void solve(){
Scanner scan = new Scanner(System.in);
String expression;
expression = scan.nextLine();
String[] symbols = expression.split(" ");
Stack<Integer> operands = new Stack<Integer>();
for(String s: symbols){
if(s.equals("+")){
int a = operands.pop();
int b = operands.pop();
int res = b + a;
operands.push(res);
}else if(s.equals("-")){
int a = operands.pop();
int b = operands.pop();
int res = b - a;
operands.push(res);
}else if(s.equals("*")){
int a = operands.pop();
int b = operands.pop();
int res = b * a;
operands.push(res);
}else{
int x = (int)Integer.parseInt(s);
operands.push(x);
}
}
int x = operands.pop();
System.out.println(x);
}
public static void main(String[] args) {
solve();
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
20,
4,
18,
13,
23,
13,
6,
13,
41,
13,
12,
13,
30,
0,
13,
20,
12,
13,
30,
4,
18,
13,
13,
23,
13,
12,
13,
30,
41,
13,
4,
18,
13,
2,
4,
18,
13,
17,
4,
18,
13,
2,
4,
18,
13,
17,
29,
13,
12,
13,
30,
29,
4,
18,
13,
17,
6,
13,
41,
13,
41,
13,
12,
13,
30,
0,
13,
4,
18,
13,
17,
17,
0,
13,
20,
23,
13,
12,
13,
30,
41,
13,
28,
13,
13,
30,
30,
14,
2,
2,
2,
4,
18,
13,
17,
4,
18,
13,
17,
4,
18,
13,
17,
4,
18,
13,
17,
4,
18,
13,
4,
13,
4,
18,
13,
4,
18,
13,
4,
18,
13,
17,
4,
18,
13,
4,
18,
13,
13,
4,
18,
18,
13,
13,
4,
18,
13,
12,
13,
30,
14,
2,
13,
17,
29,
2,
13,
13,
14,
2,
13,
17,
29,
2,
13,
13,
14,
2,
13,
17,
29,
2,
13,
13,
4,
18,
18,
13,
13,
17,
29,
17,
23,
13,
23,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
196,
8
],
[
196,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
12,
14
],
[
11,
15
],
[
15,
16
],
[
15,
17
],
[
11,
18
],
[
18,
19
],
[
19,
20
],
[
9,
21
],
[
21,
22
],
[
0,
23
],
[
23,
24
],
[
23,
25
],
[
25,
26
],
[
23,
27
],
[
27,
28
],
[
27,
29
],
[
29,
30
],
[
30,
31
],
[
30,
32
],
[
23,
33
],
[
33,
34
],
[
33,
35
],
[
35,
36
],
[
36,
37
],
[
37,
38
],
[
36,
39
],
[
33,
40
],
[
40,
41
],
[
23,
42
],
[
42,
43
],
[
42,
44
],
[
44,
45
],
[
45,
46
],
[
45,
47
],
[
47,
48
],
[
48,
49
],
[
47,
50
],
[
50,
51
],
[
51,
52
],
[
52,
53
],
[
50,
54
],
[
44,
55
],
[
55,
56
],
[
56,
57
],
[
55,
58
],
[
58,
59
],
[
59,
60
],
[
60,
61
],
[
58,
62
],
[
44,
63
],
[
63,
64
],
[
23,
65
],
[
65,
66
],
[
65,
67
],
[
67,
68
],
[
68,
69
],
[
69,
70
],
[
70,
71
],
[
69,
72
],
[
0,
73
],
[
73,
74
],
[
73,
75
],
[
75,
76
],
[
73,
77
],
[
77,
78
],
[
73,
79
],
[
79,
80
],
[
79,
81
],
[
81,
82
],
[
82,
83
],
[
82,
84
],
[
84,
85
],
[
85,
86
],
[
84,
87
],
[
84,
88
],
[
81,
89
],
[
89,
90
],
[
89,
91
],
[
79,
92
],
[
92,
93
],
[
73,
94
],
[
94,
95
],
[
94,
96
],
[
96,
97
],
[
97,
98
],
[
96,
99
],
[
99,
100
],
[
99,
101
],
[
99,
102
],
[
103,
103
],
[
103,
104
],
[
104,
105
],
[
107,
106
],
[
106,
107
],
[
107,
108
],
[
108,
109
],
[
109,
110
],
[
108,
111
],
[
107,
112
],
[
112,
113
],
[
113,
114
],
[
112,
115
],
[
106,
116
],
[
116,
117
],
[
117,
118
],
[
116,
119
],
[
107,
120
],
[
120,
121
],
[
121,
122
],
[
120,
123
],
[
104,
124
],
[
124,
125
],
[
125,
126
],
[
124,
127
],
[
127,
128
],
[
127,
129
],
[
129,
130
],
[
130,
131
],
[
127,
132
],
[
132,
133
],
[
133,
134
],
[
127,
135
],
[
135,
136
],
[
136,
137
],
[
135,
138
],
[
104,
139
],
[
139,
140
],
[
140,
141
],
[
139,
142
],
[
142,
143
],
[
143,
144
],
[
142,
145
],
[
96,
146
],
[
146,
147
],
[
147,
148
],
[
148,
149
],
[
148,
150
],
[
146,
151
],
[
151,
152
],
[
152,
153
],
[
73,
154
],
[
154,
155
],
[
154,
156
],
[
156,
157
],
[
157,
158
],
[
158,
159
],
[
158,
160
],
[
157,
161
],
[
161,
162
],
[
162,
163
],
[
162,
164
],
[
156,
165
],
[
165,
166
],
[
166,
167
],
[
166,
168
],
[
165,
169
],
[
169,
170
],
[
170,
171
],
[
170,
172
],
[
156,
173
],
[
173,
174
],
[
174,
175
],
[
174,
176
],
[
173,
177
],
[
177,
178
],
[
178,
179
],
[
178,
180
],
[
156,
181
],
[
181,
182
],
[
182,
183
],
[
183,
184
],
[
183,
185
],
[
181,
186
],
[
156,
187
],
[
187,
188
],
[
154,
189
],
[
189,
190
],
[
154,
191
],
[
191,
192
],
[
154,
193
],
[
193,
194
],
[
0,
195
],
[
195,
196
],
[
195,
197
]
] | [
"import java.io.*;\nimport java.util.*;\npublic class Main{ \n\n\tpublic static void main(String args[]){\n\t\t\n\t\tScanner scan = new Scanner(System.in);\n\t\tRPN rpn = new RPN(scan.nextLine());\n rpn.analyze();\n\n\t}\n}\nclass Stack{\n ArrayList<Integer> stk;\n public Stack(){\n stk = new ArrayList<Integer>();\n }\n public void push(int val){\n stk.add(val);\n }\n public int pop(){\n int tmp=stk.get(stk.size()-1);\n stk.remove(stk.size()-1);\n return tmp;\n }\n public int ans(){\n return stk.get(0);\n }\n}\nclass RPN{\n String[] exp;\n Stack stack;\n public RPN(String e){\n exp = e.split(\" \", 0);\n stack = new Stack();\n }\n\n public void analyze(){\n int num;\n for(String str : exp){\n if(str.equals(\"+\") || str.equals(\"-\") || str.equals(\"*\") || str.equals(\"/\"))\n\t stack.push(calc(stack.pop(),stack.pop(),str.charAt(0)));\n else\n stack.push(Integer.parseInt(str));\n }\n System.out.println(stack.ans());\n }\n int calc(int b, int a, char op){\n if(op=='+')\n return a+b;\n if(op=='*')\n return a*b;\n if(op=='-')\n return a-b;\n System.out.println(\"error\");\n return 0;\n }\n}\n ",
"import java.io.*;",
"io.*",
"java",
"import java.util.*;",
"util.*",
"java",
"public class Main{ \n\n\tpublic static void main(String args[]){\n\t\t\n\t\tScanner scan = new Scanner(System.in);\n\t\tRPN rpn = new RPN(scan.nextLine());\n rpn.analyze();\n\n\t}\n}",
"Main",
"public static void main(String args[]){\n\t\t\n\t\tScanner scan = new Scanner(System.in);\n\t\tRPN rpn = new RPN(scan.nextLine());\n rpn.analyze();\n\n\t}",
"main",
"{\n\t\t\n\t\tScanner scan = new Scanner(System.in);\n\t\tRPN rpn = new RPN(scan.nextLine());\n rpn.analyze();\n\n\t}",
"Scanner scan = new Scanner(System.in);",
"scan",
"new Scanner(System.in)",
"RPN rpn = new RPN(scan.nextLine());",
"rpn",
"new RPN(scan.nextLine())",
"rpn.analyze()",
"rpn.analyze",
"rpn",
"String args[]",
"args",
"class Stack{\n ArrayList<Integer> stk;\n public Stack(){\n stk = new ArrayList<Integer>();\n }\n public void push(int val){\n stk.add(val);\n }\n public int pop(){\n int tmp=stk.get(stk.size()-1);\n stk.remove(stk.size()-1);\n return tmp;\n }\n public int ans(){\n return stk.get(0);\n }\n}",
"Stack",
"ArrayList<Integer> stk;",
"stk",
"public Stack(){\n stk = new ArrayList<Integer>();\n }",
"Stack",
"{\n stk = new ArrayList<Integer>();\n }",
"stk = new ArrayList<Integer>()",
"stk",
"new ArrayList<Integer>()",
"public void push(int val){\n stk.add(val);\n }",
"push",
"{\n stk.add(val);\n }",
"stk.add(val)",
"stk.add",
"stk",
"val",
"int val",
"val",
"public int pop(){\n int tmp=stk.get(stk.size()-1);\n stk.remove(stk.size()-1);\n return tmp;\n }",
"pop",
"{\n int tmp=stk.get(stk.size()-1);\n stk.remove(stk.size()-1);\n return tmp;\n }",
"int tmp=stk.get(stk.size()-1);",
"tmp",
"stk.get(stk.size()-1)",
"stk.get",
"stk",
"stk.size()-1",
"stk.size()",
"stk.size",
"stk",
"1",
"stk.remove(stk.size()-1)",
"stk.remove",
"stk",
"stk.size()-1",
"stk.size()",
"stk.size",
"stk",
"1",
"return tmp;",
"tmp",
"public int ans(){\n return stk.get(0);\n }",
"ans",
"{\n return stk.get(0);\n }",
"return stk.get(0);",
"stk.get(0)",
"stk.get",
"stk",
"0",
"class RPN{\n String[] exp;\n Stack stack;\n public RPN(String e){\n exp = e.split(\" \", 0);\n stack = new Stack();\n }\n\n public void analyze(){\n int num;\n for(String str : exp){\n if(str.equals(\"+\") || str.equals(\"-\") || str.equals(\"*\") || str.equals(\"/\"))\n\t stack.push(calc(stack.pop(),stack.pop(),str.charAt(0)));\n else\n stack.push(Integer.parseInt(str));\n }\n System.out.println(stack.ans());\n }\n int calc(int b, int a, char op){\n if(op=='+')\n return a+b;\n if(op=='*')\n return a*b;\n if(op=='-')\n return a-b;\n System.out.println(\"error\");\n return 0;\n }\n}",
"RPN",
"String[] exp;",
"exp",
"Stack stack;",
"stack",
"public RPN(String e){\n exp = e.split(\" \", 0);\n stack = new Stack();\n }",
"RPN",
"{\n exp = e.split(\" \", 0);\n stack = new Stack();\n }",
"exp = e.split(\" \", 0)",
"exp",
"e.split(\" \", 0)",
"e.split",
"e",
"\" \"",
"0",
"stack = new Stack()",
"stack",
"new Stack()",
"String e",
"e",
"public void analyze(){\n int num;\n for(String str : exp){\n if(str.equals(\"+\") || str.equals(\"-\") || str.equals(\"*\") || str.equals(\"/\"))\n\t stack.push(calc(stack.pop(),stack.pop(),str.charAt(0)));\n else\n stack.push(Integer.parseInt(str));\n }\n System.out.println(stack.ans());\n }",
"analyze",
"{\n int num;\n for(String str : exp){\n if(str.equals(\"+\") || str.equals(\"-\") || str.equals(\"*\") || str.equals(\"/\"))\n\t stack.push(calc(stack.pop(),stack.pop(),str.charAt(0)));\n else\n stack.push(Integer.parseInt(str));\n }\n System.out.println(stack.ans());\n }",
"int num;",
"num",
"for(String str : exp){\n if(str.equals(\"+\") || str.equals(\"-\") || str.equals(\"*\") || str.equals(\"/\"))\n\t stack.push(calc(stack.pop(),stack.pop(),str.charAt(0)));\n else\n stack.push(Integer.parseInt(str));\n }",
"String str",
"exp",
"{\n if(str.equals(\"+\") || str.equals(\"-\") || str.equals(\"*\") || str.equals(\"/\"))\n\t stack.push(calc(stack.pop(),stack.pop(),str.charAt(0)));\n else\n stack.push(Integer.parseInt(str));\n }",
"{\n if(str.equals(\"+\") || str.equals(\"-\") || str.equals(\"*\") || str.equals(\"/\"))\n\t stack.push(calc(stack.pop(),stack.pop(),str.charAt(0)));\n else\n stack.push(Integer.parseInt(str));\n }",
"if(str.equals(\"+\") || str.equals(\"-\") || str.equals(\"*\") || str.equals(\"/\"))\n\t stack.push(calc(stack.pop(),stack.pop(),str.charAt(0)));\n else\n stack.push(Integer.parseInt(str));",
"str.equals(\"+\") || str.equals(\"-\") || str.equals(\"*\") || str.equals(\"/\")",
"str.equals(\"*\")",
"str.equals(\"+\") || str.equals(\"-\") || str.equals(\"*\") || str.equals(\"/\")",
"str.equals(\"+\")",
"str.equals",
"str",
"\"+\"",
"str.equals(\"-\")",
"str.equals",
"str",
"\"-\"",
"str.equals(\"*\")",
"str.equals",
"str",
"\"*\"",
"str.equals(\"/\")",
"str.equals",
"str",
"\"/\"",
"stack.push(calc(stack.pop(),stack.pop(),str.charAt(0)))",
"stack.push",
"stack",
"calc(stack.pop(),stack.pop(),str.charAt(0))",
"calc",
"stack.pop()",
"stack.pop",
"stack",
"stack.pop()",
"stack.pop",
"stack",
"str.charAt(0)",
"str.charAt",
"str",
"0",
"stack.push(Integer.parseInt(str))",
"stack.push",
"stack",
"Integer.parseInt(str)",
"Integer.parseInt",
"Integer",
"str",
"System.out.println(stack.ans())",
"System.out.println",
"System.out",
"System",
"System.out",
"stack.ans()",
"stack.ans",
"stack",
"int calc(int b, int a, char op){\n if(op=='+')\n return a+b;\n if(op=='*')\n return a*b;\n if(op=='-')\n return a-b;\n System.out.println(\"error\");\n return 0;\n }",
"calc",
"{\n if(op=='+')\n return a+b;\n if(op=='*')\n return a*b;\n if(op=='-')\n return a-b;\n System.out.println(\"error\");\n return 0;\n }",
"if(op=='+')\n return a+b;",
"op=='+'",
"op",
"'+'",
"return a+b;",
"a+b",
"a",
"b",
"if(op=='*')\n return a*b;",
"op=='*'",
"op",
"'*'",
"return a*b;",
"a*b",
"a",
"b",
"if(op=='-')\n return a-b;",
"op=='-'",
"op",
"'-'",
"return a-b;",
"a-b",
"a",
"b",
"System.out.println(\"error\")",
"System.out.println",
"System.out",
"System",
"System.out",
"\"error\"",
"return 0;",
"0",
"int b",
"b",
"int a",
"a",
"char op",
"op",
"public class Main{ \n\n\tpublic static void main(String args[]){\n\t\t\n\t\tScanner scan = new Scanner(System.in);\n\t\tRPN rpn = new RPN(scan.nextLine());\n rpn.analyze();\n\n\t}\n}",
"public class Main{ \n\n\tpublic static void main(String args[]){\n\t\t\n\t\tScanner scan = new Scanner(System.in);\n\t\tRPN rpn = new RPN(scan.nextLine());\n rpn.analyze();\n\n\t}\n}",
"Main"
] | import java.io.*;
import java.util.*;
public class Main{
public static void main(String args[]){
Scanner scan = new Scanner(System.in);
RPN rpn = new RPN(scan.nextLine());
rpn.analyze();
}
}
class Stack{
ArrayList<Integer> stk;
public Stack(){
stk = new ArrayList<Integer>();
}
public void push(int val){
stk.add(val);
}
public int pop(){
int tmp=stk.get(stk.size()-1);
stk.remove(stk.size()-1);
return tmp;
}
public int ans(){
return stk.get(0);
}
}
class RPN{
String[] exp;
Stack stack;
public RPN(String e){
exp = e.split(" ", 0);
stack = new Stack();
}
public void analyze(){
int num;
for(String str : exp){
if(str.equals("+") || str.equals("-") || str.equals("*") || str.equals("/"))
stack.push(calc(stack.pop(),stack.pop(),str.charAt(0)));
else
stack.push(Integer.parseInt(str));
}
System.out.println(stack.ans());
}
int calc(int b, int a, char op){
if(op=='+')
return a+b;
if(op=='*')
return a*b;
if(op=='-')
return a-b;
System.out.println("error");
return 0;
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
4,
18,
13,
17,
41,
13,
20,
18,
13,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
30,
35,
4,
18,
18,
13,
13,
17,
34,
17,
1,
40,
13,
0,
18,
13,
2,
13,
17,
2,
18,
13,
2,
13,
17,
18,
13,
13,
3,
34,
17,
1,
40,
13,
0,
18,
13,
2,
13,
17,
2,
18,
13,
2,
13,
17,
18,
13,
13,
3,
34,
17,
1,
40,
13,
0,
18,
13,
2,
13,
17,
2,
18,
13,
2,
13,
17,
18,
13,
13,
3,
34,
1,
0,
18,
13,
13,
4,
18,
13,
18,
13,
13,
40,
13,
3,
4,
18,
18,
13,
13,
18,
13,
17,
23,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
16,
17
],
[
17,
18
],
[
14,
19
],
[
8,
20
],
[
20,
21
],
[
20,
22
],
[
23,
24
],
[
23,
25
],
[
8,
26
],
[
26,
27
],
[
26,
28
],
[
8,
29
],
[
29,
30
],
[
30,
31
],
[
31,
32
],
[
31,
33
],
[
29,
34
],
[
34,
35
],
[
34,
36
],
[
36,
37
],
[
36,
38
],
[
29,
39
],
[
39,
40
],
[
40,
41
],
[
29,
42
],
[
43,
43
],
[
43,
44
],
[
44,
45
],
[
45,
46
],
[
46,
47
],
[
47,
48
],
[
47,
49
],
[
45,
50
],
[
44,
51
],
[
51,
52
],
[
51,
53
],
[
53,
54
],
[
54,
55
],
[
53,
56
],
[
56,
57
],
[
57,
58
],
[
57,
59
],
[
59,
60
],
[
59,
61
],
[
56,
62
],
[
62,
63
],
[
63,
64
],
[
63,
65
],
[
65,
66
],
[
65,
67
],
[
62,
68
],
[
68,
69
],
[
68,
70
],
[
53,
71
],
[
44,
72
],
[
72,
73
],
[
72,
74
],
[
74,
75
],
[
75,
76
],
[
74,
77
],
[
77,
78
],
[
78,
79
],
[
78,
80
],
[
80,
81
],
[
80,
82
],
[
77,
83
],
[
83,
84
],
[
84,
85
],
[
84,
86
],
[
86,
87
],
[
86,
88
],
[
83,
89
],
[
89,
90
],
[
89,
91
],
[
74,
92
],
[
44,
93
],
[
93,
94
],
[
93,
95
],
[
95,
96
],
[
96,
97
],
[
95,
98
],
[
98,
99
],
[
99,
100
],
[
99,
101
],
[
101,
102
],
[
101,
103
],
[
98,
104
],
[
104,
105
],
[
105,
106
],
[
105,
107
],
[
107,
108
],
[
107,
109
],
[
104,
110
],
[
110,
111
],
[
110,
112
],
[
95,
113
],
[
44,
114
],
[
114,
115
],
[
115,
116
],
[
116,
117
],
[
117,
118
],
[
117,
119
],
[
116,
120
],
[
120,
121
],
[
121,
122
],
[
120,
123
],
[
123,
124
],
[
123,
125
],
[
115,
126
],
[
126,
127
],
[
115,
128
],
[
8,
129
],
[
129,
130
],
[
130,
131
],
[
131,
132
],
[
131,
133
],
[
129,
134
],
[
134,
135
],
[
134,
136
],
[
6,
137
],
[
137,
138
]
] | [
"import java.io.*;\n\nclass Main {\n\tpublic static void main(String[] args) throws IOException{\n\t\tBufferedReader r = new BufferedReader(new InputStreamReader(System.in));\n\t\t\n\t\tString[] s = r.readLine().split(\" \");\n\t\tint[] stack = new int[s.length];\n\t\tint topOfStack = 0;\n\t\t\n\t\tfor (int i = 0; i < s.length; i++) {\n\t\t\tswitch (s[i].charAt(0)) {\n\t\t\t\tcase '+':\n\t\t\t\t\ttopOfStack--;\n\t\t\t\t\tstack[topOfStack-1] = stack[topOfStack - 1] + stack[topOfStack];\n\t\t\t\t\tbreak;\n\t\t\t\tcase '-':\n\t\t\t\t\ttopOfStack--;\n\t\t\t\t\tstack[topOfStack-1] = stack[topOfStack - 1] - stack[topOfStack];\n\t\t\t\t\tbreak;\n\t\t\t\tcase '*':\n\t\t\t\t\ttopOfStack--;\n\t\t\t\t\tstack[topOfStack-1] = stack[topOfStack - 1] * stack[topOfStack];\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tstack[topOfStack] = Integer.parseInt(s[i]);\n\t\t\t\t\ttopOfStack++;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(stack[0]);\n\t}\n\t\n}",
"import java.io.*;",
"io.*",
"java",
"class Main {\n\tpublic static void main(String[] args) throws IOException{\n\t\tBufferedReader r = new BufferedReader(new InputStreamReader(System.in));\n\t\t\n\t\tString[] s = r.readLine().split(\" \");\n\t\tint[] stack = new int[s.length];\n\t\tint topOfStack = 0;\n\t\t\n\t\tfor (int i = 0; i < s.length; i++) {\n\t\t\tswitch (s[i].charAt(0)) {\n\t\t\t\tcase '+':\n\t\t\t\t\ttopOfStack--;\n\t\t\t\t\tstack[topOfStack-1] = stack[topOfStack - 1] + stack[topOfStack];\n\t\t\t\t\tbreak;\n\t\t\t\tcase '-':\n\t\t\t\t\ttopOfStack--;\n\t\t\t\t\tstack[topOfStack-1] = stack[topOfStack - 1] - stack[topOfStack];\n\t\t\t\t\tbreak;\n\t\t\t\tcase '*':\n\t\t\t\t\ttopOfStack--;\n\t\t\t\t\tstack[topOfStack-1] = stack[topOfStack - 1] * stack[topOfStack];\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tstack[topOfStack] = Integer.parseInt(s[i]);\n\t\t\t\t\ttopOfStack++;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(stack[0]);\n\t}\n\t\n}",
"Main",
"public static void main(String[] args) throws IOException{\n\t\tBufferedReader r = new BufferedReader(new InputStreamReader(System.in));\n\t\t\n\t\tString[] s = r.readLine().split(\" \");\n\t\tint[] stack = new int[s.length];\n\t\tint topOfStack = 0;\n\t\t\n\t\tfor (int i = 0; i < s.length; i++) {\n\t\t\tswitch (s[i].charAt(0)) {\n\t\t\t\tcase '+':\n\t\t\t\t\ttopOfStack--;\n\t\t\t\t\tstack[topOfStack-1] = stack[topOfStack - 1] + stack[topOfStack];\n\t\t\t\t\tbreak;\n\t\t\t\tcase '-':\n\t\t\t\t\ttopOfStack--;\n\t\t\t\t\tstack[topOfStack-1] = stack[topOfStack - 1] - stack[topOfStack];\n\t\t\t\t\tbreak;\n\t\t\t\tcase '*':\n\t\t\t\t\ttopOfStack--;\n\t\t\t\t\tstack[topOfStack-1] = stack[topOfStack - 1] * stack[topOfStack];\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tstack[topOfStack] = Integer.parseInt(s[i]);\n\t\t\t\t\ttopOfStack++;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(stack[0]);\n\t}",
"main",
"{\n\t\tBufferedReader r = new BufferedReader(new InputStreamReader(System.in));\n\t\t\n\t\tString[] s = r.readLine().split(\" \");\n\t\tint[] stack = new int[s.length];\n\t\tint topOfStack = 0;\n\t\t\n\t\tfor (int i = 0; i < s.length; i++) {\n\t\t\tswitch (s[i].charAt(0)) {\n\t\t\t\tcase '+':\n\t\t\t\t\ttopOfStack--;\n\t\t\t\t\tstack[topOfStack-1] = stack[topOfStack - 1] + stack[topOfStack];\n\t\t\t\t\tbreak;\n\t\t\t\tcase '-':\n\t\t\t\t\ttopOfStack--;\n\t\t\t\t\tstack[topOfStack-1] = stack[topOfStack - 1] - stack[topOfStack];\n\t\t\t\t\tbreak;\n\t\t\t\tcase '*':\n\t\t\t\t\ttopOfStack--;\n\t\t\t\t\tstack[topOfStack-1] = stack[topOfStack - 1] * stack[topOfStack];\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tstack[topOfStack] = Integer.parseInt(s[i]);\n\t\t\t\t\ttopOfStack++;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(stack[0]);\n\t}",
"BufferedReader r = new BufferedReader(new InputStreamReader(System.in));",
"r",
"new BufferedReader(new InputStreamReader(System.in))",
"String[] s = r.readLine().split(\" \");",
"s",
"r.readLine().split(\" \")",
"r.readLine().split",
"r.readLine()",
"r.readLine",
"r",
"\" \"",
"int[] stack = new int[s.length];",
"stack",
"new int[s.length]",
"s.length",
"s",
"s.length",
"int topOfStack = 0;",
"topOfStack",
"0",
"for (int i = 0; i < s.length; i++) {\n\t\t\tswitch (s[i].charAt(0)) {\n\t\t\t\tcase '+':\n\t\t\t\t\ttopOfStack--;\n\t\t\t\t\tstack[topOfStack-1] = stack[topOfStack - 1] + stack[topOfStack];\n\t\t\t\t\tbreak;\n\t\t\t\tcase '-':\n\t\t\t\t\ttopOfStack--;\n\t\t\t\t\tstack[topOfStack-1] = stack[topOfStack - 1] - stack[topOfStack];\n\t\t\t\t\tbreak;\n\t\t\t\tcase '*':\n\t\t\t\t\ttopOfStack--;\n\t\t\t\t\tstack[topOfStack-1] = stack[topOfStack - 1] * stack[topOfStack];\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tstack[topOfStack] = Integer.parseInt(s[i]);\n\t\t\t\t\ttopOfStack++;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < s.length",
"i",
"s.length",
"s",
"s.length",
"i++",
"i++",
"i",
"{\n\t\t\tswitch (s[i].charAt(0)) {\n\t\t\t\tcase '+':\n\t\t\t\t\ttopOfStack--;\n\t\t\t\t\tstack[topOfStack-1] = stack[topOfStack - 1] + stack[topOfStack];\n\t\t\t\t\tbreak;\n\t\t\t\tcase '-':\n\t\t\t\t\ttopOfStack--;\n\t\t\t\t\tstack[topOfStack-1] = stack[topOfStack - 1] - stack[topOfStack];\n\t\t\t\t\tbreak;\n\t\t\t\tcase '*':\n\t\t\t\t\ttopOfStack--;\n\t\t\t\t\tstack[topOfStack-1] = stack[topOfStack - 1] * stack[topOfStack];\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tstack[topOfStack] = Integer.parseInt(s[i]);\n\t\t\t\t\ttopOfStack++;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}",
"{\n\t\t\tswitch (s[i].charAt(0)) {\n\t\t\t\tcase '+':\n\t\t\t\t\ttopOfStack--;\n\t\t\t\t\tstack[topOfStack-1] = stack[topOfStack - 1] + stack[topOfStack];\n\t\t\t\t\tbreak;\n\t\t\t\tcase '-':\n\t\t\t\t\ttopOfStack--;\n\t\t\t\t\tstack[topOfStack-1] = stack[topOfStack - 1] - stack[topOfStack];\n\t\t\t\t\tbreak;\n\t\t\t\tcase '*':\n\t\t\t\t\ttopOfStack--;\n\t\t\t\t\tstack[topOfStack-1] = stack[topOfStack - 1] * stack[topOfStack];\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tstack[topOfStack] = Integer.parseInt(s[i]);\n\t\t\t\t\ttopOfStack++;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}",
"switch (s[i].charAt(0)) {\n\t\t\t\tcase '+':\n\t\t\t\t\ttopOfStack--;\n\t\t\t\t\tstack[topOfStack-1] = stack[topOfStack - 1] + stack[topOfStack];\n\t\t\t\t\tbreak;\n\t\t\t\tcase '-':\n\t\t\t\t\ttopOfStack--;\n\t\t\t\t\tstack[topOfStack-1] = stack[topOfStack - 1] - stack[topOfStack];\n\t\t\t\t\tbreak;\n\t\t\t\tcase '*':\n\t\t\t\t\ttopOfStack--;\n\t\t\t\t\tstack[topOfStack-1] = stack[topOfStack - 1] * stack[topOfStack];\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tstack[topOfStack] = Integer.parseInt(s[i]);\n\t\t\t\t\ttopOfStack++;\n\t\t\t\t\tbreak;\n\t\t\t}",
"s[i].charAt(0)",
"s[i].charAt",
"s[i]",
"s",
"i",
"0",
"case '+':",
"'+'",
"case '+':",
"topOfStack--",
"topOfStack",
"stack[topOfStack-1] = stack[topOfStack - 1] + stack[topOfStack]",
"stack[topOfStack-1]",
"stack",
"topOfStack-1",
"topOfStack",
"1",
"stack[topOfStack - 1] + stack[topOfStack]",
"stack[topOfStack - 1]",
"stack",
"topOfStack - 1",
"topOfStack",
"1",
"stack[topOfStack]",
"stack",
"topOfStack",
"break;",
"case '-':",
"'-'",
"case '-':",
"topOfStack--",
"topOfStack",
"stack[topOfStack-1] = stack[topOfStack - 1] - stack[topOfStack]",
"stack[topOfStack-1]",
"stack",
"topOfStack-1",
"topOfStack",
"1",
"stack[topOfStack - 1] - stack[topOfStack]",
"stack[topOfStack - 1]",
"stack",
"topOfStack - 1",
"topOfStack",
"1",
"stack[topOfStack]",
"stack",
"topOfStack",
"break;",
"case '*':",
"'*'",
"case '*':",
"topOfStack--",
"topOfStack",
"stack[topOfStack-1] = stack[topOfStack - 1] * stack[topOfStack]",
"stack[topOfStack-1]",
"stack",
"topOfStack-1",
"topOfStack",
"1",
"stack[topOfStack - 1] * stack[topOfStack]",
"stack[topOfStack - 1]",
"stack",
"topOfStack - 1",
"topOfStack",
"1",
"stack[topOfStack]",
"stack",
"topOfStack",
"break;",
"default:",
"default:",
"stack[topOfStack] = Integer.parseInt(s[i])",
"stack[topOfStack]",
"stack",
"topOfStack",
"Integer.parseInt(s[i])",
"Integer.parseInt",
"Integer",
"s[i]",
"s",
"i",
"topOfStack++",
"topOfStack",
"break;",
"System.out.println(stack[0])",
"System.out.println",
"System.out",
"System",
"System.out",
"stack[0]",
"stack",
"0",
"String[] args",
"args"
] | import java.io.*;
class Main {
public static void main(String[] args) throws IOException{
BufferedReader r = new BufferedReader(new InputStreamReader(System.in));
String[] s = r.readLine().split(" ");
int[] stack = new int[s.length];
int topOfStack = 0;
for (int i = 0; i < s.length; i++) {
switch (s[i].charAt(0)) {
case '+':
topOfStack--;
stack[topOfStack-1] = stack[topOfStack - 1] + stack[topOfStack];
break;
case '-':
topOfStack--;
stack[topOfStack-1] = stack[topOfStack - 1] - stack[topOfStack];
break;
case '*':
topOfStack--;
stack[topOfStack-1] = stack[topOfStack - 1] * stack[topOfStack];
break;
default:
stack[topOfStack] = Integer.parseInt(s[i]);
topOfStack++;
break;
}
}
System.out.println(stack[0]);
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
17,
41,
13,
20,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
30,
41,
13,
17,
41,
13,
17,
35,
18,
13,
13,
34,
17,
1,
0,
13,
4,
18,
13,
0,
13,
4,
18,
13,
4,
18,
13,
2,
13,
13,
3,
34,
17,
1,
0,
13,
4,
18,
13,
0,
13,
4,
18,
13,
4,
18,
13,
2,
13,
13,
3,
34,
17,
1,
0,
13,
4,
18,
13,
0,
13,
4,
18,
13,
4,
18,
13,
2,
13,
13,
3,
34,
17,
1,
0,
13,
4,
18,
13,
0,
13,
4,
18,
13,
4,
18,
13,
2,
13,
13,
3,
34,
1,
0,
13,
4,
18,
13,
18,
13,
13,
4,
18,
13,
13,
3,
41,
13,
4,
18,
13,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
166,
11
],
[
166,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
15,
17
],
[
14,
18
],
[
18,
19
],
[
18,
20
],
[
20,
21
],
[
21,
22
],
[
14,
23
],
[
23,
24
],
[
23,
25
],
[
25,
26
],
[
26,
27
],
[
25,
28
],
[
14,
29
],
[
29,
30
],
[
29,
31
],
[
14,
32
],
[
32,
33
],
[
33,
34
],
[
34,
35
],
[
34,
36
],
[
32,
37
],
[
37,
38
],
[
37,
39
],
[
39,
40
],
[
39,
41
],
[
32,
42
],
[
42,
43
],
[
43,
44
],
[
32,
45
],
[
46,
46
],
[
46,
47
],
[
47,
48
],
[
47,
49
],
[
46,
50
],
[
50,
51
],
[
50,
52
],
[
46,
53
],
[
53,
54
],
[
54,
55
],
[
54,
56
],
[
53,
57
],
[
57,
58
],
[
57,
59
],
[
59,
60
],
[
60,
61
],
[
60,
62
],
[
62,
63
],
[
63,
64
],
[
59,
65
],
[
65,
66
],
[
65,
67
],
[
67,
68
],
[
68,
69
],
[
59,
70
],
[
70,
71
],
[
71,
72
],
[
70,
73
],
[
73,
74
],
[
73,
75
],
[
59,
76
],
[
53,
77
],
[
77,
78
],
[
77,
79
],
[
79,
80
],
[
80,
81
],
[
80,
82
],
[
82,
83
],
[
83,
84
],
[
79,
85
],
[
85,
86
],
[
85,
87
],
[
87,
88
],
[
88,
89
],
[
79,
90
],
[
90,
91
],
[
91,
92
],
[
90,
93
],
[
93,
94
],
[
93,
95
],
[
79,
96
],
[
53,
97
],
[
97,
98
],
[
97,
99
],
[
99,
100
],
[
100,
101
],
[
100,
102
],
[
102,
103
],
[
103,
104
],
[
99,
105
],
[
105,
106
],
[
105,
107
],
[
107,
108
],
[
108,
109
],
[
99,
110
],
[
110,
111
],
[
111,
112
],
[
110,
113
],
[
113,
114
],
[
113,
115
],
[
99,
116
],
[
53,
117
],
[
117,
118
],
[
117,
119
],
[
119,
120
],
[
120,
121
],
[
120,
122
],
[
122,
123
],
[
123,
124
],
[
119,
125
],
[
125,
126
],
[
125,
127
],
[
127,
128
],
[
128,
129
],
[
119,
130
],
[
130,
131
],
[
131,
132
],
[
130,
133
],
[
133,
134
],
[
133,
135
],
[
119,
136
],
[
53,
137
],
[
137,
138
],
[
138,
139
],
[
139,
140
],
[
139,
141
],
[
141,
142
],
[
142,
143
],
[
141,
144
],
[
144,
145
],
[
144,
146
],
[
138,
147
],
[
147,
148
],
[
148,
149
],
[
147,
150
],
[
138,
151
],
[
14,
152
],
[
152,
153
],
[
152,
154
],
[
154,
155
],
[
155,
156
],
[
14,
157
],
[
157,
158
],
[
158,
159
],
[
159,
160
],
[
159,
161
],
[
157,
162
],
[
12,
163
],
[
163,
164
],
[
0,
165
],
[
165,
166
],
[
165,
167
]
] | [
"import java.util.ArrayDeque;\nimport java.util.Deque;\nimport java.util.Scanner;\n\npublic class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tString n = sc.nextLine();\n\n\t\tString[] line =n.split(\" \");\n\n\n\t\tDeque<Integer> stack = new ArrayDeque<Integer>();\n\t\tfor(int i=0; i<line.length; i++) {\n\t\t\tint a=0,b=0;\n\t\t\tswitch(line[i]) {\n\t\t\tcase \"+\":\n\t\t\t\ta = stack.pop();\n\t\t\t\tb = stack.pop();\n\t\t\t\tstack.push(b+a);\n\t\t\t\tbreak;\n\t\t\tcase \"-\":\n\t\t\t\ta = stack.pop();\n\t\t\t\tb = stack.pop();\n\t\t\t\tstack.push(b-a);\n\t\t\t\tbreak;\n\t\t\tcase \"/\":\n\t\t\t\ta = stack.pop();\n\t\t\t\tb = stack.pop();\n\t\t\t\tstack.push(b/a);\n\t\t\t\tbreak;\n\t\t\tcase \"*\":\n\t\t\t\ta = stack.pop();\n\t\t\t\tb = stack.pop();\n\t\t\t\tstack.push(b*a);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\ta = Integer.parseInt(line[i]);\n\t\t\t\tstack.push(a);\n\t\t\t\tbreak; \n\t\t\t}\n\t\t}\n int ans = stack.pop();\n\t\tSystem.out.println(ans);\n\t}\n}\n\n",
"import java.util.ArrayDeque;",
"ArrayDeque",
"java.util",
"import java.util.Deque;",
"Deque",
"java.util",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tString n = sc.nextLine();\n\n\t\tString[] line =n.split(\" \");\n\n\n\t\tDeque<Integer> stack = new ArrayDeque<Integer>();\n\t\tfor(int i=0; i<line.length; i++) {\n\t\t\tint a=0,b=0;\n\t\t\tswitch(line[i]) {\n\t\t\tcase \"+\":\n\t\t\t\ta = stack.pop();\n\t\t\t\tb = stack.pop();\n\t\t\t\tstack.push(b+a);\n\t\t\t\tbreak;\n\t\t\tcase \"-\":\n\t\t\t\ta = stack.pop();\n\t\t\t\tb = stack.pop();\n\t\t\t\tstack.push(b-a);\n\t\t\t\tbreak;\n\t\t\tcase \"/\":\n\t\t\t\ta = stack.pop();\n\t\t\t\tb = stack.pop();\n\t\t\t\tstack.push(b/a);\n\t\t\t\tbreak;\n\t\t\tcase \"*\":\n\t\t\t\ta = stack.pop();\n\t\t\t\tb = stack.pop();\n\t\t\t\tstack.push(b*a);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\ta = Integer.parseInt(line[i]);\n\t\t\t\tstack.push(a);\n\t\t\t\tbreak; \n\t\t\t}\n\t\t}\n int ans = stack.pop();\n\t\tSystem.out.println(ans);\n\t}\n}",
"Main",
"public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tString n = sc.nextLine();\n\n\t\tString[] line =n.split(\" \");\n\n\n\t\tDeque<Integer> stack = new ArrayDeque<Integer>();\n\t\tfor(int i=0; i<line.length; i++) {\n\t\t\tint a=0,b=0;\n\t\t\tswitch(line[i]) {\n\t\t\tcase \"+\":\n\t\t\t\ta = stack.pop();\n\t\t\t\tb = stack.pop();\n\t\t\t\tstack.push(b+a);\n\t\t\t\tbreak;\n\t\t\tcase \"-\":\n\t\t\t\ta = stack.pop();\n\t\t\t\tb = stack.pop();\n\t\t\t\tstack.push(b-a);\n\t\t\t\tbreak;\n\t\t\tcase \"/\":\n\t\t\t\ta = stack.pop();\n\t\t\t\tb = stack.pop();\n\t\t\t\tstack.push(b/a);\n\t\t\t\tbreak;\n\t\t\tcase \"*\":\n\t\t\t\ta = stack.pop();\n\t\t\t\tb = stack.pop();\n\t\t\t\tstack.push(b*a);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\ta = Integer.parseInt(line[i]);\n\t\t\t\tstack.push(a);\n\t\t\t\tbreak; \n\t\t\t}\n\t\t}\n int ans = stack.pop();\n\t\tSystem.out.println(ans);\n\t}",
"main",
"{\n\t\tScanner sc = new Scanner(System.in);\n\t\tString n = sc.nextLine();\n\n\t\tString[] line =n.split(\" \");\n\n\n\t\tDeque<Integer> stack = new ArrayDeque<Integer>();\n\t\tfor(int i=0; i<line.length; i++) {\n\t\t\tint a=0,b=0;\n\t\t\tswitch(line[i]) {\n\t\t\tcase \"+\":\n\t\t\t\ta = stack.pop();\n\t\t\t\tb = stack.pop();\n\t\t\t\tstack.push(b+a);\n\t\t\t\tbreak;\n\t\t\tcase \"-\":\n\t\t\t\ta = stack.pop();\n\t\t\t\tb = stack.pop();\n\t\t\t\tstack.push(b-a);\n\t\t\t\tbreak;\n\t\t\tcase \"/\":\n\t\t\t\ta = stack.pop();\n\t\t\t\tb = stack.pop();\n\t\t\t\tstack.push(b/a);\n\t\t\t\tbreak;\n\t\t\tcase \"*\":\n\t\t\t\ta = stack.pop();\n\t\t\t\tb = stack.pop();\n\t\t\t\tstack.push(b*a);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\ta = Integer.parseInt(line[i]);\n\t\t\t\tstack.push(a);\n\t\t\t\tbreak; \n\t\t\t}\n\t\t}\n int ans = stack.pop();\n\t\tSystem.out.println(ans);\n\t}",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"String n = sc.nextLine();",
"n",
"sc.nextLine()",
"sc.nextLine",
"sc",
"String[] line =n.split(\" \");",
"line",
"n.split(\" \")",
"n.split",
"n",
"\" \"",
"Deque<Integer> stack = new ArrayDeque<Integer>();",
"stack",
"new ArrayDeque<Integer>()",
"for(int i=0; i<line.length; i++) {\n\t\t\tint a=0,b=0;\n\t\t\tswitch(line[i]) {\n\t\t\tcase \"+\":\n\t\t\t\ta = stack.pop();\n\t\t\t\tb = stack.pop();\n\t\t\t\tstack.push(b+a);\n\t\t\t\tbreak;\n\t\t\tcase \"-\":\n\t\t\t\ta = stack.pop();\n\t\t\t\tb = stack.pop();\n\t\t\t\tstack.push(b-a);\n\t\t\t\tbreak;\n\t\t\tcase \"/\":\n\t\t\t\ta = stack.pop();\n\t\t\t\tb = stack.pop();\n\t\t\t\tstack.push(b/a);\n\t\t\t\tbreak;\n\t\t\tcase \"*\":\n\t\t\t\ta = stack.pop();\n\t\t\t\tb = stack.pop();\n\t\t\t\tstack.push(b*a);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\ta = Integer.parseInt(line[i]);\n\t\t\t\tstack.push(a);\n\t\t\t\tbreak; \n\t\t\t}\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<line.length",
"i",
"line.length",
"line",
"line.length",
"i++",
"i++",
"i",
"{\n\t\t\tint a=0,b=0;\n\t\t\tswitch(line[i]) {\n\t\t\tcase \"+\":\n\t\t\t\ta = stack.pop();\n\t\t\t\tb = stack.pop();\n\t\t\t\tstack.push(b+a);\n\t\t\t\tbreak;\n\t\t\tcase \"-\":\n\t\t\t\ta = stack.pop();\n\t\t\t\tb = stack.pop();\n\t\t\t\tstack.push(b-a);\n\t\t\t\tbreak;\n\t\t\tcase \"/\":\n\t\t\t\ta = stack.pop();\n\t\t\t\tb = stack.pop();\n\t\t\t\tstack.push(b/a);\n\t\t\t\tbreak;\n\t\t\tcase \"*\":\n\t\t\t\ta = stack.pop();\n\t\t\t\tb = stack.pop();\n\t\t\t\tstack.push(b*a);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\ta = Integer.parseInt(line[i]);\n\t\t\t\tstack.push(a);\n\t\t\t\tbreak; \n\t\t\t}\n\t\t}",
"{\n\t\t\tint a=0,b=0;\n\t\t\tswitch(line[i]) {\n\t\t\tcase \"+\":\n\t\t\t\ta = stack.pop();\n\t\t\t\tb = stack.pop();\n\t\t\t\tstack.push(b+a);\n\t\t\t\tbreak;\n\t\t\tcase \"-\":\n\t\t\t\ta = stack.pop();\n\t\t\t\tb = stack.pop();\n\t\t\t\tstack.push(b-a);\n\t\t\t\tbreak;\n\t\t\tcase \"/\":\n\t\t\t\ta = stack.pop();\n\t\t\t\tb = stack.pop();\n\t\t\t\tstack.push(b/a);\n\t\t\t\tbreak;\n\t\t\tcase \"*\":\n\t\t\t\ta = stack.pop();\n\t\t\t\tb = stack.pop();\n\t\t\t\tstack.push(b*a);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\ta = Integer.parseInt(line[i]);\n\t\t\t\tstack.push(a);\n\t\t\t\tbreak; \n\t\t\t}\n\t\t}",
"int a=0",
"a",
"0",
"b=0;",
"b",
"0",
"switch(line[i]) {\n\t\t\tcase \"+\":\n\t\t\t\ta = stack.pop();\n\t\t\t\tb = stack.pop();\n\t\t\t\tstack.push(b+a);\n\t\t\t\tbreak;\n\t\t\tcase \"-\":\n\t\t\t\ta = stack.pop();\n\t\t\t\tb = stack.pop();\n\t\t\t\tstack.push(b-a);\n\t\t\t\tbreak;\n\t\t\tcase \"/\":\n\t\t\t\ta = stack.pop();\n\t\t\t\tb = stack.pop();\n\t\t\t\tstack.push(b/a);\n\t\t\t\tbreak;\n\t\t\tcase \"*\":\n\t\t\t\ta = stack.pop();\n\t\t\t\tb = stack.pop();\n\t\t\t\tstack.push(b*a);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\ta = Integer.parseInt(line[i]);\n\t\t\t\tstack.push(a);\n\t\t\t\tbreak; \n\t\t\t}",
"line[i]",
"line",
"i",
"case \"+\":",
"\"+\"",
"case \"+\":",
"a = stack.pop()",
"a",
"stack.pop()",
"stack.pop",
"stack",
"b = stack.pop()",
"b",
"stack.pop()",
"stack.pop",
"stack",
"stack.push(b+a)",
"stack.push",
"stack",
"b+a",
"b",
"a",
"break;",
"case \"-\":",
"\"-\"",
"case \"-\":",
"a = stack.pop()",
"a",
"stack.pop()",
"stack.pop",
"stack",
"b = stack.pop()",
"b",
"stack.pop()",
"stack.pop",
"stack",
"stack.push(b-a)",
"stack.push",
"stack",
"b-a",
"b",
"a",
"break;",
"case \"/\":",
"\"/\"",
"case \"/\":",
"a = stack.pop()",
"a",
"stack.pop()",
"stack.pop",
"stack",
"b = stack.pop()",
"b",
"stack.pop()",
"stack.pop",
"stack",
"stack.push(b/a)",
"stack.push",
"stack",
"b/a",
"b",
"a",
"break;",
"case \"*\":",
"\"*\"",
"case \"*\":",
"a = stack.pop()",
"a",
"stack.pop()",
"stack.pop",
"stack",
"b = stack.pop()",
"b",
"stack.pop()",
"stack.pop",
"stack",
"stack.push(b*a)",
"stack.push",
"stack",
"b*a",
"b",
"a",
"break;",
"default:",
"default:",
"a = Integer.parseInt(line[i])",
"a",
"Integer.parseInt(line[i])",
"Integer.parseInt",
"Integer",
"line[i]",
"line",
"i",
"stack.push(a)",
"stack.push",
"stack",
"a",
"break;",
"int ans = stack.pop();",
"ans",
"stack.pop()",
"stack.pop",
"stack",
"System.out.println(ans)",
"System.out.println",
"System.out",
"System",
"System.out",
"ans",
"String[] args",
"args",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tString n = sc.nextLine();\n\n\t\tString[] line =n.split(\" \");\n\n\n\t\tDeque<Integer> stack = new ArrayDeque<Integer>();\n\t\tfor(int i=0; i<line.length; i++) {\n\t\t\tint a=0,b=0;\n\t\t\tswitch(line[i]) {\n\t\t\tcase \"+\":\n\t\t\t\ta = stack.pop();\n\t\t\t\tb = stack.pop();\n\t\t\t\tstack.push(b+a);\n\t\t\t\tbreak;\n\t\t\tcase \"-\":\n\t\t\t\ta = stack.pop();\n\t\t\t\tb = stack.pop();\n\t\t\t\tstack.push(b-a);\n\t\t\t\tbreak;\n\t\t\tcase \"/\":\n\t\t\t\ta = stack.pop();\n\t\t\t\tb = stack.pop();\n\t\t\t\tstack.push(b/a);\n\t\t\t\tbreak;\n\t\t\tcase \"*\":\n\t\t\t\ta = stack.pop();\n\t\t\t\tb = stack.pop();\n\t\t\t\tstack.push(b*a);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\ta = Integer.parseInt(line[i]);\n\t\t\t\tstack.push(a);\n\t\t\t\tbreak; \n\t\t\t}\n\t\t}\n int ans = stack.pop();\n\t\tSystem.out.println(ans);\n\t}\n}",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tString n = sc.nextLine();\n\n\t\tString[] line =n.split(\" \");\n\n\n\t\tDeque<Integer> stack = new ArrayDeque<Integer>();\n\t\tfor(int i=0; i<line.length; i++) {\n\t\t\tint a=0,b=0;\n\t\t\tswitch(line[i]) {\n\t\t\tcase \"+\":\n\t\t\t\ta = stack.pop();\n\t\t\t\tb = stack.pop();\n\t\t\t\tstack.push(b+a);\n\t\t\t\tbreak;\n\t\t\tcase \"-\":\n\t\t\t\ta = stack.pop();\n\t\t\t\tb = stack.pop();\n\t\t\t\tstack.push(b-a);\n\t\t\t\tbreak;\n\t\t\tcase \"/\":\n\t\t\t\ta = stack.pop();\n\t\t\t\tb = stack.pop();\n\t\t\t\tstack.push(b/a);\n\t\t\t\tbreak;\n\t\t\tcase \"*\":\n\t\t\t\ta = stack.pop();\n\t\t\t\tb = stack.pop();\n\t\t\t\tstack.push(b*a);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\ta = Integer.parseInt(line[i]);\n\t\t\t\tstack.push(a);\n\t\t\t\tbreak; \n\t\t\t}\n\t\t}\n int ans = stack.pop();\n\t\tSystem.out.println(ans);\n\t}\n}",
"Main"
] | import java.util.ArrayDeque;
import java.util.Deque;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String n = sc.nextLine();
String[] line =n.split(" ");
Deque<Integer> stack = new ArrayDeque<Integer>();
for(int i=0; i<line.length; i++) {
int a=0,b=0;
switch(line[i]) {
case "+":
a = stack.pop();
b = stack.pop();
stack.push(b+a);
break;
case "-":
a = stack.pop();
b = stack.pop();
stack.push(b-a);
break;
case "/":
a = stack.pop();
b = stack.pop();
stack.push(b/a);
break;
case "*":
a = stack.pop();
b = stack.pop();
stack.push(b*a);
break;
default:
a = Integer.parseInt(line[i]);
stack.push(a);
break;
}
}
int ans = stack.pop();
System.out.println(ans);
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
29,
2,
2,
4,
18,
13,
17,
4,
18,
13,
17,
4,
18,
13,
17,
23,
13,
12,
13,
30,
14,
4,
18,
13,
17,
29,
2,
13,
13,
14,
4,
18,
13,
17,
29,
2,
13,
13,
14,
4,
18,
13,
17,
29,
2,
13,
13,
29,
17,
23,
13,
23,
13,
23,
13,
12,
13,
30,
41,
13,
20,
41,
13,
17,
42,
2,
13,
18,
13,
13,
30,
41,
13,
18,
13,
13,
14,
4,
13,
13,
30,
4,
18,
13,
4,
13,
4,
18,
13,
4,
18,
13,
13,
30,
4,
18,
13,
4,
18,
13,
13,
40,
13,
29,
4,
18,
13,
23,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
4,
18,
18,
13,
13,
4,
13,
4,
18,
13,
17,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
146,
8
],
[
146,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
14,
14
],
[
14,
15
],
[
15,
16
],
[
16,
17
],
[
15,
18
],
[
14,
19
],
[
19,
20
],
[
20,
21
],
[
19,
22
],
[
14,
23
],
[
23,
24
],
[
24,
25
],
[
23,
26
],
[
9,
27
],
[
27,
28
],
[
146,
29
],
[
29,
30
],
[
29,
31
],
[
31,
32
],
[
32,
33
],
[
33,
34
],
[
34,
35
],
[
33,
36
],
[
32,
37
],
[
37,
38
],
[
38,
39
],
[
38,
40
],
[
31,
41
],
[
41,
42
],
[
42,
43
],
[
43,
44
],
[
42,
45
],
[
41,
46
],
[
46,
47
],
[
47,
48
],
[
47,
49
],
[
31,
50
],
[
50,
51
],
[
51,
52
],
[
52,
53
],
[
51,
54
],
[
50,
55
],
[
55,
56
],
[
56,
57
],
[
56,
58
],
[
31,
59
],
[
59,
60
],
[
29,
61
],
[
61,
62
],
[
29,
63
],
[
63,
64
],
[
29,
65
],
[
65,
66
],
[
146,
67
],
[
67,
68
],
[
67,
69
],
[
69,
70
],
[
70,
71
],
[
70,
72
],
[
69,
73
],
[
73,
74
],
[
73,
75
],
[
69,
76
],
[
76,
77
],
[
77,
78
],
[
77,
79
],
[
79,
80
],
[
79,
81
],
[
76,
82
],
[
82,
83
],
[
83,
84
],
[
83,
85
],
[
85,
86
],
[
85,
87
],
[
82,
88
],
[
88,
89
],
[
89,
90
],
[
89,
91
],
[
88,
92
],
[
92,
93
],
[
93,
94
],
[
94,
95
],
[
93,
96
],
[
96,
97
],
[
96,
98
],
[
98,
99
],
[
99,
100
],
[
96,
101
],
[
101,
102
],
[
102,
103
],
[
96,
104
],
[
88,
105
],
[
105,
106
],
[
106,
107
],
[
107,
108
],
[
106,
109
],
[
109,
110
],
[
110,
111
],
[
109,
112
],
[
82,
113
],
[
113,
114
],
[
69,
115
],
[
115,
116
],
[
116,
117
],
[
117,
118
],
[
67,
119
],
[
119,
120
],
[
146,
121
],
[
121,
122
],
[
121,
123
],
[
123,
124
],
[
124,
125
],
[
124,
126
],
[
123,
127
],
[
127,
128
],
[
127,
129
],
[
129,
130
],
[
130,
131
],
[
123,
132
],
[
132,
133
],
[
133,
134
],
[
134,
135
],
[
134,
136
],
[
132,
137
],
[
137,
138
],
[
137,
139
],
[
139,
140
],
[
140,
141
],
[
139,
142
],
[
121,
143
],
[
143,
144
],
[
0,
145
],
[
145,
146
],
[
145,
147
]
] | [
"\nimport java.util.Scanner;\nimport java.util.Stack;\n\n//a trivial practice to evaluate reverse polish notation\n\npublic class Main {\n\tpublic static boolean is_operator(String token) {\n\t\treturn token.equals(\"+\") || token.equals(\"-\") || token.equals(\"*\");\n\t}\n\t\n\t\n\tpublic static int eval_simple_exp(int b, int a, String op) {\n\t\tif(op.equals(\"+\")) return a + b;\n\t\tif(op.equals(\"-\")) return a - b;\n\t\tif(op.equals(\"*\")) return a * b;\n\t\t\n\t\t\n\t\treturn 0;\n\t}\n\t\n\t\n\t//without any other validation about the expression's validity\n\tpublic static int eval_r_polish(String[] exp) {\n\t\tStack<Integer> oprd_stk =new Stack<Integer>();\n\t\tint i = 0;\n\t\t\n\t\t\n\t\twhile(i < exp.length) {\n\t\t\tString token = exp[i];\n\t\t\tif(is_operator(token)) {\n\t\t\t\toprd_stk.push(eval_simple_exp(oprd_stk.pop(), oprd_stk.pop(), token));\n\t\t\t}else {\n\t\t\t\toprd_stk.push(Integer.parseInt(token));\n\t\t\t}\n\t\t\ti++;\n\t\t}\n\t\t\n\t\treturn oprd_stk.pop();\n\t}\n\t\n\t\n\tpublic static void main(String [] args) {\n\t\tScanner cin = new Scanner(System.in);\n\t\t\n\t\tString str_exp = cin.nextLine();\n\t\t\n\t\tSystem.out.println(eval_r_polish(str_exp.split(\" \")));\n\t\t\n\t}\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"import java.util.Stack;",
"Stack",
"java.util",
"public class Main {\n\tpublic static boolean is_operator(String token) {\n\t\treturn token.equals(\"+\") || token.equals(\"-\") || token.equals(\"*\");\n\t}\n\t\n\t\n\tpublic static int eval_simple_exp(int b, int a, String op) {\n\t\tif(op.equals(\"+\")) return a + b;\n\t\tif(op.equals(\"-\")) return a - b;\n\t\tif(op.equals(\"*\")) return a * b;\n\t\t\n\t\t\n\t\treturn 0;\n\t}\n\t\n\t\n\t//without any other validation about the expression's validity\n\tpublic static int eval_r_polish(String[] exp) {\n\t\tStack<Integer> oprd_stk =new Stack<Integer>();\n\t\tint i = 0;\n\t\t\n\t\t\n\t\twhile(i < exp.length) {\n\t\t\tString token = exp[i];\n\t\t\tif(is_operator(token)) {\n\t\t\t\toprd_stk.push(eval_simple_exp(oprd_stk.pop(), oprd_stk.pop(), token));\n\t\t\t}else {\n\t\t\t\toprd_stk.push(Integer.parseInt(token));\n\t\t\t}\n\t\t\ti++;\n\t\t}\n\t\t\n\t\treturn oprd_stk.pop();\n\t}\n\t\n\t\n\tpublic static void main(String [] args) {\n\t\tScanner cin = new Scanner(System.in);\n\t\t\n\t\tString str_exp = cin.nextLine();\n\t\t\n\t\tSystem.out.println(eval_r_polish(str_exp.split(\" \")));\n\t\t\n\t}\n}",
"Main",
"public static boolean is_operator(String token) {\n\t\treturn token.equals(\"+\") || token.equals(\"-\") || token.equals(\"*\");\n\t}",
"is_operator",
"{\n\t\treturn token.equals(\"+\") || token.equals(\"-\") || token.equals(\"*\");\n\t}",
"return token.equals(\"+\") || token.equals(\"-\") || token.equals(\"*\");",
"token.equals(\"+\") || token.equals(\"-\") || token.equals(\"*\")",
"token.equals(\"+\") || token.equals(\"-\") || token.equals(\"*\")",
"token.equals(\"+\")",
"token.equals",
"token",
"\"+\"",
"token.equals(\"-\")",
"token.equals",
"token",
"\"-\"",
"token.equals(\"*\")",
"token.equals",
"token",
"\"*\"",
"String token",
"token",
"public static int eval_simple_exp(int b, int a, String op) {\n\t\tif(op.equals(\"+\")) return a + b;\n\t\tif(op.equals(\"-\")) return a - b;\n\t\tif(op.equals(\"*\")) return a * b;\n\t\t\n\t\t\n\t\treturn 0;\n\t}",
"eval_simple_exp",
"{\n\t\tif(op.equals(\"+\")) return a + b;\n\t\tif(op.equals(\"-\")) return a - b;\n\t\tif(op.equals(\"*\")) return a * b;\n\t\t\n\t\t\n\t\treturn 0;\n\t}",
"if(op.equals(\"+\")) return a + b;",
"op.equals(\"+\")",
"op.equals",
"op",
"\"+\"",
"return a + b;",
"a + b",
"a",
"b",
"if(op.equals(\"-\")) return a - b;",
"op.equals(\"-\")",
"op.equals",
"op",
"\"-\"",
"return a - b;",
"a - b",
"a",
"b",
"if(op.equals(\"*\")) return a * b;",
"op.equals(\"*\")",
"op.equals",
"op",
"\"*\"",
"return a * b;",
"a * b",
"a",
"b",
"return 0;",
"0",
"int b",
"b",
"int a",
"a",
"String op",
"op",
"//without any other validation about the expression's validity\n\tpublic static int eval_r_polish(String[] exp) {\n\t\tStack<Integer> oprd_stk =new Stack<Integer>();\n\t\tint i = 0;\n\t\t\n\t\t\n\t\twhile(i < exp.length) {\n\t\t\tString token = exp[i];\n\t\t\tif(is_operator(token)) {\n\t\t\t\toprd_stk.push(eval_simple_exp(oprd_stk.pop(), oprd_stk.pop(), token));\n\t\t\t}else {\n\t\t\t\toprd_stk.push(Integer.parseInt(token));\n\t\t\t}\n\t\t\ti++;\n\t\t}\n\t\t\n\t\treturn oprd_stk.pop();\n\t}",
"eval_r_polish",
"{\n\t\tStack<Integer> oprd_stk =new Stack<Integer>();\n\t\tint i = 0;\n\t\t\n\t\t\n\t\twhile(i < exp.length) {\n\t\t\tString token = exp[i];\n\t\t\tif(is_operator(token)) {\n\t\t\t\toprd_stk.push(eval_simple_exp(oprd_stk.pop(), oprd_stk.pop(), token));\n\t\t\t}else {\n\t\t\t\toprd_stk.push(Integer.parseInt(token));\n\t\t\t}\n\t\t\ti++;\n\t\t}\n\t\t\n\t\treturn oprd_stk.pop();\n\t}",
"Stack<Integer> oprd_stk =new Stack<Integer>();",
"oprd_stk",
"new Stack<Integer>()",
"int i = 0;",
"i",
"0",
"while(i < exp.length) {\n\t\t\tString token = exp[i];\n\t\t\tif(is_operator(token)) {\n\t\t\t\toprd_stk.push(eval_simple_exp(oprd_stk.pop(), oprd_stk.pop(), token));\n\t\t\t}else {\n\t\t\t\toprd_stk.push(Integer.parseInt(token));\n\t\t\t}\n\t\t\ti++;\n\t\t}",
"i < exp.length",
"i",
"exp.length",
"exp",
"exp.length",
"{\n\t\t\tString token = exp[i];\n\t\t\tif(is_operator(token)) {\n\t\t\t\toprd_stk.push(eval_simple_exp(oprd_stk.pop(), oprd_stk.pop(), token));\n\t\t\t}else {\n\t\t\t\toprd_stk.push(Integer.parseInt(token));\n\t\t\t}\n\t\t\ti++;\n\t\t}",
"String token = exp[i];",
"token",
"exp[i]",
"exp",
"i",
"if(is_operator(token)) {\n\t\t\t\toprd_stk.push(eval_simple_exp(oprd_stk.pop(), oprd_stk.pop(), token));\n\t\t\t}else {\n\t\t\t\toprd_stk.push(Integer.parseInt(token));\n\t\t\t}",
"is_operator(token)",
"is_operator",
"token",
"{\n\t\t\t\toprd_stk.push(eval_simple_exp(oprd_stk.pop(), oprd_stk.pop(), token));\n\t\t\t}",
"oprd_stk.push(eval_simple_exp(oprd_stk.pop(), oprd_stk.pop(), token))",
"oprd_stk.push",
"oprd_stk",
"eval_simple_exp(oprd_stk.pop(), oprd_stk.pop(), token)",
"eval_simple_exp",
"oprd_stk.pop()",
"oprd_stk.pop",
"oprd_stk",
"oprd_stk.pop()",
"oprd_stk.pop",
"oprd_stk",
"token",
"{\n\t\t\t\toprd_stk.push(Integer.parseInt(token));\n\t\t\t}",
"oprd_stk.push(Integer.parseInt(token))",
"oprd_stk.push",
"oprd_stk",
"Integer.parseInt(token)",
"Integer.parseInt",
"Integer",
"token",
"i++",
"i",
"return oprd_stk.pop();",
"oprd_stk.pop()",
"oprd_stk.pop",
"oprd_stk",
"String[] exp",
"exp",
"public static void main(String [] args) {\n\t\tScanner cin = new Scanner(System.in);\n\t\t\n\t\tString str_exp = cin.nextLine();\n\t\t\n\t\tSystem.out.println(eval_r_polish(str_exp.split(\" \")));\n\t\t\n\t}",
"main",
"{\n\t\tScanner cin = new Scanner(System.in);\n\t\t\n\t\tString str_exp = cin.nextLine();\n\t\t\n\t\tSystem.out.println(eval_r_polish(str_exp.split(\" \")));\n\t\t\n\t}",
"Scanner cin = new Scanner(System.in);",
"cin",
"new Scanner(System.in)",
"String str_exp = cin.nextLine();",
"str_exp",
"cin.nextLine()",
"cin.nextLine",
"cin",
"System.out.println(eval_r_polish(str_exp.split(\" \")))",
"System.out.println",
"System.out",
"System",
"System.out",
"eval_r_polish(str_exp.split(\" \"))",
"eval_r_polish",
"str_exp.split(\" \")",
"str_exp.split",
"str_exp",
"\" \"",
"String [] args",
"args",
"public class Main {\n\tpublic static boolean is_operator(String token) {\n\t\treturn token.equals(\"+\") || token.equals(\"-\") || token.equals(\"*\");\n\t}\n\t\n\t\n\tpublic static int eval_simple_exp(int b, int a, String op) {\n\t\tif(op.equals(\"+\")) return a + b;\n\t\tif(op.equals(\"-\")) return a - b;\n\t\tif(op.equals(\"*\")) return a * b;\n\t\t\n\t\t\n\t\treturn 0;\n\t}\n\t\n\t\n\t//without any other validation about the expression's validity\n\tpublic static int eval_r_polish(String[] exp) {\n\t\tStack<Integer> oprd_stk =new Stack<Integer>();\n\t\tint i = 0;\n\t\t\n\t\t\n\t\twhile(i < exp.length) {\n\t\t\tString token = exp[i];\n\t\t\tif(is_operator(token)) {\n\t\t\t\toprd_stk.push(eval_simple_exp(oprd_stk.pop(), oprd_stk.pop(), token));\n\t\t\t}else {\n\t\t\t\toprd_stk.push(Integer.parseInt(token));\n\t\t\t}\n\t\t\ti++;\n\t\t}\n\t\t\n\t\treturn oprd_stk.pop();\n\t}\n\t\n\t\n\tpublic static void main(String [] args) {\n\t\tScanner cin = new Scanner(System.in);\n\t\t\n\t\tString str_exp = cin.nextLine();\n\t\t\n\t\tSystem.out.println(eval_r_polish(str_exp.split(\" \")));\n\t\t\n\t}\n}",
"public class Main {\n\tpublic static boolean is_operator(String token) {\n\t\treturn token.equals(\"+\") || token.equals(\"-\") || token.equals(\"*\");\n\t}\n\t\n\t\n\tpublic static int eval_simple_exp(int b, int a, String op) {\n\t\tif(op.equals(\"+\")) return a + b;\n\t\tif(op.equals(\"-\")) return a - b;\n\t\tif(op.equals(\"*\")) return a * b;\n\t\t\n\t\t\n\t\treturn 0;\n\t}\n\t\n\t\n\t//without any other validation about the expression's validity\n\tpublic static int eval_r_polish(String[] exp) {\n\t\tStack<Integer> oprd_stk =new Stack<Integer>();\n\t\tint i = 0;\n\t\t\n\t\t\n\t\twhile(i < exp.length) {\n\t\t\tString token = exp[i];\n\t\t\tif(is_operator(token)) {\n\t\t\t\toprd_stk.push(eval_simple_exp(oprd_stk.pop(), oprd_stk.pop(), token));\n\t\t\t}else {\n\t\t\t\toprd_stk.push(Integer.parseInt(token));\n\t\t\t}\n\t\t\ti++;\n\t\t}\n\t\t\n\t\treturn oprd_stk.pop();\n\t}\n\t\n\t\n\tpublic static void main(String [] args) {\n\t\tScanner cin = new Scanner(System.in);\n\t\t\n\t\tString str_exp = cin.nextLine();\n\t\t\n\t\tSystem.out.println(eval_r_polish(str_exp.split(\" \")));\n\t\t\n\t}\n}",
"Main"
] |
import java.util.Scanner;
import java.util.Stack;
//a trivial practice to evaluate reverse polish notation
public class Main {
public static boolean is_operator(String token) {
return token.equals("+") || token.equals("-") || token.equals("*");
}
public static int eval_simple_exp(int b, int a, String op) {
if(op.equals("+")) return a + b;
if(op.equals("-")) return a - b;
if(op.equals("*")) return a * b;
return 0;
}
//without any other validation about the expression's validity
public static int eval_r_polish(String[] exp) {
Stack<Integer> oprd_stk =new Stack<Integer>();
int i = 0;
while(i < exp.length) {
String token = exp[i];
if(is_operator(token)) {
oprd_stk.push(eval_simple_exp(oprd_stk.pop(), oprd_stk.pop(), token));
}else {
oprd_stk.push(Integer.parseInt(token));
}
i++;
}
return oprd_stk.pop();
}
public static void main(String [] args) {
Scanner cin = new Scanner(System.in);
String str_exp = cin.nextLine();
System.out.println(eval_r_polish(str_exp.split(" ")));
}
} |
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
41,
13,
41,
13,
20,
38,
5,
13,
30,
30,
41,
13,
4,
18,
13,
0,
13,
4,
18,
13,
17,
0,
13,
18,
13,
13,
41,
13,
20,
41,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
35,
18,
13,
13,
34,
17,
1,
0,
13,
2,
4,
18,
13,
4,
18,
13,
4,
18,
13,
13,
3,
34,
17,
1,
0,
13,
2,
4,
18,
13,
4,
18,
13,
4,
18,
13,
40,
13,
3,
34,
17,
1,
0,
13,
2,
4,
18,
13,
4,
18,
13,
4,
18,
13,
13,
3,
34,
1,
0,
13,
4,
18,
13,
18,
13,
13,
4,
18,
13,
13,
4,
18,
18,
13,
13,
4,
18,
13,
23,
13,
6,
13,
41,
13,
41,
13,
41,
13,
12,
13,
30,
0,
13,
13,
0,
13,
17,
0,
13,
20,
13,
23,
13,
12,
13,
30,
14,
2,
13,
13,
0,
18,
13,
40,
13,
13,
23,
13,
12,
13,
30,
14,
2,
13,
17,
29,
18,
13,
40,
13,
29,
40,
17,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
195,
11
],
[
195,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
14,
17
],
[
17,
18
],
[
14,
19
],
[
19,
20
],
[
19,
21
],
[
14,
22
],
[
22,
23
],
[
23,
24
],
[
23,
25
],
[
22,
26
],
[
26,
27
],
[
27,
28
],
[
27,
29
],
[
29,
30
],
[
30,
31
],
[
26,
32
],
[
32,
33
],
[
32,
34
],
[
34,
35
],
[
35,
36
],
[
34,
37
],
[
26,
38
],
[
38,
39
],
[
38,
40
],
[
40,
41
],
[
40,
42
],
[
26,
43
],
[
43,
44
],
[
43,
45
],
[
26,
46
],
[
46,
47
],
[
26,
48
],
[
48,
49
],
[
49,
50
],
[
50,
51
],
[
50,
52
],
[
48,
53
],
[
53,
54
],
[
53,
55
],
[
48,
56
],
[
56,
57
],
[
57,
58
],
[
48,
59
],
[
59,
60
],
[
60,
61
],
[
61,
62
],
[
62,
63
],
[
62,
64
],
[
61,
65
],
[
65,
66
],
[
65,
67
],
[
67,
68
],
[
68,
69
],
[
68,
70
],
[
70,
71
],
[
71,
72
],
[
72,
73
],
[
70,
74
],
[
74,
75
],
[
75,
76
],
[
67,
77
],
[
77,
78
],
[
78,
79
],
[
77,
80
],
[
67,
81
],
[
61,
82
],
[
82,
83
],
[
82,
84
],
[
84,
85
],
[
85,
86
],
[
85,
87
],
[
87,
88
],
[
88,
89
],
[
89,
90
],
[
87,
91
],
[
91,
92
],
[
92,
93
],
[
84,
94
],
[
94,
95
],
[
95,
96
],
[
94,
97
],
[
97,
98
],
[
84,
99
],
[
61,
100
],
[
100,
101
],
[
100,
102
],
[
102,
103
],
[
103,
104
],
[
103,
105
],
[
105,
106
],
[
106,
107
],
[
107,
108
],
[
105,
109
],
[
109,
110
],
[
110,
111
],
[
102,
112
],
[
112,
113
],
[
113,
114
],
[
112,
115
],
[
102,
116
],
[
61,
117
],
[
117,
118
],
[
118,
119
],
[
119,
120
],
[
119,
121
],
[
121,
122
],
[
122,
123
],
[
121,
124
],
[
124,
125
],
[
124,
126
],
[
118,
127
],
[
127,
128
],
[
128,
129
],
[
127,
130
],
[
26,
131
],
[
131,
132
],
[
132,
133
],
[
133,
134
],
[
133,
135
],
[
131,
136
],
[
136,
137
],
[
137,
138
],
[
12,
139
],
[
139,
140
],
[
0,
141
],
[
141,
142
],
[
141,
143
],
[
143,
144
],
[
141,
145
],
[
145,
146
],
[
141,
147
],
[
147,
148
],
[
141,
149
],
[
149,
150
],
[
149,
151
],
[
151,
152
],
[
152,
153
],
[
152,
154
],
[
151,
155
],
[
155,
156
],
[
155,
157
],
[
151,
158
],
[
158,
159
],
[
158,
160
],
[
149,
162
],
[
162,
163
],
[
141,
164
],
[
164,
165
],
[
164,
166
],
[
166,
167
],
[
167,
168
],
[
168,
169
],
[
168,
170
],
[
167,
171
],
[
171,
172
],
[
172,
173
],
[
172,
174
],
[
174,
175
],
[
171,
176
],
[
164,
177
],
[
177,
178
],
[
141,
179
],
[
179,
180
],
[
179,
181
],
[
181,
182
],
[
182,
183
],
[
183,
184
],
[
183,
185
],
[
182,
186
],
[
186,
187
],
[
187,
188
],
[
187,
189
],
[
189,
190
],
[
182,
191
],
[
191,
192
],
[
192,
193
],
[
0,
194
],
[
194,
195
],
[
194,
196
]
] | [
"import java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\n\npublic class Main{\n\n\n\n\n\tpublic static void main(String[] args){\n\n\t\tint len;\n\t\tString array[];\n\n\t\tBufferedReader reader=new BufferedReader(new InputStreamReader(System.in));\n\n\t\ttry{\n\t\tString str=reader.readLine();\n\t\tarray=str.split(\" \");\n\n\t\tlen=array.length;\n\n\t\tStack stack=new Stack(len);\n\t\tint tmp;\n\n\t\tfor(int i=0;i<len;i++){\n\t\t\tswitch(array[i]){\n\t\t\tcase\"+\":\n\t\t\t\ttmp=stack.pop()+stack.pop();\n\t\t\t\tstack.push(tmp);\n\t\t\t\tbreak;\n\t\t\tcase\"-\":\n\t\t\t\ttmp=stack.pop()-stack.pop();\n\t\t\t\tstack.push(-tmp);\n\t\t\t\tbreak;\n\t\t\tcase\"*\":\n\t\t\t\ttmp=stack.pop()*stack.pop();\n\t\t\t\tstack.push(tmp);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\ttmp=Integer.parseInt(array[i]);\n\t\t\t\tstack.push(tmp);\n\t\t\t}//swicth\n\n\t\t}//for\n\n\t\tSystem.out.println(stack.pop());\n\n\n\n\t\t}catch(IOException e){\n\n\t\t}\n\n\t}//main\n}\n\nclass Stack{\n\tint max;\n\tint ptr;\n\tint[] array;\n\n\tStack(int capacity){//?????????????????????\n\t\tmax=capacity;\n\t\tptr=0;\n\t\tarray=new int[max];\n\t}\n\n\tpublic void push(int p){\n\t\tif(ptr<=max)array[ptr++]=p;\n\t}//push????????????\n\n\tpublic int pop(){\n\t\tif(ptr>0)return array[--ptr];\n\t\telse return -1;\n\t}//pop????????????\n\n}//stack?????????",
"import java.io.BufferedReader;",
"BufferedReader",
"java.io",
"import java.io.IOException;",
"IOException",
"java.io",
"import java.io.InputStreamReader;",
"InputStreamReader",
"java.io",
"public class Main{\n\n\n\n\n\tpublic static void main(String[] args){\n\n\t\tint len;\n\t\tString array[];\n\n\t\tBufferedReader reader=new BufferedReader(new InputStreamReader(System.in));\n\n\t\ttry{\n\t\tString str=reader.readLine();\n\t\tarray=str.split(\" \");\n\n\t\tlen=array.length;\n\n\t\tStack stack=new Stack(len);\n\t\tint tmp;\n\n\t\tfor(int i=0;i<len;i++){\n\t\t\tswitch(array[i]){\n\t\t\tcase\"+\":\n\t\t\t\ttmp=stack.pop()+stack.pop();\n\t\t\t\tstack.push(tmp);\n\t\t\t\tbreak;\n\t\t\tcase\"-\":\n\t\t\t\ttmp=stack.pop()-stack.pop();\n\t\t\t\tstack.push(-tmp);\n\t\t\t\tbreak;\n\t\t\tcase\"*\":\n\t\t\t\ttmp=stack.pop()*stack.pop();\n\t\t\t\tstack.push(tmp);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\ttmp=Integer.parseInt(array[i]);\n\t\t\t\tstack.push(tmp);\n\t\t\t}//swicth\n\n\t\t}//for\n\n\t\tSystem.out.println(stack.pop());\n\n\n\n\t\t}catch(IOException e){\n\n\t\t}\n\n\t}//main\n}",
"Main",
"public static void main(String[] args){\n\n\t\tint len;\n\t\tString array[];\n\n\t\tBufferedReader reader=new BufferedReader(new InputStreamReader(System.in));\n\n\t\ttry{\n\t\tString str=reader.readLine();\n\t\tarray=str.split(\" \");\n\n\t\tlen=array.length;\n\n\t\tStack stack=new Stack(len);\n\t\tint tmp;\n\n\t\tfor(int i=0;i<len;i++){\n\t\t\tswitch(array[i]){\n\t\t\tcase\"+\":\n\t\t\t\ttmp=stack.pop()+stack.pop();\n\t\t\t\tstack.push(tmp);\n\t\t\t\tbreak;\n\t\t\tcase\"-\":\n\t\t\t\ttmp=stack.pop()-stack.pop();\n\t\t\t\tstack.push(-tmp);\n\t\t\t\tbreak;\n\t\t\tcase\"*\":\n\t\t\t\ttmp=stack.pop()*stack.pop();\n\t\t\t\tstack.push(tmp);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\ttmp=Integer.parseInt(array[i]);\n\t\t\t\tstack.push(tmp);\n\t\t\t}//swicth\n\n\t\t}//for\n\n\t\tSystem.out.println(stack.pop());\n\n\n\n\t\t}catch(IOException e){\n\n\t\t}\n\n\t}//main",
"main",
"{\n\n\t\tint len;\n\t\tString array[];\n\n\t\tBufferedReader reader=new BufferedReader(new InputStreamReader(System.in));\n\n\t\ttry{\n\t\tString str=reader.readLine();\n\t\tarray=str.split(\" \");\n\n\t\tlen=array.length;\n\n\t\tStack stack=new Stack(len);\n\t\tint tmp;\n\n\t\tfor(int i=0;i<len;i++){\n\t\t\tswitch(array[i]){\n\t\t\tcase\"+\":\n\t\t\t\ttmp=stack.pop()+stack.pop();\n\t\t\t\tstack.push(tmp);\n\t\t\t\tbreak;\n\t\t\tcase\"-\":\n\t\t\t\ttmp=stack.pop()-stack.pop();\n\t\t\t\tstack.push(-tmp);\n\t\t\t\tbreak;\n\t\t\tcase\"*\":\n\t\t\t\ttmp=stack.pop()*stack.pop();\n\t\t\t\tstack.push(tmp);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\ttmp=Integer.parseInt(array[i]);\n\t\t\t\tstack.push(tmp);\n\t\t\t}//swicth\n\n\t\t}//for\n\n\t\tSystem.out.println(stack.pop());\n\n\n\n\t\t}catch(IOException e){\n\n\t\t}\n\n\t}",
"int len;",
"len",
"String array[];",
"array",
"BufferedReader reader=new BufferedReader(new InputStreamReader(System.in));",
"reader",
"new BufferedReader(new InputStreamReader(System.in))",
"try{\n\t\tString str=reader.readLine();\n\t\tarray=str.split(\" \");\n\n\t\tlen=array.length;\n\n\t\tStack stack=new Stack(len);\n\t\tint tmp;\n\n\t\tfor(int i=0;i<len;i++){\n\t\t\tswitch(array[i]){\n\t\t\tcase\"+\":\n\t\t\t\ttmp=stack.pop()+stack.pop();\n\t\t\t\tstack.push(tmp);\n\t\t\t\tbreak;\n\t\t\tcase\"-\":\n\t\t\t\ttmp=stack.pop()-stack.pop();\n\t\t\t\tstack.push(-tmp);\n\t\t\t\tbreak;\n\t\t\tcase\"*\":\n\t\t\t\ttmp=stack.pop()*stack.pop();\n\t\t\t\tstack.push(tmp);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\ttmp=Integer.parseInt(array[i]);\n\t\t\t\tstack.push(tmp);\n\t\t\t}//swicth\n\n\t\t}//for\n\n\t\tSystem.out.println(stack.pop());\n\n\n\n\t\t}catch(IOException e){\n\n\t\t}",
"catch(IOException e){\n\n\t\t}",
"IOException e",
"{\n\n\t\t}",
"{\n\t\tString str=reader.readLine();\n\t\tarray=str.split(\" \");\n\n\t\tlen=array.length;\n\n\t\tStack stack=new Stack(len);\n\t\tint tmp;\n\n\t\tfor(int i=0;i<len;i++){\n\t\t\tswitch(array[i]){\n\t\t\tcase\"+\":\n\t\t\t\ttmp=stack.pop()+stack.pop();\n\t\t\t\tstack.push(tmp);\n\t\t\t\tbreak;\n\t\t\tcase\"-\":\n\t\t\t\ttmp=stack.pop()-stack.pop();\n\t\t\t\tstack.push(-tmp);\n\t\t\t\tbreak;\n\t\t\tcase\"*\":\n\t\t\t\ttmp=stack.pop()*stack.pop();\n\t\t\t\tstack.push(tmp);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\ttmp=Integer.parseInt(array[i]);\n\t\t\t\tstack.push(tmp);\n\t\t\t}//swicth\n\n\t\t}//for\n\n\t\tSystem.out.println(stack.pop());\n\n\n\n\t\t}",
"String str=reader.readLine();",
"str",
"reader.readLine()",
"reader.readLine",
"reader",
"array=str.split(\" \")",
"array",
"str.split(\" \")",
"str.split",
"str",
"\" \"",
"len=array.length",
"len",
"array.length",
"array",
"array.length",
"Stack stack=new Stack(len);",
"stack",
"new Stack(len)",
"int tmp;",
"tmp",
"for(int i=0;i<len;i++){\n\t\t\tswitch(array[i]){\n\t\t\tcase\"+\":\n\t\t\t\ttmp=stack.pop()+stack.pop();\n\t\t\t\tstack.push(tmp);\n\t\t\t\tbreak;\n\t\t\tcase\"-\":\n\t\t\t\ttmp=stack.pop()-stack.pop();\n\t\t\t\tstack.push(-tmp);\n\t\t\t\tbreak;\n\t\t\tcase\"*\":\n\t\t\t\ttmp=stack.pop()*stack.pop();\n\t\t\t\tstack.push(tmp);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\ttmp=Integer.parseInt(array[i]);\n\t\t\t\tstack.push(tmp);\n\t\t\t}//swicth\n\n\t\t}//for",
"int i=0;",
"int i=0;",
"i",
"0",
"i<len",
"i",
"len",
"i++",
"i++",
"i",
"{\n\t\t\tswitch(array[i]){\n\t\t\tcase\"+\":\n\t\t\t\ttmp=stack.pop()+stack.pop();\n\t\t\t\tstack.push(tmp);\n\t\t\t\tbreak;\n\t\t\tcase\"-\":\n\t\t\t\ttmp=stack.pop()-stack.pop();\n\t\t\t\tstack.push(-tmp);\n\t\t\t\tbreak;\n\t\t\tcase\"*\":\n\t\t\t\ttmp=stack.pop()*stack.pop();\n\t\t\t\tstack.push(tmp);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\ttmp=Integer.parseInt(array[i]);\n\t\t\t\tstack.push(tmp);\n\t\t\t}//swicth\n\n\t\t}//for",
"{\n\t\t\tswitch(array[i]){\n\t\t\tcase\"+\":\n\t\t\t\ttmp=stack.pop()+stack.pop();\n\t\t\t\tstack.push(tmp);\n\t\t\t\tbreak;\n\t\t\tcase\"-\":\n\t\t\t\ttmp=stack.pop()-stack.pop();\n\t\t\t\tstack.push(-tmp);\n\t\t\t\tbreak;\n\t\t\tcase\"*\":\n\t\t\t\ttmp=stack.pop()*stack.pop();\n\t\t\t\tstack.push(tmp);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\ttmp=Integer.parseInt(array[i]);\n\t\t\t\tstack.push(tmp);\n\t\t\t}//swicth\n\n\t\t}",
"switch(array[i]){\n\t\t\tcase\"+\":\n\t\t\t\ttmp=stack.pop()+stack.pop();\n\t\t\t\tstack.push(tmp);\n\t\t\t\tbreak;\n\t\t\tcase\"-\":\n\t\t\t\ttmp=stack.pop()-stack.pop();\n\t\t\t\tstack.push(-tmp);\n\t\t\t\tbreak;\n\t\t\tcase\"*\":\n\t\t\t\ttmp=stack.pop()*stack.pop();\n\t\t\t\tstack.push(tmp);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\ttmp=Integer.parseInt(array[i]);\n\t\t\t\tstack.push(tmp);\n\t\t\t}//swicth",
"array[i]",
"array",
"i",
"case\"+\":",
"\"+\"",
"case\"+\":",
"tmp=stack.pop()+stack.pop()",
"tmp",
"stack.pop()+stack.pop()",
"stack.pop()",
"stack.pop",
"stack",
"stack.pop()",
"stack.pop",
"stack",
"stack.push(tmp)",
"stack.push",
"stack",
"tmp",
"break;",
"case\"-\":",
"\"-\"",
"case\"-\":",
"tmp=stack.pop()-stack.pop()",
"tmp",
"stack.pop()-stack.pop()",
"stack.pop()",
"stack.pop",
"stack",
"stack.pop()",
"stack.pop",
"stack",
"stack.push(-tmp)",
"stack.push",
"stack",
"-tmp",
"tmp",
"break;",
"case\"*\":",
"\"*\"",
"case\"*\":",
"tmp=stack.pop()*stack.pop()",
"tmp",
"stack.pop()*stack.pop()",
"stack.pop()",
"stack.pop",
"stack",
"stack.pop()",
"stack.pop",
"stack",
"stack.push(tmp)",
"stack.push",
"stack",
"tmp",
"break;",
"default:",
"default:",
"tmp=Integer.parseInt(array[i])",
"tmp",
"Integer.parseInt(array[i])",
"Integer.parseInt",
"Integer",
"array[i]",
"array",
"i",
"stack.push(tmp)",
"stack.push",
"stack",
"tmp",
"System.out.println(stack.pop())",
"System.out.println",
"System.out",
"System",
"System.out",
"stack.pop()",
"stack.pop",
"stack",
"String[] args",
"args",
"class Stack{\n\tint max;\n\tint ptr;\n\tint[] array;\n\n\tStack(int capacity){//?????????????????????\n\t\tmax=capacity;\n\t\tptr=0;\n\t\tarray=new int[max];\n\t}\n\n\tpublic void push(int p){\n\t\tif(ptr<=max)array[ptr++]=p;\n\t}//push????????????\n\n\tpublic int pop(){\n\t\tif(ptr>0)return array[--ptr];\n\t\telse return -1;\n\t}//pop????????????\n\n}//stack?????????",
"Stack",
"int max;",
"max",
"int ptr;",
"ptr",
"int[] array;",
"array",
"Stack(int capacity){//?????????????????????\n\t\tmax=capacity;\n\t\tptr=0;\n\t\tarray=new int[max];\n\t}",
"Stack",
"{//?????????????????????\n\t\tmax=capacity;\n\t\tptr=0;\n\t\tarray=new int[max];\n\t}",
"max=capacity",
"max",
"capacity",
"ptr=0",
"ptr",
"0",
"array=new int[max]",
"array",
"new int[max]",
"max",
"int capacity",
"capacity",
"public void push(int p){\n\t\tif(ptr<=max)array[ptr++]=p;\n\t}//push????????????",
"push",
"{\n\t\tif(ptr<=max)array[ptr++]=p;\n\t}",
"if(ptr<=max)array[ptr++]=p;",
"ptr<=max",
"ptr",
"max",
"array[ptr++]=p",
"array[ptr++]",
"array",
"ptr++",
"ptr",
"p",
"int p",
"p",
"public int pop(){\n\t\tif(ptr>0)return array[--ptr];\n\t\telse return -1;\n\t}//pop????????????",
"pop",
"{\n\t\tif(ptr>0)return array[--ptr];\n\t\telse return -1;\n\t}",
"if(ptr>0)return array[--ptr];\n\t\telse return -1;",
"ptr>0",
"ptr",
"0",
"return array[--ptr];",
"array[--ptr]",
"array",
"--ptr",
"ptr",
"return -1;",
"-1",
"1",
"public class Main{\n\n\n\n\n\tpublic static void main(String[] args){\n\n\t\tint len;\n\t\tString array[];\n\n\t\tBufferedReader reader=new BufferedReader(new InputStreamReader(System.in));\n\n\t\ttry{\n\t\tString str=reader.readLine();\n\t\tarray=str.split(\" \");\n\n\t\tlen=array.length;\n\n\t\tStack stack=new Stack(len);\n\t\tint tmp;\n\n\t\tfor(int i=0;i<len;i++){\n\t\t\tswitch(array[i]){\n\t\t\tcase\"+\":\n\t\t\t\ttmp=stack.pop()+stack.pop();\n\t\t\t\tstack.push(tmp);\n\t\t\t\tbreak;\n\t\t\tcase\"-\":\n\t\t\t\ttmp=stack.pop()-stack.pop();\n\t\t\t\tstack.push(-tmp);\n\t\t\t\tbreak;\n\t\t\tcase\"*\":\n\t\t\t\ttmp=stack.pop()*stack.pop();\n\t\t\t\tstack.push(tmp);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\ttmp=Integer.parseInt(array[i]);\n\t\t\t\tstack.push(tmp);\n\t\t\t}//swicth\n\n\t\t}//for\n\n\t\tSystem.out.println(stack.pop());\n\n\n\n\t\t}catch(IOException e){\n\n\t\t}\n\n\t}//main\n}",
"public class Main{\n\n\n\n\n\tpublic static void main(String[] args){\n\n\t\tint len;\n\t\tString array[];\n\n\t\tBufferedReader reader=new BufferedReader(new InputStreamReader(System.in));\n\n\t\ttry{\n\t\tString str=reader.readLine();\n\t\tarray=str.split(\" \");\n\n\t\tlen=array.length;\n\n\t\tStack stack=new Stack(len);\n\t\tint tmp;\n\n\t\tfor(int i=0;i<len;i++){\n\t\t\tswitch(array[i]){\n\t\t\tcase\"+\":\n\t\t\t\ttmp=stack.pop()+stack.pop();\n\t\t\t\tstack.push(tmp);\n\t\t\t\tbreak;\n\t\t\tcase\"-\":\n\t\t\t\ttmp=stack.pop()-stack.pop();\n\t\t\t\tstack.push(-tmp);\n\t\t\t\tbreak;\n\t\t\tcase\"*\":\n\t\t\t\ttmp=stack.pop()*stack.pop();\n\t\t\t\tstack.push(tmp);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\ttmp=Integer.parseInt(array[i]);\n\t\t\t\tstack.push(tmp);\n\t\t\t}//swicth\n\n\t\t}//for\n\n\t\tSystem.out.println(stack.pop());\n\n\n\n\t\t}catch(IOException e){\n\n\t\t}\n\n\t}//main\n}",
"Main"
] | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Main{
public static void main(String[] args){
int len;
String array[];
BufferedReader reader=new BufferedReader(new InputStreamReader(System.in));
try{
String str=reader.readLine();
array=str.split(" ");
len=array.length;
Stack stack=new Stack(len);
int tmp;
for(int i=0;i<len;i++){
switch(array[i]){
case"+":
tmp=stack.pop()+stack.pop();
stack.push(tmp);
break;
case"-":
tmp=stack.pop()-stack.pop();
stack.push(-tmp);
break;
case"*":
tmp=stack.pop()*stack.pop();
stack.push(tmp);
break;
default:
tmp=Integer.parseInt(array[i]);
stack.push(tmp);
}//swicth
}//for
System.out.println(stack.pop());
}catch(IOException e){
}
}//main
}
class Stack{
int max;
int ptr;
int[] array;
Stack(int capacity){//?????????????????????
max=capacity;
ptr=0;
array=new int[max];
}
public void push(int p){
if(ptr<=max)array[ptr++]=p;
}//push????????????
public int pop(){
if(ptr>0)return array[--ptr];
else return -1;
}//pop????????????
}//stack????????? |
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
20,
42,
4,
18,
13,
30,
41,
13,
4,
18,
13,
35,
13,
34,
17,
1,
0,
13,
4,
18,
13,
2,
4,
18,
13,
4,
18,
13,
4,
18,
13,
4,
18,
13,
3,
34,
17,
1,
0,
13,
4,
18,
13,
2,
2,
40,
17,
4,
18,
13,
4,
18,
13,
4,
18,
13,
4,
18,
13,
3,
34,
17,
1,
0,
13,
4,
18,
13,
2,
2,
17,
4,
18,
13,
4,
18,
13,
4,
18,
13,
4,
18,
13,
3,
34,
17,
1,
0,
13,
4,
18,
13,
2,
4,
18,
13,
4,
18,
13,
4,
18,
13,
4,
18,
13,
3,
4,
18,
13,
13,
41,
13,
4,
18,
13,
4,
18,
13,
14,
2,
13,
13,
30,
4,
18,
18,
13,
13,
13,
30,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
156,
8
],
[
156,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
12,
14
],
[
11,
15
],
[
15,
16
],
[
15,
17
],
[
11,
18
],
[
18,
19
],
[
19,
20
],
[
20,
21
],
[
18,
22
],
[
22,
23
],
[
23,
24
],
[
23,
25
],
[
25,
26
],
[
26,
27
],
[
22,
28
],
[
28,
29
],
[
28,
30
],
[
30,
31
],
[
30,
32
],
[
32,
33
],
[
33,
34
],
[
33,
35
],
[
35,
36
],
[
36,
37
],
[
35,
38
],
[
38,
39
],
[
39,
40
],
[
40,
41
],
[
39,
42
],
[
42,
43
],
[
43,
44
],
[
38,
45
],
[
45,
46
],
[
46,
47
],
[
45,
48
],
[
48,
49
],
[
49,
50
],
[
32,
51
],
[
28,
52
],
[
52,
53
],
[
52,
54
],
[
54,
55
],
[
55,
56
],
[
55,
57
],
[
57,
58
],
[
58,
59
],
[
57,
60
],
[
60,
61
],
[
61,
62
],
[
62,
63
],
[
61,
64
],
[
64,
65
],
[
65,
66
],
[
64,
67
],
[
67,
68
],
[
68,
69
],
[
60,
70
],
[
70,
71
],
[
71,
72
],
[
70,
73
],
[
73,
74
],
[
74,
75
],
[
54,
76
],
[
28,
77
],
[
77,
78
],
[
77,
79
],
[
79,
80
],
[
80,
81
],
[
80,
82
],
[
82,
83
],
[
83,
84
],
[
82,
85
],
[
85,
86
],
[
86,
87
],
[
86,
88
],
[
88,
89
],
[
89,
90
],
[
88,
91
],
[
91,
92
],
[
92,
93
],
[
85,
94
],
[
94,
95
],
[
95,
96
],
[
94,
97
],
[
97,
98
],
[
98,
99
],
[
79,
100
],
[
28,
101
],
[
101,
102
],
[
101,
103
],
[
103,
104
],
[
104,
105
],
[
104,
106
],
[
106,
107
],
[
107,
108
],
[
106,
109
],
[
109,
110
],
[
110,
111
],
[
111,
112
],
[
110,
113
],
[
113,
114
],
[
114,
115
],
[
109,
116
],
[
116,
117
],
[
117,
118
],
[
116,
119
],
[
119,
120
],
[
120,
121
],
[
103,
122
],
[
22,
123
],
[
123,
124
],
[
124,
125
],
[
123,
126
],
[
11,
127
],
[
127,
128
],
[
127,
129
],
[
129,
130
],
[
130,
131
],
[
129,
132
],
[
132,
133
],
[
133,
134
],
[
11,
135
],
[
135,
136
],
[
136,
137
],
[
136,
138
],
[
135,
139
],
[
139,
140
],
[
140,
141
],
[
141,
142
],
[
142,
143
],
[
142,
144
],
[
140,
145
],
[
135,
146
],
[
146,
147
],
[
147,
148
],
[
148,
149
],
[
149,
150
],
[
149,
151
],
[
147,
152
],
[
9,
153
],
[
153,
154
],
[
0,
155
],
[
155,
156
],
[
155,
157
]
] | [
"import java.io.*;\nimport java.util.*;\npublic class Main{\n public static void main(String[] args){\n Deque<String> formula = new ArrayDeque<String>();\n Scanner scan = new Scanner(System.in);\n while(scan.hasNext()){\n String input = scan.next();\n switch(input){\n case \"+\":\n input = String.valueOf(Double.parseDouble(formula.poll())+Double.parseDouble(formula.poll()));\n break;\n case \"-\":\n input = String.valueOf(-1*Double.parseDouble(formula.poll())+Double.parseDouble(formula.poll())); \n break;\n case \"/\":\n input = String.valueOf(1.0/Double.parseDouble(formula.poll())*Double.parseDouble(formula.poll()));\n break;\n case \"*\":\n input = String.valueOf(Double.parseDouble(formula.poll())*Double.parseDouble(formula.poll()));\n break;\n }\n formula.push(input);\n }\n double ans = Double.parseDouble(formula.poll());\n if(ans==(int)ans){\n System.out.println((int)ans);\n }else{\n System.out.println(ans);\n }\n }\n}",
"import java.io.*;",
"io.*",
"java",
"import java.util.*;",
"util.*",
"java",
"public class Main{\n public static void main(String[] args){\n Deque<String> formula = new ArrayDeque<String>();\n Scanner scan = new Scanner(System.in);\n while(scan.hasNext()){\n String input = scan.next();\n switch(input){\n case \"+\":\n input = String.valueOf(Double.parseDouble(formula.poll())+Double.parseDouble(formula.poll()));\n break;\n case \"-\":\n input = String.valueOf(-1*Double.parseDouble(formula.poll())+Double.parseDouble(formula.poll())); \n break;\n case \"/\":\n input = String.valueOf(1.0/Double.parseDouble(formula.poll())*Double.parseDouble(formula.poll()));\n break;\n case \"*\":\n input = String.valueOf(Double.parseDouble(formula.poll())*Double.parseDouble(formula.poll()));\n break;\n }\n formula.push(input);\n }\n double ans = Double.parseDouble(formula.poll());\n if(ans==(int)ans){\n System.out.println((int)ans);\n }else{\n System.out.println(ans);\n }\n }\n}",
"Main",
"public static void main(String[] args){\n Deque<String> formula = new ArrayDeque<String>();\n Scanner scan = new Scanner(System.in);\n while(scan.hasNext()){\n String input = scan.next();\n switch(input){\n case \"+\":\n input = String.valueOf(Double.parseDouble(formula.poll())+Double.parseDouble(formula.poll()));\n break;\n case \"-\":\n input = String.valueOf(-1*Double.parseDouble(formula.poll())+Double.parseDouble(formula.poll())); \n break;\n case \"/\":\n input = String.valueOf(1.0/Double.parseDouble(formula.poll())*Double.parseDouble(formula.poll()));\n break;\n case \"*\":\n input = String.valueOf(Double.parseDouble(formula.poll())*Double.parseDouble(formula.poll()));\n break;\n }\n formula.push(input);\n }\n double ans = Double.parseDouble(formula.poll());\n if(ans==(int)ans){\n System.out.println((int)ans);\n }else{\n System.out.println(ans);\n }\n }",
"main",
"{\n Deque<String> formula = new ArrayDeque<String>();\n Scanner scan = new Scanner(System.in);\n while(scan.hasNext()){\n String input = scan.next();\n switch(input){\n case \"+\":\n input = String.valueOf(Double.parseDouble(formula.poll())+Double.parseDouble(formula.poll()));\n break;\n case \"-\":\n input = String.valueOf(-1*Double.parseDouble(formula.poll())+Double.parseDouble(formula.poll())); \n break;\n case \"/\":\n input = String.valueOf(1.0/Double.parseDouble(formula.poll())*Double.parseDouble(formula.poll()));\n break;\n case \"*\":\n input = String.valueOf(Double.parseDouble(formula.poll())*Double.parseDouble(formula.poll()));\n break;\n }\n formula.push(input);\n }\n double ans = Double.parseDouble(formula.poll());\n if(ans==(int)ans){\n System.out.println((int)ans);\n }else{\n System.out.println(ans);\n }\n }",
"Deque<String> formula = new ArrayDeque<String>();",
"formula",
"new ArrayDeque<String>()",
"Scanner scan = new Scanner(System.in);",
"scan",
"new Scanner(System.in)",
"while(scan.hasNext()){\n String input = scan.next();\n switch(input){\n case \"+\":\n input = String.valueOf(Double.parseDouble(formula.poll())+Double.parseDouble(formula.poll()));\n break;\n case \"-\":\n input = String.valueOf(-1*Double.parseDouble(formula.poll())+Double.parseDouble(formula.poll())); \n break;\n case \"/\":\n input = String.valueOf(1.0/Double.parseDouble(formula.poll())*Double.parseDouble(formula.poll()));\n break;\n case \"*\":\n input = String.valueOf(Double.parseDouble(formula.poll())*Double.parseDouble(formula.poll()));\n break;\n }\n formula.push(input);\n }",
"scan.hasNext()",
"scan.hasNext",
"scan",
"{\n String input = scan.next();\n switch(input){\n case \"+\":\n input = String.valueOf(Double.parseDouble(formula.poll())+Double.parseDouble(formula.poll()));\n break;\n case \"-\":\n input = String.valueOf(-1*Double.parseDouble(formula.poll())+Double.parseDouble(formula.poll())); \n break;\n case \"/\":\n input = String.valueOf(1.0/Double.parseDouble(formula.poll())*Double.parseDouble(formula.poll()));\n break;\n case \"*\":\n input = String.valueOf(Double.parseDouble(formula.poll())*Double.parseDouble(formula.poll()));\n break;\n }\n formula.push(input);\n }",
"String input = scan.next();",
"input",
"scan.next()",
"scan.next",
"scan",
"switch(input){\n case \"+\":\n input = String.valueOf(Double.parseDouble(formula.poll())+Double.parseDouble(formula.poll()));\n break;\n case \"-\":\n input = String.valueOf(-1*Double.parseDouble(formula.poll())+Double.parseDouble(formula.poll())); \n break;\n case \"/\":\n input = String.valueOf(1.0/Double.parseDouble(formula.poll())*Double.parseDouble(formula.poll()));\n break;\n case \"*\":\n input = String.valueOf(Double.parseDouble(formula.poll())*Double.parseDouble(formula.poll()));\n break;\n }",
"input",
"case \"+\":",
"\"+\"",
"case \"+\":",
"input = String.valueOf(Double.parseDouble(formula.poll())+Double.parseDouble(formula.poll()))",
"input",
"String.valueOf(Double.parseDouble(formula.poll())+Double.parseDouble(formula.poll()))",
"String.valueOf",
"String",
"Double.parseDouble(formula.poll())+Double.parseDouble(formula.poll())",
"Double.parseDouble(formula.poll())",
"Double.parseDouble",
"Double",
"formula.poll()",
"formula.poll",
"formula",
"Double.parseDouble(formula.poll())",
"Double.parseDouble",
"Double",
"formula.poll()",
"formula.poll",
"formula",
"break;",
"case \"-\":",
"\"-\"",
"case \"-\":",
"input = String.valueOf(-1*Double.parseDouble(formula.poll())+Double.parseDouble(formula.poll()))",
"input",
"String.valueOf(-1*Double.parseDouble(formula.poll())+Double.parseDouble(formula.poll()))",
"String.valueOf",
"String",
"-1*Double.parseDouble(formula.poll())+Double.parseDouble(formula.poll())",
"-1*Double.parseDouble(formula.poll())",
"-1",
"1",
"Double.parseDouble(formula.poll())",
"Double.parseDouble",
"Double",
"formula.poll()",
"formula.poll",
"formula",
"Double.parseDouble(formula.poll())",
"Double.parseDouble",
"Double",
"formula.poll()",
"formula.poll",
"formula",
"break;",
"case \"/\":",
"\"/\"",
"case \"/\":",
"input = String.valueOf(1.0/Double.parseDouble(formula.poll())*Double.parseDouble(formula.poll()))",
"input",
"String.valueOf(1.0/Double.parseDouble(formula.poll())*Double.parseDouble(formula.poll()))",
"String.valueOf",
"String",
"1.0/Double.parseDouble(formula.poll())*Double.parseDouble(formula.poll())",
"1.0/Double.parseDouble(formula.poll())",
"1.0",
"Double.parseDouble(formula.poll())",
"Double.parseDouble",
"Double",
"formula.poll()",
"formula.poll",
"formula",
"Double.parseDouble(formula.poll())",
"Double.parseDouble",
"Double",
"formula.poll()",
"formula.poll",
"formula",
"break;",
"case \"*\":",
"\"*\"",
"case \"*\":",
"input = String.valueOf(Double.parseDouble(formula.poll())*Double.parseDouble(formula.poll()))",
"input",
"String.valueOf(Double.parseDouble(formula.poll())*Double.parseDouble(formula.poll()))",
"String.valueOf",
"String",
"Double.parseDouble(formula.poll())*Double.parseDouble(formula.poll())",
"Double.parseDouble(formula.poll())",
"Double.parseDouble",
"Double",
"formula.poll()",
"formula.poll",
"formula",
"Double.parseDouble(formula.poll())",
"Double.parseDouble",
"Double",
"formula.poll()",
"formula.poll",
"formula",
"break;",
"formula.push(input)",
"formula.push",
"formula",
"input",
"double ans = Double.parseDouble(formula.poll());",
"ans",
"Double.parseDouble(formula.poll())",
"Double.parseDouble",
"Double",
"formula.poll()",
"formula.poll",
"formula",
"if(ans==(int)ans){\n System.out.println((int)ans);\n }else{\n System.out.println(ans);\n }",
"ans==(int)ans",
"ans",
"(int)ans",
"{\n System.out.println((int)ans);\n }",
"System.out.println((int)ans)",
"System.out.println",
"System.out",
"System",
"System.out",
"(int)ans",
"{\n System.out.println(ans);\n }",
"System.out.println(ans)",
"System.out.println",
"System.out",
"System",
"System.out",
"ans",
"String[] args",
"args",
"public class Main{\n public static void main(String[] args){\n Deque<String> formula = new ArrayDeque<String>();\n Scanner scan = new Scanner(System.in);\n while(scan.hasNext()){\n String input = scan.next();\n switch(input){\n case \"+\":\n input = String.valueOf(Double.parseDouble(formula.poll())+Double.parseDouble(formula.poll()));\n break;\n case \"-\":\n input = String.valueOf(-1*Double.parseDouble(formula.poll())+Double.parseDouble(formula.poll())); \n break;\n case \"/\":\n input = String.valueOf(1.0/Double.parseDouble(formula.poll())*Double.parseDouble(formula.poll()));\n break;\n case \"*\":\n input = String.valueOf(Double.parseDouble(formula.poll())*Double.parseDouble(formula.poll()));\n break;\n }\n formula.push(input);\n }\n double ans = Double.parseDouble(formula.poll());\n if(ans==(int)ans){\n System.out.println((int)ans);\n }else{\n System.out.println(ans);\n }\n }\n}",
"public class Main{\n public static void main(String[] args){\n Deque<String> formula = new ArrayDeque<String>();\n Scanner scan = new Scanner(System.in);\n while(scan.hasNext()){\n String input = scan.next();\n switch(input){\n case \"+\":\n input = String.valueOf(Double.parseDouble(formula.poll())+Double.parseDouble(formula.poll()));\n break;\n case \"-\":\n input = String.valueOf(-1*Double.parseDouble(formula.poll())+Double.parseDouble(formula.poll())); \n break;\n case \"/\":\n input = String.valueOf(1.0/Double.parseDouble(formula.poll())*Double.parseDouble(formula.poll()));\n break;\n case \"*\":\n input = String.valueOf(Double.parseDouble(formula.poll())*Double.parseDouble(formula.poll()));\n break;\n }\n formula.push(input);\n }\n double ans = Double.parseDouble(formula.poll());\n if(ans==(int)ans){\n System.out.println((int)ans);\n }else{\n System.out.println(ans);\n }\n }\n}",
"Main"
] | import java.io.*;
import java.util.*;
public class Main{
public static void main(String[] args){
Deque<String> formula = new ArrayDeque<String>();
Scanner scan = new Scanner(System.in);
while(scan.hasNext()){
String input = scan.next();
switch(input){
case "+":
input = String.valueOf(Double.parseDouble(formula.poll())+Double.parseDouble(formula.poll()));
break;
case "-":
input = String.valueOf(-1*Double.parseDouble(formula.poll())+Double.parseDouble(formula.poll()));
break;
case "/":
input = String.valueOf(1.0/Double.parseDouble(formula.poll())*Double.parseDouble(formula.poll()));
break;
case "*":
input = String.valueOf(Double.parseDouble(formula.poll())*Double.parseDouble(formula.poll()));
break;
}
formula.push(input);
}
double ans = Double.parseDouble(formula.poll());
if(ans==(int)ans){
System.out.println((int)ans);
}else{
System.out.println(ans);
}
}
} |
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
20,
42,
4,
18,
13,
30,
41,
13,
4,
18,
13,
14,
4,
18,
13,
17,
0,
13,
4,
18,
13,
2,
4,
18,
13,
4,
18,
13,
4,
18,
13,
4,
18,
13,
14,
4,
18,
13,
17,
0,
13,
4,
18,
13,
2,
2,
40,
17,
4,
18,
13,
4,
18,
13,
4,
18,
13,
4,
18,
13,
14,
4,
18,
13,
17,
0,
13,
4,
18,
13,
2,
4,
18,
13,
4,
18,
13,
4,
18,
13,
4,
18,
13,
4,
18,
13,
13,
4,
18,
18,
13,
13,
4,
18,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
115,
8
],
[
115,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
12,
14
],
[
11,
15
],
[
15,
16
],
[
15,
17
],
[
11,
18
],
[
18,
19
],
[
19,
20
],
[
20,
21
],
[
18,
22
],
[
22,
23
],
[
23,
24
],
[
23,
25
],
[
25,
26
],
[
26,
27
],
[
22,
28
],
[
28,
29
],
[
29,
30
],
[
30,
31
],
[
29,
32
],
[
28,
33
],
[
33,
34
],
[
33,
35
],
[
35,
36
],
[
36,
37
],
[
35,
38
],
[
38,
39
],
[
39,
40
],
[
40,
41
],
[
39,
42
],
[
42,
43
],
[
43,
44
],
[
38,
45
],
[
45,
46
],
[
46,
47
],
[
45,
48
],
[
48,
49
],
[
49,
50
],
[
28,
51
],
[
51,
52
],
[
52,
53
],
[
53,
54
],
[
52,
55
],
[
51,
56
],
[
56,
57
],
[
56,
58
],
[
58,
59
],
[
59,
60
],
[
58,
61
],
[
61,
62
],
[
62,
63
],
[
63,
64
],
[
62,
65
],
[
65,
66
],
[
66,
67
],
[
65,
68
],
[
68,
69
],
[
69,
70
],
[
61,
71
],
[
71,
72
],
[
72,
73
],
[
71,
74
],
[
74,
75
],
[
75,
76
],
[
51,
77
],
[
77,
78
],
[
78,
79
],
[
79,
80
],
[
78,
81
],
[
77,
82
],
[
82,
83
],
[
82,
84
],
[
84,
85
],
[
85,
86
],
[
84,
87
],
[
87,
88
],
[
88,
89
],
[
89,
90
],
[
88,
91
],
[
91,
92
],
[
92,
93
],
[
87,
94
],
[
94,
95
],
[
95,
96
],
[
94,
97
],
[
97,
98
],
[
98,
99
],
[
22,
100
],
[
100,
101
],
[
101,
102
],
[
100,
103
],
[
11,
104
],
[
104,
105
],
[
105,
106
],
[
106,
107
],
[
106,
108
],
[
104,
109
],
[
109,
110
],
[
110,
111
],
[
9,
112
],
[
112,
113
],
[
0,
114
],
[
114,
115
],
[
114,
116
]
] | [
"import java.io.*;\nimport java.util.*;\npublic class Main{\n public static void main(String[] args){\n Deque<String> formula = new ArrayDeque<String>();\n Scanner scan = new Scanner(System.in);\n while(scan.hasNext()){\n String input = scan.next();\n if(input.equals(\"+\")) input = String.valueOf(Integer.parseInt(formula.poll())+Integer.parseInt(formula.poll()));\n else if(input.equals(\"-\")) input = String.valueOf(-1*Integer.parseInt(formula.poll())+Integer.parseInt(formula.poll()));\n else if(input.equals(\"*\")) input = String.valueOf(Integer.parseInt(formula.poll())*Integer.parseInt(formula.poll()));\n formula.push(input);\n }\n System.out.println(formula.poll());\n }\n}",
"import java.io.*;",
"io.*",
"java",
"import java.util.*;",
"util.*",
"java",
"public class Main{\n public static void main(String[] args){\n Deque<String> formula = new ArrayDeque<String>();\n Scanner scan = new Scanner(System.in);\n while(scan.hasNext()){\n String input = scan.next();\n if(input.equals(\"+\")) input = String.valueOf(Integer.parseInt(formula.poll())+Integer.parseInt(formula.poll()));\n else if(input.equals(\"-\")) input = String.valueOf(-1*Integer.parseInt(formula.poll())+Integer.parseInt(formula.poll()));\n else if(input.equals(\"*\")) input = String.valueOf(Integer.parseInt(formula.poll())*Integer.parseInt(formula.poll()));\n formula.push(input);\n }\n System.out.println(formula.poll());\n }\n}",
"Main",
"public static void main(String[] args){\n Deque<String> formula = new ArrayDeque<String>();\n Scanner scan = new Scanner(System.in);\n while(scan.hasNext()){\n String input = scan.next();\n if(input.equals(\"+\")) input = String.valueOf(Integer.parseInt(formula.poll())+Integer.parseInt(formula.poll()));\n else if(input.equals(\"-\")) input = String.valueOf(-1*Integer.parseInt(formula.poll())+Integer.parseInt(formula.poll()));\n else if(input.equals(\"*\")) input = String.valueOf(Integer.parseInt(formula.poll())*Integer.parseInt(formula.poll()));\n formula.push(input);\n }\n System.out.println(formula.poll());\n }",
"main",
"{\n Deque<String> formula = new ArrayDeque<String>();\n Scanner scan = new Scanner(System.in);\n while(scan.hasNext()){\n String input = scan.next();\n if(input.equals(\"+\")) input = String.valueOf(Integer.parseInt(formula.poll())+Integer.parseInt(formula.poll()));\n else if(input.equals(\"-\")) input = String.valueOf(-1*Integer.parseInt(formula.poll())+Integer.parseInt(formula.poll()));\n else if(input.equals(\"*\")) input = String.valueOf(Integer.parseInt(formula.poll())*Integer.parseInt(formula.poll()));\n formula.push(input);\n }\n System.out.println(formula.poll());\n }",
"Deque<String> formula = new ArrayDeque<String>();",
"formula",
"new ArrayDeque<String>()",
"Scanner scan = new Scanner(System.in);",
"scan",
"new Scanner(System.in)",
"while(scan.hasNext()){\n String input = scan.next();\n if(input.equals(\"+\")) input = String.valueOf(Integer.parseInt(formula.poll())+Integer.parseInt(formula.poll()));\n else if(input.equals(\"-\")) input = String.valueOf(-1*Integer.parseInt(formula.poll())+Integer.parseInt(formula.poll()));\n else if(input.equals(\"*\")) input = String.valueOf(Integer.parseInt(formula.poll())*Integer.parseInt(formula.poll()));\n formula.push(input);\n }",
"scan.hasNext()",
"scan.hasNext",
"scan",
"{\n String input = scan.next();\n if(input.equals(\"+\")) input = String.valueOf(Integer.parseInt(formula.poll())+Integer.parseInt(formula.poll()));\n else if(input.equals(\"-\")) input = String.valueOf(-1*Integer.parseInt(formula.poll())+Integer.parseInt(formula.poll()));\n else if(input.equals(\"*\")) input = String.valueOf(Integer.parseInt(formula.poll())*Integer.parseInt(formula.poll()));\n formula.push(input);\n }",
"String input = scan.next();",
"input",
"scan.next()",
"scan.next",
"scan",
"if(input.equals(\"+\")) input = String.valueOf(Integer.parseInt(formula.poll())+Integer.parseInt(formula.poll()));\n else if(input.equals(\"-\")) input = String.valueOf(-1*Integer.parseInt(formula.poll())+Integer.parseInt(formula.poll()));\n else if(input.equals(\"*\")) input = String.valueOf(Integer.parseInt(formula.poll())*Integer.parseInt(formula.poll()));",
"input.equals(\"+\")",
"input.equals",
"input",
"\"+\"",
"input = String.valueOf(Integer.parseInt(formula.poll())+Integer.parseInt(formula.poll()))",
"input",
"String.valueOf(Integer.parseInt(formula.poll())+Integer.parseInt(formula.poll()))",
"String.valueOf",
"String",
"Integer.parseInt(formula.poll())+Integer.parseInt(formula.poll())",
"Integer.parseInt(formula.poll())",
"Integer.parseInt",
"Integer",
"formula.poll()",
"formula.poll",
"formula",
"Integer.parseInt(formula.poll())",
"Integer.parseInt",
"Integer",
"formula.poll()",
"formula.poll",
"formula",
"if(input.equals(\"-\")) input = String.valueOf(-1*Integer.parseInt(formula.poll())+Integer.parseInt(formula.poll()));\n else if(input.equals(\"*\")) input = String.valueOf(Integer.parseInt(formula.poll())*Integer.parseInt(formula.poll()));",
"input.equals(\"-\")",
"input.equals",
"input",
"\"-\"",
"input = String.valueOf(-1*Integer.parseInt(formula.poll())+Integer.parseInt(formula.poll()))",
"input",
"String.valueOf(-1*Integer.parseInt(formula.poll())+Integer.parseInt(formula.poll()))",
"String.valueOf",
"String",
"-1*Integer.parseInt(formula.poll())+Integer.parseInt(formula.poll())",
"-1*Integer.parseInt(formula.poll())",
"-1",
"1",
"Integer.parseInt(formula.poll())",
"Integer.parseInt",
"Integer",
"formula.poll()",
"formula.poll",
"formula",
"Integer.parseInt(formula.poll())",
"Integer.parseInt",
"Integer",
"formula.poll()",
"formula.poll",
"formula",
"if(input.equals(\"*\")) input = String.valueOf(Integer.parseInt(formula.poll())*Integer.parseInt(formula.poll()));",
"input.equals(\"*\")",
"input.equals",
"input",
"\"*\"",
"input = String.valueOf(Integer.parseInt(formula.poll())*Integer.parseInt(formula.poll()))",
"input",
"String.valueOf(Integer.parseInt(formula.poll())*Integer.parseInt(formula.poll()))",
"String.valueOf",
"String",
"Integer.parseInt(formula.poll())*Integer.parseInt(formula.poll())",
"Integer.parseInt(formula.poll())",
"Integer.parseInt",
"Integer",
"formula.poll()",
"formula.poll",
"formula",
"Integer.parseInt(formula.poll())",
"Integer.parseInt",
"Integer",
"formula.poll()",
"formula.poll",
"formula",
"formula.push(input)",
"formula.push",
"formula",
"input",
"System.out.println(formula.poll())",
"System.out.println",
"System.out",
"System",
"System.out",
"formula.poll()",
"formula.poll",
"formula",
"String[] args",
"args",
"public class Main{\n public static void main(String[] args){\n Deque<String> formula = new ArrayDeque<String>();\n Scanner scan = new Scanner(System.in);\n while(scan.hasNext()){\n String input = scan.next();\n if(input.equals(\"+\")) input = String.valueOf(Integer.parseInt(formula.poll())+Integer.parseInt(formula.poll()));\n else if(input.equals(\"-\")) input = String.valueOf(-1*Integer.parseInt(formula.poll())+Integer.parseInt(formula.poll()));\n else if(input.equals(\"*\")) input = String.valueOf(Integer.parseInt(formula.poll())*Integer.parseInt(formula.poll()));\n formula.push(input);\n }\n System.out.println(formula.poll());\n }\n}",
"public class Main{\n public static void main(String[] args){\n Deque<String> formula = new ArrayDeque<String>();\n Scanner scan = new Scanner(System.in);\n while(scan.hasNext()){\n String input = scan.next();\n if(input.equals(\"+\")) input = String.valueOf(Integer.parseInt(formula.poll())+Integer.parseInt(formula.poll()));\n else if(input.equals(\"-\")) input = String.valueOf(-1*Integer.parseInt(formula.poll())+Integer.parseInt(formula.poll()));\n else if(input.equals(\"*\")) input = String.valueOf(Integer.parseInt(formula.poll())*Integer.parseInt(formula.poll()));\n formula.push(input);\n }\n System.out.println(formula.poll());\n }\n}",
"Main"
] | import java.io.*;
import java.util.*;
public class Main{
public static void main(String[] args){
Deque<String> formula = new ArrayDeque<String>();
Scanner scan = new Scanner(System.in);
while(scan.hasNext()){
String input = scan.next();
if(input.equals("+")) input = String.valueOf(Integer.parseInt(formula.poll())+Integer.parseInt(formula.poll()));
else if(input.equals("-")) input = String.valueOf(-1*Integer.parseInt(formula.poll())+Integer.parseInt(formula.poll()));
else if(input.equals("*")) input = String.valueOf(Integer.parseInt(formula.poll())*Integer.parseInt(formula.poll()));
formula.push(input);
}
System.out.println(formula.poll());
}
} |
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
4,
18,
13,
17,
41,
13,
20,
41,
13,
17,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
30,
14,
4,
18,
18,
13,
13,
17,
30,
0,
13,
4,
18,
13,
0,
13,
4,
18,
13,
4,
18,
13,
2,
13,
13,
14,
4,
18,
18,
13,
13,
17,
30,
0,
13,
4,
18,
13,
0,
13,
4,
18,
13,
4,
18,
13,
2,
13,
13,
14,
4,
18,
18,
13,
13,
17,
30,
0,
13,
4,
18,
13,
0,
13,
4,
18,
13,
4,
18,
13,
2,
13,
13,
30,
4,
18,
13,
4,
18,
13,
18,
13,
13,
4,
18,
18,
13,
13,
4,
18,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
10,
11
],
[
10,
12
],
[
0,
13
],
[
13,
14
],
[
13,
15
],
[
0,
16
],
[
149,
17
],
[
149,
18
],
[
18,
19
],
[
18,
20
],
[
20,
21
],
[
21,
22
],
[
21,
23
],
[
20,
24
],
[
24,
25
],
[
24,
26
],
[
26,
27
],
[
27,
28
],
[
28,
29
],
[
29,
30
],
[
26,
31
],
[
20,
32
],
[
32,
33
],
[
32,
34
],
[
20,
35
],
[
35,
36
],
[
35,
37
],
[
20,
38
],
[
38,
39
],
[
38,
40
],
[
20,
41
],
[
41,
42
],
[
42,
43
],
[
43,
44
],
[
43,
45
],
[
41,
46
],
[
46,
47
],
[
46,
48
],
[
48,
49
],
[
48,
50
],
[
41,
51
],
[
51,
52
],
[
52,
53
],
[
41,
54
],
[
55,
55
],
[
55,
56
],
[
56,
57
],
[
57,
58
],
[
58,
59
],
[
59,
60
],
[
59,
61
],
[
57,
62
],
[
56,
63
],
[
63,
64
],
[
64,
65
],
[
64,
66
],
[
66,
67
],
[
67,
68
],
[
63,
69
],
[
69,
70
],
[
69,
71
],
[
71,
72
],
[
72,
73
],
[
63,
74
],
[
74,
75
],
[
75,
76
],
[
74,
77
],
[
77,
78
],
[
77,
79
],
[
56,
80
],
[
80,
81
],
[
81,
82
],
[
82,
83
],
[
83,
84
],
[
83,
85
],
[
81,
86
],
[
80,
87
],
[
87,
88
],
[
88,
89
],
[
88,
90
],
[
90,
91
],
[
91,
92
],
[
87,
93
],
[
93,
94
],
[
93,
95
],
[
95,
96
],
[
96,
97
],
[
87,
98
],
[
98,
99
],
[
99,
100
],
[
98,
101
],
[
101,
102
],
[
101,
103
],
[
80,
104
],
[
104,
105
],
[
105,
106
],
[
106,
107
],
[
107,
108
],
[
107,
109
],
[
105,
110
],
[
104,
111
],
[
111,
112
],
[
112,
113
],
[
112,
114
],
[
114,
115
],
[
115,
116
],
[
111,
117
],
[
117,
118
],
[
117,
119
],
[
119,
120
],
[
120,
121
],
[
111,
122
],
[
122,
123
],
[
123,
124
],
[
122,
125
],
[
125,
126
],
[
125,
127
],
[
104,
128
],
[
128,
129
],
[
129,
130
],
[
130,
131
],
[
129,
132
],
[
132,
133
],
[
133,
134
],
[
132,
135
],
[
135,
136
],
[
135,
137
],
[
20,
138
],
[
138,
139
],
[
139,
140
],
[
140,
141
],
[
140,
142
],
[
138,
143
],
[
143,
144
],
[
144,
145
],
[
18,
146
],
[
146,
147
],
[
0,
148
],
[
148,
149
],
[
148,
150
]
] | [
"import java.util.ArrayDeque;\nimport java.util.Arrays;\nimport java.util.Deque;\nimport java.util.Scanner;\nimport java.util.Stack;\n\npublic class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n String[] line = sc.nextLine().split(\" \");\n Stack<Integer> stack = new Stack<Integer>();\n int a=0,b=0;\n for(int i=0; i<line.length; i++){\n if(line[i].equals(\"+\")) {\n a = stack.pop();\n b = stack.pop();\n stack.push(b+a);\n } else if (line[i].equals(\"-\")) {\n a = stack.pop();\n b = stack.pop();\n stack.push(b-a);\n } else if (line[i].equals(\"*\")) {\n a = stack.pop();\n b = stack.pop();\n stack.push(b*a);\n } else {\n stack.push(Integer.parseInt(line[i]));\n }\n }\n System.out.println(stack.pop());\n }\n}\n",
"import java.util.ArrayDeque;",
"ArrayDeque",
"java.util",
"import java.util.Arrays;",
"Arrays",
"java.util",
"import java.util.Deque;",
"Deque",
"java.util",
"import java.util.Scanner;",
"Scanner",
"java.util",
"import java.util.Stack;",
"Stack",
"java.util",
"public class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n String[] line = sc.nextLine().split(\" \");\n Stack<Integer> stack = new Stack<Integer>();\n int a=0,b=0;\n for(int i=0; i<line.length; i++){\n if(line[i].equals(\"+\")) {\n a = stack.pop();\n b = stack.pop();\n stack.push(b+a);\n } else if (line[i].equals(\"-\")) {\n a = stack.pop();\n b = stack.pop();\n stack.push(b-a);\n } else if (line[i].equals(\"*\")) {\n a = stack.pop();\n b = stack.pop();\n stack.push(b*a);\n } else {\n stack.push(Integer.parseInt(line[i]));\n }\n }\n System.out.println(stack.pop());\n }\n}",
"Main",
"public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n String[] line = sc.nextLine().split(\" \");\n Stack<Integer> stack = new Stack<Integer>();\n int a=0,b=0;\n for(int i=0; i<line.length; i++){\n if(line[i].equals(\"+\")) {\n a = stack.pop();\n b = stack.pop();\n stack.push(b+a);\n } else if (line[i].equals(\"-\")) {\n a = stack.pop();\n b = stack.pop();\n stack.push(b-a);\n } else if (line[i].equals(\"*\")) {\n a = stack.pop();\n b = stack.pop();\n stack.push(b*a);\n } else {\n stack.push(Integer.parseInt(line[i]));\n }\n }\n System.out.println(stack.pop());\n }",
"main",
"{\n Scanner sc = new Scanner(System.in);\n String[] line = sc.nextLine().split(\" \");\n Stack<Integer> stack = new Stack<Integer>();\n int a=0,b=0;\n for(int i=0; i<line.length; i++){\n if(line[i].equals(\"+\")) {\n a = stack.pop();\n b = stack.pop();\n stack.push(b+a);\n } else if (line[i].equals(\"-\")) {\n a = stack.pop();\n b = stack.pop();\n stack.push(b-a);\n } else if (line[i].equals(\"*\")) {\n a = stack.pop();\n b = stack.pop();\n stack.push(b*a);\n } else {\n stack.push(Integer.parseInt(line[i]));\n }\n }\n System.out.println(stack.pop());\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"String[] line = sc.nextLine().split(\" \");",
"line",
"sc.nextLine().split(\" \")",
"sc.nextLine().split",
"sc.nextLine()",
"sc.nextLine",
"sc",
"\" \"",
"Stack<Integer> stack = new Stack<Integer>();",
"stack",
"new Stack<Integer>()",
"int a=0",
"a",
"0",
"b=0;",
"b",
"0",
"for(int i=0; i<line.length; i++){\n if(line[i].equals(\"+\")) {\n a = stack.pop();\n b = stack.pop();\n stack.push(b+a);\n } else if (line[i].equals(\"-\")) {\n a = stack.pop();\n b = stack.pop();\n stack.push(b-a);\n } else if (line[i].equals(\"*\")) {\n a = stack.pop();\n b = stack.pop();\n stack.push(b*a);\n } else {\n stack.push(Integer.parseInt(line[i]));\n }\n }",
"int i=0;",
"int i=0;",
"i",
"0",
"i<line.length",
"i",
"line.length",
"line",
"line.length",
"i++",
"i++",
"i",
"{\n if(line[i].equals(\"+\")) {\n a = stack.pop();\n b = stack.pop();\n stack.push(b+a);\n } else if (line[i].equals(\"-\")) {\n a = stack.pop();\n b = stack.pop();\n stack.push(b-a);\n } else if (line[i].equals(\"*\")) {\n a = stack.pop();\n b = stack.pop();\n stack.push(b*a);\n } else {\n stack.push(Integer.parseInt(line[i]));\n }\n }",
"{\n if(line[i].equals(\"+\")) {\n a = stack.pop();\n b = stack.pop();\n stack.push(b+a);\n } else if (line[i].equals(\"-\")) {\n a = stack.pop();\n b = stack.pop();\n stack.push(b-a);\n } else if (line[i].equals(\"*\")) {\n a = stack.pop();\n b = stack.pop();\n stack.push(b*a);\n } else {\n stack.push(Integer.parseInt(line[i]));\n }\n }",
"if(line[i].equals(\"+\")) {\n a = stack.pop();\n b = stack.pop();\n stack.push(b+a);\n } else if (line[i].equals(\"-\")) {\n a = stack.pop();\n b = stack.pop();\n stack.push(b-a);\n } else if (line[i].equals(\"*\")) {\n a = stack.pop();\n b = stack.pop();\n stack.push(b*a);\n } else {\n stack.push(Integer.parseInt(line[i]));\n }",
"line[i].equals(\"+\")",
"line[i].equals",
"line[i]",
"line",
"i",
"\"+\"",
"{\n a = stack.pop();\n b = stack.pop();\n stack.push(b+a);\n }",
"a = stack.pop()",
"a",
"stack.pop()",
"stack.pop",
"stack",
"b = stack.pop()",
"b",
"stack.pop()",
"stack.pop",
"stack",
"stack.push(b+a)",
"stack.push",
"stack",
"b+a",
"b",
"a",
"if (line[i].equals(\"-\")) {\n a = stack.pop();\n b = stack.pop();\n stack.push(b-a);\n } else if (line[i].equals(\"*\")) {\n a = stack.pop();\n b = stack.pop();\n stack.push(b*a);\n } else {\n stack.push(Integer.parseInt(line[i]));\n }",
"line[i].equals(\"-\")",
"line[i].equals",
"line[i]",
"line",
"i",
"\"-\"",
"{\n a = stack.pop();\n b = stack.pop();\n stack.push(b-a);\n }",
"a = stack.pop()",
"a",
"stack.pop()",
"stack.pop",
"stack",
"b = stack.pop()",
"b",
"stack.pop()",
"stack.pop",
"stack",
"stack.push(b-a)",
"stack.push",
"stack",
"b-a",
"b",
"a",
"if (line[i].equals(\"*\")) {\n a = stack.pop();\n b = stack.pop();\n stack.push(b*a);\n } else {\n stack.push(Integer.parseInt(line[i]));\n }",
"line[i].equals(\"*\")",
"line[i].equals",
"line[i]",
"line",
"i",
"\"*\"",
"{\n a = stack.pop();\n b = stack.pop();\n stack.push(b*a);\n }",
"a = stack.pop()",
"a",
"stack.pop()",
"stack.pop",
"stack",
"b = stack.pop()",
"b",
"stack.pop()",
"stack.pop",
"stack",
"stack.push(b*a)",
"stack.push",
"stack",
"b*a",
"b",
"a",
"{\n stack.push(Integer.parseInt(line[i]));\n }",
"stack.push(Integer.parseInt(line[i]))",
"stack.push",
"stack",
"Integer.parseInt(line[i])",
"Integer.parseInt",
"Integer",
"line[i]",
"line",
"i",
"System.out.println(stack.pop())",
"System.out.println",
"System.out",
"System",
"System.out",
"stack.pop()",
"stack.pop",
"stack",
"String[] args",
"args",
"public class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n String[] line = sc.nextLine().split(\" \");\n Stack<Integer> stack = new Stack<Integer>();\n int a=0,b=0;\n for(int i=0; i<line.length; i++){\n if(line[i].equals(\"+\")) {\n a = stack.pop();\n b = stack.pop();\n stack.push(b+a);\n } else if (line[i].equals(\"-\")) {\n a = stack.pop();\n b = stack.pop();\n stack.push(b-a);\n } else if (line[i].equals(\"*\")) {\n a = stack.pop();\n b = stack.pop();\n stack.push(b*a);\n } else {\n stack.push(Integer.parseInt(line[i]));\n }\n }\n System.out.println(stack.pop());\n }\n}",
"public class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n String[] line = sc.nextLine().split(\" \");\n Stack<Integer> stack = new Stack<Integer>();\n int a=0,b=0;\n for(int i=0; i<line.length; i++){\n if(line[i].equals(\"+\")) {\n a = stack.pop();\n b = stack.pop();\n stack.push(b+a);\n } else if (line[i].equals(\"-\")) {\n a = stack.pop();\n b = stack.pop();\n stack.push(b-a);\n } else if (line[i].equals(\"*\")) {\n a = stack.pop();\n b = stack.pop();\n stack.push(b*a);\n } else {\n stack.push(Integer.parseInt(line[i]));\n }\n }\n System.out.println(stack.pop());\n }\n}",
"Main"
] | import java.util.ArrayDeque;
import java.util.Arrays;
import java.util.Deque;
import java.util.Scanner;
import java.util.Stack;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String[] line = sc.nextLine().split(" ");
Stack<Integer> stack = new Stack<Integer>();
int a=0,b=0;
for(int i=0; i<line.length; i++){
if(line[i].equals("+")) {
a = stack.pop();
b = stack.pop();
stack.push(b+a);
} else if (line[i].equals("-")) {
a = stack.pop();
b = stack.pop();
stack.push(b-a);
} else if (line[i].equals("*")) {
a = stack.pop();
b = stack.pop();
stack.push(b*a);
} else {
stack.push(Integer.parseInt(line[i]));
}
}
System.out.println(stack.pop());
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
4,
18,
20,
23,
13,
12,
13,
30,
41,
13,
20,
41,
13,
20,
41,
13,
4,
18,
4,
18,
13,
17,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
30,
41,
13,
18,
13,
13,
41,
13,
41,
13,
35,
4,
18,
13,
17,
34,
17,
1,
0,
13,
4,
18,
13,
0,
13,
4,
18,
13,
4,
18,
13,
2,
13,
13,
3,
34,
17,
1,
0,
13,
4,
18,
13,
0,
13,
4,
18,
13,
4,
18,
13,
2,
13,
13,
3,
34,
17,
1,
0,
13,
4,
18,
13,
0,
13,
4,
18,
13,
4,
18,
13,
2,
13,
13,
3,
34,
1,
4,
18,
13,
4,
18,
13,
13,
3,
4,
18,
18,
13,
13,
4,
18,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
142,
8
],
[
142,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
13,
14
],
[
9,
15
],
[
15,
16
],
[
142,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
20,
22
],
[
19,
23
],
[
23,
24
],
[
23,
25
],
[
19,
26
],
[
26,
27
],
[
26,
28
],
[
28,
29
],
[
29,
30
],
[
30,
31
],
[
31,
32
],
[
28,
33
],
[
19,
34
],
[
34,
35
],
[
35,
36
],
[
36,
37
],
[
36,
38
],
[
34,
39
],
[
39,
40
],
[
39,
41
],
[
41,
42
],
[
41,
43
],
[
34,
44
],
[
44,
45
],
[
45,
46
],
[
34,
47
],
[
48,
48
],
[
48,
49
],
[
49,
50
],
[
49,
51
],
[
51,
52
],
[
51,
53
],
[
48,
54
],
[
54,
55
],
[
48,
56
],
[
56,
57
],
[
48,
58
],
[
58,
59
],
[
59,
60
],
[
60,
61
],
[
59,
62
],
[
58,
63
],
[
63,
64
],
[
63,
65
],
[
65,
66
],
[
66,
67
],
[
66,
68
],
[
68,
69
],
[
69,
70
],
[
65,
71
],
[
71,
72
],
[
71,
73
],
[
73,
74
],
[
74,
75
],
[
65,
76
],
[
76,
77
],
[
77,
78
],
[
76,
79
],
[
79,
80
],
[
79,
81
],
[
65,
82
],
[
58,
83
],
[
83,
84
],
[
83,
85
],
[
85,
86
],
[
86,
87
],
[
86,
88
],
[
88,
89
],
[
89,
90
],
[
85,
91
],
[
91,
92
],
[
91,
93
],
[
93,
94
],
[
94,
95
],
[
85,
96
],
[
96,
97
],
[
97,
98
],
[
96,
99
],
[
99,
100
],
[
99,
101
],
[
85,
102
],
[
58,
103
],
[
103,
104
],
[
103,
105
],
[
105,
106
],
[
106,
107
],
[
106,
108
],
[
108,
109
],
[
109,
110
],
[
105,
111
],
[
111,
112
],
[
111,
113
],
[
113,
114
],
[
114,
115
],
[
105,
116
],
[
116,
117
],
[
117,
118
],
[
116,
119
],
[
119,
120
],
[
119,
121
],
[
105,
122
],
[
58,
123
],
[
123,
124
],
[
124,
125
],
[
125,
126
],
[
126,
127
],
[
125,
128
],
[
128,
129
],
[
129,
130
],
[
128,
131
],
[
124,
132
],
[
19,
133
],
[
133,
134
],
[
134,
135
],
[
135,
136
],
[
135,
137
],
[
133,
138
],
[
138,
139
],
[
139,
140
],
[
0,
141
],
[
141,
142
],
[
141,
143
]
] | [
"import java.util.Scanner;\nimport java.util.Stack;\n\npublic class Main {\n\n\tpublic static void main(String args[]) {\n\t\tnew Main().solve();\n\t}\n\tvoid solve() {\n\t\tScanner scan = new Scanner(System.in);\n\t\tStack<Integer> stack = new Stack<Integer>();\n\t\tString[] strArray = scan.nextLine().split(\" \");\n\t\tfor (int i = 0; i < strArray.length; i++) {\n\t\t\tString str = strArray[i];\n\t\t\tint x,y;\n\t\t\tswitch(str.charAt(0)) {\n\t\t\tcase '+':\n\t\t\t\ty = stack.pop();\n\t\t\t\tx = stack.pop();\n\t\t\t\tstack.add(x + y);\n\t\t\t\tbreak;\n\t\t\tcase '-':\n\t\t\t\ty = stack.pop();\n\t\t\t\tx = stack.pop();\n\t\t\t\tstack.add(x - y);\n\t\t\t\tbreak;\n\t\t\tcase '*':\n\t\t\t\ty = stack.pop();\n\t\t\t\tx = stack.pop();\n\t\t\t\tstack.add(x * y);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tstack.add(Integer.parseInt(str));\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(stack.pop());\n\t}\n}\n",
"import java.util.Scanner;",
"Scanner",
"java.util",
"import java.util.Stack;",
"Stack",
"java.util",
"public class Main {\n\n\tpublic static void main(String args[]) {\n\t\tnew Main().solve();\n\t}\n\tvoid solve() {\n\t\tScanner scan = new Scanner(System.in);\n\t\tStack<Integer> stack = new Stack<Integer>();\n\t\tString[] strArray = scan.nextLine().split(\" \");\n\t\tfor (int i = 0; i < strArray.length; i++) {\n\t\t\tString str = strArray[i];\n\t\t\tint x,y;\n\t\t\tswitch(str.charAt(0)) {\n\t\t\tcase '+':\n\t\t\t\ty = stack.pop();\n\t\t\t\tx = stack.pop();\n\t\t\t\tstack.add(x + y);\n\t\t\t\tbreak;\n\t\t\tcase '-':\n\t\t\t\ty = stack.pop();\n\t\t\t\tx = stack.pop();\n\t\t\t\tstack.add(x - y);\n\t\t\t\tbreak;\n\t\t\tcase '*':\n\t\t\t\ty = stack.pop();\n\t\t\t\tx = stack.pop();\n\t\t\t\tstack.add(x * y);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tstack.add(Integer.parseInt(str));\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(stack.pop());\n\t}\n}",
"Main",
"public static void main(String args[]) {\n\t\tnew Main().solve();\n\t}",
"main",
"{\n\t\tnew Main().solve();\n\t}",
"new Main().solve()",
"new Main().solve",
"new Main()",
"String args[]",
"args",
"void solve() {\n\t\tScanner scan = new Scanner(System.in);\n\t\tStack<Integer> stack = new Stack<Integer>();\n\t\tString[] strArray = scan.nextLine().split(\" \");\n\t\tfor (int i = 0; i < strArray.length; i++) {\n\t\t\tString str = strArray[i];\n\t\t\tint x,y;\n\t\t\tswitch(str.charAt(0)) {\n\t\t\tcase '+':\n\t\t\t\ty = stack.pop();\n\t\t\t\tx = stack.pop();\n\t\t\t\tstack.add(x + y);\n\t\t\t\tbreak;\n\t\t\tcase '-':\n\t\t\t\ty = stack.pop();\n\t\t\t\tx = stack.pop();\n\t\t\t\tstack.add(x - y);\n\t\t\t\tbreak;\n\t\t\tcase '*':\n\t\t\t\ty = stack.pop();\n\t\t\t\tx = stack.pop();\n\t\t\t\tstack.add(x * y);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tstack.add(Integer.parseInt(str));\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(stack.pop());\n\t}",
"solve",
"{\n\t\tScanner scan = new Scanner(System.in);\n\t\tStack<Integer> stack = new Stack<Integer>();\n\t\tString[] strArray = scan.nextLine().split(\" \");\n\t\tfor (int i = 0; i < strArray.length; i++) {\n\t\t\tString str = strArray[i];\n\t\t\tint x,y;\n\t\t\tswitch(str.charAt(0)) {\n\t\t\tcase '+':\n\t\t\t\ty = stack.pop();\n\t\t\t\tx = stack.pop();\n\t\t\t\tstack.add(x + y);\n\t\t\t\tbreak;\n\t\t\tcase '-':\n\t\t\t\ty = stack.pop();\n\t\t\t\tx = stack.pop();\n\t\t\t\tstack.add(x - y);\n\t\t\t\tbreak;\n\t\t\tcase '*':\n\t\t\t\ty = stack.pop();\n\t\t\t\tx = stack.pop();\n\t\t\t\tstack.add(x * y);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tstack.add(Integer.parseInt(str));\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(stack.pop());\n\t}",
"Scanner scan = new Scanner(System.in);",
"scan",
"new Scanner(System.in)",
"Stack<Integer> stack = new Stack<Integer>();",
"stack",
"new Stack<Integer>()",
"String[] strArray = scan.nextLine().split(\" \");",
"strArray",
"scan.nextLine().split(\" \")",
"scan.nextLine().split",
"scan.nextLine()",
"scan.nextLine",
"scan",
"\" \"",
"for (int i = 0; i < strArray.length; i++) {\n\t\t\tString str = strArray[i];\n\t\t\tint x,y;\n\t\t\tswitch(str.charAt(0)) {\n\t\t\tcase '+':\n\t\t\t\ty = stack.pop();\n\t\t\t\tx = stack.pop();\n\t\t\t\tstack.add(x + y);\n\t\t\t\tbreak;\n\t\t\tcase '-':\n\t\t\t\ty = stack.pop();\n\t\t\t\tx = stack.pop();\n\t\t\t\tstack.add(x - y);\n\t\t\t\tbreak;\n\t\t\tcase '*':\n\t\t\t\ty = stack.pop();\n\t\t\t\tx = stack.pop();\n\t\t\t\tstack.add(x * y);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tstack.add(Integer.parseInt(str));\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < strArray.length",
"i",
"strArray.length",
"strArray",
"strArray.length",
"i++",
"i++",
"i",
"{\n\t\t\tString str = strArray[i];\n\t\t\tint x,y;\n\t\t\tswitch(str.charAt(0)) {\n\t\t\tcase '+':\n\t\t\t\ty = stack.pop();\n\t\t\t\tx = stack.pop();\n\t\t\t\tstack.add(x + y);\n\t\t\t\tbreak;\n\t\t\tcase '-':\n\t\t\t\ty = stack.pop();\n\t\t\t\tx = stack.pop();\n\t\t\t\tstack.add(x - y);\n\t\t\t\tbreak;\n\t\t\tcase '*':\n\t\t\t\ty = stack.pop();\n\t\t\t\tx = stack.pop();\n\t\t\t\tstack.add(x * y);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tstack.add(Integer.parseInt(str));\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}",
"{\n\t\t\tString str = strArray[i];\n\t\t\tint x,y;\n\t\t\tswitch(str.charAt(0)) {\n\t\t\tcase '+':\n\t\t\t\ty = stack.pop();\n\t\t\t\tx = stack.pop();\n\t\t\t\tstack.add(x + y);\n\t\t\t\tbreak;\n\t\t\tcase '-':\n\t\t\t\ty = stack.pop();\n\t\t\t\tx = stack.pop();\n\t\t\t\tstack.add(x - y);\n\t\t\t\tbreak;\n\t\t\tcase '*':\n\t\t\t\ty = stack.pop();\n\t\t\t\tx = stack.pop();\n\t\t\t\tstack.add(x * y);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tstack.add(Integer.parseInt(str));\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}",
"String str = strArray[i];",
"str",
"strArray[i]",
"strArray",
"i",
"int x",
"x",
"y;",
"y",
"switch(str.charAt(0)) {\n\t\t\tcase '+':\n\t\t\t\ty = stack.pop();\n\t\t\t\tx = stack.pop();\n\t\t\t\tstack.add(x + y);\n\t\t\t\tbreak;\n\t\t\tcase '-':\n\t\t\t\ty = stack.pop();\n\t\t\t\tx = stack.pop();\n\t\t\t\tstack.add(x - y);\n\t\t\t\tbreak;\n\t\t\tcase '*':\n\t\t\t\ty = stack.pop();\n\t\t\t\tx = stack.pop();\n\t\t\t\tstack.add(x * y);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tstack.add(Integer.parseInt(str));\n\t\t\t\tbreak;\n\t\t\t}",
"str.charAt(0)",
"str.charAt",
"str",
"0",
"case '+':",
"'+'",
"case '+':",
"y = stack.pop()",
"y",
"stack.pop()",
"stack.pop",
"stack",
"x = stack.pop()",
"x",
"stack.pop()",
"stack.pop",
"stack",
"stack.add(x + y)",
"stack.add",
"stack",
"x + y",
"x",
"y",
"break;",
"case '-':",
"'-'",
"case '-':",
"y = stack.pop()",
"y",
"stack.pop()",
"stack.pop",
"stack",
"x = stack.pop()",
"x",
"stack.pop()",
"stack.pop",
"stack",
"stack.add(x - y)",
"stack.add",
"stack",
"x - y",
"x",
"y",
"break;",
"case '*':",
"'*'",
"case '*':",
"y = stack.pop()",
"y",
"stack.pop()",
"stack.pop",
"stack",
"x = stack.pop()",
"x",
"stack.pop()",
"stack.pop",
"stack",
"stack.add(x * y)",
"stack.add",
"stack",
"x * y",
"x",
"y",
"break;",
"default:",
"default:",
"stack.add(Integer.parseInt(str))",
"stack.add",
"stack",
"Integer.parseInt(str)",
"Integer.parseInt",
"Integer",
"str",
"break;",
"System.out.println(stack.pop())",
"System.out.println",
"System.out",
"System",
"System.out",
"stack.pop()",
"stack.pop",
"stack",
"public class Main {\n\n\tpublic static void main(String args[]) {\n\t\tnew Main().solve();\n\t}\n\tvoid solve() {\n\t\tScanner scan = new Scanner(System.in);\n\t\tStack<Integer> stack = new Stack<Integer>();\n\t\tString[] strArray = scan.nextLine().split(\" \");\n\t\tfor (int i = 0; i < strArray.length; i++) {\n\t\t\tString str = strArray[i];\n\t\t\tint x,y;\n\t\t\tswitch(str.charAt(0)) {\n\t\t\tcase '+':\n\t\t\t\ty = stack.pop();\n\t\t\t\tx = stack.pop();\n\t\t\t\tstack.add(x + y);\n\t\t\t\tbreak;\n\t\t\tcase '-':\n\t\t\t\ty = stack.pop();\n\t\t\t\tx = stack.pop();\n\t\t\t\tstack.add(x - y);\n\t\t\t\tbreak;\n\t\t\tcase '*':\n\t\t\t\ty = stack.pop();\n\t\t\t\tx = stack.pop();\n\t\t\t\tstack.add(x * y);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tstack.add(Integer.parseInt(str));\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(stack.pop());\n\t}\n}",
"public class Main {\n\n\tpublic static void main(String args[]) {\n\t\tnew Main().solve();\n\t}\n\tvoid solve() {\n\t\tScanner scan = new Scanner(System.in);\n\t\tStack<Integer> stack = new Stack<Integer>();\n\t\tString[] strArray = scan.nextLine().split(\" \");\n\t\tfor (int i = 0; i < strArray.length; i++) {\n\t\t\tString str = strArray[i];\n\t\t\tint x,y;\n\t\t\tswitch(str.charAt(0)) {\n\t\t\tcase '+':\n\t\t\t\ty = stack.pop();\n\t\t\t\tx = stack.pop();\n\t\t\t\tstack.add(x + y);\n\t\t\t\tbreak;\n\t\t\tcase '-':\n\t\t\t\ty = stack.pop();\n\t\t\t\tx = stack.pop();\n\t\t\t\tstack.add(x - y);\n\t\t\t\tbreak;\n\t\t\tcase '*':\n\t\t\t\ty = stack.pop();\n\t\t\t\tx = stack.pop();\n\t\t\t\tstack.add(x * y);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tstack.add(Integer.parseInt(str));\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(stack.pop());\n\t}\n}",
"Main"
] | import java.util.Scanner;
import java.util.Stack;
public class Main {
public static void main(String args[]) {
new Main().solve();
}
void solve() {
Scanner scan = new Scanner(System.in);
Stack<Integer> stack = new Stack<Integer>();
String[] strArray = scan.nextLine().split(" ");
for (int i = 0; i < strArray.length; i++) {
String str = strArray[i];
int x,y;
switch(str.charAt(0)) {
case '+':
y = stack.pop();
x = stack.pop();
stack.add(x + y);
break;
case '-':
y = stack.pop();
x = stack.pop();
stack.add(x - y);
break;
case '*':
y = stack.pop();
x = stack.pop();
stack.add(x * y);
break;
default:
stack.add(Integer.parseInt(str));
break;
}
}
System.out.println(stack.pop());
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
0,
13,
4,
18,
13,
41,
13,
4,
18,
13,
17,
41,
13,
20,
18,
13,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
30,
14,
4,
18,
18,
13,
13,
17,
30,
40,
13,
0,
18,
13,
2,
13,
17,
2,
18,
13,
2,
13,
17,
18,
13,
13,
14,
4,
18,
18,
13,
13,
17,
30,
40,
13,
0,
18,
13,
2,
13,
17,
2,
18,
13,
2,
13,
17,
18,
13,
13,
14,
4,
18,
18,
13,
13,
17,
30,
40,
13,
0,
18,
13,
2,
13,
17,
2,
18,
13,
2,
13,
17,
18,
13,
13,
30,
0,
18,
13,
13,
4,
18,
13,
18,
13,
13,
40,
13,
4,
18,
18,
13,
13,
18,
13,
2,
13,
17,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
153,
8
],
[
153,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
12,
14
],
[
11,
15
],
[
15,
16
],
[
11,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
11,
22
],
[
22,
23
],
[
22,
24
],
[
24,
25
],
[
25,
26
],
[
24,
27
],
[
11,
28
],
[
28,
29
],
[
28,
30
],
[
31,
32
],
[
31,
33
],
[
11,
34
],
[
34,
35
],
[
34,
36
],
[
11,
37
],
[
37,
38
],
[
38,
39
],
[
39,
40
],
[
39,
41
],
[
37,
42
],
[
42,
43
],
[
42,
44
],
[
44,
45
],
[
44,
46
],
[
37,
47
],
[
47,
48
],
[
48,
49
],
[
37,
50
],
[
51,
51
],
[
51,
52
],
[
52,
53
],
[
53,
54
],
[
54,
55
],
[
55,
56
],
[
55,
57
],
[
53,
58
],
[
52,
59
],
[
59,
60
],
[
60,
61
],
[
59,
62
],
[
62,
63
],
[
63,
64
],
[
63,
65
],
[
65,
66
],
[
65,
67
],
[
62,
68
],
[
68,
69
],
[
69,
70
],
[
69,
71
],
[
71,
72
],
[
71,
73
],
[
68,
74
],
[
74,
75
],
[
74,
76
],
[
52,
77
],
[
77,
78
],
[
78,
79
],
[
79,
80
],
[
80,
81
],
[
80,
82
],
[
78,
83
],
[
77,
84
],
[
84,
85
],
[
85,
86
],
[
84,
87
],
[
87,
88
],
[
88,
89
],
[
88,
90
],
[
90,
91
],
[
90,
92
],
[
87,
93
],
[
93,
94
],
[
94,
95
],
[
94,
96
],
[
96,
97
],
[
96,
98
],
[
93,
99
],
[
99,
100
],
[
99,
101
],
[
77,
102
],
[
102,
103
],
[
103,
104
],
[
104,
105
],
[
105,
106
],
[
105,
107
],
[
103,
108
],
[
102,
109
],
[
109,
110
],
[
110,
111
],
[
109,
112
],
[
112,
113
],
[
113,
114
],
[
113,
115
],
[
115,
116
],
[
115,
117
],
[
112,
118
],
[
118,
119
],
[
119,
120
],
[
119,
121
],
[
121,
122
],
[
121,
123
],
[
118,
124
],
[
124,
125
],
[
124,
126
],
[
102,
127
],
[
127,
128
],
[
128,
129
],
[
129,
130
],
[
129,
131
],
[
128,
132
],
[
132,
133
],
[
133,
134
],
[
132,
135
],
[
135,
136
],
[
135,
137
],
[
127,
138
],
[
138,
139
],
[
11,
140
],
[
140,
141
],
[
141,
142
],
[
142,
143
],
[
142,
144
],
[
140,
145
],
[
145,
146
],
[
145,
147
],
[
147,
148
],
[
147,
149
],
[
9,
150
],
[
150,
151
],
[
0,
152
],
[
152,
153
],
[
152,
154
]
] | [
"import java.util.ArrayList;\nimport java.util.Scanner;\n\npublic class Main {\n\tpublic static void main(String arg[]){\n\t\tScanner sc = new Scanner(System.in);\n\t\tString nf;\n\t\tnf = sc.nextLine();\n\t\t\n\t\tString[] A = nf.split(\" \");\n\t\tint[] n = new int[A.length];\n\t\tint st = 0;\n\n\t\tfor (int i=0; i<A.length; i++) {\n\t\t\tif(A[i].equals(\"+\")){\n\t\t\t\tst--;\n\t\t\t\tn[st-1] = n[st-1] + n[st];\n\t\t\t} else if (A[i].equals(\"-\")){\n\t\t\t\tst--;\n\t\t\t\tn[st-1] = n[st-1] - n[st];\n\t\t\t} else if (A[i].equals(\"*\")){\n\t\t\t\tst--;\n\t\t\t\tn[st-1] = n[st-1] * n[st];\n\t\t\t} else {\n\t\t\t\tn[st] = Integer.parseInt(A[i]);\n\t\t\t\tst++;\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(n[st-1]);\n\t}\n}",
"import java.util.ArrayList;",
"ArrayList",
"java.util",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\tpublic static void main(String arg[]){\n\t\tScanner sc = new Scanner(System.in);\n\t\tString nf;\n\t\tnf = sc.nextLine();\n\t\t\n\t\tString[] A = nf.split(\" \");\n\t\tint[] n = new int[A.length];\n\t\tint st = 0;\n\n\t\tfor (int i=0; i<A.length; i++) {\n\t\t\tif(A[i].equals(\"+\")){\n\t\t\t\tst--;\n\t\t\t\tn[st-1] = n[st-1] + n[st];\n\t\t\t} else if (A[i].equals(\"-\")){\n\t\t\t\tst--;\n\t\t\t\tn[st-1] = n[st-1] - n[st];\n\t\t\t} else if (A[i].equals(\"*\")){\n\t\t\t\tst--;\n\t\t\t\tn[st-1] = n[st-1] * n[st];\n\t\t\t} else {\n\t\t\t\tn[st] = Integer.parseInt(A[i]);\n\t\t\t\tst++;\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(n[st-1]);\n\t}\n}",
"Main",
"public static void main(String arg[]){\n\t\tScanner sc = new Scanner(System.in);\n\t\tString nf;\n\t\tnf = sc.nextLine();\n\t\t\n\t\tString[] A = nf.split(\" \");\n\t\tint[] n = new int[A.length];\n\t\tint st = 0;\n\n\t\tfor (int i=0; i<A.length; i++) {\n\t\t\tif(A[i].equals(\"+\")){\n\t\t\t\tst--;\n\t\t\t\tn[st-1] = n[st-1] + n[st];\n\t\t\t} else if (A[i].equals(\"-\")){\n\t\t\t\tst--;\n\t\t\t\tn[st-1] = n[st-1] - n[st];\n\t\t\t} else if (A[i].equals(\"*\")){\n\t\t\t\tst--;\n\t\t\t\tn[st-1] = n[st-1] * n[st];\n\t\t\t} else {\n\t\t\t\tn[st] = Integer.parseInt(A[i]);\n\t\t\t\tst++;\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(n[st-1]);\n\t}",
"main",
"{\n\t\tScanner sc = new Scanner(System.in);\n\t\tString nf;\n\t\tnf = sc.nextLine();\n\t\t\n\t\tString[] A = nf.split(\" \");\n\t\tint[] n = new int[A.length];\n\t\tint st = 0;\n\n\t\tfor (int i=0; i<A.length; i++) {\n\t\t\tif(A[i].equals(\"+\")){\n\t\t\t\tst--;\n\t\t\t\tn[st-1] = n[st-1] + n[st];\n\t\t\t} else if (A[i].equals(\"-\")){\n\t\t\t\tst--;\n\t\t\t\tn[st-1] = n[st-1] - n[st];\n\t\t\t} else if (A[i].equals(\"*\")){\n\t\t\t\tst--;\n\t\t\t\tn[st-1] = n[st-1] * n[st];\n\t\t\t} else {\n\t\t\t\tn[st] = Integer.parseInt(A[i]);\n\t\t\t\tst++;\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(n[st-1]);\n\t}",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"String nf;",
"nf",
"nf = sc.nextLine()",
"nf",
"sc.nextLine()",
"sc.nextLine",
"sc",
"String[] A = nf.split(\" \");",
"A",
"nf.split(\" \")",
"nf.split",
"nf",
"\" \"",
"int[] n = new int[A.length];",
"n",
"new int[A.length]",
"A.length",
"A",
"A.length",
"int st = 0;",
"st",
"0",
"for (int i=0; i<A.length; i++) {\n\t\t\tif(A[i].equals(\"+\")){\n\t\t\t\tst--;\n\t\t\t\tn[st-1] = n[st-1] + n[st];\n\t\t\t} else if (A[i].equals(\"-\")){\n\t\t\t\tst--;\n\t\t\t\tn[st-1] = n[st-1] - n[st];\n\t\t\t} else if (A[i].equals(\"*\")){\n\t\t\t\tst--;\n\t\t\t\tn[st-1] = n[st-1] * n[st];\n\t\t\t} else {\n\t\t\t\tn[st] = Integer.parseInt(A[i]);\n\t\t\t\tst++;\n\t\t\t}\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<A.length",
"i",
"A.length",
"A",
"A.length",
"i++",
"i++",
"i",
"{\n\t\t\tif(A[i].equals(\"+\")){\n\t\t\t\tst--;\n\t\t\t\tn[st-1] = n[st-1] + n[st];\n\t\t\t} else if (A[i].equals(\"-\")){\n\t\t\t\tst--;\n\t\t\t\tn[st-1] = n[st-1] - n[st];\n\t\t\t} else if (A[i].equals(\"*\")){\n\t\t\t\tst--;\n\t\t\t\tn[st-1] = n[st-1] * n[st];\n\t\t\t} else {\n\t\t\t\tn[st] = Integer.parseInt(A[i]);\n\t\t\t\tst++;\n\t\t\t}\n\t\t}",
"{\n\t\t\tif(A[i].equals(\"+\")){\n\t\t\t\tst--;\n\t\t\t\tn[st-1] = n[st-1] + n[st];\n\t\t\t} else if (A[i].equals(\"-\")){\n\t\t\t\tst--;\n\t\t\t\tn[st-1] = n[st-1] - n[st];\n\t\t\t} else if (A[i].equals(\"*\")){\n\t\t\t\tst--;\n\t\t\t\tn[st-1] = n[st-1] * n[st];\n\t\t\t} else {\n\t\t\t\tn[st] = Integer.parseInt(A[i]);\n\t\t\t\tst++;\n\t\t\t}\n\t\t}",
"if(A[i].equals(\"+\")){\n\t\t\t\tst--;\n\t\t\t\tn[st-1] = n[st-1] + n[st];\n\t\t\t} else if (A[i].equals(\"-\")){\n\t\t\t\tst--;\n\t\t\t\tn[st-1] = n[st-1] - n[st];\n\t\t\t} else if (A[i].equals(\"*\")){\n\t\t\t\tst--;\n\t\t\t\tn[st-1] = n[st-1] * n[st];\n\t\t\t} else {\n\t\t\t\tn[st] = Integer.parseInt(A[i]);\n\t\t\t\tst++;\n\t\t\t}",
"A[i].equals(\"+\")",
"A[i].equals",
"A[i]",
"A",
"i",
"\"+\"",
"{\n\t\t\t\tst--;\n\t\t\t\tn[st-1] = n[st-1] + n[st];\n\t\t\t}",
"st--",
"st",
"n[st-1] = n[st-1] + n[st]",
"n[st-1]",
"n",
"st-1",
"st",
"1",
"n[st-1] + n[st]",
"n[st-1]",
"n",
"st-1",
"st",
"1",
"n[st]",
"n",
"st",
"if (A[i].equals(\"-\")){\n\t\t\t\tst--;\n\t\t\t\tn[st-1] = n[st-1] - n[st];\n\t\t\t} else if (A[i].equals(\"*\")){\n\t\t\t\tst--;\n\t\t\t\tn[st-1] = n[st-1] * n[st];\n\t\t\t} else {\n\t\t\t\tn[st] = Integer.parseInt(A[i]);\n\t\t\t\tst++;\n\t\t\t}",
"A[i].equals(\"-\")",
"A[i].equals",
"A[i]",
"A",
"i",
"\"-\"",
"{\n\t\t\t\tst--;\n\t\t\t\tn[st-1] = n[st-1] - n[st];\n\t\t\t}",
"st--",
"st",
"n[st-1] = n[st-1] - n[st]",
"n[st-1]",
"n",
"st-1",
"st",
"1",
"n[st-1] - n[st]",
"n[st-1]",
"n",
"st-1",
"st",
"1",
"n[st]",
"n",
"st",
"if (A[i].equals(\"*\")){\n\t\t\t\tst--;\n\t\t\t\tn[st-1] = n[st-1] * n[st];\n\t\t\t} else {\n\t\t\t\tn[st] = Integer.parseInt(A[i]);\n\t\t\t\tst++;\n\t\t\t}",
"A[i].equals(\"*\")",
"A[i].equals",
"A[i]",
"A",
"i",
"\"*\"",
"{\n\t\t\t\tst--;\n\t\t\t\tn[st-1] = n[st-1] * n[st];\n\t\t\t}",
"st--",
"st",
"n[st-1] = n[st-1] * n[st]",
"n[st-1]",
"n",
"st-1",
"st",
"1",
"n[st-1] * n[st]",
"n[st-1]",
"n",
"st-1",
"st",
"1",
"n[st]",
"n",
"st",
"{\n\t\t\t\tn[st] = Integer.parseInt(A[i]);\n\t\t\t\tst++;\n\t\t\t}",
"n[st] = Integer.parseInt(A[i])",
"n[st]",
"n",
"st",
"Integer.parseInt(A[i])",
"Integer.parseInt",
"Integer",
"A[i]",
"A",
"i",
"st++",
"st",
"System.out.println(n[st-1])",
"System.out.println",
"System.out",
"System",
"System.out",
"n[st-1]",
"n",
"st-1",
"st",
"1",
"String arg[]",
"arg",
"public class Main {\n\tpublic static void main(String arg[]){\n\t\tScanner sc = new Scanner(System.in);\n\t\tString nf;\n\t\tnf = sc.nextLine();\n\t\t\n\t\tString[] A = nf.split(\" \");\n\t\tint[] n = new int[A.length];\n\t\tint st = 0;\n\n\t\tfor (int i=0; i<A.length; i++) {\n\t\t\tif(A[i].equals(\"+\")){\n\t\t\t\tst--;\n\t\t\t\tn[st-1] = n[st-1] + n[st];\n\t\t\t} else if (A[i].equals(\"-\")){\n\t\t\t\tst--;\n\t\t\t\tn[st-1] = n[st-1] - n[st];\n\t\t\t} else if (A[i].equals(\"*\")){\n\t\t\t\tst--;\n\t\t\t\tn[st-1] = n[st-1] * n[st];\n\t\t\t} else {\n\t\t\t\tn[st] = Integer.parseInt(A[i]);\n\t\t\t\tst++;\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(n[st-1]);\n\t}\n}",
"public class Main {\n\tpublic static void main(String arg[]){\n\t\tScanner sc = new Scanner(System.in);\n\t\tString nf;\n\t\tnf = sc.nextLine();\n\t\t\n\t\tString[] A = nf.split(\" \");\n\t\tint[] n = new int[A.length];\n\t\tint st = 0;\n\n\t\tfor (int i=0; i<A.length; i++) {\n\t\t\tif(A[i].equals(\"+\")){\n\t\t\t\tst--;\n\t\t\t\tn[st-1] = n[st-1] + n[st];\n\t\t\t} else if (A[i].equals(\"-\")){\n\t\t\t\tst--;\n\t\t\t\tn[st-1] = n[st-1] - n[st];\n\t\t\t} else if (A[i].equals(\"*\")){\n\t\t\t\tst--;\n\t\t\t\tn[st-1] = n[st-1] * n[st];\n\t\t\t} else {\n\t\t\t\tn[st] = Integer.parseInt(A[i]);\n\t\t\t\tst++;\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(n[st-1]);\n\t}\n}",
"Main"
] | import java.util.ArrayList;
import java.util.Scanner;
public class Main {
public static void main(String arg[]){
Scanner sc = new Scanner(System.in);
String nf;
nf = sc.nextLine();
String[] A = nf.split(" ");
int[] n = new int[A.length];
int st = 0;
for (int i=0; i<A.length; i++) {
if(A[i].equals("+")){
st--;
n[st-1] = n[st-1] + n[st];
} else if (A[i].equals("-")){
st--;
n[st-1] = n[st-1] - n[st];
} else if (A[i].equals("*")){
st--;
n[st-1] = n[st-1] * n[st];
} else {
n[st] = Integer.parseInt(A[i]);
st++;
}
}
System.out.println(n[st-1]);
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
41,
13,
20,
42,
4,
18,
13,
30,
0,
13,
4,
18,
13,
14,
4,
18,
13,
17,
30,
4,
18,
13,
2,
4,
18,
13,
4,
18,
13,
14,
4,
18,
13,
17,
30,
4,
18,
13,
2,
2,
4,
18,
13,
40,
17,
4,
18,
13,
14,
4,
18,
13,
17,
30,
4,
18,
13,
2,
4,
18,
13,
4,
18,
13,
30,
4,
18,
13,
4,
18,
13,
13,
4,
18,
18,
13,
13,
4,
18,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
10,
11
],
[
10,
12
],
[
0,
13
],
[
106,
14
],
[
106,
15
],
[
15,
16
],
[
15,
17
],
[
17,
18
],
[
18,
19
],
[
18,
20
],
[
17,
21
],
[
21,
22
],
[
17,
23
],
[
23,
24
],
[
23,
25
],
[
17,
26
],
[
26,
27
],
[
27,
28
],
[
28,
29
],
[
26,
30
],
[
30,
31
],
[
31,
32
],
[
31,
33
],
[
33,
34
],
[
34,
35
],
[
30,
36
],
[
36,
37
],
[
37,
38
],
[
38,
39
],
[
37,
40
],
[
36,
41
],
[
41,
42
],
[
42,
43
],
[
43,
44
],
[
42,
45
],
[
45,
46
],
[
46,
47
],
[
47,
48
],
[
45,
49
],
[
49,
50
],
[
50,
51
],
[
36,
52
],
[
52,
53
],
[
53,
54
],
[
54,
55
],
[
53,
56
],
[
52,
57
],
[
57,
58
],
[
58,
59
],
[
59,
60
],
[
58,
61
],
[
61,
62
],
[
62,
63
],
[
63,
64
],
[
64,
65
],
[
62,
66
],
[
66,
67
],
[
61,
68
],
[
68,
69
],
[
69,
70
],
[
52,
71
],
[
71,
72
],
[
72,
73
],
[
73,
74
],
[
72,
75
],
[
71,
76
],
[
76,
77
],
[
77,
78
],
[
78,
79
],
[
77,
80
],
[
80,
81
],
[
81,
82
],
[
82,
83
],
[
80,
84
],
[
84,
85
],
[
85,
86
],
[
71,
87
],
[
87,
88
],
[
88,
89
],
[
89,
90
],
[
88,
91
],
[
91,
92
],
[
92,
93
],
[
91,
94
],
[
17,
95
],
[
95,
96
],
[
96,
97
],
[
97,
98
],
[
97,
99
],
[
95,
100
],
[
100,
101
],
[
101,
102
],
[
15,
103
],
[
103,
104
],
[
0,
105
],
[
105,
106
],
[
105,
107
]
] | [
"import java.util.ArrayDeque;\nimport java.util.Scanner;\n\nimport static java.lang.Integer.parseInt;\n\nimport java.util.*;\n\npublic class Main {\n\n public static void main(String[] args) {\n\n Scanner sc = new Scanner(System.in);\n\n String symbol;\n ArrayDeque<Integer> stack = new ArrayDeque<Integer>();\n\n while (sc.hasNext()) {\n symbol = sc.next();\n\n if (symbol.equals(\"+\")) {\n stack.push(stack.pop() + stack.pop());\n } else if (symbol.equals(\"-\")) {\n stack.push((stack.pop() * -1) + stack.pop());\n } else if (symbol.equals(\"*\")) {\n stack.push(stack.pop() * stack.pop());\n } else {\n stack.push(Integer.parseInt(symbol));\n }\n }\n System.out.println(stack.pop());\n }\n}",
"import java.util.ArrayDeque;",
"ArrayDeque",
"java.util",
"import java.util.Scanner;",
"Scanner",
"java.util",
"import static java.lang.Integer.parseInt;",
"import static java.lang.Integer.parseInt;",
"import static java.lang.Integer.parseInt;",
"import java.util.*;",
"util.*",
"java",
"public class Main {\n\n public static void main(String[] args) {\n\n Scanner sc = new Scanner(System.in);\n\n String symbol;\n ArrayDeque<Integer> stack = new ArrayDeque<Integer>();\n\n while (sc.hasNext()) {\n symbol = sc.next();\n\n if (symbol.equals(\"+\")) {\n stack.push(stack.pop() + stack.pop());\n } else if (symbol.equals(\"-\")) {\n stack.push((stack.pop() * -1) + stack.pop());\n } else if (symbol.equals(\"*\")) {\n stack.push(stack.pop() * stack.pop());\n } else {\n stack.push(Integer.parseInt(symbol));\n }\n }\n System.out.println(stack.pop());\n }\n}",
"Main",
"public static void main(String[] args) {\n\n Scanner sc = new Scanner(System.in);\n\n String symbol;\n ArrayDeque<Integer> stack = new ArrayDeque<Integer>();\n\n while (sc.hasNext()) {\n symbol = sc.next();\n\n if (symbol.equals(\"+\")) {\n stack.push(stack.pop() + stack.pop());\n } else if (symbol.equals(\"-\")) {\n stack.push((stack.pop() * -1) + stack.pop());\n } else if (symbol.equals(\"*\")) {\n stack.push(stack.pop() * stack.pop());\n } else {\n stack.push(Integer.parseInt(symbol));\n }\n }\n System.out.println(stack.pop());\n }",
"main",
"{\n\n Scanner sc = new Scanner(System.in);\n\n String symbol;\n ArrayDeque<Integer> stack = new ArrayDeque<Integer>();\n\n while (sc.hasNext()) {\n symbol = sc.next();\n\n if (symbol.equals(\"+\")) {\n stack.push(stack.pop() + stack.pop());\n } else if (symbol.equals(\"-\")) {\n stack.push((stack.pop() * -1) + stack.pop());\n } else if (symbol.equals(\"*\")) {\n stack.push(stack.pop() * stack.pop());\n } else {\n stack.push(Integer.parseInt(symbol));\n }\n }\n System.out.println(stack.pop());\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"String symbol;",
"symbol",
"ArrayDeque<Integer> stack = new ArrayDeque<Integer>();",
"stack",
"new ArrayDeque<Integer>()",
"while (sc.hasNext()) {\n symbol = sc.next();\n\n if (symbol.equals(\"+\")) {\n stack.push(stack.pop() + stack.pop());\n } else if (symbol.equals(\"-\")) {\n stack.push((stack.pop() * -1) + stack.pop());\n } else if (symbol.equals(\"*\")) {\n stack.push(stack.pop() * stack.pop());\n } else {\n stack.push(Integer.parseInt(symbol));\n }\n }",
"sc.hasNext()",
"sc.hasNext",
"sc",
"{\n symbol = sc.next();\n\n if (symbol.equals(\"+\")) {\n stack.push(stack.pop() + stack.pop());\n } else if (symbol.equals(\"-\")) {\n stack.push((stack.pop() * -1) + stack.pop());\n } else if (symbol.equals(\"*\")) {\n stack.push(stack.pop() * stack.pop());\n } else {\n stack.push(Integer.parseInt(symbol));\n }\n }",
"symbol = sc.next()",
"symbol",
"sc.next()",
"sc.next",
"sc",
"if (symbol.equals(\"+\")) {\n stack.push(stack.pop() + stack.pop());\n } else if (symbol.equals(\"-\")) {\n stack.push((stack.pop() * -1) + stack.pop());\n } else if (symbol.equals(\"*\")) {\n stack.push(stack.pop() * stack.pop());\n } else {\n stack.push(Integer.parseInt(symbol));\n }",
"symbol.equals(\"+\")",
"symbol.equals",
"symbol",
"\"+\"",
"{\n stack.push(stack.pop() + stack.pop());\n }",
"stack.push(stack.pop() + stack.pop())",
"stack.push",
"stack",
"stack.pop() + stack.pop()",
"stack.pop()",
"stack.pop",
"stack",
"stack.pop()",
"stack.pop",
"stack",
"if (symbol.equals(\"-\")) {\n stack.push((stack.pop() * -1) + stack.pop());\n } else if (symbol.equals(\"*\")) {\n stack.push(stack.pop() * stack.pop());\n } else {\n stack.push(Integer.parseInt(symbol));\n }",
"symbol.equals(\"-\")",
"symbol.equals",
"symbol",
"\"-\"",
"{\n stack.push((stack.pop() * -1) + stack.pop());\n }",
"stack.push((stack.pop() * -1) + stack.pop())",
"stack.push",
"stack",
"(stack.pop() * -1) + stack.pop()",
"(stack.pop() * -1)",
"stack.pop()",
"stack.pop",
"stack",
"-1",
"1",
"stack.pop()",
"stack.pop",
"stack",
"if (symbol.equals(\"*\")) {\n stack.push(stack.pop() * stack.pop());\n } else {\n stack.push(Integer.parseInt(symbol));\n }",
"symbol.equals(\"*\")",
"symbol.equals",
"symbol",
"\"*\"",
"{\n stack.push(stack.pop() * stack.pop());\n }",
"stack.push(stack.pop() * stack.pop())",
"stack.push",
"stack",
"stack.pop() * stack.pop()",
"stack.pop()",
"stack.pop",
"stack",
"stack.pop()",
"stack.pop",
"stack",
"{\n stack.push(Integer.parseInt(symbol));\n }",
"stack.push(Integer.parseInt(symbol))",
"stack.push",
"stack",
"Integer.parseInt(symbol)",
"Integer.parseInt",
"Integer",
"symbol",
"System.out.println(stack.pop())",
"System.out.println",
"System.out",
"System",
"System.out",
"stack.pop()",
"stack.pop",
"stack",
"String[] args",
"args",
"public class Main {\n\n public static void main(String[] args) {\n\n Scanner sc = new Scanner(System.in);\n\n String symbol;\n ArrayDeque<Integer> stack = new ArrayDeque<Integer>();\n\n while (sc.hasNext()) {\n symbol = sc.next();\n\n if (symbol.equals(\"+\")) {\n stack.push(stack.pop() + stack.pop());\n } else if (symbol.equals(\"-\")) {\n stack.push((stack.pop() * -1) + stack.pop());\n } else if (symbol.equals(\"*\")) {\n stack.push(stack.pop() * stack.pop());\n } else {\n stack.push(Integer.parseInt(symbol));\n }\n }\n System.out.println(stack.pop());\n }\n}",
"public class Main {\n\n public static void main(String[] args) {\n\n Scanner sc = new Scanner(System.in);\n\n String symbol;\n ArrayDeque<Integer> stack = new ArrayDeque<Integer>();\n\n while (sc.hasNext()) {\n symbol = sc.next();\n\n if (symbol.equals(\"+\")) {\n stack.push(stack.pop() + stack.pop());\n } else if (symbol.equals(\"-\")) {\n stack.push((stack.pop() * -1) + stack.pop());\n } else if (symbol.equals(\"*\")) {\n stack.push(stack.pop() * stack.pop());\n } else {\n stack.push(Integer.parseInt(symbol));\n }\n }\n System.out.println(stack.pop());\n }\n}",
"Main"
] | import java.util.ArrayDeque;
import java.util.Scanner;
import static java.lang.Integer.parseInt;
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String symbol;
ArrayDeque<Integer> stack = new ArrayDeque<Integer>();
while (sc.hasNext()) {
symbol = sc.next();
if (symbol.equals("+")) {
stack.push(stack.pop() + stack.pop());
} else if (symbol.equals("-")) {
stack.push((stack.pop() * -1) + stack.pop());
} else if (symbol.equals("*")) {
stack.push(stack.pop() * stack.pop());
} else {
stack.push(Integer.parseInt(symbol));
}
}
System.out.println(stack.pop());
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
41,
13,
41,
13,
12,
13,
30,
41,
13,
20,
42,
4,
18,
13,
30,
41,
13,
4,
18,
13,
14,
2,
4,
18,
13,
17,
17,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
4,
18,
13,
2,
13,
13,
14,
2,
4,
18,
13,
17,
17,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
4,
18,
13,
2,
13,
13,
14,
2,
4,
18,
13,
17,
17,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
4,
18,
13,
2,
13,
13,
30,
4,
18,
13,
4,
18,
13,
13,
4,
18,
13,
4,
18,
13,
12,
13,
30,
0,
13,
20,
0,
13,
20,
4,
13,
4,
18,
13,
23,
13,
6,
13,
41,
13,
41,
13,
20,
17,
41,
13,
41,
13,
12,
13,
30,
0,
18,
36,
13,
13,
0,
18,
36,
13,
0,
18,
36,
13,
17,
23,
13,
12,
13,
30,
14,
2,
13,
13,
30,
0,
13,
17,
38,
5,
13,
30,
37,
20,
30,
0,
13,
4,
18,
13,
13,
14,
2,
13,
17,
29,
17,
29,
17,
12,
13,
30,
14,
4,
13,
29,
18,
13,
40,
13,
29,
40,
17,
12,
13,
30,
29,
40,
2,
2,
13,
17,
2,
13,
17,
23,
13,
12,
13,
30,
42,
2,
4,
13,
4,
13,
18,
13,
13,
40,
13,
12,
13,
30,
4,
13,
29,
4,
13,
12,
13,
30,
14,
40,
4,
13,
37,
20,
41,
13,
20,
41,
13,
4,
13,
42,
40,
4,
13,
13,
30,
4,
18,
13,
13,
0,
13,
4,
13,
29,
4,
18,
13,
12,
13,
30,
14,
40,
4,
13,
37,
20,
41,
13,
4,
13,
42,
4,
13,
13,
0,
13,
4,
13,
41,
13,
17,
14,
2,
13,
17,
30,
0,
13,
17,
0,
13,
4,
13,
41,
13,
17,
42,
40,
4,
13,
13,
30,
14,
2,
2,
13,
17,
2,
13,
17,
37,
20,
0,
13,
2,
2,
2,
13,
17,
13,
17,
0,
13,
4,
13,
29,
8,
13,
40,
13,
13,
12,
13,
30,
14,
40,
4,
13,
37,
20,
41,
13,
4,
13,
42,
4,
13,
13,
0,
13,
4,
13,
41,
13,
17,
14,
2,
13,
17,
30,
0,
13,
17,
0,
13,
4,
13,
41,
13,
17,
42,
40,
4,
13,
13,
30,
14,
2,
2,
13,
17,
2,
13,
17,
37,
20,
0,
13,
2,
2,
2,
13,
17,
13,
17,
0,
13,
4,
13,
29,
8,
13,
40,
13,
13,
12,
13,
30,
29,
4,
18,
13,
4,
13,
12,
13,
30,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
0,
18,
13,
13,
4,
13,
29,
13,
23,
13,
12,
13,
30,
41,
13,
20,
13,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
0,
18,
13,
13,
4,
18,
4,
13,
29,
13,
23,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
10,
11
],
[
10,
12
],
[
0,
13
],
[
13,
14
],
[
13,
15
],
[
0,
16
],
[
16,
17
],
[
16,
18
],
[
0,
19
],
[
19,
20
],
[
19,
21
],
[
0,
22
],
[
22,
23
],
[
22,
24
],
[
0,
25
],
[
517,
26
],
[
517,
27
],
[
27,
28
],
[
517,
29
],
[
29,
30
],
[
517,
31
],
[
31,
32
],
[
31,
33
],
[
33,
34
],
[
34,
35
],
[
34,
36
],
[
33,
37
],
[
37,
38
],
[
38,
39
],
[
39,
40
],
[
37,
41
],
[
41,
42
],
[
42,
43
],
[
42,
44
],
[
44,
45
],
[
45,
46
],
[
41,
47
],
[
47,
48
],
[
48,
49
],
[
49,
50
],
[
50,
51
],
[
49,
52
],
[
48,
53
],
[
47,
54
],
[
54,
55
],
[
55,
56
],
[
55,
57
],
[
57,
58
],
[
58,
59
],
[
54,
60
],
[
60,
61
],
[
60,
62
],
[
62,
63
],
[
63,
64
],
[
54,
65
],
[
65,
66
],
[
66,
67
],
[
65,
68
],
[
68,
69
],
[
68,
70
],
[
47,
71
],
[
71,
72
],
[
72,
73
],
[
73,
74
],
[
74,
75
],
[
73,
76
],
[
72,
77
],
[
71,
78
],
[
78,
79
],
[
79,
80
],
[
79,
81
],
[
81,
82
],
[
82,
83
],
[
78,
84
],
[
84,
85
],
[
84,
86
],
[
86,
87
],
[
87,
88
],
[
78,
89
],
[
89,
90
],
[
90,
91
],
[
89,
92
],
[
92,
93
],
[
92,
94
],
[
71,
95
],
[
95,
96
],
[
96,
97
],
[
97,
98
],
[
98,
99
],
[
97,
100
],
[
96,
101
],
[
95,
102
],
[
102,
103
],
[
103,
104
],
[
103,
105
],
[
105,
106
],
[
106,
107
],
[
102,
108
],
[
108,
109
],
[
108,
110
],
[
110,
111
],
[
111,
112
],
[
102,
113
],
[
113,
114
],
[
114,
115
],
[
113,
116
],
[
116,
117
],
[
116,
118
],
[
95,
119
],
[
119,
120
],
[
120,
121
],
[
121,
122
],
[
120,
123
],
[
123,
124
],
[
124,
125
],
[
123,
126
],
[
33,
127
],
[
127,
128
],
[
128,
129
],
[
127,
130
],
[
130,
131
],
[
131,
132
],
[
517,
133
],
[
133,
134
],
[
133,
135
],
[
135,
136
],
[
136,
137
],
[
136,
138
],
[
135,
139
],
[
139,
140
],
[
139,
141
],
[
135,
142
],
[
142,
143
],
[
135,
144
],
[
144,
145
],
[
145,
146
],
[
133,
147
],
[
147,
148
],
[
517,
149
],
[
149,
150
],
[
149,
151
],
[
151,
152
],
[
149,
153
],
[
153,
154
],
[
153,
155
],
[
149,
157
],
[
157,
158
],
[
149,
159
],
[
159,
160
],
[
149,
161
],
[
161,
162
],
[
161,
163
],
[
163,
164
],
[
164,
165
],
[
165,
166
],
[
165,
167
],
[
164,
168
],
[
163,
169
],
[
169,
170
],
[
170,
171
],
[
170,
172
],
[
169,
173
],
[
173,
174
],
[
174,
175
],
[
174,
176
],
[
173,
177
],
[
161,
178
],
[
178,
179
],
[
149,
180
],
[
180,
181
],
[
180,
182
],
[
182,
183
],
[
183,
184
],
[
184,
185
],
[
184,
186
],
[
183,
187
],
[
187,
188
],
[
188,
189
],
[
188,
190
],
[
187,
191
],
[
191,
192
],
[
192,
193
],
[
192,
194
],
[
194,
195
],
[
195,
196
],
[
191,
197
],
[
197,
198
],
[
198,
199
],
[
198,
200
],
[
200,
201
],
[
201,
202
],
[
200,
203
],
[
187,
204
],
[
204,
205
],
[
205,
206
],
[
205,
207
],
[
204,
208
],
[
208,
209
],
[
182,
210
],
[
210,
211
],
[
149,
212
],
[
212,
213
],
[
212,
214
],
[
214,
215
],
[
215,
216
],
[
216,
217
],
[
215,
218
],
[
218,
219
],
[
219,
220
],
[
219,
221
],
[
221,
222
],
[
215,
223
],
[
223,
224
],
[
224,
225
],
[
149,
226
],
[
226,
227
],
[
226,
228
],
[
228,
229
],
[
229,
230
],
[
230,
231
],
[
231,
232
],
[
232,
233
],
[
232,
234
],
[
231,
235
],
[
235,
236
],
[
235,
237
],
[
226,
238
],
[
238,
239
],
[
149,
240
],
[
240,
241
],
[
240,
242
],
[
242,
243
],
[
243,
244
],
[
244,
245
],
[
245,
246
],
[
244,
247
],
[
247,
248
],
[
247,
249
],
[
249,
250
],
[
249,
251
],
[
243,
252
],
[
252,
253
],
[
149,
254
],
[
254,
255
],
[
254,
256
],
[
256,
257
],
[
257,
258
],
[
256,
259
],
[
259,
260
],
[
260,
261
],
[
149,
262
],
[
262,
263
],
[
262,
264
],
[
264,
265
],
[
265,
266
],
[
266,
267
],
[
267,
268
],
[
265,
269
],
[
269,
270
],
[
264,
271
],
[
271,
272
],
[
271,
273
],
[
264,
274
],
[
274,
275
],
[
274,
276
],
[
276,
277
],
[
264,
278
],
[
278,
279
],
[
279,
280
],
[
280,
281
],
[
280,
282
],
[
278,
283
],
[
283,
284
],
[
284,
285
],
[
285,
286
],
[
284,
287
],
[
283,
288
],
[
288,
289
],
[
288,
290
],
[
290,
291
],
[
264,
292
],
[
292,
293
],
[
293,
294
],
[
294,
295
],
[
149,
296
],
[
296,
297
],
[
296,
298
],
[
298,
299
],
[
299,
300
],
[
300,
301
],
[
301,
302
],
[
299,
303
],
[
303,
304
],
[
298,
305
],
[
305,
306
],
[
305,
307
],
[
307,
308
],
[
298,
309
],
[
309,
310
],
[
310,
311
],
[
310,
312
],
[
309,
313
],
[
313,
314
],
[
313,
315
],
[
315,
316
],
[
298,
317
],
[
317,
318
],
[
317,
319
],
[
298,
320
],
[
320,
321
],
[
321,
322
],
[
321,
323
],
[
320,
324
],
[
324,
325
],
[
325,
326
],
[
325,
327
],
[
324,
328
],
[
328,
329
],
[
328,
330
],
[
330,
331
],
[
298,
332
],
[
332,
333
],
[
332,
334
],
[
298,
335
],
[
335,
336
],
[
336,
337
],
[
337,
338
],
[
337,
339
],
[
335,
340
],
[
340,
341
],
[
341,
342
],
[
342,
343
],
[
343,
344
],
[
343,
345
],
[
342,
346
],
[
346,
347
],
[
346,
348
],
[
341,
349
],
[
349,
350
],
[
340,
351
],
[
351,
352
],
[
351,
353
],
[
353,
354
],
[
354,
355
],
[
355,
356
],
[
355,
357
],
[
354,
358
],
[
353,
359
],
[
340,
360
],
[
360,
361
],
[
360,
362
],
[
362,
363
],
[
298,
364
],
[
364,
365
],
[
365,
366
],
[
365,
367
],
[
367,
368
],
[
365,
369
],
[
149,
370
],
[
370,
371
],
[
370,
372
],
[
372,
373
],
[
373,
374
],
[
374,
375
],
[
375,
376
],
[
373,
377
],
[
377,
378
],
[
372,
379
],
[
379,
380
],
[
379,
381
],
[
381,
382
],
[
372,
383
],
[
383,
384
],
[
384,
385
],
[
384,
386
],
[
383,
387
],
[
387,
388
],
[
387,
389
],
[
389,
390
],
[
372,
391
],
[
391,
392
],
[
391,
393
],
[
372,
394
],
[
394,
395
],
[
395,
396
],
[
395,
397
],
[
394,
398
],
[
398,
399
],
[
399,
400
],
[
399,
401
],
[
398,
402
],
[
402,
403
],
[
402,
404
],
[
404,
405
],
[
372,
406
],
[
406,
407
],
[
406,
408
],
[
372,
409
],
[
409,
410
],
[
410,
411
],
[
411,
412
],
[
411,
413
],
[
409,
414
],
[
414,
415
],
[
415,
416
],
[
416,
417
],
[
417,
418
],
[
417,
419
],
[
416,
420
],
[
420,
421
],
[
420,
422
],
[
415,
423
],
[
423,
424
],
[
414,
425
],
[
425,
426
],
[
425,
427
],
[
427,
428
],
[
428,
429
],
[
429,
430
],
[
429,
431
],
[
428,
432
],
[
427,
433
],
[
414,
434
],
[
434,
435
],
[
434,
436
],
[
436,
437
],
[
372,
438
],
[
438,
439
],
[
439,
440
],
[
439,
441
],
[
441,
442
],
[
439,
443
],
[
149,
444
],
[
444,
445
],
[
444,
446
],
[
446,
447
],
[
447,
448
],
[
448,
449
],
[
449,
450
],
[
448,
451
],
[
451,
452
],
[
149,
453
],
[
453,
454
],
[
453,
455
],
[
455,
456
],
[
456,
457
],
[
456,
458
],
[
455,
460
],
[
460,
461
],
[
461,
462
],
[
462,
463
],
[
462,
464
],
[
460,
465
],
[
465,
466
],
[
465,
467
],
[
460,
468
],
[
468,
469
],
[
469,
470
],
[
460,
471
],
[
471,
472
],
[
472,
473
],
[
473,
474
],
[
473,
475
],
[
472,
476
],
[
476,
477
],
[
455,
478
],
[
478,
479
],
[
453,
480
],
[
480,
481
],
[
149,
482
],
[
482,
483
],
[
482,
484
],
[
484,
485
],
[
485,
486
],
[
485,
487
],
[
484,
490
],
[
490,
491
],
[
491,
492
],
[
492,
493
],
[
492,
494
],
[
490,
495
],
[
495,
496
],
[
495,
497
],
[
490,
498
],
[
498,
499
],
[
499,
500
],
[
490,
501
],
[
501,
502
],
[
502,
503
],
[
503,
504
],
[
503,
505
],
[
502,
506
],
[
506,
507
],
[
507,
508
],
[
508,
509
],
[
484,
510
],
[
510,
511
],
[
482,
512
],
[
512,
513
],
[
482,
514
],
[
514,
515
],
[
0,
516
],
[
516,
517
],
[
516,
518
]
] | [
"import java.io.InputStream;\nimport java.io.IOException;\nimport java.io.PrintWriter;\nimport java.util.ArrayDeque;\nimport java.util.Deque;\nimport java.util.InputMismatchException;\nimport java.util.NoSuchElementException;\nimport java.util.PriorityQueue;\n \npublic class Main{\n \n static InputReader ir;\n static PrintWriter out;\n\n static void solve(){\n Deque<Integer> stk=new ArrayDeque<Integer>();\n\twhile(ir.hasNext()){\n\t String s=ir.next();\n\t if(s.charAt(0)=='+'){\n\t\tint a=stk.pollFirst();\n\t\tint b=stk.pollFirst();\n\t\tstk.offerFirst(a+b);\n\t }\n\t else if(s.charAt(0)=='-'){\n\t\tint a=stk.pollFirst();\n\t\tint b=stk.pollFirst();\n\t\tstk.offerFirst(b-a);\n\t }\n\t else if(s.charAt(0)=='*'){\n\t\tint a=stk.pollFirst();\n\t\tint b=stk.pollFirst();\n\t\tstk.offerFirst(a*b);\n\t }\n\t else{\n\t stk.offerFirst(Integer.parseInt(s));\n\t }\n\t}\n\tout.println(stk.pollFirst());\n }\n \n public static void main(String[] args) throws Exception {\n\tir = new InputReader(System.in);\n \tout = new PrintWriter(System.out);\n\tsolve();\n\tout.flush();\n }\n \n static class InputReader {\n\tprivate InputStream in;\n\tprivate byte[] buffer=new byte[1024];\n\tprivate int curbuf;\n\tprivate int lenbuf;\n\n\tpublic InputReader(InputStream in) {this.in=in; this.curbuf=this.lenbuf=0;}\n \n\tpublic boolean hasNextByte() {\n\t if(curbuf>=lenbuf){\n\t\tcurbuf= 0;\n\t\ttry{\n\t\t lenbuf=in.read(buffer);\n\t\t}catch(IOException e) {\n\t\t throw new InputMismatchException();\n\t\t}\n\t\tif(lenbuf<=0) return false;\n\t }\n\t return true;\n\t}\n \n\tprivate int readByte(){if(hasNextByte()) return buffer[curbuf++]; else return -1;}\n \n\tprivate boolean isSpaceChar(int c){return !(c>=33&&c<=126);}\n \n\tprivate void skip(){while(hasNextByte()&&isSpaceChar(buffer[curbuf])) curbuf++;}\n \n\tpublic boolean hasNext(){skip(); return hasNextByte();}\n \n\tpublic String next(){\n\t if(!hasNext()) throw new NoSuchElementException();\n\t StringBuilder sb=new StringBuilder();\n\t int b=readByte();\n\t while(!isSpaceChar(b)){\n\t\tsb.appendCodePoint(b);\n\t\tb=readByte();\n\t }\n\t return sb.toString();\n\t}\n \n\tpublic int nextInt() {\n\t if(!hasNext()) throw new NoSuchElementException();\n\t int c=readByte();\n\t while (isSpaceChar(c)) c=readByte();\n\t boolean minus=false;\n\t if (c=='-') {\n\t\tminus=true;\n\t\tc=readByte();\n\t }\n\t int res=0;\n\t do{\n\t\tif(c<'0'||c>'9') throw new InputMismatchException();\n\t\tres=res*10+c-'0';\n\t\tc=readByte();\n\t }while(!isSpaceChar(c));\n\t return (minus)?-res:res;\n\t}\n \n\tpublic long nextLong() {\n\t if(!hasNext()) throw new NoSuchElementException();\n\t int c=readByte();\n\t while (isSpaceChar(c)) c=readByte();\n\t boolean minus=false;\n\t if (c=='-') {\n\t\tminus=true;\n\t\tc=readByte();\n\t }\n\t long res = 0;\n\t do{\n\t\tif(c<'0'||c>'9') throw new InputMismatchException();\n\t\tres=res*10+c-'0';\n\t\tc=readByte();\n\t }while(!isSpaceChar(c));\n\t return (minus)?-res:res;\n\t}\n \n\tpublic double nextDouble(){return Double.parseDouble(next());}\n \n\tpublic int[] nextIntArray(int n){\n\t int[] a=new int[n];\n\t for(int i=0;i<n;i++)\n\t\ta[i]=nextInt();\n\t return a;\n\t}\n \n\tpublic char[][] nextCharMap(int n,int m){\n\t char[][] map=new char[n][m];\n\t for(int i=0;i<n;i++)\n\t\tmap[i]=next().toCharArray();\n\t return map;\n\t}\n }\n}\n",
"import java.io.InputStream;",
"InputStream",
"java.io",
"import java.io.IOException;",
"IOException",
"java.io",
"import java.io.PrintWriter;",
"PrintWriter",
"java.io",
"import java.util.ArrayDeque;",
"ArrayDeque",
"java.util",
"import java.util.Deque;",
"Deque",
"java.util",
"import java.util.InputMismatchException;",
"InputMismatchException",
"java.util",
"import java.util.NoSuchElementException;",
"NoSuchElementException",
"java.util",
"import java.util.PriorityQueue;",
"PriorityQueue",
"java.util",
"public class Main{\n \n static InputReader ir;\n static PrintWriter out;\n\n static void solve(){\n Deque<Integer> stk=new ArrayDeque<Integer>();\n\twhile(ir.hasNext()){\n\t String s=ir.next();\n\t if(s.charAt(0)=='+'){\n\t\tint a=stk.pollFirst();\n\t\tint b=stk.pollFirst();\n\t\tstk.offerFirst(a+b);\n\t }\n\t else if(s.charAt(0)=='-'){\n\t\tint a=stk.pollFirst();\n\t\tint b=stk.pollFirst();\n\t\tstk.offerFirst(b-a);\n\t }\n\t else if(s.charAt(0)=='*'){\n\t\tint a=stk.pollFirst();\n\t\tint b=stk.pollFirst();\n\t\tstk.offerFirst(a*b);\n\t }\n\t else{\n\t stk.offerFirst(Integer.parseInt(s));\n\t }\n\t}\n\tout.println(stk.pollFirst());\n }\n \n public static void main(String[] args) throws Exception {\n\tir = new InputReader(System.in);\n \tout = new PrintWriter(System.out);\n\tsolve();\n\tout.flush();\n }\n \n static class InputReader {\n\tprivate InputStream in;\n\tprivate byte[] buffer=new byte[1024];\n\tprivate int curbuf;\n\tprivate int lenbuf;\n\n\tpublic InputReader(InputStream in) {this.in=in; this.curbuf=this.lenbuf=0;}\n \n\tpublic boolean hasNextByte() {\n\t if(curbuf>=lenbuf){\n\t\tcurbuf= 0;\n\t\ttry{\n\t\t lenbuf=in.read(buffer);\n\t\t}catch(IOException e) {\n\t\t throw new InputMismatchException();\n\t\t}\n\t\tif(lenbuf<=0) return false;\n\t }\n\t return true;\n\t}\n \n\tprivate int readByte(){if(hasNextByte()) return buffer[curbuf++]; else return -1;}\n \n\tprivate boolean isSpaceChar(int c){return !(c>=33&&c<=126);}\n \n\tprivate void skip(){while(hasNextByte()&&isSpaceChar(buffer[curbuf])) curbuf++;}\n \n\tpublic boolean hasNext(){skip(); return hasNextByte();}\n \n\tpublic String next(){\n\t if(!hasNext()) throw new NoSuchElementException();\n\t StringBuilder sb=new StringBuilder();\n\t int b=readByte();\n\t while(!isSpaceChar(b)){\n\t\tsb.appendCodePoint(b);\n\t\tb=readByte();\n\t }\n\t return sb.toString();\n\t}\n \n\tpublic int nextInt() {\n\t if(!hasNext()) throw new NoSuchElementException();\n\t int c=readByte();\n\t while (isSpaceChar(c)) c=readByte();\n\t boolean minus=false;\n\t if (c=='-') {\n\t\tminus=true;\n\t\tc=readByte();\n\t }\n\t int res=0;\n\t do{\n\t\tif(c<'0'||c>'9') throw new InputMismatchException();\n\t\tres=res*10+c-'0';\n\t\tc=readByte();\n\t }while(!isSpaceChar(c));\n\t return (minus)?-res:res;\n\t}\n \n\tpublic long nextLong() {\n\t if(!hasNext()) throw new NoSuchElementException();\n\t int c=readByte();\n\t while (isSpaceChar(c)) c=readByte();\n\t boolean minus=false;\n\t if (c=='-') {\n\t\tminus=true;\n\t\tc=readByte();\n\t }\n\t long res = 0;\n\t do{\n\t\tif(c<'0'||c>'9') throw new InputMismatchException();\n\t\tres=res*10+c-'0';\n\t\tc=readByte();\n\t }while(!isSpaceChar(c));\n\t return (minus)?-res:res;\n\t}\n \n\tpublic double nextDouble(){return Double.parseDouble(next());}\n \n\tpublic int[] nextIntArray(int n){\n\t int[] a=new int[n];\n\t for(int i=0;i<n;i++)\n\t\ta[i]=nextInt();\n\t return a;\n\t}\n \n\tpublic char[][] nextCharMap(int n,int m){\n\t char[][] map=new char[n][m];\n\t for(int i=0;i<n;i++)\n\t\tmap[i]=next().toCharArray();\n\t return map;\n\t}\n }\n}",
"Main",
"static InputReader ir;",
"ir",
"static PrintWriter out;",
"out",
"static void solve(){\n Deque<Integer> stk=new ArrayDeque<Integer>();\n\twhile(ir.hasNext()){\n\t String s=ir.next();\n\t if(s.charAt(0)=='+'){\n\t\tint a=stk.pollFirst();\n\t\tint b=stk.pollFirst();\n\t\tstk.offerFirst(a+b);\n\t }\n\t else if(s.charAt(0)=='-'){\n\t\tint a=stk.pollFirst();\n\t\tint b=stk.pollFirst();\n\t\tstk.offerFirst(b-a);\n\t }\n\t else if(s.charAt(0)=='*'){\n\t\tint a=stk.pollFirst();\n\t\tint b=stk.pollFirst();\n\t\tstk.offerFirst(a*b);\n\t }\n\t else{\n\t stk.offerFirst(Integer.parseInt(s));\n\t }\n\t}\n\tout.println(stk.pollFirst());\n }",
"solve",
"{\n Deque<Integer> stk=new ArrayDeque<Integer>();\n\twhile(ir.hasNext()){\n\t String s=ir.next();\n\t if(s.charAt(0)=='+'){\n\t\tint a=stk.pollFirst();\n\t\tint b=stk.pollFirst();\n\t\tstk.offerFirst(a+b);\n\t }\n\t else if(s.charAt(0)=='-'){\n\t\tint a=stk.pollFirst();\n\t\tint b=stk.pollFirst();\n\t\tstk.offerFirst(b-a);\n\t }\n\t else if(s.charAt(0)=='*'){\n\t\tint a=stk.pollFirst();\n\t\tint b=stk.pollFirst();\n\t\tstk.offerFirst(a*b);\n\t }\n\t else{\n\t stk.offerFirst(Integer.parseInt(s));\n\t }\n\t}\n\tout.println(stk.pollFirst());\n }",
"Deque<Integer> stk=new ArrayDeque<Integer>();",
"stk",
"new ArrayDeque<Integer>()",
"while(ir.hasNext()){\n\t String s=ir.next();\n\t if(s.charAt(0)=='+'){\n\t\tint a=stk.pollFirst();\n\t\tint b=stk.pollFirst();\n\t\tstk.offerFirst(a+b);\n\t }\n\t else if(s.charAt(0)=='-'){\n\t\tint a=stk.pollFirst();\n\t\tint b=stk.pollFirst();\n\t\tstk.offerFirst(b-a);\n\t }\n\t else if(s.charAt(0)=='*'){\n\t\tint a=stk.pollFirst();\n\t\tint b=stk.pollFirst();\n\t\tstk.offerFirst(a*b);\n\t }\n\t else{\n\t stk.offerFirst(Integer.parseInt(s));\n\t }\n\t}",
"ir.hasNext()",
"ir.hasNext",
"ir",
"{\n\t String s=ir.next();\n\t if(s.charAt(0)=='+'){\n\t\tint a=stk.pollFirst();\n\t\tint b=stk.pollFirst();\n\t\tstk.offerFirst(a+b);\n\t }\n\t else if(s.charAt(0)=='-'){\n\t\tint a=stk.pollFirst();\n\t\tint b=stk.pollFirst();\n\t\tstk.offerFirst(b-a);\n\t }\n\t else if(s.charAt(0)=='*'){\n\t\tint a=stk.pollFirst();\n\t\tint b=stk.pollFirst();\n\t\tstk.offerFirst(a*b);\n\t }\n\t else{\n\t stk.offerFirst(Integer.parseInt(s));\n\t }\n\t}",
"String s=ir.next();",
"s",
"ir.next()",
"ir.next",
"ir",
"if(s.charAt(0)=='+'){\n\t\tint a=stk.pollFirst();\n\t\tint b=stk.pollFirst();\n\t\tstk.offerFirst(a+b);\n\t }\n\t else if(s.charAt(0)=='-'){\n\t\tint a=stk.pollFirst();\n\t\tint b=stk.pollFirst();\n\t\tstk.offerFirst(b-a);\n\t }\n\t else if(s.charAt(0)=='*'){\n\t\tint a=stk.pollFirst();\n\t\tint b=stk.pollFirst();\n\t\tstk.offerFirst(a*b);\n\t }\n\t else{\n\t stk.offerFirst(Integer.parseInt(s));\n\t }",
"s.charAt(0)=='+'",
"s.charAt(0)",
"s.charAt",
"s",
"0",
"'+'",
"{\n\t\tint a=stk.pollFirst();\n\t\tint b=stk.pollFirst();\n\t\tstk.offerFirst(a+b);\n\t }",
"int a=stk.pollFirst();",
"a",
"stk.pollFirst()",
"stk.pollFirst",
"stk",
"int b=stk.pollFirst();",
"b",
"stk.pollFirst()",
"stk.pollFirst",
"stk",
"stk.offerFirst(a+b)",
"stk.offerFirst",
"stk",
"a+b",
"a",
"b",
"if(s.charAt(0)=='-'){\n\t\tint a=stk.pollFirst();\n\t\tint b=stk.pollFirst();\n\t\tstk.offerFirst(b-a);\n\t }\n\t else if(s.charAt(0)=='*'){\n\t\tint a=stk.pollFirst();\n\t\tint b=stk.pollFirst();\n\t\tstk.offerFirst(a*b);\n\t }\n\t else{\n\t stk.offerFirst(Integer.parseInt(s));\n\t }",
"s.charAt(0)=='-'",
"s.charAt(0)",
"s.charAt",
"s",
"0",
"'-'",
"{\n\t\tint a=stk.pollFirst();\n\t\tint b=stk.pollFirst();\n\t\tstk.offerFirst(b-a);\n\t }",
"int a=stk.pollFirst();",
"a",
"stk.pollFirst()",
"stk.pollFirst",
"stk",
"int b=stk.pollFirst();",
"b",
"stk.pollFirst()",
"stk.pollFirst",
"stk",
"stk.offerFirst(b-a)",
"stk.offerFirst",
"stk",
"b-a",
"b",
"a",
"if(s.charAt(0)=='*'){\n\t\tint a=stk.pollFirst();\n\t\tint b=stk.pollFirst();\n\t\tstk.offerFirst(a*b);\n\t }\n\t else{\n\t stk.offerFirst(Integer.parseInt(s));\n\t }",
"s.charAt(0)=='*'",
"s.charAt(0)",
"s.charAt",
"s",
"0",
"'*'",
"{\n\t\tint a=stk.pollFirst();\n\t\tint b=stk.pollFirst();\n\t\tstk.offerFirst(a*b);\n\t }",
"int a=stk.pollFirst();",
"a",
"stk.pollFirst()",
"stk.pollFirst",
"stk",
"int b=stk.pollFirst();",
"b",
"stk.pollFirst()",
"stk.pollFirst",
"stk",
"stk.offerFirst(a*b)",
"stk.offerFirst",
"stk",
"a*b",
"a",
"b",
"{\n\t stk.offerFirst(Integer.parseInt(s));\n\t }",
"stk.offerFirst(Integer.parseInt(s))",
"stk.offerFirst",
"stk",
"Integer.parseInt(s)",
"Integer.parseInt",
"Integer",
"s",
"out.println(stk.pollFirst())",
"out.println",
"out",
"stk.pollFirst()",
"stk.pollFirst",
"stk",
"public static void main(String[] args) throws Exception {\n\tir = new InputReader(System.in);\n \tout = new PrintWriter(System.out);\n\tsolve();\n\tout.flush();\n }",
"main",
"{\n\tir = new InputReader(System.in);\n \tout = new PrintWriter(System.out);\n\tsolve();\n\tout.flush();\n }",
"ir = new InputReader(System.in)",
"ir",
"new InputReader(System.in)",
"out = new PrintWriter(System.out)",
"out",
"new PrintWriter(System.out)",
"solve()",
"solve",
"out.flush()",
"out.flush",
"out",
"String[] args",
"args",
"static class InputReader {\n\tprivate InputStream in;\n\tprivate byte[] buffer=new byte[1024];\n\tprivate int curbuf;\n\tprivate int lenbuf;\n\n\tpublic InputReader(InputStream in) {this.in=in; this.curbuf=this.lenbuf=0;}\n \n\tpublic boolean hasNextByte() {\n\t if(curbuf>=lenbuf){\n\t\tcurbuf= 0;\n\t\ttry{\n\t\t lenbuf=in.read(buffer);\n\t\t}catch(IOException e) {\n\t\t throw new InputMismatchException();\n\t\t}\n\t\tif(lenbuf<=0) return false;\n\t }\n\t return true;\n\t}\n \n\tprivate int readByte(){if(hasNextByte()) return buffer[curbuf++]; else return -1;}\n \n\tprivate boolean isSpaceChar(int c){return !(c>=33&&c<=126);}\n \n\tprivate void skip(){while(hasNextByte()&&isSpaceChar(buffer[curbuf])) curbuf++;}\n \n\tpublic boolean hasNext(){skip(); return hasNextByte();}\n \n\tpublic String next(){\n\t if(!hasNext()) throw new NoSuchElementException();\n\t StringBuilder sb=new StringBuilder();\n\t int b=readByte();\n\t while(!isSpaceChar(b)){\n\t\tsb.appendCodePoint(b);\n\t\tb=readByte();\n\t }\n\t return sb.toString();\n\t}\n \n\tpublic int nextInt() {\n\t if(!hasNext()) throw new NoSuchElementException();\n\t int c=readByte();\n\t while (isSpaceChar(c)) c=readByte();\n\t boolean minus=false;\n\t if (c=='-') {\n\t\tminus=true;\n\t\tc=readByte();\n\t }\n\t int res=0;\n\t do{\n\t\tif(c<'0'||c>'9') throw new InputMismatchException();\n\t\tres=res*10+c-'0';\n\t\tc=readByte();\n\t }while(!isSpaceChar(c));\n\t return (minus)?-res:res;\n\t}\n \n\tpublic long nextLong() {\n\t if(!hasNext()) throw new NoSuchElementException();\n\t int c=readByte();\n\t while (isSpaceChar(c)) c=readByte();\n\t boolean minus=false;\n\t if (c=='-') {\n\t\tminus=true;\n\t\tc=readByte();\n\t }\n\t long res = 0;\n\t do{\n\t\tif(c<'0'||c>'9') throw new InputMismatchException();\n\t\tres=res*10+c-'0';\n\t\tc=readByte();\n\t }while(!isSpaceChar(c));\n\t return (minus)?-res:res;\n\t}\n \n\tpublic double nextDouble(){return Double.parseDouble(next());}\n \n\tpublic int[] nextIntArray(int n){\n\t int[] a=new int[n];\n\t for(int i=0;i<n;i++)\n\t\ta[i]=nextInt();\n\t return a;\n\t}\n \n\tpublic char[][] nextCharMap(int n,int m){\n\t char[][] map=new char[n][m];\n\t for(int i=0;i<n;i++)\n\t\tmap[i]=next().toCharArray();\n\t return map;\n\t}\n }",
"InputReader",
"private InputStream in;",
"in",
"private byte[] buffer=new byte[1024];",
"buffer",
"new byte[1024]",
"1024",
"private int curbuf;",
"curbuf",
"private int lenbuf;",
"lenbuf",
"public InputReader(InputStream in) {this.in=in; this.curbuf=this.lenbuf=0;}",
"InputReader",
"{this.in=in; this.curbuf=this.lenbuf=0;}",
"this.in=in",
"this.in",
"this",
"this.in",
"in",
"this.curbuf=this.lenbuf=0",
"this.curbuf",
"this",
"this.curbuf",
"this.lenbuf=0",
"this.lenbuf",
"this",
"this.lenbuf",
"0",
"InputStream in",
"in",
"public boolean hasNextByte() {\n\t if(curbuf>=lenbuf){\n\t\tcurbuf= 0;\n\t\ttry{\n\t\t lenbuf=in.read(buffer);\n\t\t}catch(IOException e) {\n\t\t throw new InputMismatchException();\n\t\t}\n\t\tif(lenbuf<=0) return false;\n\t }\n\t return true;\n\t}",
"hasNextByte",
"{\n\t if(curbuf>=lenbuf){\n\t\tcurbuf= 0;\n\t\ttry{\n\t\t lenbuf=in.read(buffer);\n\t\t}catch(IOException e) {\n\t\t throw new InputMismatchException();\n\t\t}\n\t\tif(lenbuf<=0) return false;\n\t }\n\t return true;\n\t}",
"if(curbuf>=lenbuf){\n\t\tcurbuf= 0;\n\t\ttry{\n\t\t lenbuf=in.read(buffer);\n\t\t}catch(IOException e) {\n\t\t throw new InputMismatchException();\n\t\t}\n\t\tif(lenbuf<=0) return false;\n\t }",
"curbuf>=lenbuf",
"curbuf",
"lenbuf",
"{\n\t\tcurbuf= 0;\n\t\ttry{\n\t\t lenbuf=in.read(buffer);\n\t\t}catch(IOException e) {\n\t\t throw new InputMismatchException();\n\t\t}\n\t\tif(lenbuf<=0) return false;\n\t }",
"curbuf= 0",
"curbuf",
"0",
"try{\n\t\t lenbuf=in.read(buffer);\n\t\t}catch(IOException e) {\n\t\t throw new InputMismatchException();\n\t\t}",
"catch(IOException e) {\n\t\t throw new InputMismatchException();\n\t\t}",
"IOException e",
"{\n\t\t throw new InputMismatchException();\n\t\t}",
"throw new InputMismatchException();",
"new InputMismatchException()",
"{\n\t\t lenbuf=in.read(buffer);\n\t\t}",
"lenbuf=in.read(buffer)",
"lenbuf",
"in.read(buffer)",
"in.read",
"in",
"buffer",
"if(lenbuf<=0) return false;",
"lenbuf<=0",
"lenbuf",
"0",
"return false;",
"false",
"return true;",
"true",
"private int readByte(){if(hasNextByte()) return buffer[curbuf++]; else return -1;}",
"readByte",
"{if(hasNextByte()) return buffer[curbuf++]; else return -1;}",
"if(hasNextByte()) return buffer[curbuf++]; else return -1;",
"hasNextByte()",
"hasNextByte",
"return buffer[curbuf++];",
"buffer[curbuf++]",
"buffer",
"curbuf++",
"curbuf",
"return -1;",
"-1",
"1",
"private boolean isSpaceChar(int c){return !(c>=33&&c<=126);}",
"isSpaceChar",
"{return !(c>=33&&c<=126);}",
"return !(c>=33&&c<=126);",
"!(c>=33&&c<=126)",
"(c>=33&&c<=126)",
"c>=33",
"c",
"33",
"c<=126",
"c",
"126",
"int c",
"c",
"private void skip(){while(hasNextByte()&&isSpaceChar(buffer[curbuf])) curbuf++;}",
"skip",
"{while(hasNextByte()&&isSpaceChar(buffer[curbuf])) curbuf++;}",
"while(hasNextByte()&&isSpaceChar(buffer[curbuf])) curbuf++;",
"hasNextByte()&&isSpaceChar(buffer[curbuf])",
"hasNextByte()",
"hasNextByte",
"isSpaceChar(buffer[curbuf])",
"isSpaceChar",
"buffer[curbuf]",
"buffer",
"curbuf",
"curbuf++",
"curbuf",
"public boolean hasNext(){skip(); return hasNextByte();}",
"hasNext",
"{skip(); return hasNextByte();}",
"skip()",
"skip",
"return hasNextByte();",
"hasNextByte()",
"hasNextByte",
"public String next(){\n\t if(!hasNext()) throw new NoSuchElementException();\n\t StringBuilder sb=new StringBuilder();\n\t int b=readByte();\n\t while(!isSpaceChar(b)){\n\t\tsb.appendCodePoint(b);\n\t\tb=readByte();\n\t }\n\t return sb.toString();\n\t}",
"next",
"{\n\t if(!hasNext()) throw new NoSuchElementException();\n\t StringBuilder sb=new StringBuilder();\n\t int b=readByte();\n\t while(!isSpaceChar(b)){\n\t\tsb.appendCodePoint(b);\n\t\tb=readByte();\n\t }\n\t return sb.toString();\n\t}",
"if(!hasNext()) throw new NoSuchElementException();",
"!hasNext()",
"hasNext()",
"hasNext",
"throw new NoSuchElementException();",
"new NoSuchElementException()",
"StringBuilder sb=new StringBuilder();",
"sb",
"new StringBuilder()",
"int b=readByte();",
"b",
"readByte()",
"readByte",
"while(!isSpaceChar(b)){\n\t\tsb.appendCodePoint(b);\n\t\tb=readByte();\n\t }",
"!isSpaceChar(b)",
"isSpaceChar(b)",
"isSpaceChar",
"b",
"{\n\t\tsb.appendCodePoint(b);\n\t\tb=readByte();\n\t }",
"sb.appendCodePoint(b)",
"sb.appendCodePoint",
"sb",
"b",
"b=readByte()",
"b",
"readByte()",
"readByte",
"return sb.toString();",
"sb.toString()",
"sb.toString",
"sb",
"public int nextInt() {\n\t if(!hasNext()) throw new NoSuchElementException();\n\t int c=readByte();\n\t while (isSpaceChar(c)) c=readByte();\n\t boolean minus=false;\n\t if (c=='-') {\n\t\tminus=true;\n\t\tc=readByte();\n\t }\n\t int res=0;\n\t do{\n\t\tif(c<'0'||c>'9') throw new InputMismatchException();\n\t\tres=res*10+c-'0';\n\t\tc=readByte();\n\t }while(!isSpaceChar(c));\n\t return (minus)?-res:res;\n\t}",
"nextInt",
"{\n\t if(!hasNext()) throw new NoSuchElementException();\n\t int c=readByte();\n\t while (isSpaceChar(c)) c=readByte();\n\t boolean minus=false;\n\t if (c=='-') {\n\t\tminus=true;\n\t\tc=readByte();\n\t }\n\t int res=0;\n\t do{\n\t\tif(c<'0'||c>'9') throw new InputMismatchException();\n\t\tres=res*10+c-'0';\n\t\tc=readByte();\n\t }while(!isSpaceChar(c));\n\t return (minus)?-res:res;\n\t}",
"if(!hasNext()) throw new NoSuchElementException();",
"!hasNext()",
"hasNext()",
"hasNext",
"throw new NoSuchElementException();",
"new NoSuchElementException()",
"int c=readByte();",
"c",
"readByte()",
"readByte",
"while (isSpaceChar(c)) c=readByte();",
"isSpaceChar(c)",
"isSpaceChar",
"c",
"c=readByte()",
"c",
"readByte()",
"readByte",
"boolean minus=false;",
"minus",
"false",
"if (c=='-') {\n\t\tminus=true;\n\t\tc=readByte();\n\t }",
"c=='-'",
"c",
"'-'",
"{\n\t\tminus=true;\n\t\tc=readByte();\n\t }",
"minus=true",
"minus",
"true",
"c=readByte()",
"c",
"readByte()",
"readByte",
"int res=0;",
"res",
"0",
"do{\n\t\tif(c<'0'||c>'9') throw new InputMismatchException();\n\t\tres=res*10+c-'0';\n\t\tc=readByte();\n\t }while(!isSpaceChar(c));",
"!isSpaceChar(c)",
"isSpaceChar(c)",
"isSpaceChar",
"c",
"{\n\t\tif(c<'0'||c>'9') throw new InputMismatchException();\n\t\tres=res*10+c-'0';\n\t\tc=readByte();\n\t }",
"if(c<'0'||c>'9') throw new InputMismatchException();",
"c<'0'||c>'9'",
"c<'0'",
"c",
"'0'",
"c>'9'",
"c",
"'9'",
"throw new InputMismatchException();",
"new InputMismatchException()",
"res=res*10+c-'0'",
"res",
"res*10+c-'0'",
"res*10+c",
"res*10",
"res",
"10",
"c",
"'0'",
"c=readByte()",
"c",
"readByte()",
"readByte",
"return (minus)?-res:res;",
"(minus)?-res:res",
"(minus)",
"-res",
"res",
"res",
"public long nextLong() {\n\t if(!hasNext()) throw new NoSuchElementException();\n\t int c=readByte();\n\t while (isSpaceChar(c)) c=readByte();\n\t boolean minus=false;\n\t if (c=='-') {\n\t\tminus=true;\n\t\tc=readByte();\n\t }\n\t long res = 0;\n\t do{\n\t\tif(c<'0'||c>'9') throw new InputMismatchException();\n\t\tres=res*10+c-'0';\n\t\tc=readByte();\n\t }while(!isSpaceChar(c));\n\t return (minus)?-res:res;\n\t}",
"nextLong",
"{\n\t if(!hasNext()) throw new NoSuchElementException();\n\t int c=readByte();\n\t while (isSpaceChar(c)) c=readByte();\n\t boolean minus=false;\n\t if (c=='-') {\n\t\tminus=true;\n\t\tc=readByte();\n\t }\n\t long res = 0;\n\t do{\n\t\tif(c<'0'||c>'9') throw new InputMismatchException();\n\t\tres=res*10+c-'0';\n\t\tc=readByte();\n\t }while(!isSpaceChar(c));\n\t return (minus)?-res:res;\n\t}",
"if(!hasNext()) throw new NoSuchElementException();",
"!hasNext()",
"hasNext()",
"hasNext",
"throw new NoSuchElementException();",
"new NoSuchElementException()",
"int c=readByte();",
"c",
"readByte()",
"readByte",
"while (isSpaceChar(c)) c=readByte();",
"isSpaceChar(c)",
"isSpaceChar",
"c",
"c=readByte()",
"c",
"readByte()",
"readByte",
"boolean minus=false;",
"minus",
"false",
"if (c=='-') {\n\t\tminus=true;\n\t\tc=readByte();\n\t }",
"c=='-'",
"c",
"'-'",
"{\n\t\tminus=true;\n\t\tc=readByte();\n\t }",
"minus=true",
"minus",
"true",
"c=readByte()",
"c",
"readByte()",
"readByte",
"long res = 0;",
"res",
"0",
"do{\n\t\tif(c<'0'||c>'9') throw new InputMismatchException();\n\t\tres=res*10+c-'0';\n\t\tc=readByte();\n\t }while(!isSpaceChar(c));",
"!isSpaceChar(c)",
"isSpaceChar(c)",
"isSpaceChar",
"c",
"{\n\t\tif(c<'0'||c>'9') throw new InputMismatchException();\n\t\tres=res*10+c-'0';\n\t\tc=readByte();\n\t }",
"if(c<'0'||c>'9') throw new InputMismatchException();",
"c<'0'||c>'9'",
"c<'0'",
"c",
"'0'",
"c>'9'",
"c",
"'9'",
"throw new InputMismatchException();",
"new InputMismatchException()",
"res=res*10+c-'0'",
"res",
"res*10+c-'0'",
"res*10+c",
"res*10",
"res",
"10",
"c",
"'0'",
"c=readByte()",
"c",
"readByte()",
"readByte",
"return (minus)?-res:res;",
"(minus)?-res:res",
"(minus)",
"-res",
"res",
"res",
"public double nextDouble(){return Double.parseDouble(next());}",
"nextDouble",
"{return Double.parseDouble(next());}",
"return Double.parseDouble(next());",
"Double.parseDouble(next())",
"Double.parseDouble",
"Double",
"next()",
"next",
"public int[] nextIntArray(int n){\n\t int[] a=new int[n];\n\t for(int i=0;i<n;i++)\n\t\ta[i]=nextInt();\n\t return a;\n\t}",
"nextIntArray",
"{\n\t int[] a=new int[n];\n\t for(int i=0;i<n;i++)\n\t\ta[i]=nextInt();\n\t return a;\n\t}",
"int[] a=new int[n];",
"a",
"new int[n]",
"n",
"for(int i=0;i<n;i++)\n\t\ta[i]=nextInt();",
"int i=0;",
"int i=0;",
"i",
"0",
"i<n",
"i",
"n",
"i++",
"i++",
"i",
"a[i]=nextInt();",
"a[i]=nextInt()",
"a[i]",
"a",
"i",
"nextInt()",
"nextInt",
"return a;",
"a",
"int n",
"n",
"public char[][] nextCharMap(int n,int m){\n\t char[][] map=new char[n][m];\n\t for(int i=0;i<n;i++)\n\t\tmap[i]=next().toCharArray();\n\t return map;\n\t}",
"nextCharMap",
"{\n\t char[][] map=new char[n][m];\n\t for(int i=0;i<n;i++)\n\t\tmap[i]=next().toCharArray();\n\t return map;\n\t}",
"char[][] map=new char[n][m];",
"map",
"new char[n][m]",
"n",
"m",
"for(int i=0;i<n;i++)\n\t\tmap[i]=next().toCharArray();",
"int i=0;",
"int i=0;",
"i",
"0",
"i<n",
"i",
"n",
"i++",
"i++",
"i",
"map[i]=next().toCharArray();",
"map[i]=next().toCharArray()",
"map[i]",
"map",
"i",
"next().toCharArray()",
"next().toCharArray",
"next()",
"next",
"return map;",
"map",
"int n",
"n",
"int m",
"m",
"public class Main{\n \n static InputReader ir;\n static PrintWriter out;\n\n static void solve(){\n Deque<Integer> stk=new ArrayDeque<Integer>();\n\twhile(ir.hasNext()){\n\t String s=ir.next();\n\t if(s.charAt(0)=='+'){\n\t\tint a=stk.pollFirst();\n\t\tint b=stk.pollFirst();\n\t\tstk.offerFirst(a+b);\n\t }\n\t else if(s.charAt(0)=='-'){\n\t\tint a=stk.pollFirst();\n\t\tint b=stk.pollFirst();\n\t\tstk.offerFirst(b-a);\n\t }\n\t else if(s.charAt(0)=='*'){\n\t\tint a=stk.pollFirst();\n\t\tint b=stk.pollFirst();\n\t\tstk.offerFirst(a*b);\n\t }\n\t else{\n\t stk.offerFirst(Integer.parseInt(s));\n\t }\n\t}\n\tout.println(stk.pollFirst());\n }\n \n public static void main(String[] args) throws Exception {\n\tir = new InputReader(System.in);\n \tout = new PrintWriter(System.out);\n\tsolve();\n\tout.flush();\n }\n \n static class InputReader {\n\tprivate InputStream in;\n\tprivate byte[] buffer=new byte[1024];\n\tprivate int curbuf;\n\tprivate int lenbuf;\n\n\tpublic InputReader(InputStream in) {this.in=in; this.curbuf=this.lenbuf=0;}\n \n\tpublic boolean hasNextByte() {\n\t if(curbuf>=lenbuf){\n\t\tcurbuf= 0;\n\t\ttry{\n\t\t lenbuf=in.read(buffer);\n\t\t}catch(IOException e) {\n\t\t throw new InputMismatchException();\n\t\t}\n\t\tif(lenbuf<=0) return false;\n\t }\n\t return true;\n\t}\n \n\tprivate int readByte(){if(hasNextByte()) return buffer[curbuf++]; else return -1;}\n \n\tprivate boolean isSpaceChar(int c){return !(c>=33&&c<=126);}\n \n\tprivate void skip(){while(hasNextByte()&&isSpaceChar(buffer[curbuf])) curbuf++;}\n \n\tpublic boolean hasNext(){skip(); return hasNextByte();}\n \n\tpublic String next(){\n\t if(!hasNext()) throw new NoSuchElementException();\n\t StringBuilder sb=new StringBuilder();\n\t int b=readByte();\n\t while(!isSpaceChar(b)){\n\t\tsb.appendCodePoint(b);\n\t\tb=readByte();\n\t }\n\t return sb.toString();\n\t}\n \n\tpublic int nextInt() {\n\t if(!hasNext()) throw new NoSuchElementException();\n\t int c=readByte();\n\t while (isSpaceChar(c)) c=readByte();\n\t boolean minus=false;\n\t if (c=='-') {\n\t\tminus=true;\n\t\tc=readByte();\n\t }\n\t int res=0;\n\t do{\n\t\tif(c<'0'||c>'9') throw new InputMismatchException();\n\t\tres=res*10+c-'0';\n\t\tc=readByte();\n\t }while(!isSpaceChar(c));\n\t return (minus)?-res:res;\n\t}\n \n\tpublic long nextLong() {\n\t if(!hasNext()) throw new NoSuchElementException();\n\t int c=readByte();\n\t while (isSpaceChar(c)) c=readByte();\n\t boolean minus=false;\n\t if (c=='-') {\n\t\tminus=true;\n\t\tc=readByte();\n\t }\n\t long res = 0;\n\t do{\n\t\tif(c<'0'||c>'9') throw new InputMismatchException();\n\t\tres=res*10+c-'0';\n\t\tc=readByte();\n\t }while(!isSpaceChar(c));\n\t return (minus)?-res:res;\n\t}\n \n\tpublic double nextDouble(){return Double.parseDouble(next());}\n \n\tpublic int[] nextIntArray(int n){\n\t int[] a=new int[n];\n\t for(int i=0;i<n;i++)\n\t\ta[i]=nextInt();\n\t return a;\n\t}\n \n\tpublic char[][] nextCharMap(int n,int m){\n\t char[][] map=new char[n][m];\n\t for(int i=0;i<n;i++)\n\t\tmap[i]=next().toCharArray();\n\t return map;\n\t}\n }\n}",
"public class Main{\n \n static InputReader ir;\n static PrintWriter out;\n\n static void solve(){\n Deque<Integer> stk=new ArrayDeque<Integer>();\n\twhile(ir.hasNext()){\n\t String s=ir.next();\n\t if(s.charAt(0)=='+'){\n\t\tint a=stk.pollFirst();\n\t\tint b=stk.pollFirst();\n\t\tstk.offerFirst(a+b);\n\t }\n\t else if(s.charAt(0)=='-'){\n\t\tint a=stk.pollFirst();\n\t\tint b=stk.pollFirst();\n\t\tstk.offerFirst(b-a);\n\t }\n\t else if(s.charAt(0)=='*'){\n\t\tint a=stk.pollFirst();\n\t\tint b=stk.pollFirst();\n\t\tstk.offerFirst(a*b);\n\t }\n\t else{\n\t stk.offerFirst(Integer.parseInt(s));\n\t }\n\t}\n\tout.println(stk.pollFirst());\n }\n \n public static void main(String[] args) throws Exception {\n\tir = new InputReader(System.in);\n \tout = new PrintWriter(System.out);\n\tsolve();\n\tout.flush();\n }\n \n static class InputReader {\n\tprivate InputStream in;\n\tprivate byte[] buffer=new byte[1024];\n\tprivate int curbuf;\n\tprivate int lenbuf;\n\n\tpublic InputReader(InputStream in) {this.in=in; this.curbuf=this.lenbuf=0;}\n \n\tpublic boolean hasNextByte() {\n\t if(curbuf>=lenbuf){\n\t\tcurbuf= 0;\n\t\ttry{\n\t\t lenbuf=in.read(buffer);\n\t\t}catch(IOException e) {\n\t\t throw new InputMismatchException();\n\t\t}\n\t\tif(lenbuf<=0) return false;\n\t }\n\t return true;\n\t}\n \n\tprivate int readByte(){if(hasNextByte()) return buffer[curbuf++]; else return -1;}\n \n\tprivate boolean isSpaceChar(int c){return !(c>=33&&c<=126);}\n \n\tprivate void skip(){while(hasNextByte()&&isSpaceChar(buffer[curbuf])) curbuf++;}\n \n\tpublic boolean hasNext(){skip(); return hasNextByte();}\n \n\tpublic String next(){\n\t if(!hasNext()) throw new NoSuchElementException();\n\t StringBuilder sb=new StringBuilder();\n\t int b=readByte();\n\t while(!isSpaceChar(b)){\n\t\tsb.appendCodePoint(b);\n\t\tb=readByte();\n\t }\n\t return sb.toString();\n\t}\n \n\tpublic int nextInt() {\n\t if(!hasNext()) throw new NoSuchElementException();\n\t int c=readByte();\n\t while (isSpaceChar(c)) c=readByte();\n\t boolean minus=false;\n\t if (c=='-') {\n\t\tminus=true;\n\t\tc=readByte();\n\t }\n\t int res=0;\n\t do{\n\t\tif(c<'0'||c>'9') throw new InputMismatchException();\n\t\tres=res*10+c-'0';\n\t\tc=readByte();\n\t }while(!isSpaceChar(c));\n\t return (minus)?-res:res;\n\t}\n \n\tpublic long nextLong() {\n\t if(!hasNext()) throw new NoSuchElementException();\n\t int c=readByte();\n\t while (isSpaceChar(c)) c=readByte();\n\t boolean minus=false;\n\t if (c=='-') {\n\t\tminus=true;\n\t\tc=readByte();\n\t }\n\t long res = 0;\n\t do{\n\t\tif(c<'0'||c>'9') throw new InputMismatchException();\n\t\tres=res*10+c-'0';\n\t\tc=readByte();\n\t }while(!isSpaceChar(c));\n\t return (minus)?-res:res;\n\t}\n \n\tpublic double nextDouble(){return Double.parseDouble(next());}\n \n\tpublic int[] nextIntArray(int n){\n\t int[] a=new int[n];\n\t for(int i=0;i<n;i++)\n\t\ta[i]=nextInt();\n\t return a;\n\t}\n \n\tpublic char[][] nextCharMap(int n,int m){\n\t char[][] map=new char[n][m];\n\t for(int i=0;i<n;i++)\n\t\tmap[i]=next().toCharArray();\n\t return map;\n\t}\n }\n}",
"Main"
] | import java.io.InputStream;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayDeque;
import java.util.Deque;
import java.util.InputMismatchException;
import java.util.NoSuchElementException;
import java.util.PriorityQueue;
public class Main{
static InputReader ir;
static PrintWriter out;
static void solve(){
Deque<Integer> stk=new ArrayDeque<Integer>();
while(ir.hasNext()){
String s=ir.next();
if(s.charAt(0)=='+'){
int a=stk.pollFirst();
int b=stk.pollFirst();
stk.offerFirst(a+b);
}
else if(s.charAt(0)=='-'){
int a=stk.pollFirst();
int b=stk.pollFirst();
stk.offerFirst(b-a);
}
else if(s.charAt(0)=='*'){
int a=stk.pollFirst();
int b=stk.pollFirst();
stk.offerFirst(a*b);
}
else{
stk.offerFirst(Integer.parseInt(s));
}
}
out.println(stk.pollFirst());
}
public static void main(String[] args) throws Exception {
ir = new InputReader(System.in);
out = new PrintWriter(System.out);
solve();
out.flush();
}
static class InputReader {
private InputStream in;
private byte[] buffer=new byte[1024];
private int curbuf;
private int lenbuf;
public InputReader(InputStream in) {this.in=in; this.curbuf=this.lenbuf=0;}
public boolean hasNextByte() {
if(curbuf>=lenbuf){
curbuf= 0;
try{
lenbuf=in.read(buffer);
}catch(IOException e) {
throw new InputMismatchException();
}
if(lenbuf<=0) return false;
}
return true;
}
private int readByte(){if(hasNextByte()) return buffer[curbuf++]; else return -1;}
private boolean isSpaceChar(int c){return !(c>=33&&c<=126);}
private void skip(){while(hasNextByte()&&isSpaceChar(buffer[curbuf])) curbuf++;}
public boolean hasNext(){skip(); return hasNextByte();}
public String next(){
if(!hasNext()) throw new NoSuchElementException();
StringBuilder sb=new StringBuilder();
int b=readByte();
while(!isSpaceChar(b)){
sb.appendCodePoint(b);
b=readByte();
}
return sb.toString();
}
public int nextInt() {
if(!hasNext()) throw new NoSuchElementException();
int c=readByte();
while (isSpaceChar(c)) c=readByte();
boolean minus=false;
if (c=='-') {
minus=true;
c=readByte();
}
int res=0;
do{
if(c<'0'||c>'9') throw new InputMismatchException();
res=res*10+c-'0';
c=readByte();
}while(!isSpaceChar(c));
return (minus)?-res:res;
}
public long nextLong() {
if(!hasNext()) throw new NoSuchElementException();
int c=readByte();
while (isSpaceChar(c)) c=readByte();
boolean minus=false;
if (c=='-') {
minus=true;
c=readByte();
}
long res = 0;
do{
if(c<'0'||c>'9') throw new InputMismatchException();
res=res*10+c-'0';
c=readByte();
}while(!isSpaceChar(c));
return (minus)?-res:res;
}
public double nextDouble(){return Double.parseDouble(next());}
public int[] nextIntArray(int n){
int[] a=new int[n];
for(int i=0;i<n;i++)
a[i]=nextInt();
return a;
}
public char[][] nextCharMap(int n,int m){
char[][] map=new char[n][m];
for(int i=0;i<n;i++)
map[i]=next().toCharArray();
return map;
}
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
17,
41,
13,
20,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
30,
41,
13,
4,
18,
18,
13,
13,
17,
14,
2,
2,
13,
17,
2,
13,
17,
30,
4,
18,
13,
4,
18,
13,
18,
13,
13,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
14,
2,
13,
17,
30,
4,
18,
13,
2,
13,
13,
14,
2,
13,
17,
30,
4,
18,
13,
2,
13,
13,
30,
4,
18,
13,
2,
13,
13,
4,
18,
18,
13,
13,
4,
18,
13,
4,
18,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
124,
8
],
[
124,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
12,
14
],
[
11,
15
],
[
15,
16
],
[
15,
17
],
[
17,
18
],
[
18,
19
],
[
11,
20
],
[
20,
21
],
[
20,
22
],
[
22,
23
],
[
23,
24
],
[
22,
25
],
[
11,
26
],
[
26,
27
],
[
26,
28
],
[
11,
29
],
[
29,
30
],
[
30,
31
],
[
31,
32
],
[
31,
33
],
[
29,
34
],
[
34,
35
],
[
34,
36
],
[
36,
37
],
[
36,
38
],
[
29,
39
],
[
39,
40
],
[
40,
41
],
[
29,
42
],
[
43,
43
],
[
43,
44
],
[
44,
45
],
[
44,
46
],
[
46,
47
],
[
47,
48
],
[
48,
49
],
[
48,
50
],
[
46,
51
],
[
43,
52
],
[
52,
53
],
[
53,
54
],
[
54,
55
],
[
54,
56
],
[
53,
57
],
[
57,
58
],
[
57,
59
],
[
52,
60
],
[
60,
61
],
[
61,
62
],
[
62,
63
],
[
61,
64
],
[
64,
65
],
[
65,
66
],
[
64,
67
],
[
67,
68
],
[
67,
69
],
[
52,
70
],
[
70,
71
],
[
71,
72
],
[
71,
73
],
[
73,
74
],
[
74,
75
],
[
70,
76
],
[
76,
77
],
[
76,
78
],
[
78,
79
],
[
79,
80
],
[
70,
81
],
[
81,
82
],
[
82,
83
],
[
82,
84
],
[
81,
85
],
[
85,
86
],
[
86,
87
],
[
87,
88
],
[
86,
89
],
[
89,
90
],
[
89,
91
],
[
81,
92
],
[
92,
93
],
[
93,
94
],
[
93,
95
],
[
92,
96
],
[
96,
97
],
[
97,
98
],
[
98,
99
],
[
97,
100
],
[
100,
101
],
[
100,
102
],
[
92,
103
],
[
103,
104
],
[
104,
105
],
[
105,
106
],
[
104,
107
],
[
107,
108
],
[
107,
109
],
[
11,
110
],
[
110,
111
],
[
111,
112
],
[
112,
113
],
[
112,
114
],
[
110,
115
],
[
115,
116
],
[
116,
117
],
[
11,
118
],
[
118,
119
],
[
119,
120
],
[
9,
121
],
[
121,
122
],
[
0,
123
],
[
123,
124
],
[
123,
125
]
] | [
"import java.util.Scanner;\nimport java.util.Stack;\n\npublic class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tString op = sc.nextLine();\n\t\tString[] items = op.split(\" \");\n\n\t\tStack<Integer> stack = new Stack<>();\n\t\tfor (int i=0; i<items.length; i++) {\n\t\t\tchar c = items[i].charAt(0);\n\t\t\tif (c>='0'&&c<='9') {\n\t\t\t\tstack.push(Integer.parseInt(items[i]));\n\t\t\t} else {\n\t\t\t\tint b = stack.pop();\n\t\t\t\tint a = stack.pop();\n\t\t\t\tif (c=='+') {\n\t\t\t\t\tstack.push(a+b);\n\t\t\t\t} else if (c=='-') {\n\t\t\t\t\tstack.push(a-b);\n\t\t\t\t} else {\n\t\t\t\t\tstack.push(a*b);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.println(stack.pop());\n\n\t\tsc.close();\n\t}\n\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"import java.util.Stack;",
"Stack",
"java.util",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tString op = sc.nextLine();\n\t\tString[] items = op.split(\" \");\n\n\t\tStack<Integer> stack = new Stack<>();\n\t\tfor (int i=0; i<items.length; i++) {\n\t\t\tchar c = items[i].charAt(0);\n\t\t\tif (c>='0'&&c<='9') {\n\t\t\t\tstack.push(Integer.parseInt(items[i]));\n\t\t\t} else {\n\t\t\t\tint b = stack.pop();\n\t\t\t\tint a = stack.pop();\n\t\t\t\tif (c=='+') {\n\t\t\t\t\tstack.push(a+b);\n\t\t\t\t} else if (c=='-') {\n\t\t\t\t\tstack.push(a-b);\n\t\t\t\t} else {\n\t\t\t\t\tstack.push(a*b);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.println(stack.pop());\n\n\t\tsc.close();\n\t}\n\n}",
"Main",
"public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tString op = sc.nextLine();\n\t\tString[] items = op.split(\" \");\n\n\t\tStack<Integer> stack = new Stack<>();\n\t\tfor (int i=0; i<items.length; i++) {\n\t\t\tchar c = items[i].charAt(0);\n\t\t\tif (c>='0'&&c<='9') {\n\t\t\t\tstack.push(Integer.parseInt(items[i]));\n\t\t\t} else {\n\t\t\t\tint b = stack.pop();\n\t\t\t\tint a = stack.pop();\n\t\t\t\tif (c=='+') {\n\t\t\t\t\tstack.push(a+b);\n\t\t\t\t} else if (c=='-') {\n\t\t\t\t\tstack.push(a-b);\n\t\t\t\t} else {\n\t\t\t\t\tstack.push(a*b);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.println(stack.pop());\n\n\t\tsc.close();\n\t}",
"main",
"{\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tString op = sc.nextLine();\n\t\tString[] items = op.split(\" \");\n\n\t\tStack<Integer> stack = new Stack<>();\n\t\tfor (int i=0; i<items.length; i++) {\n\t\t\tchar c = items[i].charAt(0);\n\t\t\tif (c>='0'&&c<='9') {\n\t\t\t\tstack.push(Integer.parseInt(items[i]));\n\t\t\t} else {\n\t\t\t\tint b = stack.pop();\n\t\t\t\tint a = stack.pop();\n\t\t\t\tif (c=='+') {\n\t\t\t\t\tstack.push(a+b);\n\t\t\t\t} else if (c=='-') {\n\t\t\t\t\tstack.push(a-b);\n\t\t\t\t} else {\n\t\t\t\t\tstack.push(a*b);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.println(stack.pop());\n\n\t\tsc.close();\n\t}",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"String op = sc.nextLine();",
"op",
"sc.nextLine()",
"sc.nextLine",
"sc",
"String[] items = op.split(\" \");",
"items",
"op.split(\" \")",
"op.split",
"op",
"\" \"",
"Stack<Integer> stack = new Stack<>();",
"stack",
"new Stack<>()",
"for (int i=0; i<items.length; i++) {\n\t\t\tchar c = items[i].charAt(0);\n\t\t\tif (c>='0'&&c<='9') {\n\t\t\t\tstack.push(Integer.parseInt(items[i]));\n\t\t\t} else {\n\t\t\t\tint b = stack.pop();\n\t\t\t\tint a = stack.pop();\n\t\t\t\tif (c=='+') {\n\t\t\t\t\tstack.push(a+b);\n\t\t\t\t} else if (c=='-') {\n\t\t\t\t\tstack.push(a-b);\n\t\t\t\t} else {\n\t\t\t\t\tstack.push(a*b);\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<items.length",
"i",
"items.length",
"items",
"items.length",
"i++",
"i++",
"i",
"{\n\t\t\tchar c = items[i].charAt(0);\n\t\t\tif (c>='0'&&c<='9') {\n\t\t\t\tstack.push(Integer.parseInt(items[i]));\n\t\t\t} else {\n\t\t\t\tint b = stack.pop();\n\t\t\t\tint a = stack.pop();\n\t\t\t\tif (c=='+') {\n\t\t\t\t\tstack.push(a+b);\n\t\t\t\t} else if (c=='-') {\n\t\t\t\t\tstack.push(a-b);\n\t\t\t\t} else {\n\t\t\t\t\tstack.push(a*b);\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"{\n\t\t\tchar c = items[i].charAt(0);\n\t\t\tif (c>='0'&&c<='9') {\n\t\t\t\tstack.push(Integer.parseInt(items[i]));\n\t\t\t} else {\n\t\t\t\tint b = stack.pop();\n\t\t\t\tint a = stack.pop();\n\t\t\t\tif (c=='+') {\n\t\t\t\t\tstack.push(a+b);\n\t\t\t\t} else if (c=='-') {\n\t\t\t\t\tstack.push(a-b);\n\t\t\t\t} else {\n\t\t\t\t\tstack.push(a*b);\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"char c = items[i].charAt(0);",
"c",
"items[i].charAt(0)",
"items[i].charAt",
"items[i]",
"items",
"i",
"0",
"if (c>='0'&&c<='9') {\n\t\t\t\tstack.push(Integer.parseInt(items[i]));\n\t\t\t} else {\n\t\t\t\tint b = stack.pop();\n\t\t\t\tint a = stack.pop();\n\t\t\t\tif (c=='+') {\n\t\t\t\t\tstack.push(a+b);\n\t\t\t\t} else if (c=='-') {\n\t\t\t\t\tstack.push(a-b);\n\t\t\t\t} else {\n\t\t\t\t\tstack.push(a*b);\n\t\t\t\t}\n\t\t\t}",
"c>='0'&&c<='9'",
"c>='0'",
"c",
"'0'",
"c<='9'",
"c",
"'9'",
"{\n\t\t\t\tstack.push(Integer.parseInt(items[i]));\n\t\t\t}",
"stack.push(Integer.parseInt(items[i]))",
"stack.push",
"stack",
"Integer.parseInt(items[i])",
"Integer.parseInt",
"Integer",
"items[i]",
"items",
"i",
"{\n\t\t\t\tint b = stack.pop();\n\t\t\t\tint a = stack.pop();\n\t\t\t\tif (c=='+') {\n\t\t\t\t\tstack.push(a+b);\n\t\t\t\t} else if (c=='-') {\n\t\t\t\t\tstack.push(a-b);\n\t\t\t\t} else {\n\t\t\t\t\tstack.push(a*b);\n\t\t\t\t}\n\t\t\t}",
"int b = stack.pop();",
"b",
"stack.pop()",
"stack.pop",
"stack",
"int a = stack.pop();",
"a",
"stack.pop()",
"stack.pop",
"stack",
"if (c=='+') {\n\t\t\t\t\tstack.push(a+b);\n\t\t\t\t} else if (c=='-') {\n\t\t\t\t\tstack.push(a-b);\n\t\t\t\t} else {\n\t\t\t\t\tstack.push(a*b);\n\t\t\t\t}",
"c=='+'",
"c",
"'+'",
"{\n\t\t\t\t\tstack.push(a+b);\n\t\t\t\t}",
"stack.push(a+b)",
"stack.push",
"stack",
"a+b",
"a",
"b",
"if (c=='-') {\n\t\t\t\t\tstack.push(a-b);\n\t\t\t\t} else {\n\t\t\t\t\tstack.push(a*b);\n\t\t\t\t}",
"c=='-'",
"c",
"'-'",
"{\n\t\t\t\t\tstack.push(a-b);\n\t\t\t\t}",
"stack.push(a-b)",
"stack.push",
"stack",
"a-b",
"a",
"b",
"{\n\t\t\t\t\tstack.push(a*b);\n\t\t\t\t}",
"stack.push(a*b)",
"stack.push",
"stack",
"a*b",
"a",
"b",
"System.out.println(stack.pop())",
"System.out.println",
"System.out",
"System",
"System.out",
"stack.pop()",
"stack.pop",
"stack",
"sc.close()",
"sc.close",
"sc",
"String[] args",
"args",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tString op = sc.nextLine();\n\t\tString[] items = op.split(\" \");\n\n\t\tStack<Integer> stack = new Stack<>();\n\t\tfor (int i=0; i<items.length; i++) {\n\t\t\tchar c = items[i].charAt(0);\n\t\t\tif (c>='0'&&c<='9') {\n\t\t\t\tstack.push(Integer.parseInt(items[i]));\n\t\t\t} else {\n\t\t\t\tint b = stack.pop();\n\t\t\t\tint a = stack.pop();\n\t\t\t\tif (c=='+') {\n\t\t\t\t\tstack.push(a+b);\n\t\t\t\t} else if (c=='-') {\n\t\t\t\t\tstack.push(a-b);\n\t\t\t\t} else {\n\t\t\t\t\tstack.push(a*b);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.println(stack.pop());\n\n\t\tsc.close();\n\t}\n\n}",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tString op = sc.nextLine();\n\t\tString[] items = op.split(\" \");\n\n\t\tStack<Integer> stack = new Stack<>();\n\t\tfor (int i=0; i<items.length; i++) {\n\t\t\tchar c = items[i].charAt(0);\n\t\t\tif (c>='0'&&c<='9') {\n\t\t\t\tstack.push(Integer.parseInt(items[i]));\n\t\t\t} else {\n\t\t\t\tint b = stack.pop();\n\t\t\t\tint a = stack.pop();\n\t\t\t\tif (c=='+') {\n\t\t\t\t\tstack.push(a+b);\n\t\t\t\t} else if (c=='-') {\n\t\t\t\t\tstack.push(a-b);\n\t\t\t\t} else {\n\t\t\t\t\tstack.push(a*b);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.println(stack.pop());\n\n\t\tsc.close();\n\t}\n\n}",
"Main"
] | import java.util.Scanner;
import java.util.Stack;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String op = sc.nextLine();
String[] items = op.split(" ");
Stack<Integer> stack = new Stack<>();
for (int i=0; i<items.length; i++) {
char c = items[i].charAt(0);
if (c>='0'&&c<='9') {
stack.push(Integer.parseInt(items[i]));
} else {
int b = stack.pop();
int a = stack.pop();
if (c=='+') {
stack.push(a+b);
} else if (c=='-') {
stack.push(a-b);
} else {
stack.push(a*b);
}
}
}
System.out.println(stack.pop());
sc.close();
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
38,
5,
13,
30,
4,
18,
18,
13,
13,
13,
30,
41,
13,
20,
2,
17,
17,
41,
13,
41,
13,
41,
13,
41,
13,
4,
18,
13,
0,
13,
17,
28,
13,
4,
18,
13,
17,
30,
30,
14,
4,
18,
17,
13,
30,
0,
13,
18,
13,
40,
13,
0,
13,
18,
13,
40,
13,
0,
18,
13,
40,
13,
2,
13,
13,
14,
4,
18,
17,
13,
30,
0,
13,
18,
13,
40,
13,
0,
13,
18,
13,
40,
13,
0,
18,
13,
40,
13,
2,
13,
13,
14,
4,
18,
17,
13,
30,
0,
13,
18,
13,
40,
13,
0,
13,
18,
13,
40,
13,
0,
18,
13,
40,
13,
2,
13,
13,
30,
0,
18,
13,
40,
13,
4,
18,
13,
13,
4,
18,
18,
13,
13,
18,
13,
40,
13,
23,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
13,
14
],
[
13,
15
],
[
15,
16
],
[
16,
17
],
[
17,
18
],
[
18,
19
],
[
18,
20
],
[
16,
21
],
[
12,
22
],
[
22,
23
],
[
23,
24
],
[
23,
25
],
[
26,
27
],
[
26,
28
],
[
22,
29
],
[
29,
30
],
[
22,
31
],
[
31,
32
],
[
22,
33
],
[
33,
34
],
[
22,
35
],
[
35,
36
],
[
35,
37
],
[
37,
38
],
[
38,
39
],
[
22,
40
],
[
40,
41
],
[
40,
42
],
[
22,
43
],
[
43,
44
],
[
43,
45
],
[
45,
46
],
[
46,
47
],
[
45,
48
],
[
43,
49
],
[
50,
50
],
[
50,
51
],
[
51,
52
],
[
52,
53
],
[
53,
54
],
[
52,
55
],
[
51,
56
],
[
56,
57
],
[
57,
58
],
[
57,
59
],
[
59,
60
],
[
59,
61
],
[
61,
62
],
[
56,
63
],
[
63,
64
],
[
63,
65
],
[
65,
66
],
[
65,
67
],
[
67,
68
],
[
56,
69
],
[
69,
70
],
[
70,
71
],
[
70,
72
],
[
72,
73
],
[
69,
74
],
[
74,
75
],
[
74,
76
],
[
51,
77
],
[
77,
78
],
[
78,
79
],
[
79,
80
],
[
78,
81
],
[
77,
82
],
[
82,
83
],
[
83,
84
],
[
83,
85
],
[
85,
86
],
[
85,
87
],
[
87,
88
],
[
82,
89
],
[
89,
90
],
[
89,
91
],
[
91,
92
],
[
91,
93
],
[
93,
94
],
[
82,
95
],
[
95,
96
],
[
96,
97
],
[
96,
98
],
[
98,
99
],
[
95,
100
],
[
100,
101
],
[
100,
102
],
[
77,
103
],
[
103,
104
],
[
104,
105
],
[
105,
106
],
[
104,
107
],
[
103,
108
],
[
108,
109
],
[
109,
110
],
[
109,
111
],
[
111,
112
],
[
111,
113
],
[
113,
114
],
[
108,
115
],
[
115,
116
],
[
115,
117
],
[
117,
118
],
[
117,
119
],
[
119,
120
],
[
108,
121
],
[
121,
122
],
[
122,
123
],
[
122,
124
],
[
124,
125
],
[
121,
126
],
[
126,
127
],
[
126,
128
],
[
103,
129
],
[
129,
130
],
[
130,
131
],
[
131,
132
],
[
131,
133
],
[
133,
134
],
[
130,
135
],
[
135,
136
],
[
136,
137
],
[
135,
138
],
[
22,
139
],
[
139,
140
],
[
140,
141
],
[
141,
142
],
[
141,
143
],
[
139,
144
],
[
144,
145
],
[
144,
146
],
[
146,
147
],
[
6,
148
],
[
148,
149
]
] | [
"import java.io.*;\n\nclass Main {\n\tpublic static void main(String[] args) {\n\t BufferedReader kb = new BufferedReader( new InputStreamReader( System.in ) );\n\t try {\n\t\t\tint[] stack = new int[ 100+1 ];\n\t\t\tint i, a, b;\n\t\t String str = kb.readLine();\n\t\t \n\t\t i = 0;\n\t\t for( String wd: str.split( \" \" ) ) {\n\t\t\t if( \"+\".equals( wd ) ) {\n\t\t\t \tb = stack[ --i ];\n\t\t\t \ta = stack[ --i ];\n\t\t\t \tstack[ i++ ] = a + b;\t\t\t \n\t\t\t } else if( \"-\".equals( wd ) ) {\n\t\t\t \tb = stack[ --i ];\n\t\t\t \ta = stack[ --i ];\n\t\t\t \tstack[ i++ ] = a - b;\t\t\t \n\t\t\t } else if( \"*\".equals( wd ) ) {\n\t\t\t \tb = stack[ --i ];\n\t\t\t \ta = stack[ --i ];\n\t\t\t \tstack[ i++ ] = a * b;\t\t\t \n\t\t\t } else {\n\t\t\t \tstack[i++] = Integer.parseInt( wd );\n\t\t\t }\n\t\t }\n\n System.out.println( stack[ --i ] );\n\t } catch( IOException e ) {\n\t System.err.println( e );\n\t }\n\t}\n}",
"import java.io.*;",
"io.*",
"java",
"class Main {\n\tpublic static void main(String[] args) {\n\t BufferedReader kb = new BufferedReader( new InputStreamReader( System.in ) );\n\t try {\n\t\t\tint[] stack = new int[ 100+1 ];\n\t\t\tint i, a, b;\n\t\t String str = kb.readLine();\n\t\t \n\t\t i = 0;\n\t\t for( String wd: str.split( \" \" ) ) {\n\t\t\t if( \"+\".equals( wd ) ) {\n\t\t\t \tb = stack[ --i ];\n\t\t\t \ta = stack[ --i ];\n\t\t\t \tstack[ i++ ] = a + b;\t\t\t \n\t\t\t } else if( \"-\".equals( wd ) ) {\n\t\t\t \tb = stack[ --i ];\n\t\t\t \ta = stack[ --i ];\n\t\t\t \tstack[ i++ ] = a - b;\t\t\t \n\t\t\t } else if( \"*\".equals( wd ) ) {\n\t\t\t \tb = stack[ --i ];\n\t\t\t \ta = stack[ --i ];\n\t\t\t \tstack[ i++ ] = a * b;\t\t\t \n\t\t\t } else {\n\t\t\t \tstack[i++] = Integer.parseInt( wd );\n\t\t\t }\n\t\t }\n\n System.out.println( stack[ --i ] );\n\t } catch( IOException e ) {\n\t System.err.println( e );\n\t }\n\t}\n}",
"Main",
"public static void main(String[] args) {\n\t BufferedReader kb = new BufferedReader( new InputStreamReader( System.in ) );\n\t try {\n\t\t\tint[] stack = new int[ 100+1 ];\n\t\t\tint i, a, b;\n\t\t String str = kb.readLine();\n\t\t \n\t\t i = 0;\n\t\t for( String wd: str.split( \" \" ) ) {\n\t\t\t if( \"+\".equals( wd ) ) {\n\t\t\t \tb = stack[ --i ];\n\t\t\t \ta = stack[ --i ];\n\t\t\t \tstack[ i++ ] = a + b;\t\t\t \n\t\t\t } else if( \"-\".equals( wd ) ) {\n\t\t\t \tb = stack[ --i ];\n\t\t\t \ta = stack[ --i ];\n\t\t\t \tstack[ i++ ] = a - b;\t\t\t \n\t\t\t } else if( \"*\".equals( wd ) ) {\n\t\t\t \tb = stack[ --i ];\n\t\t\t \ta = stack[ --i ];\n\t\t\t \tstack[ i++ ] = a * b;\t\t\t \n\t\t\t } else {\n\t\t\t \tstack[i++] = Integer.parseInt( wd );\n\t\t\t }\n\t\t }\n\n System.out.println( stack[ --i ] );\n\t } catch( IOException e ) {\n\t System.err.println( e );\n\t }\n\t}",
"main",
"{\n\t BufferedReader kb = new BufferedReader( new InputStreamReader( System.in ) );\n\t try {\n\t\t\tint[] stack = new int[ 100+1 ];\n\t\t\tint i, a, b;\n\t\t String str = kb.readLine();\n\t\t \n\t\t i = 0;\n\t\t for( String wd: str.split( \" \" ) ) {\n\t\t\t if( \"+\".equals( wd ) ) {\n\t\t\t \tb = stack[ --i ];\n\t\t\t \ta = stack[ --i ];\n\t\t\t \tstack[ i++ ] = a + b;\t\t\t \n\t\t\t } else if( \"-\".equals( wd ) ) {\n\t\t\t \tb = stack[ --i ];\n\t\t\t \ta = stack[ --i ];\n\t\t\t \tstack[ i++ ] = a - b;\t\t\t \n\t\t\t } else if( \"*\".equals( wd ) ) {\n\t\t\t \tb = stack[ --i ];\n\t\t\t \ta = stack[ --i ];\n\t\t\t \tstack[ i++ ] = a * b;\t\t\t \n\t\t\t } else {\n\t\t\t \tstack[i++] = Integer.parseInt( wd );\n\t\t\t }\n\t\t }\n\n System.out.println( stack[ --i ] );\n\t } catch( IOException e ) {\n\t System.err.println( e );\n\t }\n\t}",
"BufferedReader kb = new BufferedReader( new InputStreamReader( System.in ) );",
"kb",
"new BufferedReader( new InputStreamReader( System.in ) )",
"try {\n\t\t\tint[] stack = new int[ 100+1 ];\n\t\t\tint i, a, b;\n\t\t String str = kb.readLine();\n\t\t \n\t\t i = 0;\n\t\t for( String wd: str.split( \" \" ) ) {\n\t\t\t if( \"+\".equals( wd ) ) {\n\t\t\t \tb = stack[ --i ];\n\t\t\t \ta = stack[ --i ];\n\t\t\t \tstack[ i++ ] = a + b;\t\t\t \n\t\t\t } else if( \"-\".equals( wd ) ) {\n\t\t\t \tb = stack[ --i ];\n\t\t\t \ta = stack[ --i ];\n\t\t\t \tstack[ i++ ] = a - b;\t\t\t \n\t\t\t } else if( \"*\".equals( wd ) ) {\n\t\t\t \tb = stack[ --i ];\n\t\t\t \ta = stack[ --i ];\n\t\t\t \tstack[ i++ ] = a * b;\t\t\t \n\t\t\t } else {\n\t\t\t \tstack[i++] = Integer.parseInt( wd );\n\t\t\t }\n\t\t }\n\n System.out.println( stack[ --i ] );\n\t } catch( IOException e ) {\n\t System.err.println( e );\n\t }",
"catch( IOException e ) {\n\t System.err.println( e );\n\t }",
"IOException e",
"{\n\t System.err.println( e );\n\t }",
"System.err.println( e )",
"System.err.println",
"System.err",
"System",
"System.err",
"e",
"{\n\t\t\tint[] stack = new int[ 100+1 ];\n\t\t\tint i, a, b;\n\t\t String str = kb.readLine();\n\t\t \n\t\t i = 0;\n\t\t for( String wd: str.split( \" \" ) ) {\n\t\t\t if( \"+\".equals( wd ) ) {\n\t\t\t \tb = stack[ --i ];\n\t\t\t \ta = stack[ --i ];\n\t\t\t \tstack[ i++ ] = a + b;\t\t\t \n\t\t\t } else if( \"-\".equals( wd ) ) {\n\t\t\t \tb = stack[ --i ];\n\t\t\t \ta = stack[ --i ];\n\t\t\t \tstack[ i++ ] = a - b;\t\t\t \n\t\t\t } else if( \"*\".equals( wd ) ) {\n\t\t\t \tb = stack[ --i ];\n\t\t\t \ta = stack[ --i ];\n\t\t\t \tstack[ i++ ] = a * b;\t\t\t \n\t\t\t } else {\n\t\t\t \tstack[i++] = Integer.parseInt( wd );\n\t\t\t }\n\t\t }\n\n System.out.println( stack[ --i ] );\n\t }",
"int[] stack = new int[ 100+1 ];",
"stack",
"new int[ 100+1 ]",
"100+1",
"100",
"1",
"int i",
"i",
"a",
"a",
"b;",
"b",
"String str = kb.readLine();",
"str",
"kb.readLine()",
"kb.readLine",
"kb",
"i = 0",
"i",
"0",
"for( String wd: str.split( \" \" ) ) {\n\t\t\t if( \"+\".equals( wd ) ) {\n\t\t\t \tb = stack[ --i ];\n\t\t\t \ta = stack[ --i ];\n\t\t\t \tstack[ i++ ] = a + b;\t\t\t \n\t\t\t } else if( \"-\".equals( wd ) ) {\n\t\t\t \tb = stack[ --i ];\n\t\t\t \ta = stack[ --i ];\n\t\t\t \tstack[ i++ ] = a - b;\t\t\t \n\t\t\t } else if( \"*\".equals( wd ) ) {\n\t\t\t \tb = stack[ --i ];\n\t\t\t \ta = stack[ --i ];\n\t\t\t \tstack[ i++ ] = a * b;\t\t\t \n\t\t\t } else {\n\t\t\t \tstack[i++] = Integer.parseInt( wd );\n\t\t\t }\n\t\t }",
"String wd",
"str.split( \" \" )",
"str.split",
"str",
"\" \"",
"{\n\t\t\t if( \"+\".equals( wd ) ) {\n\t\t\t \tb = stack[ --i ];\n\t\t\t \ta = stack[ --i ];\n\t\t\t \tstack[ i++ ] = a + b;\t\t\t \n\t\t\t } else if( \"-\".equals( wd ) ) {\n\t\t\t \tb = stack[ --i ];\n\t\t\t \ta = stack[ --i ];\n\t\t\t \tstack[ i++ ] = a - b;\t\t\t \n\t\t\t } else if( \"*\".equals( wd ) ) {\n\t\t\t \tb = stack[ --i ];\n\t\t\t \ta = stack[ --i ];\n\t\t\t \tstack[ i++ ] = a * b;\t\t\t \n\t\t\t } else {\n\t\t\t \tstack[i++] = Integer.parseInt( wd );\n\t\t\t }\n\t\t }",
"{\n\t\t\t if( \"+\".equals( wd ) ) {\n\t\t\t \tb = stack[ --i ];\n\t\t\t \ta = stack[ --i ];\n\t\t\t \tstack[ i++ ] = a + b;\t\t\t \n\t\t\t } else if( \"-\".equals( wd ) ) {\n\t\t\t \tb = stack[ --i ];\n\t\t\t \ta = stack[ --i ];\n\t\t\t \tstack[ i++ ] = a - b;\t\t\t \n\t\t\t } else if( \"*\".equals( wd ) ) {\n\t\t\t \tb = stack[ --i ];\n\t\t\t \ta = stack[ --i ];\n\t\t\t \tstack[ i++ ] = a * b;\t\t\t \n\t\t\t } else {\n\t\t\t \tstack[i++] = Integer.parseInt( wd );\n\t\t\t }\n\t\t }",
"if( \"+\".equals( wd ) ) {\n\t\t\t \tb = stack[ --i ];\n\t\t\t \ta = stack[ --i ];\n\t\t\t \tstack[ i++ ] = a + b;\t\t\t \n\t\t\t } else if( \"-\".equals( wd ) ) {\n\t\t\t \tb = stack[ --i ];\n\t\t\t \ta = stack[ --i ];\n\t\t\t \tstack[ i++ ] = a - b;\t\t\t \n\t\t\t } else if( \"*\".equals( wd ) ) {\n\t\t\t \tb = stack[ --i ];\n\t\t\t \ta = stack[ --i ];\n\t\t\t \tstack[ i++ ] = a * b;\t\t\t \n\t\t\t } else {\n\t\t\t \tstack[i++] = Integer.parseInt( wd );\n\t\t\t }",
"\"+\".equals( wd )",
"\"+\".equals",
"\"+\"",
"wd",
"{\n\t\t\t \tb = stack[ --i ];\n\t\t\t \ta = stack[ --i ];\n\t\t\t \tstack[ i++ ] = a + b;\t\t\t \n\t\t\t }",
"b = stack[ --i ]",
"b",
"stack[ --i ]",
"stack",
"--i",
"i",
"a = stack[ --i ]",
"a",
"stack[ --i ]",
"stack",
"--i",
"i",
"stack[ i++ ] = a + b",
"stack[ i++ ]",
"stack",
"i++",
"i",
"a + b",
"a",
"b",
"if( \"-\".equals( wd ) ) {\n\t\t\t \tb = stack[ --i ];\n\t\t\t \ta = stack[ --i ];\n\t\t\t \tstack[ i++ ] = a - b;\t\t\t \n\t\t\t } else if( \"*\".equals( wd ) ) {\n\t\t\t \tb = stack[ --i ];\n\t\t\t \ta = stack[ --i ];\n\t\t\t \tstack[ i++ ] = a * b;\t\t\t \n\t\t\t } else {\n\t\t\t \tstack[i++] = Integer.parseInt( wd );\n\t\t\t }",
"\"-\".equals( wd )",
"\"-\".equals",
"\"-\"",
"wd",
"{\n\t\t\t \tb = stack[ --i ];\n\t\t\t \ta = stack[ --i ];\n\t\t\t \tstack[ i++ ] = a - b;\t\t\t \n\t\t\t }",
"b = stack[ --i ]",
"b",
"stack[ --i ]",
"stack",
"--i",
"i",
"a = stack[ --i ]",
"a",
"stack[ --i ]",
"stack",
"--i",
"i",
"stack[ i++ ] = a - b",
"stack[ i++ ]",
"stack",
"i++",
"i",
"a - b",
"a",
"b",
"if( \"*\".equals( wd ) ) {\n\t\t\t \tb = stack[ --i ];\n\t\t\t \ta = stack[ --i ];\n\t\t\t \tstack[ i++ ] = a * b;\t\t\t \n\t\t\t } else {\n\t\t\t \tstack[i++] = Integer.parseInt( wd );\n\t\t\t }",
"\"*\".equals( wd )",
"\"*\".equals",
"\"*\"",
"wd",
"{\n\t\t\t \tb = stack[ --i ];\n\t\t\t \ta = stack[ --i ];\n\t\t\t \tstack[ i++ ] = a * b;\t\t\t \n\t\t\t }",
"b = stack[ --i ]",
"b",
"stack[ --i ]",
"stack",
"--i",
"i",
"a = stack[ --i ]",
"a",
"stack[ --i ]",
"stack",
"--i",
"i",
"stack[ i++ ] = a * b",
"stack[ i++ ]",
"stack",
"i++",
"i",
"a * b",
"a",
"b",
"{\n\t\t\t \tstack[i++] = Integer.parseInt( wd );\n\t\t\t }",
"stack[i++] = Integer.parseInt( wd )",
"stack[i++]",
"stack",
"i++",
"i",
"Integer.parseInt( wd )",
"Integer.parseInt",
"Integer",
"wd",
"System.out.println( stack[ --i ] )",
"System.out.println",
"System.out",
"System",
"System.out",
"stack[ --i ]",
"stack",
"--i",
"i",
"String[] args",
"args"
] | import java.io.*;
class Main {
public static void main(String[] args) {
BufferedReader kb = new BufferedReader( new InputStreamReader( System.in ) );
try {
int[] stack = new int[ 100+1 ];
int i, a, b;
String str = kb.readLine();
i = 0;
for( String wd: str.split( " " ) ) {
if( "+".equals( wd ) ) {
b = stack[ --i ];
a = stack[ --i ];
stack[ i++ ] = a + b;
} else if( "-".equals( wd ) ) {
b = stack[ --i ];
a = stack[ --i ];
stack[ i++ ] = a - b;
} else if( "*".equals( wd ) ) {
b = stack[ --i ];
a = stack[ --i ];
stack[ i++ ] = a * b;
} else {
stack[i++] = Integer.parseInt( wd );
}
}
System.out.println( stack[ --i ] );
} catch( IOException e ) {
System.err.println( e );
}
}
} |
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
20,
41,
13,
17,
42,
4,
18,
13,
30,
41,
13,
4,
18,
13,
14,
4,
18,
13,
17,
30,
4,
18,
13,
2,
4,
18,
13,
4,
18,
13,
14,
4,
18,
13,
17,
30,
4,
18,
13,
2,
40,
17,
2,
4,
18,
13,
4,
18,
13,
14,
4,
18,
13,
17,
30,
4,
18,
13,
2,
4,
18,
13,
4,
18,
13,
30,
4,
18,
13,
4,
18,
13,
13,
0,
13,
4,
18,
13,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
104,
8
],
[
104,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
12,
14
],
[
11,
15
],
[
15,
16
],
[
15,
17
],
[
11,
18
],
[
18,
19
],
[
18,
20
],
[
11,
21
],
[
21,
22
],
[
22,
23
],
[
23,
24
],
[
21,
25
],
[
25,
26
],
[
26,
27
],
[
26,
28
],
[
28,
29
],
[
29,
30
],
[
25,
31
],
[
31,
32
],
[
32,
33
],
[
33,
34
],
[
32,
35
],
[
31,
36
],
[
36,
37
],
[
37,
38
],
[
38,
39
],
[
37,
40
],
[
40,
41
],
[
41,
42
],
[
42,
43
],
[
40,
44
],
[
44,
45
],
[
45,
46
],
[
31,
47
],
[
47,
48
],
[
48,
49
],
[
49,
50
],
[
48,
51
],
[
47,
52
],
[
52,
53
],
[
53,
54
],
[
54,
55
],
[
53,
56
],
[
56,
57
],
[
57,
58
],
[
56,
59
],
[
59,
60
],
[
60,
61
],
[
61,
62
],
[
59,
63
],
[
63,
64
],
[
64,
65
],
[
47,
66
],
[
66,
67
],
[
67,
68
],
[
68,
69
],
[
67,
70
],
[
66,
71
],
[
71,
72
],
[
72,
73
],
[
73,
74
],
[
72,
75
],
[
75,
76
],
[
76,
77
],
[
77,
78
],
[
75,
79
],
[
79,
80
],
[
80,
81
],
[
66,
82
],
[
82,
83
],
[
83,
84
],
[
84,
85
],
[
83,
86
],
[
86,
87
],
[
87,
88
],
[
86,
89
],
[
25,
90
],
[
90,
91
],
[
90,
92
],
[
92,
93
],
[
93,
94
],
[
11,
95
],
[
95,
96
],
[
96,
97
],
[
97,
98
],
[
97,
99
],
[
95,
100
],
[
9,
101
],
[
101,
102
],
[
0,
103
],
[
103,
104
],
[
103,
105
]
] | [
"\nimport java.util.Scanner;\nimport java.util.Stack;\t\n\npublic class Main {\n\tpublic static void main(String[] args) {\n\t\t//System.out.println(\"t\");\n\t\t\n\t\tStack<Integer> stack = new Stack<Integer>();\n\t\tScanner scan = new Scanner(System.in);\n\t\t\n\t\tint value = 0;\n\t\t\n\t\twhile(scan.hasNext()) {\n\t\t\tString e = scan.next();\n\t\t\tif(e.equals(\"+\")) {\n\t\t\t\tstack.push(stack.pop() + stack.pop());\n\t\t\t} else if(e.equals(\"-\")) {\n\t\t\t\tstack.push(-1*(stack.pop() - stack.pop()));\n\t\t\t} else if(e.equals(\"*\")) {\n\t\t\t\tstack.push(stack.pop() * stack.pop());\n\t\t\t}else {\n\t\t\t\tstack.push(Integer.parseInt(e));\n\t\t\t}\n\t\t\tvalue = stack.peek();\n\t\t\t//System.out.println(value);\n\t\t}\n\t\t//System.out.println(\"here\");\n\t\tSystem.out.println(value);\n\t\t\n\t}\n}\n",
"import java.util.Scanner;",
"Scanner",
"java.util",
"import java.util.Stack;",
"Stack",
"java.util",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\t//System.out.println(\"t\");\n\t\t\n\t\tStack<Integer> stack = new Stack<Integer>();\n\t\tScanner scan = new Scanner(System.in);\n\t\t\n\t\tint value = 0;\n\t\t\n\t\twhile(scan.hasNext()) {\n\t\t\tString e = scan.next();\n\t\t\tif(e.equals(\"+\")) {\n\t\t\t\tstack.push(stack.pop() + stack.pop());\n\t\t\t} else if(e.equals(\"-\")) {\n\t\t\t\tstack.push(-1*(stack.pop() - stack.pop()));\n\t\t\t} else if(e.equals(\"*\")) {\n\t\t\t\tstack.push(stack.pop() * stack.pop());\n\t\t\t}else {\n\t\t\t\tstack.push(Integer.parseInt(e));\n\t\t\t}\n\t\t\tvalue = stack.peek();\n\t\t\t//System.out.println(value);\n\t\t}\n\t\t//System.out.println(\"here\");\n\t\tSystem.out.println(value);\n\t\t\n\t}\n}",
"Main",
"public static void main(String[] args) {\n\t\t//System.out.println(\"t\");\n\t\t\n\t\tStack<Integer> stack = new Stack<Integer>();\n\t\tScanner scan = new Scanner(System.in);\n\t\t\n\t\tint value = 0;\n\t\t\n\t\twhile(scan.hasNext()) {\n\t\t\tString e = scan.next();\n\t\t\tif(e.equals(\"+\")) {\n\t\t\t\tstack.push(stack.pop() + stack.pop());\n\t\t\t} else if(e.equals(\"-\")) {\n\t\t\t\tstack.push(-1*(stack.pop() - stack.pop()));\n\t\t\t} else if(e.equals(\"*\")) {\n\t\t\t\tstack.push(stack.pop() * stack.pop());\n\t\t\t}else {\n\t\t\t\tstack.push(Integer.parseInt(e));\n\t\t\t}\n\t\t\tvalue = stack.peek();\n\t\t\t//System.out.println(value);\n\t\t}\n\t\t//System.out.println(\"here\");\n\t\tSystem.out.println(value);\n\t\t\n\t}",
"main",
"{\n\t\t//System.out.println(\"t\");\n\t\t\n\t\tStack<Integer> stack = new Stack<Integer>();\n\t\tScanner scan = new Scanner(System.in);\n\t\t\n\t\tint value = 0;\n\t\t\n\t\twhile(scan.hasNext()) {\n\t\t\tString e = scan.next();\n\t\t\tif(e.equals(\"+\")) {\n\t\t\t\tstack.push(stack.pop() + stack.pop());\n\t\t\t} else if(e.equals(\"-\")) {\n\t\t\t\tstack.push(-1*(stack.pop() - stack.pop()));\n\t\t\t} else if(e.equals(\"*\")) {\n\t\t\t\tstack.push(stack.pop() * stack.pop());\n\t\t\t}else {\n\t\t\t\tstack.push(Integer.parseInt(e));\n\t\t\t}\n\t\t\tvalue = stack.peek();\n\t\t\t//System.out.println(value);\n\t\t}\n\t\t//System.out.println(\"here\");\n\t\tSystem.out.println(value);\n\t\t\n\t}",
"Stack<Integer> stack = new Stack<Integer>();",
"stack",
"new Stack<Integer>()",
"Scanner scan = new Scanner(System.in);",
"scan",
"new Scanner(System.in)",
"int value = 0;",
"value",
"0",
"while(scan.hasNext()) {\n\t\t\tString e = scan.next();\n\t\t\tif(e.equals(\"+\")) {\n\t\t\t\tstack.push(stack.pop() + stack.pop());\n\t\t\t} else if(e.equals(\"-\")) {\n\t\t\t\tstack.push(-1*(stack.pop() - stack.pop()));\n\t\t\t} else if(e.equals(\"*\")) {\n\t\t\t\tstack.push(stack.pop() * stack.pop());\n\t\t\t}else {\n\t\t\t\tstack.push(Integer.parseInt(e));\n\t\t\t}\n\t\t\tvalue = stack.peek();\n\t\t\t//System.out.println(value);\n\t\t}",
"scan.hasNext()",
"scan.hasNext",
"scan",
"{\n\t\t\tString e = scan.next();\n\t\t\tif(e.equals(\"+\")) {\n\t\t\t\tstack.push(stack.pop() + stack.pop());\n\t\t\t} else if(e.equals(\"-\")) {\n\t\t\t\tstack.push(-1*(stack.pop() - stack.pop()));\n\t\t\t} else if(e.equals(\"*\")) {\n\t\t\t\tstack.push(stack.pop() * stack.pop());\n\t\t\t}else {\n\t\t\t\tstack.push(Integer.parseInt(e));\n\t\t\t}\n\t\t\tvalue = stack.peek();\n\t\t\t//System.out.println(value);\n\t\t}",
"String e = scan.next();",
"e",
"scan.next()",
"scan.next",
"scan",
"if(e.equals(\"+\")) {\n\t\t\t\tstack.push(stack.pop() + stack.pop());\n\t\t\t} else if(e.equals(\"-\")) {\n\t\t\t\tstack.push(-1*(stack.pop() - stack.pop()));\n\t\t\t} else if(e.equals(\"*\")) {\n\t\t\t\tstack.push(stack.pop() * stack.pop());\n\t\t\t}else {\n\t\t\t\tstack.push(Integer.parseInt(e));\n\t\t\t}",
"e.equals(\"+\")",
"e.equals",
"e",
"\"+\"",
"{\n\t\t\t\tstack.push(stack.pop() + stack.pop());\n\t\t\t}",
"stack.push(stack.pop() + stack.pop())",
"stack.push",
"stack",
"stack.pop() + stack.pop()",
"stack.pop()",
"stack.pop",
"stack",
"stack.pop()",
"stack.pop",
"stack",
"if(e.equals(\"-\")) {\n\t\t\t\tstack.push(-1*(stack.pop() - stack.pop()));\n\t\t\t} else if(e.equals(\"*\")) {\n\t\t\t\tstack.push(stack.pop() * stack.pop());\n\t\t\t}else {\n\t\t\t\tstack.push(Integer.parseInt(e));\n\t\t\t}",
"e.equals(\"-\")",
"e.equals",
"e",
"\"-\"",
"{\n\t\t\t\tstack.push(-1*(stack.pop() - stack.pop()));\n\t\t\t}",
"stack.push(-1*(stack.pop() - stack.pop()))",
"stack.push",
"stack",
"-1*(stack.pop() - stack.pop())",
"-1",
"1",
"(stack.pop() - stack.pop())",
"stack.pop()",
"stack.pop",
"stack",
"stack.pop()",
"stack.pop",
"stack",
"if(e.equals(\"*\")) {\n\t\t\t\tstack.push(stack.pop() * stack.pop());\n\t\t\t}else {\n\t\t\t\tstack.push(Integer.parseInt(e));\n\t\t\t}",
"e.equals(\"*\")",
"e.equals",
"e",
"\"*\"",
"{\n\t\t\t\tstack.push(stack.pop() * stack.pop());\n\t\t\t}",
"stack.push(stack.pop() * stack.pop())",
"stack.push",
"stack",
"stack.pop() * stack.pop()",
"stack.pop()",
"stack.pop",
"stack",
"stack.pop()",
"stack.pop",
"stack",
"{\n\t\t\t\tstack.push(Integer.parseInt(e));\n\t\t\t}",
"stack.push(Integer.parseInt(e))",
"stack.push",
"stack",
"Integer.parseInt(e)",
"Integer.parseInt",
"Integer",
"e",
"value = stack.peek()",
"value",
"stack.peek()",
"stack.peek",
"stack",
"System.out.println(value)",
"System.out.println",
"System.out",
"System",
"System.out",
"value",
"String[] args",
"args",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\t//System.out.println(\"t\");\n\t\t\n\t\tStack<Integer> stack = new Stack<Integer>();\n\t\tScanner scan = new Scanner(System.in);\n\t\t\n\t\tint value = 0;\n\t\t\n\t\twhile(scan.hasNext()) {\n\t\t\tString e = scan.next();\n\t\t\tif(e.equals(\"+\")) {\n\t\t\t\tstack.push(stack.pop() + stack.pop());\n\t\t\t} else if(e.equals(\"-\")) {\n\t\t\t\tstack.push(-1*(stack.pop() - stack.pop()));\n\t\t\t} else if(e.equals(\"*\")) {\n\t\t\t\tstack.push(stack.pop() * stack.pop());\n\t\t\t}else {\n\t\t\t\tstack.push(Integer.parseInt(e));\n\t\t\t}\n\t\t\tvalue = stack.peek();\n\t\t\t//System.out.println(value);\n\t\t}\n\t\t//System.out.println(\"here\");\n\t\tSystem.out.println(value);\n\t\t\n\t}\n}",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\t//System.out.println(\"t\");\n\t\t\n\t\tStack<Integer> stack = new Stack<Integer>();\n\t\tScanner scan = new Scanner(System.in);\n\t\t\n\t\tint value = 0;\n\t\t\n\t\twhile(scan.hasNext()) {\n\t\t\tString e = scan.next();\n\t\t\tif(e.equals(\"+\")) {\n\t\t\t\tstack.push(stack.pop() + stack.pop());\n\t\t\t} else if(e.equals(\"-\")) {\n\t\t\t\tstack.push(-1*(stack.pop() - stack.pop()));\n\t\t\t} else if(e.equals(\"*\")) {\n\t\t\t\tstack.push(stack.pop() * stack.pop());\n\t\t\t}else {\n\t\t\t\tstack.push(Integer.parseInt(e));\n\t\t\t}\n\t\t\tvalue = stack.peek();\n\t\t\t//System.out.println(value);\n\t\t}\n\t\t//System.out.println(\"here\");\n\t\tSystem.out.println(value);\n\t\t\n\t}\n}",
"Main"
] |
import java.util.Scanner;
import java.util.Stack;
public class Main {
public static void main(String[] args) {
//System.out.println("t");
Stack<Integer> stack = new Stack<Integer>();
Scanner scan = new Scanner(System.in);
int value = 0;
while(scan.hasNext()) {
String e = scan.next();
if(e.equals("+")) {
stack.push(stack.pop() + stack.pop());
} else if(e.equals("-")) {
stack.push(-1*(stack.pop() - stack.pop()));
} else if(e.equals("*")) {
stack.push(stack.pop() * stack.pop());
}else {
stack.push(Integer.parseInt(e));
}
value = stack.peek();
//System.out.println(value);
}
//System.out.println("here");
System.out.println(value);
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
20,
41,
13,
4,
18,
4,
18,
13,
17,
41,
13,
20,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
30,
38,
5,
13,
30,
14,
4,
18,
18,
13,
13,
17,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
4,
18,
13,
2,
13,
13,
14,
4,
18,
18,
13,
13,
17,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
4,
18,
13,
2,
13,
13,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
4,
18,
13,
2,
13,
13,
30,
41,
13,
4,
18,
13,
18,
13,
13,
4,
18,
13,
13,
4,
18,
13,
4,
18,
13,
23,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
12,
14
],
[
11,
15
],
[
15,
16
],
[
15,
17
],
[
11,
18
],
[
18,
19
],
[
18,
20
],
[
20,
21
],
[
21,
22
],
[
22,
23
],
[
23,
24
],
[
20,
25
],
[
11,
26
],
[
26,
27
],
[
26,
28
],
[
11,
29
],
[
29,
30
],
[
30,
31
],
[
31,
32
],
[
31,
33
],
[
29,
34
],
[
34,
35
],
[
34,
36
],
[
36,
37
],
[
36,
38
],
[
29,
39
],
[
39,
40
],
[
40,
41
],
[
29,
42
],
[
43,
43
],
[
43,
44
],
[
44,
45
],
[
45,
46
],
[
45,
47
],
[
47,
48
],
[
48,
49
],
[
49,
50
],
[
50,
51
],
[
51,
52
],
[
51,
53
],
[
49,
54
],
[
48,
55
],
[
55,
56
],
[
56,
57
],
[
56,
58
],
[
58,
59
],
[
59,
60
],
[
55,
61
],
[
61,
62
],
[
61,
63
],
[
63,
64
],
[
64,
65
],
[
55,
66
],
[
66,
67
],
[
67,
68
],
[
66,
69
],
[
69,
70
],
[
69,
71
],
[
48,
72
],
[
72,
73
],
[
73,
74
],
[
74,
75
],
[
75,
76
],
[
75,
77
],
[
73,
78
],
[
72,
79
],
[
79,
80
],
[
80,
81
],
[
80,
82
],
[
82,
83
],
[
83,
84
],
[
79,
85
],
[
85,
86
],
[
85,
87
],
[
87,
88
],
[
88,
89
],
[
79,
90
],
[
90,
91
],
[
91,
92
],
[
90,
93
],
[
93,
94
],
[
93,
95
],
[
72,
96
],
[
96,
97
],
[
97,
98
],
[
97,
99
],
[
99,
100
],
[
100,
101
],
[
96,
102
],
[
102,
103
],
[
102,
104
],
[
104,
105
],
[
105,
106
],
[
96,
107
],
[
107,
108
],
[
108,
109
],
[
107,
110
],
[
110,
111
],
[
110,
112
],
[
44,
113
],
[
113,
114
],
[
114,
115
],
[
114,
116
],
[
116,
117
],
[
117,
118
],
[
116,
119
],
[
119,
120
],
[
119,
121
],
[
113,
122
],
[
122,
123
],
[
123,
124
],
[
122,
125
],
[
11,
126
],
[
126,
127
],
[
127,
128
],
[
126,
129
],
[
129,
130
],
[
130,
131
],
[
9,
132
],
[
132,
133
]
] | [
"import java.util.*;\nimport java.io.*;\nclass Main{\n\tpublic static void main(String[]args){\n\t\tScanner in=new Scanner(System.in);\n\t\tPrintWriter out=new PrintWriter(System.out, true);\n\t\tString str[]=in.nextLine().split(\" \");\n\t\tStack<Integer> st=new Stack<>();\n\t\tfor(int i=0;i<str.length;i++){\n\t\t\ttry{\n\t\t\t\tint a=Integer.parseInt(str[i]);\n\t\t\t\tst.push(a);\n\t\t\t}catch(Exception e){\n\t\t\t\tif(str[i].equals(\"+\")){\n\t\t\t\t\tint a=st.pop();\n\t\t\t\t\tint b=st.pop();\n\t\t\t\t\tst.push(a+b);\n\t\t\t\t}else if(str[i].equals(\"-\")){\n\n\t\t\t\t\tint a=st.pop();\n\t\t\t\t\tint b=st.pop();\n\t\t\t\t\tst.push(b-a);\n\t\t\t\t}else{\n\t\t\t\t\tint a=st.pop();\n\t\t\t\t\tint b=st.pop();\n\t\t\t\t\tst.push(a*b);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tout.println(st.pop());\n\t}\n\n}",
"import java.util.*;",
"util.*",
"java",
"import java.io.*;",
"io.*",
"java",
"class Main{\n\tpublic static void main(String[]args){\n\t\tScanner in=new Scanner(System.in);\n\t\tPrintWriter out=new PrintWriter(System.out, true);\n\t\tString str[]=in.nextLine().split(\" \");\n\t\tStack<Integer> st=new Stack<>();\n\t\tfor(int i=0;i<str.length;i++){\n\t\t\ttry{\n\t\t\t\tint a=Integer.parseInt(str[i]);\n\t\t\t\tst.push(a);\n\t\t\t}catch(Exception e){\n\t\t\t\tif(str[i].equals(\"+\")){\n\t\t\t\t\tint a=st.pop();\n\t\t\t\t\tint b=st.pop();\n\t\t\t\t\tst.push(a+b);\n\t\t\t\t}else if(str[i].equals(\"-\")){\n\n\t\t\t\t\tint a=st.pop();\n\t\t\t\t\tint b=st.pop();\n\t\t\t\t\tst.push(b-a);\n\t\t\t\t}else{\n\t\t\t\t\tint a=st.pop();\n\t\t\t\t\tint b=st.pop();\n\t\t\t\t\tst.push(a*b);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tout.println(st.pop());\n\t}\n\n}",
"Main",
"public static void main(String[]args){\n\t\tScanner in=new Scanner(System.in);\n\t\tPrintWriter out=new PrintWriter(System.out, true);\n\t\tString str[]=in.nextLine().split(\" \");\n\t\tStack<Integer> st=new Stack<>();\n\t\tfor(int i=0;i<str.length;i++){\n\t\t\ttry{\n\t\t\t\tint a=Integer.parseInt(str[i]);\n\t\t\t\tst.push(a);\n\t\t\t}catch(Exception e){\n\t\t\t\tif(str[i].equals(\"+\")){\n\t\t\t\t\tint a=st.pop();\n\t\t\t\t\tint b=st.pop();\n\t\t\t\t\tst.push(a+b);\n\t\t\t\t}else if(str[i].equals(\"-\")){\n\n\t\t\t\t\tint a=st.pop();\n\t\t\t\t\tint b=st.pop();\n\t\t\t\t\tst.push(b-a);\n\t\t\t\t}else{\n\t\t\t\t\tint a=st.pop();\n\t\t\t\t\tint b=st.pop();\n\t\t\t\t\tst.push(a*b);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tout.println(st.pop());\n\t}",
"main",
"{\n\t\tScanner in=new Scanner(System.in);\n\t\tPrintWriter out=new PrintWriter(System.out, true);\n\t\tString str[]=in.nextLine().split(\" \");\n\t\tStack<Integer> st=new Stack<>();\n\t\tfor(int i=0;i<str.length;i++){\n\t\t\ttry{\n\t\t\t\tint a=Integer.parseInt(str[i]);\n\t\t\t\tst.push(a);\n\t\t\t}catch(Exception e){\n\t\t\t\tif(str[i].equals(\"+\")){\n\t\t\t\t\tint a=st.pop();\n\t\t\t\t\tint b=st.pop();\n\t\t\t\t\tst.push(a+b);\n\t\t\t\t}else if(str[i].equals(\"-\")){\n\n\t\t\t\t\tint a=st.pop();\n\t\t\t\t\tint b=st.pop();\n\t\t\t\t\tst.push(b-a);\n\t\t\t\t}else{\n\t\t\t\t\tint a=st.pop();\n\t\t\t\t\tint b=st.pop();\n\t\t\t\t\tst.push(a*b);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tout.println(st.pop());\n\t}",
"Scanner in=new Scanner(System.in);",
"in",
"new Scanner(System.in)",
"PrintWriter out=new PrintWriter(System.out, true);",
"out",
"new PrintWriter(System.out, true)",
"String str[]=in.nextLine().split(\" \");",
"str",
"in.nextLine().split(\" \")",
"in.nextLine().split",
"in.nextLine()",
"in.nextLine",
"in",
"\" \"",
"Stack<Integer> st=new Stack<>();",
"st",
"new Stack<>()",
"for(int i=0;i<str.length;i++){\n\t\t\ttry{\n\t\t\t\tint a=Integer.parseInt(str[i]);\n\t\t\t\tst.push(a);\n\t\t\t}catch(Exception e){\n\t\t\t\tif(str[i].equals(\"+\")){\n\t\t\t\t\tint a=st.pop();\n\t\t\t\t\tint b=st.pop();\n\t\t\t\t\tst.push(a+b);\n\t\t\t\t}else if(str[i].equals(\"-\")){\n\n\t\t\t\t\tint a=st.pop();\n\t\t\t\t\tint b=st.pop();\n\t\t\t\t\tst.push(b-a);\n\t\t\t\t}else{\n\t\t\t\t\tint a=st.pop();\n\t\t\t\t\tint b=st.pop();\n\t\t\t\t\tst.push(a*b);\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<str.length",
"i",
"str.length",
"str",
"str.length",
"i++",
"i++",
"i",
"{\n\t\t\ttry{\n\t\t\t\tint a=Integer.parseInt(str[i]);\n\t\t\t\tst.push(a);\n\t\t\t}catch(Exception e){\n\t\t\t\tif(str[i].equals(\"+\")){\n\t\t\t\t\tint a=st.pop();\n\t\t\t\t\tint b=st.pop();\n\t\t\t\t\tst.push(a+b);\n\t\t\t\t}else if(str[i].equals(\"-\")){\n\n\t\t\t\t\tint a=st.pop();\n\t\t\t\t\tint b=st.pop();\n\t\t\t\t\tst.push(b-a);\n\t\t\t\t}else{\n\t\t\t\t\tint a=st.pop();\n\t\t\t\t\tint b=st.pop();\n\t\t\t\t\tst.push(a*b);\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"{\n\t\t\ttry{\n\t\t\t\tint a=Integer.parseInt(str[i]);\n\t\t\t\tst.push(a);\n\t\t\t}catch(Exception e){\n\t\t\t\tif(str[i].equals(\"+\")){\n\t\t\t\t\tint a=st.pop();\n\t\t\t\t\tint b=st.pop();\n\t\t\t\t\tst.push(a+b);\n\t\t\t\t}else if(str[i].equals(\"-\")){\n\n\t\t\t\t\tint a=st.pop();\n\t\t\t\t\tint b=st.pop();\n\t\t\t\t\tst.push(b-a);\n\t\t\t\t}else{\n\t\t\t\t\tint a=st.pop();\n\t\t\t\t\tint b=st.pop();\n\t\t\t\t\tst.push(a*b);\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"try{\n\t\t\t\tint a=Integer.parseInt(str[i]);\n\t\t\t\tst.push(a);\n\t\t\t}catch(Exception e){\n\t\t\t\tif(str[i].equals(\"+\")){\n\t\t\t\t\tint a=st.pop();\n\t\t\t\t\tint b=st.pop();\n\t\t\t\t\tst.push(a+b);\n\t\t\t\t}else if(str[i].equals(\"-\")){\n\n\t\t\t\t\tint a=st.pop();\n\t\t\t\t\tint b=st.pop();\n\t\t\t\t\tst.push(b-a);\n\t\t\t\t}else{\n\t\t\t\t\tint a=st.pop();\n\t\t\t\t\tint b=st.pop();\n\t\t\t\t\tst.push(a*b);\n\t\t\t\t}\n\t\t\t}",
"catch(Exception e){\n\t\t\t\tif(str[i].equals(\"+\")){\n\t\t\t\t\tint a=st.pop();\n\t\t\t\t\tint b=st.pop();\n\t\t\t\t\tst.push(a+b);\n\t\t\t\t}else if(str[i].equals(\"-\")){\n\n\t\t\t\t\tint a=st.pop();\n\t\t\t\t\tint b=st.pop();\n\t\t\t\t\tst.push(b-a);\n\t\t\t\t}else{\n\t\t\t\t\tint a=st.pop();\n\t\t\t\t\tint b=st.pop();\n\t\t\t\t\tst.push(a*b);\n\t\t\t\t}\n\t\t\t}",
"Exception e",
"{\n\t\t\t\tif(str[i].equals(\"+\")){\n\t\t\t\t\tint a=st.pop();\n\t\t\t\t\tint b=st.pop();\n\t\t\t\t\tst.push(a+b);\n\t\t\t\t}else if(str[i].equals(\"-\")){\n\n\t\t\t\t\tint a=st.pop();\n\t\t\t\t\tint b=st.pop();\n\t\t\t\t\tst.push(b-a);\n\t\t\t\t}else{\n\t\t\t\t\tint a=st.pop();\n\t\t\t\t\tint b=st.pop();\n\t\t\t\t\tst.push(a*b);\n\t\t\t\t}\n\t\t\t}",
"if(str[i].equals(\"+\")){\n\t\t\t\t\tint a=st.pop();\n\t\t\t\t\tint b=st.pop();\n\t\t\t\t\tst.push(a+b);\n\t\t\t\t}else if(str[i].equals(\"-\")){\n\n\t\t\t\t\tint a=st.pop();\n\t\t\t\t\tint b=st.pop();\n\t\t\t\t\tst.push(b-a);\n\t\t\t\t}else{\n\t\t\t\t\tint a=st.pop();\n\t\t\t\t\tint b=st.pop();\n\t\t\t\t\tst.push(a*b);\n\t\t\t\t}",
"str[i].equals(\"+\")",
"str[i].equals",
"str[i]",
"str",
"i",
"\"+\"",
"{\n\t\t\t\t\tint a=st.pop();\n\t\t\t\t\tint b=st.pop();\n\t\t\t\t\tst.push(a+b);\n\t\t\t\t}",
"int a=st.pop();",
"a",
"st.pop()",
"st.pop",
"st",
"int b=st.pop();",
"b",
"st.pop()",
"st.pop",
"st",
"st.push(a+b)",
"st.push",
"st",
"a+b",
"a",
"b",
"if(str[i].equals(\"-\")){\n\n\t\t\t\t\tint a=st.pop();\n\t\t\t\t\tint b=st.pop();\n\t\t\t\t\tst.push(b-a);\n\t\t\t\t}else{\n\t\t\t\t\tint a=st.pop();\n\t\t\t\t\tint b=st.pop();\n\t\t\t\t\tst.push(a*b);\n\t\t\t\t}",
"str[i].equals(\"-\")",
"str[i].equals",
"str[i]",
"str",
"i",
"\"-\"",
"{\n\n\t\t\t\t\tint a=st.pop();\n\t\t\t\t\tint b=st.pop();\n\t\t\t\t\tst.push(b-a);\n\t\t\t\t}",
"int a=st.pop();",
"a",
"st.pop()",
"st.pop",
"st",
"int b=st.pop();",
"b",
"st.pop()",
"st.pop",
"st",
"st.push(b-a)",
"st.push",
"st",
"b-a",
"b",
"a",
"{\n\t\t\t\t\tint a=st.pop();\n\t\t\t\t\tint b=st.pop();\n\t\t\t\t\tst.push(a*b);\n\t\t\t\t}",
"int a=st.pop();",
"a",
"st.pop()",
"st.pop",
"st",
"int b=st.pop();",
"b",
"st.pop()",
"st.pop",
"st",
"st.push(a*b)",
"st.push",
"st",
"a*b",
"a",
"b",
"{\n\t\t\t\tint a=Integer.parseInt(str[i]);\n\t\t\t\tst.push(a);\n\t\t\t}",
"int a=Integer.parseInt(str[i]);",
"a",
"Integer.parseInt(str[i])",
"Integer.parseInt",
"Integer",
"str[i]",
"str",
"i",
"st.push(a)",
"st.push",
"st",
"a",
"out.println(st.pop())",
"out.println",
"out",
"st.pop()",
"st.pop",
"st",
"String[]args",
"args"
] | import java.util.*;
import java.io.*;
class Main{
public static void main(String[]args){
Scanner in=new Scanner(System.in);
PrintWriter out=new PrintWriter(System.out, true);
String str[]=in.nextLine().split(" ");
Stack<Integer> st=new Stack<>();
for(int i=0;i<str.length;i++){
try{
int a=Integer.parseInt(str[i]);
st.push(a);
}catch(Exception e){
if(str[i].equals("+")){
int a=st.pop();
int b=st.pop();
st.push(a+b);
}else if(str[i].equals("-")){
int a=st.pop();
int b=st.pop();
st.push(b-a);
}else{
int a=st.pop();
int b=st.pop();
st.push(a*b);
}
}
}
out.println(st.pop());
}
}
|
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.