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,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
20,
41,
13,
4,
18,
4,
18,
13,
17,
41,
13,
20,
18,
13,
13,
41,
13,
40,
17,
41,
13,
41,
13,
28,
13,
13,
30,
30,
35,
13,
34,
17,
1,
0,
13,
18,
13,
13,
0,
18,
13,
40,
13,
17,
0,
13,
18,
13,
13,
0,
18,
13,
40,
13,
17,
0,
18,
13,
40,
13,
2,
13,
13,
3,
34,
17,
1,
0,
13,
18,
13,
13,
0,
18,
13,
40,
13,
17,
0,
13,
18,
13,
13,
0,
18,
13,
40,
13,
17,
0,
18,
13,
40,
13,
2,
13,
13,
3,
34,
17,
1,
0,
13,
18,
13,
13,
0,
18,
13,
40,
13,
17,
0,
13,
18,
13,
13,
0,
18,
13,
40,
13,
17,
0,
18,
13,
40,
13,
2,
13,
13,
3,
34,
17,
1,
0,
13,
18,
13,
13,
0,
18,
13,
40,
13,
17,
0,
13,
18,
13,
13,
0,
18,
13,
40,
13,
17,
0,
18,
13,
40,
13,
2,
13,
13,
3,
34,
1,
0,
18,
13,
40,
13,
4,
18,
13,
13,
3,
4,
18,
13,
2,
18,
13,
17,
17,
4,
18,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
206,
5
],
[
206,
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
],
[
19,
20
],
[
20,
21
],
[
17,
22
],
[
8,
23
],
[
23,
24
],
[
23,
25
],
[
26,
27
],
[
26,
28
],
[
8,
29
],
[
29,
30
],
[
29,
31
],
[
31,
32
],
[
8,
33
],
[
33,
34
],
[
8,
35
],
[
35,
36
],
[
8,
37
],
[
37,
38
],
[
37,
39
],
[
37,
40
],
[
41,
41
],
[
41,
42
],
[
42,
43
],
[
42,
44
],
[
44,
45
],
[
44,
46
],
[
46,
47
],
[
47,
48
],
[
47,
49
],
[
49,
50
],
[
49,
51
],
[
46,
52
],
[
52,
53
],
[
53,
54
],
[
53,
55
],
[
55,
56
],
[
52,
57
],
[
46,
58
],
[
58,
59
],
[
58,
60
],
[
60,
61
],
[
60,
62
],
[
46,
63
],
[
63,
64
],
[
64,
65
],
[
64,
66
],
[
66,
67
],
[
63,
68
],
[
46,
69
],
[
69,
70
],
[
70,
71
],
[
70,
72
],
[
72,
73
],
[
69,
74
],
[
74,
75
],
[
74,
76
],
[
46,
77
],
[
42,
78
],
[
78,
79
],
[
78,
80
],
[
80,
81
],
[
81,
82
],
[
81,
83
],
[
83,
84
],
[
83,
85
],
[
80,
86
],
[
86,
87
],
[
87,
88
],
[
87,
89
],
[
89,
90
],
[
86,
91
],
[
80,
92
],
[
92,
93
],
[
92,
94
],
[
94,
95
],
[
94,
96
],
[
80,
97
],
[
97,
98
],
[
98,
99
],
[
98,
100
],
[
100,
101
],
[
97,
102
],
[
80,
103
],
[
103,
104
],
[
104,
105
],
[
104,
106
],
[
106,
107
],
[
103,
108
],
[
108,
109
],
[
108,
110
],
[
80,
111
],
[
42,
112
],
[
112,
113
],
[
112,
114
],
[
114,
115
],
[
115,
116
],
[
115,
117
],
[
117,
118
],
[
117,
119
],
[
114,
120
],
[
120,
121
],
[
121,
122
],
[
121,
123
],
[
123,
124
],
[
120,
125
],
[
114,
126
],
[
126,
127
],
[
126,
128
],
[
128,
129
],
[
128,
130
],
[
114,
131
],
[
131,
132
],
[
132,
133
],
[
132,
134
],
[
134,
135
],
[
131,
136
],
[
114,
137
],
[
137,
138
],
[
138,
139
],
[
138,
140
],
[
140,
141
],
[
137,
142
],
[
142,
143
],
[
142,
144
],
[
114,
145
],
[
42,
146
],
[
146,
147
],
[
146,
148
],
[
148,
149
],
[
149,
150
],
[
149,
151
],
[
151,
152
],
[
151,
153
],
[
148,
154
],
[
154,
155
],
[
155,
156
],
[
155,
157
],
[
157,
158
],
[
154,
159
],
[
148,
160
],
[
160,
161
],
[
160,
162
],
[
162,
163
],
[
162,
164
],
[
148,
165
],
[
165,
166
],
[
166,
167
],
[
166,
168
],
[
168,
169
],
[
165,
170
],
[
148,
171
],
[
171,
172
],
[
172,
173
],
[
172,
174
],
[
174,
175
],
[
171,
176
],
[
176,
177
],
[
176,
178
],
[
148,
179
],
[
42,
180
],
[
180,
181
],
[
181,
182
],
[
182,
183
],
[
183,
184
],
[
183,
185
],
[
185,
186
],
[
182,
187
],
[
187,
188
],
[
188,
189
],
[
187,
190
],
[
181,
191
],
[
8,
192
],
[
192,
193
],
[
193,
194
],
[
192,
195
],
[
195,
196
],
[
196,
197
],
[
196,
198
],
[
195,
199
],
[
8,
200
],
[
200,
201
],
[
201,
202
],
[
6,
203
],
[
203,
204
],
[
0,
205
],
[
205,
206
],
[
205,
207
]
] | [
"import java.io.*;\n\npublic class Main {\n\n public static void main(String a[]) throws IOException {\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));\n String[] input = br.readLine().split(\" \");\n int[] stack = new int[input.length];\n int top = -1;\n int op1, op2;\n for (String i : input) {\n switch (i) {\n case \"-\":\n op1 = stack[top];\n stack[top--] = 0;\n op2 = stack[top];\n stack[top--] = 0;\n stack[++top] = op2 - op1 ;\n break;\n case \"+\":\n op1 = stack[top];\n stack[top--] = 0;\n op2 = stack[top];\n stack[top--] = 0;\n stack[++top] = op2 + op1;\n break;\n case \"/\":\n op1 = stack[top];\n stack[top--] = 0;\n op2 = stack[top];\n stack[top--] = 0;\n stack[++top] = op2 / op1;\n break;\n case \"*\":\n op1 = stack[top];\n stack[top--] = 0;\n op2 = stack[top];\n stack[top--] = 0;\n stack[++top] = op2 * op1;\n break;\n default:\n stack[++top] = Integer.parseInt(i);\n break;\n }\n }\n bw.append(stack[0] + \"\\n\");\n bw.flush();\n }\n\n}",
"import java.io.*;",
"io.*",
"java",
"public class Main {\n\n public static void main(String a[]) throws IOException {\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));\n String[] input = br.readLine().split(\" \");\n int[] stack = new int[input.length];\n int top = -1;\n int op1, op2;\n for (String i : input) {\n switch (i) {\n case \"-\":\n op1 = stack[top];\n stack[top--] = 0;\n op2 = stack[top];\n stack[top--] = 0;\n stack[++top] = op2 - op1 ;\n break;\n case \"+\":\n op1 = stack[top];\n stack[top--] = 0;\n op2 = stack[top];\n stack[top--] = 0;\n stack[++top] = op2 + op1;\n break;\n case \"/\":\n op1 = stack[top];\n stack[top--] = 0;\n op2 = stack[top];\n stack[top--] = 0;\n stack[++top] = op2 / op1;\n break;\n case \"*\":\n op1 = stack[top];\n stack[top--] = 0;\n op2 = stack[top];\n stack[top--] = 0;\n stack[++top] = op2 * op1;\n break;\n default:\n stack[++top] = Integer.parseInt(i);\n break;\n }\n }\n bw.append(stack[0] + \"\\n\");\n bw.flush();\n }\n\n}",
"Main",
"public static void main(String a[]) throws IOException {\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));\n String[] input = br.readLine().split(\" \");\n int[] stack = new int[input.length];\n int top = -1;\n int op1, op2;\n for (String i : input) {\n switch (i) {\n case \"-\":\n op1 = stack[top];\n stack[top--] = 0;\n op2 = stack[top];\n stack[top--] = 0;\n stack[++top] = op2 - op1 ;\n break;\n case \"+\":\n op1 = stack[top];\n stack[top--] = 0;\n op2 = stack[top];\n stack[top--] = 0;\n stack[++top] = op2 + op1;\n break;\n case \"/\":\n op1 = stack[top];\n stack[top--] = 0;\n op2 = stack[top];\n stack[top--] = 0;\n stack[++top] = op2 / op1;\n break;\n case \"*\":\n op1 = stack[top];\n stack[top--] = 0;\n op2 = stack[top];\n stack[top--] = 0;\n stack[++top] = op2 * op1;\n break;\n default:\n stack[++top] = Integer.parseInt(i);\n break;\n }\n }\n bw.append(stack[0] + \"\\n\");\n bw.flush();\n }",
"main",
"{\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));\n String[] input = br.readLine().split(\" \");\n int[] stack = new int[input.length];\n int top = -1;\n int op1, op2;\n for (String i : input) {\n switch (i) {\n case \"-\":\n op1 = stack[top];\n stack[top--] = 0;\n op2 = stack[top];\n stack[top--] = 0;\n stack[++top] = op2 - op1 ;\n break;\n case \"+\":\n op1 = stack[top];\n stack[top--] = 0;\n op2 = stack[top];\n stack[top--] = 0;\n stack[++top] = op2 + op1;\n break;\n case \"/\":\n op1 = stack[top];\n stack[top--] = 0;\n op2 = stack[top];\n stack[top--] = 0;\n stack[++top] = op2 / op1;\n break;\n case \"*\":\n op1 = stack[top];\n stack[top--] = 0;\n op2 = stack[top];\n stack[top--] = 0;\n stack[++top] = op2 * op1;\n break;\n default:\n stack[++top] = Integer.parseInt(i);\n break;\n }\n }\n bw.append(stack[0] + \"\\n\");\n bw.flush();\n }",
"BufferedReader br = new BufferedReader(new InputStreamReader(System.in));",
"br",
"new BufferedReader(new InputStreamReader(System.in))",
"BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));",
"bw",
"new BufferedWriter(new OutputStreamWriter(System.out))",
"String[] input = br.readLine().split(\" \");",
"input",
"br.readLine().split(\" \")",
"br.readLine().split",
"br.readLine()",
"br.readLine",
"br",
"\" \"",
"int[] stack = new int[input.length];",
"stack",
"new int[input.length]",
"input.length",
"input",
"input.length",
"int top = -1;",
"top",
"-1",
"1",
"int op1",
"op1",
"op2;",
"op2",
"for (String i : input) {\n switch (i) {\n case \"-\":\n op1 = stack[top];\n stack[top--] = 0;\n op2 = stack[top];\n stack[top--] = 0;\n stack[++top] = op2 - op1 ;\n break;\n case \"+\":\n op1 = stack[top];\n stack[top--] = 0;\n op2 = stack[top];\n stack[top--] = 0;\n stack[++top] = op2 + op1;\n break;\n case \"/\":\n op1 = stack[top];\n stack[top--] = 0;\n op2 = stack[top];\n stack[top--] = 0;\n stack[++top] = op2 / op1;\n break;\n case \"*\":\n op1 = stack[top];\n stack[top--] = 0;\n op2 = stack[top];\n stack[top--] = 0;\n stack[++top] = op2 * op1;\n break;\n default:\n stack[++top] = Integer.parseInt(i);\n break;\n }\n }",
"String i",
"input",
"{\n switch (i) {\n case \"-\":\n op1 = stack[top];\n stack[top--] = 0;\n op2 = stack[top];\n stack[top--] = 0;\n stack[++top] = op2 - op1 ;\n break;\n case \"+\":\n op1 = stack[top];\n stack[top--] = 0;\n op2 = stack[top];\n stack[top--] = 0;\n stack[++top] = op2 + op1;\n break;\n case \"/\":\n op1 = stack[top];\n stack[top--] = 0;\n op2 = stack[top];\n stack[top--] = 0;\n stack[++top] = op2 / op1;\n break;\n case \"*\":\n op1 = stack[top];\n stack[top--] = 0;\n op2 = stack[top];\n stack[top--] = 0;\n stack[++top] = op2 * op1;\n break;\n default:\n stack[++top] = Integer.parseInt(i);\n break;\n }\n }",
"{\n switch (i) {\n case \"-\":\n op1 = stack[top];\n stack[top--] = 0;\n op2 = stack[top];\n stack[top--] = 0;\n stack[++top] = op2 - op1 ;\n break;\n case \"+\":\n op1 = stack[top];\n stack[top--] = 0;\n op2 = stack[top];\n stack[top--] = 0;\n stack[++top] = op2 + op1;\n break;\n case \"/\":\n op1 = stack[top];\n stack[top--] = 0;\n op2 = stack[top];\n stack[top--] = 0;\n stack[++top] = op2 / op1;\n break;\n case \"*\":\n op1 = stack[top];\n stack[top--] = 0;\n op2 = stack[top];\n stack[top--] = 0;\n stack[++top] = op2 * op1;\n break;\n default:\n stack[++top] = Integer.parseInt(i);\n break;\n }\n }",
"switch (i) {\n case \"-\":\n op1 = stack[top];\n stack[top--] = 0;\n op2 = stack[top];\n stack[top--] = 0;\n stack[++top] = op2 - op1 ;\n break;\n case \"+\":\n op1 = stack[top];\n stack[top--] = 0;\n op2 = stack[top];\n stack[top--] = 0;\n stack[++top] = op2 + op1;\n break;\n case \"/\":\n op1 = stack[top];\n stack[top--] = 0;\n op2 = stack[top];\n stack[top--] = 0;\n stack[++top] = op2 / op1;\n break;\n case \"*\":\n op1 = stack[top];\n stack[top--] = 0;\n op2 = stack[top];\n stack[top--] = 0;\n stack[++top] = op2 * op1;\n break;\n default:\n stack[++top] = Integer.parseInt(i);\n break;\n }",
"i",
"case \"-\":",
"\"-\"",
"case \"-\":",
"op1 = stack[top]",
"op1",
"stack[top]",
"stack",
"top",
"stack[top--] = 0",
"stack[top--]",
"stack",
"top--",
"top",
"0",
"op2 = stack[top]",
"op2",
"stack[top]",
"stack",
"top",
"stack[top--] = 0",
"stack[top--]",
"stack",
"top--",
"top",
"0",
"stack[++top] = op2 - op1",
"stack[++top]",
"stack",
"++top",
"top",
"op2 - op1",
"op2",
"op1",
"break;",
"case \"+\":",
"\"+\"",
"case \"+\":",
"op1 = stack[top]",
"op1",
"stack[top]",
"stack",
"top",
"stack[top--] = 0",
"stack[top--]",
"stack",
"top--",
"top",
"0",
"op2 = stack[top]",
"op2",
"stack[top]",
"stack",
"top",
"stack[top--] = 0",
"stack[top--]",
"stack",
"top--",
"top",
"0",
"stack[++top] = op2 + op1",
"stack[++top]",
"stack",
"++top",
"top",
"op2 + op1",
"op2",
"op1",
"break;",
"case \"/\":",
"\"/\"",
"case \"/\":",
"op1 = stack[top]",
"op1",
"stack[top]",
"stack",
"top",
"stack[top--] = 0",
"stack[top--]",
"stack",
"top--",
"top",
"0",
"op2 = stack[top]",
"op2",
"stack[top]",
"stack",
"top",
"stack[top--] = 0",
"stack[top--]",
"stack",
"top--",
"top",
"0",
"stack[++top] = op2 / op1",
"stack[++top]",
"stack",
"++top",
"top",
"op2 / op1",
"op2",
"op1",
"break;",
"case \"*\":",
"\"*\"",
"case \"*\":",
"op1 = stack[top]",
"op1",
"stack[top]",
"stack",
"top",
"stack[top--] = 0",
"stack[top--]",
"stack",
"top--",
"top",
"0",
"op2 = stack[top]",
"op2",
"stack[top]",
"stack",
"top",
"stack[top--] = 0",
"stack[top--]",
"stack",
"top--",
"top",
"0",
"stack[++top] = op2 * op1",
"stack[++top]",
"stack",
"++top",
"top",
"op2 * op1",
"op2",
"op1",
"break;",
"default:",
"default:",
"stack[++top] = Integer.parseInt(i)",
"stack[++top]",
"stack",
"++top",
"top",
"Integer.parseInt(i)",
"Integer.parseInt",
"Integer",
"i",
"break;",
"bw.append(stack[0] + \"\\n\")",
"bw.append",
"bw",
"stack[0] + \"\\n\"",
"stack[0]",
"stack",
"0",
"\"\\n\"",
"bw.flush()",
"bw.flush",
"bw",
"String a[]",
"a",
"public class Main {\n\n public static void main(String a[]) throws IOException {\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));\n String[] input = br.readLine().split(\" \");\n int[] stack = new int[input.length];\n int top = -1;\n int op1, op2;\n for (String i : input) {\n switch (i) {\n case \"-\":\n op1 = stack[top];\n stack[top--] = 0;\n op2 = stack[top];\n stack[top--] = 0;\n stack[++top] = op2 - op1 ;\n break;\n case \"+\":\n op1 = stack[top];\n stack[top--] = 0;\n op2 = stack[top];\n stack[top--] = 0;\n stack[++top] = op2 + op1;\n break;\n case \"/\":\n op1 = stack[top];\n stack[top--] = 0;\n op2 = stack[top];\n stack[top--] = 0;\n stack[++top] = op2 / op1;\n break;\n case \"*\":\n op1 = stack[top];\n stack[top--] = 0;\n op2 = stack[top];\n stack[top--] = 0;\n stack[++top] = op2 * op1;\n break;\n default:\n stack[++top] = Integer.parseInt(i);\n break;\n }\n }\n bw.append(stack[0] + \"\\n\");\n bw.flush();\n }\n\n}",
"public class Main {\n\n public static void main(String a[]) throws IOException {\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));\n String[] input = br.readLine().split(\" \");\n int[] stack = new int[input.length];\n int top = -1;\n int op1, op2;\n for (String i : input) {\n switch (i) {\n case \"-\":\n op1 = stack[top];\n stack[top--] = 0;\n op2 = stack[top];\n stack[top--] = 0;\n stack[++top] = op2 - op1 ;\n break;\n case \"+\":\n op1 = stack[top];\n stack[top--] = 0;\n op2 = stack[top];\n stack[top--] = 0;\n stack[++top] = op2 + op1;\n break;\n case \"/\":\n op1 = stack[top];\n stack[top--] = 0;\n op2 = stack[top];\n stack[top--] = 0;\n stack[++top] = op2 / op1;\n break;\n case \"*\":\n op1 = stack[top];\n stack[top--] = 0;\n op2 = stack[top];\n stack[top--] = 0;\n stack[++top] = op2 * op1;\n break;\n default:\n stack[++top] = Integer.parseInt(i);\n break;\n }\n }\n bw.append(stack[0] + \"\\n\");\n bw.flush();\n }\n\n}",
"Main"
] | import java.io.*;
public class Main {
public static void main(String a[]) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));
String[] input = br.readLine().split(" ");
int[] stack = new int[input.length];
int top = -1;
int op1, op2;
for (String i : input) {
switch (i) {
case "-":
op1 = stack[top];
stack[top--] = 0;
op2 = stack[top];
stack[top--] = 0;
stack[++top] = op2 - op1 ;
break;
case "+":
op1 = stack[top];
stack[top--] = 0;
op2 = stack[top];
stack[top--] = 0;
stack[++top] = op2 + op1;
break;
case "/":
op1 = stack[top];
stack[top--] = 0;
op2 = stack[top];
stack[top--] = 0;
stack[++top] = op2 / op1;
break;
case "*":
op1 = stack[top];
stack[top--] = 0;
op2 = stack[top];
stack[top--] = 0;
stack[++top] = op2 * op1;
break;
default:
stack[++top] = Integer.parseInt(i);
break;
}
}
bw.append(stack[0] + "\n");
bw.flush();
}
}
|
[
7,
15,
13,
17,
6,
13,
41,
13,
20,
17,
12,
13,
30,
41,
13,
17,
41,
13,
41,
13,
20,
0,
13,
4,
18,
13,
42,
17,
30,
14,
4,
13,
13,
30,
40,
13,
0,
18,
13,
13,
4,
18,
13,
13,
30,
14,
4,
18,
13,
17,
30,
0,
18,
13,
2,
13,
17,
2,
18,
13,
2,
13,
17,
18,
13,
13,
40,
13,
14,
4,
18,
13,
17,
30,
0,
18,
13,
2,
13,
17,
2,
18,
13,
2,
13,
17,
18,
13,
13,
40,
13,
14,
4,
18,
13,
17,
30,
0,
18,
13,
2,
13,
17,
2,
18,
13,
2,
13,
17,
18,
13,
13,
40,
13,
14,
4,
18,
13,
17,
30,
0,
18,
13,
2,
13,
17,
2,
18,
13,
2,
13,
17,
18,
13,
13,
40,
13,
14,
40,
4,
18,
13,
3,
0,
13,
4,
18,
13,
4,
18,
18,
13,
13,
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
],
[
177,
5
],
[
177,
6
],
[
6,
7
],
[
6,
8
],
[
177,
10
],
[
10,
11
],
[
10,
12
],
[
12,
13
],
[
13,
14
],
[
13,
15
],
[
12,
16
],
[
16,
17
],
[
12,
18
],
[
18,
19
],
[
18,
20
],
[
12,
21
],
[
21,
22
],
[
21,
23
],
[
23,
24
],
[
24,
25
],
[
12,
26
],
[
26,
27
],
[
26,
28
],
[
28,
29
],
[
29,
30
],
[
30,
31
],
[
30,
32
],
[
29,
33
],
[
33,
34
],
[
34,
35
],
[
33,
36
],
[
36,
37
],
[
37,
38
],
[
37,
39
],
[
36,
40
],
[
40,
41
],
[
41,
42
],
[
40,
43
],
[
29,
44
],
[
44,
45
],
[
45,
46
],
[
46,
47
],
[
47,
48
],
[
46,
49
],
[
45,
50
],
[
50,
51
],
[
51,
52
],
[
52,
53
],
[
52,
54
],
[
54,
55
],
[
54,
56
],
[
51,
57
],
[
57,
58
],
[
58,
59
],
[
58,
60
],
[
60,
61
],
[
60,
62
],
[
57,
63
],
[
63,
64
],
[
63,
65
],
[
50,
66
],
[
66,
67
],
[
44,
68
],
[
68,
69
],
[
69,
70
],
[
70,
71
],
[
69,
72
],
[
68,
73
],
[
73,
74
],
[
74,
75
],
[
75,
76
],
[
75,
77
],
[
77,
78
],
[
77,
79
],
[
74,
80
],
[
80,
81
],
[
81,
82
],
[
81,
83
],
[
83,
84
],
[
83,
85
],
[
80,
86
],
[
86,
87
],
[
86,
88
],
[
73,
89
],
[
89,
90
],
[
44,
91
],
[
91,
92
],
[
92,
93
],
[
93,
94
],
[
92,
95
],
[
91,
96
],
[
96,
97
],
[
97,
98
],
[
98,
99
],
[
98,
100
],
[
100,
101
],
[
100,
102
],
[
97,
103
],
[
103,
104
],
[
104,
105
],
[
104,
106
],
[
106,
107
],
[
106,
108
],
[
103,
109
],
[
109,
110
],
[
109,
111
],
[
96,
112
],
[
112,
113
],
[
44,
114
],
[
114,
115
],
[
115,
116
],
[
116,
117
],
[
115,
118
],
[
114,
119
],
[
119,
120
],
[
120,
121
],
[
121,
122
],
[
121,
123
],
[
123,
124
],
[
123,
125
],
[
120,
126
],
[
126,
127
],
[
127,
128
],
[
127,
129
],
[
129,
130
],
[
129,
131
],
[
126,
132
],
[
132,
133
],
[
132,
134
],
[
119,
135
],
[
135,
136
],
[
28,
137
],
[
137,
138
],
[
138,
139
],
[
139,
140
],
[
140,
141
],
[
137,
142
],
[
28,
143
],
[
143,
144
],
[
143,
145
],
[
145,
146
],
[
146,
147
],
[
12,
148
],
[
148,
149
],
[
149,
150
],
[
150,
151
],
[
150,
152
],
[
148,
153
],
[
153,
154
],
[
153,
155
],
[
10,
156
],
[
156,
157
],
[
177,
158
],
[
158,
159
],
[
158,
160
],
[
160,
161
],
[
161,
162
],
[
162,
163
],
[
162,
164
],
[
164,
165
],
[
165,
166
],
[
161,
167
],
[
167,
168
],
[
168,
169
],
[
169,
170
],
[
168,
171
],
[
167,
172
],
[
172,
173
],
[
158,
174
],
[
174,
175
],
[
0,
176
],
[
176,
177
],
[
176,
178
]
] | [
"import java.util.Scanner;\npublic class Main{\n static int stack[]=new int[101];\n\tpublic static void main(String[] args) {\n\t\tint i=0;\n\t\tString s;\n\t\t// TODO Auto-generated method stub\n Scanner sc= new Scanner(System.in);\n\ts=sc.next();\n while(true){\n \tif(Number(s)){\n \t i++;\n \t stack[i]=Integer.parseInt(s);\n \t }else{\n \t\t if(s.equals(\"+\")){\n \t\t\t stack[i-1]=stack[i-1]+stack[i];\n \t\t\t i--;\n \t\t }\n \t\tif(s.equals(\"-\")){\n \t\t\tstack[i-1]=stack[i-1]-stack[i];\n \t\t\ti--;\n \t\t}\n \t\tif(s.equals(\"*\")){\n \t\t\tstack[i-1]=stack[i-1]*stack[i];\n \t\t\ti--;\n \t\t}\n \t\tif(s.equals(\"/\")){\n \t\t\tstack[i-1]=stack[i-1]/stack[i];\n \t\t\ti--;\n \t\t}\n \t \n }\n \tif(!sc.hasNext()) break;\n \ts=sc.next();\n }\n System.out.println(stack[1]);\n\t}\n\tpublic static boolean Number(String a){\n\t\ttry{\n\t\t\tInteger.parseInt(a);\n\t\treturn true ;\n\t\t}catch(Exception e){\n\t\treturn false;\n\t}\n}\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main{\n static int stack[]=new int[101];\n\tpublic static void main(String[] args) {\n\t\tint i=0;\n\t\tString s;\n\t\t// TODO Auto-generated method stub\n Scanner sc= new Scanner(System.in);\n\ts=sc.next();\n while(true){\n \tif(Number(s)){\n \t i++;\n \t stack[i]=Integer.parseInt(s);\n \t }else{\n \t\t if(s.equals(\"+\")){\n \t\t\t stack[i-1]=stack[i-1]+stack[i];\n \t\t\t i--;\n \t\t }\n \t\tif(s.equals(\"-\")){\n \t\t\tstack[i-1]=stack[i-1]-stack[i];\n \t\t\ti--;\n \t\t}\n \t\tif(s.equals(\"*\")){\n \t\t\tstack[i-1]=stack[i-1]*stack[i];\n \t\t\ti--;\n \t\t}\n \t\tif(s.equals(\"/\")){\n \t\t\tstack[i-1]=stack[i-1]/stack[i];\n \t\t\ti--;\n \t\t}\n \t \n }\n \tif(!sc.hasNext()) break;\n \ts=sc.next();\n }\n System.out.println(stack[1]);\n\t}\n\tpublic static boolean Number(String a){\n\t\ttry{\n\t\t\tInteger.parseInt(a);\n\t\treturn true ;\n\t\t}catch(Exception e){\n\t\treturn false;\n\t}\n}\n}",
"Main",
"static int stack[]=new int[101];",
"stack",
"new int[101]",
"101",
"public static void main(String[] args) {\n\t\tint i=0;\n\t\tString s;\n\t\t// TODO Auto-generated method stub\n Scanner sc= new Scanner(System.in);\n\ts=sc.next();\n while(true){\n \tif(Number(s)){\n \t i++;\n \t stack[i]=Integer.parseInt(s);\n \t }else{\n \t\t if(s.equals(\"+\")){\n \t\t\t stack[i-1]=stack[i-1]+stack[i];\n \t\t\t i--;\n \t\t }\n \t\tif(s.equals(\"-\")){\n \t\t\tstack[i-1]=stack[i-1]-stack[i];\n \t\t\ti--;\n \t\t}\n \t\tif(s.equals(\"*\")){\n \t\t\tstack[i-1]=stack[i-1]*stack[i];\n \t\t\ti--;\n \t\t}\n \t\tif(s.equals(\"/\")){\n \t\t\tstack[i-1]=stack[i-1]/stack[i];\n \t\t\ti--;\n \t\t}\n \t \n }\n \tif(!sc.hasNext()) break;\n \ts=sc.next();\n }\n System.out.println(stack[1]);\n\t}",
"main",
"{\n\t\tint i=0;\n\t\tString s;\n\t\t// TODO Auto-generated method stub\n Scanner sc= new Scanner(System.in);\n\ts=sc.next();\n while(true){\n \tif(Number(s)){\n \t i++;\n \t stack[i]=Integer.parseInt(s);\n \t }else{\n \t\t if(s.equals(\"+\")){\n \t\t\t stack[i-1]=stack[i-1]+stack[i];\n \t\t\t i--;\n \t\t }\n \t\tif(s.equals(\"-\")){\n \t\t\tstack[i-1]=stack[i-1]-stack[i];\n \t\t\ti--;\n \t\t}\n \t\tif(s.equals(\"*\")){\n \t\t\tstack[i-1]=stack[i-1]*stack[i];\n \t\t\ti--;\n \t\t}\n \t\tif(s.equals(\"/\")){\n \t\t\tstack[i-1]=stack[i-1]/stack[i];\n \t\t\ti--;\n \t\t}\n \t \n }\n \tif(!sc.hasNext()) break;\n \ts=sc.next();\n }\n System.out.println(stack[1]);\n\t}",
"int i=0;",
"i",
"0",
"String s;",
"s",
"Scanner sc= new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"s=sc.next()",
"s",
"sc.next()",
"sc.next",
"sc",
"while(true){\n \tif(Number(s)){\n \t i++;\n \t stack[i]=Integer.parseInt(s);\n \t }else{\n \t\t if(s.equals(\"+\")){\n \t\t\t stack[i-1]=stack[i-1]+stack[i];\n \t\t\t i--;\n \t\t }\n \t\tif(s.equals(\"-\")){\n \t\t\tstack[i-1]=stack[i-1]-stack[i];\n \t\t\ti--;\n \t\t}\n \t\tif(s.equals(\"*\")){\n \t\t\tstack[i-1]=stack[i-1]*stack[i];\n \t\t\ti--;\n \t\t}\n \t\tif(s.equals(\"/\")){\n \t\t\tstack[i-1]=stack[i-1]/stack[i];\n \t\t\ti--;\n \t\t}\n \t \n }\n \tif(!sc.hasNext()) break;\n \ts=sc.next();\n }",
"true",
"{\n \tif(Number(s)){\n \t i++;\n \t stack[i]=Integer.parseInt(s);\n \t }else{\n \t\t if(s.equals(\"+\")){\n \t\t\t stack[i-1]=stack[i-1]+stack[i];\n \t\t\t i--;\n \t\t }\n \t\tif(s.equals(\"-\")){\n \t\t\tstack[i-1]=stack[i-1]-stack[i];\n \t\t\ti--;\n \t\t}\n \t\tif(s.equals(\"*\")){\n \t\t\tstack[i-1]=stack[i-1]*stack[i];\n \t\t\ti--;\n \t\t}\n \t\tif(s.equals(\"/\")){\n \t\t\tstack[i-1]=stack[i-1]/stack[i];\n \t\t\ti--;\n \t\t}\n \t \n }\n \tif(!sc.hasNext()) break;\n \ts=sc.next();\n }",
"if(Number(s)){\n \t i++;\n \t stack[i]=Integer.parseInt(s);\n \t }else{\n \t\t if(s.equals(\"+\")){\n \t\t\t stack[i-1]=stack[i-1]+stack[i];\n \t\t\t i--;\n \t\t }\n \t\tif(s.equals(\"-\")){\n \t\t\tstack[i-1]=stack[i-1]-stack[i];\n \t\t\ti--;\n \t\t}\n \t\tif(s.equals(\"*\")){\n \t\t\tstack[i-1]=stack[i-1]*stack[i];\n \t\t\ti--;\n \t\t}\n \t\tif(s.equals(\"/\")){\n \t\t\tstack[i-1]=stack[i-1]/stack[i];\n \t\t\ti--;\n \t\t}\n \t \n }",
"Number(s)",
"Number",
"s",
"{\n \t i++;\n \t stack[i]=Integer.parseInt(s);\n \t }",
"i++",
"i",
"stack[i]=Integer.parseInt(s)",
"stack[i]",
"stack",
"i",
"Integer.parseInt(s)",
"Integer.parseInt",
"Integer",
"s",
"{\n \t\t if(s.equals(\"+\")){\n \t\t\t stack[i-1]=stack[i-1]+stack[i];\n \t\t\t i--;\n \t\t }\n \t\tif(s.equals(\"-\")){\n \t\t\tstack[i-1]=stack[i-1]-stack[i];\n \t\t\ti--;\n \t\t}\n \t\tif(s.equals(\"*\")){\n \t\t\tstack[i-1]=stack[i-1]*stack[i];\n \t\t\ti--;\n \t\t}\n \t\tif(s.equals(\"/\")){\n \t\t\tstack[i-1]=stack[i-1]/stack[i];\n \t\t\ti--;\n \t\t}\n \t \n }",
"if(s.equals(\"+\")){\n \t\t\t stack[i-1]=stack[i-1]+stack[i];\n \t\t\t i--;\n \t\t }",
"s.equals(\"+\")",
"s.equals",
"s",
"\"+\"",
"{\n \t\t\t stack[i-1]=stack[i-1]+stack[i];\n \t\t\t i--;\n \t\t }",
"stack[i-1]=stack[i-1]+stack[i]",
"stack[i-1]",
"stack",
"i-1",
"i",
"1",
"stack[i-1]+stack[i]",
"stack[i-1]",
"stack",
"i-1",
"i",
"1",
"stack[i]",
"stack",
"i",
"i--",
"i",
"if(s.equals(\"-\")){\n \t\t\tstack[i-1]=stack[i-1]-stack[i];\n \t\t\ti--;\n \t\t}",
"s.equals(\"-\")",
"s.equals",
"s",
"\"-\"",
"{\n \t\t\tstack[i-1]=stack[i-1]-stack[i];\n \t\t\ti--;\n \t\t}",
"stack[i-1]=stack[i-1]-stack[i]",
"stack[i-1]",
"stack",
"i-1",
"i",
"1",
"stack[i-1]-stack[i]",
"stack[i-1]",
"stack",
"i-1",
"i",
"1",
"stack[i]",
"stack",
"i",
"i--",
"i",
"if(s.equals(\"*\")){\n \t\t\tstack[i-1]=stack[i-1]*stack[i];\n \t\t\ti--;\n \t\t}",
"s.equals(\"*\")",
"s.equals",
"s",
"\"*\"",
"{\n \t\t\tstack[i-1]=stack[i-1]*stack[i];\n \t\t\ti--;\n \t\t}",
"stack[i-1]=stack[i-1]*stack[i]",
"stack[i-1]",
"stack",
"i-1",
"i",
"1",
"stack[i-1]*stack[i]",
"stack[i-1]",
"stack",
"i-1",
"i",
"1",
"stack[i]",
"stack",
"i",
"i--",
"i",
"if(s.equals(\"/\")){\n \t\t\tstack[i-1]=stack[i-1]/stack[i];\n \t\t\ti--;\n \t\t}",
"s.equals(\"/\")",
"s.equals",
"s",
"\"/\"",
"{\n \t\t\tstack[i-1]=stack[i-1]/stack[i];\n \t\t\ti--;\n \t\t}",
"stack[i-1]=stack[i-1]/stack[i]",
"stack[i-1]",
"stack",
"i-1",
"i",
"1",
"stack[i-1]/stack[i]",
"stack[i-1]",
"stack",
"i-1",
"i",
"1",
"stack[i]",
"stack",
"i",
"i--",
"i",
"if(!sc.hasNext()) break;",
"!sc.hasNext()",
"sc.hasNext()",
"sc.hasNext",
"sc",
"break;",
"s=sc.next()",
"s",
"sc.next()",
"sc.next",
"sc",
"System.out.println(stack[1])",
"System.out.println",
"System.out",
"System",
"System.out",
"stack[1]",
"stack",
"1",
"String[] args",
"args",
"public static boolean Number(String a){\n\t\ttry{\n\t\t\tInteger.parseInt(a);\n\t\treturn true ;\n\t\t}catch(Exception e){\n\t\treturn false;\n\t}\n}",
"Number",
"{\n\t\ttry{\n\t\t\tInteger.parseInt(a);\n\t\treturn true ;\n\t\t}catch(Exception e){\n\t\treturn false;\n\t}\n}",
"try{\n\t\t\tInteger.parseInt(a);\n\t\treturn true ;\n\t\t}catch(Exception e){\n\t\treturn false;\n\t}",
"catch(Exception e){\n\t\treturn false;\n\t}",
"Exception e",
"{\n\t\treturn false;\n\t}",
"return false;",
"false",
"{\n\t\t\tInteger.parseInt(a);\n\t\treturn true ;\n\t\t}",
"Integer.parseInt(a)",
"Integer.parseInt",
"Integer",
"a",
"return true ;",
"true",
"String a",
"a",
"public class Main{\n static int stack[]=new int[101];\n\tpublic static void main(String[] args) {\n\t\tint i=0;\n\t\tString s;\n\t\t// TODO Auto-generated method stub\n Scanner sc= new Scanner(System.in);\n\ts=sc.next();\n while(true){\n \tif(Number(s)){\n \t i++;\n \t stack[i]=Integer.parseInt(s);\n \t }else{\n \t\t if(s.equals(\"+\")){\n \t\t\t stack[i-1]=stack[i-1]+stack[i];\n \t\t\t i--;\n \t\t }\n \t\tif(s.equals(\"-\")){\n \t\t\tstack[i-1]=stack[i-1]-stack[i];\n \t\t\ti--;\n \t\t}\n \t\tif(s.equals(\"*\")){\n \t\t\tstack[i-1]=stack[i-1]*stack[i];\n \t\t\ti--;\n \t\t}\n \t\tif(s.equals(\"/\")){\n \t\t\tstack[i-1]=stack[i-1]/stack[i];\n \t\t\ti--;\n \t\t}\n \t \n }\n \tif(!sc.hasNext()) break;\n \ts=sc.next();\n }\n System.out.println(stack[1]);\n\t}\n\tpublic static boolean Number(String a){\n\t\ttry{\n\t\t\tInteger.parseInt(a);\n\t\treturn true ;\n\t\t}catch(Exception e){\n\t\treturn false;\n\t}\n}\n}",
"public class Main{\n static int stack[]=new int[101];\n\tpublic static void main(String[] args) {\n\t\tint i=0;\n\t\tString s;\n\t\t// TODO Auto-generated method stub\n Scanner sc= new Scanner(System.in);\n\ts=sc.next();\n while(true){\n \tif(Number(s)){\n \t i++;\n \t stack[i]=Integer.parseInt(s);\n \t }else{\n \t\t if(s.equals(\"+\")){\n \t\t\t stack[i-1]=stack[i-1]+stack[i];\n \t\t\t i--;\n \t\t }\n \t\tif(s.equals(\"-\")){\n \t\t\tstack[i-1]=stack[i-1]-stack[i];\n \t\t\ti--;\n \t\t}\n \t\tif(s.equals(\"*\")){\n \t\t\tstack[i-1]=stack[i-1]*stack[i];\n \t\t\ti--;\n \t\t}\n \t\tif(s.equals(\"/\")){\n \t\t\tstack[i-1]=stack[i-1]/stack[i];\n \t\t\ti--;\n \t\t}\n \t \n }\n \tif(!sc.hasNext()) break;\n \ts=sc.next();\n }\n System.out.println(stack[1]);\n\t}\n\tpublic static boolean Number(String a){\n\t\ttry{\n\t\t\tInteger.parseInt(a);\n\t\treturn true ;\n\t\t}catch(Exception e){\n\t\treturn false;\n\t}\n}\n}",
"Main"
] | import java.util.Scanner;
public class Main{
static int stack[]=new int[101];
public static void main(String[] args) {
int i=0;
String s;
// TODO Auto-generated method stub
Scanner sc= new Scanner(System.in);
s=sc.next();
while(true){
if(Number(s)){
i++;
stack[i]=Integer.parseInt(s);
}else{
if(s.equals("+")){
stack[i-1]=stack[i-1]+stack[i];
i--;
}
if(s.equals("-")){
stack[i-1]=stack[i-1]-stack[i];
i--;
}
if(s.equals("*")){
stack[i-1]=stack[i-1]*stack[i];
i--;
}
if(s.equals("/")){
stack[i-1]=stack[i-1]/stack[i];
i--;
}
}
if(!sc.hasNext()) break;
s=sc.next();
}
System.out.println(stack[1]);
}
public static boolean Number(String a){
try{
Integer.parseInt(a);
return true ;
}catch(Exception e){
return false;
}
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
18,
13,
13,
41,
13,
18,
13,
13,
41,
13,
20,
41,
13,
20,
41,
13,
20,
4,
18,
13,
17,
13,
13,
4,
18,
13,
23,
13,
6,
13,
12,
13,
30,
41,
13,
4,
18,
4,
18,
13,
41,
13,
20,
41,
13,
4,
18,
13,
17,
28,
13,
13,
30,
30,
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,
30,
4,
18,
13,
13,
4,
18,
13,
17,
4,
18,
13,
23,
13,
23,
13,
23,
13,
6,
13,
41,
13,
41,
13,
12,
13,
30,
0,
13,
20,
13,
0,
13,
40,
17,
23,
13,
12,
13,
30,
29,
2,
13,
40,
17,
12,
13,
30,
0,
18,
13,
40,
13,
13,
23,
13,
12,
13,
30,
14,
4,
13,
30,
37,
20,
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
],
[
10,
11
],
[
10,
12
],
[
0,
13
],
[
13,
14
],
[
13,
15
],
[
0,
16
],
[
241,
17
],
[
241,
18
],
[
18,
19
],
[
18,
20
],
[
20,
21
],
[
21,
22
],
[
21,
23
],
[
23,
24
],
[
23,
25
],
[
20,
26
],
[
26,
27
],
[
26,
28
],
[
28,
29
],
[
28,
30
],
[
20,
31
],
[
31,
32
],
[
31,
33
],
[
20,
34
],
[
34,
35
],
[
34,
36
],
[
20,
37
],
[
37,
38
],
[
37,
39
],
[
20,
40
],
[
40,
41
],
[
41,
42
],
[
40,
43
],
[
40,
44
],
[
40,
45
],
[
20,
46
],
[
46,
47
],
[
47,
48
],
[
18,
49
],
[
49,
50
],
[
241,
51
],
[
51,
52
],
[
51,
53
],
[
53,
54
],
[
53,
55
],
[
55,
56
],
[
56,
57
],
[
56,
58
],
[
58,
59
],
[
59,
60
],
[
60,
61
],
[
61,
62
],
[
55,
63
],
[
63,
64
],
[
63,
65
],
[
55,
66
],
[
66,
67
],
[
66,
68
],
[
68,
69
],
[
69,
70
],
[
68,
71
],
[
55,
72
],
[
72,
73
],
[
72,
74
],
[
72,
75
],
[
76,
76
],
[
76,
77
],
[
77,
78
],
[
78,
79
],
[
79,
80
],
[
78,
81
],
[
77,
82
],
[
82,
83
],
[
83,
84
],
[
83,
85
],
[
85,
86
],
[
86,
87
],
[
85,
88
],
[
88,
89
],
[
89,
90
],
[
82,
91
],
[
91,
92
],
[
91,
93
],
[
93,
94
],
[
94,
95
],
[
93,
96
],
[
96,
97
],
[
97,
98
],
[
82,
99
],
[
99,
100
],
[
100,
101
],
[
99,
102
],
[
102,
103
],
[
103,
104
],
[
102,
105
],
[
105,
106
],
[
105,
107
],
[
77,
108
],
[
108,
109
],
[
109,
110
],
[
110,
111
],
[
109,
112
],
[
108,
113
],
[
113,
114
],
[
114,
115
],
[
114,
116
],
[
116,
117
],
[
117,
118
],
[
116,
119
],
[
119,
120
],
[
120,
121
],
[
113,
122
],
[
122,
123
],
[
122,
124
],
[
124,
125
],
[
125,
126
],
[
124,
127
],
[
127,
128
],
[
128,
129
],
[
113,
130
],
[
130,
131
],
[
131,
132
],
[
130,
133
],
[
133,
134
],
[
134,
135
],
[
133,
136
],
[
136,
137
],
[
136,
138
],
[
108,
139
],
[
139,
140
],
[
140,
141
],
[
141,
142
],
[
140,
143
],
[
139,
144
],
[
144,
145
],
[
145,
146
],
[
145,
147
],
[
147,
148
],
[
148,
149
],
[
147,
150
],
[
150,
151
],
[
151,
152
],
[
144,
153
],
[
153,
154
],
[
153,
155
],
[
155,
156
],
[
156,
157
],
[
155,
158
],
[
158,
159
],
[
159,
160
],
[
144,
161
],
[
161,
162
],
[
162,
163
],
[
161,
164
],
[
164,
165
],
[
165,
166
],
[
164,
167
],
[
167,
168
],
[
167,
169
],
[
139,
170
],
[
170,
171
],
[
171,
172
],
[
172,
173
],
[
171,
174
],
[
55,
175
],
[
175,
176
],
[
176,
177
],
[
175,
178
],
[
175,
179
],
[
179,
180
],
[
180,
181
],
[
53,
182
],
[
182,
183
],
[
53,
184
],
[
184,
185
],
[
53,
186
],
[
186,
187
],
[
51,
188
],
[
188,
189
],
[
188,
190
],
[
190,
191
],
[
188,
192
],
[
192,
193
],
[
188,
194
],
[
194,
195
],
[
194,
196
],
[
196,
197
],
[
197,
198
],
[
197,
199
],
[
196,
201
],
[
201,
202
],
[
201,
203
],
[
203,
204
],
[
194,
205
],
[
205,
206
],
[
188,
207
],
[
207,
208
],
[
207,
209
],
[
209,
210
],
[
210,
211
],
[
211,
212
],
[
211,
213
],
[
213,
214
],
[
188,
215
],
[
215,
216
],
[
215,
217
],
[
217,
218
],
[
218,
219
],
[
219,
220
],
[
219,
221
],
[
221,
222
],
[
218,
223
],
[
215,
224
],
[
224,
225
],
[
188,
226
],
[
226,
227
],
[
226,
228
],
[
228,
229
],
[
229,
230
],
[
230,
231
],
[
229,
232
],
[
232,
233
],
[
233,
234
],
[
228,
235
],
[
235,
236
],
[
236,
237
],
[
236,
238
],
[
238,
239
],
[
0,
240
],
[
240,
241
],
[
240,
242
]
] | [
"import java.io.OutputStream;\nimport java.io.IOException;\nimport java.io.InputStream;\nimport java.io.PrintWriter;\nimport java.util.Scanner;\n\n/**\n * Built using CHelper plug-in\n * Actual solution is at the top\n */\npublic class Main {\n public static void main(String[] args) {\n InputStream inputStream = System.in;\n OutputStream outputStream = System.out;\n Scanner in = new Scanner(inputStream);\n PrintWriter out = new PrintWriter(outputStream);\n AizuRPN solver = new AizuRPN();\n solver.solve(1, in, out);\n out.close();\n }\n\n static class AizuRPN {\n public void solve(int testNumber, Scanner in, PrintWriter out) {\n final String s = in.nextLine().trim();\n\n AizuRPN.Stack st = new AizuRPN.Stack(1000);\n String[] input = s.split(\" \");\n\n for (String x : input) {\n if (x.equals(\"+\")) {\n long b = Long.parseLong(st.pop());\n long a = Long.parseLong(st.pop());\n\n st.push(String.valueOf(a + b));\n } else if (x.equals(\"-\")) {\n long b = Long.parseLong(st.pop());\n long a = Long.parseLong(st.pop());\n\n st.push(String.valueOf(a - b));\n } else if (x.equals(\"*\")) {\n long b = Long.parseLong(st.pop());\n long a = Long.parseLong(st.pop());\n\n st.push(String.valueOf(a * b));\n } else {\n st.push(x);\n }\n }\n\n out.printf(\"%s\\n\", st.pop());\n }\n\n static class Stack {\n private String[] a;\n private int top;\n\n public Stack(final int n) {\n a = new String[n];\n top = -1;\n }\n\n public boolean isEmpty() {\n return top == -1;\n }\n\n public void push(String c) {\n a[++top] = c;\n }\n\n public String pop() {\n if (isEmpty()) {\n throw new IllegalStateException(\"empty stack\");\n }\n\n return a[top--];\n }\n\n }\n\n }\n}\n\n",
"import java.io.OutputStream;",
"OutputStream",
"java.io",
"import java.io.IOException;",
"IOException",
"java.io",
"import java.io.InputStream;",
"InputStream",
"java.io",
"import java.io.PrintWriter;",
"PrintWriter",
"java.io",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n public static void main(String[] args) {\n InputStream inputStream = System.in;\n OutputStream outputStream = System.out;\n Scanner in = new Scanner(inputStream);\n PrintWriter out = new PrintWriter(outputStream);\n AizuRPN solver = new AizuRPN();\n solver.solve(1, in, out);\n out.close();\n }\n\n static class AizuRPN {\n public void solve(int testNumber, Scanner in, PrintWriter out) {\n final String s = in.nextLine().trim();\n\n AizuRPN.Stack st = new AizuRPN.Stack(1000);\n String[] input = s.split(\" \");\n\n for (String x : input) {\n if (x.equals(\"+\")) {\n long b = Long.parseLong(st.pop());\n long a = Long.parseLong(st.pop());\n\n st.push(String.valueOf(a + b));\n } else if (x.equals(\"-\")) {\n long b = Long.parseLong(st.pop());\n long a = Long.parseLong(st.pop());\n\n st.push(String.valueOf(a - b));\n } else if (x.equals(\"*\")) {\n long b = Long.parseLong(st.pop());\n long a = Long.parseLong(st.pop());\n\n st.push(String.valueOf(a * b));\n } else {\n st.push(x);\n }\n }\n\n out.printf(\"%s\\n\", st.pop());\n }\n\n static class Stack {\n private String[] a;\n private int top;\n\n public Stack(final int n) {\n a = new String[n];\n top = -1;\n }\n\n public boolean isEmpty() {\n return top == -1;\n }\n\n public void push(String c) {\n a[++top] = c;\n }\n\n public String pop() {\n if (isEmpty()) {\n throw new IllegalStateException(\"empty stack\");\n }\n\n return a[top--];\n }\n\n }\n\n }\n}",
"Main",
"public static void main(String[] args) {\n InputStream inputStream = System.in;\n OutputStream outputStream = System.out;\n Scanner in = new Scanner(inputStream);\n PrintWriter out = new PrintWriter(outputStream);\n AizuRPN solver = new AizuRPN();\n solver.solve(1, in, out);\n out.close();\n }",
"main",
"{\n InputStream inputStream = System.in;\n OutputStream outputStream = System.out;\n Scanner in = new Scanner(inputStream);\n PrintWriter out = new PrintWriter(outputStream);\n AizuRPN solver = new AizuRPN();\n solver.solve(1, in, out);\n out.close();\n }",
"InputStream inputStream = System.in;",
"inputStream",
"System.in",
"System",
"System.in",
"OutputStream outputStream = System.out;",
"outputStream",
"System.out",
"System",
"System.out",
"Scanner in = new Scanner(inputStream);",
"in",
"new Scanner(inputStream)",
"PrintWriter out = new PrintWriter(outputStream);",
"out",
"new PrintWriter(outputStream)",
"AizuRPN solver = new AizuRPN();",
"solver",
"new AizuRPN()",
"solver.solve(1, in, out)",
"solver.solve",
"solver",
"1",
"in",
"out",
"out.close()",
"out.close",
"out",
"String[] args",
"args",
"static class AizuRPN {\n public void solve(int testNumber, Scanner in, PrintWriter out) {\n final String s = in.nextLine().trim();\n\n AizuRPN.Stack st = new AizuRPN.Stack(1000);\n String[] input = s.split(\" \");\n\n for (String x : input) {\n if (x.equals(\"+\")) {\n long b = Long.parseLong(st.pop());\n long a = Long.parseLong(st.pop());\n\n st.push(String.valueOf(a + b));\n } else if (x.equals(\"-\")) {\n long b = Long.parseLong(st.pop());\n long a = Long.parseLong(st.pop());\n\n st.push(String.valueOf(a - b));\n } else if (x.equals(\"*\")) {\n long b = Long.parseLong(st.pop());\n long a = Long.parseLong(st.pop());\n\n st.push(String.valueOf(a * b));\n } else {\n st.push(x);\n }\n }\n\n out.printf(\"%s\\n\", st.pop());\n }\n\n static class Stack {\n private String[] a;\n private int top;\n\n public Stack(final int n) {\n a = new String[n];\n top = -1;\n }\n\n public boolean isEmpty() {\n return top == -1;\n }\n\n public void push(String c) {\n a[++top] = c;\n }\n\n public String pop() {\n if (isEmpty()) {\n throw new IllegalStateException(\"empty stack\");\n }\n\n return a[top--];\n }\n\n }\n\n }",
"AizuRPN",
"public void solve(int testNumber, Scanner in, PrintWriter out) {\n final String s = in.nextLine().trim();\n\n AizuRPN.Stack st = new AizuRPN.Stack(1000);\n String[] input = s.split(\" \");\n\n for (String x : input) {\n if (x.equals(\"+\")) {\n long b = Long.parseLong(st.pop());\n long a = Long.parseLong(st.pop());\n\n st.push(String.valueOf(a + b));\n } else if (x.equals(\"-\")) {\n long b = Long.parseLong(st.pop());\n long a = Long.parseLong(st.pop());\n\n st.push(String.valueOf(a - b));\n } else if (x.equals(\"*\")) {\n long b = Long.parseLong(st.pop());\n long a = Long.parseLong(st.pop());\n\n st.push(String.valueOf(a * b));\n } else {\n st.push(x);\n }\n }\n\n out.printf(\"%s\\n\", st.pop());\n }",
"solve",
"{\n final String s = in.nextLine().trim();\n\n AizuRPN.Stack st = new AizuRPN.Stack(1000);\n String[] input = s.split(\" \");\n\n for (String x : input) {\n if (x.equals(\"+\")) {\n long b = Long.parseLong(st.pop());\n long a = Long.parseLong(st.pop());\n\n st.push(String.valueOf(a + b));\n } else if (x.equals(\"-\")) {\n long b = Long.parseLong(st.pop());\n long a = Long.parseLong(st.pop());\n\n st.push(String.valueOf(a - b));\n } else if (x.equals(\"*\")) {\n long b = Long.parseLong(st.pop());\n long a = Long.parseLong(st.pop());\n\n st.push(String.valueOf(a * b));\n } else {\n st.push(x);\n }\n }\n\n out.printf(\"%s\\n\", st.pop());\n }",
"final String s = in.nextLine().trim();",
"s",
"in.nextLine().trim()",
"in.nextLine().trim",
"in.nextLine()",
"in.nextLine",
"in",
"AizuRPN.Stack st = new AizuRPN.Stack(1000);",
"st",
"new AizuRPN.Stack(1000)",
"String[] input = s.split(\" \");",
"input",
"s.split(\" \")",
"s.split",
"s",
"\" \"",
"for (String x : input) {\n if (x.equals(\"+\")) {\n long b = Long.parseLong(st.pop());\n long a = Long.parseLong(st.pop());\n\n st.push(String.valueOf(a + b));\n } else if (x.equals(\"-\")) {\n long b = Long.parseLong(st.pop());\n long a = Long.parseLong(st.pop());\n\n st.push(String.valueOf(a - b));\n } else if (x.equals(\"*\")) {\n long b = Long.parseLong(st.pop());\n long a = Long.parseLong(st.pop());\n\n st.push(String.valueOf(a * b));\n } else {\n st.push(x);\n }\n }",
"String x",
"input",
"{\n if (x.equals(\"+\")) {\n long b = Long.parseLong(st.pop());\n long a = Long.parseLong(st.pop());\n\n st.push(String.valueOf(a + b));\n } else if (x.equals(\"-\")) {\n long b = Long.parseLong(st.pop());\n long a = Long.parseLong(st.pop());\n\n st.push(String.valueOf(a - b));\n } else if (x.equals(\"*\")) {\n long b = Long.parseLong(st.pop());\n long a = Long.parseLong(st.pop());\n\n st.push(String.valueOf(a * b));\n } else {\n st.push(x);\n }\n }",
"{\n if (x.equals(\"+\")) {\n long b = Long.parseLong(st.pop());\n long a = Long.parseLong(st.pop());\n\n st.push(String.valueOf(a + b));\n } else if (x.equals(\"-\")) {\n long b = Long.parseLong(st.pop());\n long a = Long.parseLong(st.pop());\n\n st.push(String.valueOf(a - b));\n } else if (x.equals(\"*\")) {\n long b = Long.parseLong(st.pop());\n long a = Long.parseLong(st.pop());\n\n st.push(String.valueOf(a * b));\n } else {\n st.push(x);\n }\n }",
"if (x.equals(\"+\")) {\n long b = Long.parseLong(st.pop());\n long a = Long.parseLong(st.pop());\n\n st.push(String.valueOf(a + b));\n } else if (x.equals(\"-\")) {\n long b = Long.parseLong(st.pop());\n long a = Long.parseLong(st.pop());\n\n st.push(String.valueOf(a - b));\n } else if (x.equals(\"*\")) {\n long b = Long.parseLong(st.pop());\n long a = Long.parseLong(st.pop());\n\n st.push(String.valueOf(a * b));\n } else {\n st.push(x);\n }",
"x.equals(\"+\")",
"x.equals",
"x",
"\"+\"",
"{\n long b = Long.parseLong(st.pop());\n long a = Long.parseLong(st.pop());\n\n st.push(String.valueOf(a + b));\n }",
"long b = Long.parseLong(st.pop());",
"b",
"Long.parseLong(st.pop())",
"Long.parseLong",
"Long",
"st.pop()",
"st.pop",
"st",
"long a = Long.parseLong(st.pop());",
"a",
"Long.parseLong(st.pop())",
"Long.parseLong",
"Long",
"st.pop()",
"st.pop",
"st",
"st.push(String.valueOf(a + b))",
"st.push",
"st",
"String.valueOf(a + b)",
"String.valueOf",
"String",
"a + b",
"a",
"b",
"if (x.equals(\"-\")) {\n long b = Long.parseLong(st.pop());\n long a = Long.parseLong(st.pop());\n\n st.push(String.valueOf(a - b));\n } else if (x.equals(\"*\")) {\n long b = Long.parseLong(st.pop());\n long a = Long.parseLong(st.pop());\n\n st.push(String.valueOf(a * b));\n } else {\n st.push(x);\n }",
"x.equals(\"-\")",
"x.equals",
"x",
"\"-\"",
"{\n long b = Long.parseLong(st.pop());\n long a = Long.parseLong(st.pop());\n\n st.push(String.valueOf(a - b));\n }",
"long b = Long.parseLong(st.pop());",
"b",
"Long.parseLong(st.pop())",
"Long.parseLong",
"Long",
"st.pop()",
"st.pop",
"st",
"long a = Long.parseLong(st.pop());",
"a",
"Long.parseLong(st.pop())",
"Long.parseLong",
"Long",
"st.pop()",
"st.pop",
"st",
"st.push(String.valueOf(a - b))",
"st.push",
"st",
"String.valueOf(a - b)",
"String.valueOf",
"String",
"a - b",
"a",
"b",
"if (x.equals(\"*\")) {\n long b = Long.parseLong(st.pop());\n long a = Long.parseLong(st.pop());\n\n st.push(String.valueOf(a * b));\n } else {\n st.push(x);\n }",
"x.equals(\"*\")",
"x.equals",
"x",
"\"*\"",
"{\n long b = Long.parseLong(st.pop());\n long a = Long.parseLong(st.pop());\n\n st.push(String.valueOf(a * b));\n }",
"long b = Long.parseLong(st.pop());",
"b",
"Long.parseLong(st.pop())",
"Long.parseLong",
"Long",
"st.pop()",
"st.pop",
"st",
"long a = Long.parseLong(st.pop());",
"a",
"Long.parseLong(st.pop())",
"Long.parseLong",
"Long",
"st.pop()",
"st.pop",
"st",
"st.push(String.valueOf(a * b))",
"st.push",
"st",
"String.valueOf(a * b)",
"String.valueOf",
"String",
"a * b",
"a",
"b",
"{\n st.push(x);\n }",
"st.push(x)",
"st.push",
"st",
"x",
"out.printf(\"%s\\n\", st.pop())",
"out.printf",
"out",
"\"%s\\n\"",
"st.pop()",
"st.pop",
"st",
"int testNumber",
"testNumber",
"Scanner in",
"in",
"PrintWriter out",
"out",
"static class Stack {\n private String[] a;\n private int top;\n\n public Stack(final int n) {\n a = new String[n];\n top = -1;\n }\n\n public boolean isEmpty() {\n return top == -1;\n }\n\n public void push(String c) {\n a[++top] = c;\n }\n\n public String pop() {\n if (isEmpty()) {\n throw new IllegalStateException(\"empty stack\");\n }\n\n return a[top--];\n }\n\n }",
"Stack",
"private String[] a;",
"a",
"private int top;",
"top",
"public Stack(final int n) {\n a = new String[n];\n top = -1;\n }",
"Stack",
"{\n a = new String[n];\n top = -1;\n }",
"a = new String[n]",
"a",
"new String[n]",
"n",
"top = -1",
"top",
"-1",
"1",
"final int n",
"n",
"public boolean isEmpty() {\n return top == -1;\n }",
"isEmpty",
"{\n return top == -1;\n }",
"return top == -1;",
"top == -1",
"top",
"-1",
"1",
"public void push(String c) {\n a[++top] = c;\n }",
"push",
"{\n a[++top] = c;\n }",
"a[++top] = c",
"a[++top]",
"a",
"++top",
"top",
"c",
"String c",
"c",
"public String pop() {\n if (isEmpty()) {\n throw new IllegalStateException(\"empty stack\");\n }\n\n return a[top--];\n }",
"pop",
"{\n if (isEmpty()) {\n throw new IllegalStateException(\"empty stack\");\n }\n\n return a[top--];\n }",
"if (isEmpty()) {\n throw new IllegalStateException(\"empty stack\");\n }",
"isEmpty()",
"isEmpty",
"{\n throw new IllegalStateException(\"empty stack\");\n }",
"throw new IllegalStateException(\"empty stack\");",
"new IllegalStateException(\"empty stack\")",
"return a[top--];",
"a[top--]",
"a",
"top--",
"top",
"public class Main {\n public static void main(String[] args) {\n InputStream inputStream = System.in;\n OutputStream outputStream = System.out;\n Scanner in = new Scanner(inputStream);\n PrintWriter out = new PrintWriter(outputStream);\n AizuRPN solver = new AizuRPN();\n solver.solve(1, in, out);\n out.close();\n }\n\n static class AizuRPN {\n public void solve(int testNumber, Scanner in, PrintWriter out) {\n final String s = in.nextLine().trim();\n\n AizuRPN.Stack st = new AizuRPN.Stack(1000);\n String[] input = s.split(\" \");\n\n for (String x : input) {\n if (x.equals(\"+\")) {\n long b = Long.parseLong(st.pop());\n long a = Long.parseLong(st.pop());\n\n st.push(String.valueOf(a + b));\n } else if (x.equals(\"-\")) {\n long b = Long.parseLong(st.pop());\n long a = Long.parseLong(st.pop());\n\n st.push(String.valueOf(a - b));\n } else if (x.equals(\"*\")) {\n long b = Long.parseLong(st.pop());\n long a = Long.parseLong(st.pop());\n\n st.push(String.valueOf(a * b));\n } else {\n st.push(x);\n }\n }\n\n out.printf(\"%s\\n\", st.pop());\n }\n\n static class Stack {\n private String[] a;\n private int top;\n\n public Stack(final int n) {\n a = new String[n];\n top = -1;\n }\n\n public boolean isEmpty() {\n return top == -1;\n }\n\n public void push(String c) {\n a[++top] = c;\n }\n\n public String pop() {\n if (isEmpty()) {\n throw new IllegalStateException(\"empty stack\");\n }\n\n return a[top--];\n }\n\n }\n\n }\n}",
"public class Main {\n public static void main(String[] args) {\n InputStream inputStream = System.in;\n OutputStream outputStream = System.out;\n Scanner in = new Scanner(inputStream);\n PrintWriter out = new PrintWriter(outputStream);\n AizuRPN solver = new AizuRPN();\n solver.solve(1, in, out);\n out.close();\n }\n\n static class AizuRPN {\n public void solve(int testNumber, Scanner in, PrintWriter out) {\n final String s = in.nextLine().trim();\n\n AizuRPN.Stack st = new AizuRPN.Stack(1000);\n String[] input = s.split(\" \");\n\n for (String x : input) {\n if (x.equals(\"+\")) {\n long b = Long.parseLong(st.pop());\n long a = Long.parseLong(st.pop());\n\n st.push(String.valueOf(a + b));\n } else if (x.equals(\"-\")) {\n long b = Long.parseLong(st.pop());\n long a = Long.parseLong(st.pop());\n\n st.push(String.valueOf(a - b));\n } else if (x.equals(\"*\")) {\n long b = Long.parseLong(st.pop());\n long a = Long.parseLong(st.pop());\n\n st.push(String.valueOf(a * b));\n } else {\n st.push(x);\n }\n }\n\n out.printf(\"%s\\n\", st.pop());\n }\n\n static class Stack {\n private String[] a;\n private int top;\n\n public Stack(final int n) {\n a = new String[n];\n top = -1;\n }\n\n public boolean isEmpty() {\n return top == -1;\n }\n\n public void push(String c) {\n a[++top] = c;\n }\n\n public String pop() {\n if (isEmpty()) {\n throw new IllegalStateException(\"empty stack\");\n }\n\n return a[top--];\n }\n\n }\n\n }\n}",
"Main"
] | import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Scanner;
/**
* Built using CHelper plug-in
* Actual solution is at the top
*/
public class Main {
public static void main(String[] args) {
InputStream inputStream = System.in;
OutputStream outputStream = System.out;
Scanner in = new Scanner(inputStream);
PrintWriter out = new PrintWriter(outputStream);
AizuRPN solver = new AizuRPN();
solver.solve(1, in, out);
out.close();
}
static class AizuRPN {
public void solve(int testNumber, Scanner in, PrintWriter out) {
final String s = in.nextLine().trim();
AizuRPN.Stack st = new AizuRPN.Stack(1000);
String[] input = s.split(" ");
for (String x : input) {
if (x.equals("+")) {
long b = Long.parseLong(st.pop());
long a = Long.parseLong(st.pop());
st.push(String.valueOf(a + b));
} else if (x.equals("-")) {
long b = Long.parseLong(st.pop());
long a = Long.parseLong(st.pop());
st.push(String.valueOf(a - b));
} else if (x.equals("*")) {
long b = Long.parseLong(st.pop());
long a = Long.parseLong(st.pop());
st.push(String.valueOf(a * b));
} else {
st.push(x);
}
}
out.printf("%s\n", st.pop());
}
static class Stack {
private String[] a;
private int top;
public Stack(final int n) {
a = new String[n];
top = -1;
}
public boolean isEmpty() {
return top == -1;
}
public void push(String c) {
a[++top] = c;
}
public String pop() {
if (isEmpty()) {
throw new IllegalStateException("empty stack");
}
return a[top--];
}
}
}
}
|
[
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,
42,
4,
18,
13,
30,
41,
13,
4,
18,
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,
4,
18,
13,
12,
13,
30,
4,
18,
18,
13,
13,
4,
18,
13,
13,
23,
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
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
10,
11
],
[
10,
12
],
[
0,
13
],
[
13,
14
],
[
13,
15
],
[
0,
16
],
[
153,
17
],
[
153,
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
],
[
31,
32
],
[
32,
33
],
[
30,
34
],
[
34,
35
],
[
35,
36
],
[
35,
37
],
[
37,
38
],
[
38,
39
],
[
34,
40
],
[
40,
41
],
[
34,
42
],
[
42,
43
],
[
34,
44
],
[
44,
45
],
[
45,
46
],
[
46,
47
],
[
45,
48
],
[
44,
49
],
[
49,
50
],
[
49,
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
],
[
62,
65
],
[
65,
66
],
[
65,
67
],
[
51,
68
],
[
44,
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
],
[
44,
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
],
[
44,
109
],
[
109,
110
],
[
110,
111
],
[
111,
112
],
[
112,
113
],
[
111,
114
],
[
114,
115
],
[
115,
116
],
[
114,
117
],
[
110,
118
],
[
20,
119
],
[
119,
120
],
[
120,
121
],
[
121,
122
],
[
121,
123
],
[
119,
124
],
[
124,
125
],
[
125,
126
],
[
20,
127
],
[
127,
128
],
[
128,
129
],
[
153,
130
],
[
130,
131
],
[
130,
132
],
[
132,
133
],
[
133,
134
],
[
134,
135
],
[
135,
136
],
[
135,
137
],
[
133,
138
],
[
138,
139
],
[
139,
140
],
[
138,
141
],
[
130,
142
],
[
142,
143
],
[
153,
144
],
[
144,
145
],
[
144,
146
],
[
146,
147
],
[
147,
148
],
[
148,
149
],
[
144,
150
],
[
150,
151
],
[
0,
152
],
[
152,
153
],
[
152,
154
]
] | [
"import java.util.ArrayDeque;\nimport java.util.Arrays;\nimport java.util.Deque;\nimport java.util.Scanner;\nimport java.util.StringTokenizer;\n\npublic class Main {\n\tvoid run() {\n\t\tScanner sc = new Scanner(System.in);\n\t\tDeque<Integer> Q = new ArrayDeque<>();\n\t\t\n\t\tStringTokenizer st = new StringTokenizer(sc.nextLine(), \" \");\n\t\twhile(st.hasMoreTokens()) {\n\t\t\tString str = st.nextToken();\n\t\t\tint a, b;\n\t\t\tswitch(str.charAt(0)) {\n\t\t\t\tcase '+':\n\t\t\t\t\tb = Q.pop();\n\t\t\t\t\ta = Q.pop();\n\t\t\t\t\tQ.push(a + b);\n\t\t\t\t\tbreak;\n\t\t\t\tcase '-':\n\t\t\t\t\tb = Q.pop();\n\t\t\t\t\ta = Q.pop();\n\t\t\t\t\tQ.push(a - b);\n\t\t\t\t\tbreak;\n\t\t\t\tcase '*':\n\t\t\t\t\tb = Q.pop();\n\t\t\t\t\ta = Q.pop();\n\t\t\t\t\tQ.push(a * b);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tQ.push(Integer.parseInt(str));\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(Q.pop());\n\t\tsc.close();\n\t}\n\n\tvoid debug(Object... o) {\n\t\tSystem.out.println(Arrays.deepToString(o));\n\t}\n\n\tpublic static void main(String[] args) {\n\t\tnew Main().run();\n\t}\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.StringTokenizer;",
"StringTokenizer",
"java.util",
"public class Main {\n\tvoid run() {\n\t\tScanner sc = new Scanner(System.in);\n\t\tDeque<Integer> Q = new ArrayDeque<>();\n\t\t\n\t\tStringTokenizer st = new StringTokenizer(sc.nextLine(), \" \");\n\t\twhile(st.hasMoreTokens()) {\n\t\t\tString str = st.nextToken();\n\t\t\tint a, b;\n\t\t\tswitch(str.charAt(0)) {\n\t\t\t\tcase '+':\n\t\t\t\t\tb = Q.pop();\n\t\t\t\t\ta = Q.pop();\n\t\t\t\t\tQ.push(a + b);\n\t\t\t\t\tbreak;\n\t\t\t\tcase '-':\n\t\t\t\t\tb = Q.pop();\n\t\t\t\t\ta = Q.pop();\n\t\t\t\t\tQ.push(a - b);\n\t\t\t\t\tbreak;\n\t\t\t\tcase '*':\n\t\t\t\t\tb = Q.pop();\n\t\t\t\t\ta = Q.pop();\n\t\t\t\t\tQ.push(a * b);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tQ.push(Integer.parseInt(str));\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(Q.pop());\n\t\tsc.close();\n\t}\n\n\tvoid debug(Object... o) {\n\t\tSystem.out.println(Arrays.deepToString(o));\n\t}\n\n\tpublic static void main(String[] args) {\n\t\tnew Main().run();\n\t}\n}",
"Main",
"void run() {\n\t\tScanner sc = new Scanner(System.in);\n\t\tDeque<Integer> Q = new ArrayDeque<>();\n\t\t\n\t\tStringTokenizer st = new StringTokenizer(sc.nextLine(), \" \");\n\t\twhile(st.hasMoreTokens()) {\n\t\t\tString str = st.nextToken();\n\t\t\tint a, b;\n\t\t\tswitch(str.charAt(0)) {\n\t\t\t\tcase '+':\n\t\t\t\t\tb = Q.pop();\n\t\t\t\t\ta = Q.pop();\n\t\t\t\t\tQ.push(a + b);\n\t\t\t\t\tbreak;\n\t\t\t\tcase '-':\n\t\t\t\t\tb = Q.pop();\n\t\t\t\t\ta = Q.pop();\n\t\t\t\t\tQ.push(a - b);\n\t\t\t\t\tbreak;\n\t\t\t\tcase '*':\n\t\t\t\t\tb = Q.pop();\n\t\t\t\t\ta = Q.pop();\n\t\t\t\t\tQ.push(a * b);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tQ.push(Integer.parseInt(str));\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(Q.pop());\n\t\tsc.close();\n\t}",
"run",
"{\n\t\tScanner sc = new Scanner(System.in);\n\t\tDeque<Integer> Q = new ArrayDeque<>();\n\t\t\n\t\tStringTokenizer st = new StringTokenizer(sc.nextLine(), \" \");\n\t\twhile(st.hasMoreTokens()) {\n\t\t\tString str = st.nextToken();\n\t\t\tint a, b;\n\t\t\tswitch(str.charAt(0)) {\n\t\t\t\tcase '+':\n\t\t\t\t\tb = Q.pop();\n\t\t\t\t\ta = Q.pop();\n\t\t\t\t\tQ.push(a + b);\n\t\t\t\t\tbreak;\n\t\t\t\tcase '-':\n\t\t\t\t\tb = Q.pop();\n\t\t\t\t\ta = Q.pop();\n\t\t\t\t\tQ.push(a - b);\n\t\t\t\t\tbreak;\n\t\t\t\tcase '*':\n\t\t\t\t\tb = Q.pop();\n\t\t\t\t\ta = Q.pop();\n\t\t\t\t\tQ.push(a * b);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tQ.push(Integer.parseInt(str));\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(Q.pop());\n\t\tsc.close();\n\t}",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"Deque<Integer> Q = new ArrayDeque<>();",
"Q",
"new ArrayDeque<>()",
"StringTokenizer st = new StringTokenizer(sc.nextLine(), \" \");",
"st",
"new StringTokenizer(sc.nextLine(), \" \")",
"while(st.hasMoreTokens()) {\n\t\t\tString str = st.nextToken();\n\t\t\tint a, b;\n\t\t\tswitch(str.charAt(0)) {\n\t\t\t\tcase '+':\n\t\t\t\t\tb = Q.pop();\n\t\t\t\t\ta = Q.pop();\n\t\t\t\t\tQ.push(a + b);\n\t\t\t\t\tbreak;\n\t\t\t\tcase '-':\n\t\t\t\t\tb = Q.pop();\n\t\t\t\t\ta = Q.pop();\n\t\t\t\t\tQ.push(a - b);\n\t\t\t\t\tbreak;\n\t\t\t\tcase '*':\n\t\t\t\t\tb = Q.pop();\n\t\t\t\t\ta = Q.pop();\n\t\t\t\t\tQ.push(a * b);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tQ.push(Integer.parseInt(str));\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}",
"st.hasMoreTokens()",
"st.hasMoreTokens",
"st",
"{\n\t\t\tString str = st.nextToken();\n\t\t\tint a, b;\n\t\t\tswitch(str.charAt(0)) {\n\t\t\t\tcase '+':\n\t\t\t\t\tb = Q.pop();\n\t\t\t\t\ta = Q.pop();\n\t\t\t\t\tQ.push(a + b);\n\t\t\t\t\tbreak;\n\t\t\t\tcase '-':\n\t\t\t\t\tb = Q.pop();\n\t\t\t\t\ta = Q.pop();\n\t\t\t\t\tQ.push(a - b);\n\t\t\t\t\tbreak;\n\t\t\t\tcase '*':\n\t\t\t\t\tb = Q.pop();\n\t\t\t\t\ta = Q.pop();\n\t\t\t\t\tQ.push(a * b);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tQ.push(Integer.parseInt(str));\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}",
"String str = st.nextToken();",
"str",
"st.nextToken()",
"st.nextToken",
"st",
"int a",
"a",
"b;",
"b",
"switch(str.charAt(0)) {\n\t\t\t\tcase '+':\n\t\t\t\t\tb = Q.pop();\n\t\t\t\t\ta = Q.pop();\n\t\t\t\t\tQ.push(a + b);\n\t\t\t\t\tbreak;\n\t\t\t\tcase '-':\n\t\t\t\t\tb = Q.pop();\n\t\t\t\t\ta = Q.pop();\n\t\t\t\t\tQ.push(a - b);\n\t\t\t\t\tbreak;\n\t\t\t\tcase '*':\n\t\t\t\t\tb = Q.pop();\n\t\t\t\t\ta = Q.pop();\n\t\t\t\t\tQ.push(a * b);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tQ.push(Integer.parseInt(str));\n\t\t\t\t\tbreak;\n\t\t\t}",
"str.charAt(0)",
"str.charAt",
"str",
"0",
"case '+':",
"'+'",
"case '+':",
"b = Q.pop()",
"b",
"Q.pop()",
"Q.pop",
"Q",
"a = Q.pop()",
"a",
"Q.pop()",
"Q.pop",
"Q",
"Q.push(a + b)",
"Q.push",
"Q",
"a + b",
"a",
"b",
"break;",
"case '-':",
"'-'",
"case '-':",
"b = Q.pop()",
"b",
"Q.pop()",
"Q.pop",
"Q",
"a = Q.pop()",
"a",
"Q.pop()",
"Q.pop",
"Q",
"Q.push(a - b)",
"Q.push",
"Q",
"a - b",
"a",
"b",
"break;",
"case '*':",
"'*'",
"case '*':",
"b = Q.pop()",
"b",
"Q.pop()",
"Q.pop",
"Q",
"a = Q.pop()",
"a",
"Q.pop()",
"Q.pop",
"Q",
"Q.push(a * b)",
"Q.push",
"Q",
"a * b",
"a",
"b",
"break;",
"default:",
"default:",
"Q.push(Integer.parseInt(str))",
"Q.push",
"Q",
"Integer.parseInt(str)",
"Integer.parseInt",
"Integer",
"str",
"break;",
"System.out.println(Q.pop())",
"System.out.println",
"System.out",
"System",
"System.out",
"Q.pop()",
"Q.pop",
"Q",
"sc.close()",
"sc.close",
"sc",
"void debug(Object... o) {\n\t\tSystem.out.println(Arrays.deepToString(o));\n\t}",
"debug",
"{\n\t\tSystem.out.println(Arrays.deepToString(o));\n\t}",
"System.out.println(Arrays.deepToString(o))",
"System.out.println",
"System.out",
"System",
"System.out",
"Arrays.deepToString(o)",
"Arrays.deepToString",
"Arrays",
"o",
"Object... o",
"o",
"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 sc = new Scanner(System.in);\n\t\tDeque<Integer> Q = new ArrayDeque<>();\n\t\t\n\t\tStringTokenizer st = new StringTokenizer(sc.nextLine(), \" \");\n\t\twhile(st.hasMoreTokens()) {\n\t\t\tString str = st.nextToken();\n\t\t\tint a, b;\n\t\t\tswitch(str.charAt(0)) {\n\t\t\t\tcase '+':\n\t\t\t\t\tb = Q.pop();\n\t\t\t\t\ta = Q.pop();\n\t\t\t\t\tQ.push(a + b);\n\t\t\t\t\tbreak;\n\t\t\t\tcase '-':\n\t\t\t\t\tb = Q.pop();\n\t\t\t\t\ta = Q.pop();\n\t\t\t\t\tQ.push(a - b);\n\t\t\t\t\tbreak;\n\t\t\t\tcase '*':\n\t\t\t\t\tb = Q.pop();\n\t\t\t\t\ta = Q.pop();\n\t\t\t\t\tQ.push(a * b);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tQ.push(Integer.parseInt(str));\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(Q.pop());\n\t\tsc.close();\n\t}\n\n\tvoid debug(Object... o) {\n\t\tSystem.out.println(Arrays.deepToString(o));\n\t}\n\n\tpublic static void main(String[] args) {\n\t\tnew Main().run();\n\t}\n}",
"public class Main {\n\tvoid run() {\n\t\tScanner sc = new Scanner(System.in);\n\t\tDeque<Integer> Q = new ArrayDeque<>();\n\t\t\n\t\tStringTokenizer st = new StringTokenizer(sc.nextLine(), \" \");\n\t\twhile(st.hasMoreTokens()) {\n\t\t\tString str = st.nextToken();\n\t\t\tint a, b;\n\t\t\tswitch(str.charAt(0)) {\n\t\t\t\tcase '+':\n\t\t\t\t\tb = Q.pop();\n\t\t\t\t\ta = Q.pop();\n\t\t\t\t\tQ.push(a + b);\n\t\t\t\t\tbreak;\n\t\t\t\tcase '-':\n\t\t\t\t\tb = Q.pop();\n\t\t\t\t\ta = Q.pop();\n\t\t\t\t\tQ.push(a - b);\n\t\t\t\t\tbreak;\n\t\t\t\tcase '*':\n\t\t\t\t\tb = Q.pop();\n\t\t\t\t\ta = Q.pop();\n\t\t\t\t\tQ.push(a * b);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tQ.push(Integer.parseInt(str));\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(Q.pop());\n\t\tsc.close();\n\t}\n\n\tvoid debug(Object... o) {\n\t\tSystem.out.println(Arrays.deepToString(o));\n\t}\n\n\tpublic static void main(String[] args) {\n\t\tnew Main().run();\n\t}\n}",
"Main"
] | import java.util.ArrayDeque;
import java.util.Arrays;
import java.util.Deque;
import java.util.Scanner;
import java.util.StringTokenizer;
public class Main {
void run() {
Scanner sc = new Scanner(System.in);
Deque<Integer> Q = new ArrayDeque<>();
StringTokenizer st = new StringTokenizer(sc.nextLine(), " ");
while(st.hasMoreTokens()) {
String str = st.nextToken();
int a, b;
switch(str.charAt(0)) {
case '+':
b = Q.pop();
a = Q.pop();
Q.push(a + b);
break;
case '-':
b = Q.pop();
a = Q.pop();
Q.push(a - b);
break;
case '*':
b = Q.pop();
a = Q.pop();
Q.push(a * b);
break;
default:
Q.push(Integer.parseInt(str));
break;
}
}
System.out.println(Q.pop());
sc.close();
}
void debug(Object... o) {
System.out.println(Arrays.deepToString(o));
}
public static void main(String[] args) {
new Main().run();
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
17,
41,
13,
20,
41,
13,
17,
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,
18,
13,
2,
13,
17,
2,
18,
13,
2,
13,
17,
18,
13,
2,
13,
17,
40,
13,
14,
4,
18,
18,
13,
13,
17,
30,
0,
18,
13,
2,
13,
17,
2,
18,
13,
2,
13,
17,
18,
13,
2,
13,
17,
40,
13,
14,
4,
18,
18,
13,
13,
17,
30,
0,
18,
13,
2,
13,
17,
2,
18,
13,
2,
13,
17,
18,
13,
2,
13,
17,
40,
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
],
[
149,
5
],
[
149,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
13
],
[
13,
14
],
[
13,
15
],
[
8,
16
],
[
16,
17
],
[
16,
18
],
[
8,
19
],
[
19,
20
],
[
19,
21
],
[
21,
22
],
[
22,
23
],
[
23,
24
],
[
24,
25
],
[
21,
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
],
[
43,
44
],
[
44,
45
],
[
45,
46
],
[
45,
47
],
[
43,
48
],
[
42,
49
],
[
49,
50
],
[
50,
51
],
[
51,
52
],
[
51,
53
],
[
53,
54
],
[
53,
55
],
[
50,
56
],
[
56,
57
],
[
57,
58
],
[
57,
59
],
[
59,
60
],
[
59,
61
],
[
56,
62
],
[
62,
63
],
[
62,
64
],
[
64,
65
],
[
64,
66
],
[
49,
67
],
[
67,
68
],
[
42,
69
],
[
69,
70
],
[
70,
71
],
[
71,
72
],
[
72,
73
],
[
72,
74
],
[
70,
75
],
[
69,
76
],
[
76,
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
],
[
91,
92
],
[
91,
93
],
[
76,
94
],
[
94,
95
],
[
69,
96
],
[
96,
97
],
[
97,
98
],
[
98,
99
],
[
99,
100
],
[
99,
101
],
[
97,
102
],
[
96,
103
],
[
103,
104
],
[
104,
105
],
[
105,
106
],
[
105,
107
],
[
107,
108
],
[
107,
109
],
[
104,
110
],
[
110,
111
],
[
111,
112
],
[
111,
113
],
[
113,
114
],
[
113,
115
],
[
110,
116
],
[
116,
117
],
[
116,
118
],
[
118,
119
],
[
118,
120
],
[
103,
121
],
[
121,
122
],
[
96,
123
],
[
123,
124
],
[
124,
125
],
[
125,
126
],
[
125,
127
],
[
124,
128
],
[
128,
129
],
[
129,
130
],
[
128,
131
],
[
131,
132
],
[
131,
133
],
[
123,
134
],
[
134,
135
],
[
8,
136
],
[
136,
137
],
[
137,
138
],
[
138,
139
],
[
138,
140
],
[
136,
141
],
[
141,
142
],
[
141,
143
],
[
143,
144
],
[
143,
145
],
[
6,
146
],
[
146,
147
],
[
0,
148
],
[
148,
149
],
[
148,
150
]
] | [
"import java.util.Scanner;\n\npublic class Main {\n\tpublic static void main(String[] args) {\n\t\tint stack[] = new int[1000];\n\n\t\tScanner scanner = new Scanner(System.in);\n\t\tint counta = 0;\n\t\tString input[] = (scanner.nextLine()).split(\" \");\n\n\t\tfor (int i = 0; i < input.length; i++) {\n\t\t\tif (input[i].equals(\"*\")) {\n\t\t\t\tstack[counta - 2] = stack[counta - 2] * stack[counta - 1];\n\t\t\t\tcounta--;\n\t\t\t} else if (input[i].equals(\"+\")) {\n\t\t\t\tstack[counta - 2] = stack[counta - 2] + stack[counta - 1];\n\t\t\t\tcounta--;\n\n\t\t\t} else if (input[i].equals(\"-\")) {\n\t\t\t\tstack[counta - 2] = stack[counta - 2] - stack[counta - 1];\n\t\t\t\tcounta--;\n\n\t\t\t} else {\n\t\t\t\tstack[counta] = Integer.parseInt(input[i]);\n\t\t\t\tcounta++;\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(stack[counta - 1]);\n\t}\n\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tint stack[] = new int[1000];\n\n\t\tScanner scanner = new Scanner(System.in);\n\t\tint counta = 0;\n\t\tString input[] = (scanner.nextLine()).split(\" \");\n\n\t\tfor (int i = 0; i < input.length; i++) {\n\t\t\tif (input[i].equals(\"*\")) {\n\t\t\t\tstack[counta - 2] = stack[counta - 2] * stack[counta - 1];\n\t\t\t\tcounta--;\n\t\t\t} else if (input[i].equals(\"+\")) {\n\t\t\t\tstack[counta - 2] = stack[counta - 2] + stack[counta - 1];\n\t\t\t\tcounta--;\n\n\t\t\t} else if (input[i].equals(\"-\")) {\n\t\t\t\tstack[counta - 2] = stack[counta - 2] - stack[counta - 1];\n\t\t\t\tcounta--;\n\n\t\t\t} else {\n\t\t\t\tstack[counta] = Integer.parseInt(input[i]);\n\t\t\t\tcounta++;\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(stack[counta - 1]);\n\t}\n\n}",
"Main",
"public static void main(String[] args) {\n\t\tint stack[] = new int[1000];\n\n\t\tScanner scanner = new Scanner(System.in);\n\t\tint counta = 0;\n\t\tString input[] = (scanner.nextLine()).split(\" \");\n\n\t\tfor (int i = 0; i < input.length; i++) {\n\t\t\tif (input[i].equals(\"*\")) {\n\t\t\t\tstack[counta - 2] = stack[counta - 2] * stack[counta - 1];\n\t\t\t\tcounta--;\n\t\t\t} else if (input[i].equals(\"+\")) {\n\t\t\t\tstack[counta - 2] = stack[counta - 2] + stack[counta - 1];\n\t\t\t\tcounta--;\n\n\t\t\t} else if (input[i].equals(\"-\")) {\n\t\t\t\tstack[counta - 2] = stack[counta - 2] - stack[counta - 1];\n\t\t\t\tcounta--;\n\n\t\t\t} else {\n\t\t\t\tstack[counta] = Integer.parseInt(input[i]);\n\t\t\t\tcounta++;\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(stack[counta - 1]);\n\t}",
"main",
"{\n\t\tint stack[] = new int[1000];\n\n\t\tScanner scanner = new Scanner(System.in);\n\t\tint counta = 0;\n\t\tString input[] = (scanner.nextLine()).split(\" \");\n\n\t\tfor (int i = 0; i < input.length; i++) {\n\t\t\tif (input[i].equals(\"*\")) {\n\t\t\t\tstack[counta - 2] = stack[counta - 2] * stack[counta - 1];\n\t\t\t\tcounta--;\n\t\t\t} else if (input[i].equals(\"+\")) {\n\t\t\t\tstack[counta - 2] = stack[counta - 2] + stack[counta - 1];\n\t\t\t\tcounta--;\n\n\t\t\t} else if (input[i].equals(\"-\")) {\n\t\t\t\tstack[counta - 2] = stack[counta - 2] - stack[counta - 1];\n\t\t\t\tcounta--;\n\n\t\t\t} else {\n\t\t\t\tstack[counta] = Integer.parseInt(input[i]);\n\t\t\t\tcounta++;\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(stack[counta - 1]);\n\t}",
"int stack[] = new int[1000];",
"stack",
"new int[1000]",
"1000",
"Scanner scanner = new Scanner(System.in);",
"scanner",
"new Scanner(System.in)",
"int counta = 0;",
"counta",
"0",
"String input[] = (scanner.nextLine()).split(\" \");",
"input",
"(scanner.nextLine()).split(\" \")",
"(scanner.nextLine()).split",
"(scanner.nextLine())",
"scanner.nextLine",
"scanner",
"\" \"",
"for (int i = 0; i < input.length; i++) {\n\t\t\tif (input[i].equals(\"*\")) {\n\t\t\t\tstack[counta - 2] = stack[counta - 2] * stack[counta - 1];\n\t\t\t\tcounta--;\n\t\t\t} else if (input[i].equals(\"+\")) {\n\t\t\t\tstack[counta - 2] = stack[counta - 2] + stack[counta - 1];\n\t\t\t\tcounta--;\n\n\t\t\t} else if (input[i].equals(\"-\")) {\n\t\t\t\tstack[counta - 2] = stack[counta - 2] - stack[counta - 1];\n\t\t\t\tcounta--;\n\n\t\t\t} else {\n\t\t\t\tstack[counta] = Integer.parseInt(input[i]);\n\t\t\t\tcounta++;\n\t\t\t}\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < input.length",
"i",
"input.length",
"input",
"input.length",
"i++",
"i++",
"i",
"{\n\t\t\tif (input[i].equals(\"*\")) {\n\t\t\t\tstack[counta - 2] = stack[counta - 2] * stack[counta - 1];\n\t\t\t\tcounta--;\n\t\t\t} else if (input[i].equals(\"+\")) {\n\t\t\t\tstack[counta - 2] = stack[counta - 2] + stack[counta - 1];\n\t\t\t\tcounta--;\n\n\t\t\t} else if (input[i].equals(\"-\")) {\n\t\t\t\tstack[counta - 2] = stack[counta - 2] - stack[counta - 1];\n\t\t\t\tcounta--;\n\n\t\t\t} else {\n\t\t\t\tstack[counta] = Integer.parseInt(input[i]);\n\t\t\t\tcounta++;\n\t\t\t}\n\t\t}",
"{\n\t\t\tif (input[i].equals(\"*\")) {\n\t\t\t\tstack[counta - 2] = stack[counta - 2] * stack[counta - 1];\n\t\t\t\tcounta--;\n\t\t\t} else if (input[i].equals(\"+\")) {\n\t\t\t\tstack[counta - 2] = stack[counta - 2] + stack[counta - 1];\n\t\t\t\tcounta--;\n\n\t\t\t} else if (input[i].equals(\"-\")) {\n\t\t\t\tstack[counta - 2] = stack[counta - 2] - stack[counta - 1];\n\t\t\t\tcounta--;\n\n\t\t\t} else {\n\t\t\t\tstack[counta] = Integer.parseInt(input[i]);\n\t\t\t\tcounta++;\n\t\t\t}\n\t\t}",
"if (input[i].equals(\"*\")) {\n\t\t\t\tstack[counta - 2] = stack[counta - 2] * stack[counta - 1];\n\t\t\t\tcounta--;\n\t\t\t} else if (input[i].equals(\"+\")) {\n\t\t\t\tstack[counta - 2] = stack[counta - 2] + stack[counta - 1];\n\t\t\t\tcounta--;\n\n\t\t\t} else if (input[i].equals(\"-\")) {\n\t\t\t\tstack[counta - 2] = stack[counta - 2] - stack[counta - 1];\n\t\t\t\tcounta--;\n\n\t\t\t} else {\n\t\t\t\tstack[counta] = Integer.parseInt(input[i]);\n\t\t\t\tcounta++;\n\t\t\t}",
"input[i].equals(\"*\")",
"input[i].equals",
"input[i]",
"input",
"i",
"\"*\"",
"{\n\t\t\t\tstack[counta - 2] = stack[counta - 2] * stack[counta - 1];\n\t\t\t\tcounta--;\n\t\t\t}",
"stack[counta - 2] = stack[counta - 2] * stack[counta - 1]",
"stack[counta - 2]",
"stack",
"counta - 2",
"counta",
"2",
"stack[counta - 2] * stack[counta - 1]",
"stack[counta - 2]",
"stack",
"counta - 2",
"counta",
"2",
"stack[counta - 1]",
"stack",
"counta - 1",
"counta",
"1",
"counta--",
"counta",
"if (input[i].equals(\"+\")) {\n\t\t\t\tstack[counta - 2] = stack[counta - 2] + stack[counta - 1];\n\t\t\t\tcounta--;\n\n\t\t\t} else if (input[i].equals(\"-\")) {\n\t\t\t\tstack[counta - 2] = stack[counta - 2] - stack[counta - 1];\n\t\t\t\tcounta--;\n\n\t\t\t} else {\n\t\t\t\tstack[counta] = Integer.parseInt(input[i]);\n\t\t\t\tcounta++;\n\t\t\t}",
"input[i].equals(\"+\")",
"input[i].equals",
"input[i]",
"input",
"i",
"\"+\"",
"{\n\t\t\t\tstack[counta - 2] = stack[counta - 2] + stack[counta - 1];\n\t\t\t\tcounta--;\n\n\t\t\t}",
"stack[counta - 2] = stack[counta - 2] + stack[counta - 1]",
"stack[counta - 2]",
"stack",
"counta - 2",
"counta",
"2",
"stack[counta - 2] + stack[counta - 1]",
"stack[counta - 2]",
"stack",
"counta - 2",
"counta",
"2",
"stack[counta - 1]",
"stack",
"counta - 1",
"counta",
"1",
"counta--",
"counta",
"if (input[i].equals(\"-\")) {\n\t\t\t\tstack[counta - 2] = stack[counta - 2] - stack[counta - 1];\n\t\t\t\tcounta--;\n\n\t\t\t} else {\n\t\t\t\tstack[counta] = Integer.parseInt(input[i]);\n\t\t\t\tcounta++;\n\t\t\t}",
"input[i].equals(\"-\")",
"input[i].equals",
"input[i]",
"input",
"i",
"\"-\"",
"{\n\t\t\t\tstack[counta - 2] = stack[counta - 2] - stack[counta - 1];\n\t\t\t\tcounta--;\n\n\t\t\t}",
"stack[counta - 2] = stack[counta - 2] - stack[counta - 1]",
"stack[counta - 2]",
"stack",
"counta - 2",
"counta",
"2",
"stack[counta - 2] - stack[counta - 1]",
"stack[counta - 2]",
"stack",
"counta - 2",
"counta",
"2",
"stack[counta - 1]",
"stack",
"counta - 1",
"counta",
"1",
"counta--",
"counta",
"{\n\t\t\t\tstack[counta] = Integer.parseInt(input[i]);\n\t\t\t\tcounta++;\n\t\t\t}",
"stack[counta] = Integer.parseInt(input[i])",
"stack[counta]",
"stack",
"counta",
"Integer.parseInt(input[i])",
"Integer.parseInt",
"Integer",
"input[i]",
"input",
"i",
"counta++",
"counta",
"System.out.println(stack[counta - 1])",
"System.out.println",
"System.out",
"System",
"System.out",
"stack[counta - 1]",
"stack",
"counta - 1",
"counta",
"1",
"String[] args",
"args",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tint stack[] = new int[1000];\n\n\t\tScanner scanner = new Scanner(System.in);\n\t\tint counta = 0;\n\t\tString input[] = (scanner.nextLine()).split(\" \");\n\n\t\tfor (int i = 0; i < input.length; i++) {\n\t\t\tif (input[i].equals(\"*\")) {\n\t\t\t\tstack[counta - 2] = stack[counta - 2] * stack[counta - 1];\n\t\t\t\tcounta--;\n\t\t\t} else if (input[i].equals(\"+\")) {\n\t\t\t\tstack[counta - 2] = stack[counta - 2] + stack[counta - 1];\n\t\t\t\tcounta--;\n\n\t\t\t} else if (input[i].equals(\"-\")) {\n\t\t\t\tstack[counta - 2] = stack[counta - 2] - stack[counta - 1];\n\t\t\t\tcounta--;\n\n\t\t\t} else {\n\t\t\t\tstack[counta] = Integer.parseInt(input[i]);\n\t\t\t\tcounta++;\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(stack[counta - 1]);\n\t}\n\n}",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tint stack[] = new int[1000];\n\n\t\tScanner scanner = new Scanner(System.in);\n\t\tint counta = 0;\n\t\tString input[] = (scanner.nextLine()).split(\" \");\n\n\t\tfor (int i = 0; i < input.length; i++) {\n\t\t\tif (input[i].equals(\"*\")) {\n\t\t\t\tstack[counta - 2] = stack[counta - 2] * stack[counta - 1];\n\t\t\t\tcounta--;\n\t\t\t} else if (input[i].equals(\"+\")) {\n\t\t\t\tstack[counta - 2] = stack[counta - 2] + stack[counta - 1];\n\t\t\t\tcounta--;\n\n\t\t\t} else if (input[i].equals(\"-\")) {\n\t\t\t\tstack[counta - 2] = stack[counta - 2] - stack[counta - 1];\n\t\t\t\tcounta--;\n\n\t\t\t} else {\n\t\t\t\tstack[counta] = Integer.parseInt(input[i]);\n\t\t\t\tcounta++;\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(stack[counta - 1]);\n\t}\n\n}",
"Main"
] | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
int stack[] = new int[1000];
Scanner scanner = new Scanner(System.in);
int counta = 0;
String input[] = (scanner.nextLine()).split(" ");
for (int i = 0; i < input.length; i++) {
if (input[i].equals("*")) {
stack[counta - 2] = stack[counta - 2] * stack[counta - 1];
counta--;
} else if (input[i].equals("+")) {
stack[counta - 2] = stack[counta - 2] + stack[counta - 1];
counta--;
} else if (input[i].equals("-")) {
stack[counta - 2] = stack[counta - 2] - stack[counta - 1];
counta--;
} else {
stack[counta] = Integer.parseInt(input[i]);
counta++;
}
}
System.out.println(stack[counta - 1]);
}
}
|
[
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,
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,
4,
18,
13,
18,
13,
13,
30,
35,
18,
13,
13,
34,
17,
1,
4,
18,
13,
2,
4,
18,
13,
4,
18,
13,
3,
34,
17,
1,
41,
13,
41,
13,
0,
13,
4,
18,
13,
0,
13,
4,
18,
13,
4,
18,
13,
2,
13,
13,
3,
34,
1,
4,
18,
13,
2,
4,
18,
13,
4,
18,
13,
4,
18,
18,
13,
13,
4,
18,
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
],
[
143,
8
],
[
143,
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
],
[
11,
28
],
[
28,
29
],
[
29,
30
],
[
30,
31
],
[
30,
32
],
[
28,
33
],
[
33,
34
],
[
33,
35
],
[
35,
36
],
[
35,
37
],
[
28,
38
],
[
38,
39
],
[
39,
40
],
[
28,
41
],
[
42,
42
],
[
42,
43
],
[
43,
44
],
[
44,
45
],
[
44,
46
],
[
46,
47
],
[
46,
48
],
[
43,
49
],
[
49,
50
],
[
50,
51
],
[
51,
52
],
[
50,
53
],
[
53,
54
],
[
54,
55
],
[
53,
56
],
[
56,
57
],
[
56,
58
],
[
43,
59
],
[
59,
60
],
[
60,
61
],
[
61,
62
],
[
61,
63
],
[
60,
64
],
[
64,
65
],
[
64,
66
],
[
66,
67
],
[
67,
68
],
[
68,
69
],
[
67,
70
],
[
70,
71
],
[
71,
72
],
[
72,
73
],
[
70,
74
],
[
74,
75
],
[
75,
76
],
[
66,
77
],
[
60,
78
],
[
78,
79
],
[
78,
80
],
[
80,
81
],
[
81,
82
],
[
80,
83
],
[
83,
84
],
[
80,
85
],
[
85,
86
],
[
85,
87
],
[
87,
88
],
[
88,
89
],
[
80,
90
],
[
90,
91
],
[
90,
92
],
[
92,
93
],
[
93,
94
],
[
80,
95
],
[
95,
96
],
[
96,
97
],
[
95,
98
],
[
98,
99
],
[
98,
100
],
[
80,
101
],
[
60,
102
],
[
102,
103
],
[
103,
104
],
[
104,
105
],
[
105,
106
],
[
104,
107
],
[
107,
108
],
[
108,
109
],
[
109,
110
],
[
107,
111
],
[
111,
112
],
[
112,
113
],
[
11,
114
],
[
114,
115
],
[
115,
116
],
[
116,
117
],
[
116,
118
],
[
114,
119
],
[
119,
120
],
[
120,
121
],
[
9,
122
],
[
122,
123
],
[
143,
124
],
[
124,
125
],
[
124,
126
],
[
126,
127
],
[
127,
128
],
[
128,
129
],
[
128,
130
],
[
130,
131
],
[
131,
132
],
[
127,
133
],
[
133,
134
],
[
134,
135
],
[
135,
136
],
[
134,
137
],
[
133,
138
],
[
138,
139
],
[
124,
140
],
[
140,
141
],
[
0,
142
],
[
142,
143
],
[
142,
144
]
] | [
"\nimport java.util.Scanner;\nimport java.util.Stack;\n\npublic class Main {\n\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n Stack<Integer> pila = new Stack<>();\n String[] exp = sc.nextLine().split(\" \");\n int oper;\n for (int i = 0; i < exp.length; i++) {\n if (esnumero(exp[i])) {\n pila.push(Integer.parseInt(exp[i]));\n } else {\n switch (exp[i]) {\n case \"+\":\n pila.push(pila.pop() + pila.pop());\n break;\n case \"-\":\n int a,\n b;\n a = pila.pop();\n b = pila.pop();\n pila.push(b - a);\n break;\n default:\n pila.push(pila.pop() * pila.pop());\n }\n }\n }\n System.out.println(pila.pop());\n }\n\n static boolean esnumero(String cadena) {\n try {\n Integer.parseInt(cadena);\n return true;\n } catch (NumberFormatException nfe) {\n return false;\n }\n }\n}\n",
"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 Scanner sc = new Scanner(System.in);\n Stack<Integer> pila = new Stack<>();\n String[] exp = sc.nextLine().split(\" \");\n int oper;\n for (int i = 0; i < exp.length; i++) {\n if (esnumero(exp[i])) {\n pila.push(Integer.parseInt(exp[i]));\n } else {\n switch (exp[i]) {\n case \"+\":\n pila.push(pila.pop() + pila.pop());\n break;\n case \"-\":\n int a,\n b;\n a = pila.pop();\n b = pila.pop();\n pila.push(b - a);\n break;\n default:\n pila.push(pila.pop() * pila.pop());\n }\n }\n }\n System.out.println(pila.pop());\n }\n\n static boolean esnumero(String cadena) {\n try {\n Integer.parseInt(cadena);\n return true;\n } catch (NumberFormatException nfe) {\n return false;\n }\n }\n}",
"Main",
"public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n Stack<Integer> pila = new Stack<>();\n String[] exp = sc.nextLine().split(\" \");\n int oper;\n for (int i = 0; i < exp.length; i++) {\n if (esnumero(exp[i])) {\n pila.push(Integer.parseInt(exp[i]));\n } else {\n switch (exp[i]) {\n case \"+\":\n pila.push(pila.pop() + pila.pop());\n break;\n case \"-\":\n int a,\n b;\n a = pila.pop();\n b = pila.pop();\n pila.push(b - a);\n break;\n default:\n pila.push(pila.pop() * pila.pop());\n }\n }\n }\n System.out.println(pila.pop());\n }",
"main",
"{\n Scanner sc = new Scanner(System.in);\n Stack<Integer> pila = new Stack<>();\n String[] exp = sc.nextLine().split(\" \");\n int oper;\n for (int i = 0; i < exp.length; i++) {\n if (esnumero(exp[i])) {\n pila.push(Integer.parseInt(exp[i]));\n } else {\n switch (exp[i]) {\n case \"+\":\n pila.push(pila.pop() + pila.pop());\n break;\n case \"-\":\n int a,\n b;\n a = pila.pop();\n b = pila.pop();\n pila.push(b - a);\n break;\n default:\n pila.push(pila.pop() * pila.pop());\n }\n }\n }\n System.out.println(pila.pop());\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"Stack<Integer> pila = new Stack<>();",
"pila",
"new Stack<>()",
"String[] exp = sc.nextLine().split(\" \");",
"exp",
"sc.nextLine().split(\" \")",
"sc.nextLine().split",
"sc.nextLine()",
"sc.nextLine",
"sc",
"\" \"",
"int oper;",
"oper",
"for (int i = 0; i < exp.length; i++) {\n if (esnumero(exp[i])) {\n pila.push(Integer.parseInt(exp[i]));\n } else {\n switch (exp[i]) {\n case \"+\":\n pila.push(pila.pop() + pila.pop());\n break;\n case \"-\":\n int a,\n b;\n a = pila.pop();\n b = pila.pop();\n pila.push(b - a);\n break;\n default:\n pila.push(pila.pop() * pila.pop());\n }\n }\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < exp.length",
"i",
"exp.length",
"exp",
"exp.length",
"i++",
"i++",
"i",
"{\n if (esnumero(exp[i])) {\n pila.push(Integer.parseInt(exp[i]));\n } else {\n switch (exp[i]) {\n case \"+\":\n pila.push(pila.pop() + pila.pop());\n break;\n case \"-\":\n int a,\n b;\n a = pila.pop();\n b = pila.pop();\n pila.push(b - a);\n break;\n default:\n pila.push(pila.pop() * pila.pop());\n }\n }\n }",
"{\n if (esnumero(exp[i])) {\n pila.push(Integer.parseInt(exp[i]));\n } else {\n switch (exp[i]) {\n case \"+\":\n pila.push(pila.pop() + pila.pop());\n break;\n case \"-\":\n int a,\n b;\n a = pila.pop();\n b = pila.pop();\n pila.push(b - a);\n break;\n default:\n pila.push(pila.pop() * pila.pop());\n }\n }\n }",
"if (esnumero(exp[i])) {\n pila.push(Integer.parseInt(exp[i]));\n } else {\n switch (exp[i]) {\n case \"+\":\n pila.push(pila.pop() + pila.pop());\n break;\n case \"-\":\n int a,\n b;\n a = pila.pop();\n b = pila.pop();\n pila.push(b - a);\n break;\n default:\n pila.push(pila.pop() * pila.pop());\n }\n }",
"esnumero(exp[i])",
"esnumero",
"exp[i]",
"exp",
"i",
"{\n pila.push(Integer.parseInt(exp[i]));\n }",
"pila.push(Integer.parseInt(exp[i]))",
"pila.push",
"pila",
"Integer.parseInt(exp[i])",
"Integer.parseInt",
"Integer",
"exp[i]",
"exp",
"i",
"{\n switch (exp[i]) {\n case \"+\":\n pila.push(pila.pop() + pila.pop());\n break;\n case \"-\":\n int a,\n b;\n a = pila.pop();\n b = pila.pop();\n pila.push(b - a);\n break;\n default:\n pila.push(pila.pop() * pila.pop());\n }\n }",
"switch (exp[i]) {\n case \"+\":\n pila.push(pila.pop() + pila.pop());\n break;\n case \"-\":\n int a,\n b;\n a = pila.pop();\n b = pila.pop();\n pila.push(b - a);\n break;\n default:\n pila.push(pila.pop() * pila.pop());\n }",
"exp[i]",
"exp",
"i",
"case \"+\":",
"\"+\"",
"case \"+\":",
"pila.push(pila.pop() + pila.pop())",
"pila.push",
"pila",
"pila.pop() + pila.pop()",
"pila.pop()",
"pila.pop",
"pila",
"pila.pop()",
"pila.pop",
"pila",
"break;",
"case \"-\":",
"\"-\"",
"case \"-\":",
"int a",
"a",
"b;",
"b",
"a = pila.pop()",
"a",
"pila.pop()",
"pila.pop",
"pila",
"b = pila.pop()",
"b",
"pila.pop()",
"pila.pop",
"pila",
"pila.push(b - a)",
"pila.push",
"pila",
"b - a",
"b",
"a",
"break;",
"default:",
"default:",
"pila.push(pila.pop() * pila.pop())",
"pila.push",
"pila",
"pila.pop() * pila.pop()",
"pila.pop()",
"pila.pop",
"pila",
"pila.pop()",
"pila.pop",
"pila",
"System.out.println(pila.pop())",
"System.out.println",
"System.out",
"System",
"System.out",
"pila.pop()",
"pila.pop",
"pila",
"String[] args",
"args",
"static boolean esnumero(String cadena) {\n try {\n Integer.parseInt(cadena);\n return true;\n } catch (NumberFormatException nfe) {\n return false;\n }\n }",
"esnumero",
"{\n try {\n Integer.parseInt(cadena);\n return true;\n } catch (NumberFormatException nfe) {\n return false;\n }\n }",
"try {\n Integer.parseInt(cadena);\n return true;\n } catch (NumberFormatException nfe) {\n return false;\n }",
"catch (NumberFormatException nfe) {\n return false;\n }",
"NumberFormatException nfe",
"{\n return false;\n }",
"return false;",
"false",
"{\n Integer.parseInt(cadena);\n return true;\n }",
"Integer.parseInt(cadena)",
"Integer.parseInt",
"Integer",
"cadena",
"return true;",
"true",
"String cadena",
"cadena",
"public class Main {\n\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n Stack<Integer> pila = new Stack<>();\n String[] exp = sc.nextLine().split(\" \");\n int oper;\n for (int i = 0; i < exp.length; i++) {\n if (esnumero(exp[i])) {\n pila.push(Integer.parseInt(exp[i]));\n } else {\n switch (exp[i]) {\n case \"+\":\n pila.push(pila.pop() + pila.pop());\n break;\n case \"-\":\n int a,\n b;\n a = pila.pop();\n b = pila.pop();\n pila.push(b - a);\n break;\n default:\n pila.push(pila.pop() * pila.pop());\n }\n }\n }\n System.out.println(pila.pop());\n }\n\n static boolean esnumero(String cadena) {\n try {\n Integer.parseInt(cadena);\n return true;\n } catch (NumberFormatException nfe) {\n return false;\n }\n }\n}",
"public class Main {\n\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n Stack<Integer> pila = new Stack<>();\n String[] exp = sc.nextLine().split(\" \");\n int oper;\n for (int i = 0; i < exp.length; i++) {\n if (esnumero(exp[i])) {\n pila.push(Integer.parseInt(exp[i]));\n } else {\n switch (exp[i]) {\n case \"+\":\n pila.push(pila.pop() + pila.pop());\n break;\n case \"-\":\n int a,\n b;\n a = pila.pop();\n b = pila.pop();\n pila.push(b - a);\n break;\n default:\n pila.push(pila.pop() * pila.pop());\n }\n }\n }\n System.out.println(pila.pop());\n }\n\n static boolean esnumero(String cadena) {\n try {\n Integer.parseInt(cadena);\n return true;\n } catch (NumberFormatException nfe) {\n return false;\n }\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);
Stack<Integer> pila = new Stack<>();
String[] exp = sc.nextLine().split(" ");
int oper;
for (int i = 0; i < exp.length; i++) {
if (esnumero(exp[i])) {
pila.push(Integer.parseInt(exp[i]));
} else {
switch (exp[i]) {
case "+":
pila.push(pila.pop() + pila.pop());
break;
case "-":
int a,
b;
a = pila.pop();
b = pila.pop();
pila.push(b - a);
break;
default:
pila.push(pila.pop() * pila.pop());
}
}
}
System.out.println(pila.pop());
}
static boolean esnumero(String cadena) {
try {
Integer.parseInt(cadena);
return true;
} catch (NumberFormatException nfe) {
return false;
}
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
38,
5,
13,
30,
4,
18,
18,
13,
13,
13,
30,
41,
13,
20,
17,
41,
13,
17,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
17,
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,
18,
13,
2,
13,
17,
2,
18,
13,
2,
13,
17,
18,
13,
2,
13,
17,
40,
13,
14,
4,
18,
18,
13,
13,
17,
30,
0,
18,
13,
2,
13,
17,
2,
18,
13,
2,
13,
17,
18,
13,
2,
13,
17,
40,
13,
14,
4,
18,
18,
13,
13,
17,
30,
0,
18,
13,
2,
13,
17,
2,
18,
13,
2,
13,
17,
18,
13,
2,
13,
17,
40,
13,
14,
4,
18,
18,
13,
13,
17,
30,
0,
18,
13,
2,
13,
17,
2,
18,
13,
2,
13,
17,
18,
13,
2,
13,
17,
40,
13,
30,
0,
18,
13,
13,
4,
18,
13,
18,
13,
13,
40,
13,
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
],
[
10,
11
],
[
10,
12
],
[
12,
13
],
[
13,
14
],
[
14,
15
],
[
15,
16
],
[
15,
17
],
[
13,
18
],
[
9,
19
],
[
19,
20
],
[
20,
21
],
[
20,
22
],
[
19,
24
],
[
24,
25
],
[
24,
26
],
[
19,
27
],
[
27,
28
],
[
27,
29
],
[
19,
30
],
[
30,
31
],
[
30,
32
],
[
32,
33
],
[
33,
34
],
[
19,
35
],
[
35,
36
],
[
35,
37
],
[
37,
38
],
[
38,
39
],
[
37,
40
],
[
37,
41
],
[
19,
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
],
[
58,
59
],
[
59,
60
],
[
60,
61
],
[
60,
62
],
[
58,
63
],
[
57,
64
],
[
64,
65
],
[
65,
66
],
[
66,
67
],
[
66,
68
],
[
68,
69
],
[
68,
70
],
[
65,
71
],
[
71,
72
],
[
72,
73
],
[
72,
74
],
[
74,
75
],
[
74,
76
],
[
71,
77
],
[
77,
78
],
[
77,
79
],
[
79,
80
],
[
79,
81
],
[
64,
82
],
[
82,
83
],
[
57,
84
],
[
84,
85
],
[
85,
86
],
[
86,
87
],
[
87,
88
],
[
87,
89
],
[
85,
90
],
[
84,
91
],
[
91,
92
],
[
92,
93
],
[
93,
94
],
[
93,
95
],
[
95,
96
],
[
95,
97
],
[
92,
98
],
[
98,
99
],
[
99,
100
],
[
99,
101
],
[
101,
102
],
[
101,
103
],
[
98,
104
],
[
104,
105
],
[
104,
106
],
[
106,
107
],
[
106,
108
],
[
91,
109
],
[
109,
110
],
[
84,
111
],
[
111,
112
],
[
112,
113
],
[
113,
114
],
[
114,
115
],
[
114,
116
],
[
112,
117
],
[
111,
118
],
[
118,
119
],
[
119,
120
],
[
120,
121
],
[
120,
122
],
[
122,
123
],
[
122,
124
],
[
119,
125
],
[
125,
126
],
[
126,
127
],
[
126,
128
],
[
128,
129
],
[
128,
130
],
[
125,
131
],
[
131,
132
],
[
131,
133
],
[
133,
134
],
[
133,
135
],
[
118,
136
],
[
136,
137
],
[
111,
138
],
[
138,
139
],
[
139,
140
],
[
140,
141
],
[
141,
142
],
[
141,
143
],
[
139,
144
],
[
138,
145
],
[
145,
146
],
[
146,
147
],
[
147,
148
],
[
147,
149
],
[
149,
150
],
[
149,
151
],
[
146,
152
],
[
152,
153
],
[
153,
154
],
[
153,
155
],
[
155,
156
],
[
155,
157
],
[
152,
158
],
[
158,
159
],
[
158,
160
],
[
160,
161
],
[
160,
162
],
[
145,
163
],
[
163,
164
],
[
138,
165
],
[
165,
166
],
[
166,
167
],
[
167,
168
],
[
167,
169
],
[
166,
170
],
[
170,
171
],
[
171,
172
],
[
170,
173
],
[
173,
174
],
[
173,
175
],
[
165,
176
],
[
176,
177
],
[
19,
178
],
[
178,
179
],
[
179,
180
],
[
180,
181
],
[
180,
182
],
[
178,
183
],
[
183,
184
],
[
183,
185
],
[
6,
186
],
[
186,
187
]
] | [
"import java.io.*;\n\nclass Main\n{\n\n public static void main(String args[])\n {\n\ttry\n\t {\n\t\tint stack[]=new int[100];\n\t\tint j=0;\n\t\tBufferedReader reader = new BufferedReader(new InputStreamReader(System.in));\n\n\t\tString str = reader.readLine();\n\t\tString[] processed = str.split(\" \",0);\n\t\t//for(int i= 0 ; i <processed.length ; i++)System.out.println(processed[i]);\n\t\tfor(int i= 0 ; i <processed.length ; i++)\n\t\t {\n\t\t\tif(processed[i].equals(\"+\"))//equals(\"\")はダブルクオーテーション\" \"の見た目と変数.equals(\" \")の変数の中身が一致すればtrue、一致しなければfalse。半角全角とかが違っても見た目同じならtrue。\n\t\t\t {\n\t\t\t\t//System.out.println(\"test\");\n\t\t\t\t//System.out.println(stack[j-1]+\" \"+stack[j]);\n\t\t\t\tstack[j-2] = stack[j-2]+stack[j-1];\n\t\t\t\t/*System.out.println(stack[j]);\n\t\t\t\tSystem.out.println(stack[j-1]);\n\t\t\t\tSystem.out.println(stack[j+1]);*/\n\t\t\t\tj--;\n\t\t\t }\n\t\t\telse if(processed[i].equals(\"-\"))\n\t\t\t {\n\t\t\t\t\n\t\t\t\tstack[j-2] = stack[j-2]-stack[j-1];\n\t\t\t\tj--;\n\t\t\t }\n\t\t\telse if(processed[i].equals(\"*\"))\n\t\t\t {\n\t\t\t\tstack[j-2] = stack[j-2] * stack[j-1];\n\t\t\t\tj--;\n\t\t\t }\n\t\t\telse if(processed[i].equals(\"/\"))\n\t\t\t {\n\t\t\t\tstack[j-2] = stack[j-2]/stack[j-1];\n\t\t\t\tj--;\n\t\t\t }\n\t\t\telse\n\t\t\t {\n\t\t\t\tstack[j] = Integer.parseInt(processed[i]);\n\t\t\t\t//System.out.println(\"stack[\"+j+\"]=\"+stack[j]);\n\t\t\t\tj++;\n\t\t\t\t//for(int k = 0 ; k < j ; k++)System.out.println(\"stack[\"+k+\"]=\"+stack[k]);\n\t\t\t\t//System.out.println(\"j = \"+j);\n\t\t\t\t//System.out.println(\"\");\n\t\t\t }\n\t\t }\n\t\t//for(int i = 0 ; i< processed.length ; i++)System.out.print(processed[i]+\" \");\n\n\t\t//for(int k = 0 ; k < j ; k++)System.out.println(\"stack[\"+k+\"]=\"+stack[k]);\n\t\tSystem.out.println(stack[0]);\n\t\t \n\t }\n\tcatch(IOException e)\n\t {\n\t\tSystem.out.println(e);\n\t }\n }\n \n}\n",
"import java.io.*;",
"io.*",
"java",
"class Main\n{\n\n public static void main(String args[])\n {\n\ttry\n\t {\n\t\tint stack[]=new int[100];\n\t\tint j=0;\n\t\tBufferedReader reader = new BufferedReader(new InputStreamReader(System.in));\n\n\t\tString str = reader.readLine();\n\t\tString[] processed = str.split(\" \",0);\n\t\t//for(int i= 0 ; i <processed.length ; i++)System.out.println(processed[i]);\n\t\tfor(int i= 0 ; i <processed.length ; i++)\n\t\t {\n\t\t\tif(processed[i].equals(\"+\"))//equals(\"\")はダブルクオーテーション\" \"の見た目と変数.equals(\" \")の変数の中身が一致すればtrue、一致しなければfalse。半角全角とかが違っても見た目同じならtrue。\n\t\t\t {\n\t\t\t\t//System.out.println(\"test\");\n\t\t\t\t//System.out.println(stack[j-1]+\" \"+stack[j]);\n\t\t\t\tstack[j-2] = stack[j-2]+stack[j-1];\n\t\t\t\t/*System.out.println(stack[j]);\n\t\t\t\tSystem.out.println(stack[j-1]);\n\t\t\t\tSystem.out.println(stack[j+1]);*/\n\t\t\t\tj--;\n\t\t\t }\n\t\t\telse if(processed[i].equals(\"-\"))\n\t\t\t {\n\t\t\t\t\n\t\t\t\tstack[j-2] = stack[j-2]-stack[j-1];\n\t\t\t\tj--;\n\t\t\t }\n\t\t\telse if(processed[i].equals(\"*\"))\n\t\t\t {\n\t\t\t\tstack[j-2] = stack[j-2] * stack[j-1];\n\t\t\t\tj--;\n\t\t\t }\n\t\t\telse if(processed[i].equals(\"/\"))\n\t\t\t {\n\t\t\t\tstack[j-2] = stack[j-2]/stack[j-1];\n\t\t\t\tj--;\n\t\t\t }\n\t\t\telse\n\t\t\t {\n\t\t\t\tstack[j] = Integer.parseInt(processed[i]);\n\t\t\t\t//System.out.println(\"stack[\"+j+\"]=\"+stack[j]);\n\t\t\t\tj++;\n\t\t\t\t//for(int k = 0 ; k < j ; k++)System.out.println(\"stack[\"+k+\"]=\"+stack[k]);\n\t\t\t\t//System.out.println(\"j = \"+j);\n\t\t\t\t//System.out.println(\"\");\n\t\t\t }\n\t\t }\n\t\t//for(int i = 0 ; i< processed.length ; i++)System.out.print(processed[i]+\" \");\n\n\t\t//for(int k = 0 ; k < j ; k++)System.out.println(\"stack[\"+k+\"]=\"+stack[k]);\n\t\tSystem.out.println(stack[0]);\n\t\t \n\t }\n\tcatch(IOException e)\n\t {\n\t\tSystem.out.println(e);\n\t }\n }\n \n}",
"Main",
"public static void main(String args[])\n {\n\ttry\n\t {\n\t\tint stack[]=new int[100];\n\t\tint j=0;\n\t\tBufferedReader reader = new BufferedReader(new InputStreamReader(System.in));\n\n\t\tString str = reader.readLine();\n\t\tString[] processed = str.split(\" \",0);\n\t\t//for(int i= 0 ; i <processed.length ; i++)System.out.println(processed[i]);\n\t\tfor(int i= 0 ; i <processed.length ; i++)\n\t\t {\n\t\t\tif(processed[i].equals(\"+\"))//equals(\"\")はダブルクオーテーション\" \"の見た目と変数.equals(\" \")の変数の中身が一致すればtrue、一致しなければfalse。半角全角とかが違っても見た目同じならtrue。\n\t\t\t {\n\t\t\t\t//System.out.println(\"test\");\n\t\t\t\t//System.out.println(stack[j-1]+\" \"+stack[j]);\n\t\t\t\tstack[j-2] = stack[j-2]+stack[j-1];\n\t\t\t\t/*System.out.println(stack[j]);\n\t\t\t\tSystem.out.println(stack[j-1]);\n\t\t\t\tSystem.out.println(stack[j+1]);*/\n\t\t\t\tj--;\n\t\t\t }\n\t\t\telse if(processed[i].equals(\"-\"))\n\t\t\t {\n\t\t\t\t\n\t\t\t\tstack[j-2] = stack[j-2]-stack[j-1];\n\t\t\t\tj--;\n\t\t\t }\n\t\t\telse if(processed[i].equals(\"*\"))\n\t\t\t {\n\t\t\t\tstack[j-2] = stack[j-2] * stack[j-1];\n\t\t\t\tj--;\n\t\t\t }\n\t\t\telse if(processed[i].equals(\"/\"))\n\t\t\t {\n\t\t\t\tstack[j-2] = stack[j-2]/stack[j-1];\n\t\t\t\tj--;\n\t\t\t }\n\t\t\telse\n\t\t\t {\n\t\t\t\tstack[j] = Integer.parseInt(processed[i]);\n\t\t\t\t//System.out.println(\"stack[\"+j+\"]=\"+stack[j]);\n\t\t\t\tj++;\n\t\t\t\t//for(int k = 0 ; k < j ; k++)System.out.println(\"stack[\"+k+\"]=\"+stack[k]);\n\t\t\t\t//System.out.println(\"j = \"+j);\n\t\t\t\t//System.out.println(\"\");\n\t\t\t }\n\t\t }\n\t\t//for(int i = 0 ; i< processed.length ; i++)System.out.print(processed[i]+\" \");\n\n\t\t//for(int k = 0 ; k < j ; k++)System.out.println(\"stack[\"+k+\"]=\"+stack[k]);\n\t\tSystem.out.println(stack[0]);\n\t\t \n\t }\n\tcatch(IOException e)\n\t {\n\t\tSystem.out.println(e);\n\t }\n }",
"main",
"{\n\ttry\n\t {\n\t\tint stack[]=new int[100];\n\t\tint j=0;\n\t\tBufferedReader reader = new BufferedReader(new InputStreamReader(System.in));\n\n\t\tString str = reader.readLine();\n\t\tString[] processed = str.split(\" \",0);\n\t\t//for(int i= 0 ; i <processed.length ; i++)System.out.println(processed[i]);\n\t\tfor(int i= 0 ; i <processed.length ; i++)\n\t\t {\n\t\t\tif(processed[i].equals(\"+\"))//equals(\"\")はダブルクオーテーション\" \"の見た目と変数.equals(\" \")の変数の中身が一致すればtrue、一致しなければfalse。半角全角とかが違っても見た目同じならtrue。\n\t\t\t {\n\t\t\t\t//System.out.println(\"test\");\n\t\t\t\t//System.out.println(stack[j-1]+\" \"+stack[j]);\n\t\t\t\tstack[j-2] = stack[j-2]+stack[j-1];\n\t\t\t\t/*System.out.println(stack[j]);\n\t\t\t\tSystem.out.println(stack[j-1]);\n\t\t\t\tSystem.out.println(stack[j+1]);*/\n\t\t\t\tj--;\n\t\t\t }\n\t\t\telse if(processed[i].equals(\"-\"))\n\t\t\t {\n\t\t\t\t\n\t\t\t\tstack[j-2] = stack[j-2]-stack[j-1];\n\t\t\t\tj--;\n\t\t\t }\n\t\t\telse if(processed[i].equals(\"*\"))\n\t\t\t {\n\t\t\t\tstack[j-2] = stack[j-2] * stack[j-1];\n\t\t\t\tj--;\n\t\t\t }\n\t\t\telse if(processed[i].equals(\"/\"))\n\t\t\t {\n\t\t\t\tstack[j-2] = stack[j-2]/stack[j-1];\n\t\t\t\tj--;\n\t\t\t }\n\t\t\telse\n\t\t\t {\n\t\t\t\tstack[j] = Integer.parseInt(processed[i]);\n\t\t\t\t//System.out.println(\"stack[\"+j+\"]=\"+stack[j]);\n\t\t\t\tj++;\n\t\t\t\t//for(int k = 0 ; k < j ; k++)System.out.println(\"stack[\"+k+\"]=\"+stack[k]);\n\t\t\t\t//System.out.println(\"j = \"+j);\n\t\t\t\t//System.out.println(\"\");\n\t\t\t }\n\t\t }\n\t\t//for(int i = 0 ; i< processed.length ; i++)System.out.print(processed[i]+\" \");\n\n\t\t//for(int k = 0 ; k < j ; k++)System.out.println(\"stack[\"+k+\"]=\"+stack[k]);\n\t\tSystem.out.println(stack[0]);\n\t\t \n\t }\n\tcatch(IOException e)\n\t {\n\t\tSystem.out.println(e);\n\t }\n }",
"try\n\t {\n\t\tint stack[]=new int[100];\n\t\tint j=0;\n\t\tBufferedReader reader = new BufferedReader(new InputStreamReader(System.in));\n\n\t\tString str = reader.readLine();\n\t\tString[] processed = str.split(\" \",0);\n\t\t//for(int i= 0 ; i <processed.length ; i++)System.out.println(processed[i]);\n\t\tfor(int i= 0 ; i <processed.length ; i++)\n\t\t {\n\t\t\tif(processed[i].equals(\"+\"))//equals(\"\")はダブルクオーテーション\" \"の見た目と変数.equals(\" \")の変数の中身が一致すればtrue、一致しなければfalse。半角全角とかが違っても見た目同じならtrue。\n\t\t\t {\n\t\t\t\t//System.out.println(\"test\");\n\t\t\t\t//System.out.println(stack[j-1]+\" \"+stack[j]);\n\t\t\t\tstack[j-2] = stack[j-2]+stack[j-1];\n\t\t\t\t/*System.out.println(stack[j]);\n\t\t\t\tSystem.out.println(stack[j-1]);\n\t\t\t\tSystem.out.println(stack[j+1]);*/\n\t\t\t\tj--;\n\t\t\t }\n\t\t\telse if(processed[i].equals(\"-\"))\n\t\t\t {\n\t\t\t\t\n\t\t\t\tstack[j-2] = stack[j-2]-stack[j-1];\n\t\t\t\tj--;\n\t\t\t }\n\t\t\telse if(processed[i].equals(\"*\"))\n\t\t\t {\n\t\t\t\tstack[j-2] = stack[j-2] * stack[j-1];\n\t\t\t\tj--;\n\t\t\t }\n\t\t\telse if(processed[i].equals(\"/\"))\n\t\t\t {\n\t\t\t\tstack[j-2] = stack[j-2]/stack[j-1];\n\t\t\t\tj--;\n\t\t\t }\n\t\t\telse\n\t\t\t {\n\t\t\t\tstack[j] = Integer.parseInt(processed[i]);\n\t\t\t\t//System.out.println(\"stack[\"+j+\"]=\"+stack[j]);\n\t\t\t\tj++;\n\t\t\t\t//for(int k = 0 ; k < j ; k++)System.out.println(\"stack[\"+k+\"]=\"+stack[k]);\n\t\t\t\t//System.out.println(\"j = \"+j);\n\t\t\t\t//System.out.println(\"\");\n\t\t\t }\n\t\t }\n\t\t//for(int i = 0 ; i< processed.length ; i++)System.out.print(processed[i]+\" \");\n\n\t\t//for(int k = 0 ; k < j ; k++)System.out.println(\"stack[\"+k+\"]=\"+stack[k]);\n\t\tSystem.out.println(stack[0]);\n\t\t \n\t }\n\tcatch(IOException e)\n\t {\n\t\tSystem.out.println(e);\n\t }",
"catch(IOException e)\n\t {\n\t\tSystem.out.println(e);\n\t }",
"IOException e",
"{\n\t\tSystem.out.println(e);\n\t }",
"System.out.println(e)",
"System.out.println",
"System.out",
"System",
"System.out",
"e",
"{\n\t\tint stack[]=new int[100];\n\t\tint j=0;\n\t\tBufferedReader reader = new BufferedReader(new InputStreamReader(System.in));\n\n\t\tString str = reader.readLine();\n\t\tString[] processed = str.split(\" \",0);\n\t\t//for(int i= 0 ; i <processed.length ; i++)System.out.println(processed[i]);\n\t\tfor(int i= 0 ; i <processed.length ; i++)\n\t\t {\n\t\t\tif(processed[i].equals(\"+\"))//equals(\"\")はダブルクオーテーション\" \"の見た目と変数.equals(\" \")の変数の中身が一致すればtrue、一致しなければfalse。半角全角とかが違っても見た目同じならtrue。\n\t\t\t {\n\t\t\t\t//System.out.println(\"test\");\n\t\t\t\t//System.out.println(stack[j-1]+\" \"+stack[j]);\n\t\t\t\tstack[j-2] = stack[j-2]+stack[j-1];\n\t\t\t\t/*System.out.println(stack[j]);\n\t\t\t\tSystem.out.println(stack[j-1]);\n\t\t\t\tSystem.out.println(stack[j+1]);*/\n\t\t\t\tj--;\n\t\t\t }\n\t\t\telse if(processed[i].equals(\"-\"))\n\t\t\t {\n\t\t\t\t\n\t\t\t\tstack[j-2] = stack[j-2]-stack[j-1];\n\t\t\t\tj--;\n\t\t\t }\n\t\t\telse if(processed[i].equals(\"*\"))\n\t\t\t {\n\t\t\t\tstack[j-2] = stack[j-2] * stack[j-1];\n\t\t\t\tj--;\n\t\t\t }\n\t\t\telse if(processed[i].equals(\"/\"))\n\t\t\t {\n\t\t\t\tstack[j-2] = stack[j-2]/stack[j-1];\n\t\t\t\tj--;\n\t\t\t }\n\t\t\telse\n\t\t\t {\n\t\t\t\tstack[j] = Integer.parseInt(processed[i]);\n\t\t\t\t//System.out.println(\"stack[\"+j+\"]=\"+stack[j]);\n\t\t\t\tj++;\n\t\t\t\t//for(int k = 0 ; k < j ; k++)System.out.println(\"stack[\"+k+\"]=\"+stack[k]);\n\t\t\t\t//System.out.println(\"j = \"+j);\n\t\t\t\t//System.out.println(\"\");\n\t\t\t }\n\t\t }\n\t\t//for(int i = 0 ; i< processed.length ; i++)System.out.print(processed[i]+\" \");\n\n\t\t//for(int k = 0 ; k < j ; k++)System.out.println(\"stack[\"+k+\"]=\"+stack[k]);\n\t\tSystem.out.println(stack[0]);\n\t\t \n\t }",
"int stack[]=new int[100];",
"stack",
"new int[100]",
"100",
"int j=0;",
"j",
"0",
"BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));",
"reader",
"new BufferedReader(new InputStreamReader(System.in))",
"String str = reader.readLine();",
"str",
"reader.readLine()",
"reader.readLine",
"reader",
"String[] processed = str.split(\" \",0);",
"processed",
"str.split(\" \",0)",
"str.split",
"str",
"\" \"",
"0",
"for(int i= 0 ; i <processed.length ; i++)\n\t\t {\n\t\t\tif(processed[i].equals(\"+\"))//equals(\"\")はダブルクオーテーション\" \"の見た目と変数.equals(\" \")の変数の中身が一致すればtrue、一致しなければfalse。半角全角とかが違っても見た目同じならtrue。\n\t\t\t {\n\t\t\t\t//System.out.println(\"test\");\n\t\t\t\t//System.out.println(stack[j-1]+\" \"+stack[j]);\n\t\t\t\tstack[j-2] = stack[j-2]+stack[j-1];\n\t\t\t\t/*System.out.println(stack[j]);\n\t\t\t\tSystem.out.println(stack[j-1]);\n\t\t\t\tSystem.out.println(stack[j+1]);*/\n\t\t\t\tj--;\n\t\t\t }\n\t\t\telse if(processed[i].equals(\"-\"))\n\t\t\t {\n\t\t\t\t\n\t\t\t\tstack[j-2] = stack[j-2]-stack[j-1];\n\t\t\t\tj--;\n\t\t\t }\n\t\t\telse if(processed[i].equals(\"*\"))\n\t\t\t {\n\t\t\t\tstack[j-2] = stack[j-2] * stack[j-1];\n\t\t\t\tj--;\n\t\t\t }\n\t\t\telse if(processed[i].equals(\"/\"))\n\t\t\t {\n\t\t\t\tstack[j-2] = stack[j-2]/stack[j-1];\n\t\t\t\tj--;\n\t\t\t }\n\t\t\telse\n\t\t\t {\n\t\t\t\tstack[j] = Integer.parseInt(processed[i]);\n\t\t\t\t//System.out.println(\"stack[\"+j+\"]=\"+stack[j]);\n\t\t\t\tj++;\n\t\t\t\t//for(int k = 0 ; k < j ; k++)System.out.println(\"stack[\"+k+\"]=\"+stack[k]);\n\t\t\t\t//System.out.println(\"j = \"+j);\n\t\t\t\t//System.out.println(\"\");\n\t\t\t }\n\t\t }",
"int i= 0 ;",
"int i= 0 ;",
"i",
"0",
"i <processed.length",
"i",
"processed.length",
"processed",
"processed.length",
"i++",
"i++",
"i",
"{\n\t\t\tif(processed[i].equals(\"+\"))//equals(\"\")はダブルクオーテーション\" \"の見た目と変数.equals(\" \")の変数の中身が一致すればtrue、一致しなければfalse。半角全角とかが違っても見た目同じならtrue。\n\t\t\t {\n\t\t\t\t//System.out.println(\"test\");\n\t\t\t\t//System.out.println(stack[j-1]+\" \"+stack[j]);\n\t\t\t\tstack[j-2] = stack[j-2]+stack[j-1];\n\t\t\t\t/*System.out.println(stack[j]);\n\t\t\t\tSystem.out.println(stack[j-1]);\n\t\t\t\tSystem.out.println(stack[j+1]);*/\n\t\t\t\tj--;\n\t\t\t }\n\t\t\telse if(processed[i].equals(\"-\"))\n\t\t\t {\n\t\t\t\t\n\t\t\t\tstack[j-2] = stack[j-2]-stack[j-1];\n\t\t\t\tj--;\n\t\t\t }\n\t\t\telse if(processed[i].equals(\"*\"))\n\t\t\t {\n\t\t\t\tstack[j-2] = stack[j-2] * stack[j-1];\n\t\t\t\tj--;\n\t\t\t }\n\t\t\telse if(processed[i].equals(\"/\"))\n\t\t\t {\n\t\t\t\tstack[j-2] = stack[j-2]/stack[j-1];\n\t\t\t\tj--;\n\t\t\t }\n\t\t\telse\n\t\t\t {\n\t\t\t\tstack[j] = Integer.parseInt(processed[i]);\n\t\t\t\t//System.out.println(\"stack[\"+j+\"]=\"+stack[j]);\n\t\t\t\tj++;\n\t\t\t\t//for(int k = 0 ; k < j ; k++)System.out.println(\"stack[\"+k+\"]=\"+stack[k]);\n\t\t\t\t//System.out.println(\"j = \"+j);\n\t\t\t\t//System.out.println(\"\");\n\t\t\t }\n\t\t }",
"{\n\t\t\tif(processed[i].equals(\"+\"))//equals(\"\")はダブルクオーテーション\" \"の見た目と変数.equals(\" \")の変数の中身が一致すればtrue、一致しなければfalse。半角全角とかが違っても見た目同じならtrue。\n\t\t\t {\n\t\t\t\t//System.out.println(\"test\");\n\t\t\t\t//System.out.println(stack[j-1]+\" \"+stack[j]);\n\t\t\t\tstack[j-2] = stack[j-2]+stack[j-1];\n\t\t\t\t/*System.out.println(stack[j]);\n\t\t\t\tSystem.out.println(stack[j-1]);\n\t\t\t\tSystem.out.println(stack[j+1]);*/\n\t\t\t\tj--;\n\t\t\t }\n\t\t\telse if(processed[i].equals(\"-\"))\n\t\t\t {\n\t\t\t\t\n\t\t\t\tstack[j-2] = stack[j-2]-stack[j-1];\n\t\t\t\tj--;\n\t\t\t }\n\t\t\telse if(processed[i].equals(\"*\"))\n\t\t\t {\n\t\t\t\tstack[j-2] = stack[j-2] * stack[j-1];\n\t\t\t\tj--;\n\t\t\t }\n\t\t\telse if(processed[i].equals(\"/\"))\n\t\t\t {\n\t\t\t\tstack[j-2] = stack[j-2]/stack[j-1];\n\t\t\t\tj--;\n\t\t\t }\n\t\t\telse\n\t\t\t {\n\t\t\t\tstack[j] = Integer.parseInt(processed[i]);\n\t\t\t\t//System.out.println(\"stack[\"+j+\"]=\"+stack[j]);\n\t\t\t\tj++;\n\t\t\t\t//for(int k = 0 ; k < j ; k++)System.out.println(\"stack[\"+k+\"]=\"+stack[k]);\n\t\t\t\t//System.out.println(\"j = \"+j);\n\t\t\t\t//System.out.println(\"\");\n\t\t\t }\n\t\t }",
"if(processed[i].equals(\"+\"))//equals(\"\")はダブルクオーテーション\" \"の見た目と変数.equals(\" \")の変数の中身が一致すればtrue、一致しなければfalse。半角全角とかが違っても見た目同じならtrue。\n\t\t\t {\n\t\t\t\t//System.out.println(\"test\");\n\t\t\t\t//System.out.println(stack[j-1]+\" \"+stack[j]);\n\t\t\t\tstack[j-2] = stack[j-2]+stack[j-1];\n\t\t\t\t/*System.out.println(stack[j]);\n\t\t\t\tSystem.out.println(stack[j-1]);\n\t\t\t\tSystem.out.println(stack[j+1]);*/\n\t\t\t\tj--;\n\t\t\t }\n\t\t\telse if(processed[i].equals(\"-\"))\n\t\t\t {\n\t\t\t\t\n\t\t\t\tstack[j-2] = stack[j-2]-stack[j-1];\n\t\t\t\tj--;\n\t\t\t }\n\t\t\telse if(processed[i].equals(\"*\"))\n\t\t\t {\n\t\t\t\tstack[j-2] = stack[j-2] * stack[j-1];\n\t\t\t\tj--;\n\t\t\t }\n\t\t\telse if(processed[i].equals(\"/\"))\n\t\t\t {\n\t\t\t\tstack[j-2] = stack[j-2]/stack[j-1];\n\t\t\t\tj--;\n\t\t\t }\n\t\t\telse\n\t\t\t {\n\t\t\t\tstack[j] = Integer.parseInt(processed[i]);\n\t\t\t\t//System.out.println(\"stack[\"+j+\"]=\"+stack[j]);\n\t\t\t\tj++;\n\t\t\t\t//for(int k = 0 ; k < j ; k++)System.out.println(\"stack[\"+k+\"]=\"+stack[k]);\n\t\t\t\t//System.out.println(\"j = \"+j);\n\t\t\t\t//System.out.println(\"\");\n\t\t\t }",
"processed[i].equals(\"+\")",
"processed[i].equals",
"processed[i]",
"processed",
"i",
"\"+\"",
"{\n\t\t\t\t//System.out.println(\"test\");\n\t\t\t\t//System.out.println(stack[j-1]+\" \"+stack[j]);\n\t\t\t\tstack[j-2] = stack[j-2]+stack[j-1];\n\t\t\t\t/*System.out.println(stack[j]);\n\t\t\t\tSystem.out.println(stack[j-1]);\n\t\t\t\tSystem.out.println(stack[j+1]);*/\n\t\t\t\tj--;\n\t\t\t }",
"stack[j-2] = stack[j-2]+stack[j-1]",
"stack[j-2]",
"stack",
"j-2",
"j",
"2",
"stack[j-2]+stack[j-1]",
"stack[j-2]",
"stack",
"j-2",
"j",
"2",
"stack[j-1]",
"stack",
"j-1",
"j",
"1",
"j--",
"j",
"if(processed[i].equals(\"-\"))\n\t\t\t {\n\t\t\t\t\n\t\t\t\tstack[j-2] = stack[j-2]-stack[j-1];\n\t\t\t\tj--;\n\t\t\t }\n\t\t\telse if(processed[i].equals(\"*\"))\n\t\t\t {\n\t\t\t\tstack[j-2] = stack[j-2] * stack[j-1];\n\t\t\t\tj--;\n\t\t\t }\n\t\t\telse if(processed[i].equals(\"/\"))\n\t\t\t {\n\t\t\t\tstack[j-2] = stack[j-2]/stack[j-1];\n\t\t\t\tj--;\n\t\t\t }\n\t\t\telse\n\t\t\t {\n\t\t\t\tstack[j] = Integer.parseInt(processed[i]);\n\t\t\t\t//System.out.println(\"stack[\"+j+\"]=\"+stack[j]);\n\t\t\t\tj++;\n\t\t\t\t//for(int k = 0 ; k < j ; k++)System.out.println(\"stack[\"+k+\"]=\"+stack[k]);\n\t\t\t\t//System.out.println(\"j = \"+j);\n\t\t\t\t//System.out.println(\"\");\n\t\t\t }",
"processed[i].equals(\"-\")",
"processed[i].equals",
"processed[i]",
"processed",
"i",
"\"-\"",
"{\n\t\t\t\t\n\t\t\t\tstack[j-2] = stack[j-2]-stack[j-1];\n\t\t\t\tj--;\n\t\t\t }",
"stack[j-2] = stack[j-2]-stack[j-1]",
"stack[j-2]",
"stack",
"j-2",
"j",
"2",
"stack[j-2]-stack[j-1]",
"stack[j-2]",
"stack",
"j-2",
"j",
"2",
"stack[j-1]",
"stack",
"j-1",
"j",
"1",
"j--",
"j",
"if(processed[i].equals(\"*\"))\n\t\t\t {\n\t\t\t\tstack[j-2] = stack[j-2] * stack[j-1];\n\t\t\t\tj--;\n\t\t\t }\n\t\t\telse if(processed[i].equals(\"/\"))\n\t\t\t {\n\t\t\t\tstack[j-2] = stack[j-2]/stack[j-1];\n\t\t\t\tj--;\n\t\t\t }\n\t\t\telse\n\t\t\t {\n\t\t\t\tstack[j] = Integer.parseInt(processed[i]);\n\t\t\t\t//System.out.println(\"stack[\"+j+\"]=\"+stack[j]);\n\t\t\t\tj++;\n\t\t\t\t//for(int k = 0 ; k < j ; k++)System.out.println(\"stack[\"+k+\"]=\"+stack[k]);\n\t\t\t\t//System.out.println(\"j = \"+j);\n\t\t\t\t//System.out.println(\"\");\n\t\t\t }",
"processed[i].equals(\"*\")",
"processed[i].equals",
"processed[i]",
"processed",
"i",
"\"*\"",
"{\n\t\t\t\tstack[j-2] = stack[j-2] * stack[j-1];\n\t\t\t\tj--;\n\t\t\t }",
"stack[j-2] = stack[j-2] * stack[j-1]",
"stack[j-2]",
"stack",
"j-2",
"j",
"2",
"stack[j-2] * stack[j-1]",
"stack[j-2]",
"stack",
"j-2",
"j",
"2",
"stack[j-1]",
"stack",
"j-1",
"j",
"1",
"j--",
"j",
"if(processed[i].equals(\"/\"))\n\t\t\t {\n\t\t\t\tstack[j-2] = stack[j-2]/stack[j-1];\n\t\t\t\tj--;\n\t\t\t }\n\t\t\telse\n\t\t\t {\n\t\t\t\tstack[j] = Integer.parseInt(processed[i]);\n\t\t\t\t//System.out.println(\"stack[\"+j+\"]=\"+stack[j]);\n\t\t\t\tj++;\n\t\t\t\t//for(int k = 0 ; k < j ; k++)System.out.println(\"stack[\"+k+\"]=\"+stack[k]);\n\t\t\t\t//System.out.println(\"j = \"+j);\n\t\t\t\t//System.out.println(\"\");\n\t\t\t }",
"processed[i].equals(\"/\")",
"processed[i].equals",
"processed[i]",
"processed",
"i",
"\"/\"",
"{\n\t\t\t\tstack[j-2] = stack[j-2]/stack[j-1];\n\t\t\t\tj--;\n\t\t\t }",
"stack[j-2] = stack[j-2]/stack[j-1]",
"stack[j-2]",
"stack",
"j-2",
"j",
"2",
"stack[j-2]/stack[j-1]",
"stack[j-2]",
"stack",
"j-2",
"j",
"2",
"stack[j-1]",
"stack",
"j-1",
"j",
"1",
"j--",
"j",
"{\n\t\t\t\tstack[j] = Integer.parseInt(processed[i]);\n\t\t\t\t//System.out.println(\"stack[\"+j+\"]=\"+stack[j]);\n\t\t\t\tj++;\n\t\t\t\t//for(int k = 0 ; k < j ; k++)System.out.println(\"stack[\"+k+\"]=\"+stack[k]);\n\t\t\t\t//System.out.println(\"j = \"+j);\n\t\t\t\t//System.out.println(\"\");\n\t\t\t }",
"stack[j] = Integer.parseInt(processed[i])",
"stack[j]",
"stack",
"j",
"Integer.parseInt(processed[i])",
"Integer.parseInt",
"Integer",
"processed[i]",
"processed",
"i",
"j++",
"j",
"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[])
{
try
{
int stack[]=new int[100];
int j=0;
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
String str = reader.readLine();
String[] processed = str.split(" ",0);
//for(int i= 0 ; i <processed.length ; i++)System.out.println(processed[i]);
for(int i= 0 ; i <processed.length ; i++)
{
if(processed[i].equals("+"))//equals("")はダブルクオーテーション" "の見た目と変数.equals(" ")の変数の中身が一致すればtrue、一致しなければfalse。半角全角とかが違っても見た目同じならtrue。
{
//System.out.println("test");
//System.out.println(stack[j-1]+" "+stack[j]);
stack[j-2] = stack[j-2]+stack[j-1];
/*System.out.println(stack[j]);
System.out.println(stack[j-1]);
System.out.println(stack[j+1]);*/
j--;
}
else if(processed[i].equals("-"))
{
stack[j-2] = stack[j-2]-stack[j-1];
j--;
}
else if(processed[i].equals("*"))
{
stack[j-2] = stack[j-2] * stack[j-1];
j--;
}
else if(processed[i].equals("/"))
{
stack[j-2] = stack[j-2]/stack[j-1];
j--;
}
else
{
stack[j] = Integer.parseInt(processed[i]);
//System.out.println("stack["+j+"]="+stack[j]);
j++;
//for(int k = 0 ; k < j ; k++)System.out.println("stack["+k+"]="+stack[k]);
//System.out.println("j = "+j);
//System.out.println("");
}
}
//for(int i = 0 ; i< processed.length ; i++)System.out.print(processed[i]+" ");
//for(int k = 0 ; k < j ; k++)System.out.println("stack["+k+"]="+stack[k]);
System.out.println(stack[0]);
}
catch(IOException e)
{
System.out.println(e);
}
}
}
|
[
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,
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,
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,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
2,
13,
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
] | [
[
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
],
[
45,
46
],
[
46,
47
],
[
47,
48
],
[
47,
49
],
[
45,
50
],
[
44,
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
],
[
62,
64
],
[
64,
65
],
[
64,
66
],
[
51,
67
],
[
67,
68
],
[
68,
69
],
[
67,
70
],
[
44,
71
],
[
71,
72
],
[
72,
73
],
[
73,
74
],
[
74,
75
],
[
74,
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
],
[
89,
91
],
[
91,
92
],
[
91,
93
],
[
78,
94
],
[
94,
95
],
[
95,
96
],
[
94,
97
],
[
71,
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
],
[
116,
118
],
[
118,
119
],
[
118,
120
],
[
105,
121
],
[
121,
122
],
[
122,
123
],
[
121,
124
],
[
98,
125
],
[
125,
126
],
[
126,
127
],
[
127,
128
],
[
126,
129
],
[
129,
130
],
[
130,
131
],
[
129,
132
],
[
132,
133
],
[
132,
134
],
[
14,
135
],
[
135,
136
],
[
136,
137
],
[
137,
138
],
[
137,
139
],
[
135,
140
],
[
140,
141
],
[
141,
142
],
[
12,
143
],
[
143,
144
]
] | [
"import java.io.*;\nimport java.util.Arrays;\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[] str = (br.readLine()).split(\" \");\n\t\tDeque<Integer> stack = new ArrayDeque<Integer>();\n\t\tfor (int i = 0; i<str.length ; i++ ) {\n\t\t\tif (str[i].equals(\"+\")) {\n\t\t\t\tint\ta = stack.pop();\n\t\t\t\tint\tb = stack.pop();\n\t\t\t\tint\tc = a+b;\n\t\t\t\tstack.push(c);\t\n\t\t\t}else if(str[i].equals(\"-\")){\n\t\t\t\tint\ta = stack.pop();\n\t\t\t\tint\tb = stack.pop();\n\t\t\t\tint\tc = b-a;\n\t\t\t\tstack.push(c);\t\n\t\t\t}else if (str[i].equals(\"*\")) {\n\t\t\t\tint\ta = stack.pop();\n\t\t\t\tint\tb = stack.pop();\t\t\n\t\t\t\tint\tc = a*b;\n\t\t\t\tstack.push(c);\t\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.*;",
"io.*",
"java",
"import java.util.Arrays;",
"Arrays",
"java.util",
"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[] str = (br.readLine()).split(\" \");\n\t\tDeque<Integer> stack = new ArrayDeque<Integer>();\n\t\tfor (int i = 0; i<str.length ; i++ ) {\n\t\t\tif (str[i].equals(\"+\")) {\n\t\t\t\tint\ta = stack.pop();\n\t\t\t\tint\tb = stack.pop();\n\t\t\t\tint\tc = a+b;\n\t\t\t\tstack.push(c);\t\n\t\t\t}else if(str[i].equals(\"-\")){\n\t\t\t\tint\ta = stack.pop();\n\t\t\t\tint\tb = stack.pop();\n\t\t\t\tint\tc = b-a;\n\t\t\t\tstack.push(c);\t\n\t\t\t}else if (str[i].equals(\"*\")) {\n\t\t\t\tint\ta = stack.pop();\n\t\t\t\tint\tb = stack.pop();\t\t\n\t\t\t\tint\tc = a*b;\n\t\t\t\tstack.push(c);\t\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 IOException{\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tString[] str = (br.readLine()).split(\" \");\n\t\tDeque<Integer> stack = new ArrayDeque<Integer>();\n\t\tfor (int i = 0; i<str.length ; i++ ) {\n\t\t\tif (str[i].equals(\"+\")) {\n\t\t\t\tint\ta = stack.pop();\n\t\t\t\tint\tb = stack.pop();\n\t\t\t\tint\tc = a+b;\n\t\t\t\tstack.push(c);\t\n\t\t\t}else if(str[i].equals(\"-\")){\n\t\t\t\tint\ta = stack.pop();\n\t\t\t\tint\tb = stack.pop();\n\t\t\t\tint\tc = b-a;\n\t\t\t\tstack.push(c);\t\n\t\t\t}else if (str[i].equals(\"*\")) {\n\t\t\t\tint\ta = stack.pop();\n\t\t\t\tint\tb = stack.pop();\t\t\n\t\t\t\tint\tc = a*b;\n\t\t\t\tstack.push(c);\t\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\tDeque<Integer> stack = new ArrayDeque<Integer>();\n\t\tfor (int i = 0; i<str.length ; i++ ) {\n\t\t\tif (str[i].equals(\"+\")) {\n\t\t\t\tint\ta = stack.pop();\n\t\t\t\tint\tb = stack.pop();\n\t\t\t\tint\tc = a+b;\n\t\t\t\tstack.push(c);\t\n\t\t\t}else if(str[i].equals(\"-\")){\n\t\t\t\tint\ta = stack.pop();\n\t\t\t\tint\tb = stack.pop();\n\t\t\t\tint\tc = b-a;\n\t\t\t\tstack.push(c);\t\n\t\t\t}else if (str[i].equals(\"*\")) {\n\t\t\t\tint\ta = stack.pop();\n\t\t\t\tint\tb = stack.pop();\t\t\n\t\t\t\tint\tc = a*b;\n\t\t\t\tstack.push(c);\t\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",
"\" \"",
"Deque<Integer> stack = new ArrayDeque<Integer>();",
"stack",
"new ArrayDeque<Integer>()",
"for (int i = 0; i<str.length ; i++ ) {\n\t\t\tif (str[i].equals(\"+\")) {\n\t\t\t\tint\ta = stack.pop();\n\t\t\t\tint\tb = stack.pop();\n\t\t\t\tint\tc = a+b;\n\t\t\t\tstack.push(c);\t\n\t\t\t}else if(str[i].equals(\"-\")){\n\t\t\t\tint\ta = stack.pop();\n\t\t\t\tint\tb = stack.pop();\n\t\t\t\tint\tc = b-a;\n\t\t\t\tstack.push(c);\t\n\t\t\t}else if (str[i].equals(\"*\")) {\n\t\t\t\tint\ta = stack.pop();\n\t\t\t\tint\tb = stack.pop();\t\t\n\t\t\t\tint\tc = a*b;\n\t\t\t\tstack.push(c);\t\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\tint\ta = stack.pop();\n\t\t\t\tint\tb = stack.pop();\n\t\t\t\tint\tc = a+b;\n\t\t\t\tstack.push(c);\t\n\t\t\t}else if(str[i].equals(\"-\")){\n\t\t\t\tint\ta = stack.pop();\n\t\t\t\tint\tb = stack.pop();\n\t\t\t\tint\tc = b-a;\n\t\t\t\tstack.push(c);\t\n\t\t\t}else if (str[i].equals(\"*\")) {\n\t\t\t\tint\ta = stack.pop();\n\t\t\t\tint\tb = stack.pop();\t\t\n\t\t\t\tint\tc = a*b;\n\t\t\t\tstack.push(c);\t\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\tint\ta = stack.pop();\n\t\t\t\tint\tb = stack.pop();\n\t\t\t\tint\tc = a+b;\n\t\t\t\tstack.push(c);\t\n\t\t\t}else if(str[i].equals(\"-\")){\n\t\t\t\tint\ta = stack.pop();\n\t\t\t\tint\tb = stack.pop();\n\t\t\t\tint\tc = b-a;\n\t\t\t\tstack.push(c);\t\n\t\t\t}else if (str[i].equals(\"*\")) {\n\t\t\t\tint\ta = stack.pop();\n\t\t\t\tint\tb = stack.pop();\t\t\n\t\t\t\tint\tc = a*b;\n\t\t\t\tstack.push(c);\t\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\tint\ta = stack.pop();\n\t\t\t\tint\tb = stack.pop();\n\t\t\t\tint\tc = a+b;\n\t\t\t\tstack.push(c);\t\n\t\t\t}else if(str[i].equals(\"-\")){\n\t\t\t\tint\ta = stack.pop();\n\t\t\t\tint\tb = stack.pop();\n\t\t\t\tint\tc = b-a;\n\t\t\t\tstack.push(c);\t\n\t\t\t}else if (str[i].equals(\"*\")) {\n\t\t\t\tint\ta = stack.pop();\n\t\t\t\tint\tb = stack.pop();\t\t\n\t\t\t\tint\tc = a*b;\n\t\t\t\tstack.push(c);\t\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\ta = stack.pop();\n\t\t\t\tint\tb = stack.pop();\n\t\t\t\tint\tc = a+b;\n\t\t\t\tstack.push(c);\t\n\t\t\t}",
"int\ta = stack.pop();",
"a",
"stack.pop()",
"stack.pop",
"stack",
"int\tb = stack.pop();",
"b",
"stack.pop()",
"stack.pop",
"stack",
"int\tc = a+b;",
"c",
"a+b",
"a",
"b",
"stack.push(c)",
"stack.push",
"stack",
"c",
"if(str[i].equals(\"-\")){\n\t\t\t\tint\ta = stack.pop();\n\t\t\t\tint\tb = stack.pop();\n\t\t\t\tint\tc = b-a;\n\t\t\t\tstack.push(c);\t\n\t\t\t}else if (str[i].equals(\"*\")) {\n\t\t\t\tint\ta = stack.pop();\n\t\t\t\tint\tb = stack.pop();\t\t\n\t\t\t\tint\tc = a*b;\n\t\t\t\tstack.push(c);\t\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\ta = stack.pop();\n\t\t\t\tint\tb = stack.pop();\n\t\t\t\tint\tc = b-a;\n\t\t\t\tstack.push(c);\t\n\t\t\t}",
"int\ta = stack.pop();",
"a",
"stack.pop()",
"stack.pop",
"stack",
"int\tb = stack.pop();",
"b",
"stack.pop()",
"stack.pop",
"stack",
"int\tc = b-a;",
"c",
"b-a",
"b",
"a",
"stack.push(c)",
"stack.push",
"stack",
"c",
"if (str[i].equals(\"*\")) {\n\t\t\t\tint\ta = stack.pop();\n\t\t\t\tint\tb = stack.pop();\t\t\n\t\t\t\tint\tc = a*b;\n\t\t\t\tstack.push(c);\t\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\ta = stack.pop();\n\t\t\t\tint\tb = stack.pop();\t\t\n\t\t\t\tint\tc = a*b;\n\t\t\t\tstack.push(c);\t\n\t\t\t}",
"int\ta = stack.pop();",
"a",
"stack.pop()",
"stack.pop",
"stack",
"int\tb = stack.pop();",
"b",
"stack.pop()",
"stack.pop",
"stack",
"int\tc = a*b;",
"c",
"a*b",
"a",
"b",
"stack.push(c)",
"stack.push",
"stack",
"c",
"{\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.*;
import java.util.Arrays;
import java.util.*;
class Main{
public static void main(String[] args) throws IOException{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String[] str = (br.readLine()).split(" ");
Deque<Integer> stack = new ArrayDeque<Integer>();
for (int i = 0; i<str.length ; i++ ) {
if (str[i].equals("+")) {
int a = stack.pop();
int b = stack.pop();
int c = a+b;
stack.push(c);
}else if(str[i].equals("-")){
int a = stack.pop();
int b = stack.pop();
int c = b-a;
stack.push(c);
}else if (str[i].equals("*")) {
int a = stack.pop();
int b = stack.pop();
int c = a*b;
stack.push(c);
}else{
stack.push(Integer.parseInt(str[i]));
}
}
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,
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,
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
],
[
148,
14
],
[
148,
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
],
[
128,
131
],
[
131,
132
],
[
132,
133
],
[
131,
134
],
[
134,
135
],
[
134,
136
],
[
17,
137
],
[
137,
138
],
[
138,
139
],
[
139,
140
],
[
139,
141
],
[
137,
142
],
[
142,
143
],
[
143,
144
],
[
15,
145
],
[
145,
146
],
[
0,
147
],
[
147,
148
],
[
147,
149
]
] | [
"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 \t\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n String[] inputArray = br.readLine().split(\" \");\n \n Stack<Integer> stack = new Stack<Integer>();\n int a = 0;\n int b = 0;\n \n for (int i = 0; i < inputArray.length; i++) {\n if (inputArray[i].equals(\"+\")) {\n a = stack.pop();\n b = stack.pop();\n stack.add(b + a);\n continue;\n }\n \n if (inputArray[i].equals(\"-\")) {\n a = stack.pop();\n b = stack.pop();\n stack.add(b - a);\n continue;\n }\n \n if (inputArray[i].equals(\"*\")) {\n a = stack.pop();\n b = stack.pop();\n stack.add(b * a);\n continue;\n }\n \n stack.push(Integer.parseInt(inputArray[i]));\n }\n System.out.println(stack.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 \t\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n String[] inputArray = br.readLine().split(\" \");\n \n Stack<Integer> stack = new Stack<Integer>();\n int a = 0;\n int b = 0;\n \n for (int i = 0; i < inputArray.length; i++) {\n if (inputArray[i].equals(\"+\")) {\n a = stack.pop();\n b = stack.pop();\n stack.add(b + a);\n continue;\n }\n \n if (inputArray[i].equals(\"-\")) {\n a = stack.pop();\n b = stack.pop();\n stack.add(b - a);\n continue;\n }\n \n if (inputArray[i].equals(\"*\")) {\n a = stack.pop();\n b = stack.pop();\n stack.add(b * a);\n continue;\n }\n \n stack.push(Integer.parseInt(inputArray[i]));\n }\n System.out.println(stack.pop());\n }\n}",
"Main",
"public static void main(String args[]) throws IOException {\n \t\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n String[] inputArray = br.readLine().split(\" \");\n \n Stack<Integer> stack = new Stack<Integer>();\n int a = 0;\n int b = 0;\n \n for (int i = 0; i < inputArray.length; i++) {\n if (inputArray[i].equals(\"+\")) {\n a = stack.pop();\n b = stack.pop();\n stack.add(b + a);\n continue;\n }\n \n if (inputArray[i].equals(\"-\")) {\n a = stack.pop();\n b = stack.pop();\n stack.add(b - a);\n continue;\n }\n \n if (inputArray[i].equals(\"*\")) {\n a = stack.pop();\n b = stack.pop();\n stack.add(b * a);\n continue;\n }\n \n stack.push(Integer.parseInt(inputArray[i]));\n }\n System.out.println(stack.pop());\n }",
"main",
"{\n \t\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n String[] inputArray = br.readLine().split(\" \");\n \n Stack<Integer> stack = new Stack<Integer>();\n int a = 0;\n int b = 0;\n \n for (int i = 0; i < inputArray.length; i++) {\n if (inputArray[i].equals(\"+\")) {\n a = stack.pop();\n b = stack.pop();\n stack.add(b + a);\n continue;\n }\n \n if (inputArray[i].equals(\"-\")) {\n a = stack.pop();\n b = stack.pop();\n stack.add(b - a);\n continue;\n }\n \n if (inputArray[i].equals(\"*\")) {\n a = stack.pop();\n b = stack.pop();\n stack.add(b * a);\n continue;\n }\n \n stack.push(Integer.parseInt(inputArray[i]));\n }\n System.out.println(stack.pop());\n }",
"BufferedReader br = new BufferedReader(new InputStreamReader(System.in));",
"br",
"new BufferedReader(new InputStreamReader(System.in))",
"String[] inputArray = br.readLine().split(\" \");",
"inputArray",
"br.readLine().split(\" \")",
"br.readLine().split",
"br.readLine()",
"br.readLine",
"br",
"\" \"",
"Stack<Integer> stack = new Stack<Integer>();",
"stack",
"new Stack<Integer>()",
"int a = 0;",
"a",
"0",
"int b = 0;",
"b",
"0",
"for (int i = 0; i < inputArray.length; i++) {\n if (inputArray[i].equals(\"+\")) {\n a = stack.pop();\n b = stack.pop();\n stack.add(b + a);\n continue;\n }\n \n if (inputArray[i].equals(\"-\")) {\n a = stack.pop();\n b = stack.pop();\n stack.add(b - a);\n continue;\n }\n \n if (inputArray[i].equals(\"*\")) {\n a = stack.pop();\n b = stack.pop();\n stack.add(b * a);\n continue;\n }\n \n stack.push(Integer.parseInt(inputArray[i]));\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < inputArray.length",
"i",
"inputArray.length",
"inputArray",
"inputArray.length",
"i++",
"i++",
"i",
"{\n if (inputArray[i].equals(\"+\")) {\n a = stack.pop();\n b = stack.pop();\n stack.add(b + a);\n continue;\n }\n \n if (inputArray[i].equals(\"-\")) {\n a = stack.pop();\n b = stack.pop();\n stack.add(b - a);\n continue;\n }\n \n if (inputArray[i].equals(\"*\")) {\n a = stack.pop();\n b = stack.pop();\n stack.add(b * a);\n continue;\n }\n \n stack.push(Integer.parseInt(inputArray[i]));\n }",
"{\n if (inputArray[i].equals(\"+\")) {\n a = stack.pop();\n b = stack.pop();\n stack.add(b + a);\n continue;\n }\n \n if (inputArray[i].equals(\"-\")) {\n a = stack.pop();\n b = stack.pop();\n stack.add(b - a);\n continue;\n }\n \n if (inputArray[i].equals(\"*\")) {\n a = stack.pop();\n b = stack.pop();\n stack.add(b * a);\n continue;\n }\n \n stack.push(Integer.parseInt(inputArray[i]));\n }",
"if (inputArray[i].equals(\"+\")) {\n a = stack.pop();\n b = stack.pop();\n stack.add(b + a);\n continue;\n }",
"inputArray[i].equals(\"+\")",
"inputArray[i].equals",
"inputArray[i]",
"inputArray",
"i",
"\"+\"",
"{\n a = stack.pop();\n b = stack.pop();\n stack.add(b + a);\n continue;\n }",
"a = stack.pop()",
"a",
"stack.pop()",
"stack.pop",
"stack",
"b = stack.pop()",
"b",
"stack.pop()",
"stack.pop",
"stack",
"stack.add(b + a)",
"stack.add",
"stack",
"b + a",
"b",
"a",
"continue;",
"if (inputArray[i].equals(\"-\")) {\n a = stack.pop();\n b = stack.pop();\n stack.add(b - a);\n continue;\n }",
"inputArray[i].equals(\"-\")",
"inputArray[i].equals",
"inputArray[i]",
"inputArray",
"i",
"\"-\"",
"{\n a = stack.pop();\n b = stack.pop();\n stack.add(b - a);\n continue;\n }",
"a = stack.pop()",
"a",
"stack.pop()",
"stack.pop",
"stack",
"b = stack.pop()",
"b",
"stack.pop()",
"stack.pop",
"stack",
"stack.add(b - a)",
"stack.add",
"stack",
"b - a",
"b",
"a",
"continue;",
"if (inputArray[i].equals(\"*\")) {\n a = stack.pop();\n b = stack.pop();\n stack.add(b * a);\n continue;\n }",
"inputArray[i].equals(\"*\")",
"inputArray[i].equals",
"inputArray[i]",
"inputArray",
"i",
"\"*\"",
"{\n a = stack.pop();\n b = stack.pop();\n stack.add(b * a);\n continue;\n }",
"a = stack.pop()",
"a",
"stack.pop()",
"stack.pop",
"stack",
"b = stack.pop()",
"b",
"stack.pop()",
"stack.pop",
"stack",
"stack.add(b * a)",
"stack.add",
"stack",
"b * a",
"b",
"a",
"continue;",
"stack.push(Integer.parseInt(inputArray[i]))",
"stack.push",
"stack",
"Integer.parseInt(inputArray[i])",
"Integer.parseInt",
"Integer",
"inputArray[i]",
"inputArray",
"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\n public static void main(String args[]) throws IOException {\n \t\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n String[] inputArray = br.readLine().split(\" \");\n \n Stack<Integer> stack = new Stack<Integer>();\n int a = 0;\n int b = 0;\n \n for (int i = 0; i < inputArray.length; i++) {\n if (inputArray[i].equals(\"+\")) {\n a = stack.pop();\n b = stack.pop();\n stack.add(b + a);\n continue;\n }\n \n if (inputArray[i].equals(\"-\")) {\n a = stack.pop();\n b = stack.pop();\n stack.add(b - a);\n continue;\n }\n \n if (inputArray[i].equals(\"*\")) {\n a = stack.pop();\n b = stack.pop();\n stack.add(b * a);\n continue;\n }\n \n stack.push(Integer.parseInt(inputArray[i]));\n }\n System.out.println(stack.pop());\n }\n}",
"public class Main {\n\n public static void main(String args[]) throws IOException {\n \t\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n String[] inputArray = br.readLine().split(\" \");\n \n Stack<Integer> stack = new Stack<Integer>();\n int a = 0;\n int b = 0;\n \n for (int i = 0; i < inputArray.length; i++) {\n if (inputArray[i].equals(\"+\")) {\n a = stack.pop();\n b = stack.pop();\n stack.add(b + a);\n continue;\n }\n \n if (inputArray[i].equals(\"-\")) {\n a = stack.pop();\n b = stack.pop();\n stack.add(b - a);\n continue;\n }\n \n if (inputArray[i].equals(\"*\")) {\n a = stack.pop();\n b = stack.pop();\n stack.add(b * a);\n continue;\n }\n \n stack.push(Integer.parseInt(inputArray[i]));\n }\n System.out.println(stack.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[] inputArray = br.readLine().split(" ");
Stack<Integer> stack = new Stack<Integer>();
int a = 0;
int b = 0;
for (int i = 0; i < inputArray.length; i++) {
if (inputArray[i].equals("+")) {
a = stack.pop();
b = stack.pop();
stack.add(b + a);
continue;
}
if (inputArray[i].equals("-")) {
a = stack.pop();
b = stack.pop();
stack.add(b - a);
continue;
}
if (inputArray[i].equals("*")) {
a = stack.pop();
b = stack.pop();
stack.add(b * a);
continue;
}
stack.push(Integer.parseInt(inputArray[i]));
}
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,
20,
42,
4,
18,
13,
30,
41,
13,
17,
41,
13,
17,
14,
4,
18,
13,
30,
0,
13,
4,
18,
13,
4,
18,
13,
13,
30,
0,
13,
4,
18,
13,
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,
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
],
[
105,
11
],
[
105,
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
],
[
25,
29
],
[
29,
30
],
[
29,
31
],
[
25,
32
],
[
32,
33
],
[
33,
34
],
[
34,
35
],
[
32,
36
],
[
36,
37
],
[
37,
38
],
[
37,
39
],
[
39,
40
],
[
40,
41
],
[
36,
42
],
[
42,
43
],
[
43,
44
],
[
42,
45
],
[
32,
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
],
[
60,
61
],
[
46,
62
],
[
62,
63
],
[
62,
64
],
[
64,
65
],
[
64,
66
],
[
66,
67
],
[
67,
68
],
[
68,
69
],
[
67,
70
],
[
70,
71
],
[
70,
72
],
[
66,
73
],
[
62,
74
],
[
74,
75
],
[
74,
76
],
[
76,
77
],
[
77,
78
],
[
78,
79
],
[
77,
80
],
[
80,
81
],
[
80,
82
],
[
76,
83
],
[
62,
84
],
[
84,
85
],
[
84,
86
],
[
86,
87
],
[
87,
88
],
[
88,
89
],
[
87,
90
],
[
90,
91
],
[
90,
92
],
[
86,
93
],
[
14,
94
],
[
94,
95
],
[
95,
96
],
[
96,
97
],
[
96,
98
],
[
94,
99
],
[
99,
100
],
[
100,
101
],
[
12,
102
],
[
102,
103
],
[
0,
104
],
[
104,
105
],
[
104,
106
]
] | [
"import java.util.ArrayDeque;\nimport java.util.Deque;\nimport java.util.Scanner;\n\npublic class Main {\n\tpublic static void main(String[] args) {\n\n\t\t// Dequeはインターフェースなので、実装クラスのArrayDequeで実装\n\t\tDeque<Integer> stack = new ArrayDeque<>();\n\t\tScanner sc = new Scanner(System.in);\n\n\t\twhile (sc.hasNext()) {\n\t\t\tint curNum = 0;\n\t\t\tString curStr = \"\";\n\t\t\tif (sc.hasNextInt()) {\n\t\t\t\tcurNum = sc.nextInt();\n\t\t\t\tstack.push(curNum);\n\t\t\t} else {\n\t\t\t\tcurStr = sc.next();\n\t\t\t\tint a = stack.pop();\n\t\t\t\tint b = stack.pop();\n\t\t\t\tswitch (curStr) {\n\t\t\t\tcase \"+\":\n\t\t\t\t\tstack.push(b + a);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"-\":\n\t\t\t\t\tstack.push(b - a);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"*\":\n\t\t\t\t\tstack.push(b * a);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\t\tSystem.out.println(stack.pop());\n\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\tpublic static void main(String[] args) {\n\n\t\t// Dequeはインターフェースなので、実装クラスのArrayDequeで実装\n\t\tDeque<Integer> stack = new ArrayDeque<>();\n\t\tScanner sc = new Scanner(System.in);\n\n\t\twhile (sc.hasNext()) {\n\t\t\tint curNum = 0;\n\t\t\tString curStr = \"\";\n\t\t\tif (sc.hasNextInt()) {\n\t\t\t\tcurNum = sc.nextInt();\n\t\t\t\tstack.push(curNum);\n\t\t\t} else {\n\t\t\t\tcurStr = sc.next();\n\t\t\t\tint a = stack.pop();\n\t\t\t\tint b = stack.pop();\n\t\t\t\tswitch (curStr) {\n\t\t\t\tcase \"+\":\n\t\t\t\t\tstack.push(b + a);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"-\":\n\t\t\t\t\tstack.push(b - a);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"*\":\n\t\t\t\t\tstack.push(b * a);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\t\tSystem.out.println(stack.pop());\n\n\t}\n\n}",
"Main",
"public static void main(String[] args) {\n\n\t\t// Dequeはインターフェースなので、実装クラスのArrayDequeで実装\n\t\tDeque<Integer> stack = new ArrayDeque<>();\n\t\tScanner sc = new Scanner(System.in);\n\n\t\twhile (sc.hasNext()) {\n\t\t\tint curNum = 0;\n\t\t\tString curStr = \"\";\n\t\t\tif (sc.hasNextInt()) {\n\t\t\t\tcurNum = sc.nextInt();\n\t\t\t\tstack.push(curNum);\n\t\t\t} else {\n\t\t\t\tcurStr = sc.next();\n\t\t\t\tint a = stack.pop();\n\t\t\t\tint b = stack.pop();\n\t\t\t\tswitch (curStr) {\n\t\t\t\tcase \"+\":\n\t\t\t\t\tstack.push(b + a);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"-\":\n\t\t\t\t\tstack.push(b - a);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"*\":\n\t\t\t\t\tstack.push(b * a);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\t\tSystem.out.println(stack.pop());\n\n\t}",
"main",
"{\n\n\t\t// Dequeはインターフェースなので、実装クラスのArrayDequeで実装\n\t\tDeque<Integer> stack = new ArrayDeque<>();\n\t\tScanner sc = new Scanner(System.in);\n\n\t\twhile (sc.hasNext()) {\n\t\t\tint curNum = 0;\n\t\t\tString curStr = \"\";\n\t\t\tif (sc.hasNextInt()) {\n\t\t\t\tcurNum = sc.nextInt();\n\t\t\t\tstack.push(curNum);\n\t\t\t} else {\n\t\t\t\tcurStr = sc.next();\n\t\t\t\tint a = stack.pop();\n\t\t\t\tint b = stack.pop();\n\t\t\t\tswitch (curStr) {\n\t\t\t\tcase \"+\":\n\t\t\t\t\tstack.push(b + a);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"-\":\n\t\t\t\t\tstack.push(b - a);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"*\":\n\t\t\t\t\tstack.push(b * a);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\t\tSystem.out.println(stack.pop());\n\n\t}",
"Deque<Integer> stack = new ArrayDeque<>();",
"stack",
"new ArrayDeque<>()",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"while (sc.hasNext()) {\n\t\t\tint curNum = 0;\n\t\t\tString curStr = \"\";\n\t\t\tif (sc.hasNextInt()) {\n\t\t\t\tcurNum = sc.nextInt();\n\t\t\t\tstack.push(curNum);\n\t\t\t} else {\n\t\t\t\tcurStr = sc.next();\n\t\t\t\tint a = stack.pop();\n\t\t\t\tint b = stack.pop();\n\t\t\t\tswitch (curStr) {\n\t\t\t\tcase \"+\":\n\t\t\t\t\tstack.push(b + a);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"-\":\n\t\t\t\t\tstack.push(b - a);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"*\":\n\t\t\t\t\tstack.push(b * a);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t}",
"sc.hasNext()",
"sc.hasNext",
"sc",
"{\n\t\t\tint curNum = 0;\n\t\t\tString curStr = \"\";\n\t\t\tif (sc.hasNextInt()) {\n\t\t\t\tcurNum = sc.nextInt();\n\t\t\t\tstack.push(curNum);\n\t\t\t} else {\n\t\t\t\tcurStr = sc.next();\n\t\t\t\tint a = stack.pop();\n\t\t\t\tint b = stack.pop();\n\t\t\t\tswitch (curStr) {\n\t\t\t\tcase \"+\":\n\t\t\t\t\tstack.push(b + a);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"-\":\n\t\t\t\t\tstack.push(b - a);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"*\":\n\t\t\t\t\tstack.push(b * a);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t}",
"int curNum = 0;",
"curNum",
"0",
"String curStr = \"\";",
"curStr",
"\"\"",
"if (sc.hasNextInt()) {\n\t\t\t\tcurNum = sc.nextInt();\n\t\t\t\tstack.push(curNum);\n\t\t\t} else {\n\t\t\t\tcurStr = sc.next();\n\t\t\t\tint a = stack.pop();\n\t\t\t\tint b = stack.pop();\n\t\t\t\tswitch (curStr) {\n\t\t\t\tcase \"+\":\n\t\t\t\t\tstack.push(b + a);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"-\":\n\t\t\t\t\tstack.push(b - a);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"*\":\n\t\t\t\t\tstack.push(b * a);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}",
"sc.hasNextInt()",
"sc.hasNextInt",
"sc",
"{\n\t\t\t\tcurNum = sc.nextInt();\n\t\t\t\tstack.push(curNum);\n\t\t\t}",
"curNum = sc.nextInt()",
"curNum",
"sc.nextInt()",
"sc.nextInt",
"sc",
"stack.push(curNum)",
"stack.push",
"stack",
"curNum",
"{\n\t\t\t\tcurStr = sc.next();\n\t\t\t\tint a = stack.pop();\n\t\t\t\tint b = stack.pop();\n\t\t\t\tswitch (curStr) {\n\t\t\t\tcase \"+\":\n\t\t\t\t\tstack.push(b + a);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"-\":\n\t\t\t\t\tstack.push(b - a);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"*\":\n\t\t\t\t\tstack.push(b * a);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}",
"curStr = sc.next()",
"curStr",
"sc.next()",
"sc.next",
"sc",
"int a = stack.pop();",
"a",
"stack.pop()",
"stack.pop",
"stack",
"int b = stack.pop();",
"b",
"stack.pop()",
"stack.pop",
"stack",
"switch (curStr) {\n\t\t\t\tcase \"+\":\n\t\t\t\t\tstack.push(b + a);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"-\":\n\t\t\t\t\tstack.push(b - a);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"*\":\n\t\t\t\t\tstack.push(b * a);\n\t\t\t\t\tbreak;\n\t\t\t\t}",
"curStr",
"case \"+\":",
"\"+\"",
"case \"+\":",
"stack.push(b + a)",
"stack.push",
"stack",
"b + a",
"b",
"a",
"break;",
"case \"-\":",
"\"-\"",
"case \"-\":",
"stack.push(b - a)",
"stack.push",
"stack",
"b - a",
"b",
"a",
"break;",
"case \"*\":",
"\"*\"",
"case \"*\":",
"stack.push(b * a)",
"stack.push",
"stack",
"b * a",
"b",
"a",
"break;",
"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\n\t\t// Dequeはインターフェースなので、実装クラスのArrayDequeで実装\n\t\tDeque<Integer> stack = new ArrayDeque<>();\n\t\tScanner sc = new Scanner(System.in);\n\n\t\twhile (sc.hasNext()) {\n\t\t\tint curNum = 0;\n\t\t\tString curStr = \"\";\n\t\t\tif (sc.hasNextInt()) {\n\t\t\t\tcurNum = sc.nextInt();\n\t\t\t\tstack.push(curNum);\n\t\t\t} else {\n\t\t\t\tcurStr = sc.next();\n\t\t\t\tint a = stack.pop();\n\t\t\t\tint b = stack.pop();\n\t\t\t\tswitch (curStr) {\n\t\t\t\tcase \"+\":\n\t\t\t\t\tstack.push(b + a);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"-\":\n\t\t\t\t\tstack.push(b - a);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"*\":\n\t\t\t\t\tstack.push(b * a);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\t\tSystem.out.println(stack.pop());\n\n\t}\n\n}",
"public class Main {\n\tpublic static void main(String[] args) {\n\n\t\t// Dequeはインターフェースなので、実装クラスのArrayDequeで実装\n\t\tDeque<Integer> stack = new ArrayDeque<>();\n\t\tScanner sc = new Scanner(System.in);\n\n\t\twhile (sc.hasNext()) {\n\t\t\tint curNum = 0;\n\t\t\tString curStr = \"\";\n\t\t\tif (sc.hasNextInt()) {\n\t\t\t\tcurNum = sc.nextInt();\n\t\t\t\tstack.push(curNum);\n\t\t\t} else {\n\t\t\t\tcurStr = sc.next();\n\t\t\t\tint a = stack.pop();\n\t\t\t\tint b = stack.pop();\n\t\t\t\tswitch (curStr) {\n\t\t\t\tcase \"+\":\n\t\t\t\t\tstack.push(b + a);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"-\":\n\t\t\t\t\tstack.push(b - a);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"*\":\n\t\t\t\t\tstack.push(b * a);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\t\tSystem.out.println(stack.pop());\n\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) {
// Dequeはインターフェースなので、実装クラスのArrayDequeで実装
Deque<Integer> stack = new ArrayDeque<>();
Scanner sc = new Scanner(System.in);
while (sc.hasNext()) {
int curNum = 0;
String curStr = "";
if (sc.hasNextInt()) {
curNum = sc.nextInt();
stack.push(curNum);
} else {
curStr = sc.next();
int a = stack.pop();
int b = stack.pop();
switch (curStr) {
case "+":
stack.push(b + a);
break;
case "-":
stack.push(b - a);
break;
case "*":
stack.push(b * a);
break;
}
}
}
System.out.println(stack.pop());
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
4,
13,
13,
4,
18,
13,
23,
13,
12,
13,
30,
41,
13,
4,
18,
13,
28,
13,
13,
30,
30,
14,
2,
4,
18,
13,
13,
30,
29,
13,
29,
17,
23,
13,
12,
13,
30,
41,
13,
41,
13,
41,
13,
20,
17,
41,
13,
17,
41,
13,
17,
41,
13,
41,
13,
20,
17,
42,
4,
18,
13,
30,
0,
13,
4,
18,
13,
38,
5,
13,
30,
4,
18,
13,
30,
0,
13,
4,
18,
13,
17,
0,
13,
18,
13,
17,
14,
2,
2,
13,
17,
2,
13,
17,
30,
0,
18,
13,
13,
4,
18,
13,
13,
40,
13,
30,
0,
13,
17,
14,
2,
13,
17,
30,
35,
4,
13,
13,
34,
13,
1,
0,
18,
13,
13,
2,
18,
13,
13,
18,
13,
2,
13,
17,
40,
13,
3,
34,
13,
1,
0,
18,
13,
13,
2,
18,
13,
13,
18,
13,
2,
13,
17,
40,
13,
3,
34,
13,
1,
0,
18,
13,
13,
2,
18,
13,
13,
18,
13,
2,
13,
17,
40,
13,
30,
3,
40,
13,
4,
18,
18,
13,
13,
18,
13,
17,
23,
13,
6,
13,
41,
13,
41,
13,
41,
13,
41,
13,
12,
13,
30,
0,
18,
36,
13,
13,
23,
13,
12,
13,
30,
29,
18,
36,
13,
12,
12
] | [
[
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
],
[
8,
15
],
[
15,
16
],
[
16,
17
],
[
6,
18
],
[
18,
19
],
[
4,
20
],
[
20,
21
],
[
20,
22
],
[
22,
23
],
[
23,
24
],
[
23,
25
],
[
25,
26
],
[
26,
27
],
[
22,
28
],
[
28,
29
],
[
28,
30
],
[
28,
31
],
[
32,
32
],
[
32,
33
],
[
33,
34
],
[
34,
35
],
[
35,
36
],
[
36,
37
],
[
34,
38
],
[
33,
39
],
[
39,
40
],
[
40,
41
],
[
22,
42
],
[
42,
43
],
[
20,
44
],
[
44,
45
],
[
4,
46
],
[
46,
47
],
[
46,
48
],
[
48,
49
],
[
49,
50
],
[
48,
51
],
[
51,
52
],
[
48,
53
],
[
53,
54
],
[
53,
55
],
[
48,
57
],
[
57,
58
],
[
57,
59
],
[
48,
60
],
[
60,
61
],
[
60,
62
],
[
48,
63
],
[
63,
64
],
[
48,
65
],
[
65,
66
],
[
65,
67
],
[
48,
69
],
[
69,
70
],
[
70,
71
],
[
71,
72
],
[
69,
73
],
[
73,
74
],
[
74,
75
],
[
74,
76
],
[
76,
77
],
[
77,
78
],
[
73,
79
],
[
79,
80
],
[
80,
81
],
[
80,
82
],
[
82,
83
],
[
83,
84
],
[
84,
85
],
[
79,
86
],
[
86,
87
],
[
87,
88
],
[
87,
89
],
[
89,
90
],
[
90,
91
],
[
89,
92
],
[
73,
93
],
[
93,
94
],
[
93,
95
],
[
95,
96
],
[
95,
97
],
[
73,
98
],
[
98,
99
],
[
99,
100
],
[
100,
101
],
[
100,
102
],
[
99,
103
],
[
103,
104
],
[
103,
105
],
[
98,
106
],
[
106,
107
],
[
107,
108
],
[
108,
109
],
[
108,
110
],
[
107,
111
],
[
111,
112
],
[
112,
113
],
[
111,
114
],
[
106,
115
],
[
115,
116
],
[
98,
117
],
[
117,
118
],
[
118,
119
],
[
118,
120
],
[
117,
121
],
[
121,
122
],
[
122,
123
],
[
122,
124
],
[
121,
125
],
[
125,
126
],
[
126,
127
],
[
127,
128
],
[
127,
129
],
[
126,
130
],
[
130,
131
],
[
130,
132
],
[
132,
133
],
[
133,
134
],
[
134,
135
],
[
134,
136
],
[
133,
137
],
[
137,
138
],
[
138,
139
],
[
138,
140
],
[
137,
141
],
[
141,
142
],
[
141,
143
],
[
143,
144
],
[
143,
145
],
[
132,
146
],
[
146,
147
],
[
132,
148
],
[
126,
149
],
[
149,
150
],
[
149,
151
],
[
151,
152
],
[
152,
153
],
[
153,
154
],
[
153,
155
],
[
152,
156
],
[
156,
157
],
[
157,
158
],
[
157,
159
],
[
156,
160
],
[
160,
161
],
[
160,
162
],
[
162,
163
],
[
162,
164
],
[
151,
165
],
[
165,
166
],
[
151,
167
],
[
126,
168
],
[
168,
169
],
[
168,
170
],
[
170,
171
],
[
171,
172
],
[
172,
173
],
[
172,
174
],
[
171,
175
],
[
175,
176
],
[
176,
177
],
[
176,
178
],
[
175,
179
],
[
179,
180
],
[
179,
181
],
[
181,
182
],
[
181,
183
],
[
170,
184
],
[
184,
185
],
[
121,
186
],
[
186,
187
],
[
117,
188
],
[
188,
189
],
[
48,
190
],
[
190,
191
],
[
191,
192
],
[
192,
193
],
[
192,
194
],
[
190,
195
],
[
195,
196
],
[
195,
197
],
[
46,
198
],
[
198,
199
],
[
4,
200
],
[
200,
201
],
[
200,
202
],
[
202,
203
],
[
200,
204
],
[
204,
205
],
[
200,
206
],
[
206,
207
],
[
200,
208
],
[
208,
209
],
[
200,
210
],
[
210,
211
],
[
210,
212
],
[
212,
213
],
[
213,
214
],
[
214,
215
],
[
214,
216
],
[
213,
217
],
[
210,
218
],
[
218,
219
],
[
200,
220
],
[
220,
221
],
[
220,
222
],
[
222,
223
],
[
223,
224
],
[
224,
225
],
[
224,
226
],
[
200,
227
],
[
200,
228
]
] | [
"import java.util.Scanner;\n\n\nclass Main {\n\tpublic static void main(String args[]) {\n\t\tScanner scanner = new Scanner(System.in);\n\t\t\n\t\tReversePolishNotation(scanner);\n\t\t\n\t\tscanner.close();\n\t}\n\t\n\tpublic static enum Operator\n\t{\n\t\tplus(43),\n\t\ttimes(42),\n\t\tminus(45);\n\t\t\n\t\tprivate final int mark;\n\t\t\n\t\tprivate Operator(final int mark) {\n\t\t\tthis.mark = mark;\n\t\t}\n\t\t\n\t\tpublic int getInt(){\n\t\t\treturn this.mark;\n\t\t}\n\t}\n\tpublic static Operator getMark(final int id) {\n\t\tOperator[] marks = Operator.values();\n\t\tfor (Operator type : marks) {\n\t\t\tif (type.getInt() == id) {\n\t\t\t\treturn type;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}\n\n\tpublic static void ReversePolishNotation(Scanner scanner ){ // N個の要素を含む0-オリジンの配列A\n\t\tString num;\n\t\tint sub;\n\t\tint array_num[] = new int[100];\n\t\tint count = 0;\n\t\tint count_num = 0;\n\t\tint i;\n\t\tbyte[] oper = new byte[200];\n\t\t\n\t\t\n\t\twhile( scanner.hasNext() ){\n\t\t\tnum = scanner.next();\n\t\t\ttry {\n\t\t\t\toper = num.getBytes(\"US-ASCII\");\n\t\t\t} catch (Exception e) {\n\t\t\t\t// TODO 自動生成された catch ブロック\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\n\t\t\tsub = (int)oper[0];\n\t\t\t\n\t\t\tif(sub < 42 || sub > 45){\n\t\t\t\tarray_num[count_num] = Integer.parseInt(num);\n\t\t\t\tcount_num ++;\n\t\t\t\n\t\t\t}else{\n\t\t\t\tcount_num -= 2;\n\t\t\t\tif( count_num >= 0 ){\n\t\t\t\t\tswitch( getMark(sub) ) {\n\t\t\t\t\t\tcase plus:\n\t\t\t\t\t\t\tarray_num[count_num] = array_num[count_num] + array_num[count_num + 1];\n\t\t\t\t\t\t\tcount_num ++;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase times:\n\t\t\t\t\t\t\tarray_num[count_num] = array_num[count_num] * array_num[count_num + 1];\n\t\t\t\t\t\t\tcount_num ++;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase minus:\n\t\t\t\t\t\t\tarray_num[count_num] = array_num[count_num] - array_num[count_num + 1];\n\t\t\t\t\t\t\tcount_num ++;\n\t\t\t\t\t}\n\t\t\t\t}else {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\n\t\t\tcount ++;\n\t\t\t}\n\t\t\n\t\t}\n\t\tSystem.out.println(array_num[0]);\n\t}\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"class Main {\n\tpublic static void main(String args[]) {\n\t\tScanner scanner = new Scanner(System.in);\n\t\t\n\t\tReversePolishNotation(scanner);\n\t\t\n\t\tscanner.close();\n\t}\n\t\n\tpublic static enum Operator\n\t{\n\t\tplus(43),\n\t\ttimes(42),\n\t\tminus(45);\n\t\t\n\t\tprivate final int mark;\n\t\t\n\t\tprivate Operator(final int mark) {\n\t\t\tthis.mark = mark;\n\t\t}\n\t\t\n\t\tpublic int getInt(){\n\t\t\treturn this.mark;\n\t\t}\n\t}\n\tpublic static Operator getMark(final int id) {\n\t\tOperator[] marks = Operator.values();\n\t\tfor (Operator type : marks) {\n\t\t\tif (type.getInt() == id) {\n\t\t\t\treturn type;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}\n\n\tpublic static void ReversePolishNotation(Scanner scanner ){ // N個の要素を含む0-オリジンの配列A\n\t\tString num;\n\t\tint sub;\n\t\tint array_num[] = new int[100];\n\t\tint count = 0;\n\t\tint count_num = 0;\n\t\tint i;\n\t\tbyte[] oper = new byte[200];\n\t\t\n\t\t\n\t\twhile( scanner.hasNext() ){\n\t\t\tnum = scanner.next();\n\t\t\ttry {\n\t\t\t\toper = num.getBytes(\"US-ASCII\");\n\t\t\t} catch (Exception e) {\n\t\t\t\t// TODO 自動生成された catch ブロック\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\n\t\t\tsub = (int)oper[0];\n\t\t\t\n\t\t\tif(sub < 42 || sub > 45){\n\t\t\t\tarray_num[count_num] = Integer.parseInt(num);\n\t\t\t\tcount_num ++;\n\t\t\t\n\t\t\t}else{\n\t\t\t\tcount_num -= 2;\n\t\t\t\tif( count_num >= 0 ){\n\t\t\t\t\tswitch( getMark(sub) ) {\n\t\t\t\t\t\tcase plus:\n\t\t\t\t\t\t\tarray_num[count_num] = array_num[count_num] + array_num[count_num + 1];\n\t\t\t\t\t\t\tcount_num ++;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase times:\n\t\t\t\t\t\t\tarray_num[count_num] = array_num[count_num] * array_num[count_num + 1];\n\t\t\t\t\t\t\tcount_num ++;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase minus:\n\t\t\t\t\t\t\tarray_num[count_num] = array_num[count_num] - array_num[count_num + 1];\n\t\t\t\t\t\t\tcount_num ++;\n\t\t\t\t\t}\n\t\t\t\t}else {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\n\t\t\tcount ++;\n\t\t\t}\n\t\t\n\t\t}\n\t\tSystem.out.println(array_num[0]);\n\t}\n}",
"Main",
"public static void main(String args[]) {\n\t\tScanner scanner = new Scanner(System.in);\n\t\t\n\t\tReversePolishNotation(scanner);\n\t\t\n\t\tscanner.close();\n\t}",
"main",
"{\n\t\tScanner scanner = new Scanner(System.in);\n\t\t\n\t\tReversePolishNotation(scanner);\n\t\t\n\t\tscanner.close();\n\t}",
"Scanner scanner = new Scanner(System.in);",
"scanner",
"new Scanner(System.in)",
"ReversePolishNotation(scanner)",
"ReversePolishNotation",
"scanner",
"scanner.close()",
"scanner.close",
"scanner",
"String args[]",
"args",
"public static Operator getMark(final int id) {\n\t\tOperator[] marks = Operator.values();\n\t\tfor (Operator type : marks) {\n\t\t\tif (type.getInt() == id) {\n\t\t\t\treturn type;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}",
"getMark",
"{\n\t\tOperator[] marks = Operator.values();\n\t\tfor (Operator type : marks) {\n\t\t\tif (type.getInt() == id) {\n\t\t\t\treturn type;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}",
"Operator[] marks = Operator.values();",
"marks",
"Operator.values()",
"Operator.values",
"Operator",
"for (Operator type : marks) {\n\t\t\tif (type.getInt() == id) {\n\t\t\t\treturn type;\n\t\t\t}\n\t\t}",
"Operator type",
"marks",
"{\n\t\t\tif (type.getInt() == id) {\n\t\t\t\treturn type;\n\t\t\t}\n\t\t}",
"{\n\t\t\tif (type.getInt() == id) {\n\t\t\t\treturn type;\n\t\t\t}\n\t\t}",
"if (type.getInt() == id) {\n\t\t\t\treturn type;\n\t\t\t}",
"type.getInt() == id",
"type.getInt()",
"type.getInt",
"type",
"id",
"{\n\t\t\t\treturn type;\n\t\t\t}",
"return type;",
"type",
"return null;",
"null",
"final int id",
"id",
"public static void ReversePolishNotation(Scanner scanner ){ // N個の要素を含む0-オリジンの配列A\n\t\tString num;\n\t\tint sub;\n\t\tint array_num[] = new int[100];\n\t\tint count = 0;\n\t\tint count_num = 0;\n\t\tint i;\n\t\tbyte[] oper = new byte[200];\n\t\t\n\t\t\n\t\twhile( scanner.hasNext() ){\n\t\t\tnum = scanner.next();\n\t\t\ttry {\n\t\t\t\toper = num.getBytes(\"US-ASCII\");\n\t\t\t} catch (Exception e) {\n\t\t\t\t// TODO 自動生成された catch ブロック\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\n\t\t\tsub = (int)oper[0];\n\t\t\t\n\t\t\tif(sub < 42 || sub > 45){\n\t\t\t\tarray_num[count_num] = Integer.parseInt(num);\n\t\t\t\tcount_num ++;\n\t\t\t\n\t\t\t}else{\n\t\t\t\tcount_num -= 2;\n\t\t\t\tif( count_num >= 0 ){\n\t\t\t\t\tswitch( getMark(sub) ) {\n\t\t\t\t\t\tcase plus:\n\t\t\t\t\t\t\tarray_num[count_num] = array_num[count_num] + array_num[count_num + 1];\n\t\t\t\t\t\t\tcount_num ++;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase times:\n\t\t\t\t\t\t\tarray_num[count_num] = array_num[count_num] * array_num[count_num + 1];\n\t\t\t\t\t\t\tcount_num ++;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase minus:\n\t\t\t\t\t\t\tarray_num[count_num] = array_num[count_num] - array_num[count_num + 1];\n\t\t\t\t\t\t\tcount_num ++;\n\t\t\t\t\t}\n\t\t\t\t}else {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\n\t\t\tcount ++;\n\t\t\t}\n\t\t\n\t\t}\n\t\tSystem.out.println(array_num[0]);\n\t}",
"ReversePolishNotation",
"{ // N個の要素を含む0-オリジンの配列A\n\t\tString num;\n\t\tint sub;\n\t\tint array_num[] = new int[100];\n\t\tint count = 0;\n\t\tint count_num = 0;\n\t\tint i;\n\t\tbyte[] oper = new byte[200];\n\t\t\n\t\t\n\t\twhile( scanner.hasNext() ){\n\t\t\tnum = scanner.next();\n\t\t\ttry {\n\t\t\t\toper = num.getBytes(\"US-ASCII\");\n\t\t\t} catch (Exception e) {\n\t\t\t\t// TODO 自動生成された catch ブロック\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\n\t\t\tsub = (int)oper[0];\n\t\t\t\n\t\t\tif(sub < 42 || sub > 45){\n\t\t\t\tarray_num[count_num] = Integer.parseInt(num);\n\t\t\t\tcount_num ++;\n\t\t\t\n\t\t\t}else{\n\t\t\t\tcount_num -= 2;\n\t\t\t\tif( count_num >= 0 ){\n\t\t\t\t\tswitch( getMark(sub) ) {\n\t\t\t\t\t\tcase plus:\n\t\t\t\t\t\t\tarray_num[count_num] = array_num[count_num] + array_num[count_num + 1];\n\t\t\t\t\t\t\tcount_num ++;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase times:\n\t\t\t\t\t\t\tarray_num[count_num] = array_num[count_num] * array_num[count_num + 1];\n\t\t\t\t\t\t\tcount_num ++;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase minus:\n\t\t\t\t\t\t\tarray_num[count_num] = array_num[count_num] - array_num[count_num + 1];\n\t\t\t\t\t\t\tcount_num ++;\n\t\t\t\t\t}\n\t\t\t\t}else {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\n\t\t\tcount ++;\n\t\t\t}\n\t\t\n\t\t}\n\t\tSystem.out.println(array_num[0]);\n\t}",
"String num;",
"num",
"int sub;",
"sub",
"int array_num[] = new int[100];",
"array_num",
"new int[100]",
"100",
"int count = 0;",
"count",
"0",
"int count_num = 0;",
"count_num",
"0",
"int i;",
"i",
"byte[] oper = new byte[200];",
"oper",
"new byte[200]",
"200",
"while( scanner.hasNext() ){\n\t\t\tnum = scanner.next();\n\t\t\ttry {\n\t\t\t\toper = num.getBytes(\"US-ASCII\");\n\t\t\t} catch (Exception e) {\n\t\t\t\t// TODO 自動生成された catch ブロック\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\n\t\t\tsub = (int)oper[0];\n\t\t\t\n\t\t\tif(sub < 42 || sub > 45){\n\t\t\t\tarray_num[count_num] = Integer.parseInt(num);\n\t\t\t\tcount_num ++;\n\t\t\t\n\t\t\t}else{\n\t\t\t\tcount_num -= 2;\n\t\t\t\tif( count_num >= 0 ){\n\t\t\t\t\tswitch( getMark(sub) ) {\n\t\t\t\t\t\tcase plus:\n\t\t\t\t\t\t\tarray_num[count_num] = array_num[count_num] + array_num[count_num + 1];\n\t\t\t\t\t\t\tcount_num ++;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase times:\n\t\t\t\t\t\t\tarray_num[count_num] = array_num[count_num] * array_num[count_num + 1];\n\t\t\t\t\t\t\tcount_num ++;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase minus:\n\t\t\t\t\t\t\tarray_num[count_num] = array_num[count_num] - array_num[count_num + 1];\n\t\t\t\t\t\t\tcount_num ++;\n\t\t\t\t\t}\n\t\t\t\t}else {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\n\t\t\tcount ++;\n\t\t\t}\n\t\t\n\t\t}",
"scanner.hasNext()",
"scanner.hasNext",
"scanner",
"{\n\t\t\tnum = scanner.next();\n\t\t\ttry {\n\t\t\t\toper = num.getBytes(\"US-ASCII\");\n\t\t\t} catch (Exception e) {\n\t\t\t\t// TODO 自動生成された catch ブロック\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\n\t\t\tsub = (int)oper[0];\n\t\t\t\n\t\t\tif(sub < 42 || sub > 45){\n\t\t\t\tarray_num[count_num] = Integer.parseInt(num);\n\t\t\t\tcount_num ++;\n\t\t\t\n\t\t\t}else{\n\t\t\t\tcount_num -= 2;\n\t\t\t\tif( count_num >= 0 ){\n\t\t\t\t\tswitch( getMark(sub) ) {\n\t\t\t\t\t\tcase plus:\n\t\t\t\t\t\t\tarray_num[count_num] = array_num[count_num] + array_num[count_num + 1];\n\t\t\t\t\t\t\tcount_num ++;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase times:\n\t\t\t\t\t\t\tarray_num[count_num] = array_num[count_num] * array_num[count_num + 1];\n\t\t\t\t\t\t\tcount_num ++;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase minus:\n\t\t\t\t\t\t\tarray_num[count_num] = array_num[count_num] - array_num[count_num + 1];\n\t\t\t\t\t\t\tcount_num ++;\n\t\t\t\t\t}\n\t\t\t\t}else {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\n\t\t\tcount ++;\n\t\t\t}\n\t\t\n\t\t}",
"num = scanner.next()",
"num",
"scanner.next()",
"scanner.next",
"scanner",
"try {\n\t\t\t\toper = num.getBytes(\"US-ASCII\");\n\t\t\t} catch (Exception e) {\n\t\t\t\t// TODO 自動生成された catch ブロック\n\t\t\t\te.printStackTrace();\n\t\t\t}",
"catch (Exception e) {\n\t\t\t\t// TODO 自動生成された catch ブロック\n\t\t\t\te.printStackTrace();\n\t\t\t}",
"Exception e",
"{\n\t\t\t\t// TODO 自動生成された catch ブロック\n\t\t\t\te.printStackTrace();\n\t\t\t}",
"e.printStackTrace()",
"e.printStackTrace",
"e",
"{\n\t\t\t\toper = num.getBytes(\"US-ASCII\");\n\t\t\t}",
"oper = num.getBytes(\"US-ASCII\")",
"oper",
"num.getBytes(\"US-ASCII\")",
"num.getBytes",
"num",
"\"US-ASCII\"",
"sub = (int)oper[0]",
"sub",
"(int)oper[0]",
"oper",
"0",
"if(sub < 42 || sub > 45){\n\t\t\t\tarray_num[count_num] = Integer.parseInt(num);\n\t\t\t\tcount_num ++;\n\t\t\t\n\t\t\t}else{\n\t\t\t\tcount_num -= 2;\n\t\t\t\tif( count_num >= 0 ){\n\t\t\t\t\tswitch( getMark(sub) ) {\n\t\t\t\t\t\tcase plus:\n\t\t\t\t\t\t\tarray_num[count_num] = array_num[count_num] + array_num[count_num + 1];\n\t\t\t\t\t\t\tcount_num ++;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase times:\n\t\t\t\t\t\t\tarray_num[count_num] = array_num[count_num] * array_num[count_num + 1];\n\t\t\t\t\t\t\tcount_num ++;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase minus:\n\t\t\t\t\t\t\tarray_num[count_num] = array_num[count_num] - array_num[count_num + 1];\n\t\t\t\t\t\t\tcount_num ++;\n\t\t\t\t\t}\n\t\t\t\t}else {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\n\t\t\tcount ++;\n\t\t\t}",
"sub < 42 || sub > 45",
"sub < 42",
"sub",
"42",
"sub > 45",
"sub",
"45",
"{\n\t\t\t\tarray_num[count_num] = Integer.parseInt(num);\n\t\t\t\tcount_num ++;\n\t\t\t\n\t\t\t}",
"array_num[count_num] = Integer.parseInt(num)",
"array_num[count_num]",
"array_num",
"count_num",
"Integer.parseInt(num)",
"Integer.parseInt",
"Integer",
"num",
"count_num ++",
"count_num",
"{\n\t\t\t\tcount_num -= 2;\n\t\t\t\tif( count_num >= 0 ){\n\t\t\t\t\tswitch( getMark(sub) ) {\n\t\t\t\t\t\tcase plus:\n\t\t\t\t\t\t\tarray_num[count_num] = array_num[count_num] + array_num[count_num + 1];\n\t\t\t\t\t\t\tcount_num ++;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase times:\n\t\t\t\t\t\t\tarray_num[count_num] = array_num[count_num] * array_num[count_num + 1];\n\t\t\t\t\t\t\tcount_num ++;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase minus:\n\t\t\t\t\t\t\tarray_num[count_num] = array_num[count_num] - array_num[count_num + 1];\n\t\t\t\t\t\t\tcount_num ++;\n\t\t\t\t\t}\n\t\t\t\t}else {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\n\t\t\tcount ++;\n\t\t\t}",
"count_num -= 2",
"count_num",
"2",
"if( count_num >= 0 ){\n\t\t\t\t\tswitch( getMark(sub) ) {\n\t\t\t\t\t\tcase plus:\n\t\t\t\t\t\t\tarray_num[count_num] = array_num[count_num] + array_num[count_num + 1];\n\t\t\t\t\t\t\tcount_num ++;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase times:\n\t\t\t\t\t\t\tarray_num[count_num] = array_num[count_num] * array_num[count_num + 1];\n\t\t\t\t\t\t\tcount_num ++;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase minus:\n\t\t\t\t\t\t\tarray_num[count_num] = array_num[count_num] - array_num[count_num + 1];\n\t\t\t\t\t\t\tcount_num ++;\n\t\t\t\t\t}\n\t\t\t\t}else {\n\t\t\t\t\tbreak;\n\t\t\t\t}",
"count_num >= 0",
"count_num",
"0",
"{\n\t\t\t\t\tswitch( getMark(sub) ) {\n\t\t\t\t\t\tcase plus:\n\t\t\t\t\t\t\tarray_num[count_num] = array_num[count_num] + array_num[count_num + 1];\n\t\t\t\t\t\t\tcount_num ++;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase times:\n\t\t\t\t\t\t\tarray_num[count_num] = array_num[count_num] * array_num[count_num + 1];\n\t\t\t\t\t\t\tcount_num ++;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase minus:\n\t\t\t\t\t\t\tarray_num[count_num] = array_num[count_num] - array_num[count_num + 1];\n\t\t\t\t\t\t\tcount_num ++;\n\t\t\t\t\t}\n\t\t\t\t}",
"switch( getMark(sub) ) {\n\t\t\t\t\t\tcase plus:\n\t\t\t\t\t\t\tarray_num[count_num] = array_num[count_num] + array_num[count_num + 1];\n\t\t\t\t\t\t\tcount_num ++;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase times:\n\t\t\t\t\t\t\tarray_num[count_num] = array_num[count_num] * array_num[count_num + 1];\n\t\t\t\t\t\t\tcount_num ++;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase minus:\n\t\t\t\t\t\t\tarray_num[count_num] = array_num[count_num] - array_num[count_num + 1];\n\t\t\t\t\t\t\tcount_num ++;\n\t\t\t\t\t}",
"getMark(sub)",
"getMark",
"sub",
"case plus:",
"plus",
"case plus:",
"array_num[count_num] = array_num[count_num] + array_num[count_num + 1]",
"array_num[count_num]",
"array_num",
"count_num",
"array_num[count_num] + array_num[count_num + 1]",
"array_num[count_num]",
"array_num",
"count_num",
"array_num[count_num + 1]",
"array_num",
"count_num + 1",
"count_num",
"1",
"count_num ++",
"count_num",
"break;",
"case times:",
"times",
"case times:",
"array_num[count_num] = array_num[count_num] * array_num[count_num + 1]",
"array_num[count_num]",
"array_num",
"count_num",
"array_num[count_num] * array_num[count_num + 1]",
"array_num[count_num]",
"array_num",
"count_num",
"array_num[count_num + 1]",
"array_num",
"count_num + 1",
"count_num",
"1",
"count_num ++",
"count_num",
"break;",
"case minus:",
"minus",
"case minus:",
"array_num[count_num] = array_num[count_num] - array_num[count_num + 1]",
"array_num[count_num]",
"array_num",
"count_num",
"array_num[count_num] - array_num[count_num + 1]",
"array_num[count_num]",
"array_num",
"count_num",
"array_num[count_num + 1]",
"array_num",
"count_num + 1",
"count_num",
"1",
"count_num ++",
"count_num",
"{\n\t\t\t\t\tbreak;\n\t\t\t\t}",
"break;",
"count ++",
"count",
"System.out.println(array_num[0])",
"System.out.println",
"System.out",
"System",
"System.out",
"array_num[0]",
"array_num",
"0",
"Scanner scanner",
"scanner",
"public static enum Operator\n\t{\n\t\tplus(43),\n\t\ttimes(42),\n\t\tminus(45);\n\t\t\n\t\tprivate final int mark;\n\t\t\n\t\tprivate Operator(final int mark) {\n\t\t\tthis.mark = mark;\n\t\t}\n\t\t\n\t\tpublic int getInt(){\n\t\t\treturn this.mark;\n\t\t}\n\t}",
"Operator",
"plus(43)",
"plus",
"times(42)",
"times",
"minus(45)",
"minus",
"private final int mark;",
"mark",
"private Operator(final int mark) {\n\t\t\tthis.mark = mark;\n\t\t}",
"Operator",
"{\n\t\t\tthis.mark = mark;\n\t\t}",
"this.mark = mark",
"this.mark",
"this",
"this.mark",
"mark",
"final int mark",
"mark",
"public int getInt(){\n\t\t\treturn this.mark;\n\t\t}",
"getInt",
"{\n\t\t\treturn this.mark;\n\t\t}",
"return this.mark;",
"this.mark",
"this",
"this.mark",
"import java.util.Scanner;\n\n\nclass Mai",
"import java.util.Scanner;\n\n\nclass Main {\n\tpublic static void main(String args[]) {\n\t\tScanner scanne"
] | import java.util.Scanner;
class Main {
public static void main(String args[]) {
Scanner scanner = new Scanner(System.in);
ReversePolishNotation(scanner);
scanner.close();
}
public static enum Operator
{
plus(43),
times(42),
minus(45);
private final int mark;
private Operator(final int mark) {
this.mark = mark;
}
public int getInt(){
return this.mark;
}
}
public static Operator getMark(final int id) {
Operator[] marks = Operator.values();
for (Operator type : marks) {
if (type.getInt() == id) {
return type;
}
}
return null;
}
public static void ReversePolishNotation(Scanner scanner ){ // N個の要素を含む0-オリジンの配列A
String num;
int sub;
int array_num[] = new int[100];
int count = 0;
int count_num = 0;
int i;
byte[] oper = new byte[200];
while( scanner.hasNext() ){
num = scanner.next();
try {
oper = num.getBytes("US-ASCII");
} catch (Exception e) {
// TODO 自動生成された catch ブロック
e.printStackTrace();
}
sub = (int)oper[0];
if(sub < 42 || sub > 45){
array_num[count_num] = Integer.parseInt(num);
count_num ++;
}else{
count_num -= 2;
if( count_num >= 0 ){
switch( getMark(sub) ) {
case plus:
array_num[count_num] = array_num[count_num] + array_num[count_num + 1];
count_num ++;
break;
case times:
array_num[count_num] = array_num[count_num] * array_num[count_num + 1];
count_num ++;
break;
case minus:
array_num[count_num] = array_num[count_num] - array_num[count_num + 1];
count_num ++;
}
}else {
break;
}
count ++;
}
}
System.out.println(array_num[0]);
}
}
|
[
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,
17,
4,
18,
13,
41,
13,
18,
13,
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,
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,
41,
13,
2,
13,
13,
41,
13,
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
],
[
150,
8
],
[
150,
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
],
[
25,
29
],
[
11,
30
],
[
30,
31
],
[
31,
32
],
[
11,
33
],
[
33,
34
],
[
33,
35
],
[
35,
36
],
[
35,
37
],
[
11,
38
],
[
38,
39
],
[
39,
40
],
[
40,
41
],
[
40,
42
],
[
38,
43
],
[
43,
44
],
[
43,
45
],
[
38,
46
],
[
46,
47
],
[
47,
48
],
[
38,
49
],
[
50,
50
],
[
50,
51
],
[
51,
52
],
[
52,
53
],
[
53,
54
],
[
54,
55
],
[
54,
56
],
[
52,
57
],
[
51,
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
],
[
51,
75
],
[
75,
76
],
[
76,
77
],
[
77,
78
],
[
78,
79
],
[
78,
80
],
[
76,
81
],
[
75,
82
],
[
82,
83
],
[
83,
84
],
[
83,
85
],
[
85,
86
],
[
86,
87
],
[
82,
88
],
[
88,
89
],
[
88,
90
],
[
90,
91
],
[
91,
92
],
[
82,
93
],
[
93,
94
],
[
94,
95
],
[
93,
96
],
[
96,
97
],
[
96,
98
],
[
75,
99
],
[
99,
100
],
[
100,
101
],
[
101,
102
],
[
102,
103
],
[
102,
104
],
[
100,
105
],
[
99,
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
],
[
122,
124
],
[
106,
125
],
[
125,
126
],
[
126,
127
],
[
125,
128
],
[
99,
129
],
[
129,
130
],
[
130,
131
],
[
131,
132
],
[
130,
133
],
[
133,
134
],
[
134,
135
],
[
133,
136
],
[
136,
137
],
[
136,
138
],
[
11,
139
],
[
139,
140
],
[
140,
141
],
[
141,
142
],
[
141,
143
],
[
139,
144
],
[
144,
145
],
[
145,
146
],
[
9,
147
],
[
147,
148
],
[
0,
149
],
[
149,
150
],
[
149,
151
]
] | [
"import java.util.Scanner;\n\nimport java.util.Stack;\n\npublic class Main {\n\n public static void main(String[] args) {\n Stack<Integer>stack = new Stack<>();\n \n Scanner scan = new Scanner(System.in);\n \n String input = scan.nextLine();\n String[] AK = input.split(\" \",0);\n scan.close();\n int kfc = AK.length; \n for(int i = 0; i < kfc; ++i) {\n \n if (AK[i].equals(\"+\")) {\n int x = stack.pop(),y = stack.pop();\n stack.push(y + x);\n }\n else if (AK[i].equals(\"-\")) {\n int x = stack.pop(),y = stack.pop();\n \n stack.push(y - x);\n }\n else if (AK[i].equals(\"*\")) {\n int x = stack.pop(),y = stack.pop();\n int B = x*y;\n int C = B;\n stack.push(C);\n }\n else {\n stack.push(Integer.parseInt(AK[i]));\n }\n }\n System.out.println(stack.firstElement());\n }\n }",
"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 Stack<Integer>stack = new Stack<>();\n \n Scanner scan = new Scanner(System.in);\n \n String input = scan.nextLine();\n String[] AK = input.split(\" \",0);\n scan.close();\n int kfc = AK.length; \n for(int i = 0; i < kfc; ++i) {\n \n if (AK[i].equals(\"+\")) {\n int x = stack.pop(),y = stack.pop();\n stack.push(y + x);\n }\n else if (AK[i].equals(\"-\")) {\n int x = stack.pop(),y = stack.pop();\n \n stack.push(y - x);\n }\n else if (AK[i].equals(\"*\")) {\n int x = stack.pop(),y = stack.pop();\n int B = x*y;\n int C = B;\n stack.push(C);\n }\n else {\n stack.push(Integer.parseInt(AK[i]));\n }\n }\n System.out.println(stack.firstElement());\n }\n }",
"Main",
"public static void main(String[] args) {\n Stack<Integer>stack = new Stack<>();\n \n Scanner scan = new Scanner(System.in);\n \n String input = scan.nextLine();\n String[] AK = input.split(\" \",0);\n scan.close();\n int kfc = AK.length; \n for(int i = 0; i < kfc; ++i) {\n \n if (AK[i].equals(\"+\")) {\n int x = stack.pop(),y = stack.pop();\n stack.push(y + x);\n }\n else if (AK[i].equals(\"-\")) {\n int x = stack.pop(),y = stack.pop();\n \n stack.push(y - x);\n }\n else if (AK[i].equals(\"*\")) {\n int x = stack.pop(),y = stack.pop();\n int B = x*y;\n int C = B;\n stack.push(C);\n }\n else {\n stack.push(Integer.parseInt(AK[i]));\n }\n }\n System.out.println(stack.firstElement());\n }",
"main",
"{\n Stack<Integer>stack = new Stack<>();\n \n Scanner scan = new Scanner(System.in);\n \n String input = scan.nextLine();\n String[] AK = input.split(\" \",0);\n scan.close();\n int kfc = AK.length; \n for(int i = 0; i < kfc; ++i) {\n \n if (AK[i].equals(\"+\")) {\n int x = stack.pop(),y = stack.pop();\n stack.push(y + x);\n }\n else if (AK[i].equals(\"-\")) {\n int x = stack.pop(),y = stack.pop();\n \n stack.push(y - x);\n }\n else if (AK[i].equals(\"*\")) {\n int x = stack.pop(),y = stack.pop();\n int B = x*y;\n int C = B;\n stack.push(C);\n }\n else {\n stack.push(Integer.parseInt(AK[i]));\n }\n }\n System.out.println(stack.firstElement());\n }",
"Stack<Integer>stack = new Stack<>();",
"stack",
"new Stack<>()",
"Scanner scan = new Scanner(System.in);",
"scan",
"new Scanner(System.in)",
"String input = scan.nextLine();",
"input",
"scan.nextLine()",
"scan.nextLine",
"scan",
"String[] AK = input.split(\" \",0);",
"AK",
"input.split(\" \",0)",
"input.split",
"input",
"\" \"",
"0",
"scan.close()",
"scan.close",
"scan",
"int kfc = AK.length;",
"kfc",
"AK.length",
"AK",
"AK.length",
"for(int i = 0; i < kfc; ++i) {\n \n if (AK[i].equals(\"+\")) {\n int x = stack.pop(),y = stack.pop();\n stack.push(y + x);\n }\n else if (AK[i].equals(\"-\")) {\n int x = stack.pop(),y = stack.pop();\n \n stack.push(y - x);\n }\n else if (AK[i].equals(\"*\")) {\n int x = stack.pop(),y = stack.pop();\n int B = x*y;\n int C = B;\n stack.push(C);\n }\n else {\n stack.push(Integer.parseInt(AK[i]));\n }\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < kfc",
"i",
"kfc",
"++i",
"++i",
"i",
"{\n \n if (AK[i].equals(\"+\")) {\n int x = stack.pop(),y = stack.pop();\n stack.push(y + x);\n }\n else if (AK[i].equals(\"-\")) {\n int x = stack.pop(),y = stack.pop();\n \n stack.push(y - x);\n }\n else if (AK[i].equals(\"*\")) {\n int x = stack.pop(),y = stack.pop();\n int B = x*y;\n int C = B;\n stack.push(C);\n }\n else {\n stack.push(Integer.parseInt(AK[i]));\n }\n }",
"{\n \n if (AK[i].equals(\"+\")) {\n int x = stack.pop(),y = stack.pop();\n stack.push(y + x);\n }\n else if (AK[i].equals(\"-\")) {\n int x = stack.pop(),y = stack.pop();\n \n stack.push(y - x);\n }\n else if (AK[i].equals(\"*\")) {\n int x = stack.pop(),y = stack.pop();\n int B = x*y;\n int C = B;\n stack.push(C);\n }\n else {\n stack.push(Integer.parseInt(AK[i]));\n }\n }",
"if (AK[i].equals(\"+\")) {\n int x = stack.pop(),y = stack.pop();\n stack.push(y + x);\n }\n else if (AK[i].equals(\"-\")) {\n int x = stack.pop(),y = stack.pop();\n \n stack.push(y - x);\n }\n else if (AK[i].equals(\"*\")) {\n int x = stack.pop(),y = stack.pop();\n int B = x*y;\n int C = B;\n stack.push(C);\n }\n else {\n stack.push(Integer.parseInt(AK[i]));\n }",
"AK[i].equals(\"+\")",
"AK[i].equals",
"AK[i]",
"AK",
"i",
"\"+\"",
"{\n int x = stack.pop(),y = stack.pop();\n stack.push(y + x);\n }",
"int x = stack.pop()",
"x",
"stack.pop()",
"stack.pop",
"stack",
"y = stack.pop();",
"y",
"stack.pop()",
"stack.pop",
"stack",
"stack.push(y + x)",
"stack.push",
"stack",
"y + x",
"y",
"x",
"if (AK[i].equals(\"-\")) {\n int x = stack.pop(),y = stack.pop();\n \n stack.push(y - x);\n }\n else if (AK[i].equals(\"*\")) {\n int x = stack.pop(),y = stack.pop();\n int B = x*y;\n int C = B;\n stack.push(C);\n }\n else {\n stack.push(Integer.parseInt(AK[i]));\n }",
"AK[i].equals(\"-\")",
"AK[i].equals",
"AK[i]",
"AK",
"i",
"\"-\"",
"{\n int x = stack.pop(),y = stack.pop();\n \n stack.push(y - x);\n }",
"int x = stack.pop()",
"x",
"stack.pop()",
"stack.pop",
"stack",
"y = stack.pop();",
"y",
"stack.pop()",
"stack.pop",
"stack",
"stack.push(y - x)",
"stack.push",
"stack",
"y - x",
"y",
"x",
"if (AK[i].equals(\"*\")) {\n int x = stack.pop(),y = stack.pop();\n int B = x*y;\n int C = B;\n stack.push(C);\n }\n else {\n stack.push(Integer.parseInt(AK[i]));\n }",
"AK[i].equals(\"*\")",
"AK[i].equals",
"AK[i]",
"AK",
"i",
"\"*\"",
"{\n int x = stack.pop(),y = stack.pop();\n int B = x*y;\n int C = B;\n stack.push(C);\n }",
"int x = stack.pop()",
"x",
"stack.pop()",
"stack.pop",
"stack",
"y = stack.pop();",
"y",
"stack.pop()",
"stack.pop",
"stack",
"int B = x*y;",
"B",
"x*y",
"x",
"y",
"int C = B;",
"C",
"B",
"stack.push(C)",
"stack.push",
"stack",
"C",
"{\n stack.push(Integer.parseInt(AK[i]));\n }",
"stack.push(Integer.parseInt(AK[i]))",
"stack.push",
"stack",
"Integer.parseInt(AK[i])",
"Integer.parseInt",
"Integer",
"AK[i]",
"AK",
"i",
"System.out.println(stack.firstElement())",
"System.out.println",
"System.out",
"System",
"System.out",
"stack.firstElement()",
"stack.firstElement",
"stack",
"String[] args",
"args",
"public class Main {\n\n public static void main(String[] args) {\n Stack<Integer>stack = new Stack<>();\n \n Scanner scan = new Scanner(System.in);\n \n String input = scan.nextLine();\n String[] AK = input.split(\" \",0);\n scan.close();\n int kfc = AK.length; \n for(int i = 0; i < kfc; ++i) {\n \n if (AK[i].equals(\"+\")) {\n int x = stack.pop(),y = stack.pop();\n stack.push(y + x);\n }\n else if (AK[i].equals(\"-\")) {\n int x = stack.pop(),y = stack.pop();\n \n stack.push(y - x);\n }\n else if (AK[i].equals(\"*\")) {\n int x = stack.pop(),y = stack.pop();\n int B = x*y;\n int C = B;\n stack.push(C);\n }\n else {\n stack.push(Integer.parseInt(AK[i]));\n }\n }\n System.out.println(stack.firstElement());\n }\n }",
"public class Main {\n\n public static void main(String[] args) {\n Stack<Integer>stack = new Stack<>();\n \n Scanner scan = new Scanner(System.in);\n \n String input = scan.nextLine();\n String[] AK = input.split(\" \",0);\n scan.close();\n int kfc = AK.length; \n for(int i = 0; i < kfc; ++i) {\n \n if (AK[i].equals(\"+\")) {\n int x = stack.pop(),y = stack.pop();\n stack.push(y + x);\n }\n else if (AK[i].equals(\"-\")) {\n int x = stack.pop(),y = stack.pop();\n \n stack.push(y - x);\n }\n else if (AK[i].equals(\"*\")) {\n int x = stack.pop(),y = stack.pop();\n int B = x*y;\n int C = B;\n stack.push(C);\n }\n else {\n stack.push(Integer.parseInt(AK[i]));\n }\n }\n System.out.println(stack.firstElement());\n }\n }",
"Main"
] | import java.util.Scanner;
import java.util.Stack;
public class Main {
public static void main(String[] args) {
Stack<Integer>stack = new Stack<>();
Scanner scan = new Scanner(System.in);
String input = scan.nextLine();
String[] AK = input.split(" ",0);
scan.close();
int kfc = AK.length;
for(int i = 0; i < kfc; ++i) {
if (AK[i].equals("+")) {
int x = stack.pop(),y = stack.pop();
stack.push(y + x);
}
else if (AK[i].equals("-")) {
int x = stack.pop(),y = stack.pop();
stack.push(y - x);
}
else if (AK[i].equals("*")) {
int x = stack.pop(),y = stack.pop();
int B = x*y;
int C = B;
stack.push(C);
}
else {
stack.push(Integer.parseInt(AK[i]));
}
}
System.out.println(stack.firstElement());
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
41,
13,
17,
41,
13,
17,
41,
13,
17,
12,
13,
30,
41,
13,
20,
41,
13,
17,
41,
13,
17,
41,
13,
17,
41,
13,
17,
41,
13,
17,
41,
13,
20,
42,
4,
18,
13,
30,
0,
13,
4,
18,
13,
14,
4,
18,
13,
13,
30,
0,
13,
4,
18,
13,
2,
4,
18,
13,
17,
4,
18,
13,
2,
4,
18,
13,
17,
0,
13,
4,
18,
13,
2,
4,
18,
13,
17,
4,
18,
13,
2,
4,
18,
13,
17,
0,
13,
2,
13,
13,
4,
18,
13,
13,
14,
4,
18,
13,
13,
30,
0,
13,
4,
18,
13,
2,
4,
18,
13,
17,
4,
18,
13,
2,
4,
18,
13,
17,
0,
13,
4,
18,
13,
2,
4,
18,
13,
17,
4,
18,
13,
2,
4,
18,
13,
17,
0,
13,
2,
13,
13,
4,
18,
13,
13,
14,
4,
18,
13,
13,
30,
0,
13,
4,
18,
13,
2,
4,
18,
13,
17,
4,
18,
13,
2,
4,
18,
13,
17,
0,
13,
4,
18,
13,
2,
4,
18,
13,
17,
4,
18,
13,
2,
4,
18,
13,
17,
0,
13,
2,
13,
13,
4,
18,
13,
13,
30,
0,
13,
4,
18,
13,
13,
4,
18,
13,
13,
0,
13,
4,
18,
13,
2,
4,
18,
13,
17,
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
],
[
238,
11
],
[
238,
12
],
[
12,
13
],
[
12,
14
],
[
238,
15
],
[
15,
16
],
[
15,
17
],
[
238,
18
],
[
18,
19
],
[
18,
20
],
[
238,
21
],
[
21,
22
],
[
21,
23
],
[
23,
24
],
[
24,
25
],
[
24,
26
],
[
23,
27
],
[
27,
28
],
[
27,
29
],
[
23,
30
],
[
30,
31
],
[
30,
32
],
[
23,
33
],
[
33,
34
],
[
33,
35
],
[
23,
36
],
[
36,
37
],
[
36,
38
],
[
23,
39
],
[
39,
40
],
[
39,
41
],
[
23,
42
],
[
42,
43
],
[
42,
44
],
[
23,
45
],
[
45,
46
],
[
46,
47
],
[
47,
48
],
[
45,
49
],
[
49,
50
],
[
50,
51
],
[
50,
52
],
[
52,
53
],
[
53,
54
],
[
49,
55
],
[
55,
56
],
[
56,
57
],
[
57,
58
],
[
56,
59
],
[
55,
60
],
[
60,
61
],
[
61,
62
],
[
61,
63
],
[
63,
64
],
[
64,
65
],
[
63,
66
],
[
66,
67
],
[
67,
68
],
[
68,
69
],
[
66,
70
],
[
60,
71
],
[
71,
72
],
[
72,
73
],
[
71,
74
],
[
74,
75
],
[
75,
76
],
[
76,
77
],
[
74,
78
],
[
60,
79
],
[
79,
80
],
[
79,
81
],
[
81,
82
],
[
82,
83
],
[
81,
84
],
[
84,
85
],
[
85,
86
],
[
86,
87
],
[
84,
88
],
[
60,
89
],
[
89,
90
],
[
90,
91
],
[
89,
92
],
[
92,
93
],
[
93,
94
],
[
94,
95
],
[
92,
96
],
[
60,
97
],
[
97,
98
],
[
97,
99
],
[
99,
100
],
[
99,
101
],
[
60,
102
],
[
102,
103
],
[
103,
104
],
[
102,
105
],
[
55,
106
],
[
106,
107
],
[
107,
108
],
[
108,
109
],
[
107,
110
],
[
106,
111
],
[
111,
112
],
[
112,
113
],
[
112,
114
],
[
114,
115
],
[
115,
116
],
[
114,
117
],
[
117,
118
],
[
118,
119
],
[
119,
120
],
[
117,
121
],
[
111,
122
],
[
122,
123
],
[
123,
124
],
[
122,
125
],
[
125,
126
],
[
126,
127
],
[
127,
128
],
[
125,
129
],
[
111,
130
],
[
130,
131
],
[
130,
132
],
[
132,
133
],
[
133,
134
],
[
132,
135
],
[
135,
136
],
[
136,
137
],
[
137,
138
],
[
135,
139
],
[
111,
140
],
[
140,
141
],
[
141,
142
],
[
140,
143
],
[
143,
144
],
[
144,
145
],
[
145,
146
],
[
143,
147
],
[
111,
148
],
[
148,
149
],
[
148,
150
],
[
150,
151
],
[
150,
152
],
[
111,
153
],
[
153,
154
],
[
154,
155
],
[
153,
156
],
[
106,
157
],
[
157,
158
],
[
158,
159
],
[
159,
160
],
[
158,
161
],
[
157,
162
],
[
162,
163
],
[
163,
164
],
[
163,
165
],
[
165,
166
],
[
166,
167
],
[
165,
168
],
[
168,
169
],
[
169,
170
],
[
170,
171
],
[
168,
172
],
[
162,
173
],
[
173,
174
],
[
174,
175
],
[
173,
176
],
[
176,
177
],
[
177,
178
],
[
178,
179
],
[
176,
180
],
[
162,
181
],
[
181,
182
],
[
181,
183
],
[
183,
184
],
[
184,
185
],
[
183,
186
],
[
186,
187
],
[
187,
188
],
[
188,
189
],
[
186,
190
],
[
162,
191
],
[
191,
192
],
[
192,
193
],
[
191,
194
],
[
194,
195
],
[
195,
196
],
[
196,
197
],
[
194,
198
],
[
162,
199
],
[
199,
200
],
[
199,
201
],
[
201,
202
],
[
201,
203
],
[
162,
204
],
[
204,
205
],
[
205,
206
],
[
204,
207
],
[
157,
208
],
[
208,
209
],
[
209,
210
],
[
209,
211
],
[
211,
212
],
[
212,
213
],
[
211,
214
],
[
208,
215
],
[
215,
216
],
[
216,
217
],
[
215,
218
],
[
23,
219
],
[
219,
220
],
[
219,
221
],
[
221,
222
],
[
222,
223
],
[
221,
224
],
[
224,
225
],
[
225,
226
],
[
226,
227
],
[
224,
228
],
[
23,
229
],
[
229,
230
],
[
230,
231
],
[
231,
232
],
[
231,
233
],
[
229,
234
],
[
21,
235
],
[
235,
236
],
[
0,
237
],
[
237,
238
],
[
237,
239
]
] | [
"import java.util.ArrayList;\nimport java.util.List;\nimport java.util.Scanner;\n\npublic class Main {\n\tpublic static final String plus = \"+\";\n\tpublic static final String minus = \"-\";\n\tpublic static final String kake = \"*\";\n public static void main(String[] args){\n \tScanner sc = new Scanner(System.in);\n\t\tString strInt = null;\n\t\tint intStr = 0;\n\t\tint numInt1 = 0;\n\t\tint numInt2 = 0;\n\t\tint total = 0;\n\t\tList<Integer> stack = new ArrayList<Integer>(100);\n\t\twhile(sc.hasNext()){\n\t\t\tstrInt = sc.next();\n\t\t\tif(strInt.equals(plus)){\n\t\t\t\tnumInt2 = stack.get(stack.size() - 1);\n\t\t\t\tstack.remove(stack.size() - 1);\n\t\t\t\tnumInt1 = stack.get(stack.size() - 1);\n\t\t\t\tstack.remove(stack.size() - 1);\n\t\t\t\ttotal = numInt1 + numInt2;\n\t\t\t\tstack.add(total);\n\t\t\t}else if(strInt.equals(minus)){\n\t\t\t\tnumInt2 = stack.get(stack.size() - 1);\n\t\t\t\tstack.remove(stack.size() - 1);\n\t\t\t\tnumInt1 = stack.get(stack.size() - 1);\n\t\t\t\tstack.remove(stack.size() - 1);\n\t\t\t\ttotal = numInt1 - numInt2;\n\t\t\t\tstack.add(total);\n\t\t\t}else if(strInt.equalsIgnoreCase(kake)){\n\t\t\t\tnumInt2 = stack.get(stack.size() - 1);\n\t\t\t\tstack.remove(stack.size() - 1);\n\t\t\t\tnumInt1 = stack.get(stack.size() - 1);\n\t\t\t\tstack.remove(stack.size() - 1);\n\t\t\t\ttotal = numInt1 * numInt2;\n\t\t\t\tstack.add(total);\n\t\t\t}else{\n\t\t\t\tintStr = Integer.parseInt(strInt);\n\t\t\t\tstack.add(intStr);\n\t\t\t}\n\t\t}\n\t\ttotal = stack.get(stack.size() - 1);\n\t\tSystem.out.println(total);\n\t}\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\tpublic static final String plus = \"+\";\n\tpublic static final String minus = \"-\";\n\tpublic static final String kake = \"*\";\n public static void main(String[] args){\n \tScanner sc = new Scanner(System.in);\n\t\tString strInt = null;\n\t\tint intStr = 0;\n\t\tint numInt1 = 0;\n\t\tint numInt2 = 0;\n\t\tint total = 0;\n\t\tList<Integer> stack = new ArrayList<Integer>(100);\n\t\twhile(sc.hasNext()){\n\t\t\tstrInt = sc.next();\n\t\t\tif(strInt.equals(plus)){\n\t\t\t\tnumInt2 = stack.get(stack.size() - 1);\n\t\t\t\tstack.remove(stack.size() - 1);\n\t\t\t\tnumInt1 = stack.get(stack.size() - 1);\n\t\t\t\tstack.remove(stack.size() - 1);\n\t\t\t\ttotal = numInt1 + numInt2;\n\t\t\t\tstack.add(total);\n\t\t\t}else if(strInt.equals(minus)){\n\t\t\t\tnumInt2 = stack.get(stack.size() - 1);\n\t\t\t\tstack.remove(stack.size() - 1);\n\t\t\t\tnumInt1 = stack.get(stack.size() - 1);\n\t\t\t\tstack.remove(stack.size() - 1);\n\t\t\t\ttotal = numInt1 - numInt2;\n\t\t\t\tstack.add(total);\n\t\t\t}else if(strInt.equalsIgnoreCase(kake)){\n\t\t\t\tnumInt2 = stack.get(stack.size() - 1);\n\t\t\t\tstack.remove(stack.size() - 1);\n\t\t\t\tnumInt1 = stack.get(stack.size() - 1);\n\t\t\t\tstack.remove(stack.size() - 1);\n\t\t\t\ttotal = numInt1 * numInt2;\n\t\t\t\tstack.add(total);\n\t\t\t}else{\n\t\t\t\tintStr = Integer.parseInt(strInt);\n\t\t\t\tstack.add(intStr);\n\t\t\t}\n\t\t}\n\t\ttotal = stack.get(stack.size() - 1);\n\t\tSystem.out.println(total);\n\t}\n}",
"Main",
"public static final String plus = \"+\";",
"plus",
"\"+\"",
"public static final String minus = \"-\";",
"minus",
"\"-\"",
"public static final String kake = \"*\";",
"kake",
"\"*\"",
"public static void main(String[] args){\n \tScanner sc = new Scanner(System.in);\n\t\tString strInt = null;\n\t\tint intStr = 0;\n\t\tint numInt1 = 0;\n\t\tint numInt2 = 0;\n\t\tint total = 0;\n\t\tList<Integer> stack = new ArrayList<Integer>(100);\n\t\twhile(sc.hasNext()){\n\t\t\tstrInt = sc.next();\n\t\t\tif(strInt.equals(plus)){\n\t\t\t\tnumInt2 = stack.get(stack.size() - 1);\n\t\t\t\tstack.remove(stack.size() - 1);\n\t\t\t\tnumInt1 = stack.get(stack.size() - 1);\n\t\t\t\tstack.remove(stack.size() - 1);\n\t\t\t\ttotal = numInt1 + numInt2;\n\t\t\t\tstack.add(total);\n\t\t\t}else if(strInt.equals(minus)){\n\t\t\t\tnumInt2 = stack.get(stack.size() - 1);\n\t\t\t\tstack.remove(stack.size() - 1);\n\t\t\t\tnumInt1 = stack.get(stack.size() - 1);\n\t\t\t\tstack.remove(stack.size() - 1);\n\t\t\t\ttotal = numInt1 - numInt2;\n\t\t\t\tstack.add(total);\n\t\t\t}else if(strInt.equalsIgnoreCase(kake)){\n\t\t\t\tnumInt2 = stack.get(stack.size() - 1);\n\t\t\t\tstack.remove(stack.size() - 1);\n\t\t\t\tnumInt1 = stack.get(stack.size() - 1);\n\t\t\t\tstack.remove(stack.size() - 1);\n\t\t\t\ttotal = numInt1 * numInt2;\n\t\t\t\tstack.add(total);\n\t\t\t}else{\n\t\t\t\tintStr = Integer.parseInt(strInt);\n\t\t\t\tstack.add(intStr);\n\t\t\t}\n\t\t}\n\t\ttotal = stack.get(stack.size() - 1);\n\t\tSystem.out.println(total);\n\t}",
"main",
"{\n \tScanner sc = new Scanner(System.in);\n\t\tString strInt = null;\n\t\tint intStr = 0;\n\t\tint numInt1 = 0;\n\t\tint numInt2 = 0;\n\t\tint total = 0;\n\t\tList<Integer> stack = new ArrayList<Integer>(100);\n\t\twhile(sc.hasNext()){\n\t\t\tstrInt = sc.next();\n\t\t\tif(strInt.equals(plus)){\n\t\t\t\tnumInt2 = stack.get(stack.size() - 1);\n\t\t\t\tstack.remove(stack.size() - 1);\n\t\t\t\tnumInt1 = stack.get(stack.size() - 1);\n\t\t\t\tstack.remove(stack.size() - 1);\n\t\t\t\ttotal = numInt1 + numInt2;\n\t\t\t\tstack.add(total);\n\t\t\t}else if(strInt.equals(minus)){\n\t\t\t\tnumInt2 = stack.get(stack.size() - 1);\n\t\t\t\tstack.remove(stack.size() - 1);\n\t\t\t\tnumInt1 = stack.get(stack.size() - 1);\n\t\t\t\tstack.remove(stack.size() - 1);\n\t\t\t\ttotal = numInt1 - numInt2;\n\t\t\t\tstack.add(total);\n\t\t\t}else if(strInt.equalsIgnoreCase(kake)){\n\t\t\t\tnumInt2 = stack.get(stack.size() - 1);\n\t\t\t\tstack.remove(stack.size() - 1);\n\t\t\t\tnumInt1 = stack.get(stack.size() - 1);\n\t\t\t\tstack.remove(stack.size() - 1);\n\t\t\t\ttotal = numInt1 * numInt2;\n\t\t\t\tstack.add(total);\n\t\t\t}else{\n\t\t\t\tintStr = Integer.parseInt(strInt);\n\t\t\t\tstack.add(intStr);\n\t\t\t}\n\t\t}\n\t\ttotal = stack.get(stack.size() - 1);\n\t\tSystem.out.println(total);\n\t}",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"String strInt = null;",
"strInt",
"null",
"int intStr = 0;",
"intStr",
"0",
"int numInt1 = 0;",
"numInt1",
"0",
"int numInt2 = 0;",
"numInt2",
"0",
"int total = 0;",
"total",
"0",
"List<Integer> stack = new ArrayList<Integer>(100);",
"stack",
"new ArrayList<Integer>(100)",
"while(sc.hasNext()){\n\t\t\tstrInt = sc.next();\n\t\t\tif(strInt.equals(plus)){\n\t\t\t\tnumInt2 = stack.get(stack.size() - 1);\n\t\t\t\tstack.remove(stack.size() - 1);\n\t\t\t\tnumInt1 = stack.get(stack.size() - 1);\n\t\t\t\tstack.remove(stack.size() - 1);\n\t\t\t\ttotal = numInt1 + numInt2;\n\t\t\t\tstack.add(total);\n\t\t\t}else if(strInt.equals(minus)){\n\t\t\t\tnumInt2 = stack.get(stack.size() - 1);\n\t\t\t\tstack.remove(stack.size() - 1);\n\t\t\t\tnumInt1 = stack.get(stack.size() - 1);\n\t\t\t\tstack.remove(stack.size() - 1);\n\t\t\t\ttotal = numInt1 - numInt2;\n\t\t\t\tstack.add(total);\n\t\t\t}else if(strInt.equalsIgnoreCase(kake)){\n\t\t\t\tnumInt2 = stack.get(stack.size() - 1);\n\t\t\t\tstack.remove(stack.size() - 1);\n\t\t\t\tnumInt1 = stack.get(stack.size() - 1);\n\t\t\t\tstack.remove(stack.size() - 1);\n\t\t\t\ttotal = numInt1 * numInt2;\n\t\t\t\tstack.add(total);\n\t\t\t}else{\n\t\t\t\tintStr = Integer.parseInt(strInt);\n\t\t\t\tstack.add(intStr);\n\t\t\t}\n\t\t}",
"sc.hasNext()",
"sc.hasNext",
"sc",
"{\n\t\t\tstrInt = sc.next();\n\t\t\tif(strInt.equals(plus)){\n\t\t\t\tnumInt2 = stack.get(stack.size() - 1);\n\t\t\t\tstack.remove(stack.size() - 1);\n\t\t\t\tnumInt1 = stack.get(stack.size() - 1);\n\t\t\t\tstack.remove(stack.size() - 1);\n\t\t\t\ttotal = numInt1 + numInt2;\n\t\t\t\tstack.add(total);\n\t\t\t}else if(strInt.equals(minus)){\n\t\t\t\tnumInt2 = stack.get(stack.size() - 1);\n\t\t\t\tstack.remove(stack.size() - 1);\n\t\t\t\tnumInt1 = stack.get(stack.size() - 1);\n\t\t\t\tstack.remove(stack.size() - 1);\n\t\t\t\ttotal = numInt1 - numInt2;\n\t\t\t\tstack.add(total);\n\t\t\t}else if(strInt.equalsIgnoreCase(kake)){\n\t\t\t\tnumInt2 = stack.get(stack.size() - 1);\n\t\t\t\tstack.remove(stack.size() - 1);\n\t\t\t\tnumInt1 = stack.get(stack.size() - 1);\n\t\t\t\tstack.remove(stack.size() - 1);\n\t\t\t\ttotal = numInt1 * numInt2;\n\t\t\t\tstack.add(total);\n\t\t\t}else{\n\t\t\t\tintStr = Integer.parseInt(strInt);\n\t\t\t\tstack.add(intStr);\n\t\t\t}\n\t\t}",
"strInt = sc.next()",
"strInt",
"sc.next()",
"sc.next",
"sc",
"if(strInt.equals(plus)){\n\t\t\t\tnumInt2 = stack.get(stack.size() - 1);\n\t\t\t\tstack.remove(stack.size() - 1);\n\t\t\t\tnumInt1 = stack.get(stack.size() - 1);\n\t\t\t\tstack.remove(stack.size() - 1);\n\t\t\t\ttotal = numInt1 + numInt2;\n\t\t\t\tstack.add(total);\n\t\t\t}else if(strInt.equals(minus)){\n\t\t\t\tnumInt2 = stack.get(stack.size() - 1);\n\t\t\t\tstack.remove(stack.size() - 1);\n\t\t\t\tnumInt1 = stack.get(stack.size() - 1);\n\t\t\t\tstack.remove(stack.size() - 1);\n\t\t\t\ttotal = numInt1 - numInt2;\n\t\t\t\tstack.add(total);\n\t\t\t}else if(strInt.equalsIgnoreCase(kake)){\n\t\t\t\tnumInt2 = stack.get(stack.size() - 1);\n\t\t\t\tstack.remove(stack.size() - 1);\n\t\t\t\tnumInt1 = stack.get(stack.size() - 1);\n\t\t\t\tstack.remove(stack.size() - 1);\n\t\t\t\ttotal = numInt1 * numInt2;\n\t\t\t\tstack.add(total);\n\t\t\t}else{\n\t\t\t\tintStr = Integer.parseInt(strInt);\n\t\t\t\tstack.add(intStr);\n\t\t\t}",
"strInt.equals(plus)",
"strInt.equals",
"strInt",
"plus",
"{\n\t\t\t\tnumInt2 = stack.get(stack.size() - 1);\n\t\t\t\tstack.remove(stack.size() - 1);\n\t\t\t\tnumInt1 = stack.get(stack.size() - 1);\n\t\t\t\tstack.remove(stack.size() - 1);\n\t\t\t\ttotal = numInt1 + numInt2;\n\t\t\t\tstack.add(total);\n\t\t\t}",
"numInt2 = stack.get(stack.size() - 1)",
"numInt2",
"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",
"numInt1 = stack.get(stack.size() - 1)",
"numInt1",
"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",
"total = numInt1 + numInt2",
"total",
"numInt1 + numInt2",
"numInt1",
"numInt2",
"stack.add(total)",
"stack.add",
"stack",
"total",
"if(strInt.equals(minus)){\n\t\t\t\tnumInt2 = stack.get(stack.size() - 1);\n\t\t\t\tstack.remove(stack.size() - 1);\n\t\t\t\tnumInt1 = stack.get(stack.size() - 1);\n\t\t\t\tstack.remove(stack.size() - 1);\n\t\t\t\ttotal = numInt1 - numInt2;\n\t\t\t\tstack.add(total);\n\t\t\t}else if(strInt.equalsIgnoreCase(kake)){\n\t\t\t\tnumInt2 = stack.get(stack.size() - 1);\n\t\t\t\tstack.remove(stack.size() - 1);\n\t\t\t\tnumInt1 = stack.get(stack.size() - 1);\n\t\t\t\tstack.remove(stack.size() - 1);\n\t\t\t\ttotal = numInt1 * numInt2;\n\t\t\t\tstack.add(total);\n\t\t\t}else{\n\t\t\t\tintStr = Integer.parseInt(strInt);\n\t\t\t\tstack.add(intStr);\n\t\t\t}",
"strInt.equals(minus)",
"strInt.equals",
"strInt",
"minus",
"{\n\t\t\t\tnumInt2 = stack.get(stack.size() - 1);\n\t\t\t\tstack.remove(stack.size() - 1);\n\t\t\t\tnumInt1 = stack.get(stack.size() - 1);\n\t\t\t\tstack.remove(stack.size() - 1);\n\t\t\t\ttotal = numInt1 - numInt2;\n\t\t\t\tstack.add(total);\n\t\t\t}",
"numInt2 = stack.get(stack.size() - 1)",
"numInt2",
"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",
"numInt1 = stack.get(stack.size() - 1)",
"numInt1",
"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",
"total = numInt1 - numInt2",
"total",
"numInt1 - numInt2",
"numInt1",
"numInt2",
"stack.add(total)",
"stack.add",
"stack",
"total",
"if(strInt.equalsIgnoreCase(kake)){\n\t\t\t\tnumInt2 = stack.get(stack.size() - 1);\n\t\t\t\tstack.remove(stack.size() - 1);\n\t\t\t\tnumInt1 = stack.get(stack.size() - 1);\n\t\t\t\tstack.remove(stack.size() - 1);\n\t\t\t\ttotal = numInt1 * numInt2;\n\t\t\t\tstack.add(total);\n\t\t\t}else{\n\t\t\t\tintStr = Integer.parseInt(strInt);\n\t\t\t\tstack.add(intStr);\n\t\t\t}",
"strInt.equalsIgnoreCase(kake)",
"strInt.equalsIgnoreCase",
"strInt",
"kake",
"{\n\t\t\t\tnumInt2 = stack.get(stack.size() - 1);\n\t\t\t\tstack.remove(stack.size() - 1);\n\t\t\t\tnumInt1 = stack.get(stack.size() - 1);\n\t\t\t\tstack.remove(stack.size() - 1);\n\t\t\t\ttotal = numInt1 * numInt2;\n\t\t\t\tstack.add(total);\n\t\t\t}",
"numInt2 = stack.get(stack.size() - 1)",
"numInt2",
"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",
"numInt1 = stack.get(stack.size() - 1)",
"numInt1",
"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",
"total = numInt1 * numInt2",
"total",
"numInt1 * numInt2",
"numInt1",
"numInt2",
"stack.add(total)",
"stack.add",
"stack",
"total",
"{\n\t\t\t\tintStr = Integer.parseInt(strInt);\n\t\t\t\tstack.add(intStr);\n\t\t\t}",
"intStr = Integer.parseInt(strInt)",
"intStr",
"Integer.parseInt(strInt)",
"Integer.parseInt",
"Integer",
"strInt",
"stack.add(intStr)",
"stack.add",
"stack",
"intStr",
"total = stack.get(stack.size() - 1)",
"total",
"stack.get(stack.size() - 1)",
"stack.get",
"stack",
"stack.size() - 1",
"stack.size()",
"stack.size",
"stack",
"1",
"System.out.println(total)",
"System.out.println",
"System.out",
"System",
"System.out",
"total",
"String[] args",
"args",
"public class Main {\n\tpublic static final String plus = \"+\";\n\tpublic static final String minus = \"-\";\n\tpublic static final String kake = \"*\";\n public static void main(String[] args){\n \tScanner sc = new Scanner(System.in);\n\t\tString strInt = null;\n\t\tint intStr = 0;\n\t\tint numInt1 = 0;\n\t\tint numInt2 = 0;\n\t\tint total = 0;\n\t\tList<Integer> stack = new ArrayList<Integer>(100);\n\t\twhile(sc.hasNext()){\n\t\t\tstrInt = sc.next();\n\t\t\tif(strInt.equals(plus)){\n\t\t\t\tnumInt2 = stack.get(stack.size() - 1);\n\t\t\t\tstack.remove(stack.size() - 1);\n\t\t\t\tnumInt1 = stack.get(stack.size() - 1);\n\t\t\t\tstack.remove(stack.size() - 1);\n\t\t\t\ttotal = numInt1 + numInt2;\n\t\t\t\tstack.add(total);\n\t\t\t}else if(strInt.equals(minus)){\n\t\t\t\tnumInt2 = stack.get(stack.size() - 1);\n\t\t\t\tstack.remove(stack.size() - 1);\n\t\t\t\tnumInt1 = stack.get(stack.size() - 1);\n\t\t\t\tstack.remove(stack.size() - 1);\n\t\t\t\ttotal = numInt1 - numInt2;\n\t\t\t\tstack.add(total);\n\t\t\t}else if(strInt.equalsIgnoreCase(kake)){\n\t\t\t\tnumInt2 = stack.get(stack.size() - 1);\n\t\t\t\tstack.remove(stack.size() - 1);\n\t\t\t\tnumInt1 = stack.get(stack.size() - 1);\n\t\t\t\tstack.remove(stack.size() - 1);\n\t\t\t\ttotal = numInt1 * numInt2;\n\t\t\t\tstack.add(total);\n\t\t\t}else{\n\t\t\t\tintStr = Integer.parseInt(strInt);\n\t\t\t\tstack.add(intStr);\n\t\t\t}\n\t\t}\n\t\ttotal = stack.get(stack.size() - 1);\n\t\tSystem.out.println(total);\n\t}\n}",
"public class Main {\n\tpublic static final String plus = \"+\";\n\tpublic static final String minus = \"-\";\n\tpublic static final String kake = \"*\";\n public static void main(String[] args){\n \tScanner sc = new Scanner(System.in);\n\t\tString strInt = null;\n\t\tint intStr = 0;\n\t\tint numInt1 = 0;\n\t\tint numInt2 = 0;\n\t\tint total = 0;\n\t\tList<Integer> stack = new ArrayList<Integer>(100);\n\t\twhile(sc.hasNext()){\n\t\t\tstrInt = sc.next();\n\t\t\tif(strInt.equals(plus)){\n\t\t\t\tnumInt2 = stack.get(stack.size() - 1);\n\t\t\t\tstack.remove(stack.size() - 1);\n\t\t\t\tnumInt1 = stack.get(stack.size() - 1);\n\t\t\t\tstack.remove(stack.size() - 1);\n\t\t\t\ttotal = numInt1 + numInt2;\n\t\t\t\tstack.add(total);\n\t\t\t}else if(strInt.equals(minus)){\n\t\t\t\tnumInt2 = stack.get(stack.size() - 1);\n\t\t\t\tstack.remove(stack.size() - 1);\n\t\t\t\tnumInt1 = stack.get(stack.size() - 1);\n\t\t\t\tstack.remove(stack.size() - 1);\n\t\t\t\ttotal = numInt1 - numInt2;\n\t\t\t\tstack.add(total);\n\t\t\t}else if(strInt.equalsIgnoreCase(kake)){\n\t\t\t\tnumInt2 = stack.get(stack.size() - 1);\n\t\t\t\tstack.remove(stack.size() - 1);\n\t\t\t\tnumInt1 = stack.get(stack.size() - 1);\n\t\t\t\tstack.remove(stack.size() - 1);\n\t\t\t\ttotal = numInt1 * numInt2;\n\t\t\t\tstack.add(total);\n\t\t\t}else{\n\t\t\t\tintStr = Integer.parseInt(strInt);\n\t\t\t\tstack.add(intStr);\n\t\t\t}\n\t\t}\n\t\ttotal = stack.get(stack.size() - 1);\n\t\tSystem.out.println(total);\n\t}\n}",
"Main"
] | import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
public class Main {
public static final String plus = "+";
public static final String minus = "-";
public static final String kake = "*";
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
String strInt = null;
int intStr = 0;
int numInt1 = 0;
int numInt2 = 0;
int total = 0;
List<Integer> stack = new ArrayList<Integer>(100);
while(sc.hasNext()){
strInt = sc.next();
if(strInt.equals(plus)){
numInt2 = stack.get(stack.size() - 1);
stack.remove(stack.size() - 1);
numInt1 = stack.get(stack.size() - 1);
stack.remove(stack.size() - 1);
total = numInt1 + numInt2;
stack.add(total);
}else if(strInt.equals(minus)){
numInt2 = stack.get(stack.size() - 1);
stack.remove(stack.size() - 1);
numInt1 = stack.get(stack.size() - 1);
stack.remove(stack.size() - 1);
total = numInt1 - numInt2;
stack.add(total);
}else if(strInt.equalsIgnoreCase(kake)){
numInt2 = stack.get(stack.size() - 1);
stack.remove(stack.size() - 1);
numInt1 = stack.get(stack.size() - 1);
stack.remove(stack.size() - 1);
total = numInt1 * numInt2;
stack.add(total);
}else{
intStr = Integer.parseInt(strInt);
stack.add(intStr);
}
}
total = stack.get(stack.size() - 1);
System.out.println(total);
}
} |
[
7,
15,
13,
17,
6,
13,
41,
13,
20,
17,
41,
13,
17,
12,
13,
30,
0,
18,
13,
13,
13,
40,
13,
23,
13,
12,
13,
30,
40,
13,
41,
13,
18,
13,
13,
29,
13,
12,
13,
30,
41,
13,
20,
41,
13,
41,
13,
41,
13,
41,
13,
41,
13,
41,
13,
0,
13,
17,
42,
4,
18,
13,
30,
14,
2,
4,
18,
13,
17,
30,
4,
13,
4,
18,
13,
30,
0,
13,
4,
18,
13,
14,
2,
4,
18,
13,
17,
17,
30,
0,
13,
4,
13,
0,
13,
4,
13,
4,
13,
2,
13,
13,
14,
2,
4,
18,
13,
17,
17,
30,
0,
13,
4,
13,
0,
13,
4,
13,
4,
13,
2,
13,
13,
14,
2,
4,
18,
13,
17,
17,
30,
0,
13,
4,
13,
0,
13,
4,
13,
4,
13,
2,
13,
13,
4,
18,
18,
13,
13,
18,
13,
17,
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
],
[
10,
12
],
[
4,
13
],
[
13,
14
],
[
13,
15
],
[
15,
16
],
[
16,
17
],
[
17,
18
],
[
17,
19
],
[
16,
20
],
[
15,
21
],
[
21,
22
],
[
13,
23
],
[
23,
24
],
[
4,
25
],
[
25,
26
],
[
25,
27
],
[
27,
28
],
[
28,
29
],
[
27,
30
],
[
30,
31
],
[
30,
32
],
[
32,
33
],
[
32,
34
],
[
27,
35
],
[
35,
36
],
[
4,
37
],
[
37,
38
],
[
37,
39
],
[
39,
40
],
[
40,
41
],
[
40,
42
],
[
39,
43
],
[
43,
44
],
[
39,
45
],
[
45,
46
],
[
39,
47
],
[
47,
48
],
[
39,
49
],
[
49,
50
],
[
39,
51
],
[
51,
52
],
[
39,
53
],
[
53,
54
],
[
39,
55
],
[
55,
56
],
[
55,
57
],
[
39,
58
],
[
58,
59
],
[
59,
60
],
[
60,
61
],
[
58,
62
],
[
62,
63
],
[
63,
64
],
[
64,
65
],
[
65,
66
],
[
66,
67
],
[
64,
68
],
[
63,
69
],
[
69,
70
],
[
70,
71
],
[
70,
72
],
[
72,
73
],
[
73,
74
],
[
63,
75
],
[
75,
76
],
[
76,
77
],
[
76,
78
],
[
78,
79
],
[
79,
80
],
[
75,
81
],
[
81,
82
],
[
82,
83
],
[
83,
84
],
[
84,
85
],
[
83,
86
],
[
82,
87
],
[
81,
88
],
[
88,
89
],
[
89,
90
],
[
89,
91
],
[
91,
92
],
[
88,
93
],
[
93,
94
],
[
93,
95
],
[
95,
96
],
[
88,
97
],
[
97,
98
],
[
97,
99
],
[
99,
100
],
[
99,
101
],
[
81,
102
],
[
102,
103
],
[
103,
104
],
[
104,
105
],
[
105,
106
],
[
104,
107
],
[
103,
108
],
[
102,
109
],
[
109,
110
],
[
110,
111
],
[
110,
112
],
[
112,
113
],
[
109,
114
],
[
114,
115
],
[
114,
116
],
[
116,
117
],
[
109,
118
],
[
118,
119
],
[
118,
120
],
[
120,
121
],
[
120,
122
],
[
102,
123
],
[
123,
124
],
[
124,
125
],
[
125,
126
],
[
126,
127
],
[
125,
128
],
[
124,
129
],
[
123,
130
],
[
130,
131
],
[
131,
132
],
[
131,
133
],
[
133,
134
],
[
130,
135
],
[
135,
136
],
[
135,
137
],
[
137,
138
],
[
130,
139
],
[
139,
140
],
[
139,
141
],
[
141,
142
],
[
141,
143
],
[
39,
144
],
[
144,
145
],
[
145,
146
],
[
146,
147
],
[
146,
148
],
[
144,
149
],
[
149,
150
],
[
149,
151
],
[
39,
152
],
[
152,
153
],
[
153,
154
],
[
37,
155
],
[
155,
156
]
] | [
"import java.util.*;\n\nclass Main\n{\n\n //------------stack-------------\n static int[] stack = new int[100];\n static int head=0;\n\n static void en(int n)\n {\n\tstack[head]=n;\n\thead++;\n }\n\n static int de()\n {\n\thead--;\n\tint i=stack[head];\n\treturn i;\n }\n\n //-----------Main---------------\n public static void main(String args[])\n {\n\tScanner sc = new Scanner(System.in);\n\tString s;\n\tint x, y;\n\tint i, j, k;\n\n\ti=0;\n\twhile(sc.hasNext())\n\t {\n\t\t//Read number\n\t\tif(sc.hasNextInt()==true)\n\t\t {\n\t\t\ten(sc.nextInt());\n\t\t }\n\t\t//Read operand\n\t\telse\n\t\t {\n\t\t\ts=sc.next();\n\t\t\t//+\n\t\t\tif(s.equals(\"+\")==true)\n\t\t\t {\n\t\t\t\tx=de();\n\t\t\t\ty=de();\n\t\t\t\ten(y+x);\n\t\t\t }\n\t\t\n\t\t\t//-\n\t\t\telse if(s.equals(\"-\")==true)\n\t\t\t {\n\t\t\t\tx=de();\n\t\t\t\ty=de();\n\t\t\t\ten(y-x);\n\t\t\t }\n\t\t\t//*\n\t\t\telse if(s.equals(\"*\")==true)\n\t\t\t {\t\t\t\t\n\t\t\t\tx=de();\n\t\t\t\ty=de();\n\t\t\t\ten(y*x);\n\t\t\t }\n\t\t\t//else if(s.equals(null)==true)break;\n\t\t }\n\t }\n \n \n\t//print\n\tSystem.out.println(stack[0]);\n\tsc.close();\n \n }\n\n}",
"import java.util.*;",
"util.*",
"java",
"class Main\n{\n\n //------------stack-------------\n static int[] stack = new int[100];\n static int head=0;\n\n static void en(int n)\n {\n\tstack[head]=n;\n\thead++;\n }\n\n static int de()\n {\n\thead--;\n\tint i=stack[head];\n\treturn i;\n }\n\n //-----------Main---------------\n public static void main(String args[])\n {\n\tScanner sc = new Scanner(System.in);\n\tString s;\n\tint x, y;\n\tint i, j, k;\n\n\ti=0;\n\twhile(sc.hasNext())\n\t {\n\t\t//Read number\n\t\tif(sc.hasNextInt()==true)\n\t\t {\n\t\t\ten(sc.nextInt());\n\t\t }\n\t\t//Read operand\n\t\telse\n\t\t {\n\t\t\ts=sc.next();\n\t\t\t//+\n\t\t\tif(s.equals(\"+\")==true)\n\t\t\t {\n\t\t\t\tx=de();\n\t\t\t\ty=de();\n\t\t\t\ten(y+x);\n\t\t\t }\n\t\t\n\t\t\t//-\n\t\t\telse if(s.equals(\"-\")==true)\n\t\t\t {\n\t\t\t\tx=de();\n\t\t\t\ty=de();\n\t\t\t\ten(y-x);\n\t\t\t }\n\t\t\t//*\n\t\t\telse if(s.equals(\"*\")==true)\n\t\t\t {\t\t\t\t\n\t\t\t\tx=de();\n\t\t\t\ty=de();\n\t\t\t\ten(y*x);\n\t\t\t }\n\t\t\t//else if(s.equals(null)==true)break;\n\t\t }\n\t }\n \n \n\t//print\n\tSystem.out.println(stack[0]);\n\tsc.close();\n \n }\n\n}",
"Main",
"//------------stack-------------\n static int[] stack = new int[100];",
"stack",
"new int[100]",
"100",
"static int head=0;",
"head",
"0",
"static void en(int n)\n {\n\tstack[head]=n;\n\thead++;\n }",
"en",
"{\n\tstack[head]=n;\n\thead++;\n }",
"stack[head]=n",
"stack[head]",
"stack",
"head",
"n",
"head++",
"head",
"int n",
"n",
"static int de()\n {\n\thead--;\n\tint i=stack[head];\n\treturn i;\n }",
"de",
"{\n\thead--;\n\tint i=stack[head];\n\treturn i;\n }",
"head--",
"head",
"int i=stack[head];",
"i",
"stack[head]",
"stack",
"head",
"return i;",
"i",
"//-----------Main---------------\n public static void main(String args[])\n {\n\tScanner sc = new Scanner(System.in);\n\tString s;\n\tint x, y;\n\tint i, j, k;\n\n\ti=0;\n\twhile(sc.hasNext())\n\t {\n\t\t//Read number\n\t\tif(sc.hasNextInt()==true)\n\t\t {\n\t\t\ten(sc.nextInt());\n\t\t }\n\t\t//Read operand\n\t\telse\n\t\t {\n\t\t\ts=sc.next();\n\t\t\t//+\n\t\t\tif(s.equals(\"+\")==true)\n\t\t\t {\n\t\t\t\tx=de();\n\t\t\t\ty=de();\n\t\t\t\ten(y+x);\n\t\t\t }\n\t\t\n\t\t\t//-\n\t\t\telse if(s.equals(\"-\")==true)\n\t\t\t {\n\t\t\t\tx=de();\n\t\t\t\ty=de();\n\t\t\t\ten(y-x);\n\t\t\t }\n\t\t\t//*\n\t\t\telse if(s.equals(\"*\")==true)\n\t\t\t {\t\t\t\t\n\t\t\t\tx=de();\n\t\t\t\ty=de();\n\t\t\t\ten(y*x);\n\t\t\t }\n\t\t\t//else if(s.equals(null)==true)break;\n\t\t }\n\t }\n \n \n\t//print\n\tSystem.out.println(stack[0]);\n\tsc.close();\n \n }",
"main",
"{\n\tScanner sc = new Scanner(System.in);\n\tString s;\n\tint x, y;\n\tint i, j, k;\n\n\ti=0;\n\twhile(sc.hasNext())\n\t {\n\t\t//Read number\n\t\tif(sc.hasNextInt()==true)\n\t\t {\n\t\t\ten(sc.nextInt());\n\t\t }\n\t\t//Read operand\n\t\telse\n\t\t {\n\t\t\ts=sc.next();\n\t\t\t//+\n\t\t\tif(s.equals(\"+\")==true)\n\t\t\t {\n\t\t\t\tx=de();\n\t\t\t\ty=de();\n\t\t\t\ten(y+x);\n\t\t\t }\n\t\t\n\t\t\t//-\n\t\t\telse if(s.equals(\"-\")==true)\n\t\t\t {\n\t\t\t\tx=de();\n\t\t\t\ty=de();\n\t\t\t\ten(y-x);\n\t\t\t }\n\t\t\t//*\n\t\t\telse if(s.equals(\"*\")==true)\n\t\t\t {\t\t\t\t\n\t\t\t\tx=de();\n\t\t\t\ty=de();\n\t\t\t\ten(y*x);\n\t\t\t }\n\t\t\t//else if(s.equals(null)==true)break;\n\t\t }\n\t }\n \n \n\t//print\n\tSystem.out.println(stack[0]);\n\tsc.close();\n \n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"String s;",
"s",
"int x",
"x",
"y;",
"y",
"int i",
"i",
"j",
"j",
"k;",
"k",
"i=0",
"i",
"0",
"while(sc.hasNext())\n\t {\n\t\t//Read number\n\t\tif(sc.hasNextInt()==true)\n\t\t {\n\t\t\ten(sc.nextInt());\n\t\t }\n\t\t//Read operand\n\t\telse\n\t\t {\n\t\t\ts=sc.next();\n\t\t\t//+\n\t\t\tif(s.equals(\"+\")==true)\n\t\t\t {\n\t\t\t\tx=de();\n\t\t\t\ty=de();\n\t\t\t\ten(y+x);\n\t\t\t }\n\t\t\n\t\t\t//-\n\t\t\telse if(s.equals(\"-\")==true)\n\t\t\t {\n\t\t\t\tx=de();\n\t\t\t\ty=de();\n\t\t\t\ten(y-x);\n\t\t\t }\n\t\t\t//*\n\t\t\telse if(s.equals(\"*\")==true)\n\t\t\t {\t\t\t\t\n\t\t\t\tx=de();\n\t\t\t\ty=de();\n\t\t\t\ten(y*x);\n\t\t\t }\n\t\t\t//else if(s.equals(null)==true)break;\n\t\t }\n\t }",
"sc.hasNext()",
"sc.hasNext",
"sc",
"{\n\t\t//Read number\n\t\tif(sc.hasNextInt()==true)\n\t\t {\n\t\t\ten(sc.nextInt());\n\t\t }\n\t\t//Read operand\n\t\telse\n\t\t {\n\t\t\ts=sc.next();\n\t\t\t//+\n\t\t\tif(s.equals(\"+\")==true)\n\t\t\t {\n\t\t\t\tx=de();\n\t\t\t\ty=de();\n\t\t\t\ten(y+x);\n\t\t\t }\n\t\t\n\t\t\t//-\n\t\t\telse if(s.equals(\"-\")==true)\n\t\t\t {\n\t\t\t\tx=de();\n\t\t\t\ty=de();\n\t\t\t\ten(y-x);\n\t\t\t }\n\t\t\t//*\n\t\t\telse if(s.equals(\"*\")==true)\n\t\t\t {\t\t\t\t\n\t\t\t\tx=de();\n\t\t\t\ty=de();\n\t\t\t\ten(y*x);\n\t\t\t }\n\t\t\t//else if(s.equals(null)==true)break;\n\t\t }\n\t }",
"if(sc.hasNextInt()==true)\n\t\t {\n\t\t\ten(sc.nextInt());\n\t\t }\n\t\t//Read operand\n\t\telse\n\t\t {\n\t\t\ts=sc.next();\n\t\t\t//+\n\t\t\tif(s.equals(\"+\")==true)\n\t\t\t {\n\t\t\t\tx=de();\n\t\t\t\ty=de();\n\t\t\t\ten(y+x);\n\t\t\t }\n\t\t\n\t\t\t//-\n\t\t\telse if(s.equals(\"-\")==true)\n\t\t\t {\n\t\t\t\tx=de();\n\t\t\t\ty=de();\n\t\t\t\ten(y-x);\n\t\t\t }\n\t\t\t//*\n\t\t\telse if(s.equals(\"*\")==true)\n\t\t\t {\t\t\t\t\n\t\t\t\tx=de();\n\t\t\t\ty=de();\n\t\t\t\ten(y*x);\n\t\t\t }\n\t\t\t//else if(s.equals(null)==true)break;\n\t\t }",
"sc.hasNextInt()==true",
"sc.hasNextInt()",
"sc.hasNextInt",
"sc",
"true",
"{\n\t\t\ten(sc.nextInt());\n\t\t }",
"en(sc.nextInt())",
"en",
"sc.nextInt()",
"sc.nextInt",
"sc",
"{\n\t\t\ts=sc.next();\n\t\t\t//+\n\t\t\tif(s.equals(\"+\")==true)\n\t\t\t {\n\t\t\t\tx=de();\n\t\t\t\ty=de();\n\t\t\t\ten(y+x);\n\t\t\t }\n\t\t\n\t\t\t//-\n\t\t\telse if(s.equals(\"-\")==true)\n\t\t\t {\n\t\t\t\tx=de();\n\t\t\t\ty=de();\n\t\t\t\ten(y-x);\n\t\t\t }\n\t\t\t//*\n\t\t\telse if(s.equals(\"*\")==true)\n\t\t\t {\t\t\t\t\n\t\t\t\tx=de();\n\t\t\t\ty=de();\n\t\t\t\ten(y*x);\n\t\t\t }\n\t\t\t//else if(s.equals(null)==true)break;\n\t\t }",
"s=sc.next()",
"s",
"sc.next()",
"sc.next",
"sc",
"if(s.equals(\"+\")==true)\n\t\t\t {\n\t\t\t\tx=de();\n\t\t\t\ty=de();\n\t\t\t\ten(y+x);\n\t\t\t }\n\t\t\n\t\t\t//-\n\t\t\telse if(s.equals(\"-\")==true)\n\t\t\t {\n\t\t\t\tx=de();\n\t\t\t\ty=de();\n\t\t\t\ten(y-x);\n\t\t\t }\n\t\t\t//*\n\t\t\telse if(s.equals(\"*\")==true)\n\t\t\t {\t\t\t\t\n\t\t\t\tx=de();\n\t\t\t\ty=de();\n\t\t\t\ten(y*x);\n\t\t\t }",
"s.equals(\"+\")==true",
"s.equals(\"+\")",
"s.equals",
"s",
"\"+\"",
"true",
"{\n\t\t\t\tx=de();\n\t\t\t\ty=de();\n\t\t\t\ten(y+x);\n\t\t\t }",
"x=de()",
"x",
"de()",
"de",
"y=de()",
"y",
"de()",
"de",
"en(y+x)",
"en",
"y+x",
"y",
"x",
"if(s.equals(\"-\")==true)\n\t\t\t {\n\t\t\t\tx=de();\n\t\t\t\ty=de();\n\t\t\t\ten(y-x);\n\t\t\t }\n\t\t\t//*\n\t\t\telse if(s.equals(\"*\")==true)\n\t\t\t {\t\t\t\t\n\t\t\t\tx=de();\n\t\t\t\ty=de();\n\t\t\t\ten(y*x);\n\t\t\t }",
"s.equals(\"-\")==true",
"s.equals(\"-\")",
"s.equals",
"s",
"\"-\"",
"true",
"{\n\t\t\t\tx=de();\n\t\t\t\ty=de();\n\t\t\t\ten(y-x);\n\t\t\t }",
"x=de()",
"x",
"de()",
"de",
"y=de()",
"y",
"de()",
"de",
"en(y-x)",
"en",
"y-x",
"y",
"x",
"if(s.equals(\"*\")==true)\n\t\t\t {\t\t\t\t\n\t\t\t\tx=de();\n\t\t\t\ty=de();\n\t\t\t\ten(y*x);\n\t\t\t }",
"s.equals(\"*\")==true",
"s.equals(\"*\")",
"s.equals",
"s",
"\"*\"",
"true",
"{\t\t\t\t\n\t\t\t\tx=de();\n\t\t\t\ty=de();\n\t\t\t\ten(y*x);\n\t\t\t }",
"x=de()",
"x",
"de()",
"de",
"y=de()",
"y",
"de()",
"de",
"en(y*x)",
"en",
"y*x",
"y",
"x",
"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"
] | import java.util.*;
class Main
{
//------------stack-------------
static int[] stack = new int[100];
static int head=0;
static void en(int n)
{
stack[head]=n;
head++;
}
static int de()
{
head--;
int i=stack[head];
return i;
}
//-----------Main---------------
public static void main(String args[])
{
Scanner sc = new Scanner(System.in);
String s;
int x, y;
int i, j, k;
i=0;
while(sc.hasNext())
{
//Read number
if(sc.hasNextInt()==true)
{
en(sc.nextInt());
}
//Read operand
else
{
s=sc.next();
//+
if(s.equals("+")==true)
{
x=de();
y=de();
en(y+x);
}
//-
else if(s.equals("-")==true)
{
x=de();
y=de();
en(y-x);
}
//*
else if(s.equals("*")==true)
{
x=de();
y=de();
en(y*x);
}
//else if(s.equals(null)==true)break;
}
}
//print
System.out.println(stack[0]);
sc.close();
}
} |
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
41,
13,
17,
41,
13,
41,
13,
20,
13,
12,
13,
30,
4,
13,
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,
13,
4,
18,
18,
13,
13,
17,
30,
4,
13,
4,
18,
13,
18,
13,
13,
14,
4,
18,
4,
18,
13,
18,
13,
13,
17,
30,
41,
13,
4,
13,
41,
13,
4,
13,
4,
13,
2,
13,
13,
14,
4,
18,
4,
18,
13,
18,
13,
13,
17,
30,
41,
13,
4,
13,
41,
13,
4,
13,
4,
13,
2,
13,
13,
14,
4,
18,
4,
18,
13,
18,
13,
13,
17,
30,
41,
13,
4,
13,
41,
13,
4,
13,
4,
13,
2,
13,
13,
4,
18,
18,
13,
13,
4,
13,
23,
13,
12,
13,
30,
0,
13,
17,
12,
13,
30,
29,
2,
13,
17,
12,
13,
30,
29,
2,
13,
2,
13,
17,
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,
4,
18,
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
],
[
224,
8
],
[
224,
9
],
[
9,
10
],
[
9,
11
],
[
224,
12
],
[
12,
13
],
[
224,
14
],
[
14,
15
],
[
14,
16
],
[
224,
18
],
[
18,
19
],
[
18,
20
],
[
20,
21
],
[
21,
22
],
[
20,
23
],
[
23,
24
],
[
23,
25
],
[
20,
26
],
[
26,
27
],
[
26,
28
],
[
28,
29
],
[
29,
30
],
[
20,
31
],
[
31,
32
],
[
31,
33
],
[
33,
34
],
[
34,
35
],
[
33,
36
],
[
20,
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
],
[
53,
56
],
[
56,
57
],
[
57,
58
],
[
58,
59
],
[
58,
60
],
[
56,
61
],
[
52,
62
],
[
62,
63
],
[
63,
64
],
[
63,
65
],
[
65,
66
],
[
66,
67
],
[
65,
68
],
[
68,
69
],
[
68,
70
],
[
52,
71
],
[
71,
72
],
[
72,
73
],
[
73,
74
],
[
74,
75
],
[
75,
76
],
[
74,
77
],
[
77,
78
],
[
77,
79
],
[
72,
80
],
[
71,
81
],
[
81,
82
],
[
82,
83
],
[
82,
84
],
[
84,
85
],
[
81,
86
],
[
86,
87
],
[
86,
88
],
[
88,
89
],
[
81,
90
],
[
90,
91
],
[
90,
92
],
[
92,
93
],
[
92,
94
],
[
71,
95
],
[
95,
96
],
[
96,
97
],
[
97,
98
],
[
98,
99
],
[
99,
100
],
[
98,
101
],
[
101,
102
],
[
101,
103
],
[
96,
104
],
[
95,
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
],
[
95,
119
],
[
119,
120
],
[
120,
121
],
[
121,
122
],
[
122,
123
],
[
123,
124
],
[
122,
125
],
[
125,
126
],
[
125,
127
],
[
120,
128
],
[
119,
129
],
[
129,
130
],
[
130,
131
],
[
130,
132
],
[
132,
133
],
[
129,
134
],
[
134,
135
],
[
134,
136
],
[
136,
137
],
[
129,
138
],
[
138,
139
],
[
138,
140
],
[
140,
141
],
[
140,
142
],
[
20,
143
],
[
143,
144
],
[
144,
145
],
[
145,
146
],
[
145,
147
],
[
143,
148
],
[
148,
149
],
[
18,
150
],
[
150,
151
],
[
224,
152
],
[
152,
153
],
[
152,
154
],
[
154,
155
],
[
155,
156
],
[
155,
157
],
[
224,
158
],
[
158,
159
],
[
158,
160
],
[
160,
161
],
[
161,
162
],
[
162,
163
],
[
162,
164
],
[
224,
165
],
[
165,
166
],
[
165,
167
],
[
167,
168
],
[
168,
169
],
[
169,
170
],
[
169,
171
],
[
171,
172
],
[
171,
173
],
[
224,
174
],
[
174,
175
],
[
174,
176
],
[
176,
177
],
[
177,
178
],
[
178,
179
],
[
177,
180
],
[
180,
181
],
[
181,
182
],
[
176,
183
],
[
183,
184
],
[
176,
185
],
[
185,
186
],
[
186,
187
],
[
186,
188
],
[
185,
189
],
[
174,
190
],
[
190,
191
],
[
224,
192
],
[
192,
193
],
[
192,
194
],
[
194,
195
],
[
195,
196
],
[
196,
197
],
[
195,
198
],
[
198,
199
],
[
199,
200
],
[
194,
201
],
[
201,
202
],
[
194,
203
],
[
203,
204
],
[
204,
205
],
[
204,
206
],
[
206,
207
],
[
206,
208
],
[
224,
209
],
[
209,
210
],
[
209,
211
],
[
211,
212
],
[
212,
213
],
[
213,
214
],
[
214,
215
],
[
214,
216
],
[
212,
217
],
[
217,
218
],
[
218,
219
],
[
217,
220
],
[
209,
221
],
[
221,
222
],
[
0,
223
],
[
223,
224
],
[
223,
225
]
] | [
"import java.util.Arrays;\nimport java.util.Scanner;\n\npublic class Main {\n static int Max = 1000;\n static int top;\n static int[] Stack = new int[Max];\n\n public static void main(final String[] args) {\n initialize();\n Scanner sc = new Scanner(System.in);\n String s = sc.nextLine();\n String[] str = s.split(\" \");\n for (int i = 0; i < str.length; i++) {\n if (Character.isDigit(str[i].charAt(0))) {\n push(Integer.parseInt(str[i]));\n }\n else if (String.valueOf(str[i]).equals(\"+\")) {\n int a = pop();\n int b = pop();\n push(a + b);\n }\n else if (String.valueOf(str[i]).equals(\"-\")) {\n int a = pop();\n int b = pop();\n push(b - a);\n }\n else if (String.valueOf(str[i]).equals(\"*\")) {\n int a = pop();\n int b = pop();\n push(a * b);\n }\n }\n System.out.println(pop());\n }\n\n private static void initialize() {\n top = 0;\n }\n\n private static boolean isEmpty() {\n return top == 0;\n }\n\n private static boolean isFull() {\n return top >= Max - 1;\n }\n\n private static void push(int x) {\n if (isFull()) {\n throw new Error(\"Over Flow\");\n }\n top++;\n Stack[top] = x;\n }\n\n private static int pop() {\n if (isEmpty()) {\n throw new Error(\"Under Flow\");\n }\n top--;\n return Stack[top + 1];\n }\n\n private static void print(int[] A) {\n System.out.println(Arrays.toString(A));\n }\n}",
"import java.util.Arrays;",
"Arrays",
"java.util",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n static int Max = 1000;\n static int top;\n static int[] Stack = new int[Max];\n\n public static void main(final String[] args) {\n initialize();\n Scanner sc = new Scanner(System.in);\n String s = sc.nextLine();\n String[] str = s.split(\" \");\n for (int i = 0; i < str.length; i++) {\n if (Character.isDigit(str[i].charAt(0))) {\n push(Integer.parseInt(str[i]));\n }\n else if (String.valueOf(str[i]).equals(\"+\")) {\n int a = pop();\n int b = pop();\n push(a + b);\n }\n else if (String.valueOf(str[i]).equals(\"-\")) {\n int a = pop();\n int b = pop();\n push(b - a);\n }\n else if (String.valueOf(str[i]).equals(\"*\")) {\n int a = pop();\n int b = pop();\n push(a * b);\n }\n }\n System.out.println(pop());\n }\n\n private static void initialize() {\n top = 0;\n }\n\n private static boolean isEmpty() {\n return top == 0;\n }\n\n private static boolean isFull() {\n return top >= Max - 1;\n }\n\n private static void push(int x) {\n if (isFull()) {\n throw new Error(\"Over Flow\");\n }\n top++;\n Stack[top] = x;\n }\n\n private static int pop() {\n if (isEmpty()) {\n throw new Error(\"Under Flow\");\n }\n top--;\n return Stack[top + 1];\n }\n\n private static void print(int[] A) {\n System.out.println(Arrays.toString(A));\n }\n}",
"Main",
"static int Max = 1000;",
"Max",
"1000",
"static int top;",
"top",
"static int[] Stack = new int[Max];",
"Stack",
"new int[Max]",
"Max",
"public static void main(final String[] args) {\n initialize();\n Scanner sc = new Scanner(System.in);\n String s = sc.nextLine();\n String[] str = s.split(\" \");\n for (int i = 0; i < str.length; i++) {\n if (Character.isDigit(str[i].charAt(0))) {\n push(Integer.parseInt(str[i]));\n }\n else if (String.valueOf(str[i]).equals(\"+\")) {\n int a = pop();\n int b = pop();\n push(a + b);\n }\n else if (String.valueOf(str[i]).equals(\"-\")) {\n int a = pop();\n int b = pop();\n push(b - a);\n }\n else if (String.valueOf(str[i]).equals(\"*\")) {\n int a = pop();\n int b = pop();\n push(a * b);\n }\n }\n System.out.println(pop());\n }",
"main",
"{\n initialize();\n Scanner sc = new Scanner(System.in);\n String s = sc.nextLine();\n String[] str = s.split(\" \");\n for (int i = 0; i < str.length; i++) {\n if (Character.isDigit(str[i].charAt(0))) {\n push(Integer.parseInt(str[i]));\n }\n else if (String.valueOf(str[i]).equals(\"+\")) {\n int a = pop();\n int b = pop();\n push(a + b);\n }\n else if (String.valueOf(str[i]).equals(\"-\")) {\n int a = pop();\n int b = pop();\n push(b - a);\n }\n else if (String.valueOf(str[i]).equals(\"*\")) {\n int a = pop();\n int b = pop();\n push(a * b);\n }\n }\n System.out.println(pop());\n }",
"initialize()",
"initialize",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"String s = sc.nextLine();",
"s",
"sc.nextLine()",
"sc.nextLine",
"sc",
"String[] str = s.split(\" \");",
"str",
"s.split(\" \")",
"s.split",
"s",
"\" \"",
"for (int i = 0; i < str.length; i++) {\n if (Character.isDigit(str[i].charAt(0))) {\n push(Integer.parseInt(str[i]));\n }\n else if (String.valueOf(str[i]).equals(\"+\")) {\n int a = pop();\n int b = pop();\n push(a + b);\n }\n else if (String.valueOf(str[i]).equals(\"-\")) {\n int a = pop();\n int b = pop();\n push(b - a);\n }\n else if (String.valueOf(str[i]).equals(\"*\")) {\n int a = pop();\n int b = pop();\n push(a * b);\n }\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < str.length",
"i",
"str.length",
"str",
"str.length",
"i++",
"i++",
"i",
"{\n if (Character.isDigit(str[i].charAt(0))) {\n push(Integer.parseInt(str[i]));\n }\n else if (String.valueOf(str[i]).equals(\"+\")) {\n int a = pop();\n int b = pop();\n push(a + b);\n }\n else if (String.valueOf(str[i]).equals(\"-\")) {\n int a = pop();\n int b = pop();\n push(b - a);\n }\n else if (String.valueOf(str[i]).equals(\"*\")) {\n int a = pop();\n int b = pop();\n push(a * b);\n }\n }",
"{\n if (Character.isDigit(str[i].charAt(0))) {\n push(Integer.parseInt(str[i]));\n }\n else if (String.valueOf(str[i]).equals(\"+\")) {\n int a = pop();\n int b = pop();\n push(a + b);\n }\n else if (String.valueOf(str[i]).equals(\"-\")) {\n int a = pop();\n int b = pop();\n push(b - a);\n }\n else if (String.valueOf(str[i]).equals(\"*\")) {\n int a = pop();\n int b = pop();\n push(a * b);\n }\n }",
"if (Character.isDigit(str[i].charAt(0))) {\n push(Integer.parseInt(str[i]));\n }\n else if (String.valueOf(str[i]).equals(\"+\")) {\n int a = pop();\n int b = pop();\n push(a + b);\n }\n else if (String.valueOf(str[i]).equals(\"-\")) {\n int a = pop();\n int b = pop();\n push(b - a);\n }\n else if (String.valueOf(str[i]).equals(\"*\")) {\n int a = pop();\n int b = pop();\n push(a * b);\n }",
"Character.isDigit(str[i].charAt(0))",
"Character.isDigit",
"Character",
"str[i].charAt(0)",
"str[i].charAt",
"str[i]",
"str",
"i",
"0",
"{\n push(Integer.parseInt(str[i]));\n }",
"push(Integer.parseInt(str[i]))",
"push",
"Integer.parseInt(str[i])",
"Integer.parseInt",
"Integer",
"str[i]",
"str",
"i",
"if (String.valueOf(str[i]).equals(\"+\")) {\n int a = pop();\n int b = pop();\n push(a + b);\n }\n else if (String.valueOf(str[i]).equals(\"-\")) {\n int a = pop();\n int b = pop();\n push(b - a);\n }\n else if (String.valueOf(str[i]).equals(\"*\")) {\n int a = pop();\n int b = pop();\n push(a * b);\n }",
"String.valueOf(str[i]).equals(\"+\")",
"String.valueOf(str[i]).equals",
"String.valueOf(str[i])",
"String.valueOf",
"String",
"str[i]",
"str",
"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 (String.valueOf(str[i]).equals(\"-\")) {\n int a = pop();\n int b = pop();\n push(b - a);\n }\n else if (String.valueOf(str[i]).equals(\"*\")) {\n int a = pop();\n int b = pop();\n push(a * b);\n }",
"String.valueOf(str[i]).equals(\"-\")",
"String.valueOf(str[i]).equals",
"String.valueOf(str[i])",
"String.valueOf",
"String",
"str[i]",
"str",
"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 (String.valueOf(str[i]).equals(\"*\")) {\n int a = pop();\n int b = pop();\n push(a * b);\n }",
"String.valueOf(str[i]).equals(\"*\")",
"String.valueOf(str[i]).equals",
"String.valueOf(str[i])",
"String.valueOf",
"String",
"str[i]",
"str",
"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",
"System.out.println(pop())",
"System.out.println",
"System.out",
"System",
"System.out",
"pop()",
"pop",
"final String[] args",
"args",
"private static void initialize() {\n top = 0;\n }",
"initialize",
"{\n top = 0;\n }",
"top = 0",
"top",
"0",
"private static boolean isEmpty() {\n return top == 0;\n }",
"isEmpty",
"{\n return top == 0;\n }",
"return top == 0;",
"top == 0",
"top",
"0",
"private static boolean isFull() {\n return top >= Max - 1;\n }",
"isFull",
"{\n return top >= Max - 1;\n }",
"return top >= Max - 1;",
"top >= Max - 1",
"top",
"Max - 1",
"Max",
"1",
"private static void push(int x) {\n if (isFull()) {\n throw new Error(\"Over Flow\");\n }\n top++;\n Stack[top] = x;\n }",
"push",
"{\n if (isFull()) {\n throw new Error(\"Over Flow\");\n }\n top++;\n Stack[top] = x;\n }",
"if (isFull()) {\n throw new Error(\"Over Flow\");\n }",
"isFull()",
"isFull",
"{\n throw new Error(\"Over Flow\");\n }",
"throw new Error(\"Over Flow\");",
"new Error(\"Over Flow\")",
"top++",
"top",
"Stack[top] = x",
"Stack[top]",
"Stack",
"top",
"x",
"int x",
"x",
"private static int pop() {\n if (isEmpty()) {\n throw new Error(\"Under Flow\");\n }\n top--;\n return Stack[top + 1];\n }",
"pop",
"{\n if (isEmpty()) {\n throw new Error(\"Under Flow\");\n }\n top--;\n return Stack[top + 1];\n }",
"if (isEmpty()) {\n throw new Error(\"Under Flow\");\n }",
"isEmpty()",
"isEmpty",
"{\n throw new Error(\"Under Flow\");\n }",
"throw new Error(\"Under Flow\");",
"new Error(\"Under Flow\")",
"top--",
"top",
"return Stack[top + 1];",
"Stack[top + 1]",
"Stack",
"top + 1",
"top",
"1",
"private static void print(int[] A) {\n System.out.println(Arrays.toString(A));\n }",
"print",
"{\n System.out.println(Arrays.toString(A));\n }",
"System.out.println(Arrays.toString(A))",
"System.out.println",
"System.out",
"System",
"System.out",
"Arrays.toString(A)",
"Arrays.toString",
"Arrays",
"A",
"int[] A",
"A",
"public class Main {\n static int Max = 1000;\n static int top;\n static int[] Stack = new int[Max];\n\n public static void main(final String[] args) {\n initialize();\n Scanner sc = new Scanner(System.in);\n String s = sc.nextLine();\n String[] str = s.split(\" \");\n for (int i = 0; i < str.length; i++) {\n if (Character.isDigit(str[i].charAt(0))) {\n push(Integer.parseInt(str[i]));\n }\n else if (String.valueOf(str[i]).equals(\"+\")) {\n int a = pop();\n int b = pop();\n push(a + b);\n }\n else if (String.valueOf(str[i]).equals(\"-\")) {\n int a = pop();\n int b = pop();\n push(b - a);\n }\n else if (String.valueOf(str[i]).equals(\"*\")) {\n int a = pop();\n int b = pop();\n push(a * b);\n }\n }\n System.out.println(pop());\n }\n\n private static void initialize() {\n top = 0;\n }\n\n private static boolean isEmpty() {\n return top == 0;\n }\n\n private static boolean isFull() {\n return top >= Max - 1;\n }\n\n private static void push(int x) {\n if (isFull()) {\n throw new Error(\"Over Flow\");\n }\n top++;\n Stack[top] = x;\n }\n\n private static int pop() {\n if (isEmpty()) {\n throw new Error(\"Under Flow\");\n }\n top--;\n return Stack[top + 1];\n }\n\n private static void print(int[] A) {\n System.out.println(Arrays.toString(A));\n }\n}",
"public class Main {\n static int Max = 1000;\n static int top;\n static int[] Stack = new int[Max];\n\n public static void main(final String[] args) {\n initialize();\n Scanner sc = new Scanner(System.in);\n String s = sc.nextLine();\n String[] str = s.split(\" \");\n for (int i = 0; i < str.length; i++) {\n if (Character.isDigit(str[i].charAt(0))) {\n push(Integer.parseInt(str[i]));\n }\n else if (String.valueOf(str[i]).equals(\"+\")) {\n int a = pop();\n int b = pop();\n push(a + b);\n }\n else if (String.valueOf(str[i]).equals(\"-\")) {\n int a = pop();\n int b = pop();\n push(b - a);\n }\n else if (String.valueOf(str[i]).equals(\"*\")) {\n int a = pop();\n int b = pop();\n push(a * b);\n }\n }\n System.out.println(pop());\n }\n\n private static void initialize() {\n top = 0;\n }\n\n private static boolean isEmpty() {\n return top == 0;\n }\n\n private static boolean isFull() {\n return top >= Max - 1;\n }\n\n private static void push(int x) {\n if (isFull()) {\n throw new Error(\"Over Flow\");\n }\n top++;\n Stack[top] = x;\n }\n\n private static int pop() {\n if (isEmpty()) {\n throw new Error(\"Under Flow\");\n }\n top--;\n return Stack[top + 1];\n }\n\n private static void print(int[] A) {\n System.out.println(Arrays.toString(A));\n }\n}",
"Main"
] | import java.util.Arrays;
import java.util.Scanner;
public class Main {
static int Max = 1000;
static int top;
static int[] Stack = new int[Max];
public static void main(final String[] args) {
initialize();
Scanner sc = new Scanner(System.in);
String s = sc.nextLine();
String[] str = s.split(" ");
for (int i = 0; i < str.length; i++) {
if (Character.isDigit(str[i].charAt(0))) {
push(Integer.parseInt(str[i]));
}
else if (String.valueOf(str[i]).equals("+")) {
int a = pop();
int b = pop();
push(a + b);
}
else if (String.valueOf(str[i]).equals("-")) {
int a = pop();
int b = pop();
push(b - a);
}
else if (String.valueOf(str[i]).equals("*")) {
int a = pop();
int b = pop();
push(a * b);
}
}
System.out.println(pop());
}
private static void initialize() {
top = 0;
}
private static boolean isEmpty() {
return top == 0;
}
private static boolean isFull() {
return top >= Max - 1;
}
private static void push(int x) {
if (isFull()) {
throw new Error("Over Flow");
}
top++;
Stack[top] = x;
}
private static int pop() {
if (isEmpty()) {
throw new Error("Under Flow");
}
top--;
return Stack[top + 1];
}
private static void print(int[] A) {
System.out.println(Arrays.toString(A));
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
17,
41,
13,
41,
13,
20,
17,
42,
4,
18,
13,
30,
0,
13,
4,
18,
13,
14,
4,
13,
13,
30,
0,
18,
13,
2,
13,
17,
4,
18,
13,
13,
40,
13,
14,
2,
13,
17,
30,
35,
13,
34,
17,
1,
0,
18,
13,
2,
13,
17,
2,
18,
13,
2,
13,
17,
18,
13,
13,
40,
13,
3,
34,
17,
1,
0,
18,
13,
2,
13,
17,
2,
18,
13,
2,
13,
17,
18,
13,
13,
40,
13,
3,
34,
17,
1,
0,
18,
13,
2,
13,
17,
2,
18,
13,
2,
13,
17,
18,
13,
13,
40,
13,
3,
34,
1,
3,
4,
18,
13,
4,
18,
18,
13,
13,
18,
13,
13,
23,
13,
12,
13,
30,
41,
13,
4,
18,
18,
18,
18,
13,
13,
13,
13,
17,
41,
13,
4,
18,
13,
13,
29,
4,
18,
13,
23,
13,
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
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
8,
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
],
[
32,
34
],
[
31,
35
],
[
35,
36
],
[
36,
37
],
[
37,
38
],
[
37,
39
],
[
39,
40
],
[
39,
41
],
[
36,
42
],
[
42,
43
],
[
43,
44
],
[
42,
45
],
[
35,
46
],
[
46,
47
],
[
31,
48
],
[
48,
49
],
[
49,
50
],
[
49,
51
],
[
48,
52
],
[
52,
53
],
[
53,
54
],
[
53,
55
],
[
55,
56
],
[
55,
57
],
[
57,
58
],
[
58,
59
],
[
59,
60
],
[
59,
61
],
[
61,
62
],
[
61,
63
],
[
58,
64
],
[
64,
65
],
[
65,
66
],
[
65,
67
],
[
67,
68
],
[
67,
69
],
[
64,
70
],
[
70,
71
],
[
70,
72
],
[
57,
73
],
[
73,
74
],
[
57,
75
],
[
53,
76
],
[
76,
77
],
[
76,
78
],
[
78,
79
],
[
79,
80
],
[
80,
81
],
[
80,
82
],
[
82,
83
],
[
82,
84
],
[
79,
85
],
[
85,
86
],
[
86,
87
],
[
86,
88
],
[
88,
89
],
[
88,
90
],
[
85,
91
],
[
91,
92
],
[
91,
93
],
[
78,
94
],
[
94,
95
],
[
78,
96
],
[
53,
97
],
[
97,
98
],
[
97,
99
],
[
99,
100
],
[
100,
101
],
[
101,
102
],
[
101,
103
],
[
103,
104
],
[
103,
105
],
[
100,
106
],
[
106,
107
],
[
107,
108
],
[
107,
109
],
[
109,
110
],
[
109,
111
],
[
106,
112
],
[
112,
113
],
[
112,
114
],
[
99,
115
],
[
115,
116
],
[
99,
117
],
[
53,
118
],
[
118,
119
],
[
119,
120
],
[
8,
121
],
[
121,
122
],
[
122,
123
],
[
8,
124
],
[
124,
125
],
[
125,
126
],
[
126,
127
],
[
126,
128
],
[
124,
129
],
[
129,
130
],
[
129,
131
],
[
6,
132
],
[
132,
133
],
[
162,
134
],
[
134,
135
],
[
134,
136
],
[
136,
137
],
[
137,
138
],
[
137,
139
],
[
139,
140
],
[
140,
141
],
[
141,
142
],
[
142,
143
],
[
143,
144
],
[
143,
145
],
[
142,
146
],
[
141,
147
],
[
139,
148
],
[
136,
149
],
[
149,
150
],
[
149,
151
],
[
151,
152
],
[
152,
153
],
[
151,
154
],
[
136,
155
],
[
155,
156
],
[
156,
157
],
[
157,
158
],
[
134,
159
],
[
159,
160
],
[
0,
161
],
[
161,
162
],
[
161,
163
]
] | [
"import java.util.Scanner;\n\npublic class Main {\n\tpublic static void main (String [] args) {\n\t\tScanner scan = new Scanner (System.in);\n\t\tint top = 0;\n\t\tString s;\n\t\tint stack[] = new int[101];\n\t\t\n\t\twhile (scan.hasNext()) {\n\t\t\ts = scan.next();\n\t\t\t\n\t\t\tif (isNum(s)) {\n\t\t\t\tstack[top + 1] = Integer.parseInt(s);\n\t\t\t\ttop++;\n\t\t\t} else if (top >= 2) {\n\t\t\t\tswitch (s) {\n\t\t\t\tcase \"+\":\n\t\t\t\t\tstack[top - 1] = stack[top - 1] + stack[top];\n\t\t\t\t\ttop--;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"-\":\n\t\t\t\t\tstack[top - 1] = stack[top - 1] - stack[top];\n\t\t\t\t\ttop--;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"*\":\n\t\t\t\t\tstack[top - 1] = stack[top - 1] * stack[top];\n\t\t\t\t\ttop--;\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tscan.close();\n\t\tSystem.out.println(stack[top]);\n\t\t\n\t}\n\t\n\tpublic static boolean isNum( String str) {\n\t\tjava.util.regex.Pattern pattern \n\t\t= java.util.regex.Pattern.compile(\"^[0-9]*$\");\n\t\tjava.util.regex.Matcher matcher\n\t\t= pattern.matcher(str);\n\t\t\n\t\treturn matcher.matches();\n\t}\n}\n",
"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\tint top = 0;\n\t\tString s;\n\t\tint stack[] = new int[101];\n\t\t\n\t\twhile (scan.hasNext()) {\n\t\t\ts = scan.next();\n\t\t\t\n\t\t\tif (isNum(s)) {\n\t\t\t\tstack[top + 1] = Integer.parseInt(s);\n\t\t\t\ttop++;\n\t\t\t} else if (top >= 2) {\n\t\t\t\tswitch (s) {\n\t\t\t\tcase \"+\":\n\t\t\t\t\tstack[top - 1] = stack[top - 1] + stack[top];\n\t\t\t\t\ttop--;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"-\":\n\t\t\t\t\tstack[top - 1] = stack[top - 1] - stack[top];\n\t\t\t\t\ttop--;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"*\":\n\t\t\t\t\tstack[top - 1] = stack[top - 1] * stack[top];\n\t\t\t\t\ttop--;\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tscan.close();\n\t\tSystem.out.println(stack[top]);\n\t\t\n\t}\n\t\n\tpublic static boolean isNum( String str) {\n\t\tjava.util.regex.Pattern pattern \n\t\t= java.util.regex.Pattern.compile(\"^[0-9]*$\");\n\t\tjava.util.regex.Matcher matcher\n\t\t= pattern.matcher(str);\n\t\t\n\t\treturn matcher.matches();\n\t}\n}",
"Main",
"public static void main (String [] args) {\n\t\tScanner scan = new Scanner (System.in);\n\t\tint top = 0;\n\t\tString s;\n\t\tint stack[] = new int[101];\n\t\t\n\t\twhile (scan.hasNext()) {\n\t\t\ts = scan.next();\n\t\t\t\n\t\t\tif (isNum(s)) {\n\t\t\t\tstack[top + 1] = Integer.parseInt(s);\n\t\t\t\ttop++;\n\t\t\t} else if (top >= 2) {\n\t\t\t\tswitch (s) {\n\t\t\t\tcase \"+\":\n\t\t\t\t\tstack[top - 1] = stack[top - 1] + stack[top];\n\t\t\t\t\ttop--;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"-\":\n\t\t\t\t\tstack[top - 1] = stack[top - 1] - stack[top];\n\t\t\t\t\ttop--;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"*\":\n\t\t\t\t\tstack[top - 1] = stack[top - 1] * stack[top];\n\t\t\t\t\ttop--;\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tscan.close();\n\t\tSystem.out.println(stack[top]);\n\t\t\n\t}",
"main",
"{\n\t\tScanner scan = new Scanner (System.in);\n\t\tint top = 0;\n\t\tString s;\n\t\tint stack[] = new int[101];\n\t\t\n\t\twhile (scan.hasNext()) {\n\t\t\ts = scan.next();\n\t\t\t\n\t\t\tif (isNum(s)) {\n\t\t\t\tstack[top + 1] = Integer.parseInt(s);\n\t\t\t\ttop++;\n\t\t\t} else if (top >= 2) {\n\t\t\t\tswitch (s) {\n\t\t\t\tcase \"+\":\n\t\t\t\t\tstack[top - 1] = stack[top - 1] + stack[top];\n\t\t\t\t\ttop--;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"-\":\n\t\t\t\t\tstack[top - 1] = stack[top - 1] - stack[top];\n\t\t\t\t\ttop--;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"*\":\n\t\t\t\t\tstack[top - 1] = stack[top - 1] * stack[top];\n\t\t\t\t\ttop--;\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tscan.close();\n\t\tSystem.out.println(stack[top]);\n\t\t\n\t}",
"Scanner scan = new Scanner (System.in);",
"scan",
"new Scanner (System.in)",
"int top = 0;",
"top",
"0",
"String s;",
"s",
"int stack[] = new int[101];",
"stack",
"new int[101]",
"101",
"while (scan.hasNext()) {\n\t\t\ts = scan.next();\n\t\t\t\n\t\t\tif (isNum(s)) {\n\t\t\t\tstack[top + 1] = Integer.parseInt(s);\n\t\t\t\ttop++;\n\t\t\t} else if (top >= 2) {\n\t\t\t\tswitch (s) {\n\t\t\t\tcase \"+\":\n\t\t\t\t\tstack[top - 1] = stack[top - 1] + stack[top];\n\t\t\t\t\ttop--;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"-\":\n\t\t\t\t\tstack[top - 1] = stack[top - 1] - stack[top];\n\t\t\t\t\ttop--;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"*\":\n\t\t\t\t\tstack[top - 1] = stack[top - 1] * stack[top];\n\t\t\t\t\ttop--;\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"scan.hasNext()",
"scan.hasNext",
"scan",
"{\n\t\t\ts = scan.next();\n\t\t\t\n\t\t\tif (isNum(s)) {\n\t\t\t\tstack[top + 1] = Integer.parseInt(s);\n\t\t\t\ttop++;\n\t\t\t} else if (top >= 2) {\n\t\t\t\tswitch (s) {\n\t\t\t\tcase \"+\":\n\t\t\t\t\tstack[top - 1] = stack[top - 1] + stack[top];\n\t\t\t\t\ttop--;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"-\":\n\t\t\t\t\tstack[top - 1] = stack[top - 1] - stack[top];\n\t\t\t\t\ttop--;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"*\":\n\t\t\t\t\tstack[top - 1] = stack[top - 1] * stack[top];\n\t\t\t\t\ttop--;\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"s = scan.next()",
"s",
"scan.next()",
"scan.next",
"scan",
"if (isNum(s)) {\n\t\t\t\tstack[top + 1] = Integer.parseInt(s);\n\t\t\t\ttop++;\n\t\t\t} else if (top >= 2) {\n\t\t\t\tswitch (s) {\n\t\t\t\tcase \"+\":\n\t\t\t\t\tstack[top - 1] = stack[top - 1] + stack[top];\n\t\t\t\t\ttop--;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"-\":\n\t\t\t\t\tstack[top - 1] = stack[top - 1] - stack[top];\n\t\t\t\t\ttop--;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"*\":\n\t\t\t\t\tstack[top - 1] = stack[top - 1] * stack[top];\n\t\t\t\t\ttop--;\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}",
"isNum(s)",
"isNum",
"s",
"{\n\t\t\t\tstack[top + 1] = Integer.parseInt(s);\n\t\t\t\ttop++;\n\t\t\t}",
"stack[top + 1] = Integer.parseInt(s)",
"stack[top + 1]",
"stack",
"top + 1",
"top",
"1",
"Integer.parseInt(s)",
"Integer.parseInt",
"Integer",
"s",
"top++",
"top",
"if (top >= 2) {\n\t\t\t\tswitch (s) {\n\t\t\t\tcase \"+\":\n\t\t\t\t\tstack[top - 1] = stack[top - 1] + stack[top];\n\t\t\t\t\ttop--;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"-\":\n\t\t\t\t\tstack[top - 1] = stack[top - 1] - stack[top];\n\t\t\t\t\ttop--;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"*\":\n\t\t\t\t\tstack[top - 1] = stack[top - 1] * stack[top];\n\t\t\t\t\ttop--;\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}",
"top >= 2",
"top",
"2",
"{\n\t\t\t\tswitch (s) {\n\t\t\t\tcase \"+\":\n\t\t\t\t\tstack[top - 1] = stack[top - 1] + stack[top];\n\t\t\t\t\ttop--;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"-\":\n\t\t\t\t\tstack[top - 1] = stack[top - 1] - stack[top];\n\t\t\t\t\ttop--;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"*\":\n\t\t\t\t\tstack[top - 1] = stack[top - 1] * stack[top];\n\t\t\t\t\ttop--;\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}",
"switch (s) {\n\t\t\t\tcase \"+\":\n\t\t\t\t\tstack[top - 1] = stack[top - 1] + stack[top];\n\t\t\t\t\ttop--;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"-\":\n\t\t\t\t\tstack[top - 1] = stack[top - 1] - stack[top];\n\t\t\t\t\ttop--;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"*\":\n\t\t\t\t\tstack[top - 1] = stack[top - 1] * stack[top];\n\t\t\t\t\ttop--;\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tbreak;\n\t\t\t\t}",
"s",
"case \"+\":",
"\"+\"",
"case \"+\":",
"stack[top - 1] = stack[top - 1] + stack[top]",
"stack[top - 1]",
"stack",
"top - 1",
"top",
"1",
"stack[top - 1] + stack[top]",
"stack[top - 1]",
"stack",
"top - 1",
"top",
"1",
"stack[top]",
"stack",
"top",
"top--",
"top",
"break;",
"case \"-\":",
"\"-\"",
"case \"-\":",
"stack[top - 1] = stack[top - 1] - stack[top]",
"stack[top - 1]",
"stack",
"top - 1",
"top",
"1",
"stack[top - 1] - stack[top]",
"stack[top - 1]",
"stack",
"top - 1",
"top",
"1",
"stack[top]",
"stack",
"top",
"top--",
"top",
"break;",
"case \"*\":",
"\"*\"",
"case \"*\":",
"stack[top - 1] = stack[top - 1] * stack[top]",
"stack[top - 1]",
"stack",
"top - 1",
"top",
"1",
"stack[top - 1] * stack[top]",
"stack[top - 1]",
"stack",
"top - 1",
"top",
"1",
"stack[top]",
"stack",
"top",
"top--",
"top",
"break;",
"default:",
"default:",
"break;",
"scan.close()",
"scan.close",
"scan",
"System.out.println(stack[top])",
"System.out.println",
"System.out",
"System",
"System.out",
"stack[top]",
"stack",
"top",
"String [] args",
"args",
"public static boolean isNum( String str) {\n\t\tjava.util.regex.Pattern pattern \n\t\t= java.util.regex.Pattern.compile(\"^[0-9]*$\");\n\t\tjava.util.regex.Matcher matcher\n\t\t= pattern.matcher(str);\n\t\t\n\t\treturn matcher.matches();\n\t}",
"isNum",
"{\n\t\tjava.util.regex.Pattern pattern \n\t\t= java.util.regex.Pattern.compile(\"^[0-9]*$\");\n\t\tjava.util.regex.Matcher matcher\n\t\t= pattern.matcher(str);\n\t\t\n\t\treturn matcher.matches();\n\t}",
"java.util.regex.Pattern pattern \n\t\t= java.util.regex.Pattern.compile(\"^[0-9]*$\");",
"pattern",
"java.util.regex.Pattern.compile(\"^[0-9]*$\")",
"java.util.regex.Pattern.compile",
"java.util.regex.Pattern",
"java.util.regex",
"java.util",
"java",
"java.util",
"java.util.regex",
"java.util.regex.Pattern",
"\"^[0-9]*$\"",
"java.util.regex.Matcher matcher\n\t\t= pattern.matcher(str);",
"matcher",
"pattern.matcher(str)",
"pattern.matcher",
"pattern",
"str",
"return matcher.matches();",
"matcher.matches()",
"matcher.matches",
"matcher",
"String str",
"str",
"public class Main {\n\tpublic static void main (String [] args) {\n\t\tScanner scan = new Scanner (System.in);\n\t\tint top = 0;\n\t\tString s;\n\t\tint stack[] = new int[101];\n\t\t\n\t\twhile (scan.hasNext()) {\n\t\t\ts = scan.next();\n\t\t\t\n\t\t\tif (isNum(s)) {\n\t\t\t\tstack[top + 1] = Integer.parseInt(s);\n\t\t\t\ttop++;\n\t\t\t} else if (top >= 2) {\n\t\t\t\tswitch (s) {\n\t\t\t\tcase \"+\":\n\t\t\t\t\tstack[top - 1] = stack[top - 1] + stack[top];\n\t\t\t\t\ttop--;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"-\":\n\t\t\t\t\tstack[top - 1] = stack[top - 1] - stack[top];\n\t\t\t\t\ttop--;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"*\":\n\t\t\t\t\tstack[top - 1] = stack[top - 1] * stack[top];\n\t\t\t\t\ttop--;\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tscan.close();\n\t\tSystem.out.println(stack[top]);\n\t\t\n\t}\n\t\n\tpublic static boolean isNum( String str) {\n\t\tjava.util.regex.Pattern pattern \n\t\t= java.util.regex.Pattern.compile(\"^[0-9]*$\");\n\t\tjava.util.regex.Matcher matcher\n\t\t= pattern.matcher(str);\n\t\t\n\t\treturn matcher.matches();\n\t}\n}",
"public class Main {\n\tpublic static void main (String [] args) {\n\t\tScanner scan = new Scanner (System.in);\n\t\tint top = 0;\n\t\tString s;\n\t\tint stack[] = new int[101];\n\t\t\n\t\twhile (scan.hasNext()) {\n\t\t\ts = scan.next();\n\t\t\t\n\t\t\tif (isNum(s)) {\n\t\t\t\tstack[top + 1] = Integer.parseInt(s);\n\t\t\t\ttop++;\n\t\t\t} else if (top >= 2) {\n\t\t\t\tswitch (s) {\n\t\t\t\tcase \"+\":\n\t\t\t\t\tstack[top - 1] = stack[top - 1] + stack[top];\n\t\t\t\t\ttop--;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"-\":\n\t\t\t\t\tstack[top - 1] = stack[top - 1] - stack[top];\n\t\t\t\t\ttop--;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"*\":\n\t\t\t\t\tstack[top - 1] = stack[top - 1] * stack[top];\n\t\t\t\t\ttop--;\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tscan.close();\n\t\tSystem.out.println(stack[top]);\n\t\t\n\t}\n\t\n\tpublic static boolean isNum( String str) {\n\t\tjava.util.regex.Pattern pattern \n\t\t= java.util.regex.Pattern.compile(\"^[0-9]*$\");\n\t\tjava.util.regex.Matcher matcher\n\t\t= pattern.matcher(str);\n\t\t\n\t\treturn matcher.matches();\n\t}\n}",
"Main"
] | import java.util.Scanner;
public class Main {
public static void main (String [] args) {
Scanner scan = new Scanner (System.in);
int top = 0;
String s;
int stack[] = new int[101];
while (scan.hasNext()) {
s = scan.next();
if (isNum(s)) {
stack[top + 1] = Integer.parseInt(s);
top++;
} else if (top >= 2) {
switch (s) {
case "+":
stack[top - 1] = stack[top - 1] + stack[top];
top--;
break;
case "-":
stack[top - 1] = stack[top - 1] - stack[top];
top--;
break;
case "*":
stack[top - 1] = stack[top - 1] * stack[top];
top--;
break;
default:
break;
}
}
}
scan.close();
System.out.println(stack[top]);
}
public static boolean isNum( String str) {
java.util.regex.Pattern pattern
= java.util.regex.Pattern.compile("^[0-9]*$");
java.util.regex.Matcher matcher
= pattern.matcher(str);
return matcher.matches();
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
41,
13,
20,
12,
13,
30,
41,
13,
41,
13,
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,
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
],
[
136,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
14,
17
],
[
17,
18
],
[
14,
19
],
[
19,
20
],
[
19,
21
],
[
21,
22
],
[
22,
23
],
[
23,
24
],
[
24,
25
],
[
21,
26
],
[
14,
27
],
[
27,
28
],
[
27,
29
],
[
14,
30
],
[
30,
31
],
[
31,
32
],
[
32,
33
],
[
32,
34
],
[
30,
35
],
[
35,
36
],
[
35,
37
],
[
37,
38
],
[
37,
39
],
[
30,
40
],
[
40,
41
],
[
41,
42
],
[
30,
43
],
[
44,
44
],
[
44,
45
],
[
45,
46
],
[
46,
47
],
[
47,
48
],
[
48,
49
],
[
48,
50
],
[
46,
51
],
[
45,
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
],
[
45,
69
],
[
69,
70
],
[
70,
71
],
[
71,
72
],
[
72,
73
],
[
72,
74
],
[
70,
75
],
[
69,
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
],
[
69,
93
],
[
93,
94
],
[
94,
95
],
[
95,
96
],
[
96,
97
],
[
96,
98
],
[
94,
99
],
[
93,
100
],
[
100,
101
],
[
101,
102
],
[
101,
103
],
[
103,
104
],
[
104,
105
],
[
100,
106
],
[
106,
107
],
[
106,
108
],
[
108,
109
],
[
109,
110
],
[
100,
111
],
[
111,
112
],
[
112,
113
],
[
111,
114
],
[
114,
115
],
[
114,
116
],
[
93,
117
],
[
117,
118
],
[
118,
119
],
[
119,
120
],
[
118,
121
],
[
121,
122
],
[
122,
123
],
[
121,
124
],
[
124,
125
],
[
124,
126
],
[
14,
127
],
[
127,
128
],
[
128,
129
],
[
127,
130
],
[
130,
131
],
[
131,
132
],
[
12,
133
],
[
133,
134
],
[
0,
135
],
[
135,
136
],
[
135,
137
]
] | [
"import java.util.*;\nimport static java.lang.System.*;\n\npublic class Main {\n\tstatic Scanner sc = new Scanner(System.in);\n\tpublic static void main(String[] args) {\n\t\tint a,b;\n\t\tString[] ar = sc.nextLine().split(\" \");\n\t\tDeque<Integer> deque = new ArrayDeque<>();\n\t\tfor (int i=0; i<ar.length; i++) {\n\t\t\tif (ar[i].equals(\"+\")) {\n\t\t\t\ta = deque.removeFirst();\n\t\t\t\tb = deque.removeFirst();\n\t\t\t\tdeque.addFirst(a+b);\n\t\t\t}\n\t\t\telse if (ar[i].equals(\"-\")) {\n\t\t\t\ta = deque.removeFirst();\n\t\t\t\tb = deque.removeFirst();\n\t\t\t\tdeque.addFirst(b-a);\n\t\t\t}\n\t\t\telse if (ar[i].equals(\"*\")) {\n\t\t\t\ta = deque.removeFirst();\n\t\t\t\tb = deque.removeFirst();\n\t\t\t\tdeque.addFirst(a*b);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tdeque.addFirst(Integer.parseInt(ar[i]));\n\t\t\t}\n\t\t}\n\t\tout.println(deque.getFirst());\n\t}\n}\n",
"import java.util.*;",
"util.*",
"java",
"import static java.lang.System.*;",
"import static java.lang.System.*;",
"import static java.lang.System.*;",
"public class Main {\n\tstatic Scanner sc = new Scanner(System.in);\n\tpublic static void main(String[] args) {\n\t\tint a,b;\n\t\tString[] ar = sc.nextLine().split(\" \");\n\t\tDeque<Integer> deque = new ArrayDeque<>();\n\t\tfor (int i=0; i<ar.length; i++) {\n\t\t\tif (ar[i].equals(\"+\")) {\n\t\t\t\ta = deque.removeFirst();\n\t\t\t\tb = deque.removeFirst();\n\t\t\t\tdeque.addFirst(a+b);\n\t\t\t}\n\t\t\telse if (ar[i].equals(\"-\")) {\n\t\t\t\ta = deque.removeFirst();\n\t\t\t\tb = deque.removeFirst();\n\t\t\t\tdeque.addFirst(b-a);\n\t\t\t}\n\t\t\telse if (ar[i].equals(\"*\")) {\n\t\t\t\ta = deque.removeFirst();\n\t\t\t\tb = deque.removeFirst();\n\t\t\t\tdeque.addFirst(a*b);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tdeque.addFirst(Integer.parseInt(ar[i]));\n\t\t\t}\n\t\t}\n\t\tout.println(deque.getFirst());\n\t}\n}",
"Main",
"static Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"public static void main(String[] args) {\n\t\tint a,b;\n\t\tString[] ar = sc.nextLine().split(\" \");\n\t\tDeque<Integer> deque = new ArrayDeque<>();\n\t\tfor (int i=0; i<ar.length; i++) {\n\t\t\tif (ar[i].equals(\"+\")) {\n\t\t\t\ta = deque.removeFirst();\n\t\t\t\tb = deque.removeFirst();\n\t\t\t\tdeque.addFirst(a+b);\n\t\t\t}\n\t\t\telse if (ar[i].equals(\"-\")) {\n\t\t\t\ta = deque.removeFirst();\n\t\t\t\tb = deque.removeFirst();\n\t\t\t\tdeque.addFirst(b-a);\n\t\t\t}\n\t\t\telse if (ar[i].equals(\"*\")) {\n\t\t\t\ta = deque.removeFirst();\n\t\t\t\tb = deque.removeFirst();\n\t\t\t\tdeque.addFirst(a*b);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tdeque.addFirst(Integer.parseInt(ar[i]));\n\t\t\t}\n\t\t}\n\t\tout.println(deque.getFirst());\n\t}",
"main",
"{\n\t\tint a,b;\n\t\tString[] ar = sc.nextLine().split(\" \");\n\t\tDeque<Integer> deque = new ArrayDeque<>();\n\t\tfor (int i=0; i<ar.length; i++) {\n\t\t\tif (ar[i].equals(\"+\")) {\n\t\t\t\ta = deque.removeFirst();\n\t\t\t\tb = deque.removeFirst();\n\t\t\t\tdeque.addFirst(a+b);\n\t\t\t}\n\t\t\telse if (ar[i].equals(\"-\")) {\n\t\t\t\ta = deque.removeFirst();\n\t\t\t\tb = deque.removeFirst();\n\t\t\t\tdeque.addFirst(b-a);\n\t\t\t}\n\t\t\telse if (ar[i].equals(\"*\")) {\n\t\t\t\ta = deque.removeFirst();\n\t\t\t\tb = deque.removeFirst();\n\t\t\t\tdeque.addFirst(a*b);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tdeque.addFirst(Integer.parseInt(ar[i]));\n\t\t\t}\n\t\t}\n\t\tout.println(deque.getFirst());\n\t}",
"int a",
"a",
"b;",
"b",
"String[] ar = sc.nextLine().split(\" \");",
"ar",
"sc.nextLine().split(\" \")",
"sc.nextLine().split",
"sc.nextLine()",
"sc.nextLine",
"sc",
"\" \"",
"Deque<Integer> deque = new ArrayDeque<>();",
"deque",
"new ArrayDeque<>()",
"for (int i=0; i<ar.length; i++) {\n\t\t\tif (ar[i].equals(\"+\")) {\n\t\t\t\ta = deque.removeFirst();\n\t\t\t\tb = deque.removeFirst();\n\t\t\t\tdeque.addFirst(a+b);\n\t\t\t}\n\t\t\telse if (ar[i].equals(\"-\")) {\n\t\t\t\ta = deque.removeFirst();\n\t\t\t\tb = deque.removeFirst();\n\t\t\t\tdeque.addFirst(b-a);\n\t\t\t}\n\t\t\telse if (ar[i].equals(\"*\")) {\n\t\t\t\ta = deque.removeFirst();\n\t\t\t\tb = deque.removeFirst();\n\t\t\t\tdeque.addFirst(a*b);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tdeque.addFirst(Integer.parseInt(ar[i]));\n\t\t\t}\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<ar.length",
"i",
"ar.length",
"ar",
"ar.length",
"i++",
"i++",
"i",
"{\n\t\t\tif (ar[i].equals(\"+\")) {\n\t\t\t\ta = deque.removeFirst();\n\t\t\t\tb = deque.removeFirst();\n\t\t\t\tdeque.addFirst(a+b);\n\t\t\t}\n\t\t\telse if (ar[i].equals(\"-\")) {\n\t\t\t\ta = deque.removeFirst();\n\t\t\t\tb = deque.removeFirst();\n\t\t\t\tdeque.addFirst(b-a);\n\t\t\t}\n\t\t\telse if (ar[i].equals(\"*\")) {\n\t\t\t\ta = deque.removeFirst();\n\t\t\t\tb = deque.removeFirst();\n\t\t\t\tdeque.addFirst(a*b);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tdeque.addFirst(Integer.parseInt(ar[i]));\n\t\t\t}\n\t\t}",
"{\n\t\t\tif (ar[i].equals(\"+\")) {\n\t\t\t\ta = deque.removeFirst();\n\t\t\t\tb = deque.removeFirst();\n\t\t\t\tdeque.addFirst(a+b);\n\t\t\t}\n\t\t\telse if (ar[i].equals(\"-\")) {\n\t\t\t\ta = deque.removeFirst();\n\t\t\t\tb = deque.removeFirst();\n\t\t\t\tdeque.addFirst(b-a);\n\t\t\t}\n\t\t\telse if (ar[i].equals(\"*\")) {\n\t\t\t\ta = deque.removeFirst();\n\t\t\t\tb = deque.removeFirst();\n\t\t\t\tdeque.addFirst(a*b);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tdeque.addFirst(Integer.parseInt(ar[i]));\n\t\t\t}\n\t\t}",
"if (ar[i].equals(\"+\")) {\n\t\t\t\ta = deque.removeFirst();\n\t\t\t\tb = deque.removeFirst();\n\t\t\t\tdeque.addFirst(a+b);\n\t\t\t}\n\t\t\telse if (ar[i].equals(\"-\")) {\n\t\t\t\ta = deque.removeFirst();\n\t\t\t\tb = deque.removeFirst();\n\t\t\t\tdeque.addFirst(b-a);\n\t\t\t}\n\t\t\telse if (ar[i].equals(\"*\")) {\n\t\t\t\ta = deque.removeFirst();\n\t\t\t\tb = deque.removeFirst();\n\t\t\t\tdeque.addFirst(a*b);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tdeque.addFirst(Integer.parseInt(ar[i]));\n\t\t\t}",
"ar[i].equals(\"+\")",
"ar[i].equals",
"ar[i]",
"ar",
"i",
"\"+\"",
"{\n\t\t\t\ta = deque.removeFirst();\n\t\t\t\tb = deque.removeFirst();\n\t\t\t\tdeque.addFirst(a+b);\n\t\t\t}",
"a = deque.removeFirst()",
"a",
"deque.removeFirst()",
"deque.removeFirst",
"deque",
"b = deque.removeFirst()",
"b",
"deque.removeFirst()",
"deque.removeFirst",
"deque",
"deque.addFirst(a+b)",
"deque.addFirst",
"deque",
"a+b",
"a",
"b",
"if (ar[i].equals(\"-\")) {\n\t\t\t\ta = deque.removeFirst();\n\t\t\t\tb = deque.removeFirst();\n\t\t\t\tdeque.addFirst(b-a);\n\t\t\t}\n\t\t\telse if (ar[i].equals(\"*\")) {\n\t\t\t\ta = deque.removeFirst();\n\t\t\t\tb = deque.removeFirst();\n\t\t\t\tdeque.addFirst(a*b);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tdeque.addFirst(Integer.parseInt(ar[i]));\n\t\t\t}",
"ar[i].equals(\"-\")",
"ar[i].equals",
"ar[i]",
"ar",
"i",
"\"-\"",
"{\n\t\t\t\ta = deque.removeFirst();\n\t\t\t\tb = deque.removeFirst();\n\t\t\t\tdeque.addFirst(b-a);\n\t\t\t}",
"a = deque.removeFirst()",
"a",
"deque.removeFirst()",
"deque.removeFirst",
"deque",
"b = deque.removeFirst()",
"b",
"deque.removeFirst()",
"deque.removeFirst",
"deque",
"deque.addFirst(b-a)",
"deque.addFirst",
"deque",
"b-a",
"b",
"a",
"if (ar[i].equals(\"*\")) {\n\t\t\t\ta = deque.removeFirst();\n\t\t\t\tb = deque.removeFirst();\n\t\t\t\tdeque.addFirst(a*b);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tdeque.addFirst(Integer.parseInt(ar[i]));\n\t\t\t}",
"ar[i].equals(\"*\")",
"ar[i].equals",
"ar[i]",
"ar",
"i",
"\"*\"",
"{\n\t\t\t\ta = deque.removeFirst();\n\t\t\t\tb = deque.removeFirst();\n\t\t\t\tdeque.addFirst(a*b);\n\t\t\t}",
"a = deque.removeFirst()",
"a",
"deque.removeFirst()",
"deque.removeFirst",
"deque",
"b = deque.removeFirst()",
"b",
"deque.removeFirst()",
"deque.removeFirst",
"deque",
"deque.addFirst(a*b)",
"deque.addFirst",
"deque",
"a*b",
"a",
"b",
"{\n\t\t\t\tdeque.addFirst(Integer.parseInt(ar[i]));\n\t\t\t}",
"deque.addFirst(Integer.parseInt(ar[i]))",
"deque.addFirst",
"deque",
"Integer.parseInt(ar[i])",
"Integer.parseInt",
"Integer",
"ar[i]",
"ar",
"i",
"out.println(deque.getFirst())",
"out.println",
"out",
"deque.getFirst()",
"deque.getFirst",
"deque",
"String[] args",
"args",
"public class Main {\n\tstatic Scanner sc = new Scanner(System.in);\n\tpublic static void main(String[] args) {\n\t\tint a,b;\n\t\tString[] ar = sc.nextLine().split(\" \");\n\t\tDeque<Integer> deque = new ArrayDeque<>();\n\t\tfor (int i=0; i<ar.length; i++) {\n\t\t\tif (ar[i].equals(\"+\")) {\n\t\t\t\ta = deque.removeFirst();\n\t\t\t\tb = deque.removeFirst();\n\t\t\t\tdeque.addFirst(a+b);\n\t\t\t}\n\t\t\telse if (ar[i].equals(\"-\")) {\n\t\t\t\ta = deque.removeFirst();\n\t\t\t\tb = deque.removeFirst();\n\t\t\t\tdeque.addFirst(b-a);\n\t\t\t}\n\t\t\telse if (ar[i].equals(\"*\")) {\n\t\t\t\ta = deque.removeFirst();\n\t\t\t\tb = deque.removeFirst();\n\t\t\t\tdeque.addFirst(a*b);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tdeque.addFirst(Integer.parseInt(ar[i]));\n\t\t\t}\n\t\t}\n\t\tout.println(deque.getFirst());\n\t}\n}",
"public class Main {\n\tstatic Scanner sc = new Scanner(System.in);\n\tpublic static void main(String[] args) {\n\t\tint a,b;\n\t\tString[] ar = sc.nextLine().split(\" \");\n\t\tDeque<Integer> deque = new ArrayDeque<>();\n\t\tfor (int i=0; i<ar.length; i++) {\n\t\t\tif (ar[i].equals(\"+\")) {\n\t\t\t\ta = deque.removeFirst();\n\t\t\t\tb = deque.removeFirst();\n\t\t\t\tdeque.addFirst(a+b);\n\t\t\t}\n\t\t\telse if (ar[i].equals(\"-\")) {\n\t\t\t\ta = deque.removeFirst();\n\t\t\t\tb = deque.removeFirst();\n\t\t\t\tdeque.addFirst(b-a);\n\t\t\t}\n\t\t\telse if (ar[i].equals(\"*\")) {\n\t\t\t\ta = deque.removeFirst();\n\t\t\t\tb = deque.removeFirst();\n\t\t\t\tdeque.addFirst(a*b);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tdeque.addFirst(Integer.parseInt(ar[i]));\n\t\t\t}\n\t\t}\n\t\tout.println(deque.getFirst());\n\t}\n}",
"Main"
] | import java.util.*;
import static java.lang.System.*;
public class Main {
static Scanner sc = new Scanner(System.in);
public static void main(String[] args) {
int a,b;
String[] ar = sc.nextLine().split(" ");
Deque<Integer> deque = new ArrayDeque<>();
for (int i=0; i<ar.length; i++) {
if (ar[i].equals("+")) {
a = deque.removeFirst();
b = deque.removeFirst();
deque.addFirst(a+b);
}
else if (ar[i].equals("-")) {
a = deque.removeFirst();
b = deque.removeFirst();
deque.addFirst(b-a);
}
else if (ar[i].equals("*")) {
a = deque.removeFirst();
b = deque.removeFirst();
deque.addFirst(a*b);
}
else {
deque.addFirst(Integer.parseInt(ar[i]));
}
}
out.println(deque.getFirst());
}
}
|
[
7,
15,
13,
17,
6,
13,
41,
13,
17,
41,
13,
17,
41,
13,
20,
13,
12,
13,
30,
38,
5,
13,
30,
29,
17,
30,
4,
18,
13,
13,
29,
17,
23,
13,
12,
13,
30,
0,
13,
17,
12,
13,
30,
29,
2,
13,
17,
12,
13,
30,
29,
2,
13,
2,
13,
17,
12,
13,
30,
14,
4,
13,
30,
37,
20,
30,
40,
13,
0,
18,
13,
13,
13,
23,
13,
12,
13,
30,
14,
4,
13,
30,
37,
20,
30,
40,
13,
29,
18,
13,
2,
13,
17,
12,
13,
30,
41,
13,
20,
41,
13,
17,
41,
13,
42,
4,
18,
13,
30,
0,
13,
4,
18,
13,
14,
4,
13,
13,
30,
4,
13,
4,
18,
13,
13,
14,
4,
18,
13,
17,
30,
0,
13,
2,
4,
13,
4,
13,
4,
13,
13,
14,
4,
18,
13,
17,
30,
0,
13,
40,
2,
4,
13,
4,
13,
4,
13,
13,
30,
0,
13,
2,
4,
13,
4,
13,
4,
13,
13,
4,
18,
18,
13,
13,
4,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
179,
5
],
[
179,
6
],
[
6,
7
],
[
6,
8
],
[
179,
9
],
[
9,
10
],
[
9,
11
],
[
179,
12
],
[
12,
13
],
[
12,
14
],
[
179,
16
],
[
16,
17
],
[
16,
18
],
[
18,
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
],
[
16,
32
],
[
32,
33
],
[
179,
34
],
[
34,
35
],
[
34,
36
],
[
36,
37
],
[
37,
38
],
[
37,
39
],
[
179,
40
],
[
40,
41
],
[
40,
42
],
[
42,
43
],
[
43,
44
],
[
44,
45
],
[
44,
46
],
[
179,
47
],
[
47,
48
],
[
47,
49
],
[
49,
50
],
[
50,
51
],
[
51,
52
],
[
51,
53
],
[
53,
54
],
[
53,
55
],
[
179,
56
],
[
56,
57
],
[
56,
58
],
[
58,
59
],
[
59,
60
],
[
60,
61
],
[
59,
62
],
[
62,
63
],
[
63,
64
],
[
59,
65
],
[
65,
66
],
[
66,
67
],
[
65,
68
],
[
68,
69
],
[
69,
70
],
[
69,
71
],
[
68,
72
],
[
56,
73
],
[
73,
74
],
[
179,
75
],
[
75,
76
],
[
75,
77
],
[
77,
78
],
[
78,
79
],
[
79,
80
],
[
78,
81
],
[
81,
82
],
[
82,
83
],
[
78,
84
],
[
84,
85
],
[
85,
86
],
[
84,
87
],
[
87,
88
],
[
88,
89
],
[
88,
90
],
[
90,
91
],
[
90,
92
],
[
179,
93
],
[
93,
94
],
[
93,
95
],
[
95,
96
],
[
96,
97
],
[
96,
98
],
[
95,
99
],
[
99,
100
],
[
99,
101
],
[
95,
102
],
[
102,
103
],
[
95,
104
],
[
104,
105
],
[
105,
106
],
[
106,
107
],
[
104,
108
],
[
108,
109
],
[
109,
110
],
[
109,
111
],
[
111,
112
],
[
112,
113
],
[
108,
114
],
[
114,
115
],
[
115,
116
],
[
115,
117
],
[
114,
118
],
[
118,
119
],
[
119,
120
],
[
119,
121
],
[
121,
122
],
[
122,
123
],
[
121,
124
],
[
114,
125
],
[
125,
126
],
[
126,
127
],
[
127,
128
],
[
126,
129
],
[
125,
130
],
[
130,
131
],
[
131,
132
],
[
131,
133
],
[
133,
134
],
[
134,
135
],
[
133,
136
],
[
136,
137
],
[
130,
138
],
[
138,
139
],
[
138,
140
],
[
125,
141
],
[
141,
142
],
[
142,
143
],
[
143,
144
],
[
142,
145
],
[
141,
146
],
[
146,
147
],
[
147,
148
],
[
147,
149
],
[
149,
150
],
[
150,
151
],
[
151,
152
],
[
150,
153
],
[
153,
154
],
[
146,
155
],
[
155,
156
],
[
155,
157
],
[
141,
158
],
[
158,
159
],
[
159,
160
],
[
159,
161
],
[
161,
162
],
[
162,
163
],
[
161,
164
],
[
164,
165
],
[
158,
166
],
[
166,
167
],
[
166,
168
],
[
95,
169
],
[
169,
170
],
[
170,
171
],
[
171,
172
],
[
171,
173
],
[
169,
174
],
[
174,
175
],
[
93,
176
],
[
176,
177
],
[
0,
178
],
[
178,
179
],
[
178,
180
]
] | [
"import java.util.*;\n\npublic class Main {\n static int top = 0;\n static int max = 110;\n static int[] stack = new int[max];\n\n public static boolean isNum(String str) {\n try {\n Integer.parseInt(str);\n return true;\n } catch(NumberFormatException e) {\n return false;\n }\n }\n public static void initialize() {\n top = 0;\n }\n public static boolean isEmpty() {\n return top == 0;\n }\n public static boolean isFull() {\n return top >= max - 1;\n }\n public static void push(int x) {\n if(isFull()) {\n throw new IllegalArgumentException(\"オーバーフロー\");\n } else {\n top++;\n stack[top] = x;\n }\n }\n public static int pop() {\n if(isEmpty()) {\n throw new IllegalArgumentException(\"アンダーフロー\");\n } else {\n top--;\n return stack[top + 1];\n }\n }\n\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n String s = \"\";\n int a;\n while(sc.hasNext()) {\n s = sc.next();\n if(isNum(s)) {\n push(Integer.parseInt(s));\n } else if(s.equals(\"+\")) {\n a = pop() + pop();\n push(a);\n } else if(s.equals(\"-\")) {\n a = - (pop() - pop());\n push(a);\n } else {\n a = pop() * pop();\n push(a);\n }\n }\n System.out.println(pop());\n }\n}\n",
"import java.util.*;",
"util.*",
"java",
"public class Main {\n static int top = 0;\n static int max = 110;\n static int[] stack = new int[max];\n\n public static boolean isNum(String str) {\n try {\n Integer.parseInt(str);\n return true;\n } catch(NumberFormatException e) {\n return false;\n }\n }\n public static void initialize() {\n top = 0;\n }\n public static boolean isEmpty() {\n return top == 0;\n }\n public static boolean isFull() {\n return top >= max - 1;\n }\n public static void push(int x) {\n if(isFull()) {\n throw new IllegalArgumentException(\"オーバーフロー\");\n } else {\n top++;\n stack[top] = x;\n }\n }\n public static int pop() {\n if(isEmpty()) {\n throw new IllegalArgumentException(\"アンダーフロー\");\n } else {\n top--;\n return stack[top + 1];\n }\n }\n\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n String s = \"\";\n int a;\n while(sc.hasNext()) {\n s = sc.next();\n if(isNum(s)) {\n push(Integer.parseInt(s));\n } else if(s.equals(\"+\")) {\n a = pop() + pop();\n push(a);\n } else if(s.equals(\"-\")) {\n a = - (pop() - pop());\n push(a);\n } else {\n a = pop() * pop();\n push(a);\n }\n }\n System.out.println(pop());\n }\n}",
"Main",
"static int top = 0;",
"top",
"0",
"static int max = 110;",
"max",
"110",
"static int[] stack = new int[max];",
"stack",
"new int[max]",
"max",
"public static boolean isNum(String str) {\n try {\n Integer.parseInt(str);\n return true;\n } catch(NumberFormatException e) {\n return false;\n }\n }",
"isNum",
"{\n try {\n Integer.parseInt(str);\n return true;\n } catch(NumberFormatException e) {\n return false;\n }\n }",
"try {\n Integer.parseInt(str);\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(str);\n return true;\n }",
"Integer.parseInt(str)",
"Integer.parseInt",
"Integer",
"str",
"return true;",
"true",
"String str",
"str",
"public static void initialize() {\n top = 0;\n }",
"initialize",
"{\n top = 0;\n }",
"top = 0",
"top",
"0",
"public static boolean isEmpty() {\n return top == 0;\n }",
"isEmpty",
"{\n return top == 0;\n }",
"return top == 0;",
"top == 0",
"top",
"0",
"public static boolean isFull() {\n return top >= max - 1;\n }",
"isFull",
"{\n return top >= max - 1;\n }",
"return top >= max - 1;",
"top >= max - 1",
"top",
"max - 1",
"max",
"1",
"public static void push(int x) {\n if(isFull()) {\n throw new IllegalArgumentException(\"オーバーフロー\");\n } else {\n top++;\n stack[top] = x;\n }\n }",
"push",
"{\n if(isFull()) {\n throw new IllegalArgumentException(\"オーバーフロー\");\n } else {\n top++;\n stack[top] = x;\n }\n }",
"if(isFull()) {\n throw new IllegalArgumentException(\"オーバーフロー\");\n } else {\n top++;\n stack[top] = x;\n }",
"isFull()",
"isFull",
"{\n throw new IllegalArgumentException(\"オーバーフロー\");\n }",
"throw new IllegalArgumentException(\"オーバーフロー\");",
"new IllegalArgumentException(\"オーバーフロー\")",
"{\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 if(isEmpty()) {\n throw new IllegalArgumentException(\"アンダーフロー\");\n } else {\n top--;\n return stack[top + 1];\n }\n }",
"pop",
"{\n if(isEmpty()) {\n throw new IllegalArgumentException(\"アンダーフロー\");\n } else {\n top--;\n return stack[top + 1];\n }\n }",
"if(isEmpty()) {\n throw new IllegalArgumentException(\"アンダーフロー\");\n } else {\n top--;\n return stack[top + 1];\n }",
"isEmpty()",
"isEmpty",
"{\n throw new IllegalArgumentException(\"アンダーフロー\");\n }",
"throw new IllegalArgumentException(\"アンダーフロー\");",
"new IllegalArgumentException(\"アンダーフロー\")",
"{\n top--;\n return stack[top + 1];\n }",
"top--",
"top",
"return stack[top + 1];",
"stack[top + 1]",
"stack",
"top + 1",
"top",
"1",
"public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n String s = \"\";\n int a;\n while(sc.hasNext()) {\n s = sc.next();\n if(isNum(s)) {\n push(Integer.parseInt(s));\n } else if(s.equals(\"+\")) {\n a = pop() + pop();\n push(a);\n } else if(s.equals(\"-\")) {\n a = - (pop() - pop());\n push(a);\n } else {\n a = pop() * pop();\n push(a);\n }\n }\n System.out.println(pop());\n }",
"main",
"{\n Scanner sc = new Scanner(System.in);\n String s = \"\";\n int a;\n while(sc.hasNext()) {\n s = sc.next();\n if(isNum(s)) {\n push(Integer.parseInt(s));\n } else if(s.equals(\"+\")) {\n a = pop() + pop();\n push(a);\n } else if(s.equals(\"-\")) {\n a = - (pop() - pop());\n push(a);\n } else {\n a = pop() * pop();\n push(a);\n }\n }\n System.out.println(pop());\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"String s = \"\";",
"s",
"\"\"",
"int a;",
"a",
"while(sc.hasNext()) {\n s = sc.next();\n if(isNum(s)) {\n push(Integer.parseInt(s));\n } else if(s.equals(\"+\")) {\n a = pop() + pop();\n push(a);\n } else if(s.equals(\"-\")) {\n a = - (pop() - pop());\n push(a);\n } else {\n a = pop() * pop();\n push(a);\n }\n }",
"sc.hasNext()",
"sc.hasNext",
"sc",
"{\n s = sc.next();\n if(isNum(s)) {\n push(Integer.parseInt(s));\n } else if(s.equals(\"+\")) {\n a = pop() + pop();\n push(a);\n } else if(s.equals(\"-\")) {\n a = - (pop() - pop());\n push(a);\n } else {\n a = pop() * pop();\n push(a);\n }\n }",
"s = sc.next()",
"s",
"sc.next()",
"sc.next",
"sc",
"if(isNum(s)) {\n push(Integer.parseInt(s));\n } else if(s.equals(\"+\")) {\n a = pop() + pop();\n push(a);\n } else if(s.equals(\"-\")) {\n a = - (pop() - pop());\n push(a);\n } else {\n a = pop() * pop();\n push(a);\n }",
"isNum(s)",
"isNum",
"s",
"{\n push(Integer.parseInt(s));\n }",
"push(Integer.parseInt(s))",
"push",
"Integer.parseInt(s)",
"Integer.parseInt",
"Integer",
"s",
"if(s.equals(\"+\")) {\n a = pop() + pop();\n push(a);\n } else if(s.equals(\"-\")) {\n a = - (pop() - pop());\n push(a);\n } else {\n a = pop() * pop();\n push(a);\n }",
"s.equals(\"+\")",
"s.equals",
"s",
"\"+\"",
"{\n a = pop() + pop();\n push(a);\n }",
"a = pop() + pop()",
"a",
"pop() + pop()",
"pop()",
"pop",
"pop()",
"pop",
"push(a)",
"push",
"a",
"if(s.equals(\"-\")) {\n a = - (pop() - pop());\n push(a);\n } else {\n a = pop() * pop();\n push(a);\n }",
"s.equals(\"-\")",
"s.equals",
"s",
"\"-\"",
"{\n a = - (pop() - pop());\n push(a);\n }",
"a = - (pop() - pop())",
"a",
"- (pop() - pop())",
"(pop() - pop())",
"pop()",
"pop",
"pop()",
"pop",
"push(a)",
"push",
"a",
"{\n a = pop() * pop();\n push(a);\n }",
"a = pop() * pop()",
"a",
"pop() * pop()",
"pop()",
"pop",
"pop()",
"pop",
"push(a)",
"push",
"a",
"System.out.println(pop())",
"System.out.println",
"System.out",
"System",
"System.out",
"pop()",
"pop",
"String[] args",
"args",
"public class Main {\n static int top = 0;\n static int max = 110;\n static int[] stack = new int[max];\n\n public static boolean isNum(String str) {\n try {\n Integer.parseInt(str);\n return true;\n } catch(NumberFormatException e) {\n return false;\n }\n }\n public static void initialize() {\n top = 0;\n }\n public static boolean isEmpty() {\n return top == 0;\n }\n public static boolean isFull() {\n return top >= max - 1;\n }\n public static void push(int x) {\n if(isFull()) {\n throw new IllegalArgumentException(\"オーバーフロー\");\n } else {\n top++;\n stack[top] = x;\n }\n }\n public static int pop() {\n if(isEmpty()) {\n throw new IllegalArgumentException(\"アンダーフロー\");\n } else {\n top--;\n return stack[top + 1];\n }\n }\n\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n String s = \"\";\n int a;\n while(sc.hasNext()) {\n s = sc.next();\n if(isNum(s)) {\n push(Integer.parseInt(s));\n } else if(s.equals(\"+\")) {\n a = pop() + pop();\n push(a);\n } else if(s.equals(\"-\")) {\n a = - (pop() - pop());\n push(a);\n } else {\n a = pop() * pop();\n push(a);\n }\n }\n System.out.println(pop());\n }\n}",
"public class Main {\n static int top = 0;\n static int max = 110;\n static int[] stack = new int[max];\n\n public static boolean isNum(String str) {\n try {\n Integer.parseInt(str);\n return true;\n } catch(NumberFormatException e) {\n return false;\n }\n }\n public static void initialize() {\n top = 0;\n }\n public static boolean isEmpty() {\n return top == 0;\n }\n public static boolean isFull() {\n return top >= max - 1;\n }\n public static void push(int x) {\n if(isFull()) {\n throw new IllegalArgumentException(\"オーバーフロー\");\n } else {\n top++;\n stack[top] = x;\n }\n }\n public static int pop() {\n if(isEmpty()) {\n throw new IllegalArgumentException(\"アンダーフロー\");\n } else {\n top--;\n return stack[top + 1];\n }\n }\n\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n String s = \"\";\n int a;\n while(sc.hasNext()) {\n s = sc.next();\n if(isNum(s)) {\n push(Integer.parseInt(s));\n } else if(s.equals(\"+\")) {\n a = pop() + pop();\n push(a);\n } else if(s.equals(\"-\")) {\n a = - (pop() - pop());\n push(a);\n } else {\n a = pop() * pop();\n push(a);\n }\n }\n System.out.println(pop());\n }\n}",
"Main"
] | import java.util.*;
public class Main {
static int top = 0;
static int max = 110;
static int[] stack = new int[max];
public static boolean isNum(String str) {
try {
Integer.parseInt(str);
return true;
} catch(NumberFormatException e) {
return false;
}
}
public static void initialize() {
top = 0;
}
public static boolean isEmpty() {
return top == 0;
}
public static boolean isFull() {
return top >= max - 1;
}
public static void push(int x) {
if(isFull()) {
throw new IllegalArgumentException("オーバーフロー");
} else {
top++;
stack[top] = x;
}
}
public static int pop() {
if(isEmpty()) {
throw new IllegalArgumentException("アンダーフロー");
} else {
top--;
return stack[top + 1];
}
}
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String s = "";
int a;
while(sc.hasNext()) {
s = sc.next();
if(isNum(s)) {
push(Integer.parseInt(s));
} else if(s.equals("+")) {
a = pop() + pop();
push(a);
} else if(s.equals("-")) {
a = - (pop() - pop());
push(a);
} else {
a = pop() * pop();
push(a);
}
}
System.out.println(pop());
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
17,
41,
13,
17,
41,
13,
41,
13,
20,
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,
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,
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
],
[
139,
5
],
[
139,
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
],
[
8,
20
],
[
20,
21
],
[
20,
22
],
[
8,
23
],
[
23,
24
],
[
23,
25
],
[
25,
26
],
[
26,
27
],
[
27,
28
],
[
28,
29
],
[
25,
30
],
[
8,
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
],
[
47,
48
],
[
48,
49
],
[
49,
50
],
[
49,
51
],
[
47,
52
],
[
46,
53
],
[
53,
54
],
[
54,
55
],
[
54,
56
],
[
56,
57
],
[
57,
58
],
[
53,
59
],
[
59,
60
],
[
59,
61
],
[
61,
62
],
[
62,
63
],
[
53,
64
],
[
64,
65
],
[
65,
66
],
[
64,
67
],
[
67,
68
],
[
67,
69
],
[
46,
70
],
[
70,
71
],
[
71,
72
],
[
72,
73
],
[
73,
74
],
[
73,
75
],
[
71,
76
],
[
70,
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
],
[
70,
94
],
[
94,
95
],
[
95,
96
],
[
96,
97
],
[
97,
98
],
[
97,
99
],
[
95,
100
],
[
94,
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
],
[
94,
118
],
[
118,
119
],
[
119,
120
],
[
120,
121
],
[
119,
122
],
[
122,
123
],
[
123,
124
],
[
122,
125
],
[
125,
126
],
[
125,
127
],
[
8,
128
],
[
128,
129
],
[
129,
130
],
[
130,
131
],
[
130,
132
],
[
128,
133
],
[
133,
134
],
[
134,
135
],
[
6,
136
],
[
136,
137
],
[
0,
138
],
[
138,
139
],
[
138,
140
]
] | [
"import java.util.Scanner;\n\npublic class Main {\n\n\tpublic static void main(String[] args) {\n\n\t\tjava.util.Stack<Integer> stack = new java.util.Stack<Integer>();\n\t\tint a = 0, b = 0;\n\t\tString[] c;\n\t\tScanner sc = new Scanner(System.in);\n\t\tc = sc.nextLine().split(\" \");\n\n\t\tfor (int i = 0; i < c.length; i++) {\n\t\t\tif (c[i].equals(\"+\")) {\n\t\t\t\tint o2 = stack.pop();\n\t\t\t\tint o1 = stack.pop();\n\t\t\t\tstack.push(o1 + o2);\n\t\t\t} else if (c[i].equals(\"-\")) {\n\t\t\t\tint o2 = stack.pop();\n\t\t\t\tint o1 = stack.pop();\n\t\t\t\tstack.push(o1 - o2);\n\t\t\t} else if (c[i].equals(\"*\")) {\n\t\t\t\tint o2 = stack.pop();\n\t\t\t\tint o1 = stack.pop();\n\t\t\t\tstack.push(o1 * o2);\n\t\t\t} else {\n\t\t\t\tstack.push(Integer.parseInt(c[i]));\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(stack.pop());\n\n\t}\n\n}\n",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\n\t\tjava.util.Stack<Integer> stack = new java.util.Stack<Integer>();\n\t\tint a = 0, b = 0;\n\t\tString[] c;\n\t\tScanner sc = new Scanner(System.in);\n\t\tc = sc.nextLine().split(\" \");\n\n\t\tfor (int i = 0; i < c.length; i++) {\n\t\t\tif (c[i].equals(\"+\")) {\n\t\t\t\tint o2 = stack.pop();\n\t\t\t\tint o1 = stack.pop();\n\t\t\t\tstack.push(o1 + o2);\n\t\t\t} else if (c[i].equals(\"-\")) {\n\t\t\t\tint o2 = stack.pop();\n\t\t\t\tint o1 = stack.pop();\n\t\t\t\tstack.push(o1 - o2);\n\t\t\t} else if (c[i].equals(\"*\")) {\n\t\t\t\tint o2 = stack.pop();\n\t\t\t\tint o1 = stack.pop();\n\t\t\t\tstack.push(o1 * o2);\n\t\t\t} else {\n\t\t\t\tstack.push(Integer.parseInt(c[i]));\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(stack.pop());\n\n\t}\n\n}",
"Main",
"public static void main(String[] args) {\n\n\t\tjava.util.Stack<Integer> stack = new java.util.Stack<Integer>();\n\t\tint a = 0, b = 0;\n\t\tString[] c;\n\t\tScanner sc = new Scanner(System.in);\n\t\tc = sc.nextLine().split(\" \");\n\n\t\tfor (int i = 0; i < c.length; i++) {\n\t\t\tif (c[i].equals(\"+\")) {\n\t\t\t\tint o2 = stack.pop();\n\t\t\t\tint o1 = stack.pop();\n\t\t\t\tstack.push(o1 + o2);\n\t\t\t} else if (c[i].equals(\"-\")) {\n\t\t\t\tint o2 = stack.pop();\n\t\t\t\tint o1 = stack.pop();\n\t\t\t\tstack.push(o1 - o2);\n\t\t\t} else if (c[i].equals(\"*\")) {\n\t\t\t\tint o2 = stack.pop();\n\t\t\t\tint o1 = stack.pop();\n\t\t\t\tstack.push(o1 * o2);\n\t\t\t} else {\n\t\t\t\tstack.push(Integer.parseInt(c[i]));\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(stack.pop());\n\n\t}",
"main",
"{\n\n\t\tjava.util.Stack<Integer> stack = new java.util.Stack<Integer>();\n\t\tint a = 0, b = 0;\n\t\tString[] c;\n\t\tScanner sc = new Scanner(System.in);\n\t\tc = sc.nextLine().split(\" \");\n\n\t\tfor (int i = 0; i < c.length; i++) {\n\t\t\tif (c[i].equals(\"+\")) {\n\t\t\t\tint o2 = stack.pop();\n\t\t\t\tint o1 = stack.pop();\n\t\t\t\tstack.push(o1 + o2);\n\t\t\t} else if (c[i].equals(\"-\")) {\n\t\t\t\tint o2 = stack.pop();\n\t\t\t\tint o1 = stack.pop();\n\t\t\t\tstack.push(o1 - o2);\n\t\t\t} else if (c[i].equals(\"*\")) {\n\t\t\t\tint o2 = stack.pop();\n\t\t\t\tint o1 = stack.pop();\n\t\t\t\tstack.push(o1 * o2);\n\t\t\t} else {\n\t\t\t\tstack.push(Integer.parseInt(c[i]));\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(stack.pop());\n\n\t}",
"java.util.Stack<Integer> stack = new java.util.Stack<Integer>();",
"stack",
"new java.util.Stack<Integer>()",
"int a = 0",
"a",
"0",
"b = 0;",
"b",
"0",
"String[] c;",
"c",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"c = sc.nextLine().split(\" \")",
"c",
"sc.nextLine().split(\" \")",
"sc.nextLine().split",
"sc.nextLine()",
"sc.nextLine",
"sc",
"\" \"",
"for (int i = 0; i < c.length; i++) {\n\t\t\tif (c[i].equals(\"+\")) {\n\t\t\t\tint o2 = stack.pop();\n\t\t\t\tint o1 = stack.pop();\n\t\t\t\tstack.push(o1 + o2);\n\t\t\t} else if (c[i].equals(\"-\")) {\n\t\t\t\tint o2 = stack.pop();\n\t\t\t\tint o1 = stack.pop();\n\t\t\t\tstack.push(o1 - o2);\n\t\t\t} else if (c[i].equals(\"*\")) {\n\t\t\t\tint o2 = stack.pop();\n\t\t\t\tint o1 = stack.pop();\n\t\t\t\tstack.push(o1 * o2);\n\t\t\t} else {\n\t\t\t\tstack.push(Integer.parseInt(c[i]));\n\t\t\t}\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < c.length",
"i",
"c.length",
"c",
"c.length",
"i++",
"i++",
"i",
"{\n\t\t\tif (c[i].equals(\"+\")) {\n\t\t\t\tint o2 = stack.pop();\n\t\t\t\tint o1 = stack.pop();\n\t\t\t\tstack.push(o1 + o2);\n\t\t\t} else if (c[i].equals(\"-\")) {\n\t\t\t\tint o2 = stack.pop();\n\t\t\t\tint o1 = stack.pop();\n\t\t\t\tstack.push(o1 - o2);\n\t\t\t} else if (c[i].equals(\"*\")) {\n\t\t\t\tint o2 = stack.pop();\n\t\t\t\tint o1 = stack.pop();\n\t\t\t\tstack.push(o1 * o2);\n\t\t\t} else {\n\t\t\t\tstack.push(Integer.parseInt(c[i]));\n\t\t\t}\n\t\t}",
"{\n\t\t\tif (c[i].equals(\"+\")) {\n\t\t\t\tint o2 = stack.pop();\n\t\t\t\tint o1 = stack.pop();\n\t\t\t\tstack.push(o1 + o2);\n\t\t\t} else if (c[i].equals(\"-\")) {\n\t\t\t\tint o2 = stack.pop();\n\t\t\t\tint o1 = stack.pop();\n\t\t\t\tstack.push(o1 - o2);\n\t\t\t} else if (c[i].equals(\"*\")) {\n\t\t\t\tint o2 = stack.pop();\n\t\t\t\tint o1 = stack.pop();\n\t\t\t\tstack.push(o1 * o2);\n\t\t\t} else {\n\t\t\t\tstack.push(Integer.parseInt(c[i]));\n\t\t\t}\n\t\t}",
"if (c[i].equals(\"+\")) {\n\t\t\t\tint o2 = stack.pop();\n\t\t\t\tint o1 = stack.pop();\n\t\t\t\tstack.push(o1 + o2);\n\t\t\t} else if (c[i].equals(\"-\")) {\n\t\t\t\tint o2 = stack.pop();\n\t\t\t\tint o1 = stack.pop();\n\t\t\t\tstack.push(o1 - o2);\n\t\t\t} else if (c[i].equals(\"*\")) {\n\t\t\t\tint o2 = stack.pop();\n\t\t\t\tint o1 = stack.pop();\n\t\t\t\tstack.push(o1 * o2);\n\t\t\t} else {\n\t\t\t\tstack.push(Integer.parseInt(c[i]));\n\t\t\t}",
"c[i].equals(\"+\")",
"c[i].equals",
"c[i]",
"c",
"i",
"\"+\"",
"{\n\t\t\t\tint o2 = stack.pop();\n\t\t\t\tint o1 = stack.pop();\n\t\t\t\tstack.push(o1 + o2);\n\t\t\t}",
"int o2 = stack.pop();",
"o2",
"stack.pop()",
"stack.pop",
"stack",
"int o1 = stack.pop();",
"o1",
"stack.pop()",
"stack.pop",
"stack",
"stack.push(o1 + o2)",
"stack.push",
"stack",
"o1 + o2",
"o1",
"o2",
"if (c[i].equals(\"-\")) {\n\t\t\t\tint o2 = stack.pop();\n\t\t\t\tint o1 = stack.pop();\n\t\t\t\tstack.push(o1 - o2);\n\t\t\t} else if (c[i].equals(\"*\")) {\n\t\t\t\tint o2 = stack.pop();\n\t\t\t\tint o1 = stack.pop();\n\t\t\t\tstack.push(o1 * o2);\n\t\t\t} else {\n\t\t\t\tstack.push(Integer.parseInt(c[i]));\n\t\t\t}",
"c[i].equals(\"-\")",
"c[i].equals",
"c[i]",
"c",
"i",
"\"-\"",
"{\n\t\t\t\tint o2 = stack.pop();\n\t\t\t\tint o1 = stack.pop();\n\t\t\t\tstack.push(o1 - o2);\n\t\t\t}",
"int o2 = stack.pop();",
"o2",
"stack.pop()",
"stack.pop",
"stack",
"int o1 = stack.pop();",
"o1",
"stack.pop()",
"stack.pop",
"stack",
"stack.push(o1 - o2)",
"stack.push",
"stack",
"o1 - o2",
"o1",
"o2",
"if (c[i].equals(\"*\")) {\n\t\t\t\tint o2 = stack.pop();\n\t\t\t\tint o1 = stack.pop();\n\t\t\t\tstack.push(o1 * o2);\n\t\t\t} else {\n\t\t\t\tstack.push(Integer.parseInt(c[i]));\n\t\t\t}",
"c[i].equals(\"*\")",
"c[i].equals",
"c[i]",
"c",
"i",
"\"*\"",
"{\n\t\t\t\tint o2 = stack.pop();\n\t\t\t\tint o1 = stack.pop();\n\t\t\t\tstack.push(o1 * o2);\n\t\t\t}",
"int o2 = stack.pop();",
"o2",
"stack.pop()",
"stack.pop",
"stack",
"int o1 = stack.pop();",
"o1",
"stack.pop()",
"stack.pop",
"stack",
"stack.push(o1 * o2)",
"stack.push",
"stack",
"o1 * o2",
"o1",
"o2",
"{\n\t\t\t\tstack.push(Integer.parseInt(c[i]));\n\t\t\t}",
"stack.push(Integer.parseInt(c[i]))",
"stack.push",
"stack",
"Integer.parseInt(c[i])",
"Integer.parseInt",
"Integer",
"c[i]",
"c",
"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\n\tpublic static void main(String[] args) {\n\n\t\tjava.util.Stack<Integer> stack = new java.util.Stack<Integer>();\n\t\tint a = 0, b = 0;\n\t\tString[] c;\n\t\tScanner sc = new Scanner(System.in);\n\t\tc = sc.nextLine().split(\" \");\n\n\t\tfor (int i = 0; i < c.length; i++) {\n\t\t\tif (c[i].equals(\"+\")) {\n\t\t\t\tint o2 = stack.pop();\n\t\t\t\tint o1 = stack.pop();\n\t\t\t\tstack.push(o1 + o2);\n\t\t\t} else if (c[i].equals(\"-\")) {\n\t\t\t\tint o2 = stack.pop();\n\t\t\t\tint o1 = stack.pop();\n\t\t\t\tstack.push(o1 - o2);\n\t\t\t} else if (c[i].equals(\"*\")) {\n\t\t\t\tint o2 = stack.pop();\n\t\t\t\tint o1 = stack.pop();\n\t\t\t\tstack.push(o1 * o2);\n\t\t\t} else {\n\t\t\t\tstack.push(Integer.parseInt(c[i]));\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(stack.pop());\n\n\t}\n\n}",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\n\t\tjava.util.Stack<Integer> stack = new java.util.Stack<Integer>();\n\t\tint a = 0, b = 0;\n\t\tString[] c;\n\t\tScanner sc = new Scanner(System.in);\n\t\tc = sc.nextLine().split(\" \");\n\n\t\tfor (int i = 0; i < c.length; i++) {\n\t\t\tif (c[i].equals(\"+\")) {\n\t\t\t\tint o2 = stack.pop();\n\t\t\t\tint o1 = stack.pop();\n\t\t\t\tstack.push(o1 + o2);\n\t\t\t} else if (c[i].equals(\"-\")) {\n\t\t\t\tint o2 = stack.pop();\n\t\t\t\tint o1 = stack.pop();\n\t\t\t\tstack.push(o1 - o2);\n\t\t\t} else if (c[i].equals(\"*\")) {\n\t\t\t\tint o2 = stack.pop();\n\t\t\t\tint o1 = stack.pop();\n\t\t\t\tstack.push(o1 * o2);\n\t\t\t} else {\n\t\t\t\tstack.push(Integer.parseInt(c[i]));\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(stack.pop());\n\n\t}\n\n}",
"Main"
] | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
java.util.Stack<Integer> stack = new java.util.Stack<Integer>();
int a = 0, b = 0;
String[] c;
Scanner sc = new Scanner(System.in);
c = sc.nextLine().split(" ");
for (int i = 0; i < c.length; i++) {
if (c[i].equals("+")) {
int o2 = stack.pop();
int o1 = stack.pop();
stack.push(o1 + o2);
} else if (c[i].equals("-")) {
int o2 = stack.pop();
int o1 = stack.pop();
stack.push(o1 - o2);
} else if (c[i].equals("*")) {
int o2 = stack.pop();
int o1 = stack.pop();
stack.push(o1 * o2);
} else {
stack.push(Integer.parseInt(c[i]));
}
}
System.out.println(stack.pop());
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
17,
41,
13,
17,
38,
30,
41,
13,
20,
42,
4,
18,
13,
30,
41,
13,
4,
18,
13,
14,
2,
4,
18,
13,
17,
17,
30,
0,
18,
13,
2,
13,
17,
18,
13,
2,
13,
17,
40,
13,
14,
2,
4,
18,
13,
17,
17,
30,
0,
18,
13,
2,
13,
17,
18,
13,
2,
13,
17,
40,
13,
14,
2,
4,
18,
13,
17,
17,
30,
0,
18,
13,
2,
13,
17,
18,
13,
2,
13,
17,
40,
13,
30,
0,
18,
13,
13,
4,
18,
13,
13,
40,
13,
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,
13
],
[
13,
14
],
[
13,
15
],
[
8,
16
],
[
16,
17
],
[
17,
18
],
[
18,
19
],
[
18,
20
],
[
17,
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
],
[
34,
35
],
[
33,
36
],
[
32,
37
],
[
31,
38
],
[
38,
39
],
[
39,
40
],
[
40,
41
],
[
40,
42
],
[
42,
43
],
[
42,
44
],
[
39,
45
],
[
45,
46
],
[
45,
47
],
[
47,
48
],
[
47,
49
],
[
38,
50
],
[
50,
51
],
[
31,
52
],
[
52,
53
],
[
53,
54
],
[
54,
55
],
[
55,
56
],
[
54,
57
],
[
53,
58
],
[
52,
59
],
[
59,
60
],
[
60,
61
],
[
61,
62
],
[
61,
63
],
[
63,
64
],
[
63,
65
],
[
60,
66
],
[
66,
67
],
[
66,
68
],
[
68,
69
],
[
68,
70
],
[
59,
71
],
[
71,
72
],
[
52,
73
],
[
73,
74
],
[
74,
75
],
[
75,
76
],
[
76,
77
],
[
75,
78
],
[
74,
79
],
[
73,
80
],
[
80,
81
],
[
81,
82
],
[
82,
83
],
[
82,
84
],
[
84,
85
],
[
84,
86
],
[
81,
87
],
[
87,
88
],
[
87,
89
],
[
89,
90
],
[
89,
91
],
[
80,
92
],
[
92,
93
],
[
73,
94
],
[
94,
95
],
[
95,
96
],
[
96,
97
],
[
96,
98
],
[
95,
99
],
[
99,
100
],
[
100,
101
],
[
99,
102
],
[
94,
103
],
[
103,
104
],
[
8,
105
],
[
105,
106
],
[
106,
107
],
[
107,
108
],
[
107,
109
],
[
105,
110
],
[
110,
111
],
[
110,
112
],
[
6,
113
],
[
113,
114
]
] | [
"import java.util.*;\n\nclass Main {\n public static void main(String args[]) {\n int[] stack = new int[1000];\n int i = 0;\n try (Scanner sc = new Scanner(System.in)) {\n while (sc.hasNext()) {\n String S = sc.next();\n if (S.charAt(0) == '+') {\n stack[i-2] += stack[i-1];\n i--;\n } else if(S.charAt(0) == '*'){\n stack[i-2] *= stack[i-1];\n i--;\n } else if(S.charAt(0) == '-'){\n stack[i-2] -= stack[i-1];\n i--;\n } else {\n stack[i] = Integer.parseInt(S);\n i++;\n }\n }\n }\n System.out.println(stack[0]);\n }\n}",
"import java.util.*;",
"util.*",
"java",
"class Main {\n public static void main(String args[]) {\n int[] stack = new int[1000];\n int i = 0;\n try (Scanner sc = new Scanner(System.in)) {\n while (sc.hasNext()) {\n String S = sc.next();\n if (S.charAt(0) == '+') {\n stack[i-2] += stack[i-1];\n i--;\n } else if(S.charAt(0) == '*'){\n stack[i-2] *= stack[i-1];\n i--;\n } else if(S.charAt(0) == '-'){\n stack[i-2] -= stack[i-1];\n i--;\n } else {\n stack[i] = Integer.parseInt(S);\n i++;\n }\n }\n }\n System.out.println(stack[0]);\n }\n}",
"Main",
"public static void main(String args[]) {\n int[] stack = new int[1000];\n int i = 0;\n try (Scanner sc = new Scanner(System.in)) {\n while (sc.hasNext()) {\n String S = sc.next();\n if (S.charAt(0) == '+') {\n stack[i-2] += stack[i-1];\n i--;\n } else if(S.charAt(0) == '*'){\n stack[i-2] *= stack[i-1];\n i--;\n } else if(S.charAt(0) == '-'){\n stack[i-2] -= stack[i-1];\n i--;\n } else {\n stack[i] = Integer.parseInt(S);\n i++;\n }\n }\n }\n System.out.println(stack[0]);\n }",
"main",
"{\n int[] stack = new int[1000];\n int i = 0;\n try (Scanner sc = new Scanner(System.in)) {\n while (sc.hasNext()) {\n String S = sc.next();\n if (S.charAt(0) == '+') {\n stack[i-2] += stack[i-1];\n i--;\n } else if(S.charAt(0) == '*'){\n stack[i-2] *= stack[i-1];\n i--;\n } else if(S.charAt(0) == '-'){\n stack[i-2] -= stack[i-1];\n i--;\n } else {\n stack[i] = Integer.parseInt(S);\n i++;\n }\n }\n }\n System.out.println(stack[0]);\n }",
"int[] stack = new int[1000];",
"stack",
"new int[1000]",
"1000",
"int i = 0;",
"i",
"0",
"try (Scanner sc = new Scanner(System.in)) {\n while (sc.hasNext()) {\n String S = sc.next();\n if (S.charAt(0) == '+') {\n stack[i-2] += stack[i-1];\n i--;\n } else if(S.charAt(0) == '*'){\n stack[i-2] *= stack[i-1];\n i--;\n } else if(S.charAt(0) == '-'){\n stack[i-2] -= stack[i-1];\n i--;\n } else {\n stack[i] = Integer.parseInt(S);\n i++;\n }\n }\n }",
"{\n while (sc.hasNext()) {\n String S = sc.next();\n if (S.charAt(0) == '+') {\n stack[i-2] += stack[i-1];\n i--;\n } else if(S.charAt(0) == '*'){\n stack[i-2] *= stack[i-1];\n i--;\n } else if(S.charAt(0) == '-'){\n stack[i-2] -= stack[i-1];\n i--;\n } else {\n stack[i] = Integer.parseInt(S);\n i++;\n }\n }\n }",
"Scanner sc = new Scanner(System.in)",
"Scanner sc = new Scanner(System.in)",
"new Scanner(System.in)",
"while (sc.hasNext()) {\n String S = sc.next();\n if (S.charAt(0) == '+') {\n stack[i-2] += stack[i-1];\n i--;\n } else if(S.charAt(0) == '*'){\n stack[i-2] *= stack[i-1];\n i--;\n } else if(S.charAt(0) == '-'){\n stack[i-2] -= stack[i-1];\n i--;\n } else {\n stack[i] = Integer.parseInt(S);\n i++;\n }\n }",
"sc.hasNext()",
"sc.hasNext",
"sc",
"{\n String S = sc.next();\n if (S.charAt(0) == '+') {\n stack[i-2] += stack[i-1];\n i--;\n } else if(S.charAt(0) == '*'){\n stack[i-2] *= stack[i-1];\n i--;\n } else if(S.charAt(0) == '-'){\n stack[i-2] -= stack[i-1];\n i--;\n } else {\n stack[i] = Integer.parseInt(S);\n i++;\n }\n }",
"String S = sc.next();",
"S",
"sc.next()",
"sc.next",
"sc",
"if (S.charAt(0) == '+') {\n stack[i-2] += stack[i-1];\n i--;\n } else if(S.charAt(0) == '*'){\n stack[i-2] *= stack[i-1];\n i--;\n } else if(S.charAt(0) == '-'){\n stack[i-2] -= stack[i-1];\n i--;\n } else {\n stack[i] = Integer.parseInt(S);\n i++;\n }",
"S.charAt(0) == '+'",
"S.charAt(0)",
"S.charAt",
"S",
"0",
"'+'",
"{\n stack[i-2] += stack[i-1];\n i--;\n }",
"stack[i-2] += stack[i-1]",
"stack[i-2]",
"stack",
"i-2",
"i",
"2",
"stack[i-1]",
"stack",
"i-1",
"i",
"1",
"i--",
"i",
"if(S.charAt(0) == '*'){\n stack[i-2] *= stack[i-1];\n i--;\n } else if(S.charAt(0) == '-'){\n stack[i-2] -= stack[i-1];\n i--;\n } else {\n stack[i] = Integer.parseInt(S);\n i++;\n }",
"S.charAt(0) == '*'",
"S.charAt(0)",
"S.charAt",
"S",
"0",
"'*'",
"{\n stack[i-2] *= stack[i-1];\n i--;\n }",
"stack[i-2] *= stack[i-1]",
"stack[i-2]",
"stack",
"i-2",
"i",
"2",
"stack[i-1]",
"stack",
"i-1",
"i",
"1",
"i--",
"i",
"if(S.charAt(0) == '-'){\n stack[i-2] -= stack[i-1];\n i--;\n } else {\n stack[i] = Integer.parseInt(S);\n i++;\n }",
"S.charAt(0) == '-'",
"S.charAt(0)",
"S.charAt",
"S",
"0",
"'-'",
"{\n stack[i-2] -= stack[i-1];\n i--;\n }",
"stack[i-2] -= stack[i-1]",
"stack[i-2]",
"stack",
"i-2",
"i",
"2",
"stack[i-1]",
"stack",
"i-1",
"i",
"1",
"i--",
"i",
"{\n stack[i] = Integer.parseInt(S);\n i++;\n }",
"stack[i] = Integer.parseInt(S)",
"stack[i]",
"stack",
"i",
"Integer.parseInt(S)",
"Integer.parseInt",
"Integer",
"S",
"i++",
"i",
"System.out.println(stack[0])",
"System.out.println",
"System.out",
"System",
"System.out",
"stack[0]",
"stack",
"0",
"String args[]",
"args"
] | import java.util.*;
class Main {
public static void main(String args[]) {
int[] stack = new int[1000];
int i = 0;
try (Scanner sc = new Scanner(System.in)) {
while (sc.hasNext()) {
String S = sc.next();
if (S.charAt(0) == '+') {
stack[i-2] += stack[i-1];
i--;
} else if(S.charAt(0) == '*'){
stack[i-2] *= stack[i-1];
i--;
} else if(S.charAt(0) == '-'){
stack[i-2] -= stack[i-1];
i--;
} else {
stack[i] = Integer.parseInt(S);
i++;
}
}
}
System.out.println(stack[0]);
}
} |
[
7,
15,
13,
17,
6,
13,
41,
13,
41,
13,
12,
13,
30,
0,
13,
20,
17,
0,
13,
17,
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,
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,
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,
4,
18,
13,
2,
40,
4,
18,
13,
4,
18,
13,
14,
4,
18,
13,
17,
30,
4,
18,
13,
2,
4,
18,
13,
4,
18,
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
],
[
6,
7
],
[
4,
8
],
[
8,
9
],
[
4,
10
],
[
10,
11
],
[
10,
12
],
[
12,
13
],
[
13,
14
],
[
13,
15
],
[
12,
17
],
[
17,
18
],
[
17,
19
],
[
4,
20
],
[
20,
21
],
[
20,
22
],
[
22,
23
],
[
23,
24
],
[
22,
25
],
[
25,
26
],
[
26,
27
],
[
26,
28
],
[
25,
29
],
[
20,
30
],
[
30,
31
],
[
4,
32
],
[
32,
33
],
[
32,
34
],
[
34,
35
],
[
35,
36
],
[
34,
37
],
[
37,
38
],
[
38,
39
],
[
38,
40
],
[
40,
41
],
[
40,
42
],
[
0,
43
],
[
156,
44
],
[
156,
45
],
[
45,
46
],
[
45,
47
],
[
47,
48
],
[
48,
49
],
[
48,
50
],
[
47,
51
],
[
51,
52
],
[
51,
53
],
[
53,
54
],
[
54,
55
],
[
47,
56
],
[
56,
57
],
[
56,
58
],
[
58,
59
],
[
59,
60
],
[
58,
61
],
[
47,
62
],
[
62,
63
],
[
62,
64
],
[
47,
65
],
[
65,
66
],
[
66,
67
],
[
67,
68
],
[
67,
69
],
[
65,
70
],
[
70,
71
],
[
70,
72
],
[
72,
73
],
[
72,
74
],
[
65,
75
],
[
75,
76
],
[
76,
77
],
[
65,
78
],
[
79,
79
],
[
79,
80
],
[
80,
81
],
[
80,
82
],
[
82,
83
],
[
82,
84
],
[
79,
85
],
[
85,
86
],
[
86,
87
],
[
87,
88
],
[
86,
89
],
[
85,
90
],
[
90,
91
],
[
91,
92
],
[
92,
93
],
[
91,
94
],
[
94,
95
],
[
95,
96
],
[
96,
97
],
[
94,
98
],
[
98,
99
],
[
99,
100
],
[
85,
101
],
[
101,
102
],
[
102,
103
],
[
103,
104
],
[
102,
105
],
[
101,
106
],
[
106,
107
],
[
107,
108
],
[
108,
109
],
[
107,
110
],
[
110,
111
],
[
111,
112
],
[
112,
113
],
[
113,
114
],
[
110,
115
],
[
115,
116
],
[
116,
117
],
[
101,
118
],
[
118,
119
],
[
119,
120
],
[
120,
121
],
[
119,
122
],
[
118,
123
],
[
123,
124
],
[
124,
125
],
[
125,
126
],
[
124,
127
],
[
127,
128
],
[
128,
129
],
[
129,
130
],
[
127,
131
],
[
131,
132
],
[
132,
133
],
[
118,
134
],
[
134,
135
],
[
135,
136
],
[
135,
137
],
[
137,
138
],
[
138,
139
],
[
137,
140
],
[
134,
141
],
[
141,
142
],
[
142,
143
],
[
141,
144
],
[
47,
145
],
[
145,
146
],
[
146,
147
],
[
147,
148
],
[
147,
149
],
[
145,
150
],
[
150,
151
],
[
151,
152
],
[
45,
153
],
[
153,
154
],
[
0,
155
],
[
155,
156
],
[
155,
157
]
] | [
"import java.io.*;\nclass Sta{\n int[] s;\n int top;\n Sta(){\n s=new int[1000];\n top=0;\n }\n void push(int x){\n top++;\n s[top]=x;\n }\n int pop(){\n top--;\n return s[top+1];\n }\n}\npublic class Main {\n public static void main(String[] args) throws IOException{\n BufferedReader din=new BufferedReader(new InputStreamReader(System.in));\n String line=din.readLine();\n String[] tokens=line.split(\" \");\n Sta stack=new Sta();\n for(int i=0;i<tokens.length;i++){\n String x=tokens[i];\n if(x.equals(\"+\")){\n stack.push(stack.pop()+stack.pop());\n }else if(x.equals(\"-\")){\n stack.push(-stack.pop()+stack.pop());\n }else if(x.equals(\"*\")){\n stack.push(stack.pop()*stack.pop());\n }else{\n int t=Integer.parseInt(x);\n stack.push(t);\n }\n }\n System.out.println(stack.pop());\n }\n}",
"import java.io.*;",
"io.*",
"java",
"class Sta{\n int[] s;\n int top;\n Sta(){\n s=new int[1000];\n top=0;\n }\n void push(int x){\n top++;\n s[top]=x;\n }\n int pop(){\n top--;\n return s[top+1];\n }\n}",
"Sta",
"int[] s;",
"s",
"int top;",
"top",
"Sta(){\n s=new int[1000];\n top=0;\n }",
"Sta",
"{\n s=new int[1000];\n top=0;\n }",
"s=new int[1000]",
"s",
"new int[1000]",
"1000",
"top=0",
"top",
"0",
"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",
"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 public static void main(String[] args) throws IOException{\n BufferedReader din=new BufferedReader(new InputStreamReader(System.in));\n String line=din.readLine();\n String[] tokens=line.split(\" \");\n Sta stack=new Sta();\n for(int i=0;i<tokens.length;i++){\n String x=tokens[i];\n if(x.equals(\"+\")){\n stack.push(stack.pop()+stack.pop());\n }else if(x.equals(\"-\")){\n stack.push(-stack.pop()+stack.pop());\n }else if(x.equals(\"*\")){\n stack.push(stack.pop()*stack.pop());\n }else{\n int t=Integer.parseInt(x);\n stack.push(t);\n }\n }\n System.out.println(stack.pop());\n }\n}",
"Main",
"public static void main(String[] args) throws IOException{\n BufferedReader din=new BufferedReader(new InputStreamReader(System.in));\n String line=din.readLine();\n String[] tokens=line.split(\" \");\n Sta stack=new Sta();\n for(int i=0;i<tokens.length;i++){\n String x=tokens[i];\n if(x.equals(\"+\")){\n stack.push(stack.pop()+stack.pop());\n }else if(x.equals(\"-\")){\n stack.push(-stack.pop()+stack.pop());\n }else if(x.equals(\"*\")){\n stack.push(stack.pop()*stack.pop());\n }else{\n int t=Integer.parseInt(x);\n stack.push(t);\n }\n }\n System.out.println(stack.pop());\n }",
"main",
"{\n BufferedReader din=new BufferedReader(new InputStreamReader(System.in));\n String line=din.readLine();\n String[] tokens=line.split(\" \");\n Sta stack=new Sta();\n for(int i=0;i<tokens.length;i++){\n String x=tokens[i];\n if(x.equals(\"+\")){\n stack.push(stack.pop()+stack.pop());\n }else if(x.equals(\"-\")){\n stack.push(-stack.pop()+stack.pop());\n }else if(x.equals(\"*\")){\n stack.push(stack.pop()*stack.pop());\n }else{\n int t=Integer.parseInt(x);\n stack.push(t);\n }\n }\n System.out.println(stack.pop());\n }",
"BufferedReader din=new BufferedReader(new InputStreamReader(System.in));",
"din",
"new BufferedReader(new InputStreamReader(System.in))",
"String line=din.readLine();",
"line",
"din.readLine()",
"din.readLine",
"din",
"String[] tokens=line.split(\" \");",
"tokens",
"line.split(\" \")",
"line.split",
"line",
"\" \"",
"Sta stack=new Sta();",
"stack",
"new Sta()",
"for(int i=0;i<tokens.length;i++){\n String x=tokens[i];\n if(x.equals(\"+\")){\n stack.push(stack.pop()+stack.pop());\n }else if(x.equals(\"-\")){\n stack.push(-stack.pop()+stack.pop());\n }else if(x.equals(\"*\")){\n stack.push(stack.pop()*stack.pop());\n }else{\n int t=Integer.parseInt(x);\n stack.push(t);\n }\n }",
"int i=0;",
"int i=0;",
"i",
"0",
"i<tokens.length",
"i",
"tokens.length",
"tokens",
"tokens.length",
"i++",
"i++",
"i",
"{\n String x=tokens[i];\n if(x.equals(\"+\")){\n stack.push(stack.pop()+stack.pop());\n }else if(x.equals(\"-\")){\n stack.push(-stack.pop()+stack.pop());\n }else if(x.equals(\"*\")){\n stack.push(stack.pop()*stack.pop());\n }else{\n int t=Integer.parseInt(x);\n stack.push(t);\n }\n }",
"{\n String x=tokens[i];\n if(x.equals(\"+\")){\n stack.push(stack.pop()+stack.pop());\n }else if(x.equals(\"-\")){\n stack.push(-stack.pop()+stack.pop());\n }else if(x.equals(\"*\")){\n stack.push(stack.pop()*stack.pop());\n }else{\n int t=Integer.parseInt(x);\n stack.push(t);\n }\n }",
"String x=tokens[i];",
"x",
"tokens[i]",
"tokens",
"i",
"if(x.equals(\"+\")){\n stack.push(stack.pop()+stack.pop());\n }else if(x.equals(\"-\")){\n stack.push(-stack.pop()+stack.pop());\n }else if(x.equals(\"*\")){\n stack.push(stack.pop()*stack.pop());\n }else{\n int t=Integer.parseInt(x);\n stack.push(t);\n }",
"x.equals(\"+\")",
"x.equals",
"x",
"\"+\"",
"{\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(x.equals(\"-\")){\n stack.push(-stack.pop()+stack.pop());\n }else if(x.equals(\"*\")){\n stack.push(stack.pop()*stack.pop());\n }else{\n int t=Integer.parseInt(x);\n stack.push(t);\n }",
"x.equals(\"-\")",
"x.equals",
"x",
"\"-\"",
"{\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.pop",
"stack",
"stack.pop()",
"stack.pop",
"stack",
"if(x.equals(\"*\")){\n stack.push(stack.pop()*stack.pop());\n }else{\n int t=Integer.parseInt(x);\n stack.push(t);\n }",
"x.equals(\"*\")",
"x.equals",
"x",
"\"*\"",
"{\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 int t=Integer.parseInt(x);\n stack.push(t);\n }",
"int t=Integer.parseInt(x);",
"t",
"Integer.parseInt(x)",
"Integer.parseInt",
"Integer",
"x",
"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 public static void main(String[] args) throws IOException{\n BufferedReader din=new BufferedReader(new InputStreamReader(System.in));\n String line=din.readLine();\n String[] tokens=line.split(\" \");\n Sta stack=new Sta();\n for(int i=0;i<tokens.length;i++){\n String x=tokens[i];\n if(x.equals(\"+\")){\n stack.push(stack.pop()+stack.pop());\n }else if(x.equals(\"-\")){\n stack.push(-stack.pop()+stack.pop());\n }else if(x.equals(\"*\")){\n stack.push(stack.pop()*stack.pop());\n }else{\n int t=Integer.parseInt(x);\n stack.push(t);\n }\n }\n System.out.println(stack.pop());\n }\n}",
"public class Main {\n public static void main(String[] args) throws IOException{\n BufferedReader din=new BufferedReader(new InputStreamReader(System.in));\n String line=din.readLine();\n String[] tokens=line.split(\" \");\n Sta stack=new Sta();\n for(int i=0;i<tokens.length;i++){\n String x=tokens[i];\n if(x.equals(\"+\")){\n stack.push(stack.pop()+stack.pop());\n }else if(x.equals(\"-\")){\n stack.push(-stack.pop()+stack.pop());\n }else if(x.equals(\"*\")){\n stack.push(stack.pop()*stack.pop());\n }else{\n int t=Integer.parseInt(x);\n stack.push(t);\n }\n }\n System.out.println(stack.pop());\n }\n}",
"Main"
] | import java.io.*;
class Sta{
int[] s;
int top;
Sta(){
s=new int[1000];
top=0;
}
void push(int x){
top++;
s[top]=x;
}
int pop(){
top--;
return s[top+1];
}
}
public class Main {
public static void main(String[] args) throws IOException{
BufferedReader din=new BufferedReader(new InputStreamReader(System.in));
String line=din.readLine();
String[] tokens=line.split(" ");
Sta stack=new Sta();
for(int i=0;i<tokens.length;i++){
String x=tokens[i];
if(x.equals("+")){
stack.push(stack.pop()+stack.pop());
}else if(x.equals("-")){
stack.push(-stack.pop()+stack.pop());
}else if(x.equals("*")){
stack.push(stack.pop()*stack.pop());
}else{
int t=Integer.parseInt(x);
stack.push(t);
}
}
System.out.println(stack.pop());
}
} |
[
7,
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,
4,
18,
13,
17,
30,
4,
18,
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,
14,
4,
18,
13,
17,
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
],
[
101,
5
],
[
101,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
8,
14
],
[
14,
15
],
[
14,
16
],
[
8,
17
],
[
17,
18
],
[
18,
19
],
[
19,
20
],
[
17,
21
],
[
21,
22
],
[
22,
23
],
[
22,
24
],
[
24,
25
],
[
25,
26
],
[
21,
27
],
[
27,
28
],
[
28,
29
],
[
29,
30
],
[
28,
31
],
[
31,
32
],
[
32,
33
],
[
31,
34
],
[
27,
35
],
[
35,
36
],
[
36,
37
],
[
37,
38
],
[
36,
39
],
[
39,
40
],
[
40,
41
],
[
39,
42
],
[
27,
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
],
[
56,
57
],
[
55,
58
],
[
54,
59
],
[
59,
60
],
[
60,
61
],
[
61,
62
],
[
60,
63
],
[
63,
64
],
[
63,
65
],
[
43,
66
],
[
66,
67
],
[
67,
68
],
[
68,
69
],
[
67,
70
],
[
66,
71
],
[
71,
72
],
[
72,
73
],
[
73,
74
],
[
72,
75
],
[
75,
76
],
[
75,
77
],
[
43,
78
],
[
78,
79
],
[
79,
80
],
[
80,
81
],
[
79,
82
],
[
78,
83
],
[
83,
84
],
[
84,
85
],
[
85,
86
],
[
84,
87
],
[
87,
88
],
[
87,
89
],
[
8,
90
],
[
90,
91
],
[
91,
92
],
[
92,
93
],
[
92,
94
],
[
90,
95
],
[
95,
96
],
[
96,
97
],
[
6,
98
],
[
98,
99
],
[
0,
100
],
[
100,
101
],
[
100,
102
]
] | [
"import java.util.*;\n\npublic class Main {\n \n \n public static void main(String[] args){ \n Scanner input = new Scanner(System.in);\n String grab;\n Stack<Integer> stack = new Stack<Integer>();\n while (input.hasNext()) { \n grab = input.next();\n \n if (Character.isDigit(grab.charAt(0))) {\n stack.push(Integer.parseInt(grab));\n }//if\n else {\n int a = stack.pop();\n int b = stack.pop();\n if (grab.equals(\"+\")){\n stack.push(a + b);\n }//if \n if (grab.equals(\"-\")){ \n stack.push(b - a);\n }//if\n if (grab.equals(\"*\")){\n stack.push(b * a);\n }//if\n }//else\n }//while\n System.out.println(stack.pop());\n }//main \n}//Main\n\n",
"import java.util.*;",
"util.*",
"java",
"public class Main {\n \n \n public static void main(String[] args){ \n Scanner input = new Scanner(System.in);\n String grab;\n Stack<Integer> stack = new Stack<Integer>();\n while (input.hasNext()) { \n grab = input.next();\n \n if (Character.isDigit(grab.charAt(0))) {\n stack.push(Integer.parseInt(grab));\n }//if\n else {\n int a = stack.pop();\n int b = stack.pop();\n if (grab.equals(\"+\")){\n stack.push(a + b);\n }//if \n if (grab.equals(\"-\")){ \n stack.push(b - a);\n }//if\n if (grab.equals(\"*\")){\n stack.push(b * a);\n }//if\n }//else\n }//while\n System.out.println(stack.pop());\n }//main \n}//Main",
"Main",
"public static void main(String[] args){ \n Scanner input = new Scanner(System.in);\n String grab;\n Stack<Integer> stack = new Stack<Integer>();\n while (input.hasNext()) { \n grab = input.next();\n \n if (Character.isDigit(grab.charAt(0))) {\n stack.push(Integer.parseInt(grab));\n }//if\n else {\n int a = stack.pop();\n int b = stack.pop();\n if (grab.equals(\"+\")){\n stack.push(a + b);\n }//if \n if (grab.equals(\"-\")){ \n stack.push(b - a);\n }//if\n if (grab.equals(\"*\")){\n stack.push(b * a);\n }//if\n }//else\n }//while\n System.out.println(stack.pop());\n }//main ",
"main",
"{ \n Scanner input = new Scanner(System.in);\n String grab;\n Stack<Integer> stack = new Stack<Integer>();\n while (input.hasNext()) { \n grab = input.next();\n \n if (Character.isDigit(grab.charAt(0))) {\n stack.push(Integer.parseInt(grab));\n }//if\n else {\n int a = stack.pop();\n int b = stack.pop();\n if (grab.equals(\"+\")){\n stack.push(a + b);\n }//if \n if (grab.equals(\"-\")){ \n stack.push(b - a);\n }//if\n if (grab.equals(\"*\")){\n stack.push(b * a);\n }//if\n }//else\n }//while\n System.out.println(stack.pop());\n }",
"Scanner input = new Scanner(System.in);",
"input",
"new Scanner(System.in)",
"String grab;",
"grab",
"Stack<Integer> stack = new Stack<Integer>();",
"stack",
"new Stack<Integer>()",
"while (input.hasNext()) { \n grab = input.next();\n \n if (Character.isDigit(grab.charAt(0))) {\n stack.push(Integer.parseInt(grab));\n }//if\n else {\n int a = stack.pop();\n int b = stack.pop();\n if (grab.equals(\"+\")){\n stack.push(a + b);\n }//if \n if (grab.equals(\"-\")){ \n stack.push(b - a);\n }//if\n if (grab.equals(\"*\")){\n stack.push(b * a);\n }//if\n }//else\n }//while",
"input.hasNext()",
"input.hasNext",
"input",
"{ \n grab = input.next();\n \n if (Character.isDigit(grab.charAt(0))) {\n stack.push(Integer.parseInt(grab));\n }//if\n else {\n int a = stack.pop();\n int b = stack.pop();\n if (grab.equals(\"+\")){\n stack.push(a + b);\n }//if \n if (grab.equals(\"-\")){ \n stack.push(b - a);\n }//if\n if (grab.equals(\"*\")){\n stack.push(b * a);\n }//if\n }//else\n }",
"grab = input.next()",
"grab",
"input.next()",
"input.next",
"input",
"if (Character.isDigit(grab.charAt(0))) {\n stack.push(Integer.parseInt(grab));\n }//if\n else {\n int a = stack.pop();\n int b = stack.pop();\n if (grab.equals(\"+\")){\n stack.push(a + b);\n }//if \n if (grab.equals(\"-\")){ \n stack.push(b - a);\n }//if\n if (grab.equals(\"*\")){\n stack.push(b * a);\n }//if\n }//else",
"Character.isDigit(grab.charAt(0))",
"Character.isDigit",
"Character",
"grab.charAt(0)",
"grab.charAt",
"grab",
"0",
"{\n stack.push(Integer.parseInt(grab));\n }",
"stack.push(Integer.parseInt(grab))",
"stack.push",
"stack",
"Integer.parseInt(grab)",
"Integer.parseInt",
"Integer",
"grab",
"{\n int a = stack.pop();\n int b = stack.pop();\n if (grab.equals(\"+\")){\n stack.push(a + b);\n }//if \n if (grab.equals(\"-\")){ \n stack.push(b - a);\n }//if\n if (grab.equals(\"*\")){\n stack.push(b * a);\n }//if\n }",
"int a = stack.pop();",
"a",
"stack.pop()",
"stack.pop",
"stack",
"int b = stack.pop();",
"b",
"stack.pop()",
"stack.pop",
"stack",
"if (grab.equals(\"+\")){\n stack.push(a + b);\n }//if ",
"grab.equals(\"+\")",
"grab.equals",
"grab",
"\"+\"",
"{\n stack.push(a + b);\n }",
"stack.push(a + b)",
"stack.push",
"stack",
"a + b",
"a",
"b",
"if (grab.equals(\"-\")){ \n stack.push(b - a);\n }//if",
"grab.equals(\"-\")",
"grab.equals",
"grab",
"\"-\"",
"{ \n stack.push(b - a);\n }",
"stack.push(b - a)",
"stack.push",
"stack",
"b - a",
"b",
"a",
"if (grab.equals(\"*\")){\n stack.push(b * a);\n }//if",
"grab.equals(\"*\")",
"grab.equals",
"grab",
"\"*\"",
"{\n stack.push(b * a);\n }",
"stack.push(b * a)",
"stack.push",
"stack",
"b * a",
"b",
"a",
"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 \n public static void main(String[] args){ \n Scanner input = new Scanner(System.in);\n String grab;\n Stack<Integer> stack = new Stack<Integer>();\n while (input.hasNext()) { \n grab = input.next();\n \n if (Character.isDigit(grab.charAt(0))) {\n stack.push(Integer.parseInt(grab));\n }//if\n else {\n int a = stack.pop();\n int b = stack.pop();\n if (grab.equals(\"+\")){\n stack.push(a + b);\n }//if \n if (grab.equals(\"-\")){ \n stack.push(b - a);\n }//if\n if (grab.equals(\"*\")){\n stack.push(b * a);\n }//if\n }//else\n }//while\n System.out.println(stack.pop());\n }//main \n}//Main",
"public class Main {\n \n \n public static void main(String[] args){ \n Scanner input = new Scanner(System.in);\n String grab;\n Stack<Integer> stack = new Stack<Integer>();\n while (input.hasNext()) { \n grab = input.next();\n \n if (Character.isDigit(grab.charAt(0))) {\n stack.push(Integer.parseInt(grab));\n }//if\n else {\n int a = stack.pop();\n int b = stack.pop();\n if (grab.equals(\"+\")){\n stack.push(a + b);\n }//if \n if (grab.equals(\"-\")){ \n stack.push(b - a);\n }//if\n if (grab.equals(\"*\")){\n stack.push(b * a);\n }//if\n }//else\n }//while\n System.out.println(stack.pop());\n }//main \n}//Main",
"Main"
] | import java.util.*;
public class Main {
public static void main(String[] args){
Scanner input = new Scanner(System.in);
String grab;
Stack<Integer> stack = new Stack<Integer>();
while (input.hasNext()) {
grab = input.next();
if (Character.isDigit(grab.charAt(0))) {
stack.push(Integer.parseInt(grab));
}//if
else {
int a = stack.pop();
int b = stack.pop();
if (grab.equals("+")){
stack.push(a + b);
}//if
if (grab.equals("-")){
stack.push(b - a);
}//if
if (grab.equals("*")){
stack.push(b * a);
}//if
}//else
}//while
System.out.println(stack.pop());
}//main
}//Main
|
[
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,
18,
13,
13,
4,
13,
13,
23,
13,
12,
13,
30,
41,
13,
20,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
30,
35,
18,
13,
13,
34,
17,
1,
4,
18,
13,
4,
18,
13,
2,
4,
18,
4,
18,
13,
4,
18,
4,
18,
13,
3,
34,
17,
1,
41,
13,
4,
18,
4,
18,
13,
41,
13,
4,
18,
4,
18,
13,
4,
18,
13,
4,
18,
13,
2,
13,
13,
3,
34,
17,
1,
4,
18,
13,
4,
18,
13,
2,
4,
18,
4,
18,
13,
4,
18,
4,
18,
13,
3,
34,
1,
4,
18,
13,
4,
18,
13,
18,
13,
13,
29,
4,
18,
4,
18,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
147,
8
],
[
147,
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
],
[
25,
26
],
[
25,
27
],
[
23,
28
],
[
28,
29
],
[
28,
30
],
[
9,
31
],
[
31,
32
],
[
147,
33
],
[
33,
34
],
[
33,
35
],
[
35,
36
],
[
36,
37
],
[
36,
38
],
[
35,
39
],
[
39,
40
],
[
40,
41
],
[
41,
42
],
[
41,
43
],
[
39,
44
],
[
44,
45
],
[
44,
46
],
[
46,
47
],
[
46,
48
],
[
39,
49
],
[
49,
50
],
[
50,
51
],
[
39,
52
],
[
53,
53
],
[
53,
54
],
[
54,
55
],
[
55,
56
],
[
55,
57
],
[
54,
58
],
[
58,
59
],
[
58,
60
],
[
60,
61
],
[
61,
62
],
[
62,
63
],
[
61,
64
],
[
64,
65
],
[
65,
66
],
[
64,
67
],
[
67,
68
],
[
68,
69
],
[
69,
70
],
[
70,
71
],
[
71,
72
],
[
67,
73
],
[
73,
74
],
[
74,
75
],
[
75,
76
],
[
76,
77
],
[
60,
78
],
[
54,
79
],
[
79,
80
],
[
79,
81
],
[
81,
82
],
[
82,
83
],
[
82,
84
],
[
84,
85
],
[
85,
86
],
[
86,
87
],
[
87,
88
],
[
81,
89
],
[
89,
90
],
[
89,
91
],
[
91,
92
],
[
92,
93
],
[
93,
94
],
[
94,
95
],
[
81,
96
],
[
96,
97
],
[
97,
98
],
[
96,
99
],
[
99,
100
],
[
100,
101
],
[
99,
102
],
[
102,
103
],
[
102,
104
],
[
81,
105
],
[
54,
106
],
[
106,
107
],
[
106,
108
],
[
108,
109
],
[
109,
110
],
[
110,
111
],
[
109,
112
],
[
112,
113
],
[
113,
114
],
[
112,
115
],
[
115,
116
],
[
116,
117
],
[
117,
118
],
[
118,
119
],
[
119,
120
],
[
115,
121
],
[
121,
122
],
[
122,
123
],
[
123,
124
],
[
124,
125
],
[
108,
126
],
[
54,
127
],
[
127,
128
],
[
128,
129
],
[
129,
130
],
[
130,
131
],
[
129,
132
],
[
132,
133
],
[
133,
134
],
[
132,
135
],
[
135,
136
],
[
135,
137
],
[
35,
138
],
[
138,
139
],
[
139,
140
],
[
140,
141
],
[
141,
142
],
[
142,
143
],
[
33,
144
],
[
144,
145
],
[
0,
146
],
[
146,
147
],
[
146,
148
]
] | [
"import java.util.Scanner;\nimport java.util.Stack;\n\npublic class Main {\n\n public static void main(String[] args) {\n Scanner scanner = new Scanner(System.in);\n String[] values = scanner.nextLine().split(\" \");\n System.out.println(calcurate(values));\n }\n\n private static long calcurate(String[] values) {\n Stack<Long> stack = new Stack<>();\n\n for (int i = 0; i < values.length; i++) {\n\n switch (values[i]) {\n case \"+\":\n stack.push(Long.valueOf(\n stack.pop().longValue() + stack.pop().longValue()\n ));\n break;\n case \"-\":\n long b = stack.pop().longValue();\n long a = stack.pop().longValue();\n stack.push(Long.valueOf(a - b));\n break;\n case \"*\":\n stack.push(Long.valueOf(\n stack.pop().longValue() * stack.pop().longValue()\n ));\n break;\n default:\n stack.push(Long.parseLong(values[i]));\n }\n }\n\n return stack.pop().longValue();\n }\n}\n",
"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 Scanner scanner = new Scanner(System.in);\n String[] values = scanner.nextLine().split(\" \");\n System.out.println(calcurate(values));\n }\n\n private static long calcurate(String[] values) {\n Stack<Long> stack = new Stack<>();\n\n for (int i = 0; i < values.length; i++) {\n\n switch (values[i]) {\n case \"+\":\n stack.push(Long.valueOf(\n stack.pop().longValue() + stack.pop().longValue()\n ));\n break;\n case \"-\":\n long b = stack.pop().longValue();\n long a = stack.pop().longValue();\n stack.push(Long.valueOf(a - b));\n break;\n case \"*\":\n stack.push(Long.valueOf(\n stack.pop().longValue() * stack.pop().longValue()\n ));\n break;\n default:\n stack.push(Long.parseLong(values[i]));\n }\n }\n\n return stack.pop().longValue();\n }\n}",
"Main",
"public static void main(String[] args) {\n Scanner scanner = new Scanner(System.in);\n String[] values = scanner.nextLine().split(\" \");\n System.out.println(calcurate(values));\n }",
"main",
"{\n Scanner scanner = new Scanner(System.in);\n String[] values = scanner.nextLine().split(\" \");\n System.out.println(calcurate(values));\n }",
"Scanner scanner = new Scanner(System.in);",
"scanner",
"new Scanner(System.in)",
"String[] values = scanner.nextLine().split(\" \");",
"values",
"scanner.nextLine().split(\" \")",
"scanner.nextLine().split",
"scanner.nextLine()",
"scanner.nextLine",
"scanner",
"\" \"",
"System.out.println(calcurate(values))",
"System.out.println",
"System.out",
"System",
"System.out",
"calcurate(values)",
"calcurate",
"values",
"String[] args",
"args",
"private static long calcurate(String[] values) {\n Stack<Long> stack = new Stack<>();\n\n for (int i = 0; i < values.length; i++) {\n\n switch (values[i]) {\n case \"+\":\n stack.push(Long.valueOf(\n stack.pop().longValue() + stack.pop().longValue()\n ));\n break;\n case \"-\":\n long b = stack.pop().longValue();\n long a = stack.pop().longValue();\n stack.push(Long.valueOf(a - b));\n break;\n case \"*\":\n stack.push(Long.valueOf(\n stack.pop().longValue() * stack.pop().longValue()\n ));\n break;\n default:\n stack.push(Long.parseLong(values[i]));\n }\n }\n\n return stack.pop().longValue();\n }",
"calcurate",
"{\n Stack<Long> stack = new Stack<>();\n\n for (int i = 0; i < values.length; i++) {\n\n switch (values[i]) {\n case \"+\":\n stack.push(Long.valueOf(\n stack.pop().longValue() + stack.pop().longValue()\n ));\n break;\n case \"-\":\n long b = stack.pop().longValue();\n long a = stack.pop().longValue();\n stack.push(Long.valueOf(a - b));\n break;\n case \"*\":\n stack.push(Long.valueOf(\n stack.pop().longValue() * stack.pop().longValue()\n ));\n break;\n default:\n stack.push(Long.parseLong(values[i]));\n }\n }\n\n return stack.pop().longValue();\n }",
"Stack<Long> stack = new Stack<>();",
"stack",
"new Stack<>()",
"for (int i = 0; i < values.length; i++) {\n\n switch (values[i]) {\n case \"+\":\n stack.push(Long.valueOf(\n stack.pop().longValue() + stack.pop().longValue()\n ));\n break;\n case \"-\":\n long b = stack.pop().longValue();\n long a = stack.pop().longValue();\n stack.push(Long.valueOf(a - b));\n break;\n case \"*\":\n stack.push(Long.valueOf(\n stack.pop().longValue() * stack.pop().longValue()\n ));\n break;\n default:\n stack.push(Long.parseLong(values[i]));\n }\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < values.length",
"i",
"values.length",
"values",
"values.length",
"i++",
"i++",
"i",
"{\n\n switch (values[i]) {\n case \"+\":\n stack.push(Long.valueOf(\n stack.pop().longValue() + stack.pop().longValue()\n ));\n break;\n case \"-\":\n long b = stack.pop().longValue();\n long a = stack.pop().longValue();\n stack.push(Long.valueOf(a - b));\n break;\n case \"*\":\n stack.push(Long.valueOf(\n stack.pop().longValue() * stack.pop().longValue()\n ));\n break;\n default:\n stack.push(Long.parseLong(values[i]));\n }\n }",
"{\n\n switch (values[i]) {\n case \"+\":\n stack.push(Long.valueOf(\n stack.pop().longValue() + stack.pop().longValue()\n ));\n break;\n case \"-\":\n long b = stack.pop().longValue();\n long a = stack.pop().longValue();\n stack.push(Long.valueOf(a - b));\n break;\n case \"*\":\n stack.push(Long.valueOf(\n stack.pop().longValue() * stack.pop().longValue()\n ));\n break;\n default:\n stack.push(Long.parseLong(values[i]));\n }\n }",
"switch (values[i]) {\n case \"+\":\n stack.push(Long.valueOf(\n stack.pop().longValue() + stack.pop().longValue()\n ));\n break;\n case \"-\":\n long b = stack.pop().longValue();\n long a = stack.pop().longValue();\n stack.push(Long.valueOf(a - b));\n break;\n case \"*\":\n stack.push(Long.valueOf(\n stack.pop().longValue() * stack.pop().longValue()\n ));\n break;\n default:\n stack.push(Long.parseLong(values[i]));\n }",
"values[i]",
"values",
"i",
"case \"+\":",
"\"+\"",
"case \"+\":",
"stack.push(Long.valueOf(\n stack.pop().longValue() + stack.pop().longValue()\n ))",
"stack.push",
"stack",
"Long.valueOf(\n stack.pop().longValue() + stack.pop().longValue()\n )",
"Long.valueOf",
"Long",
"stack.pop().longValue() + stack.pop().longValue()",
"stack.pop().longValue()",
"stack.pop().longValue",
"stack.pop()",
"stack.pop",
"stack",
"stack.pop().longValue()",
"stack.pop().longValue",
"stack.pop()",
"stack.pop",
"stack",
"break;",
"case \"-\":",
"\"-\"",
"case \"-\":",
"long b = stack.pop().longValue();",
"b",
"stack.pop().longValue()",
"stack.pop().longValue",
"stack.pop()",
"stack.pop",
"stack",
"long a = stack.pop().longValue();",
"a",
"stack.pop().longValue()",
"stack.pop().longValue",
"stack.pop()",
"stack.pop",
"stack",
"stack.push(Long.valueOf(a - b))",
"stack.push",
"stack",
"Long.valueOf(a - b)",
"Long.valueOf",
"Long",
"a - b",
"a",
"b",
"break;",
"case \"*\":",
"\"*\"",
"case \"*\":",
"stack.push(Long.valueOf(\n stack.pop().longValue() * stack.pop().longValue()\n ))",
"stack.push",
"stack",
"Long.valueOf(\n stack.pop().longValue() * stack.pop().longValue()\n )",
"Long.valueOf",
"Long",
"stack.pop().longValue() * stack.pop().longValue()",
"stack.pop().longValue()",
"stack.pop().longValue",
"stack.pop()",
"stack.pop",
"stack",
"stack.pop().longValue()",
"stack.pop().longValue",
"stack.pop()",
"stack.pop",
"stack",
"break;",
"default:",
"default:",
"stack.push(Long.parseLong(values[i]))",
"stack.push",
"stack",
"Long.parseLong(values[i])",
"Long.parseLong",
"Long",
"values[i]",
"values",
"i",
"return stack.pop().longValue();",
"stack.pop().longValue()",
"stack.pop().longValue",
"stack.pop()",
"stack.pop",
"stack",
"String[] values",
"values",
"public class Main {\n\n public static void main(String[] args) {\n Scanner scanner = new Scanner(System.in);\n String[] values = scanner.nextLine().split(\" \");\n System.out.println(calcurate(values));\n }\n\n private static long calcurate(String[] values) {\n Stack<Long> stack = new Stack<>();\n\n for (int i = 0; i < values.length; i++) {\n\n switch (values[i]) {\n case \"+\":\n stack.push(Long.valueOf(\n stack.pop().longValue() + stack.pop().longValue()\n ));\n break;\n case \"-\":\n long b = stack.pop().longValue();\n long a = stack.pop().longValue();\n stack.push(Long.valueOf(a - b));\n break;\n case \"*\":\n stack.push(Long.valueOf(\n stack.pop().longValue() * stack.pop().longValue()\n ));\n break;\n default:\n stack.push(Long.parseLong(values[i]));\n }\n }\n\n return stack.pop().longValue();\n }\n}",
"public class Main {\n\n public static void main(String[] args) {\n Scanner scanner = new Scanner(System.in);\n String[] values = scanner.nextLine().split(\" \");\n System.out.println(calcurate(values));\n }\n\n private static long calcurate(String[] values) {\n Stack<Long> stack = new Stack<>();\n\n for (int i = 0; i < values.length; i++) {\n\n switch (values[i]) {\n case \"+\":\n stack.push(Long.valueOf(\n stack.pop().longValue() + stack.pop().longValue()\n ));\n break;\n case \"-\":\n long b = stack.pop().longValue();\n long a = stack.pop().longValue();\n stack.push(Long.valueOf(a - b));\n break;\n case \"*\":\n stack.push(Long.valueOf(\n stack.pop().longValue() * stack.pop().longValue()\n ));\n break;\n default:\n stack.push(Long.parseLong(values[i]));\n }\n }\n\n return stack.pop().longValue();\n }\n}",
"Main"
] | import java.util.Scanner;
import java.util.Stack;
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
String[] values = scanner.nextLine().split(" ");
System.out.println(calcurate(values));
}
private static long calcurate(String[] values) {
Stack<Long> stack = new Stack<>();
for (int i = 0; i < values.length; i++) {
switch (values[i]) {
case "+":
stack.push(Long.valueOf(
stack.pop().longValue() + stack.pop().longValue()
));
break;
case "-":
long b = stack.pop().longValue();
long a = stack.pop().longValue();
stack.push(Long.valueOf(a - b));
break;
case "*":
stack.push(Long.valueOf(
stack.pop().longValue() * stack.pop().longValue()
));
break;
default:
stack.push(Long.parseLong(values[i]));
}
}
return stack.pop().longValue();
}
}
|
[
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,
28,
13,
13,
30,
30,
41,
13,
41,
13,
41,
13,
39,
17,
17,
17,
17,
41,
13,
17,
28,
13,
13,
30,
30,
14,
4,
18,
13,
13,
30,
0,
13,
17,
14,
13,
30,
0,
13,
4,
18,
13,
4,
18,
13,
0,
13,
4,
18,
13,
4,
18,
13,
35,
13,
34,
17,
1,
4,
18,
13,
2,
17,
2,
13,
13,
3,
34,
17,
1,
4,
18,
13,
2,
17,
2,
13,
13,
3,
34,
17,
1,
4,
18,
13,
2,
17,
2,
13,
13,
3,
34,
17,
1,
4,
18,
13,
2,
17,
2,
13,
13,
3,
34,
17,
1,
4,
18,
13,
2,
17,
2,
13,
13,
3,
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
],
[
159,
8
],
[
159,
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
],
[
29,
31
],
[
29,
32
],
[
33,
33
],
[
33,
34
],
[
34,
35
],
[
33,
36
],
[
36,
37
],
[
33,
38
],
[
38,
39
],
[
38,
40
],
[
40,
41
],
[
40,
42
],
[
40,
43
],
[
40,
44
],
[
33,
45
],
[
45,
46
],
[
45,
47
],
[
33,
48
],
[
48,
49
],
[
48,
50
],
[
48,
51
],
[
52,
52
],
[
52,
53
],
[
53,
54
],
[
54,
55
],
[
55,
56
],
[
54,
57
],
[
53,
58
],
[
58,
59
],
[
59,
60
],
[
59,
61
],
[
33,
62
],
[
62,
63
],
[
62,
64
],
[
64,
65
],
[
65,
66
],
[
65,
67
],
[
67,
68
],
[
68,
69
],
[
67,
70
],
[
70,
71
],
[
71,
72
],
[
64,
73
],
[
73,
74
],
[
73,
75
],
[
75,
76
],
[
76,
77
],
[
75,
78
],
[
78,
79
],
[
79,
80
],
[
64,
81
],
[
81,
82
],
[
81,
83
],
[
83,
84
],
[
83,
85
],
[
85,
86
],
[
86,
87
],
[
87,
88
],
[
86,
89
],
[
89,
90
],
[
89,
91
],
[
91,
92
],
[
91,
93
],
[
85,
94
],
[
81,
95
],
[
95,
96
],
[
95,
97
],
[
97,
98
],
[
98,
99
],
[
99,
100
],
[
98,
101
],
[
101,
102
],
[
101,
103
],
[
103,
104
],
[
103,
105
],
[
97,
106
],
[
81,
107
],
[
107,
108
],
[
107,
109
],
[
109,
110
],
[
110,
111
],
[
111,
112
],
[
110,
113
],
[
113,
114
],
[
113,
115
],
[
115,
116
],
[
115,
117
],
[
109,
118
],
[
81,
119
],
[
119,
120
],
[
119,
121
],
[
121,
122
],
[
122,
123
],
[
123,
124
],
[
122,
125
],
[
125,
126
],
[
125,
127
],
[
127,
128
],
[
127,
129
],
[
121,
130
],
[
81,
131
],
[
131,
132
],
[
131,
133
],
[
133,
134
],
[
134,
135
],
[
135,
136
],
[
134,
137
],
[
137,
138
],
[
137,
139
],
[
139,
140
],
[
139,
141
],
[
133,
142
],
[
62,
143
],
[
143,
144
],
[
144,
145
],
[
145,
146
],
[
144,
147
],
[
11,
148
],
[
148,
149
],
[
149,
150
],
[
150,
151
],
[
150,
152
],
[
148,
153
],
[
153,
154
],
[
154,
155
],
[
9,
156
],
[
156,
157
],
[
0,
158
],
[
158,
159
],
[
158,
160
]
] | [
"import java.util.Stack;\nimport java.util.Scanner;\n\npublic class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner in = new Scanner(System.in);\n\t\tStack<String> stack = new Stack<>();\n\t\t\n\t\tString input = in.nextLine();\n\t\tString[] tokens = input.split(\" \");\n\t\t\n\t\tfor (String n : tokens) {\n\t\t\tint o1, o2;\n\t\t\t\n\t\t\tString[] operations = {\"+\", \"-\", \"*\", \"/\"};\n\t\t\tboolean op = false;\n\t\t\t\n\t\t\tfor (String operation : operations) {\n\t\t\t\tif (n.equals(operation)) {\n\t\t\t\t\top = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif (op) {\n\t\t\t\to1 = Integer.parseInt(stack.pop());\n\t\t\t\to2 = Integer.parseInt(stack.pop());\n\t\t\t\t\n\t\t\t\tswitch (n) {\n\t\t\t\t\tcase \"+\":\n\t\t\t\t\t\tstack.push(\"\" + (o2 + o1));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"-\":\n\t\t\t\t\t\tstack.push(\"\" + (o2 - o1));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"*\":\n\t\t\t\t\t\tstack.push(\"\" + (o2 * o1));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"/\":\n\t\t\t\t\t\tstack.push(\"\" + (o2 / o1));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"%\":\n\t\t\t\t\t\tstack.push(\"\" + (o2 % o1));\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tstack.push(n);\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(stack.pop());\n\t}\n}",
"import java.util.Stack;",
"Stack",
"java.util",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner in = new Scanner(System.in);\n\t\tStack<String> stack = new Stack<>();\n\t\t\n\t\tString input = in.nextLine();\n\t\tString[] tokens = input.split(\" \");\n\t\t\n\t\tfor (String n : tokens) {\n\t\t\tint o1, o2;\n\t\t\t\n\t\t\tString[] operations = {\"+\", \"-\", \"*\", \"/\"};\n\t\t\tboolean op = false;\n\t\t\t\n\t\t\tfor (String operation : operations) {\n\t\t\t\tif (n.equals(operation)) {\n\t\t\t\t\top = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif (op) {\n\t\t\t\to1 = Integer.parseInt(stack.pop());\n\t\t\t\to2 = Integer.parseInt(stack.pop());\n\t\t\t\t\n\t\t\t\tswitch (n) {\n\t\t\t\t\tcase \"+\":\n\t\t\t\t\t\tstack.push(\"\" + (o2 + o1));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"-\":\n\t\t\t\t\t\tstack.push(\"\" + (o2 - o1));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"*\":\n\t\t\t\t\t\tstack.push(\"\" + (o2 * o1));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"/\":\n\t\t\t\t\t\tstack.push(\"\" + (o2 / o1));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"%\":\n\t\t\t\t\t\tstack.push(\"\" + (o2 % o1));\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tstack.push(n);\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(stack.pop());\n\t}\n}",
"Main",
"public static void main(String[] args) {\n\t\tScanner in = new Scanner(System.in);\n\t\tStack<String> stack = new Stack<>();\n\t\t\n\t\tString input = in.nextLine();\n\t\tString[] tokens = input.split(\" \");\n\t\t\n\t\tfor (String n : tokens) {\n\t\t\tint o1, o2;\n\t\t\t\n\t\t\tString[] operations = {\"+\", \"-\", \"*\", \"/\"};\n\t\t\tboolean op = false;\n\t\t\t\n\t\t\tfor (String operation : operations) {\n\t\t\t\tif (n.equals(operation)) {\n\t\t\t\t\top = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif (op) {\n\t\t\t\to1 = Integer.parseInt(stack.pop());\n\t\t\t\to2 = Integer.parseInt(stack.pop());\n\t\t\t\t\n\t\t\t\tswitch (n) {\n\t\t\t\t\tcase \"+\":\n\t\t\t\t\t\tstack.push(\"\" + (o2 + o1));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"-\":\n\t\t\t\t\t\tstack.push(\"\" + (o2 - o1));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"*\":\n\t\t\t\t\t\tstack.push(\"\" + (o2 * o1));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"/\":\n\t\t\t\t\t\tstack.push(\"\" + (o2 / o1));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"%\":\n\t\t\t\t\t\tstack.push(\"\" + (o2 % o1));\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tstack.push(n);\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(stack.pop());\n\t}",
"main",
"{\n\t\tScanner in = new Scanner(System.in);\n\t\tStack<String> stack = new Stack<>();\n\t\t\n\t\tString input = in.nextLine();\n\t\tString[] tokens = input.split(\" \");\n\t\t\n\t\tfor (String n : tokens) {\n\t\t\tint o1, o2;\n\t\t\t\n\t\t\tString[] operations = {\"+\", \"-\", \"*\", \"/\"};\n\t\t\tboolean op = false;\n\t\t\t\n\t\t\tfor (String operation : operations) {\n\t\t\t\tif (n.equals(operation)) {\n\t\t\t\t\top = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif (op) {\n\t\t\t\to1 = Integer.parseInt(stack.pop());\n\t\t\t\to2 = Integer.parseInt(stack.pop());\n\t\t\t\t\n\t\t\t\tswitch (n) {\n\t\t\t\t\tcase \"+\":\n\t\t\t\t\t\tstack.push(\"\" + (o2 + o1));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"-\":\n\t\t\t\t\t\tstack.push(\"\" + (o2 - o1));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"*\":\n\t\t\t\t\t\tstack.push(\"\" + (o2 * o1));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"/\":\n\t\t\t\t\t\tstack.push(\"\" + (o2 / o1));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"%\":\n\t\t\t\t\t\tstack.push(\"\" + (o2 % o1));\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tstack.push(n);\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(stack.pop());\n\t}",
"Scanner in = new Scanner(System.in);",
"in",
"new Scanner(System.in)",
"Stack<String> stack = new Stack<>();",
"stack",
"new Stack<>()",
"String input = in.nextLine();",
"input",
"in.nextLine()",
"in.nextLine",
"in",
"String[] tokens = input.split(\" \");",
"tokens",
"input.split(\" \")",
"input.split",
"input",
"\" \"",
"for (String n : tokens) {\n\t\t\tint o1, o2;\n\t\t\t\n\t\t\tString[] operations = {\"+\", \"-\", \"*\", \"/\"};\n\t\t\tboolean op = false;\n\t\t\t\n\t\t\tfor (String operation : operations) {\n\t\t\t\tif (n.equals(operation)) {\n\t\t\t\t\top = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif (op) {\n\t\t\t\to1 = Integer.parseInt(stack.pop());\n\t\t\t\to2 = Integer.parseInt(stack.pop());\n\t\t\t\t\n\t\t\t\tswitch (n) {\n\t\t\t\t\tcase \"+\":\n\t\t\t\t\t\tstack.push(\"\" + (o2 + o1));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"-\":\n\t\t\t\t\t\tstack.push(\"\" + (o2 - o1));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"*\":\n\t\t\t\t\t\tstack.push(\"\" + (o2 * o1));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"/\":\n\t\t\t\t\t\tstack.push(\"\" + (o2 / o1));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"%\":\n\t\t\t\t\t\tstack.push(\"\" + (o2 % o1));\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tstack.push(n);\n\t\t\t}\n\t\t}",
"String n",
"tokens",
"{\n\t\t\tint o1, o2;\n\t\t\t\n\t\t\tString[] operations = {\"+\", \"-\", \"*\", \"/\"};\n\t\t\tboolean op = false;\n\t\t\t\n\t\t\tfor (String operation : operations) {\n\t\t\t\tif (n.equals(operation)) {\n\t\t\t\t\top = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif (op) {\n\t\t\t\to1 = Integer.parseInt(stack.pop());\n\t\t\t\to2 = Integer.parseInt(stack.pop());\n\t\t\t\t\n\t\t\t\tswitch (n) {\n\t\t\t\t\tcase \"+\":\n\t\t\t\t\t\tstack.push(\"\" + (o2 + o1));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"-\":\n\t\t\t\t\t\tstack.push(\"\" + (o2 - o1));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"*\":\n\t\t\t\t\t\tstack.push(\"\" + (o2 * o1));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"/\":\n\t\t\t\t\t\tstack.push(\"\" + (o2 / o1));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"%\":\n\t\t\t\t\t\tstack.push(\"\" + (o2 % o1));\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tstack.push(n);\n\t\t\t}\n\t\t}",
"{\n\t\t\tint o1, o2;\n\t\t\t\n\t\t\tString[] operations = {\"+\", \"-\", \"*\", \"/\"};\n\t\t\tboolean op = false;\n\t\t\t\n\t\t\tfor (String operation : operations) {\n\t\t\t\tif (n.equals(operation)) {\n\t\t\t\t\top = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif (op) {\n\t\t\t\to1 = Integer.parseInt(stack.pop());\n\t\t\t\to2 = Integer.parseInt(stack.pop());\n\t\t\t\t\n\t\t\t\tswitch (n) {\n\t\t\t\t\tcase \"+\":\n\t\t\t\t\t\tstack.push(\"\" + (o2 + o1));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"-\":\n\t\t\t\t\t\tstack.push(\"\" + (o2 - o1));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"*\":\n\t\t\t\t\t\tstack.push(\"\" + (o2 * o1));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"/\":\n\t\t\t\t\t\tstack.push(\"\" + (o2 / o1));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"%\":\n\t\t\t\t\t\tstack.push(\"\" + (o2 % o1));\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tstack.push(n);\n\t\t\t}\n\t\t}",
"int o1",
"o1",
"o2;",
"o2",
"String[] operations = {\"+\", \"-\", \"*\", \"/\"};",
"operations",
"{\"+\", \"-\", \"*\", \"/\"}",
"\"+\"",
"\"-\"",
"\"*\"",
"\"/\"",
"boolean op = false;",
"op",
"false",
"for (String operation : operations) {\n\t\t\t\tif (n.equals(operation)) {\n\t\t\t\t\top = true;\n\t\t\t\t}\n\t\t\t}",
"String operation",
"operations",
"{\n\t\t\t\tif (n.equals(operation)) {\n\t\t\t\t\top = true;\n\t\t\t\t}\n\t\t\t}",
"{\n\t\t\t\tif (n.equals(operation)) {\n\t\t\t\t\top = true;\n\t\t\t\t}\n\t\t\t}",
"if (n.equals(operation)) {\n\t\t\t\t\top = true;\n\t\t\t\t}",
"n.equals(operation)",
"n.equals",
"n",
"operation",
"{\n\t\t\t\t\top = true;\n\t\t\t\t}",
"op = true",
"op",
"true",
"if (op) {\n\t\t\t\to1 = Integer.parseInt(stack.pop());\n\t\t\t\to2 = Integer.parseInt(stack.pop());\n\t\t\t\t\n\t\t\t\tswitch (n) {\n\t\t\t\t\tcase \"+\":\n\t\t\t\t\t\tstack.push(\"\" + (o2 + o1));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"-\":\n\t\t\t\t\t\tstack.push(\"\" + (o2 - o1));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"*\":\n\t\t\t\t\t\tstack.push(\"\" + (o2 * o1));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"/\":\n\t\t\t\t\t\tstack.push(\"\" + (o2 / o1));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"%\":\n\t\t\t\t\t\tstack.push(\"\" + (o2 % o1));\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tstack.push(n);\n\t\t\t}",
"op",
"{\n\t\t\t\to1 = Integer.parseInt(stack.pop());\n\t\t\t\to2 = Integer.parseInt(stack.pop());\n\t\t\t\t\n\t\t\t\tswitch (n) {\n\t\t\t\t\tcase \"+\":\n\t\t\t\t\t\tstack.push(\"\" + (o2 + o1));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"-\":\n\t\t\t\t\t\tstack.push(\"\" + (o2 - o1));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"*\":\n\t\t\t\t\t\tstack.push(\"\" + (o2 * o1));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"/\":\n\t\t\t\t\t\tstack.push(\"\" + (o2 / o1));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"%\":\n\t\t\t\t\t\tstack.push(\"\" + (o2 % o1));\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}",
"o1 = Integer.parseInt(stack.pop())",
"o1",
"Integer.parseInt(stack.pop())",
"Integer.parseInt",
"Integer",
"stack.pop()",
"stack.pop",
"stack",
"o2 = Integer.parseInt(stack.pop())",
"o2",
"Integer.parseInt(stack.pop())",
"Integer.parseInt",
"Integer",
"stack.pop()",
"stack.pop",
"stack",
"switch (n) {\n\t\t\t\t\tcase \"+\":\n\t\t\t\t\t\tstack.push(\"\" + (o2 + o1));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"-\":\n\t\t\t\t\t\tstack.push(\"\" + (o2 - o1));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"*\":\n\t\t\t\t\t\tstack.push(\"\" + (o2 * o1));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"/\":\n\t\t\t\t\t\tstack.push(\"\" + (o2 / o1));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"%\":\n\t\t\t\t\t\tstack.push(\"\" + (o2 % o1));\n\t\t\t\t\t\tbreak;\n\t\t\t\t}",
"n",
"case \"+\":",
"\"+\"",
"case \"+\":",
"stack.push(\"\" + (o2 + o1))",
"stack.push",
"stack",
"\"\" + (o2 + o1)",
"\"\"",
"(o2 + o1)",
"o2",
"o1",
"break;",
"case \"-\":",
"\"-\"",
"case \"-\":",
"stack.push(\"\" + (o2 - o1))",
"stack.push",
"stack",
"\"\" + (o2 - o1)",
"\"\"",
"(o2 - o1)",
"o2",
"o1",
"break;",
"case \"*\":",
"\"*\"",
"case \"*\":",
"stack.push(\"\" + (o2 * o1))",
"stack.push",
"stack",
"\"\" + (o2 * o1)",
"\"\"",
"(o2 * o1)",
"o2",
"o1",
"break;",
"case \"/\":",
"\"/\"",
"case \"/\":",
"stack.push(\"\" + (o2 / o1))",
"stack.push",
"stack",
"\"\" + (o2 / o1)",
"\"\"",
"(o2 / o1)",
"o2",
"o1",
"break;",
"case \"%\":",
"\"%\"",
"case \"%\":",
"stack.push(\"\" + (o2 % o1))",
"stack.push",
"stack",
"\"\" + (o2 % o1)",
"\"\"",
"(o2 % o1)",
"o2",
"o1",
"break;",
"{\n\t\t\t\tstack.push(n);\n\t\t\t}",
"stack.push(n)",
"stack.push",
"stack",
"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\n\tpublic static void main(String[] args) {\n\t\tScanner in = new Scanner(System.in);\n\t\tStack<String> stack = new Stack<>();\n\t\t\n\t\tString input = in.nextLine();\n\t\tString[] tokens = input.split(\" \");\n\t\t\n\t\tfor (String n : tokens) {\n\t\t\tint o1, o2;\n\t\t\t\n\t\t\tString[] operations = {\"+\", \"-\", \"*\", \"/\"};\n\t\t\tboolean op = false;\n\t\t\t\n\t\t\tfor (String operation : operations) {\n\t\t\t\tif (n.equals(operation)) {\n\t\t\t\t\top = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif (op) {\n\t\t\t\to1 = Integer.parseInt(stack.pop());\n\t\t\t\to2 = Integer.parseInt(stack.pop());\n\t\t\t\t\n\t\t\t\tswitch (n) {\n\t\t\t\t\tcase \"+\":\n\t\t\t\t\t\tstack.push(\"\" + (o2 + o1));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"-\":\n\t\t\t\t\t\tstack.push(\"\" + (o2 - o1));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"*\":\n\t\t\t\t\t\tstack.push(\"\" + (o2 * o1));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"/\":\n\t\t\t\t\t\tstack.push(\"\" + (o2 / o1));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"%\":\n\t\t\t\t\t\tstack.push(\"\" + (o2 % o1));\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tstack.push(n);\n\t\t\t}\n\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\tScanner in = new Scanner(System.in);\n\t\tStack<String> stack = new Stack<>();\n\t\t\n\t\tString input = in.nextLine();\n\t\tString[] tokens = input.split(\" \");\n\t\t\n\t\tfor (String n : tokens) {\n\t\t\tint o1, o2;\n\t\t\t\n\t\t\tString[] operations = {\"+\", \"-\", \"*\", \"/\"};\n\t\t\tboolean op = false;\n\t\t\t\n\t\t\tfor (String operation : operations) {\n\t\t\t\tif (n.equals(operation)) {\n\t\t\t\t\top = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif (op) {\n\t\t\t\to1 = Integer.parseInt(stack.pop());\n\t\t\t\to2 = Integer.parseInt(stack.pop());\n\t\t\t\t\n\t\t\t\tswitch (n) {\n\t\t\t\t\tcase \"+\":\n\t\t\t\t\t\tstack.push(\"\" + (o2 + o1));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"-\":\n\t\t\t\t\t\tstack.push(\"\" + (o2 - o1));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"*\":\n\t\t\t\t\t\tstack.push(\"\" + (o2 * o1));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"/\":\n\t\t\t\t\t\tstack.push(\"\" + (o2 / o1));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"%\":\n\t\t\t\t\t\tstack.push(\"\" + (o2 % o1));\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tstack.push(n);\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(stack.pop());\n\t}\n}",
"Main"
] | import java.util.Stack;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
Stack<String> stack = new Stack<>();
String input = in.nextLine();
String[] tokens = input.split(" ");
for (String n : tokens) {
int o1, o2;
String[] operations = {"+", "-", "*", "/"};
boolean op = false;
for (String operation : operations) {
if (n.equals(operation)) {
op = true;
}
}
if (op) {
o1 = Integer.parseInt(stack.pop());
o2 = Integer.parseInt(stack.pop());
switch (n) {
case "+":
stack.push("" + (o2 + o1));
break;
case "-":
stack.push("" + (o2 - o1));
break;
case "*":
stack.push("" + (o2 * o1));
break;
case "/":
stack.push("" + (o2 / o1));
break;
case "%":
stack.push("" + (o2 % o1));
break;
}
} else {
stack.push(n);
}
}
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,
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,
41,
13,
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,
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
],
[
140,
14
],
[
140,
15
],
[
15,
16
],
[
15,
17
],
[
17,
18
],
[
18,
19
],
[
18,
20
],
[
17,
21
],
[
21,
22
],
[
21,
23
],
[
23,
24
],
[
24,
25
],
[
17,
26
],
[
26,
27
],
[
26,
28
],
[
28,
29
],
[
29,
30
],
[
28,
31
],
[
17,
32
],
[
32,
33
],
[
32,
34
],
[
17,
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
],
[
60,
66
],
[
66,
67
],
[
66,
68
],
[
68,
69
],
[
69,
70
],
[
60,
71
],
[
71,
72
],
[
72,
73
],
[
71,
74
],
[
74,
75
],
[
74,
76
],
[
60,
77
],
[
54,
78
],
[
78,
79
],
[
78,
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
],
[
80,
97
],
[
54,
98
],
[
98,
99
],
[
98,
100
],
[
100,
101
],
[
101,
102
],
[
101,
103
],
[
103,
104
],
[
104,
105
],
[
100,
106
],
[
106,
107
],
[
106,
108
],
[
108,
109
],
[
109,
110
],
[
100,
111
],
[
111,
112
],
[
112,
113
],
[
111,
114
],
[
114,
115
],
[
114,
116
],
[
100,
117
],
[
54,
118
],
[
118,
119
],
[
119,
120
],
[
120,
121
],
[
121,
122
],
[
120,
123
],
[
123,
124
],
[
124,
125
],
[
123,
126
],
[
126,
127
],
[
126,
128
],
[
17,
129
],
[
129,
130
],
[
130,
131
],
[
131,
132
],
[
131,
133
],
[
129,
134
],
[
134,
135
],
[
135,
136
],
[
15,
137
],
[
137,
138
],
[
0,
139
],
[
139,
140
],
[
139,
141
]
] | [
"import java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\nimport java.util.Stack;\n\npublic class Main {\n public static void main(String[] args) throws IOException {\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n String str = br.readLine();\n String[] stri = str.split(\" \");\n Stack<Integer> st = new Stack<Integer>();\n for (int i = 0; i < stri.length; i++) {\n int i1, i2;\n switch (stri[i]) {\n case \"+\":\n i1 = st.pop();\n i2 = st.pop();\n st.push(i1 + i2);\n break;\n case \"-\":\n i1 = st.pop();\n i2 = st.pop();\n st.push(i2 - i1);\n break;\n case \"*\":\n i1 = st.pop();\n i2 = st.pop();\n st.push(i1 * i2);\n break;\n default:\n st.push(Integer.parseInt(stri[i]));\n }\n }\n System.out.println(st.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 public static void main(String[] args) throws IOException {\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n String str = br.readLine();\n String[] stri = str.split(\" \");\n Stack<Integer> st = new Stack<Integer>();\n for (int i = 0; i < stri.length; i++) {\n int i1, i2;\n switch (stri[i]) {\n case \"+\":\n i1 = st.pop();\n i2 = st.pop();\n st.push(i1 + i2);\n break;\n case \"-\":\n i1 = st.pop();\n i2 = st.pop();\n st.push(i2 - i1);\n break;\n case \"*\":\n i1 = st.pop();\n i2 = st.pop();\n st.push(i1 * i2);\n break;\n default:\n st.push(Integer.parseInt(stri[i]));\n }\n }\n System.out.println(st.pop());\n }\n}",
"Main",
"public static void main(String[] args) throws IOException {\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n String str = br.readLine();\n String[] stri = str.split(\" \");\n Stack<Integer> st = new Stack<Integer>();\n for (int i = 0; i < stri.length; i++) {\n int i1, i2;\n switch (stri[i]) {\n case \"+\":\n i1 = st.pop();\n i2 = st.pop();\n st.push(i1 + i2);\n break;\n case \"-\":\n i1 = st.pop();\n i2 = st.pop();\n st.push(i2 - i1);\n break;\n case \"*\":\n i1 = st.pop();\n i2 = st.pop();\n st.push(i1 * i2);\n break;\n default:\n st.push(Integer.parseInt(stri[i]));\n }\n }\n System.out.println(st.pop());\n }",
"main",
"{\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n String str = br.readLine();\n String[] stri = str.split(\" \");\n Stack<Integer> st = new Stack<Integer>();\n for (int i = 0; i < stri.length; i++) {\n int i1, i2;\n switch (stri[i]) {\n case \"+\":\n i1 = st.pop();\n i2 = st.pop();\n st.push(i1 + i2);\n break;\n case \"-\":\n i1 = st.pop();\n i2 = st.pop();\n st.push(i2 - i1);\n break;\n case \"*\":\n i1 = st.pop();\n i2 = st.pop();\n st.push(i1 * i2);\n break;\n default:\n st.push(Integer.parseInt(stri[i]));\n }\n }\n System.out.println(st.pop());\n }",
"BufferedReader br = new BufferedReader(new InputStreamReader(System.in));",
"br",
"new BufferedReader(new InputStreamReader(System.in))",
"String str = br.readLine();",
"str",
"br.readLine()",
"br.readLine",
"br",
"String[] stri = str.split(\" \");",
"stri",
"str.split(\" \")",
"str.split",
"str",
"\" \"",
"Stack<Integer> st = new Stack<Integer>();",
"st",
"new Stack<Integer>()",
"for (int i = 0; i < stri.length; i++) {\n int i1, i2;\n switch (stri[i]) {\n case \"+\":\n i1 = st.pop();\n i2 = st.pop();\n st.push(i1 + i2);\n break;\n case \"-\":\n i1 = st.pop();\n i2 = st.pop();\n st.push(i2 - i1);\n break;\n case \"*\":\n i1 = st.pop();\n i2 = st.pop();\n st.push(i1 * i2);\n break;\n default:\n st.push(Integer.parseInt(stri[i]));\n }\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < stri.length",
"i",
"stri.length",
"stri",
"stri.length",
"i++",
"i++",
"i",
"{\n int i1, i2;\n switch (stri[i]) {\n case \"+\":\n i1 = st.pop();\n i2 = st.pop();\n st.push(i1 + i2);\n break;\n case \"-\":\n i1 = st.pop();\n i2 = st.pop();\n st.push(i2 - i1);\n break;\n case \"*\":\n i1 = st.pop();\n i2 = st.pop();\n st.push(i1 * i2);\n break;\n default:\n st.push(Integer.parseInt(stri[i]));\n }\n }",
"{\n int i1, i2;\n switch (stri[i]) {\n case \"+\":\n i1 = st.pop();\n i2 = st.pop();\n st.push(i1 + i2);\n break;\n case \"-\":\n i1 = st.pop();\n i2 = st.pop();\n st.push(i2 - i1);\n break;\n case \"*\":\n i1 = st.pop();\n i2 = st.pop();\n st.push(i1 * i2);\n break;\n default:\n st.push(Integer.parseInt(stri[i]));\n }\n }",
"int i1",
"i1",
"i2;",
"i2",
"switch (stri[i]) {\n case \"+\":\n i1 = st.pop();\n i2 = st.pop();\n st.push(i1 + i2);\n break;\n case \"-\":\n i1 = st.pop();\n i2 = st.pop();\n st.push(i2 - i1);\n break;\n case \"*\":\n i1 = st.pop();\n i2 = st.pop();\n st.push(i1 * i2);\n break;\n default:\n st.push(Integer.parseInt(stri[i]));\n }",
"stri[i]",
"stri",
"i",
"case \"+\":",
"\"+\"",
"case \"+\":",
"i1 = st.pop()",
"i1",
"st.pop()",
"st.pop",
"st",
"i2 = st.pop()",
"i2",
"st.pop()",
"st.pop",
"st",
"st.push(i1 + i2)",
"st.push",
"st",
"i1 + i2",
"i1",
"i2",
"break;",
"case \"-\":",
"\"-\"",
"case \"-\":",
"i1 = st.pop()",
"i1",
"st.pop()",
"st.pop",
"st",
"i2 = st.pop()",
"i2",
"st.pop()",
"st.pop",
"st",
"st.push(i2 - i1)",
"st.push",
"st",
"i2 - i1",
"i2",
"i1",
"break;",
"case \"*\":",
"\"*\"",
"case \"*\":",
"i1 = st.pop()",
"i1",
"st.pop()",
"st.pop",
"st",
"i2 = st.pop()",
"i2",
"st.pop()",
"st.pop",
"st",
"st.push(i1 * i2)",
"st.push",
"st",
"i1 * i2",
"i1",
"i2",
"break;",
"default:",
"default:",
"st.push(Integer.parseInt(stri[i]))",
"st.push",
"st",
"Integer.parseInt(stri[i])",
"Integer.parseInt",
"Integer",
"stri[i]",
"stri",
"i",
"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 void main(String[] args) throws IOException {\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n String str = br.readLine();\n String[] stri = str.split(\" \");\n Stack<Integer> st = new Stack<Integer>();\n for (int i = 0; i < stri.length; i++) {\n int i1, i2;\n switch (stri[i]) {\n case \"+\":\n i1 = st.pop();\n i2 = st.pop();\n st.push(i1 + i2);\n break;\n case \"-\":\n i1 = st.pop();\n i2 = st.pop();\n st.push(i2 - i1);\n break;\n case \"*\":\n i1 = st.pop();\n i2 = st.pop();\n st.push(i1 * i2);\n break;\n default:\n st.push(Integer.parseInt(stri[i]));\n }\n }\n System.out.println(st.pop());\n }\n}",
"public class Main {\n public static void main(String[] args) throws IOException {\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n String str = br.readLine();\n String[] stri = str.split(\" \");\n Stack<Integer> st = new Stack<Integer>();\n for (int i = 0; i < stri.length; i++) {\n int i1, i2;\n switch (stri[i]) {\n case \"+\":\n i1 = st.pop();\n i2 = st.pop();\n st.push(i1 + i2);\n break;\n case \"-\":\n i1 = st.pop();\n i2 = st.pop();\n st.push(i2 - i1);\n break;\n case \"*\":\n i1 = st.pop();\n i2 = st.pop();\n st.push(i1 * i2);\n break;\n default:\n st.push(Integer.parseInt(stri[i]));\n }\n }\n System.out.println(st.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 str = br.readLine();
String[] stri = str.split(" ");
Stack<Integer> st = new Stack<Integer>();
for (int i = 0; i < stri.length; i++) {
int i1, i2;
switch (stri[i]) {
case "+":
i1 = st.pop();
i2 = st.pop();
st.push(i1 + i2);
break;
case "-":
i1 = st.pop();
i2 = st.pop();
st.push(i2 - i1);
break;
case "*":
i1 = st.pop();
i2 = st.pop();
st.push(i1 * i2);
break;
default:
st.push(Integer.parseInt(stri[i]));
}
}
System.out.println(st.pop());
}
} |
[
7,
15,
13,
17,
6,
13,
41,
13,
20,
12,
13,
30,
41,
13,
20,
41,
13,
42,
4,
18,
13,
30,
0,
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,
13,
4,
18,
13,
23,
13,
12,
13,
30,
11,
1,
41,
13,
17,
2,
13,
2,
13,
13,
1,
40,
13,
30,
30,
14,
2,
2,
13,
13,
17,
29,
17,
29,
17,
23,
13,
12,
13,
30,
14,
2,
2,
13,
13,
17,
29,
13,
29,
4,
13,
13,
2,
13,
13,
23,
13,
23,
13,
12,
13,
30,
11,
1,
41,
13,
17,
2,
13,
2,
18,
13,
13,
17,
1,
40,
13,
30,
30,
4,
18,
18,
13,
13,
2,
18,
13,
13,
17,
4,
13,
18,
13,
2,
18,
13,
13,
17,
23,
13,
12,
13,
30,
4,
18,
18,
13,
13,
13,
23,
13,
12,
13,
30,
4,
18,
18,
13,
13,
13,
23,
13,
12,
13,
30,
14,
2,
13,
17,
30,
4,
13,
17,
30,
4,
13,
17,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
241,
5
],
[
241,
6
],
[
6,
7
],
[
6,
8
],
[
241,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
12,
14
],
[
11,
15
],
[
15,
16
],
[
11,
17
],
[
17,
18
],
[
18,
19
],
[
19,
20
],
[
17,
21
],
[
21,
22
],
[
22,
23
],
[
22,
24
],
[
24,
25
],
[
25,
26
],
[
21,
27
],
[
27,
28
],
[
28,
29
],
[
29,
30
],
[
28,
31
],
[
27,
32
],
[
32,
33
],
[
33,
34
],
[
33,
35
],
[
35,
36
],
[
36,
37
],
[
32,
38
],
[
38,
39
],
[
38,
40
],
[
40,
41
],
[
41,
42
],
[
32,
43
],
[
43,
44
],
[
44,
45
],
[
43,
46
],
[
46,
47
],
[
46,
48
],
[
27,
49
],
[
49,
50
],
[
50,
51
],
[
51,
52
],
[
50,
53
],
[
49,
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
],
[
49,
71
],
[
71,
72
],
[
72,
73
],
[
73,
74
],
[
72,
75
],
[
71,
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
],
[
71,
93
],
[
93,
94
],
[
94,
95
],
[
95,
96
],
[
94,
97
],
[
97,
98
],
[
98,
99
],
[
97,
100
],
[
11,
101
],
[
101,
102
],
[
101,
103
],
[
103,
104
],
[
104,
105
],
[
9,
106
],
[
106,
107
],
[
241,
108
],
[
108,
109
],
[
108,
110
],
[
110,
111
],
[
111,
112
],
[
112,
113
],
[
113,
114
],
[
113,
115
],
[
111,
116
],
[
116,
117
],
[
116,
118
],
[
118,
119
],
[
118,
120
],
[
111,
121
],
[
121,
122
],
[
122,
123
],
[
111,
124
],
[
125,
125
],
[
125,
126
],
[
126,
127
],
[
127,
128
],
[
128,
129
],
[
128,
130
],
[
127,
131
],
[
126,
132
],
[
132,
133
],
[
110,
134
],
[
134,
135
],
[
108,
136
],
[
136,
137
],
[
241,
138
],
[
138,
139
],
[
138,
140
],
[
140,
141
],
[
141,
142
],
[
142,
143
],
[
143,
144
],
[
143,
145
],
[
142,
146
],
[
141,
147
],
[
147,
148
],
[
141,
149
],
[
149,
150
],
[
150,
151
],
[
150,
152
],
[
150,
153
],
[
153,
154
],
[
153,
155
],
[
138,
156
],
[
156,
157
],
[
138,
158
],
[
158,
159
],
[
241,
160
],
[
160,
161
],
[
160,
162
],
[
162,
163
],
[
163,
164
],
[
164,
165
],
[
165,
166
],
[
165,
167
],
[
163,
168
],
[
168,
169
],
[
168,
170
],
[
170,
171
],
[
171,
172
],
[
171,
173
],
[
170,
174
],
[
163,
175
],
[
175,
176
],
[
176,
177
],
[
163,
178
],
[
179,
179
],
[
179,
180
],
[
180,
181
],
[
181,
182
],
[
182,
183
],
[
182,
184
],
[
180,
185
],
[
185,
186
],
[
186,
187
],
[
186,
188
],
[
185,
189
],
[
162,
190
],
[
190,
191
],
[
190,
192
],
[
192,
193
],
[
192,
194
],
[
194,
195
],
[
195,
196
],
[
195,
197
],
[
194,
198
],
[
160,
199
],
[
199,
200
],
[
241,
201
],
[
201,
202
],
[
201,
203
],
[
203,
204
],
[
204,
205
],
[
205,
206
],
[
206,
207
],
[
206,
208
],
[
204,
209
],
[
201,
210
],
[
210,
211
],
[
241,
212
],
[
212,
213
],
[
212,
214
],
[
214,
215
],
[
215,
216
],
[
216,
217
],
[
217,
218
],
[
217,
219
],
[
215,
220
],
[
212,
221
],
[
221,
222
],
[
241,
223
],
[
223,
224
],
[
223,
225
],
[
225,
226
],
[
226,
227
],
[
227,
228
],
[
227,
229
],
[
226,
230
],
[
230,
231
],
[
231,
232
],
[
231,
233
],
[
226,
234
],
[
234,
235
],
[
235,
236
],
[
235,
237
],
[
223,
238
],
[
238,
239
],
[
0,
240
],
[
240,
241
],
[
240,
242
]
] | [
"import java.util.*;\n \npublic class Main {\n\tstatic Scanner sc = new Scanner(System.in);\n\t\n\tpublic static void main(String[] args) {\n\t\tStack<Integer> stk = new Stack<Integer>();\n\t\tString s;\n\t\twhile(sc.hasNext()){\n\t\t\ts = sc.next();\n\t\t\tif(s.equals(\"+\")){\n\t\t\t\tint n1 = stk.pop();\n\t\t\t\tint n2 = stk.pop();\n\t\t\t\tstk.push(n1+n2);\n\t\t\t}\n\t\t\telse if(s.equals(\"-\")){\n\t\t\t\tint n1 = stk.pop();\n\t\t\t\tint n2 = stk.pop();\n\t\t\t\tstk.push(n2-n1);\n\t\t\t}\n\t\t\telse if(s.equals(\"*\")){\n\t\t\t\tint n1 = stk.pop();\n\t\t\t\tint n2 = stk.pop();\n\t\t\t\tstk.push(n1 * n2);\n\t\t\t}\n\t\t\telse{\n\t\t\t\tstk.push(Integer.valueOf(s));\n\t\t\t}\n\t\t}\n\t\tcout(stk.pop());\n\t}\n\t\n\t\n\t\n\tpublic static boolean isPrime(int n){\n\t\tfor(int i=2;i<=n*n;i++){\n\t\t\tif(n%i==0) return true;\n\t\t}\n\t\treturn false;\n\t}\n\tpublic static int gcd(int a,int b){\n\t\tif(a%b==0) return b;\n\t\telse return gcd(b,a%b);\n\t}\n\tpublic static void showary(int[] ary){\n\t\tfor(int i=0;i<ary.length-1;i++){\n\t\t\tSystem.out.print(ary[i]+\" \");\n\t\t}\n\t\tcout(ary[ary.length-1]);\n\t}\n\tpublic static void cout(String n){\n\t\tSystem.out.println(n);\n\t}\n\t\n\tpublic static void cout(int n){\n\t\tSystem.out.println(n);\n\t}\n\tpublic static void cout(boolean n){\n\t\tif(n==true){\n\t\t\tcout(\"true\");\n\t\t}else{\n\t\t\tcout(\"false\");\n\t\t}\n\t}\n}",
"import java.util.*;",
"util.*",
"java",
"public class Main {\n\tstatic Scanner sc = new Scanner(System.in);\n\t\n\tpublic static void main(String[] args) {\n\t\tStack<Integer> stk = new Stack<Integer>();\n\t\tString s;\n\t\twhile(sc.hasNext()){\n\t\t\ts = sc.next();\n\t\t\tif(s.equals(\"+\")){\n\t\t\t\tint n1 = stk.pop();\n\t\t\t\tint n2 = stk.pop();\n\t\t\t\tstk.push(n1+n2);\n\t\t\t}\n\t\t\telse if(s.equals(\"-\")){\n\t\t\t\tint n1 = stk.pop();\n\t\t\t\tint n2 = stk.pop();\n\t\t\t\tstk.push(n2-n1);\n\t\t\t}\n\t\t\telse if(s.equals(\"*\")){\n\t\t\t\tint n1 = stk.pop();\n\t\t\t\tint n2 = stk.pop();\n\t\t\t\tstk.push(n1 * n2);\n\t\t\t}\n\t\t\telse{\n\t\t\t\tstk.push(Integer.valueOf(s));\n\t\t\t}\n\t\t}\n\t\tcout(stk.pop());\n\t}\n\t\n\t\n\t\n\tpublic static boolean isPrime(int n){\n\t\tfor(int i=2;i<=n*n;i++){\n\t\t\tif(n%i==0) return true;\n\t\t}\n\t\treturn false;\n\t}\n\tpublic static int gcd(int a,int b){\n\t\tif(a%b==0) return b;\n\t\telse return gcd(b,a%b);\n\t}\n\tpublic static void showary(int[] ary){\n\t\tfor(int i=0;i<ary.length-1;i++){\n\t\t\tSystem.out.print(ary[i]+\" \");\n\t\t}\n\t\tcout(ary[ary.length-1]);\n\t}\n\tpublic static void cout(String n){\n\t\tSystem.out.println(n);\n\t}\n\t\n\tpublic static void cout(int n){\n\t\tSystem.out.println(n);\n\t}\n\tpublic static void cout(boolean n){\n\t\tif(n==true){\n\t\t\tcout(\"true\");\n\t\t}else{\n\t\t\tcout(\"false\");\n\t\t}\n\t}\n}",
"Main",
"static Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"public static void main(String[] args) {\n\t\tStack<Integer> stk = new Stack<Integer>();\n\t\tString s;\n\t\twhile(sc.hasNext()){\n\t\t\ts = sc.next();\n\t\t\tif(s.equals(\"+\")){\n\t\t\t\tint n1 = stk.pop();\n\t\t\t\tint n2 = stk.pop();\n\t\t\t\tstk.push(n1+n2);\n\t\t\t}\n\t\t\telse if(s.equals(\"-\")){\n\t\t\t\tint n1 = stk.pop();\n\t\t\t\tint n2 = stk.pop();\n\t\t\t\tstk.push(n2-n1);\n\t\t\t}\n\t\t\telse if(s.equals(\"*\")){\n\t\t\t\tint n1 = stk.pop();\n\t\t\t\tint n2 = stk.pop();\n\t\t\t\tstk.push(n1 * n2);\n\t\t\t}\n\t\t\telse{\n\t\t\t\tstk.push(Integer.valueOf(s));\n\t\t\t}\n\t\t}\n\t\tcout(stk.pop());\n\t}",
"main",
"{\n\t\tStack<Integer> stk = new Stack<Integer>();\n\t\tString s;\n\t\twhile(sc.hasNext()){\n\t\t\ts = sc.next();\n\t\t\tif(s.equals(\"+\")){\n\t\t\t\tint n1 = stk.pop();\n\t\t\t\tint n2 = stk.pop();\n\t\t\t\tstk.push(n1+n2);\n\t\t\t}\n\t\t\telse if(s.equals(\"-\")){\n\t\t\t\tint n1 = stk.pop();\n\t\t\t\tint n2 = stk.pop();\n\t\t\t\tstk.push(n2-n1);\n\t\t\t}\n\t\t\telse if(s.equals(\"*\")){\n\t\t\t\tint n1 = stk.pop();\n\t\t\t\tint n2 = stk.pop();\n\t\t\t\tstk.push(n1 * n2);\n\t\t\t}\n\t\t\telse{\n\t\t\t\tstk.push(Integer.valueOf(s));\n\t\t\t}\n\t\t}\n\t\tcout(stk.pop());\n\t}",
"Stack<Integer> stk = new Stack<Integer>();",
"stk",
"new Stack<Integer>()",
"String s;",
"s",
"while(sc.hasNext()){\n\t\t\ts = sc.next();\n\t\t\tif(s.equals(\"+\")){\n\t\t\t\tint n1 = stk.pop();\n\t\t\t\tint n2 = stk.pop();\n\t\t\t\tstk.push(n1+n2);\n\t\t\t}\n\t\t\telse if(s.equals(\"-\")){\n\t\t\t\tint n1 = stk.pop();\n\t\t\t\tint n2 = stk.pop();\n\t\t\t\tstk.push(n2-n1);\n\t\t\t}\n\t\t\telse if(s.equals(\"*\")){\n\t\t\t\tint n1 = stk.pop();\n\t\t\t\tint n2 = stk.pop();\n\t\t\t\tstk.push(n1 * n2);\n\t\t\t}\n\t\t\telse{\n\t\t\t\tstk.push(Integer.valueOf(s));\n\t\t\t}\n\t\t}",
"sc.hasNext()",
"sc.hasNext",
"sc",
"{\n\t\t\ts = sc.next();\n\t\t\tif(s.equals(\"+\")){\n\t\t\t\tint n1 = stk.pop();\n\t\t\t\tint n2 = stk.pop();\n\t\t\t\tstk.push(n1+n2);\n\t\t\t}\n\t\t\telse if(s.equals(\"-\")){\n\t\t\t\tint n1 = stk.pop();\n\t\t\t\tint n2 = stk.pop();\n\t\t\t\tstk.push(n2-n1);\n\t\t\t}\n\t\t\telse if(s.equals(\"*\")){\n\t\t\t\tint n1 = stk.pop();\n\t\t\t\tint n2 = stk.pop();\n\t\t\t\tstk.push(n1 * n2);\n\t\t\t}\n\t\t\telse{\n\t\t\t\tstk.push(Integer.valueOf(s));\n\t\t\t}\n\t\t}",
"s = sc.next()",
"s",
"sc.next()",
"sc.next",
"sc",
"if(s.equals(\"+\")){\n\t\t\t\tint n1 = stk.pop();\n\t\t\t\tint n2 = stk.pop();\n\t\t\t\tstk.push(n1+n2);\n\t\t\t}\n\t\t\telse if(s.equals(\"-\")){\n\t\t\t\tint n1 = stk.pop();\n\t\t\t\tint n2 = stk.pop();\n\t\t\t\tstk.push(n2-n1);\n\t\t\t}\n\t\t\telse if(s.equals(\"*\")){\n\t\t\t\tint n1 = stk.pop();\n\t\t\t\tint n2 = stk.pop();\n\t\t\t\tstk.push(n1 * n2);\n\t\t\t}\n\t\t\telse{\n\t\t\t\tstk.push(Integer.valueOf(s));\n\t\t\t}",
"s.equals(\"+\")",
"s.equals",
"s",
"\"+\"",
"{\n\t\t\t\tint n1 = stk.pop();\n\t\t\t\tint n2 = stk.pop();\n\t\t\t\tstk.push(n1+n2);\n\t\t\t}",
"int n1 = stk.pop();",
"n1",
"stk.pop()",
"stk.pop",
"stk",
"int n2 = stk.pop();",
"n2",
"stk.pop()",
"stk.pop",
"stk",
"stk.push(n1+n2)",
"stk.push",
"stk",
"n1+n2",
"n1",
"n2",
"if(s.equals(\"-\")){\n\t\t\t\tint n1 = stk.pop();\n\t\t\t\tint n2 = stk.pop();\n\t\t\t\tstk.push(n2-n1);\n\t\t\t}\n\t\t\telse if(s.equals(\"*\")){\n\t\t\t\tint n1 = stk.pop();\n\t\t\t\tint n2 = stk.pop();\n\t\t\t\tstk.push(n1 * n2);\n\t\t\t}\n\t\t\telse{\n\t\t\t\tstk.push(Integer.valueOf(s));\n\t\t\t}",
"s.equals(\"-\")",
"s.equals",
"s",
"\"-\"",
"{\n\t\t\t\tint n1 = stk.pop();\n\t\t\t\tint n2 = stk.pop();\n\t\t\t\tstk.push(n2-n1);\n\t\t\t}",
"int n1 = stk.pop();",
"n1",
"stk.pop()",
"stk.pop",
"stk",
"int n2 = stk.pop();",
"n2",
"stk.pop()",
"stk.pop",
"stk",
"stk.push(n2-n1)",
"stk.push",
"stk",
"n2-n1",
"n2",
"n1",
"if(s.equals(\"*\")){\n\t\t\t\tint n1 = stk.pop();\n\t\t\t\tint n2 = stk.pop();\n\t\t\t\tstk.push(n1 * n2);\n\t\t\t}\n\t\t\telse{\n\t\t\t\tstk.push(Integer.valueOf(s));\n\t\t\t}",
"s.equals(\"*\")",
"s.equals",
"s",
"\"*\"",
"{\n\t\t\t\tint n1 = stk.pop();\n\t\t\t\tint n2 = stk.pop();\n\t\t\t\tstk.push(n1 * n2);\n\t\t\t}",
"int n1 = stk.pop();",
"n1",
"stk.pop()",
"stk.pop",
"stk",
"int n2 = stk.pop();",
"n2",
"stk.pop()",
"stk.pop",
"stk",
"stk.push(n1 * n2)",
"stk.push",
"stk",
"n1 * n2",
"n1",
"n2",
"{\n\t\t\t\tstk.push(Integer.valueOf(s));\n\t\t\t}",
"stk.push(Integer.valueOf(s))",
"stk.push",
"stk",
"Integer.valueOf(s)",
"Integer.valueOf",
"Integer",
"s",
"cout(stk.pop())",
"cout",
"stk.pop()",
"stk.pop",
"stk",
"String[] args",
"args",
"public static boolean isPrime(int n){\n\t\tfor(int i=2;i<=n*n;i++){\n\t\t\tif(n%i==0) return true;\n\t\t}\n\t\treturn false;\n\t}",
"isPrime",
"{\n\t\tfor(int i=2;i<=n*n;i++){\n\t\t\tif(n%i==0) return true;\n\t\t}\n\t\treturn false;\n\t}",
"for(int i=2;i<=n*n;i++){\n\t\t\tif(n%i==0) return true;\n\t\t}",
"int i=2;",
"int i=2;",
"i",
"2",
"i<=n*n",
"i",
"n*n",
"n",
"n",
"i++",
"i++",
"i",
"{\n\t\t\tif(n%i==0) return true;\n\t\t}",
"{\n\t\t\tif(n%i==0) return true;\n\t\t}",
"if(n%i==0) return true;",
"n%i==0",
"n%i",
"n",
"i",
"0",
"return true;",
"true",
"return false;",
"false",
"int n",
"n",
"public static int gcd(int a,int b){\n\t\tif(a%b==0) return b;\n\t\telse return gcd(b,a%b);\n\t}",
"gcd",
"{\n\t\tif(a%b==0) return b;\n\t\telse return gcd(b,a%b);\n\t}",
"if(a%b==0) return b;\n\t\telse return gcd(b,a%b);",
"a%b==0",
"a%b",
"a",
"b",
"0",
"return b;",
"b",
"return gcd(b,a%b);",
"gcd(b,a%b)",
"gcd",
"b",
"a%b",
"a",
"b",
"int a",
"a",
"int b",
"b",
"public static void showary(int[] ary){\n\t\tfor(int i=0;i<ary.length-1;i++){\n\t\t\tSystem.out.print(ary[i]+\" \");\n\t\t}\n\t\tcout(ary[ary.length-1]);\n\t}",
"showary",
"{\n\t\tfor(int i=0;i<ary.length-1;i++){\n\t\t\tSystem.out.print(ary[i]+\" \");\n\t\t}\n\t\tcout(ary[ary.length-1]);\n\t}",
"for(int i=0;i<ary.length-1;i++){\n\t\t\tSystem.out.print(ary[i]+\" \");\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<ary.length-1",
"i",
"ary.length-1",
"ary.length",
"ary",
"ary.length",
"1",
"i++",
"i++",
"i",
"{\n\t\t\tSystem.out.print(ary[i]+\" \");\n\t\t}",
"{\n\t\t\tSystem.out.print(ary[i]+\" \");\n\t\t}",
"System.out.print(ary[i]+\" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"ary[i]+\" \"",
"ary[i]",
"ary",
"i",
"\" \"",
"cout(ary[ary.length-1])",
"cout",
"ary[ary.length-1]",
"ary",
"ary.length-1",
"ary.length",
"ary",
"ary.length",
"1",
"int[] ary",
"ary",
"public static void cout(String n){\n\t\tSystem.out.println(n);\n\t}",
"cout",
"{\n\t\tSystem.out.println(n);\n\t}",
"System.out.println(n)",
"System.out.println",
"System.out",
"System",
"System.out",
"n",
"String n",
"n",
"public static void cout(int n){\n\t\tSystem.out.println(n);\n\t}",
"cout",
"{\n\t\tSystem.out.println(n);\n\t}",
"System.out.println(n)",
"System.out.println",
"System.out",
"System",
"System.out",
"n",
"int n",
"n",
"public static void cout(boolean n){\n\t\tif(n==true){\n\t\t\tcout(\"true\");\n\t\t}else{\n\t\t\tcout(\"false\");\n\t\t}\n\t}",
"cout",
"{\n\t\tif(n==true){\n\t\t\tcout(\"true\");\n\t\t}else{\n\t\t\tcout(\"false\");\n\t\t}\n\t}",
"if(n==true){\n\t\t\tcout(\"true\");\n\t\t}else{\n\t\t\tcout(\"false\");\n\t\t}",
"n==true",
"n",
"true",
"{\n\t\t\tcout(\"true\");\n\t\t}",
"cout(\"true\")",
"cout",
"\"true\"",
"{\n\t\t\tcout(\"false\");\n\t\t}",
"cout(\"false\")",
"cout",
"\"false\"",
"boolean n",
"n",
"public class Main {\n\tstatic Scanner sc = new Scanner(System.in);\n\t\n\tpublic static void main(String[] args) {\n\t\tStack<Integer> stk = new Stack<Integer>();\n\t\tString s;\n\t\twhile(sc.hasNext()){\n\t\t\ts = sc.next();\n\t\t\tif(s.equals(\"+\")){\n\t\t\t\tint n1 = stk.pop();\n\t\t\t\tint n2 = stk.pop();\n\t\t\t\tstk.push(n1+n2);\n\t\t\t}\n\t\t\telse if(s.equals(\"-\")){\n\t\t\t\tint n1 = stk.pop();\n\t\t\t\tint n2 = stk.pop();\n\t\t\t\tstk.push(n2-n1);\n\t\t\t}\n\t\t\telse if(s.equals(\"*\")){\n\t\t\t\tint n1 = stk.pop();\n\t\t\t\tint n2 = stk.pop();\n\t\t\t\tstk.push(n1 * n2);\n\t\t\t}\n\t\t\telse{\n\t\t\t\tstk.push(Integer.valueOf(s));\n\t\t\t}\n\t\t}\n\t\tcout(stk.pop());\n\t}\n\t\n\t\n\t\n\tpublic static boolean isPrime(int n){\n\t\tfor(int i=2;i<=n*n;i++){\n\t\t\tif(n%i==0) return true;\n\t\t}\n\t\treturn false;\n\t}\n\tpublic static int gcd(int a,int b){\n\t\tif(a%b==0) return b;\n\t\telse return gcd(b,a%b);\n\t}\n\tpublic static void showary(int[] ary){\n\t\tfor(int i=0;i<ary.length-1;i++){\n\t\t\tSystem.out.print(ary[i]+\" \");\n\t\t}\n\t\tcout(ary[ary.length-1]);\n\t}\n\tpublic static void cout(String n){\n\t\tSystem.out.println(n);\n\t}\n\t\n\tpublic static void cout(int n){\n\t\tSystem.out.println(n);\n\t}\n\tpublic static void cout(boolean n){\n\t\tif(n==true){\n\t\t\tcout(\"true\");\n\t\t}else{\n\t\t\tcout(\"false\");\n\t\t}\n\t}\n}",
"public class Main {\n\tstatic Scanner sc = new Scanner(System.in);\n\t\n\tpublic static void main(String[] args) {\n\t\tStack<Integer> stk = new Stack<Integer>();\n\t\tString s;\n\t\twhile(sc.hasNext()){\n\t\t\ts = sc.next();\n\t\t\tif(s.equals(\"+\")){\n\t\t\t\tint n1 = stk.pop();\n\t\t\t\tint n2 = stk.pop();\n\t\t\t\tstk.push(n1+n2);\n\t\t\t}\n\t\t\telse if(s.equals(\"-\")){\n\t\t\t\tint n1 = stk.pop();\n\t\t\t\tint n2 = stk.pop();\n\t\t\t\tstk.push(n2-n1);\n\t\t\t}\n\t\t\telse if(s.equals(\"*\")){\n\t\t\t\tint n1 = stk.pop();\n\t\t\t\tint n2 = stk.pop();\n\t\t\t\tstk.push(n1 * n2);\n\t\t\t}\n\t\t\telse{\n\t\t\t\tstk.push(Integer.valueOf(s));\n\t\t\t}\n\t\t}\n\t\tcout(stk.pop());\n\t}\n\t\n\t\n\t\n\tpublic static boolean isPrime(int n){\n\t\tfor(int i=2;i<=n*n;i++){\n\t\t\tif(n%i==0) return true;\n\t\t}\n\t\treturn false;\n\t}\n\tpublic static int gcd(int a,int b){\n\t\tif(a%b==0) return b;\n\t\telse return gcd(b,a%b);\n\t}\n\tpublic static void showary(int[] ary){\n\t\tfor(int i=0;i<ary.length-1;i++){\n\t\t\tSystem.out.print(ary[i]+\" \");\n\t\t}\n\t\tcout(ary[ary.length-1]);\n\t}\n\tpublic static void cout(String n){\n\t\tSystem.out.println(n);\n\t}\n\t\n\tpublic static void cout(int n){\n\t\tSystem.out.println(n);\n\t}\n\tpublic static void cout(boolean n){\n\t\tif(n==true){\n\t\t\tcout(\"true\");\n\t\t}else{\n\t\t\tcout(\"false\");\n\t\t}\n\t}\n}",
"Main"
] | import java.util.*;
public class Main {
static Scanner sc = new Scanner(System.in);
public static void main(String[] args) {
Stack<Integer> stk = new Stack<Integer>();
String s;
while(sc.hasNext()){
s = sc.next();
if(s.equals("+")){
int n1 = stk.pop();
int n2 = stk.pop();
stk.push(n1+n2);
}
else if(s.equals("-")){
int n1 = stk.pop();
int n2 = stk.pop();
stk.push(n2-n1);
}
else if(s.equals("*")){
int n1 = stk.pop();
int n2 = stk.pop();
stk.push(n1 * n2);
}
else{
stk.push(Integer.valueOf(s));
}
}
cout(stk.pop());
}
public static boolean isPrime(int n){
for(int i=2;i<=n*n;i++){
if(n%i==0) return true;
}
return false;
}
public static int gcd(int a,int b){
if(a%b==0) return b;
else return gcd(b,a%b);
}
public static void showary(int[] ary){
for(int i=0;i<ary.length-1;i++){
System.out.print(ary[i]+" ");
}
cout(ary[ary.length-1]);
}
public static void cout(String n){
System.out.println(n);
}
public static void cout(int n){
System.out.println(n);
}
public static void cout(boolean n){
if(n==true){
cout("true");
}else{
cout("false");
}
}
} |
[
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,
4,
13,
41,
13,
4,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
12,
13,
30,
41,
13,
20,
28,
13,
13,
30,
30,
14,
4,
13,
13,
30,
4,
18,
13,
13,
30,
41,
13,
4,
18,
13,
4,
18,
13,
41,
13,
4,
18,
13,
4,
18,
13,
41,
13,
14,
4,
18,
17,
13,
30,
0,
13,
4,
18,
13,
2,
13,
13,
14,
4,
18,
17,
13,
30,
0,
13,
4,
18,
13,
2,
13,
13,
30,
0,
13,
4,
18,
13,
2,
13,
13,
4,
18,
13,
13,
29,
4,
18,
13,
23,
13,
12,
13,
30,
41,
13,
4,
18,
13,
17,
41,
13,
4,
18,
13,
13,
29,
4,
18,
13,
23,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
4,
18,
13,
17,
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
],
[
16,
17
],
[
16,
18
],
[
0,
19
],
[
168,
20
],
[
168,
21
],
[
21,
22
],
[
21,
23
],
[
23,
24
],
[
24,
25
],
[
24,
26
],
[
26,
27
],
[
23,
28
],
[
28,
29
],
[
28,
30
],
[
30,
31
],
[
30,
32
],
[
23,
33
],
[
33,
34
],
[
34,
35
],
[
35,
36
],
[
35,
37
],
[
33,
38
],
[
21,
39
],
[
39,
40
],
[
168,
41
],
[
41,
42
],
[
41,
43
],
[
43,
44
],
[
44,
45
],
[
44,
46
],
[
43,
47
],
[
47,
48
],
[
47,
49
],
[
47,
50
],
[
51,
51
],
[
51,
52
],
[
52,
53
],
[
53,
54
],
[
53,
55
],
[
52,
56
],
[
56,
57
],
[
57,
58
],
[
58,
59
],
[
57,
60
],
[
52,
61
],
[
61,
62
],
[
62,
63
],
[
62,
64
],
[
64,
65
],
[
65,
66
],
[
64,
67
],
[
67,
68
],
[
68,
69
],
[
61,
70
],
[
70,
71
],
[
70,
72
],
[
72,
73
],
[
73,
74
],
[
72,
75
],
[
75,
76
],
[
76,
77
],
[
61,
78
],
[
78,
79
],
[
61,
80
],
[
80,
81
],
[
81,
82
],
[
82,
83
],
[
81,
84
],
[
80,
85
],
[
85,
86
],
[
86,
87
],
[
86,
88
],
[
88,
89
],
[
89,
90
],
[
88,
91
],
[
91,
92
],
[
91,
93
],
[
80,
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
],
[
105,
107
],
[
94,
108
],
[
108,
109
],
[
109,
110
],
[
109,
111
],
[
111,
112
],
[
112,
113
],
[
111,
114
],
[
114,
115
],
[
114,
116
],
[
61,
117
],
[
117,
118
],
[
118,
119
],
[
117,
120
],
[
43,
121
],
[
121,
122
],
[
122,
123
],
[
123,
124
],
[
41,
125
],
[
125,
126
],
[
168,
127
],
[
127,
128
],
[
127,
129
],
[
129,
130
],
[
130,
131
],
[
130,
132
],
[
132,
133
],
[
133,
134
],
[
132,
135
],
[
129,
136
],
[
136,
137
],
[
136,
138
],
[
138,
139
],
[
139,
140
],
[
138,
141
],
[
129,
142
],
[
142,
143
],
[
143,
144
],
[
144,
145
],
[
127,
146
],
[
146,
147
],
[
168,
148
],
[
148,
149
],
[
148,
150
],
[
150,
151
],
[
151,
152
],
[
151,
153
],
[
150,
154
],
[
154,
155
],
[
154,
156
],
[
156,
157
],
[
157,
158
],
[
158,
159
],
[
159,
160
],
[
156,
161
],
[
150,
162
],
[
162,
163
],
[
163,
164
],
[
150,
165
],
[
165,
166
],
[
0,
167
],
[
167,
168
],
[
167,
169
]
] | [
"import java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\nimport java.util.Stack;\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\tfinal String[] expression = getExpression();\n\t\t\n\t\tfinal String answer = calclate(expression);\n\t\tSystem.out.println(answer);\n\t}\n\t\n\tpublic static String calclate(final String[] expression) {\n\t\tfinal Stack<String> stack = new Stack<String>();\n\t\t\n\t\tfor (String term : expression) {\n\t\t\t\n\t\t\tif (isNumber(term)) {\n\t\t\t\tstack.push(term);\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\tfinal int operand2 = Integer.parseInt(stack.pop());\n\t\t\t\tfinal int operand1 = Integer.parseInt(stack.pop());\n\t\t\t\t\n\t\t\t\tString result;\n\t\t\t\tif (\"+\".equals(term)) {\n\t\t\t\t\tresult = String.valueOf(operand1 + operand2);\n\t\t\t\t\t\n\t\t\t\t} else if (\"-\".equals(term)) {\n\t\t\t\t\tresult = String.valueOf(operand1 - operand2);\n\t\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\tresult = String.valueOf(operand1 * operand2);\n\t\t\t\t}\n\t\t\t\tstack.push(result);\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn stack.pop();\n\t}\n\t\n\tpublic static boolean isNumber(String term) {\n\t\tPattern patternNum = Pattern.compile(\"-*[0-9]+\");\n\t\tMatcher matcherNum = patternNum.matcher(term);\n\t\t\n\t\treturn matcherNum.matches();\n\t}\n\t\n\tpublic static String[] getExpression() throws IOException {\n\t\tfinal BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));\n\t\tfinal String[] expression = reader.readLine().split(\" \");\n\t\treader.close();\n\t\t\n\t\treturn expression;\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.Stack;",
"Stack",
"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\tfinal String[] expression = getExpression();\n\t\t\n\t\tfinal String answer = calclate(expression);\n\t\tSystem.out.println(answer);\n\t}\n\t\n\tpublic static String calclate(final String[] expression) {\n\t\tfinal Stack<String> stack = new Stack<String>();\n\t\t\n\t\tfor (String term : expression) {\n\t\t\t\n\t\t\tif (isNumber(term)) {\n\t\t\t\tstack.push(term);\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\tfinal int operand2 = Integer.parseInt(stack.pop());\n\t\t\t\tfinal int operand1 = Integer.parseInt(stack.pop());\n\t\t\t\t\n\t\t\t\tString result;\n\t\t\t\tif (\"+\".equals(term)) {\n\t\t\t\t\tresult = String.valueOf(operand1 + operand2);\n\t\t\t\t\t\n\t\t\t\t} else if (\"-\".equals(term)) {\n\t\t\t\t\tresult = String.valueOf(operand1 - operand2);\n\t\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\tresult = String.valueOf(operand1 * operand2);\n\t\t\t\t}\n\t\t\t\tstack.push(result);\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn stack.pop();\n\t}\n\t\n\tpublic static boolean isNumber(String term) {\n\t\tPattern patternNum = Pattern.compile(\"-*[0-9]+\");\n\t\tMatcher matcherNum = patternNum.matcher(term);\n\t\t\n\t\treturn matcherNum.matches();\n\t}\n\t\n\tpublic static String[] getExpression() throws IOException {\n\t\tfinal BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));\n\t\tfinal String[] expression = reader.readLine().split(\" \");\n\t\treader.close();\n\t\t\n\t\treturn expression;\n\t}\n}",
"Main",
"public static void main(String[] args) throws IOException {\n\t\tfinal String[] expression = getExpression();\n\t\t\n\t\tfinal String answer = calclate(expression);\n\t\tSystem.out.println(answer);\n\t}",
"main",
"{\n\t\tfinal String[] expression = getExpression();\n\t\t\n\t\tfinal String answer = calclate(expression);\n\t\tSystem.out.println(answer);\n\t}",
"final String[] expression = getExpression();",
"expression",
"getExpression()",
"getExpression",
"final String answer = calclate(expression);",
"answer",
"calclate(expression)",
"calclate",
"expression",
"System.out.println(answer)",
"System.out.println",
"System.out",
"System",
"System.out",
"answer",
"String[] args",
"args",
"public static String calclate(final String[] expression) {\n\t\tfinal Stack<String> stack = new Stack<String>();\n\t\t\n\t\tfor (String term : expression) {\n\t\t\t\n\t\t\tif (isNumber(term)) {\n\t\t\t\tstack.push(term);\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\tfinal int operand2 = Integer.parseInt(stack.pop());\n\t\t\t\tfinal int operand1 = Integer.parseInt(stack.pop());\n\t\t\t\t\n\t\t\t\tString result;\n\t\t\t\tif (\"+\".equals(term)) {\n\t\t\t\t\tresult = String.valueOf(operand1 + operand2);\n\t\t\t\t\t\n\t\t\t\t} else if (\"-\".equals(term)) {\n\t\t\t\t\tresult = String.valueOf(operand1 - operand2);\n\t\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\tresult = String.valueOf(operand1 * operand2);\n\t\t\t\t}\n\t\t\t\tstack.push(result);\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn stack.pop();\n\t}",
"calclate",
"{\n\t\tfinal Stack<String> stack = new Stack<String>();\n\t\t\n\t\tfor (String term : expression) {\n\t\t\t\n\t\t\tif (isNumber(term)) {\n\t\t\t\tstack.push(term);\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\tfinal int operand2 = Integer.parseInt(stack.pop());\n\t\t\t\tfinal int operand1 = Integer.parseInt(stack.pop());\n\t\t\t\t\n\t\t\t\tString result;\n\t\t\t\tif (\"+\".equals(term)) {\n\t\t\t\t\tresult = String.valueOf(operand1 + operand2);\n\t\t\t\t\t\n\t\t\t\t} else if (\"-\".equals(term)) {\n\t\t\t\t\tresult = String.valueOf(operand1 - operand2);\n\t\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\tresult = String.valueOf(operand1 * operand2);\n\t\t\t\t}\n\t\t\t\tstack.push(result);\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn stack.pop();\n\t}",
"final Stack<String> stack = new Stack<String>();",
"stack",
"new Stack<String>()",
"for (String term : expression) {\n\t\t\t\n\t\t\tif (isNumber(term)) {\n\t\t\t\tstack.push(term);\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\tfinal int operand2 = Integer.parseInt(stack.pop());\n\t\t\t\tfinal int operand1 = Integer.parseInt(stack.pop());\n\t\t\t\t\n\t\t\t\tString result;\n\t\t\t\tif (\"+\".equals(term)) {\n\t\t\t\t\tresult = String.valueOf(operand1 + operand2);\n\t\t\t\t\t\n\t\t\t\t} else if (\"-\".equals(term)) {\n\t\t\t\t\tresult = String.valueOf(operand1 - operand2);\n\t\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\tresult = String.valueOf(operand1 * operand2);\n\t\t\t\t}\n\t\t\t\tstack.push(result);\n\t\t\t}\n\t\t}",
"String term",
"expression",
"{\n\t\t\t\n\t\t\tif (isNumber(term)) {\n\t\t\t\tstack.push(term);\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\tfinal int operand2 = Integer.parseInt(stack.pop());\n\t\t\t\tfinal int operand1 = Integer.parseInt(stack.pop());\n\t\t\t\t\n\t\t\t\tString result;\n\t\t\t\tif (\"+\".equals(term)) {\n\t\t\t\t\tresult = String.valueOf(operand1 + operand2);\n\t\t\t\t\t\n\t\t\t\t} else if (\"-\".equals(term)) {\n\t\t\t\t\tresult = String.valueOf(operand1 - operand2);\n\t\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\tresult = String.valueOf(operand1 * operand2);\n\t\t\t\t}\n\t\t\t\tstack.push(result);\n\t\t\t}\n\t\t}",
"{\n\t\t\t\n\t\t\tif (isNumber(term)) {\n\t\t\t\tstack.push(term);\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\tfinal int operand2 = Integer.parseInt(stack.pop());\n\t\t\t\tfinal int operand1 = Integer.parseInt(stack.pop());\n\t\t\t\t\n\t\t\t\tString result;\n\t\t\t\tif (\"+\".equals(term)) {\n\t\t\t\t\tresult = String.valueOf(operand1 + operand2);\n\t\t\t\t\t\n\t\t\t\t} else if (\"-\".equals(term)) {\n\t\t\t\t\tresult = String.valueOf(operand1 - operand2);\n\t\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\tresult = String.valueOf(operand1 * operand2);\n\t\t\t\t}\n\t\t\t\tstack.push(result);\n\t\t\t}\n\t\t}",
"if (isNumber(term)) {\n\t\t\t\tstack.push(term);\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\tfinal int operand2 = Integer.parseInt(stack.pop());\n\t\t\t\tfinal int operand1 = Integer.parseInt(stack.pop());\n\t\t\t\t\n\t\t\t\tString result;\n\t\t\t\tif (\"+\".equals(term)) {\n\t\t\t\t\tresult = String.valueOf(operand1 + operand2);\n\t\t\t\t\t\n\t\t\t\t} else if (\"-\".equals(term)) {\n\t\t\t\t\tresult = String.valueOf(operand1 - operand2);\n\t\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\tresult = String.valueOf(operand1 * operand2);\n\t\t\t\t}\n\t\t\t\tstack.push(result);\n\t\t\t}",
"isNumber(term)",
"isNumber",
"term",
"{\n\t\t\t\tstack.push(term);\n\t\t\t\t\n\t\t\t}",
"stack.push(term)",
"stack.push",
"stack",
"term",
"{\n\t\t\t\tfinal int operand2 = Integer.parseInt(stack.pop());\n\t\t\t\tfinal int operand1 = Integer.parseInt(stack.pop());\n\t\t\t\t\n\t\t\t\tString result;\n\t\t\t\tif (\"+\".equals(term)) {\n\t\t\t\t\tresult = String.valueOf(operand1 + operand2);\n\t\t\t\t\t\n\t\t\t\t} else if (\"-\".equals(term)) {\n\t\t\t\t\tresult = String.valueOf(operand1 - operand2);\n\t\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\tresult = String.valueOf(operand1 * operand2);\n\t\t\t\t}\n\t\t\t\tstack.push(result);\n\t\t\t}",
"final int operand2 = Integer.parseInt(stack.pop());",
"operand2",
"Integer.parseInt(stack.pop())",
"Integer.parseInt",
"Integer",
"stack.pop()",
"stack.pop",
"stack",
"final int operand1 = Integer.parseInt(stack.pop());",
"operand1",
"Integer.parseInt(stack.pop())",
"Integer.parseInt",
"Integer",
"stack.pop()",
"stack.pop",
"stack",
"String result;",
"result",
"if (\"+\".equals(term)) {\n\t\t\t\t\tresult = String.valueOf(operand1 + operand2);\n\t\t\t\t\t\n\t\t\t\t} else if (\"-\".equals(term)) {\n\t\t\t\t\tresult = String.valueOf(operand1 - operand2);\n\t\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\tresult = String.valueOf(operand1 * operand2);\n\t\t\t\t}",
"\"+\".equals(term)",
"\"+\".equals",
"\"+\"",
"term",
"{\n\t\t\t\t\tresult = String.valueOf(operand1 + operand2);\n\t\t\t\t\t\n\t\t\t\t}",
"result = String.valueOf(operand1 + operand2)",
"result",
"String.valueOf(operand1 + operand2)",
"String.valueOf",
"String",
"operand1 + operand2",
"operand1",
"operand2",
"if (\"-\".equals(term)) {\n\t\t\t\t\tresult = String.valueOf(operand1 - operand2);\n\t\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\tresult = String.valueOf(operand1 * operand2);\n\t\t\t\t}",
"\"-\".equals(term)",
"\"-\".equals",
"\"-\"",
"term",
"{\n\t\t\t\t\tresult = String.valueOf(operand1 - operand2);\n\t\t\t\t\t\n\t\t\t\t}",
"result = String.valueOf(operand1 - operand2)",
"result",
"String.valueOf(operand1 - operand2)",
"String.valueOf",
"String",
"operand1 - operand2",
"operand1",
"operand2",
"{\n\t\t\t\t\tresult = String.valueOf(operand1 * operand2);\n\t\t\t\t}",
"result = String.valueOf(operand1 * operand2)",
"result",
"String.valueOf(operand1 * operand2)",
"String.valueOf",
"String",
"operand1 * operand2",
"operand1",
"operand2",
"stack.push(result)",
"stack.push",
"stack",
"result",
"return stack.pop();",
"stack.pop()",
"stack.pop",
"stack",
"final String[] expression",
"expression",
"public static boolean isNumber(String term) {\n\t\tPattern patternNum = Pattern.compile(\"-*[0-9]+\");\n\t\tMatcher matcherNum = patternNum.matcher(term);\n\t\t\n\t\treturn matcherNum.matches();\n\t}",
"isNumber",
"{\n\t\tPattern patternNum = Pattern.compile(\"-*[0-9]+\");\n\t\tMatcher matcherNum = patternNum.matcher(term);\n\t\t\n\t\treturn matcherNum.matches();\n\t}",
"Pattern patternNum = Pattern.compile(\"-*[0-9]+\");",
"patternNum",
"Pattern.compile(\"-*[0-9]+\")",
"Pattern.compile",
"Pattern",
"\"-*[0-9]+\"",
"Matcher matcherNum = patternNum.matcher(term);",
"matcherNum",
"patternNum.matcher(term)",
"patternNum.matcher",
"patternNum",
"term",
"return matcherNum.matches();",
"matcherNum.matches()",
"matcherNum.matches",
"matcherNum",
"String term",
"term",
"public static String[] getExpression() throws IOException {\n\t\tfinal BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));\n\t\tfinal String[] expression = reader.readLine().split(\" \");\n\t\treader.close();\n\t\t\n\t\treturn expression;\n\t}",
"getExpression",
"{\n\t\tfinal BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));\n\t\tfinal String[] expression = reader.readLine().split(\" \");\n\t\treader.close();\n\t\t\n\t\treturn expression;\n\t}",
"final BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));",
"reader",
"new BufferedReader(new InputStreamReader(System.in))",
"final String[] expression = reader.readLine().split(\" \");",
"expression",
"reader.readLine().split(\" \")",
"reader.readLine().split",
"reader.readLine()",
"reader.readLine",
"reader",
"\" \"",
"reader.close()",
"reader.close",
"reader",
"return expression;",
"expression",
"public class Main {\n\tpublic static void main(String[] args) throws IOException {\n\t\tfinal String[] expression = getExpression();\n\t\t\n\t\tfinal String answer = calclate(expression);\n\t\tSystem.out.println(answer);\n\t}\n\t\n\tpublic static String calclate(final String[] expression) {\n\t\tfinal Stack<String> stack = new Stack<String>();\n\t\t\n\t\tfor (String term : expression) {\n\t\t\t\n\t\t\tif (isNumber(term)) {\n\t\t\t\tstack.push(term);\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\tfinal int operand2 = Integer.parseInt(stack.pop());\n\t\t\t\tfinal int operand1 = Integer.parseInt(stack.pop());\n\t\t\t\t\n\t\t\t\tString result;\n\t\t\t\tif (\"+\".equals(term)) {\n\t\t\t\t\tresult = String.valueOf(operand1 + operand2);\n\t\t\t\t\t\n\t\t\t\t} else if (\"-\".equals(term)) {\n\t\t\t\t\tresult = String.valueOf(operand1 - operand2);\n\t\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\tresult = String.valueOf(operand1 * operand2);\n\t\t\t\t}\n\t\t\t\tstack.push(result);\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn stack.pop();\n\t}\n\t\n\tpublic static boolean isNumber(String term) {\n\t\tPattern patternNum = Pattern.compile(\"-*[0-9]+\");\n\t\tMatcher matcherNum = patternNum.matcher(term);\n\t\t\n\t\treturn matcherNum.matches();\n\t}\n\t\n\tpublic static String[] getExpression() throws IOException {\n\t\tfinal BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));\n\t\tfinal String[] expression = reader.readLine().split(\" \");\n\t\treader.close();\n\t\t\n\t\treturn expression;\n\t}\n}",
"public class Main {\n\tpublic static void main(String[] args) throws IOException {\n\t\tfinal String[] expression = getExpression();\n\t\t\n\t\tfinal String answer = calclate(expression);\n\t\tSystem.out.println(answer);\n\t}\n\t\n\tpublic static String calclate(final String[] expression) {\n\t\tfinal Stack<String> stack = new Stack<String>();\n\t\t\n\t\tfor (String term : expression) {\n\t\t\t\n\t\t\tif (isNumber(term)) {\n\t\t\t\tstack.push(term);\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\tfinal int operand2 = Integer.parseInt(stack.pop());\n\t\t\t\tfinal int operand1 = Integer.parseInt(stack.pop());\n\t\t\t\t\n\t\t\t\tString result;\n\t\t\t\tif (\"+\".equals(term)) {\n\t\t\t\t\tresult = String.valueOf(operand1 + operand2);\n\t\t\t\t\t\n\t\t\t\t} else if (\"-\".equals(term)) {\n\t\t\t\t\tresult = String.valueOf(operand1 - operand2);\n\t\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\tresult = String.valueOf(operand1 * operand2);\n\t\t\t\t}\n\t\t\t\tstack.push(result);\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn stack.pop();\n\t}\n\t\n\tpublic static boolean isNumber(String term) {\n\t\tPattern patternNum = Pattern.compile(\"-*[0-9]+\");\n\t\tMatcher matcherNum = patternNum.matcher(term);\n\t\t\n\t\treturn matcherNum.matches();\n\t}\n\t\n\tpublic static String[] getExpression() throws IOException {\n\t\tfinal BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));\n\t\tfinal String[] expression = reader.readLine().split(\" \");\n\t\treader.close();\n\t\t\n\t\treturn expression;\n\t}\n}",
"Main"
] | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Stack;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class Main {
public static void main(String[] args) throws IOException {
final String[] expression = getExpression();
final String answer = calclate(expression);
System.out.println(answer);
}
public static String calclate(final String[] expression) {
final Stack<String> stack = new Stack<String>();
for (String term : expression) {
if (isNumber(term)) {
stack.push(term);
} else {
final int operand2 = Integer.parseInt(stack.pop());
final int operand1 = Integer.parseInt(stack.pop());
String result;
if ("+".equals(term)) {
result = String.valueOf(operand1 + operand2);
} else if ("-".equals(term)) {
result = String.valueOf(operand1 - operand2);
} else {
result = String.valueOf(operand1 * operand2);
}
stack.push(result);
}
}
return stack.pop();
}
public static boolean isNumber(String term) {
Pattern patternNum = Pattern.compile("-*[0-9]+");
Matcher matcherNum = patternNum.matcher(term);
return matcherNum.matches();
}
public static String[] getExpression() throws IOException {
final BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
final String[] expression = reader.readLine().split(" ");
reader.close();
return expression;
}
} |
[
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,
17,
41,
13,
17,
41,
13,
41,
13,
17,
41,
13,
20,
38,
5,
13,
30,
4,
18,
13,
30,
0,
13,
4,
18,
13,
0,
13,
20,
0,
13,
4,
18,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
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,
14,
4,
18,
13,
17,
30,
4,
18,
13,
2,
13,
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,
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
],
[
0,
10
],
[
10,
11
],
[
10,
12
],
[
0,
13
],
[
13,
14
],
[
13,
15
],
[
0,
16
],
[
16,
17
],
[
16,
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
],
[
32,
34
],
[
20,
35
],
[
35,
36
],
[
35,
37
],
[
20,
38
],
[
38,
39
],
[
39,
40
],
[
39,
41
],
[
41,
42
],
[
42,
43
],
[
43,
44
],
[
38,
45
],
[
45,
46
],
[
46,
47
],
[
46,
48
],
[
48,
49
],
[
49,
50
],
[
45,
51
],
[
51,
52
],
[
51,
53
],
[
45,
54
],
[
54,
55
],
[
54,
56
],
[
56,
57
],
[
57,
58
],
[
45,
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
],
[
79,
79
],
[
79,
80
],
[
80,
81
],
[
81,
82
],
[
80,
83
],
[
79,
84
],
[
84,
85
],
[
85,
86
],
[
84,
87
],
[
79,
88
],
[
88,
89
],
[
89,
90
],
[
88,
91
],
[
77,
92
],
[
92,
93
],
[
93,
94
],
[
93,
95
],
[
95,
96
],
[
96,
97
],
[
92,
98
],
[
98,
99
],
[
98,
100
],
[
100,
101
],
[
101,
102
],
[
92,
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
],
[
115,
120
],
[
120,
121
],
[
121,
122
],
[
122,
123
],
[
121,
124
],
[
124,
125
],
[
124,
126
],
[
115,
127
],
[
127,
128
],
[
128,
129
],
[
129,
130
],
[
128,
131
],
[
127,
132
],
[
132,
133
],
[
133,
134
],
[
134,
135
],
[
133,
136
],
[
136,
137
],
[
136,
138
],
[
77,
139
],
[
139,
140
],
[
140,
141
],
[
141,
142
],
[
140,
143
],
[
143,
144
],
[
144,
145
],
[
143,
146
],
[
45,
147
],
[
147,
148
],
[
148,
149
],
[
149,
150
],
[
149,
151
],
[
147,
152
],
[
152,
153
],
[
153,
154
],
[
18,
155
],
[
155,
156
]
] | [
"import java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\nimport java.util.Stack;\nimport java.util.StringTokenizer;\n\nclass Main{\t\t//スタック練習\n\n\tpublic static void main(String[] args) {\n\n\tBufferedReader bfr=new BufferedReader(new InputStreamReader(System.in));\n\t\tString str=\"\";\n\t\tString toridasi=\"\";\n\t\tStringTokenizer stk;\n\t\tint stacksize=0;\n\t\tStack<Integer> st=new Stack<Integer>();\n\n\t\ttry {\n\t\t\tstr=bfr.readLine();\n\t\t\tstk=new StringTokenizer(str,\" \");\n\t\t\tstacksize=stk.countTokens();\n\t\t\tfor(int i=0; i<stacksize; i++) {\n\t\t\t\ttoridasi=stk.nextToken();\n\n\t\t\t\tif(toridasi.equals(\"+\") || toridasi.equals(\"-\") || toridasi.equals(\"*\")) {\n\t\t\t\t\tint b=st.pop();\n\t\t\t\t\tint a=st.pop();\n\t\t\t\t\tif(toridasi.equals(\"+\")) {\n\t\t\t\t\t\tst.push(a+b);\n\t\t\t\t\t}\n\t\t\t\t\telse if(toridasi.equals(\"-\")) {\n\t\t\t\t\t\tst.push(a-b);\n\t\t\t\t\t}\n\n\t\t\t\t\telse if(toridasi.equals(\"*\")) {\n\t\t\t\t\t\tst.push(a*b);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tst.push(Integer.parseInt(toridasi));\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(st.pop());\n\t\t}\n\t\tcatch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\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.Stack;",
"Stack",
"java.util",
"import java.util.StringTokenizer;",
"StringTokenizer",
"java.util",
"class Main{\t\t//スタック練習\n\n\tpublic static void main(String[] args) {\n\n\tBufferedReader bfr=new BufferedReader(new InputStreamReader(System.in));\n\t\tString str=\"\";\n\t\tString toridasi=\"\";\n\t\tStringTokenizer stk;\n\t\tint stacksize=0;\n\t\tStack<Integer> st=new Stack<Integer>();\n\n\t\ttry {\n\t\t\tstr=bfr.readLine();\n\t\t\tstk=new StringTokenizer(str,\" \");\n\t\t\tstacksize=stk.countTokens();\n\t\t\tfor(int i=0; i<stacksize; i++) {\n\t\t\t\ttoridasi=stk.nextToken();\n\n\t\t\t\tif(toridasi.equals(\"+\") || toridasi.equals(\"-\") || toridasi.equals(\"*\")) {\n\t\t\t\t\tint b=st.pop();\n\t\t\t\t\tint a=st.pop();\n\t\t\t\t\tif(toridasi.equals(\"+\")) {\n\t\t\t\t\t\tst.push(a+b);\n\t\t\t\t\t}\n\t\t\t\t\telse if(toridasi.equals(\"-\")) {\n\t\t\t\t\t\tst.push(a-b);\n\t\t\t\t\t}\n\n\t\t\t\t\telse if(toridasi.equals(\"*\")) {\n\t\t\t\t\t\tst.push(a*b);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tst.push(Integer.parseInt(toridasi));\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(st.pop());\n\t\t}\n\t\tcatch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t}\n}",
"Main",
"public static void main(String[] args) {\n\n\tBufferedReader bfr=new BufferedReader(new InputStreamReader(System.in));\n\t\tString str=\"\";\n\t\tString toridasi=\"\";\n\t\tStringTokenizer stk;\n\t\tint stacksize=0;\n\t\tStack<Integer> st=new Stack<Integer>();\n\n\t\ttry {\n\t\t\tstr=bfr.readLine();\n\t\t\tstk=new StringTokenizer(str,\" \");\n\t\t\tstacksize=stk.countTokens();\n\t\t\tfor(int i=0; i<stacksize; i++) {\n\t\t\t\ttoridasi=stk.nextToken();\n\n\t\t\t\tif(toridasi.equals(\"+\") || toridasi.equals(\"-\") || toridasi.equals(\"*\")) {\n\t\t\t\t\tint b=st.pop();\n\t\t\t\t\tint a=st.pop();\n\t\t\t\t\tif(toridasi.equals(\"+\")) {\n\t\t\t\t\t\tst.push(a+b);\n\t\t\t\t\t}\n\t\t\t\t\telse if(toridasi.equals(\"-\")) {\n\t\t\t\t\t\tst.push(a-b);\n\t\t\t\t\t}\n\n\t\t\t\t\telse if(toridasi.equals(\"*\")) {\n\t\t\t\t\t\tst.push(a*b);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tst.push(Integer.parseInt(toridasi));\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(st.pop());\n\t\t}\n\t\tcatch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t}",
"main",
"{\n\n\tBufferedReader bfr=new BufferedReader(new InputStreamReader(System.in));\n\t\tString str=\"\";\n\t\tString toridasi=\"\";\n\t\tStringTokenizer stk;\n\t\tint stacksize=0;\n\t\tStack<Integer> st=new Stack<Integer>();\n\n\t\ttry {\n\t\t\tstr=bfr.readLine();\n\t\t\tstk=new StringTokenizer(str,\" \");\n\t\t\tstacksize=stk.countTokens();\n\t\t\tfor(int i=0; i<stacksize; i++) {\n\t\t\t\ttoridasi=stk.nextToken();\n\n\t\t\t\tif(toridasi.equals(\"+\") || toridasi.equals(\"-\") || toridasi.equals(\"*\")) {\n\t\t\t\t\tint b=st.pop();\n\t\t\t\t\tint a=st.pop();\n\t\t\t\t\tif(toridasi.equals(\"+\")) {\n\t\t\t\t\t\tst.push(a+b);\n\t\t\t\t\t}\n\t\t\t\t\telse if(toridasi.equals(\"-\")) {\n\t\t\t\t\t\tst.push(a-b);\n\t\t\t\t\t}\n\n\t\t\t\t\telse if(toridasi.equals(\"*\")) {\n\t\t\t\t\t\tst.push(a*b);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tst.push(Integer.parseInt(toridasi));\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(st.pop());\n\t\t}\n\t\tcatch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t}",
"BufferedReader bfr=new BufferedReader(new InputStreamReader(System.in));",
"bfr",
"new BufferedReader(new InputStreamReader(System.in))",
"String str=\"\";",
"str",
"\"\"",
"String toridasi=\"\";",
"toridasi",
"\"\"",
"StringTokenizer stk;",
"stk",
"int stacksize=0;",
"stacksize",
"0",
"Stack<Integer> st=new Stack<Integer>();",
"st",
"new Stack<Integer>()",
"try {\n\t\t\tstr=bfr.readLine();\n\t\t\tstk=new StringTokenizer(str,\" \");\n\t\t\tstacksize=stk.countTokens();\n\t\t\tfor(int i=0; i<stacksize; i++) {\n\t\t\t\ttoridasi=stk.nextToken();\n\n\t\t\t\tif(toridasi.equals(\"+\") || toridasi.equals(\"-\") || toridasi.equals(\"*\")) {\n\t\t\t\t\tint b=st.pop();\n\t\t\t\t\tint a=st.pop();\n\t\t\t\t\tif(toridasi.equals(\"+\")) {\n\t\t\t\t\t\tst.push(a+b);\n\t\t\t\t\t}\n\t\t\t\t\telse if(toridasi.equals(\"-\")) {\n\t\t\t\t\t\tst.push(a-b);\n\t\t\t\t\t}\n\n\t\t\t\t\telse if(toridasi.equals(\"*\")) {\n\t\t\t\t\t\tst.push(a*b);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tst.push(Integer.parseInt(toridasi));\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(st.pop());\n\t\t}\n\t\tcatch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}",
"catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}",
"IOException e",
"{\n\t\t\te.printStackTrace();\n\t\t}",
"e.printStackTrace()",
"e.printStackTrace",
"e",
"{\n\t\t\tstr=bfr.readLine();\n\t\t\tstk=new StringTokenizer(str,\" \");\n\t\t\tstacksize=stk.countTokens();\n\t\t\tfor(int i=0; i<stacksize; i++) {\n\t\t\t\ttoridasi=stk.nextToken();\n\n\t\t\t\tif(toridasi.equals(\"+\") || toridasi.equals(\"-\") || toridasi.equals(\"*\")) {\n\t\t\t\t\tint b=st.pop();\n\t\t\t\t\tint a=st.pop();\n\t\t\t\t\tif(toridasi.equals(\"+\")) {\n\t\t\t\t\t\tst.push(a+b);\n\t\t\t\t\t}\n\t\t\t\t\telse if(toridasi.equals(\"-\")) {\n\t\t\t\t\t\tst.push(a-b);\n\t\t\t\t\t}\n\n\t\t\t\t\telse if(toridasi.equals(\"*\")) {\n\t\t\t\t\t\tst.push(a*b);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tst.push(Integer.parseInt(toridasi));\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(st.pop());\n\t\t}",
"str=bfr.readLine()",
"str",
"bfr.readLine()",
"bfr.readLine",
"bfr",
"stk=new StringTokenizer(str,\" \")",
"stk",
"new StringTokenizer(str,\" \")",
"stacksize=stk.countTokens()",
"stacksize",
"stk.countTokens()",
"stk.countTokens",
"stk",
"for(int i=0; i<stacksize; i++) {\n\t\t\t\ttoridasi=stk.nextToken();\n\n\t\t\t\tif(toridasi.equals(\"+\") || toridasi.equals(\"-\") || toridasi.equals(\"*\")) {\n\t\t\t\t\tint b=st.pop();\n\t\t\t\t\tint a=st.pop();\n\t\t\t\t\tif(toridasi.equals(\"+\")) {\n\t\t\t\t\t\tst.push(a+b);\n\t\t\t\t\t}\n\t\t\t\t\telse if(toridasi.equals(\"-\")) {\n\t\t\t\t\t\tst.push(a-b);\n\t\t\t\t\t}\n\n\t\t\t\t\telse if(toridasi.equals(\"*\")) {\n\t\t\t\t\t\tst.push(a*b);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tst.push(Integer.parseInt(toridasi));\n\t\t\t\t}\n\t\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<stacksize",
"i",
"stacksize",
"i++",
"i++",
"i",
"{\n\t\t\t\ttoridasi=stk.nextToken();\n\n\t\t\t\tif(toridasi.equals(\"+\") || toridasi.equals(\"-\") || toridasi.equals(\"*\")) {\n\t\t\t\t\tint b=st.pop();\n\t\t\t\t\tint a=st.pop();\n\t\t\t\t\tif(toridasi.equals(\"+\")) {\n\t\t\t\t\t\tst.push(a+b);\n\t\t\t\t\t}\n\t\t\t\t\telse if(toridasi.equals(\"-\")) {\n\t\t\t\t\t\tst.push(a-b);\n\t\t\t\t\t}\n\n\t\t\t\t\telse if(toridasi.equals(\"*\")) {\n\t\t\t\t\t\tst.push(a*b);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tst.push(Integer.parseInt(toridasi));\n\t\t\t\t}\n\t\t\t}",
"{\n\t\t\t\ttoridasi=stk.nextToken();\n\n\t\t\t\tif(toridasi.equals(\"+\") || toridasi.equals(\"-\") || toridasi.equals(\"*\")) {\n\t\t\t\t\tint b=st.pop();\n\t\t\t\t\tint a=st.pop();\n\t\t\t\t\tif(toridasi.equals(\"+\")) {\n\t\t\t\t\t\tst.push(a+b);\n\t\t\t\t\t}\n\t\t\t\t\telse if(toridasi.equals(\"-\")) {\n\t\t\t\t\t\tst.push(a-b);\n\t\t\t\t\t}\n\n\t\t\t\t\telse if(toridasi.equals(\"*\")) {\n\t\t\t\t\t\tst.push(a*b);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tst.push(Integer.parseInt(toridasi));\n\t\t\t\t}\n\t\t\t}",
"toridasi=stk.nextToken()",
"toridasi",
"stk.nextToken()",
"stk.nextToken",
"stk",
"if(toridasi.equals(\"+\") || toridasi.equals(\"-\") || toridasi.equals(\"*\")) {\n\t\t\t\t\tint b=st.pop();\n\t\t\t\t\tint a=st.pop();\n\t\t\t\t\tif(toridasi.equals(\"+\")) {\n\t\t\t\t\t\tst.push(a+b);\n\t\t\t\t\t}\n\t\t\t\t\telse if(toridasi.equals(\"-\")) {\n\t\t\t\t\t\tst.push(a-b);\n\t\t\t\t\t}\n\n\t\t\t\t\telse if(toridasi.equals(\"*\")) {\n\t\t\t\t\t\tst.push(a*b);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tst.push(Integer.parseInt(toridasi));\n\t\t\t\t}",
"toridasi.equals(\"+\") || toridasi.equals(\"-\") || toridasi.equals(\"*\")",
"toridasi.equals(\"+\") || toridasi.equals(\"-\") || toridasi.equals(\"*\")",
"toridasi.equals(\"+\")",
"toridasi.equals",
"toridasi",
"\"+\"",
"toridasi.equals(\"-\")",
"toridasi.equals",
"toridasi",
"\"-\"",
"toridasi.equals(\"*\")",
"toridasi.equals",
"toridasi",
"\"*\"",
"{\n\t\t\t\t\tint b=st.pop();\n\t\t\t\t\tint a=st.pop();\n\t\t\t\t\tif(toridasi.equals(\"+\")) {\n\t\t\t\t\t\tst.push(a+b);\n\t\t\t\t\t}\n\t\t\t\t\telse if(toridasi.equals(\"-\")) {\n\t\t\t\t\t\tst.push(a-b);\n\t\t\t\t\t}\n\n\t\t\t\t\telse if(toridasi.equals(\"*\")) {\n\t\t\t\t\t\tst.push(a*b);\n\t\t\t\t\t}\n\t\t\t\t}",
"int b=st.pop();",
"b",
"st.pop()",
"st.pop",
"st",
"int a=st.pop();",
"a",
"st.pop()",
"st.pop",
"st",
"if(toridasi.equals(\"+\")) {\n\t\t\t\t\t\tst.push(a+b);\n\t\t\t\t\t}\n\t\t\t\t\telse if(toridasi.equals(\"-\")) {\n\t\t\t\t\t\tst.push(a-b);\n\t\t\t\t\t}\n\n\t\t\t\t\telse if(toridasi.equals(\"*\")) {\n\t\t\t\t\t\tst.push(a*b);\n\t\t\t\t\t}",
"toridasi.equals(\"+\")",
"toridasi.equals",
"toridasi",
"\"+\"",
"{\n\t\t\t\t\t\tst.push(a+b);\n\t\t\t\t\t}",
"st.push(a+b)",
"st.push",
"st",
"a+b",
"a",
"b",
"if(toridasi.equals(\"-\")) {\n\t\t\t\t\t\tst.push(a-b);\n\t\t\t\t\t}\n\n\t\t\t\t\telse if(toridasi.equals(\"*\")) {\n\t\t\t\t\t\tst.push(a*b);\n\t\t\t\t\t}",
"toridasi.equals(\"-\")",
"toridasi.equals",
"toridasi",
"\"-\"",
"{\n\t\t\t\t\t\tst.push(a-b);\n\t\t\t\t\t}",
"st.push(a-b)",
"st.push",
"st",
"a-b",
"a",
"b",
"if(toridasi.equals(\"*\")) {\n\t\t\t\t\t\tst.push(a*b);\n\t\t\t\t\t}",
"toridasi.equals(\"*\")",
"toridasi.equals",
"toridasi",
"\"*\"",
"{\n\t\t\t\t\t\tst.push(a*b);\n\t\t\t\t\t}",
"st.push(a*b)",
"st.push",
"st",
"a*b",
"a",
"b",
"{\n\t\t\t\t\tst.push(Integer.parseInt(toridasi));\n\t\t\t\t}",
"st.push(Integer.parseInt(toridasi))",
"st.push",
"st",
"Integer.parseInt(toridasi)",
"Integer.parseInt",
"Integer",
"toridasi",
"System.out.println(st.pop())",
"System.out.println",
"System.out",
"System",
"System.out",
"st.pop()",
"st.pop",
"st",
"String[] args",
"args"
] | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Stack;
import java.util.StringTokenizer;
class Main{ //スタック練習
public static void main(String[] args) {
BufferedReader bfr=new BufferedReader(new InputStreamReader(System.in));
String str="";
String toridasi="";
StringTokenizer stk;
int stacksize=0;
Stack<Integer> st=new Stack<Integer>();
try {
str=bfr.readLine();
stk=new StringTokenizer(str," ");
stacksize=stk.countTokens();
for(int i=0; i<stacksize; i++) {
toridasi=stk.nextToken();
if(toridasi.equals("+") || toridasi.equals("-") || toridasi.equals("*")) {
int b=st.pop();
int a=st.pop();
if(toridasi.equals("+")) {
st.push(a+b);
}
else if(toridasi.equals("-")) {
st.push(a-b);
}
else if(toridasi.equals("*")) {
st.push(a*b);
}
}
else {
st.push(Integer.parseInt(toridasi));
}
}
System.out.println(st.pop());
}
catch (IOException e) {
e.printStackTrace();
}
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
0,
13,
4,
18,
4,
18,
13,
17,
41,
13,
20,
4,
18,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
30,
41,
13,
14,
2,
2,
4,
18,
18,
13,
13,
17,
4,
18,
18,
13,
13,
17,
4,
18,
18,
13,
13,
17,
30,
0,
13,
18,
13,
13,
14,
4,
18,
13,
17,
30,
0,
13,
2,
4,
18,
13,
4,
18,
13,
4,
18,
13,
13,
14,
4,
18,
13,
17,
30,
0,
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,
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
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
160,
8
],
[
160,
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
],
[
21,
22
],
[
22,
23
],
[
19,
24
],
[
11,
25
],
[
25,
26
],
[
25,
27
],
[
11,
28
],
[
28,
29
],
[
29,
30
],
[
11,
31
],
[
31,
32
],
[
31,
33
],
[
11,
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
],
[
48,
51
],
[
51,
52
],
[
53,
53
],
[
53,
54
],
[
54,
55
],
[
55,
56
],
[
56,
57
],
[
56,
58
],
[
54,
59
],
[
53,
60
],
[
60,
61
],
[
61,
62
],
[
62,
63
],
[
62,
64
],
[
60,
65
],
[
53,
66
],
[
66,
67
],
[
67,
68
],
[
68,
69
],
[
68,
70
],
[
66,
71
],
[
51,
72
],
[
72,
73
],
[
73,
74
],
[
73,
75
],
[
75,
76
],
[
75,
77
],
[
72,
78
],
[
78,
79
],
[
79,
80
],
[
80,
81
],
[
79,
82
],
[
78,
83
],
[
83,
84
],
[
84,
85
],
[
84,
86
],
[
86,
87
],
[
87,
88
],
[
88,
89
],
[
86,
90
],
[
90,
91
],
[
91,
92
],
[
83,
93
],
[
93,
94
],
[
94,
95
],
[
93,
96
],
[
78,
97
],
[
97,
98
],
[
98,
99
],
[
99,
100
],
[
98,
101
],
[
97,
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
],
[
97,
116
],
[
116,
117
],
[
117,
118
],
[
118,
119
],
[
117,
120
],
[
116,
121
],
[
121,
122
],
[
122,
123
],
[
122,
124
],
[
124,
125
],
[
125,
126
],
[
121,
127
],
[
127,
128
],
[
127,
129
],
[
129,
130
],
[
130,
131
],
[
121,
132
],
[
132,
133
],
[
132,
134
],
[
134,
135
],
[
134,
136
],
[
121,
137
],
[
137,
138
],
[
138,
139
],
[
137,
140
],
[
51,
141
],
[
141,
142
],
[
142,
143
],
[
143,
144
],
[
142,
145
],
[
145,
146
],
[
146,
147
],
[
145,
148
],
[
148,
149
],
[
148,
150
],
[
11,
151
],
[
151,
152
],
[
152,
153
],
[
153,
154
],
[
153,
155
],
[
151,
156
],
[
9,
157
],
[
157,
158
],
[
0,
159
],
[
159,
160
],
[
159,
161
]
] | [
"import java.util.Scanner;\nimport java.util.Stack;\n\npublic class Main {\n\n\tpublic static void main(String[] args) {\n\tScanner input = new Scanner(System.in);\n\tString[] equation;\n\tequation = input.nextLine().split(\" \");\n\tStack<Integer> numbers = new Stack<Integer>();\n\tinput.close();\n\tint solution = 0;\n\tfor(int i = 0; i < equation.length; i++) {\n\t\tString operator;\n\t\t\n\t\tif(equation[i].equals(\"*\") || equation[i].equals(\"+\") || equation[i].equals(\"-\")) {\n\t\t\toperator = equation[i];\n\t\t\tif(operator.equals(\"*\")) {\n\t\t\t\tsolution = (numbers.pop() * numbers.pop());\n\t\t\t\tnumbers.push(solution);\n\t\t\t}\n\t\t\telse if(operator.equals(\"+\")) {\n\t\t\t\tsolution = (numbers.pop() + numbers.pop());\n\t\t\t\tnumbers.push(solution);\n\t\t\t}\n\t\t\telse if(operator.equals(\"-\")) {\n\t\t\t\tint first = numbers.pop();\n\t\t\t\tint second = numbers.pop();\n\t\t\t\tsolution = ( second - first );\n\t\t\t\tnumbers.push(solution);\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t}\n\t\telse {\n\t\t\tnumbers.push(Integer.parseInt(equation[i]));\n\t\t}\n\t\t\n\t\t\n\t}\n\tSystem.out.println(solution);\n\n\t\t\n\t}\n\t\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\tScanner input = new Scanner(System.in);\n\tString[] equation;\n\tequation = input.nextLine().split(\" \");\n\tStack<Integer> numbers = new Stack<Integer>();\n\tinput.close();\n\tint solution = 0;\n\tfor(int i = 0; i < equation.length; i++) {\n\t\tString operator;\n\t\t\n\t\tif(equation[i].equals(\"*\") || equation[i].equals(\"+\") || equation[i].equals(\"-\")) {\n\t\t\toperator = equation[i];\n\t\t\tif(operator.equals(\"*\")) {\n\t\t\t\tsolution = (numbers.pop() * numbers.pop());\n\t\t\t\tnumbers.push(solution);\n\t\t\t}\n\t\t\telse if(operator.equals(\"+\")) {\n\t\t\t\tsolution = (numbers.pop() + numbers.pop());\n\t\t\t\tnumbers.push(solution);\n\t\t\t}\n\t\t\telse if(operator.equals(\"-\")) {\n\t\t\t\tint first = numbers.pop();\n\t\t\t\tint second = numbers.pop();\n\t\t\t\tsolution = ( second - first );\n\t\t\t\tnumbers.push(solution);\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t}\n\t\telse {\n\t\t\tnumbers.push(Integer.parseInt(equation[i]));\n\t\t}\n\t\t\n\t\t\n\t}\n\tSystem.out.println(solution);\n\n\t\t\n\t}\n\t\n\t\n\n}",
"Main",
"public static void main(String[] args) {\n\tScanner input = new Scanner(System.in);\n\tString[] equation;\n\tequation = input.nextLine().split(\" \");\n\tStack<Integer> numbers = new Stack<Integer>();\n\tinput.close();\n\tint solution = 0;\n\tfor(int i = 0; i < equation.length; i++) {\n\t\tString operator;\n\t\t\n\t\tif(equation[i].equals(\"*\") || equation[i].equals(\"+\") || equation[i].equals(\"-\")) {\n\t\t\toperator = equation[i];\n\t\t\tif(operator.equals(\"*\")) {\n\t\t\t\tsolution = (numbers.pop() * numbers.pop());\n\t\t\t\tnumbers.push(solution);\n\t\t\t}\n\t\t\telse if(operator.equals(\"+\")) {\n\t\t\t\tsolution = (numbers.pop() + numbers.pop());\n\t\t\t\tnumbers.push(solution);\n\t\t\t}\n\t\t\telse if(operator.equals(\"-\")) {\n\t\t\t\tint first = numbers.pop();\n\t\t\t\tint second = numbers.pop();\n\t\t\t\tsolution = ( second - first );\n\t\t\t\tnumbers.push(solution);\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t}\n\t\telse {\n\t\t\tnumbers.push(Integer.parseInt(equation[i]));\n\t\t}\n\t\t\n\t\t\n\t}\n\tSystem.out.println(solution);\n\n\t\t\n\t}",
"main",
"{\n\tScanner input = new Scanner(System.in);\n\tString[] equation;\n\tequation = input.nextLine().split(\" \");\n\tStack<Integer> numbers = new Stack<Integer>();\n\tinput.close();\n\tint solution = 0;\n\tfor(int i = 0; i < equation.length; i++) {\n\t\tString operator;\n\t\t\n\t\tif(equation[i].equals(\"*\") || equation[i].equals(\"+\") || equation[i].equals(\"-\")) {\n\t\t\toperator = equation[i];\n\t\t\tif(operator.equals(\"*\")) {\n\t\t\t\tsolution = (numbers.pop() * numbers.pop());\n\t\t\t\tnumbers.push(solution);\n\t\t\t}\n\t\t\telse if(operator.equals(\"+\")) {\n\t\t\t\tsolution = (numbers.pop() + numbers.pop());\n\t\t\t\tnumbers.push(solution);\n\t\t\t}\n\t\t\telse if(operator.equals(\"-\")) {\n\t\t\t\tint first = numbers.pop();\n\t\t\t\tint second = numbers.pop();\n\t\t\t\tsolution = ( second - first );\n\t\t\t\tnumbers.push(solution);\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t}\n\t\telse {\n\t\t\tnumbers.push(Integer.parseInt(equation[i]));\n\t\t}\n\t\t\n\t\t\n\t}\n\tSystem.out.println(solution);\n\n\t\t\n\t}",
"Scanner input = new Scanner(System.in);",
"input",
"new Scanner(System.in)",
"String[] equation;",
"equation",
"equation = input.nextLine().split(\" \")",
"equation",
"input.nextLine().split(\" \")",
"input.nextLine().split",
"input.nextLine()",
"input.nextLine",
"input",
"\" \"",
"Stack<Integer> numbers = new Stack<Integer>();",
"numbers",
"new Stack<Integer>()",
"input.close()",
"input.close",
"input",
"int solution = 0;",
"solution",
"0",
"for(int i = 0; i < equation.length; i++) {\n\t\tString operator;\n\t\t\n\t\tif(equation[i].equals(\"*\") || equation[i].equals(\"+\") || equation[i].equals(\"-\")) {\n\t\t\toperator = equation[i];\n\t\t\tif(operator.equals(\"*\")) {\n\t\t\t\tsolution = (numbers.pop() * numbers.pop());\n\t\t\t\tnumbers.push(solution);\n\t\t\t}\n\t\t\telse if(operator.equals(\"+\")) {\n\t\t\t\tsolution = (numbers.pop() + numbers.pop());\n\t\t\t\tnumbers.push(solution);\n\t\t\t}\n\t\t\telse if(operator.equals(\"-\")) {\n\t\t\t\tint first = numbers.pop();\n\t\t\t\tint second = numbers.pop();\n\t\t\t\tsolution = ( second - first );\n\t\t\t\tnumbers.push(solution);\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t}\n\t\telse {\n\t\t\tnumbers.push(Integer.parseInt(equation[i]));\n\t\t}\n\t\t\n\t\t\n\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < equation.length",
"i",
"equation.length",
"equation",
"equation.length",
"i++",
"i++",
"i",
"{\n\t\tString operator;\n\t\t\n\t\tif(equation[i].equals(\"*\") || equation[i].equals(\"+\") || equation[i].equals(\"-\")) {\n\t\t\toperator = equation[i];\n\t\t\tif(operator.equals(\"*\")) {\n\t\t\t\tsolution = (numbers.pop() * numbers.pop());\n\t\t\t\tnumbers.push(solution);\n\t\t\t}\n\t\t\telse if(operator.equals(\"+\")) {\n\t\t\t\tsolution = (numbers.pop() + numbers.pop());\n\t\t\t\tnumbers.push(solution);\n\t\t\t}\n\t\t\telse if(operator.equals(\"-\")) {\n\t\t\t\tint first = numbers.pop();\n\t\t\t\tint second = numbers.pop();\n\t\t\t\tsolution = ( second - first );\n\t\t\t\tnumbers.push(solution);\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t}\n\t\telse {\n\t\t\tnumbers.push(Integer.parseInt(equation[i]));\n\t\t}\n\t\t\n\t\t\n\t}",
"{\n\t\tString operator;\n\t\t\n\t\tif(equation[i].equals(\"*\") || equation[i].equals(\"+\") || equation[i].equals(\"-\")) {\n\t\t\toperator = equation[i];\n\t\t\tif(operator.equals(\"*\")) {\n\t\t\t\tsolution = (numbers.pop() * numbers.pop());\n\t\t\t\tnumbers.push(solution);\n\t\t\t}\n\t\t\telse if(operator.equals(\"+\")) {\n\t\t\t\tsolution = (numbers.pop() + numbers.pop());\n\t\t\t\tnumbers.push(solution);\n\t\t\t}\n\t\t\telse if(operator.equals(\"-\")) {\n\t\t\t\tint first = numbers.pop();\n\t\t\t\tint second = numbers.pop();\n\t\t\t\tsolution = ( second - first );\n\t\t\t\tnumbers.push(solution);\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t}\n\t\telse {\n\t\t\tnumbers.push(Integer.parseInt(equation[i]));\n\t\t}\n\t\t\n\t\t\n\t}",
"String operator;",
"operator",
"if(equation[i].equals(\"*\") || equation[i].equals(\"+\") || equation[i].equals(\"-\")) {\n\t\t\toperator = equation[i];\n\t\t\tif(operator.equals(\"*\")) {\n\t\t\t\tsolution = (numbers.pop() * numbers.pop());\n\t\t\t\tnumbers.push(solution);\n\t\t\t}\n\t\t\telse if(operator.equals(\"+\")) {\n\t\t\t\tsolution = (numbers.pop() + numbers.pop());\n\t\t\t\tnumbers.push(solution);\n\t\t\t}\n\t\t\telse if(operator.equals(\"-\")) {\n\t\t\t\tint first = numbers.pop();\n\t\t\t\tint second = numbers.pop();\n\t\t\t\tsolution = ( second - first );\n\t\t\t\tnumbers.push(solution);\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t}\n\t\telse {\n\t\t\tnumbers.push(Integer.parseInt(equation[i]));\n\t\t}",
"equation[i].equals(\"*\") || equation[i].equals(\"+\") || equation[i].equals(\"-\")",
"equation[i].equals(\"*\") || equation[i].equals(\"+\") || equation[i].equals(\"-\")",
"equation[i].equals(\"*\")",
"equation[i].equals",
"equation[i]",
"equation",
"i",
"\"*\"",
"equation[i].equals(\"+\")",
"equation[i].equals",
"equation[i]",
"equation",
"i",
"\"+\"",
"equation[i].equals(\"-\")",
"equation[i].equals",
"equation[i]",
"equation",
"i",
"\"-\"",
"{\n\t\t\toperator = equation[i];\n\t\t\tif(operator.equals(\"*\")) {\n\t\t\t\tsolution = (numbers.pop() * numbers.pop());\n\t\t\t\tnumbers.push(solution);\n\t\t\t}\n\t\t\telse if(operator.equals(\"+\")) {\n\t\t\t\tsolution = (numbers.pop() + numbers.pop());\n\t\t\t\tnumbers.push(solution);\n\t\t\t}\n\t\t\telse if(operator.equals(\"-\")) {\n\t\t\t\tint first = numbers.pop();\n\t\t\t\tint second = numbers.pop();\n\t\t\t\tsolution = ( second - first );\n\t\t\t\tnumbers.push(solution);\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t}",
"operator = equation[i]",
"operator",
"equation[i]",
"equation",
"i",
"if(operator.equals(\"*\")) {\n\t\t\t\tsolution = (numbers.pop() * numbers.pop());\n\t\t\t\tnumbers.push(solution);\n\t\t\t}\n\t\t\telse if(operator.equals(\"+\")) {\n\t\t\t\tsolution = (numbers.pop() + numbers.pop());\n\t\t\t\tnumbers.push(solution);\n\t\t\t}\n\t\t\telse if(operator.equals(\"-\")) {\n\t\t\t\tint first = numbers.pop();\n\t\t\t\tint second = numbers.pop();\n\t\t\t\tsolution = ( second - first );\n\t\t\t\tnumbers.push(solution);\n\t\t\t}",
"operator.equals(\"*\")",
"operator.equals",
"operator",
"\"*\"",
"{\n\t\t\t\tsolution = (numbers.pop() * numbers.pop());\n\t\t\t\tnumbers.push(solution);\n\t\t\t}",
"solution = (numbers.pop() * numbers.pop())",
"solution",
"(numbers.pop() * numbers.pop())",
"numbers.pop()",
"numbers.pop",
"numbers",
"numbers.pop()",
"numbers.pop",
"numbers",
"numbers.push(solution)",
"numbers.push",
"numbers",
"solution",
"if(operator.equals(\"+\")) {\n\t\t\t\tsolution = (numbers.pop() + numbers.pop());\n\t\t\t\tnumbers.push(solution);\n\t\t\t}\n\t\t\telse if(operator.equals(\"-\")) {\n\t\t\t\tint first = numbers.pop();\n\t\t\t\tint second = numbers.pop();\n\t\t\t\tsolution = ( second - first );\n\t\t\t\tnumbers.push(solution);\n\t\t\t}",
"operator.equals(\"+\")",
"operator.equals",
"operator",
"\"+\"",
"{\n\t\t\t\tsolution = (numbers.pop() + numbers.pop());\n\t\t\t\tnumbers.push(solution);\n\t\t\t}",
"solution = (numbers.pop() + numbers.pop())",
"solution",
"(numbers.pop() + numbers.pop())",
"numbers.pop()",
"numbers.pop",
"numbers",
"numbers.pop()",
"numbers.pop",
"numbers",
"numbers.push(solution)",
"numbers.push",
"numbers",
"solution",
"if(operator.equals(\"-\")) {\n\t\t\t\tint first = numbers.pop();\n\t\t\t\tint second = numbers.pop();\n\t\t\t\tsolution = ( second - first );\n\t\t\t\tnumbers.push(solution);\n\t\t\t}",
"operator.equals(\"-\")",
"operator.equals",
"operator",
"\"-\"",
"{\n\t\t\t\tint first = numbers.pop();\n\t\t\t\tint second = numbers.pop();\n\t\t\t\tsolution = ( second - first );\n\t\t\t\tnumbers.push(solution);\n\t\t\t}",
"int first = numbers.pop();",
"first",
"numbers.pop()",
"numbers.pop",
"numbers",
"int second = numbers.pop();",
"second",
"numbers.pop()",
"numbers.pop",
"numbers",
"solution = ( second - first )",
"solution",
"( second - first )",
"second",
"first",
"numbers.push(solution)",
"numbers.push",
"numbers",
"solution",
"{\n\t\t\tnumbers.push(Integer.parseInt(equation[i]));\n\t\t}",
"numbers.push(Integer.parseInt(equation[i]))",
"numbers.push",
"numbers",
"Integer.parseInt(equation[i])",
"Integer.parseInt",
"Integer",
"equation[i]",
"equation",
"i",
"System.out.println(solution)",
"System.out.println",
"System.out",
"System",
"System.out",
"solution",
"String[] args",
"args",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\tScanner input = new Scanner(System.in);\n\tString[] equation;\n\tequation = input.nextLine().split(\" \");\n\tStack<Integer> numbers = new Stack<Integer>();\n\tinput.close();\n\tint solution = 0;\n\tfor(int i = 0; i < equation.length; i++) {\n\t\tString operator;\n\t\t\n\t\tif(equation[i].equals(\"*\") || equation[i].equals(\"+\") || equation[i].equals(\"-\")) {\n\t\t\toperator = equation[i];\n\t\t\tif(operator.equals(\"*\")) {\n\t\t\t\tsolution = (numbers.pop() * numbers.pop());\n\t\t\t\tnumbers.push(solution);\n\t\t\t}\n\t\t\telse if(operator.equals(\"+\")) {\n\t\t\t\tsolution = (numbers.pop() + numbers.pop());\n\t\t\t\tnumbers.push(solution);\n\t\t\t}\n\t\t\telse if(operator.equals(\"-\")) {\n\t\t\t\tint first = numbers.pop();\n\t\t\t\tint second = numbers.pop();\n\t\t\t\tsolution = ( second - first );\n\t\t\t\tnumbers.push(solution);\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t}\n\t\telse {\n\t\t\tnumbers.push(Integer.parseInt(equation[i]));\n\t\t}\n\t\t\n\t\t\n\t}\n\tSystem.out.println(solution);\n\n\t\t\n\t}\n\t\n\t\n\n}",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\tScanner input = new Scanner(System.in);\n\tString[] equation;\n\tequation = input.nextLine().split(\" \");\n\tStack<Integer> numbers = new Stack<Integer>();\n\tinput.close();\n\tint solution = 0;\n\tfor(int i = 0; i < equation.length; i++) {\n\t\tString operator;\n\t\t\n\t\tif(equation[i].equals(\"*\") || equation[i].equals(\"+\") || equation[i].equals(\"-\")) {\n\t\t\toperator = equation[i];\n\t\t\tif(operator.equals(\"*\")) {\n\t\t\t\tsolution = (numbers.pop() * numbers.pop());\n\t\t\t\tnumbers.push(solution);\n\t\t\t}\n\t\t\telse if(operator.equals(\"+\")) {\n\t\t\t\tsolution = (numbers.pop() + numbers.pop());\n\t\t\t\tnumbers.push(solution);\n\t\t\t}\n\t\t\telse if(operator.equals(\"-\")) {\n\t\t\t\tint first = numbers.pop();\n\t\t\t\tint second = numbers.pop();\n\t\t\t\tsolution = ( second - first );\n\t\t\t\tnumbers.push(solution);\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t}\n\t\telse {\n\t\t\tnumbers.push(Integer.parseInt(equation[i]));\n\t\t}\n\t\t\n\t\t\n\t}\n\tSystem.out.println(solution);\n\n\t\t\n\t}\n\t\n\t\n\n}",
"Main"
] | import java.util.Scanner;
import java.util.Stack;
public class Main {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
String[] equation;
equation = input.nextLine().split(" ");
Stack<Integer> numbers = new Stack<Integer>();
input.close();
int solution = 0;
for(int i = 0; i < equation.length; i++) {
String operator;
if(equation[i].equals("*") || equation[i].equals("+") || equation[i].equals("-")) {
operator = equation[i];
if(operator.equals("*")) {
solution = (numbers.pop() * numbers.pop());
numbers.push(solution);
}
else if(operator.equals("+")) {
solution = (numbers.pop() + numbers.pop());
numbers.push(solution);
}
else if(operator.equals("-")) {
int first = numbers.pop();
int second = numbers.pop();
solution = ( second - first );
numbers.push(solution);
}
}
else {
numbers.push(Integer.parseInt(equation[i]));
}
}
System.out.println(solution);
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
41,
13,
17,
41,
13,
17,
41,
13,
20,
13,
12,
13,
30,
0,
18,
13,
40,
13,
13,
23,
13,
12,
13,
30,
29,
18,
13,
40,
13,
12,
13,
30,
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,
4,
13,
2,
4,
13,
4,
13,
14,
4,
18,
18,
13,
13,
17,
30,
4,
13,
40,
2,
4,
13,
4,
13,
14,
4,
18,
18,
13,
13,
17,
30,
4,
13,
2,
4,
13,
4,
13,
30,
4,
13,
4,
18,
13,
18,
13,
13,
4,
18,
18,
13,
13,
4,
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
],
[
7,
12
],
[
12,
13
],
[
12,
14
],
[
7,
15
],
[
15,
16
],
[
15,
17
],
[
7,
19
],
[
19,
20
],
[
19,
21
],
[
21,
22
],
[
22,
23
],
[
23,
24
],
[
23,
25
],
[
25,
26
],
[
22,
27
],
[
19,
28
],
[
28,
29
],
[
7,
30
],
[
30,
31
],
[
30,
32
],
[
32,
33
],
[
33,
34
],
[
34,
35
],
[
34,
36
],
[
36,
37
],
[
7,
38
],
[
38,
39
],
[
38,
40
],
[
40,
41
],
[
41,
42
],
[
41,
43
],
[
40,
44
],
[
44,
45
],
[
44,
46
],
[
46,
47
],
[
47,
48
],
[
48,
49
],
[
49,
50
],
[
46,
51
],
[
40,
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
],
[
78,
79
],
[
77,
80
],
[
80,
81
],
[
67,
82
],
[
82,
83
],
[
83,
84
],
[
84,
85
],
[
85,
86
],
[
85,
87
],
[
83,
88
],
[
82,
89
],
[
89,
90
],
[
90,
91
],
[
90,
92
],
[
92,
93
],
[
93,
94
],
[
94,
95
],
[
93,
96
],
[
96,
97
],
[
82,
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
],
[
108,
111
],
[
111,
112
],
[
98,
113
],
[
113,
114
],
[
114,
115
],
[
114,
116
],
[
116,
117
],
[
117,
118
],
[
116,
119
],
[
119,
120
],
[
119,
121
],
[
40,
122
],
[
122,
123
],
[
123,
124
],
[
124,
125
],
[
124,
126
],
[
122,
127
],
[
127,
128
],
[
38,
129
],
[
129,
130
]
] | [
"import java.util.*;\nimport java.lang.*;\nclass Main {\n static int stacksize = 200;\n static int stackpointer = 0;\n static int [] stack = new int[stacksize];\n//push\n static void push(int num){\n stack[stackpointer++] = num;\n }\n //pop\n static int pop(){\n return stack[--stackpointer];\n }\n //main\n public static void main(String args[]){\n Scanner sc = new Scanner(System.in);\n String [] s = sc.nextLine().split(\"\\\\s+\");\n for(int i = 0; i<s.length; i++){\n\n if(s[i].equals(\"+\")){\n push(pop()+pop());\n }else if(s[i].equals(\"-\")){\n push(-(pop()-pop()));\n }else if(s[i].equals(\"*\")){\n push(pop()*pop());\n }else{\n push(Integer.valueOf(s[i]));\n }\n }\n System.out.println(pop());\n }\n}",
"import java.util.*;",
"util.*",
"java",
"import java.lang.*;",
"lang.*",
"java",
"class Main {\n static int stacksize = 200;\n static int stackpointer = 0;\n static int [] stack = new int[stacksize];\n//push\n static void push(int num){\n stack[stackpointer++] = num;\n }\n //pop\n static int pop(){\n return stack[--stackpointer];\n }\n //main\n public static void main(String args[]){\n Scanner sc = new Scanner(System.in);\n String [] s = sc.nextLine().split(\"\\\\s+\");\n for(int i = 0; i<s.length; i++){\n\n if(s[i].equals(\"+\")){\n push(pop()+pop());\n }else if(s[i].equals(\"-\")){\n push(-(pop()-pop()));\n }else if(s[i].equals(\"*\")){\n push(pop()*pop());\n }else{\n push(Integer.valueOf(s[i]));\n }\n }\n System.out.println(pop());\n }\n}",
"Main",
"static int stacksize = 200;",
"stacksize",
"200",
"static int stackpointer = 0;",
"stackpointer",
"0",
"static int [] stack = new int[stacksize];",
"stack",
"new int[stacksize]",
"stacksize",
"//push\n static void push(int num){\n stack[stackpointer++] = num;\n }",
"push",
"{\n stack[stackpointer++] = num;\n }",
"stack[stackpointer++] = num",
"stack[stackpointer++]",
"stack",
"stackpointer++",
"stackpointer",
"num",
"int num",
"num",
"//pop\n static int pop(){\n return stack[--stackpointer];\n }",
"pop",
"{\n return stack[--stackpointer];\n }",
"return stack[--stackpointer];",
"stack[--stackpointer]",
"stack",
"--stackpointer",
"stackpointer",
"//main\n public static void main(String args[]){\n Scanner sc = new Scanner(System.in);\n String [] s = sc.nextLine().split(\"\\\\s+\");\n for(int i = 0; i<s.length; i++){\n\n if(s[i].equals(\"+\")){\n push(pop()+pop());\n }else if(s[i].equals(\"-\")){\n push(-(pop()-pop()));\n }else if(s[i].equals(\"*\")){\n push(pop()*pop());\n }else{\n push(Integer.valueOf(s[i]));\n }\n }\n System.out.println(pop());\n }",
"main",
"{\n Scanner sc = new Scanner(System.in);\n String [] s = sc.nextLine().split(\"\\\\s+\");\n for(int i = 0; i<s.length; i++){\n\n if(s[i].equals(\"+\")){\n push(pop()+pop());\n }else if(s[i].equals(\"-\")){\n push(-(pop()-pop()));\n }else if(s[i].equals(\"*\")){\n push(pop()*pop());\n }else{\n push(Integer.valueOf(s[i]));\n }\n }\n System.out.println(pop());\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"String [] s = sc.nextLine().split(\"\\\\s+\");",
"s",
"sc.nextLine().split(\"\\\\s+\")",
"sc.nextLine().split",
"sc.nextLine()",
"sc.nextLine",
"sc",
"\"\\\\s+\"",
"for(int i = 0; i<s.length; i++){\n\n if(s[i].equals(\"+\")){\n push(pop()+pop());\n }else if(s[i].equals(\"-\")){\n push(-(pop()-pop()));\n }else if(s[i].equals(\"*\")){\n push(pop()*pop());\n }else{\n push(Integer.valueOf(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\n if(s[i].equals(\"+\")){\n push(pop()+pop());\n }else if(s[i].equals(\"-\")){\n push(-(pop()-pop()));\n }else if(s[i].equals(\"*\")){\n push(pop()*pop());\n }else{\n push(Integer.valueOf(s[i]));\n }\n }",
"{\n\n if(s[i].equals(\"+\")){\n push(pop()+pop());\n }else if(s[i].equals(\"-\")){\n push(-(pop()-pop()));\n }else if(s[i].equals(\"*\")){\n push(pop()*pop());\n }else{\n push(Integer.valueOf(s[i]));\n }\n }",
"if(s[i].equals(\"+\")){\n push(pop()+pop());\n }else if(s[i].equals(\"-\")){\n push(-(pop()-pop()));\n }else if(s[i].equals(\"*\")){\n push(pop()*pop());\n }else{\n push(Integer.valueOf(s[i]));\n }",
"s[i].equals(\"+\")",
"s[i].equals",
"s[i]",
"s",
"i",
"\"+\"",
"{\n push(pop()+pop());\n }",
"push(pop()+pop())",
"push",
"pop()+pop()",
"pop()",
"pop",
"pop()",
"pop",
"if(s[i].equals(\"-\")){\n push(-(pop()-pop()));\n }else if(s[i].equals(\"*\")){\n push(pop()*pop());\n }else{\n push(Integer.valueOf(s[i]));\n }",
"s[i].equals(\"-\")",
"s[i].equals",
"s[i]",
"s",
"i",
"\"-\"",
"{\n push(-(pop()-pop()));\n }",
"push(-(pop()-pop()))",
"push",
"-(pop()-pop())",
"(pop()-pop())",
"pop()",
"pop",
"pop()",
"pop",
"if(s[i].equals(\"*\")){\n push(pop()*pop());\n }else{\n push(Integer.valueOf(s[i]));\n }",
"s[i].equals(\"*\")",
"s[i].equals",
"s[i]",
"s",
"i",
"\"*\"",
"{\n push(pop()*pop());\n }",
"push(pop()*pop())",
"push",
"pop()*pop()",
"pop()",
"pop",
"pop()",
"pop",
"{\n push(Integer.valueOf(s[i]));\n }",
"push(Integer.valueOf(s[i]))",
"push",
"Integer.valueOf(s[i])",
"Integer.valueOf",
"Integer",
"s[i]",
"s",
"i",
"System.out.println(pop())",
"System.out.println",
"System.out",
"System",
"System.out",
"pop()",
"pop",
"String args[]",
"args"
] | import java.util.*;
import java.lang.*;
class Main {
static int stacksize = 200;
static int stackpointer = 0;
static int [] stack = new int[stacksize];
//push
static void push(int num){
stack[stackpointer++] = num;
}
//pop
static int pop(){
return stack[--stackpointer];
}
//main
public static void main(String args[]){
Scanner sc = new Scanner(System.in);
String [] s = sc.nextLine().split("\\s+");
for(int i = 0; i<s.length; i++){
if(s[i].equals("+")){
push(pop()+pop());
}else if(s[i].equals("-")){
push(-(pop()-pop()));
}else if(s[i].equals("*")){
push(pop()*pop());
}else{
push(Integer.valueOf(s[i]));
}
}
System.out.println(pop());
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
41,
13,
17,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
4,
18,
13,
17,
41,
13,
20,
18,
13,
13,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
30,
41,
13,
18,
13,
13,
41,
13,
41,
13,
17,
35,
13,
34,
17,
1,
0,
13,
4,
13,
13,
0,
13,
4,
13,
13,
4,
13,
13,
2,
13,
13,
3,
34,
17,
1,
0,
13,
4,
13,
13,
0,
13,
4,
13,
13,
4,
13,
13,
2,
13,
13,
3,
34,
17,
1,
0,
13,
4,
13,
13,
0,
13,
4,
13,
13,
4,
13,
13,
2,
13,
13,
3,
34,
1,
4,
13,
13,
4,
18,
13,
13,
3,
4,
18,
18,
13,
13,
18,
13,
13,
23,
13,
12,
13,
30,
40,
13,
0,
18,
13,
13,
13,
23,
13,
23,
13,
12,
13,
30,
29,
18,
13,
40,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
164,
8
],
[
164,
9
],
[
9,
10
],
[
9,
11
],
[
164,
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
],
[
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
],
[
49,
50
],
[
49,
51
],
[
46,
52
],
[
52,
53
],
[
46,
54
],
[
54,
55
],
[
54,
56
],
[
46,
57
],
[
57,
58
],
[
57,
59
],
[
59,
60
],
[
59,
61
],
[
61,
62
],
[
62,
63
],
[
62,
64
],
[
64,
65
],
[
64,
66
],
[
61,
67
],
[
67,
68
],
[
67,
69
],
[
69,
70
],
[
69,
71
],
[
61,
72
],
[
72,
73
],
[
72,
74
],
[
72,
75
],
[
75,
76
],
[
75,
77
],
[
61,
78
],
[
57,
79
],
[
79,
80
],
[
79,
81
],
[
81,
82
],
[
82,
83
],
[
82,
84
],
[
84,
85
],
[
84,
86
],
[
81,
87
],
[
87,
88
],
[
87,
89
],
[
89,
90
],
[
89,
91
],
[
81,
92
],
[
92,
93
],
[
92,
94
],
[
92,
95
],
[
95,
96
],
[
95,
97
],
[
81,
98
],
[
57,
99
],
[
99,
100
],
[
99,
101
],
[
101,
102
],
[
102,
103
],
[
102,
104
],
[
104,
105
],
[
104,
106
],
[
101,
107
],
[
107,
108
],
[
107,
109
],
[
109,
110
],
[
109,
111
],
[
101,
112
],
[
112,
113
],
[
112,
114
],
[
112,
115
],
[
115,
116
],
[
115,
117
],
[
101,
118
],
[
57,
119
],
[
119,
120
],
[
120,
121
],
[
121,
122
],
[
121,
123
],
[
121,
124
],
[
124,
125
],
[
125,
126
],
[
124,
127
],
[
120,
128
],
[
14,
129
],
[
129,
130
],
[
130,
131
],
[
131,
132
],
[
131,
133
],
[
129,
134
],
[
134,
135
],
[
134,
136
],
[
12,
137
],
[
137,
138
],
[
164,
139
],
[
139,
140
],
[
139,
141
],
[
141,
142
],
[
142,
143
],
[
141,
144
],
[
144,
145
],
[
145,
146
],
[
145,
147
],
[
144,
148
],
[
139,
149
],
[
149,
150
],
[
139,
151
],
[
151,
152
],
[
164,
153
],
[
153,
154
],
[
153,
155
],
[
155,
156
],
[
156,
157
],
[
157,
158
],
[
157,
159
],
[
159,
160
],
[
153,
161
],
[
161,
162
],
[
0,
163
],
[
163,
164
],
[
163,
165
]
] | [
"import java.io.BufferedReader;\nimport java.io.InputStreamReader;\n\npublic class Main {\n\n\tstatic int top = 0;\n\n\tpublic static void main(String[] args) throws Exception {\n\t\tBufferedReader r = new BufferedReader(new InputStreamReader(System.in));\n\t\tString[] array = r.readLine().split(\" \");\n\t\tint[] stack = new int[array.length];\n\n\n\t\tfor(int i = 0; i < array.length; i++){\n\t\t\tString temps = array[i];\n\t\t\tint x,y = 0;\n\t\t\tswitch(temps){\n\t\t\t\tcase \"+\":\n\t\t\t\t\tx = pop(stack);\n\t\t\t\t\ty = pop(stack);\n\t\t\t\t\tpush(stack,y + x);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"-\":\n\t\t\t\t\tx = pop(stack);\n\t\t\t\t\ty = pop(stack);\n\t\t\t\t\tpush(stack,y - x);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"*\":\n\t\t\t\t\tx = pop(stack);\n\t\t\t\t\ty = pop(stack);\n\t\t\t\t\tpush(stack,y * x);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tpush(stack,Integer.parseInt(temps));\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(stack[top]);\n\t}\n\n\tpublic static void push(int[] stack,int num){\n\t\ttop++;\n\t\tstack[top] = num;\n\t}\n\n\tpublic static int pop(int[] stack){\n\t\treturn stack[top--];\n\t}\n\n\n}",
"import java.io.BufferedReader;",
"BufferedReader",
"java.io",
"import java.io.InputStreamReader;",
"InputStreamReader",
"java.io",
"public class Main {\n\n\tstatic int top = 0;\n\n\tpublic static void main(String[] args) throws Exception {\n\t\tBufferedReader r = new BufferedReader(new InputStreamReader(System.in));\n\t\tString[] array = r.readLine().split(\" \");\n\t\tint[] stack = new int[array.length];\n\n\n\t\tfor(int i = 0; i < array.length; i++){\n\t\t\tString temps = array[i];\n\t\t\tint x,y = 0;\n\t\t\tswitch(temps){\n\t\t\t\tcase \"+\":\n\t\t\t\t\tx = pop(stack);\n\t\t\t\t\ty = pop(stack);\n\t\t\t\t\tpush(stack,y + x);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"-\":\n\t\t\t\t\tx = pop(stack);\n\t\t\t\t\ty = pop(stack);\n\t\t\t\t\tpush(stack,y - x);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"*\":\n\t\t\t\t\tx = pop(stack);\n\t\t\t\t\ty = pop(stack);\n\t\t\t\t\tpush(stack,y * x);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tpush(stack,Integer.parseInt(temps));\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(stack[top]);\n\t}\n\n\tpublic static void push(int[] stack,int num){\n\t\ttop++;\n\t\tstack[top] = num;\n\t}\n\n\tpublic static int pop(int[] stack){\n\t\treturn stack[top--];\n\t}\n\n\n}",
"Main",
"static int top = 0;",
"top",
"0",
"public static void main(String[] args) throws Exception {\n\t\tBufferedReader r = new BufferedReader(new InputStreamReader(System.in));\n\t\tString[] array = r.readLine().split(\" \");\n\t\tint[] stack = new int[array.length];\n\n\n\t\tfor(int i = 0; i < array.length; i++){\n\t\t\tString temps = array[i];\n\t\t\tint x,y = 0;\n\t\t\tswitch(temps){\n\t\t\t\tcase \"+\":\n\t\t\t\t\tx = pop(stack);\n\t\t\t\t\ty = pop(stack);\n\t\t\t\t\tpush(stack,y + x);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"-\":\n\t\t\t\t\tx = pop(stack);\n\t\t\t\t\ty = pop(stack);\n\t\t\t\t\tpush(stack,y - x);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"*\":\n\t\t\t\t\tx = pop(stack);\n\t\t\t\t\ty = pop(stack);\n\t\t\t\t\tpush(stack,y * x);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tpush(stack,Integer.parseInt(temps));\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(stack[top]);\n\t}",
"main",
"{\n\t\tBufferedReader r = new BufferedReader(new InputStreamReader(System.in));\n\t\tString[] array = r.readLine().split(\" \");\n\t\tint[] stack = new int[array.length];\n\n\n\t\tfor(int i = 0; i < array.length; i++){\n\t\t\tString temps = array[i];\n\t\t\tint x,y = 0;\n\t\t\tswitch(temps){\n\t\t\t\tcase \"+\":\n\t\t\t\t\tx = pop(stack);\n\t\t\t\t\ty = pop(stack);\n\t\t\t\t\tpush(stack,y + x);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"-\":\n\t\t\t\t\tx = pop(stack);\n\t\t\t\t\ty = pop(stack);\n\t\t\t\t\tpush(stack,y - x);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"*\":\n\t\t\t\t\tx = pop(stack);\n\t\t\t\t\ty = pop(stack);\n\t\t\t\t\tpush(stack,y * x);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tpush(stack,Integer.parseInt(temps));\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(stack[top]);\n\t}",
"BufferedReader r = new BufferedReader(new InputStreamReader(System.in));",
"r",
"new BufferedReader(new InputStreamReader(System.in))",
"String[] array = r.readLine().split(\" \");",
"array",
"r.readLine().split(\" \")",
"r.readLine().split",
"r.readLine()",
"r.readLine",
"r",
"\" \"",
"int[] stack = new int[array.length];",
"stack",
"new int[array.length]",
"array.length",
"array",
"array.length",
"for(int i = 0; i < array.length; i++){\n\t\t\tString temps = array[i];\n\t\t\tint x,y = 0;\n\t\t\tswitch(temps){\n\t\t\t\tcase \"+\":\n\t\t\t\t\tx = pop(stack);\n\t\t\t\t\ty = pop(stack);\n\t\t\t\t\tpush(stack,y + x);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"-\":\n\t\t\t\t\tx = pop(stack);\n\t\t\t\t\ty = pop(stack);\n\t\t\t\t\tpush(stack,y - x);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"*\":\n\t\t\t\t\tx = pop(stack);\n\t\t\t\t\ty = pop(stack);\n\t\t\t\t\tpush(stack,y * x);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tpush(stack,Integer.parseInt(temps));\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < array.length",
"i",
"array.length",
"array",
"array.length",
"i++",
"i++",
"i",
"{\n\t\t\tString temps = array[i];\n\t\t\tint x,y = 0;\n\t\t\tswitch(temps){\n\t\t\t\tcase \"+\":\n\t\t\t\t\tx = pop(stack);\n\t\t\t\t\ty = pop(stack);\n\t\t\t\t\tpush(stack,y + x);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"-\":\n\t\t\t\t\tx = pop(stack);\n\t\t\t\t\ty = pop(stack);\n\t\t\t\t\tpush(stack,y - x);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"*\":\n\t\t\t\t\tx = pop(stack);\n\t\t\t\t\ty = pop(stack);\n\t\t\t\t\tpush(stack,y * x);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tpush(stack,Integer.parseInt(temps));\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}",
"{\n\t\t\tString temps = array[i];\n\t\t\tint x,y = 0;\n\t\t\tswitch(temps){\n\t\t\t\tcase \"+\":\n\t\t\t\t\tx = pop(stack);\n\t\t\t\t\ty = pop(stack);\n\t\t\t\t\tpush(stack,y + x);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"-\":\n\t\t\t\t\tx = pop(stack);\n\t\t\t\t\ty = pop(stack);\n\t\t\t\t\tpush(stack,y - x);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"*\":\n\t\t\t\t\tx = pop(stack);\n\t\t\t\t\ty = pop(stack);\n\t\t\t\t\tpush(stack,y * x);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tpush(stack,Integer.parseInt(temps));\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}",
"String temps = array[i];",
"temps",
"array[i]",
"array",
"i",
"int x",
"x",
"y = 0;",
"y",
"0",
"switch(temps){\n\t\t\t\tcase \"+\":\n\t\t\t\t\tx = pop(stack);\n\t\t\t\t\ty = pop(stack);\n\t\t\t\t\tpush(stack,y + x);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"-\":\n\t\t\t\t\tx = pop(stack);\n\t\t\t\t\ty = pop(stack);\n\t\t\t\t\tpush(stack,y - x);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"*\":\n\t\t\t\t\tx = pop(stack);\n\t\t\t\t\ty = pop(stack);\n\t\t\t\t\tpush(stack,y * x);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tpush(stack,Integer.parseInt(temps));\n\t\t\t\t\tbreak;\n\t\t\t}",
"temps",
"case \"+\":",
"\"+\"",
"case \"+\":",
"x = pop(stack)",
"x",
"pop(stack)",
"pop",
"stack",
"y = pop(stack)",
"y",
"pop(stack)",
"pop",
"stack",
"push(stack,y + x)",
"push",
"stack",
"y + x",
"y",
"x",
"break;",
"case \"-\":",
"\"-\"",
"case \"-\":",
"x = pop(stack)",
"x",
"pop(stack)",
"pop",
"stack",
"y = pop(stack)",
"y",
"pop(stack)",
"pop",
"stack",
"push(stack,y - x)",
"push",
"stack",
"y - x",
"y",
"x",
"break;",
"case \"*\":",
"\"*\"",
"case \"*\":",
"x = pop(stack)",
"x",
"pop(stack)",
"pop",
"stack",
"y = pop(stack)",
"y",
"pop(stack)",
"pop",
"stack",
"push(stack,y * x)",
"push",
"stack",
"y * x",
"y",
"x",
"break;",
"default:",
"default:",
"push(stack,Integer.parseInt(temps))",
"push",
"stack",
"Integer.parseInt(temps)",
"Integer.parseInt",
"Integer",
"temps",
"break;",
"System.out.println(stack[top])",
"System.out.println",
"System.out",
"System",
"System.out",
"stack[top]",
"stack",
"top",
"String[] args",
"args",
"public static void push(int[] stack,int num){\n\t\ttop++;\n\t\tstack[top] = num;\n\t}",
"push",
"{\n\t\ttop++;\n\t\tstack[top] = num;\n\t}",
"top++",
"top",
"stack[top] = num",
"stack[top]",
"stack",
"top",
"num",
"int[] stack",
"stack",
"int num",
"num",
"public static int pop(int[] stack){\n\t\treturn stack[top--];\n\t}",
"pop",
"{\n\t\treturn stack[top--];\n\t}",
"return stack[top--];",
"stack[top--]",
"stack",
"top--",
"top",
"int[] stack",
"stack",
"public class Main {\n\n\tstatic int top = 0;\n\n\tpublic static void main(String[] args) throws Exception {\n\t\tBufferedReader r = new BufferedReader(new InputStreamReader(System.in));\n\t\tString[] array = r.readLine().split(\" \");\n\t\tint[] stack = new int[array.length];\n\n\n\t\tfor(int i = 0; i < array.length; i++){\n\t\t\tString temps = array[i];\n\t\t\tint x,y = 0;\n\t\t\tswitch(temps){\n\t\t\t\tcase \"+\":\n\t\t\t\t\tx = pop(stack);\n\t\t\t\t\ty = pop(stack);\n\t\t\t\t\tpush(stack,y + x);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"-\":\n\t\t\t\t\tx = pop(stack);\n\t\t\t\t\ty = pop(stack);\n\t\t\t\t\tpush(stack,y - x);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"*\":\n\t\t\t\t\tx = pop(stack);\n\t\t\t\t\ty = pop(stack);\n\t\t\t\t\tpush(stack,y * x);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tpush(stack,Integer.parseInt(temps));\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(stack[top]);\n\t}\n\n\tpublic static void push(int[] stack,int num){\n\t\ttop++;\n\t\tstack[top] = num;\n\t}\n\n\tpublic static int pop(int[] stack){\n\t\treturn stack[top--];\n\t}\n\n\n}",
"public class Main {\n\n\tstatic int top = 0;\n\n\tpublic static void main(String[] args) throws Exception {\n\t\tBufferedReader r = new BufferedReader(new InputStreamReader(System.in));\n\t\tString[] array = r.readLine().split(\" \");\n\t\tint[] stack = new int[array.length];\n\n\n\t\tfor(int i = 0; i < array.length; i++){\n\t\t\tString temps = array[i];\n\t\t\tint x,y = 0;\n\t\t\tswitch(temps){\n\t\t\t\tcase \"+\":\n\t\t\t\t\tx = pop(stack);\n\t\t\t\t\ty = pop(stack);\n\t\t\t\t\tpush(stack,y + x);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"-\":\n\t\t\t\t\tx = pop(stack);\n\t\t\t\t\ty = pop(stack);\n\t\t\t\t\tpush(stack,y - x);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"*\":\n\t\t\t\t\tx = pop(stack);\n\t\t\t\t\ty = pop(stack);\n\t\t\t\t\tpush(stack,y * x);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tpush(stack,Integer.parseInt(temps));\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(stack[top]);\n\t}\n\n\tpublic static void push(int[] stack,int num){\n\t\ttop++;\n\t\tstack[top] = num;\n\t}\n\n\tpublic static int pop(int[] stack){\n\t\treturn stack[top--];\n\t}\n\n\n}",
"Main"
] | import java.io.BufferedReader;
import java.io.InputStreamReader;
public class Main {
static int top = 0;
public static void main(String[] args) throws Exception {
BufferedReader r = new BufferedReader(new InputStreamReader(System.in));
String[] array = r.readLine().split(" ");
int[] stack = new int[array.length];
for(int i = 0; i < array.length; i++){
String temps = array[i];
int x,y = 0;
switch(temps){
case "+":
x = pop(stack);
y = pop(stack);
push(stack,y + x);
break;
case "-":
x = pop(stack);
y = pop(stack);
push(stack,y - x);
break;
case "*":
x = pop(stack);
y = pop(stack);
push(stack,y * x);
break;
default:
push(stack,Integer.parseInt(temps));
break;
}
}
System.out.println(stack[top]);
}
public static void push(int[] stack,int num){
top++;
stack[top] = num;
}
public static int pop(int[] stack){
return stack[top--];
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
4,
18,
20,
23,
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,
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,
4,
18,
13,
4,
18,
13,
18,
13,
13,
4,
18,
18,
13,
13,
4,
18,
13,
4,
18,
13,
6,
13,
41,
13,
41,
13,
17,
12,
13,
30,
0,
13,
20,
17,
0,
13,
17,
12,
13,
30,
0,
18,
13,
40,
13,
13,
23,
13,
12,
13,
30,
29,
18,
13,
40,
13,
12,
13,
30,
29,
2,
13,
17,
12,
13,
30,
29,
2,
13,
18,
13,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
195,
5
],
[
195,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
10,
11
],
[
6,
12
],
[
12,
13
],
[
195,
14
],
[
14,
15
],
[
14,
16
],
[
16,
17
],
[
17,
18
],
[
17,
19
],
[
16,
20
],
[
20,
21
],
[
20,
22
],
[
22,
23
],
[
23,
24
],
[
16,
25
],
[
25,
26
],
[
25,
27
],
[
27,
28
],
[
28,
29
],
[
27,
30
],
[
16,
31
],
[
31,
32
],
[
31,
33
],
[
16,
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
],
[
50,
51
],
[
51,
52
],
[
52,
53
],
[
52,
54
],
[
50,
55
],
[
49,
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
],
[
49,
73
],
[
73,
74
],
[
74,
75
],
[
75,
76
],
[
76,
77
],
[
76,
78
],
[
74,
79
],
[
73,
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
],
[
73,
97
],
[
97,
98
],
[
98,
99
],
[
99,
100
],
[
100,
101
],
[
100,
102
],
[
98,
103
],
[
97,
104
],
[
104,
105
],
[
105,
106
],
[
105,
107
],
[
107,
108
],
[
108,
109
],
[
104,
110
],
[
110,
111
],
[
110,
112
],
[
112,
113
],
[
113,
114
],
[
104,
115
],
[
115,
116
],
[
116,
117
],
[
115,
118
],
[
118,
119
],
[
118,
120
],
[
97,
121
],
[
121,
122
],
[
122,
123
],
[
123,
124
],
[
122,
125
],
[
125,
126
],
[
126,
127
],
[
125,
128
],
[
128,
129
],
[
128,
130
],
[
16,
131
],
[
131,
132
],
[
132,
133
],
[
133,
134
],
[
133,
135
],
[
131,
136
],
[
136,
137
],
[
137,
138
],
[
16,
139
],
[
139,
140
],
[
140,
141
],
[
0,
142
],
[
142,
143
],
[
142,
144
],
[
144,
145
],
[
142,
146
],
[
146,
147
],
[
146,
148
],
[
142,
149
],
[
149,
150
],
[
149,
151
],
[
151,
152
],
[
152,
153
],
[
152,
154
],
[
151,
156
],
[
156,
157
],
[
156,
158
],
[
142,
159
],
[
159,
160
],
[
159,
161
],
[
161,
162
],
[
162,
163
],
[
163,
164
],
[
163,
165
],
[
165,
166
],
[
162,
167
],
[
159,
168
],
[
168,
169
],
[
142,
170
],
[
170,
171
],
[
170,
172
],
[
172,
173
],
[
173,
174
],
[
174,
175
],
[
174,
176
],
[
176,
177
],
[
142,
178
],
[
178,
179
],
[
178,
180
],
[
180,
181
],
[
181,
182
],
[
182,
183
],
[
182,
184
],
[
142,
185
],
[
185,
186
],
[
185,
187
],
[
187,
188
],
[
188,
189
],
[
189,
190
],
[
189,
191
],
[
191,
192
],
[
191,
193
],
[
0,
194
],
[
194,
195
],
[
194,
196
]
] | [
"\n\nimport java.util.Scanner;\n\npublic class Main{\n\tpublic static void main(String[] args) {\n\t\t// TODO ?????????????????????????????????????????????\n\t\tnew Main().start();\n\t}\n\tvoid start(){\n\t\tScanner in = new Scanner(System.in);\n\t\tString s = in.nextLine();\n\t\tString[] ss = s.split(\" \");\n\t\tStack stack = new Stack();\n\t\tfor(int i = 0; i < ss.length; i++){\n\t\t\tif(ss[i].equals(\"+\")){\n\t\t\t\tint a = stack.pop();\n\t\t\t\tint b = stack.pop();\n\t\t\t\tstack.push(a + b);\n\t\t\t}else if(ss[i].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(ss[i].equals(\"*\")){\n\t\t\t\tint a = stack.pop();\n\t\t\t\tint b = stack.pop();\n\t\t\t\tstack.push(a * b);\n\t\t\t}else{\n\t\t\t\tstack.push(Integer.parseInt(ss[i]));\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(stack.pop());\n\t\tin.close();\n\t}\n}\n\nclass Stack {\n\tint[] data;\n\tint top = 0;\n\tStack(){\n\t\tdata = new int[101];\n\t\ttop = 0;\n\t}\n\tvoid push(int x){\n\t\tdata[top++] = x;\n\t}\n\tint pop(){\n\t\treturn data[--top];\n\t}\n\tboolean isEmpty(){\n\t\treturn top == 0;\n\t}\n\tboolean isFull(){\n\t\treturn top == data.length;\n\t}\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main{\n\tpublic static void main(String[] args) {\n\t\t// TODO ?????????????????????????????????????????????\n\t\tnew Main().start();\n\t}\n\tvoid start(){\n\t\tScanner in = new Scanner(System.in);\n\t\tString s = in.nextLine();\n\t\tString[] ss = s.split(\" \");\n\t\tStack stack = new Stack();\n\t\tfor(int i = 0; i < ss.length; i++){\n\t\t\tif(ss[i].equals(\"+\")){\n\t\t\t\tint a = stack.pop();\n\t\t\t\tint b = stack.pop();\n\t\t\t\tstack.push(a + b);\n\t\t\t}else if(ss[i].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(ss[i].equals(\"*\")){\n\t\t\t\tint a = stack.pop();\n\t\t\t\tint b = stack.pop();\n\t\t\t\tstack.push(a * b);\n\t\t\t}else{\n\t\t\t\tstack.push(Integer.parseInt(ss[i]));\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(stack.pop());\n\t\tin.close();\n\t}\n}",
"Main",
"public static void main(String[] args) {\n\t\t// TODO ?????????????????????????????????????????????\n\t\tnew Main().start();\n\t}",
"main",
"{\n\t\t// TODO ?????????????????????????????????????????????\n\t\tnew Main().start();\n\t}",
"new Main().start()",
"new Main().start",
"new Main()",
"String[] args",
"args",
"void start(){\n\t\tScanner in = new Scanner(System.in);\n\t\tString s = in.nextLine();\n\t\tString[] ss = s.split(\" \");\n\t\tStack stack = new Stack();\n\t\tfor(int i = 0; i < ss.length; i++){\n\t\t\tif(ss[i].equals(\"+\")){\n\t\t\t\tint a = stack.pop();\n\t\t\t\tint b = stack.pop();\n\t\t\t\tstack.push(a + b);\n\t\t\t}else if(ss[i].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(ss[i].equals(\"*\")){\n\t\t\t\tint a = stack.pop();\n\t\t\t\tint b = stack.pop();\n\t\t\t\tstack.push(a * b);\n\t\t\t}else{\n\t\t\t\tstack.push(Integer.parseInt(ss[i]));\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(stack.pop());\n\t\tin.close();\n\t}",
"start",
"{\n\t\tScanner in = new Scanner(System.in);\n\t\tString s = in.nextLine();\n\t\tString[] ss = s.split(\" \");\n\t\tStack stack = new Stack();\n\t\tfor(int i = 0; i < ss.length; i++){\n\t\t\tif(ss[i].equals(\"+\")){\n\t\t\t\tint a = stack.pop();\n\t\t\t\tint b = stack.pop();\n\t\t\t\tstack.push(a + b);\n\t\t\t}else if(ss[i].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(ss[i].equals(\"*\")){\n\t\t\t\tint a = stack.pop();\n\t\t\t\tint b = stack.pop();\n\t\t\t\tstack.push(a * b);\n\t\t\t}else{\n\t\t\t\tstack.push(Integer.parseInt(ss[i]));\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(stack.pop());\n\t\tin.close();\n\t}",
"Scanner in = new Scanner(System.in);",
"in",
"new Scanner(System.in)",
"String s = in.nextLine();",
"s",
"in.nextLine()",
"in.nextLine",
"in",
"String[] ss = s.split(\" \");",
"ss",
"s.split(\" \")",
"s.split",
"s",
"\" \"",
"Stack stack = new Stack();",
"stack",
"new Stack()",
"for(int i = 0; i < ss.length; i++){\n\t\t\tif(ss[i].equals(\"+\")){\n\t\t\t\tint a = stack.pop();\n\t\t\t\tint b = stack.pop();\n\t\t\t\tstack.push(a + b);\n\t\t\t}else if(ss[i].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(ss[i].equals(\"*\")){\n\t\t\t\tint a = stack.pop();\n\t\t\t\tint b = stack.pop();\n\t\t\t\tstack.push(a * b);\n\t\t\t}else{\n\t\t\t\tstack.push(Integer.parseInt(ss[i]));\n\t\t\t}\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < ss.length",
"i",
"ss.length",
"ss",
"ss.length",
"i++",
"i++",
"i",
"{\n\t\t\tif(ss[i].equals(\"+\")){\n\t\t\t\tint a = stack.pop();\n\t\t\t\tint b = stack.pop();\n\t\t\t\tstack.push(a + b);\n\t\t\t}else if(ss[i].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(ss[i].equals(\"*\")){\n\t\t\t\tint a = stack.pop();\n\t\t\t\tint b = stack.pop();\n\t\t\t\tstack.push(a * b);\n\t\t\t}else{\n\t\t\t\tstack.push(Integer.parseInt(ss[i]));\n\t\t\t}\n\t\t}",
"{\n\t\t\tif(ss[i].equals(\"+\")){\n\t\t\t\tint a = stack.pop();\n\t\t\t\tint b = stack.pop();\n\t\t\t\tstack.push(a + b);\n\t\t\t}else if(ss[i].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(ss[i].equals(\"*\")){\n\t\t\t\tint a = stack.pop();\n\t\t\t\tint b = stack.pop();\n\t\t\t\tstack.push(a * b);\n\t\t\t}else{\n\t\t\t\tstack.push(Integer.parseInt(ss[i]));\n\t\t\t}\n\t\t}",
"if(ss[i].equals(\"+\")){\n\t\t\t\tint a = stack.pop();\n\t\t\t\tint b = stack.pop();\n\t\t\t\tstack.push(a + b);\n\t\t\t}else if(ss[i].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(ss[i].equals(\"*\")){\n\t\t\t\tint a = stack.pop();\n\t\t\t\tint b = stack.pop();\n\t\t\t\tstack.push(a * b);\n\t\t\t}else{\n\t\t\t\tstack.push(Integer.parseInt(ss[i]));\n\t\t\t}",
"ss[i].equals(\"+\")",
"ss[i].equals",
"ss[i]",
"ss",
"i",
"\"+\"",
"{\n\t\t\t\tint a = stack.pop();\n\t\t\t\tint b = stack.pop();\n\t\t\t\tstack.push(a + b);\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(a + b)",
"stack.push",
"stack",
"a + b",
"a",
"b",
"if(ss[i].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(ss[i].equals(\"*\")){\n\t\t\t\tint a = stack.pop();\n\t\t\t\tint b = stack.pop();\n\t\t\t\tstack.push(a * b);\n\t\t\t}else{\n\t\t\t\tstack.push(Integer.parseInt(ss[i]));\n\t\t\t}",
"ss[i].equals(\"-\")",
"ss[i].equals",
"ss[i]",
"ss",
"i",
"\"-\"",
"{\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(ss[i].equals(\"*\")){\n\t\t\t\tint a = stack.pop();\n\t\t\t\tint b = stack.pop();\n\t\t\t\tstack.push(a * b);\n\t\t\t}else{\n\t\t\t\tstack.push(Integer.parseInt(ss[i]));\n\t\t\t}",
"ss[i].equals(\"*\")",
"ss[i].equals",
"ss[i]",
"ss",
"i",
"\"*\"",
"{\n\t\t\t\tint a = stack.pop();\n\t\t\t\tint b = stack.pop();\n\t\t\t\tstack.push(a * b);\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(a * b)",
"stack.push",
"stack",
"a * b",
"a",
"b",
"{\n\t\t\t\tstack.push(Integer.parseInt(ss[i]));\n\t\t\t}",
"stack.push(Integer.parseInt(ss[i]))",
"stack.push",
"stack",
"Integer.parseInt(ss[i])",
"Integer.parseInt",
"Integer",
"ss[i]",
"ss",
"i",
"System.out.println(stack.pop())",
"System.out.println",
"System.out",
"System",
"System.out",
"stack.pop()",
"stack.pop",
"stack",
"in.close()",
"in.close",
"in",
"class Stack {\n\tint[] data;\n\tint top = 0;\n\tStack(){\n\t\tdata = new int[101];\n\t\ttop = 0;\n\t}\n\tvoid push(int x){\n\t\tdata[top++] = x;\n\t}\n\tint pop(){\n\t\treturn data[--top];\n\t}\n\tboolean isEmpty(){\n\t\treturn top == 0;\n\t}\n\tboolean isFull(){\n\t\treturn top == data.length;\n\t}\n}",
"Stack",
"int[] data;",
"data",
"int top = 0;",
"top",
"0",
"Stack(){\n\t\tdata = new int[101];\n\t\ttop = 0;\n\t}",
"Stack",
"{\n\t\tdata = new int[101];\n\t\ttop = 0;\n\t}",
"data = new int[101]",
"data",
"new int[101]",
"101",
"top = 0",
"top",
"0",
"void push(int x){\n\t\tdata[top++] = x;\n\t}",
"push",
"{\n\t\tdata[top++] = x;\n\t}",
"data[top++] = x",
"data[top++]",
"data",
"top++",
"top",
"x",
"int x",
"x",
"int pop(){\n\t\treturn data[--top];\n\t}",
"pop",
"{\n\t\treturn data[--top];\n\t}",
"return data[--top];",
"data[--top]",
"data",
"--top",
"top",
"boolean isEmpty(){\n\t\treturn top == 0;\n\t}",
"isEmpty",
"{\n\t\treturn top == 0;\n\t}",
"return top == 0;",
"top == 0",
"top",
"0",
"boolean isFull(){\n\t\treturn top == data.length;\n\t}",
"isFull",
"{\n\t\treturn top == data.length;\n\t}",
"return top == data.length;",
"top == data.length",
"top",
"data.length",
"data",
"data.length",
"public class Main{\n\tpublic static void main(String[] args) {\n\t\t// TODO ?????????????????????????????????????????????\n\t\tnew Main().start();\n\t}\n\tvoid start(){\n\t\tScanner in = new Scanner(System.in);\n\t\tString s = in.nextLine();\n\t\tString[] ss = s.split(\" \");\n\t\tStack stack = new Stack();\n\t\tfor(int i = 0; i < ss.length; i++){\n\t\t\tif(ss[i].equals(\"+\")){\n\t\t\t\tint a = stack.pop();\n\t\t\t\tint b = stack.pop();\n\t\t\t\tstack.push(a + b);\n\t\t\t}else if(ss[i].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(ss[i].equals(\"*\")){\n\t\t\t\tint a = stack.pop();\n\t\t\t\tint b = stack.pop();\n\t\t\t\tstack.push(a * b);\n\t\t\t}else{\n\t\t\t\tstack.push(Integer.parseInt(ss[i]));\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(stack.pop());\n\t\tin.close();\n\t}\n}",
"public class Main{\n\tpublic static void main(String[] args) {\n\t\t// TODO ?????????????????????????????????????????????\n\t\tnew Main().start();\n\t}\n\tvoid start(){\n\t\tScanner in = new Scanner(System.in);\n\t\tString s = in.nextLine();\n\t\tString[] ss = s.split(\" \");\n\t\tStack stack = new Stack();\n\t\tfor(int i = 0; i < ss.length; i++){\n\t\t\tif(ss[i].equals(\"+\")){\n\t\t\t\tint a = stack.pop();\n\t\t\t\tint b = stack.pop();\n\t\t\t\tstack.push(a + b);\n\t\t\t}else if(ss[i].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(ss[i].equals(\"*\")){\n\t\t\t\tint a = stack.pop();\n\t\t\t\tint b = stack.pop();\n\t\t\t\tstack.push(a * b);\n\t\t\t}else{\n\t\t\t\tstack.push(Integer.parseInt(ss[i]));\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(stack.pop());\n\t\tin.close();\n\t}\n}",
"Main"
] |
import java.util.Scanner;
public class Main{
public static void main(String[] args) {
// TODO ?????????????????????????????????????????????
new Main().start();
}
void start(){
Scanner in = new Scanner(System.in);
String s = in.nextLine();
String[] ss = s.split(" ");
Stack stack = new Stack();
for(int i = 0; i < ss.length; i++){
if(ss[i].equals("+")){
int a = stack.pop();
int b = stack.pop();
stack.push(a + b);
}else if(ss[i].equals("-")){
int a = stack.pop();
int b = stack.pop();
stack.push(b - a);
}else if(ss[i].equals("*")){
int a = stack.pop();
int b = stack.pop();
stack.push(a * b);
}else{
stack.push(Integer.parseInt(ss[i]));
}
}
System.out.println(stack.pop());
in.close();
}
}
class Stack {
int[] data;
int top = 0;
Stack(){
data = new int[101];
top = 0;
}
void push(int x){
data[top++] = x;
}
int pop(){
return data[--top];
}
boolean isEmpty(){
return top == 0;
}
boolean isFull(){
return top == data.length;
}
} |
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
20,
41,
13,
41,
13,
38,
5,
13,
30,
4,
18,
13,
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,
14,
2,
2,
40,
4,
18,
18,
13,
13,
17,
40,
4,
18,
18,
13,
13,
17,
40,
4,
18,
18,
13,
13,
17,
30,
4,
18,
13,
4,
18,
13,
18,
13,
13,
9,
0,
13,
4,
18,
13,
4,
18,
13,
0,
13,
4,
18,
13,
4,
18,
13,
14,
4,
18,
18,
13,
13,
17,
30,
4,
18,
13,
2,
13,
13,
14,
4,
18,
18,
13,
13,
17,
30,
4,
18,
13,
2,
13,
13,
14,
4,
18,
18,
13,
13,
17,
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
],
[
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
],
[
14,
21
],
[
21,
22
],
[
14,
23
],
[
23,
24
],
[
14,
25
],
[
25,
26
],
[
26,
27
],
[
26,
28
],
[
28,
29
],
[
29,
30
],
[
30,
31
],
[
25,
32
],
[
32,
33
],
[
32,
34
],
[
34,
35
],
[
35,
36
],
[
36,
37
],
[
25,
38
],
[
38,
39
],
[
39,
40
],
[
39,
41
],
[
41,
42
],
[
42,
43
],
[
43,
44
],
[
44,
45
],
[
41,
46
],
[
38,
47
],
[
47,
48
],
[
48,
49
],
[
49,
50
],
[
49,
51
],
[
47,
52
],
[
52,
53
],
[
52,
54
],
[
54,
55
],
[
54,
56
],
[
47,
57
],
[
57,
58
],
[
58,
59
],
[
47,
60
],
[
61,
61
],
[
61,
62
],
[
62,
63
],
[
64,
64
],
[
64,
65
],
[
65,
66
],
[
66,
67
],
[
67,
68
],
[
68,
69
],
[
68,
70
],
[
66,
71
],
[
64,
72
],
[
72,
73
],
[
73,
74
],
[
74,
75
],
[
75,
76
],
[
75,
77
],
[
73,
78
],
[
64,
79
],
[
79,
80
],
[
80,
81
],
[
81,
82
],
[
82,
83
],
[
82,
84
],
[
80,
85
],
[
62,
86
],
[
86,
87
],
[
87,
88
],
[
88,
89
],
[
87,
90
],
[
90,
91
],
[
91,
92
],
[
90,
93
],
[
93,
94
],
[
93,
95
],
[
86,
96
],
[
61,
97
],
[
97,
98
],
[
97,
99
],
[
99,
100
],
[
100,
101
],
[
61,
102
],
[
102,
103
],
[
103,
104
],
[
61,
105
],
[
105,
106
],
[
105,
107
],
[
107,
108
],
[
108,
109
],
[
61,
110
],
[
110,
111
],
[
111,
112
],
[
61,
113
],
[
113,
114
],
[
114,
115
],
[
115,
116
],
[
116,
117
],
[
116,
118
],
[
114,
119
],
[
113,
120
],
[
120,
121
],
[
121,
122
],
[
122,
123
],
[
121,
124
],
[
124,
125
],
[
124,
126
],
[
113,
127
],
[
127,
128
],
[
128,
129
],
[
129,
130
],
[
130,
131
],
[
130,
132
],
[
128,
133
],
[
127,
134
],
[
134,
135
],
[
135,
136
],
[
136,
137
],
[
135,
138
],
[
138,
139
],
[
138,
140
],
[
127,
141
],
[
141,
142
],
[
142,
143
],
[
143,
144
],
[
144,
145
],
[
144,
146
],
[
142,
147
],
[
141,
148
],
[
148,
149
],
[
149,
150
],
[
150,
151
],
[
149,
152
],
[
152,
153
],
[
152,
154
],
[
38,
155
],
[
155,
156
],
[
156,
157
],
[
157,
158
],
[
157,
159
],
[
155,
160
],
[
160,
161
],
[
161,
162
],
[
12,
163
],
[
163,
164
],
[
0,
165
],
[
165,
166
],
[
165,
167
]
] | [
"import java.util.Stack;\nimport java.io.*;\nimport java.util.regex.*;\n\npublic class Main {\n\n public static void main(String[] args) {\n\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n Stack<Integer> S = new Stack<Integer>();\n int a, b;\n\n\n try{\n String input[] = br.readLine().split(\"\\\\s+\");\n\n for(int i = 0; i < input.length; i++){\n if(!input[i].equals(\"+\") && !input[i].equals(\"-\") && !input[i].equals(\"*\")) {\n S.push(Integer.parseInt(input[i])); //intに変換\n continue;\n }\n\n b = S.peek();\n S.pop();\n a = S.peek();\n S.pop();\n\n if(input[i].equals(\"+\")) {\n S.push(a+b);\n } else if(input[i].equals(\"-\")) {\n S.push(a-b);\n } else if(input[i].equals(\"*\")) {\n S.push(a*b);\n }\n }\n System.out.println(S.peek());\n\n } catch (IOException e) {\n e.printStackTrace();\n } catch (NumberFormatException e) {\n e.printStackTrace();\n }\n }\n\n}\n",
"import java.util.Stack;",
"Stack",
"java.util",
"import java.io.*;",
"io.*",
"java",
"import java.util.regex.*;",
"regex.*",
"java.util",
"public class Main {\n\n public static void main(String[] args) {\n\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n Stack<Integer> S = new Stack<Integer>();\n int a, b;\n\n\n try{\n String input[] = br.readLine().split(\"\\\\s+\");\n\n for(int i = 0; i < input.length; i++){\n if(!input[i].equals(\"+\") && !input[i].equals(\"-\") && !input[i].equals(\"*\")) {\n S.push(Integer.parseInt(input[i])); //intに変換\n continue;\n }\n\n b = S.peek();\n S.pop();\n a = S.peek();\n S.pop();\n\n if(input[i].equals(\"+\")) {\n S.push(a+b);\n } else if(input[i].equals(\"-\")) {\n S.push(a-b);\n } else if(input[i].equals(\"*\")) {\n S.push(a*b);\n }\n }\n System.out.println(S.peek());\n\n } catch (IOException e) {\n e.printStackTrace();\n } catch (NumberFormatException e) {\n e.printStackTrace();\n }\n }\n\n}",
"Main",
"public static void main(String[] args) {\n\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n Stack<Integer> S = new Stack<Integer>();\n int a, b;\n\n\n try{\n String input[] = br.readLine().split(\"\\\\s+\");\n\n for(int i = 0; i < input.length; i++){\n if(!input[i].equals(\"+\") && !input[i].equals(\"-\") && !input[i].equals(\"*\")) {\n S.push(Integer.parseInt(input[i])); //intに変換\n continue;\n }\n\n b = S.peek();\n S.pop();\n a = S.peek();\n S.pop();\n\n if(input[i].equals(\"+\")) {\n S.push(a+b);\n } else if(input[i].equals(\"-\")) {\n S.push(a-b);\n } else if(input[i].equals(\"*\")) {\n S.push(a*b);\n }\n }\n System.out.println(S.peek());\n\n } catch (IOException e) {\n e.printStackTrace();\n } catch (NumberFormatException e) {\n e.printStackTrace();\n }\n }",
"main",
"{\n\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n Stack<Integer> S = new Stack<Integer>();\n int a, b;\n\n\n try{\n String input[] = br.readLine().split(\"\\\\s+\");\n\n for(int i = 0; i < input.length; i++){\n if(!input[i].equals(\"+\") && !input[i].equals(\"-\") && !input[i].equals(\"*\")) {\n S.push(Integer.parseInt(input[i])); //intに変換\n continue;\n }\n\n b = S.peek();\n S.pop();\n a = S.peek();\n S.pop();\n\n if(input[i].equals(\"+\")) {\n S.push(a+b);\n } else if(input[i].equals(\"-\")) {\n S.push(a-b);\n } else if(input[i].equals(\"*\")) {\n S.push(a*b);\n }\n }\n System.out.println(S.peek());\n\n } catch (IOException e) {\n e.printStackTrace();\n } catch (NumberFormatException e) {\n e.printStackTrace();\n }\n }",
"BufferedReader br = new BufferedReader(new InputStreamReader(System.in));",
"br",
"new BufferedReader(new InputStreamReader(System.in))",
"Stack<Integer> S = new Stack<Integer>();",
"S",
"new Stack<Integer>()",
"int a",
"a",
"b;",
"b",
"try{\n String input[] = br.readLine().split(\"\\\\s+\");\n\n for(int i = 0; i < input.length; i++){\n if(!input[i].equals(\"+\") && !input[i].equals(\"-\") && !input[i].equals(\"*\")) {\n S.push(Integer.parseInt(input[i])); //intに変換\n continue;\n }\n\n b = S.peek();\n S.pop();\n a = S.peek();\n S.pop();\n\n if(input[i].equals(\"+\")) {\n S.push(a+b);\n } else if(input[i].equals(\"-\")) {\n S.push(a-b);\n } else if(input[i].equals(\"*\")) {\n S.push(a*b);\n }\n }\n System.out.println(S.peek());\n\n } catch (IOException e) {\n e.printStackTrace();\n } catch (NumberFormatException e) {\n e.printStackTrace();\n }",
"catch (IOException e) {\n e.printStackTrace();\n }",
"IOException e",
"{\n e.printStackTrace();\n }",
"e.printStackTrace()",
"e.printStackTrace",
"e",
"catch (NumberFormatException e) {\n e.printStackTrace();\n }",
"NumberFormatException e",
"{\n e.printStackTrace();\n }",
"e.printStackTrace()",
"e.printStackTrace",
"e",
"{\n String input[] = br.readLine().split(\"\\\\s+\");\n\n for(int i = 0; i < input.length; i++){\n if(!input[i].equals(\"+\") && !input[i].equals(\"-\") && !input[i].equals(\"*\")) {\n S.push(Integer.parseInt(input[i])); //intに変換\n continue;\n }\n\n b = S.peek();\n S.pop();\n a = S.peek();\n S.pop();\n\n if(input[i].equals(\"+\")) {\n S.push(a+b);\n } else if(input[i].equals(\"-\")) {\n S.push(a-b);\n } else if(input[i].equals(\"*\")) {\n S.push(a*b);\n }\n }\n System.out.println(S.peek());\n\n }",
"String input[] = br.readLine().split(\"\\\\s+\");",
"input",
"br.readLine().split(\"\\\\s+\")",
"br.readLine().split",
"br.readLine()",
"br.readLine",
"br",
"\"\\\\s+\"",
"for(int i = 0; i < input.length; i++){\n if(!input[i].equals(\"+\") && !input[i].equals(\"-\") && !input[i].equals(\"*\")) {\n S.push(Integer.parseInt(input[i])); //intに変換\n continue;\n }\n\n b = S.peek();\n S.pop();\n a = S.peek();\n S.pop();\n\n if(input[i].equals(\"+\")) {\n S.push(a+b);\n } else if(input[i].equals(\"-\")) {\n S.push(a-b);\n } else if(input[i].equals(\"*\")) {\n S.push(a*b);\n }\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < input.length",
"i",
"input.length",
"input",
"input.length",
"i++",
"i++",
"i",
"{\n if(!input[i].equals(\"+\") && !input[i].equals(\"-\") && !input[i].equals(\"*\")) {\n S.push(Integer.parseInt(input[i])); //intに変換\n continue;\n }\n\n b = S.peek();\n S.pop();\n a = S.peek();\n S.pop();\n\n if(input[i].equals(\"+\")) {\n S.push(a+b);\n } else if(input[i].equals(\"-\")) {\n S.push(a-b);\n } else if(input[i].equals(\"*\")) {\n S.push(a*b);\n }\n }",
"{\n if(!input[i].equals(\"+\") && !input[i].equals(\"-\") && !input[i].equals(\"*\")) {\n S.push(Integer.parseInt(input[i])); //intに変換\n continue;\n }\n\n b = S.peek();\n S.pop();\n a = S.peek();\n S.pop();\n\n if(input[i].equals(\"+\")) {\n S.push(a+b);\n } else if(input[i].equals(\"-\")) {\n S.push(a-b);\n } else if(input[i].equals(\"*\")) {\n S.push(a*b);\n }\n }",
"if(!input[i].equals(\"+\") && !input[i].equals(\"-\") && !input[i].equals(\"*\")) {\n S.push(Integer.parseInt(input[i])); //intに変換\n continue;\n }",
"!input[i].equals(\"+\") && !input[i].equals(\"-\") && !input[i].equals(\"*\")",
"!input[i].equals(\"+\") && !input[i].equals(\"-\") && !input[i].equals(\"*\")",
"!input[i].equals(\"+\")",
"input[i].equals(\"+\")",
"input[i].equals",
"input[i]",
"input",
"i",
"\"+\"",
"!input[i].equals(\"-\")",
"input[i].equals(\"-\")",
"input[i].equals",
"input[i]",
"input",
"i",
"\"-\"",
"!input[i].equals(\"*\")",
"input[i].equals(\"*\")",
"input[i].equals",
"input[i]",
"input",
"i",
"\"*\"",
"{\n S.push(Integer.parseInt(input[i])); //intに変換\n continue;\n }",
"S.push(Integer.parseInt(input[i]))",
"S.push",
"S",
"Integer.parseInt(input[i])",
"Integer.parseInt",
"Integer",
"input[i]",
"input",
"i",
"continue;",
"b = S.peek()",
"b",
"S.peek()",
"S.peek",
"S",
"S.pop()",
"S.pop",
"S",
"a = S.peek()",
"a",
"S.peek()",
"S.peek",
"S",
"S.pop()",
"S.pop",
"S",
"if(input[i].equals(\"+\")) {\n S.push(a+b);\n } else if(input[i].equals(\"-\")) {\n S.push(a-b);\n } else if(input[i].equals(\"*\")) {\n S.push(a*b);\n }",
"input[i].equals(\"+\")",
"input[i].equals",
"input[i]",
"input",
"i",
"\"+\"",
"{\n S.push(a+b);\n }",
"S.push(a+b)",
"S.push",
"S",
"a+b",
"a",
"b",
"if(input[i].equals(\"-\")) {\n S.push(a-b);\n } else if(input[i].equals(\"*\")) {\n S.push(a*b);\n }",
"input[i].equals(\"-\")",
"input[i].equals",
"input[i]",
"input",
"i",
"\"-\"",
"{\n S.push(a-b);\n }",
"S.push(a-b)",
"S.push",
"S",
"a-b",
"a",
"b",
"if(input[i].equals(\"*\")) {\n S.push(a*b);\n }",
"input[i].equals(\"*\")",
"input[i].equals",
"input[i]",
"input",
"i",
"\"*\"",
"{\n S.push(a*b);\n }",
"S.push(a*b)",
"S.push",
"S",
"a*b",
"a",
"b",
"System.out.println(S.peek())",
"System.out.println",
"System.out",
"System",
"System.out",
"S.peek()",
"S.peek",
"S",
"String[] args",
"args",
"public class Main {\n\n public static void main(String[] args) {\n\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n Stack<Integer> S = new Stack<Integer>();\n int a, b;\n\n\n try{\n String input[] = br.readLine().split(\"\\\\s+\");\n\n for(int i = 0; i < input.length; i++){\n if(!input[i].equals(\"+\") && !input[i].equals(\"-\") && !input[i].equals(\"*\")) {\n S.push(Integer.parseInt(input[i])); //intに変換\n continue;\n }\n\n b = S.peek();\n S.pop();\n a = S.peek();\n S.pop();\n\n if(input[i].equals(\"+\")) {\n S.push(a+b);\n } else if(input[i].equals(\"-\")) {\n S.push(a-b);\n } else if(input[i].equals(\"*\")) {\n S.push(a*b);\n }\n }\n System.out.println(S.peek());\n\n } catch (IOException e) {\n e.printStackTrace();\n } catch (NumberFormatException e) {\n e.printStackTrace();\n }\n }\n\n}",
"public class Main {\n\n public static void main(String[] args) {\n\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n Stack<Integer> S = new Stack<Integer>();\n int a, b;\n\n\n try{\n String input[] = br.readLine().split(\"\\\\s+\");\n\n for(int i = 0; i < input.length; i++){\n if(!input[i].equals(\"+\") && !input[i].equals(\"-\") && !input[i].equals(\"*\")) {\n S.push(Integer.parseInt(input[i])); //intに変換\n continue;\n }\n\n b = S.peek();\n S.pop();\n a = S.peek();\n S.pop();\n\n if(input[i].equals(\"+\")) {\n S.push(a+b);\n } else if(input[i].equals(\"-\")) {\n S.push(a-b);\n } else if(input[i].equals(\"*\")) {\n S.push(a*b);\n }\n }\n System.out.println(S.peek());\n\n } catch (IOException e) {\n e.printStackTrace();\n } catch (NumberFormatException e) {\n e.printStackTrace();\n }\n }\n\n}",
"Main"
] | import java.util.Stack;
import java.io.*;
import java.util.regex.*;
public class Main {
public static void main(String[] args) {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
Stack<Integer> S = new Stack<Integer>();
int a, b;
try{
String input[] = br.readLine().split("\\s+");
for(int i = 0; i < input.length; i++){
if(!input[i].equals("+") && !input[i].equals("-") && !input[i].equals("*")) {
S.push(Integer.parseInt(input[i])); //intに変換
continue;
}
b = S.peek();
S.pop();
a = S.peek();
S.pop();
if(input[i].equals("+")) {
S.push(a+b);
} else if(input[i].equals("-")) {
S.push(a-b);
} else if(input[i].equals("*")) {
S.push(a*b);
}
}
System.out.println(S.peek());
} catch (IOException e) {
e.printStackTrace();
} catch (NumberFormatException e) {
e.printStackTrace();
}
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
17,
41,
13,
20,
11,
1,
41,
13,
17,
2,
13,
4,
18,
13,
1,
40,
13,
30,
30,
14,
40,
4,
18,
13,
4,
18,
13,
13,
30,
4,
18,
13,
4,
18,
13,
13,
30,
41,
13,
4,
18,
13,
4,
18,
13,
41,
13,
4,
18,
13,
4,
18,
13,
41,
13,
4,
18,
13,
4,
18,
13,
13,
14,
2,
13,
17,
30,
4,
18,
13,
4,
18,
13,
2,
13,
13,
14,
2,
13,
17,
30,
4,
18,
13,
4,
18,
13,
2,
13,
13,
14,
2,
13,
17,
30,
4,
18,
13,
4,
18,
13,
2,
13,
13,
14,
2,
13,
17,
30,
4,
18,
13,
4,
18,
13,
2,
13,
13,
29,
4,
18,
13,
4,
18,
13,
23,
13,
12,
13,
30,
41,
13,
20,
41,
13,
20,
42,
4,
18,
13,
30,
4,
18,
13,
4,
18,
4,
18,
13,
4,
18,
18,
13,
13,
4,
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
],
[
180,
11
],
[
180,
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
],
[
26,
28
],
[
28,
29
],
[
29,
30
],
[
21,
31
],
[
31,
32
],
[
32,
33
],
[
21,
34
],
[
35,
35
],
[
35,
36
],
[
36,
37
],
[
37,
38
],
[
38,
39
],
[
39,
40
],
[
38,
41
],
[
41,
42
],
[
42,
43
],
[
41,
44
],
[
36,
45
],
[
45,
46
],
[
46,
47
],
[
47,
48
],
[
46,
49
],
[
49,
50
],
[
50,
51
],
[
49,
52
],
[
36,
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
],
[
53,
70
],
[
70,
71
],
[
70,
72
],
[
72,
73
],
[
73,
74
],
[
72,
75
],
[
75,
76
],
[
76,
77
],
[
75,
78
],
[
53,
79
],
[
79,
80
],
[
80,
81
],
[
80,
82
],
[
79,
83
],
[
83,
84
],
[
84,
85
],
[
85,
86
],
[
84,
87
],
[
87,
88
],
[
88,
89
],
[
87,
90
],
[
90,
91
],
[
90,
92
],
[
79,
93
],
[
93,
94
],
[
94,
95
],
[
94,
96
],
[
93,
97
],
[
97,
98
],
[
98,
99
],
[
99,
100
],
[
98,
101
],
[
101,
102
],
[
102,
103
],
[
101,
104
],
[
104,
105
],
[
104,
106
],
[
93,
107
],
[
107,
108
],
[
108,
109
],
[
108,
110
],
[
107,
111
],
[
111,
112
],
[
112,
113
],
[
113,
114
],
[
112,
115
],
[
115,
116
],
[
116,
117
],
[
115,
118
],
[
118,
119
],
[
118,
120
],
[
107,
121
],
[
121,
122
],
[
122,
123
],
[
122,
124
],
[
121,
125
],
[
125,
126
],
[
126,
127
],
[
127,
128
],
[
126,
129
],
[
129,
130
],
[
130,
131
],
[
129,
132
],
[
132,
133
],
[
132,
134
],
[
14,
135
],
[
135,
136
],
[
136,
137
],
[
137,
138
],
[
136,
139
],
[
139,
140
],
[
140,
141
],
[
12,
142
],
[
142,
143
],
[
180,
144
],
[
144,
145
],
[
144,
146
],
[
146,
147
],
[
147,
148
],
[
147,
149
],
[
146,
150
],
[
150,
151
],
[
150,
152
],
[
146,
153
],
[
153,
154
],
[
154,
155
],
[
155,
156
],
[
153,
157
],
[
157,
158
],
[
158,
159
],
[
159,
160
],
[
158,
161
],
[
161,
162
],
[
162,
163
],
[
163,
164
],
[
164,
165
],
[
146,
166
],
[
166,
167
],
[
167,
168
],
[
168,
169
],
[
168,
170
],
[
166,
171
],
[
171,
172
],
[
171,
173
],
[
146,
174
],
[
174,
175
],
[
175,
176
],
[
144,
177
],
[
177,
178
],
[
0,
179
],
[
179,
180
],
[
179,
181
]
] | [
"import java.util.ArrayList;\nimport java.util.Scanner;\nimport java.util.Stack;\n\npublic class Main {\n\n\tpublic static int Oper(ArrayList<String> in) {\n\t\tString operators = \"+-*/\";\n\t\tStack<String> stack = new Stack<String>();\n\t\tfor (int i = 0; i < in.size(); i++) {\n\t\t\tif (!operators.contains(in.get(i))) {\n\t\t\t\tstack.push(in.get(i));\n\t\t\t} else {\n\t\t\t\tint y = Integer.parseInt(stack.pop());\n\t\t\t\tint x= Integer.parseInt(stack.pop());\n\t\t\t\tint action = operators.indexOf(in.get(i));\n\t\t\t\tif (action == 0) {\n\t\t\t\t\tstack.push(String.valueOf(x+y));\n\t\t\t\t} else if (action == 1) {\n\t\t\t\t\tstack.push(String.valueOf(x-y));\n\t\t\t\t} else if (action == 2) {\n\t\t\t\t\tstack.push(String.valueOf(x*y));\n\t\t\t\t} else if (action == 3) {\n\t\t\t\t\tstack.push(String.valueOf(x/y));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn Integer.parseInt(stack.pop());\n\t\t\n\t\n\t}\n\tpublic static void main(String[] args) {\n\t\tScanner scan= new Scanner(System.in);\n\t\tArrayList<String> ARRRAY = new ArrayList<>();\n\t\twhile (scan.hasNext()) {\n\t\t\tARRRAY.add(scan.next().trim());\n\t\t}\n\t\t\n\t\tSystem.out.println(Oper(ARRRAY));\n\t\tscan.close();\n\t}\n\n}",
"import java.util.ArrayList;",
"ArrayList",
"java.util",
"import java.util.Scanner;",
"Scanner",
"java.util",
"import java.util.Stack;",
"Stack",
"java.util",
"public class Main {\n\n\tpublic static int Oper(ArrayList<String> in) {\n\t\tString operators = \"+-*/\";\n\t\tStack<String> stack = new Stack<String>();\n\t\tfor (int i = 0; i < in.size(); i++) {\n\t\t\tif (!operators.contains(in.get(i))) {\n\t\t\t\tstack.push(in.get(i));\n\t\t\t} else {\n\t\t\t\tint y = Integer.parseInt(stack.pop());\n\t\t\t\tint x= Integer.parseInt(stack.pop());\n\t\t\t\tint action = operators.indexOf(in.get(i));\n\t\t\t\tif (action == 0) {\n\t\t\t\t\tstack.push(String.valueOf(x+y));\n\t\t\t\t} else if (action == 1) {\n\t\t\t\t\tstack.push(String.valueOf(x-y));\n\t\t\t\t} else if (action == 2) {\n\t\t\t\t\tstack.push(String.valueOf(x*y));\n\t\t\t\t} else if (action == 3) {\n\t\t\t\t\tstack.push(String.valueOf(x/y));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn Integer.parseInt(stack.pop());\n\t\t\n\t\n\t}\n\tpublic static void main(String[] args) {\n\t\tScanner scan= new Scanner(System.in);\n\t\tArrayList<String> ARRRAY = new ArrayList<>();\n\t\twhile (scan.hasNext()) {\n\t\t\tARRRAY.add(scan.next().trim());\n\t\t}\n\t\t\n\t\tSystem.out.println(Oper(ARRRAY));\n\t\tscan.close();\n\t}\n\n}",
"Main",
"public static int Oper(ArrayList<String> in) {\n\t\tString operators = \"+-*/\";\n\t\tStack<String> stack = new Stack<String>();\n\t\tfor (int i = 0; i < in.size(); i++) {\n\t\t\tif (!operators.contains(in.get(i))) {\n\t\t\t\tstack.push(in.get(i));\n\t\t\t} else {\n\t\t\t\tint y = Integer.parseInt(stack.pop());\n\t\t\t\tint x= Integer.parseInt(stack.pop());\n\t\t\t\tint action = operators.indexOf(in.get(i));\n\t\t\t\tif (action == 0) {\n\t\t\t\t\tstack.push(String.valueOf(x+y));\n\t\t\t\t} else if (action == 1) {\n\t\t\t\t\tstack.push(String.valueOf(x-y));\n\t\t\t\t} else if (action == 2) {\n\t\t\t\t\tstack.push(String.valueOf(x*y));\n\t\t\t\t} else if (action == 3) {\n\t\t\t\t\tstack.push(String.valueOf(x/y));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn Integer.parseInt(stack.pop());\n\t\t\n\t\n\t}",
"Oper",
"{\n\t\tString operators = \"+-*/\";\n\t\tStack<String> stack = new Stack<String>();\n\t\tfor (int i = 0; i < in.size(); i++) {\n\t\t\tif (!operators.contains(in.get(i))) {\n\t\t\t\tstack.push(in.get(i));\n\t\t\t} else {\n\t\t\t\tint y = Integer.parseInt(stack.pop());\n\t\t\t\tint x= Integer.parseInt(stack.pop());\n\t\t\t\tint action = operators.indexOf(in.get(i));\n\t\t\t\tif (action == 0) {\n\t\t\t\t\tstack.push(String.valueOf(x+y));\n\t\t\t\t} else if (action == 1) {\n\t\t\t\t\tstack.push(String.valueOf(x-y));\n\t\t\t\t} else if (action == 2) {\n\t\t\t\t\tstack.push(String.valueOf(x*y));\n\t\t\t\t} else if (action == 3) {\n\t\t\t\t\tstack.push(String.valueOf(x/y));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn Integer.parseInt(stack.pop());\n\t\t\n\t\n\t}",
"String operators = \"+-*/\";",
"operators",
"\"+-*/\"",
"Stack<String> stack = new Stack<String>();",
"stack",
"new Stack<String>()",
"for (int i = 0; i < in.size(); i++) {\n\t\t\tif (!operators.contains(in.get(i))) {\n\t\t\t\tstack.push(in.get(i));\n\t\t\t} else {\n\t\t\t\tint y = Integer.parseInt(stack.pop());\n\t\t\t\tint x= Integer.parseInt(stack.pop());\n\t\t\t\tint action = operators.indexOf(in.get(i));\n\t\t\t\tif (action == 0) {\n\t\t\t\t\tstack.push(String.valueOf(x+y));\n\t\t\t\t} else if (action == 1) {\n\t\t\t\t\tstack.push(String.valueOf(x-y));\n\t\t\t\t} else if (action == 2) {\n\t\t\t\t\tstack.push(String.valueOf(x*y));\n\t\t\t\t} else if (action == 3) {\n\t\t\t\t\tstack.push(String.valueOf(x/y));\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < in.size()",
"i",
"in.size()",
"in.size",
"in",
"i++",
"i++",
"i",
"{\n\t\t\tif (!operators.contains(in.get(i))) {\n\t\t\t\tstack.push(in.get(i));\n\t\t\t} else {\n\t\t\t\tint y = Integer.parseInt(stack.pop());\n\t\t\t\tint x= Integer.parseInt(stack.pop());\n\t\t\t\tint action = operators.indexOf(in.get(i));\n\t\t\t\tif (action == 0) {\n\t\t\t\t\tstack.push(String.valueOf(x+y));\n\t\t\t\t} else if (action == 1) {\n\t\t\t\t\tstack.push(String.valueOf(x-y));\n\t\t\t\t} else if (action == 2) {\n\t\t\t\t\tstack.push(String.valueOf(x*y));\n\t\t\t\t} else if (action == 3) {\n\t\t\t\t\tstack.push(String.valueOf(x/y));\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"{\n\t\t\tif (!operators.contains(in.get(i))) {\n\t\t\t\tstack.push(in.get(i));\n\t\t\t} else {\n\t\t\t\tint y = Integer.parseInt(stack.pop());\n\t\t\t\tint x= Integer.parseInt(stack.pop());\n\t\t\t\tint action = operators.indexOf(in.get(i));\n\t\t\t\tif (action == 0) {\n\t\t\t\t\tstack.push(String.valueOf(x+y));\n\t\t\t\t} else if (action == 1) {\n\t\t\t\t\tstack.push(String.valueOf(x-y));\n\t\t\t\t} else if (action == 2) {\n\t\t\t\t\tstack.push(String.valueOf(x*y));\n\t\t\t\t} else if (action == 3) {\n\t\t\t\t\tstack.push(String.valueOf(x/y));\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"if (!operators.contains(in.get(i))) {\n\t\t\t\tstack.push(in.get(i));\n\t\t\t} else {\n\t\t\t\tint y = Integer.parseInt(stack.pop());\n\t\t\t\tint x= Integer.parseInt(stack.pop());\n\t\t\t\tint action = operators.indexOf(in.get(i));\n\t\t\t\tif (action == 0) {\n\t\t\t\t\tstack.push(String.valueOf(x+y));\n\t\t\t\t} else if (action == 1) {\n\t\t\t\t\tstack.push(String.valueOf(x-y));\n\t\t\t\t} else if (action == 2) {\n\t\t\t\t\tstack.push(String.valueOf(x*y));\n\t\t\t\t} else if (action == 3) {\n\t\t\t\t\tstack.push(String.valueOf(x/y));\n\t\t\t\t}\n\t\t\t}",
"!operators.contains(in.get(i))",
"operators.contains(in.get(i))",
"operators.contains",
"operators",
"in.get(i)",
"in.get",
"in",
"i",
"{\n\t\t\t\tstack.push(in.get(i));\n\t\t\t}",
"stack.push(in.get(i))",
"stack.push",
"stack",
"in.get(i)",
"in.get",
"in",
"i",
"{\n\t\t\t\tint y = Integer.parseInt(stack.pop());\n\t\t\t\tint x= Integer.parseInt(stack.pop());\n\t\t\t\tint action = operators.indexOf(in.get(i));\n\t\t\t\tif (action == 0) {\n\t\t\t\t\tstack.push(String.valueOf(x+y));\n\t\t\t\t} else if (action == 1) {\n\t\t\t\t\tstack.push(String.valueOf(x-y));\n\t\t\t\t} else if (action == 2) {\n\t\t\t\t\tstack.push(String.valueOf(x*y));\n\t\t\t\t} else if (action == 3) {\n\t\t\t\t\tstack.push(String.valueOf(x/y));\n\t\t\t\t}\n\t\t\t}",
"int y = Integer.parseInt(stack.pop());",
"y",
"Integer.parseInt(stack.pop())",
"Integer.parseInt",
"Integer",
"stack.pop()",
"stack.pop",
"stack",
"int x= Integer.parseInt(stack.pop());",
"x",
"Integer.parseInt(stack.pop())",
"Integer.parseInt",
"Integer",
"stack.pop()",
"stack.pop",
"stack",
"int action = operators.indexOf(in.get(i));",
"action",
"operators.indexOf(in.get(i))",
"operators.indexOf",
"operators",
"in.get(i)",
"in.get",
"in",
"i",
"if (action == 0) {\n\t\t\t\t\tstack.push(String.valueOf(x+y));\n\t\t\t\t} else if (action == 1) {\n\t\t\t\t\tstack.push(String.valueOf(x-y));\n\t\t\t\t} else if (action == 2) {\n\t\t\t\t\tstack.push(String.valueOf(x*y));\n\t\t\t\t} else if (action == 3) {\n\t\t\t\t\tstack.push(String.valueOf(x/y));\n\t\t\t\t}",
"action == 0",
"action",
"0",
"{\n\t\t\t\t\tstack.push(String.valueOf(x+y));\n\t\t\t\t}",
"stack.push(String.valueOf(x+y))",
"stack.push",
"stack",
"String.valueOf(x+y)",
"String.valueOf",
"String",
"x+y",
"x",
"y",
"if (action == 1) {\n\t\t\t\t\tstack.push(String.valueOf(x-y));\n\t\t\t\t} else if (action == 2) {\n\t\t\t\t\tstack.push(String.valueOf(x*y));\n\t\t\t\t} else if (action == 3) {\n\t\t\t\t\tstack.push(String.valueOf(x/y));\n\t\t\t\t}",
"action == 1",
"action",
"1",
"{\n\t\t\t\t\tstack.push(String.valueOf(x-y));\n\t\t\t\t}",
"stack.push(String.valueOf(x-y))",
"stack.push",
"stack",
"String.valueOf(x-y)",
"String.valueOf",
"String",
"x-y",
"x",
"y",
"if (action == 2) {\n\t\t\t\t\tstack.push(String.valueOf(x*y));\n\t\t\t\t} else if (action == 3) {\n\t\t\t\t\tstack.push(String.valueOf(x/y));\n\t\t\t\t}",
"action == 2",
"action",
"2",
"{\n\t\t\t\t\tstack.push(String.valueOf(x*y));\n\t\t\t\t}",
"stack.push(String.valueOf(x*y))",
"stack.push",
"stack",
"String.valueOf(x*y)",
"String.valueOf",
"String",
"x*y",
"x",
"y",
"if (action == 3) {\n\t\t\t\t\tstack.push(String.valueOf(x/y));\n\t\t\t\t}",
"action == 3",
"action",
"3",
"{\n\t\t\t\t\tstack.push(String.valueOf(x/y));\n\t\t\t\t}",
"stack.push(String.valueOf(x/y))",
"stack.push",
"stack",
"String.valueOf(x/y)",
"String.valueOf",
"String",
"x/y",
"x",
"y",
"return Integer.parseInt(stack.pop());",
"Integer.parseInt(stack.pop())",
"Integer.parseInt",
"Integer",
"stack.pop()",
"stack.pop",
"stack",
"ArrayList<String> in",
"in",
"public static void main(String[] args) {\n\t\tScanner scan= new Scanner(System.in);\n\t\tArrayList<String> ARRRAY = new ArrayList<>();\n\t\twhile (scan.hasNext()) {\n\t\t\tARRRAY.add(scan.next().trim());\n\t\t}\n\t\t\n\t\tSystem.out.println(Oper(ARRRAY));\n\t\tscan.close();\n\t}",
"main",
"{\n\t\tScanner scan= new Scanner(System.in);\n\t\tArrayList<String> ARRRAY = new ArrayList<>();\n\t\twhile (scan.hasNext()) {\n\t\t\tARRRAY.add(scan.next().trim());\n\t\t}\n\t\t\n\t\tSystem.out.println(Oper(ARRRAY));\n\t\tscan.close();\n\t}",
"Scanner scan= new Scanner(System.in);",
"scan",
"new Scanner(System.in)",
"ArrayList<String> ARRRAY = new ArrayList<>();",
"ARRRAY",
"new ArrayList<>()",
"while (scan.hasNext()) {\n\t\t\tARRRAY.add(scan.next().trim());\n\t\t}",
"scan.hasNext()",
"scan.hasNext",
"scan",
"{\n\t\t\tARRRAY.add(scan.next().trim());\n\t\t}",
"ARRRAY.add(scan.next().trim())",
"ARRRAY.add",
"ARRRAY",
"scan.next().trim()",
"scan.next().trim",
"scan.next()",
"scan.next",
"scan",
"System.out.println(Oper(ARRRAY))",
"System.out.println",
"System.out",
"System",
"System.out",
"Oper(ARRRAY)",
"Oper",
"ARRRAY",
"scan.close()",
"scan.close",
"scan",
"String[] args",
"args",
"public class Main {\n\n\tpublic static int Oper(ArrayList<String> in) {\n\t\tString operators = \"+-*/\";\n\t\tStack<String> stack = new Stack<String>();\n\t\tfor (int i = 0; i < in.size(); i++) {\n\t\t\tif (!operators.contains(in.get(i))) {\n\t\t\t\tstack.push(in.get(i));\n\t\t\t} else {\n\t\t\t\tint y = Integer.parseInt(stack.pop());\n\t\t\t\tint x= Integer.parseInt(stack.pop());\n\t\t\t\tint action = operators.indexOf(in.get(i));\n\t\t\t\tif (action == 0) {\n\t\t\t\t\tstack.push(String.valueOf(x+y));\n\t\t\t\t} else if (action == 1) {\n\t\t\t\t\tstack.push(String.valueOf(x-y));\n\t\t\t\t} else if (action == 2) {\n\t\t\t\t\tstack.push(String.valueOf(x*y));\n\t\t\t\t} else if (action == 3) {\n\t\t\t\t\tstack.push(String.valueOf(x/y));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn Integer.parseInt(stack.pop());\n\t\t\n\t\n\t}\n\tpublic static void main(String[] args) {\n\t\tScanner scan= new Scanner(System.in);\n\t\tArrayList<String> ARRRAY = new ArrayList<>();\n\t\twhile (scan.hasNext()) {\n\t\t\tARRRAY.add(scan.next().trim());\n\t\t}\n\t\t\n\t\tSystem.out.println(Oper(ARRRAY));\n\t\tscan.close();\n\t}\n\n}",
"public class Main {\n\n\tpublic static int Oper(ArrayList<String> in) {\n\t\tString operators = \"+-*/\";\n\t\tStack<String> stack = new Stack<String>();\n\t\tfor (int i = 0; i < in.size(); i++) {\n\t\t\tif (!operators.contains(in.get(i))) {\n\t\t\t\tstack.push(in.get(i));\n\t\t\t} else {\n\t\t\t\tint y = Integer.parseInt(stack.pop());\n\t\t\t\tint x= Integer.parseInt(stack.pop());\n\t\t\t\tint action = operators.indexOf(in.get(i));\n\t\t\t\tif (action == 0) {\n\t\t\t\t\tstack.push(String.valueOf(x+y));\n\t\t\t\t} else if (action == 1) {\n\t\t\t\t\tstack.push(String.valueOf(x-y));\n\t\t\t\t} else if (action == 2) {\n\t\t\t\t\tstack.push(String.valueOf(x*y));\n\t\t\t\t} else if (action == 3) {\n\t\t\t\t\tstack.push(String.valueOf(x/y));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn Integer.parseInt(stack.pop());\n\t\t\n\t\n\t}\n\tpublic static void main(String[] args) {\n\t\tScanner scan= new Scanner(System.in);\n\t\tArrayList<String> ARRRAY = new ArrayList<>();\n\t\twhile (scan.hasNext()) {\n\t\t\tARRRAY.add(scan.next().trim());\n\t\t}\n\t\t\n\t\tSystem.out.println(Oper(ARRRAY));\n\t\tscan.close();\n\t}\n\n}",
"Main"
] | import java.util.ArrayList;
import java.util.Scanner;
import java.util.Stack;
public class Main {
public static int Oper(ArrayList<String> in) {
String operators = "+-*/";
Stack<String> stack = new Stack<String>();
for (int i = 0; i < in.size(); i++) {
if (!operators.contains(in.get(i))) {
stack.push(in.get(i));
} else {
int y = Integer.parseInt(stack.pop());
int x= Integer.parseInt(stack.pop());
int action = operators.indexOf(in.get(i));
if (action == 0) {
stack.push(String.valueOf(x+y));
} else if (action == 1) {
stack.push(String.valueOf(x-y));
} else if (action == 2) {
stack.push(String.valueOf(x*y));
} else if (action == 3) {
stack.push(String.valueOf(x/y));
}
}
}
return Integer.parseInt(stack.pop());
}
public static void main(String[] args) {
Scanner scan= new Scanner(System.in);
ArrayList<String> ARRRAY = new ArrayList<>();
while (scan.hasNext()) {
ARRRAY.add(scan.next().trim());
}
System.out.println(Oper(ARRRAY));
scan.close();
}
}
|
[
7,
15,
13,
17,
6,
13,
41,
13,
12,
13,
30,
0,
13,
4,
18,
13,
13,
23,
13,
12,
13,
30,
4,
18,
18,
13,
13,
13,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
17,
41,
13,
17,
41,
13,
20,
17,
42,
4,
18,
13,
30,
0,
13,
4,
18,
13,
14,
4,
18,
13,
17,
30,
0,
18,
18,
13,
2,
13,
17,
13,
2,
18,
18,
13,
2,
13,
17,
13,
18,
18,
13,
2,
13,
17,
13,
0,
13,
17,
14,
4,
18,
13,
17,
30,
0,
18,
18,
13,
2,
13,
17,
13,
2,
18,
18,
13,
2,
13,
17,
13,
18,
18,
13,
2,
13,
17,
13,
0,
13,
17,
14,
4,
18,
13,
17,
30,
0,
18,
18,
13,
2,
13,
17,
13,
2,
18,
18,
13,
2,
13,
17,
13,
18,
18,
13,
2,
13,
17,
13,
0,
13,
17,
30,
0,
18,
13,
13,
20,
40,
13,
4,
18,
18,
13,
17,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
6,
7
],
[
4,
8
],
[
8,
9
],
[
8,
10
],
[
10,
11
],
[
11,
12
],
[
11,
13
],
[
13,
14
],
[
14,
15
],
[
13,
16
],
[
8,
17
],
[
17,
18
],
[
4,
19
],
[
19,
20
],
[
19,
21
],
[
21,
22
],
[
22,
23
],
[
23,
24
],
[
24,
25
],
[
24,
26
],
[
22,
27
],
[
0,
28
],
[
168,
29
],
[
168,
30
],
[
30,
31
],
[
30,
32
],
[
32,
33
],
[
33,
34
],
[
33,
35
],
[
32,
36
],
[
36,
37
],
[
36,
38
],
[
32,
39
],
[
39,
40
],
[
39,
41
],
[
32,
42
],
[
42,
43
],
[
42,
44
],
[
32,
46
],
[
46,
47
],
[
47,
48
],
[
48,
49
],
[
46,
50
],
[
50,
51
],
[
51,
52
],
[
51,
53
],
[
53,
54
],
[
54,
55
],
[
50,
56
],
[
56,
57
],
[
57,
58
],
[
58,
59
],
[
57,
60
],
[
56,
61
],
[
61,
62
],
[
62,
63
],
[
63,
64
],
[
64,
65
],
[
64,
66
],
[
66,
67
],
[
66,
68
],
[
63,
69
],
[
62,
70
],
[
70,
71
],
[
71,
72
],
[
72,
73
],
[
72,
74
],
[
74,
75
],
[
74,
76
],
[
71,
77
],
[
70,
78
],
[
78,
79
],
[
79,
80
],
[
79,
81
],
[
81,
82
],
[
81,
83
],
[
78,
84
],
[
61,
85
],
[
85,
86
],
[
85,
87
],
[
56,
88
],
[
88,
89
],
[
89,
90
],
[
90,
91
],
[
89,
92
],
[
88,
93
],
[
93,
94
],
[
94,
95
],
[
95,
96
],
[
96,
97
],
[
96,
98
],
[
98,
99
],
[
98,
100
],
[
95,
101
],
[
94,
102
],
[
102,
103
],
[
103,
104
],
[
104,
105
],
[
104,
106
],
[
106,
107
],
[
106,
108
],
[
103,
109
],
[
102,
110
],
[
110,
111
],
[
111,
112
],
[
111,
113
],
[
113,
114
],
[
113,
115
],
[
110,
116
],
[
93,
117
],
[
117,
118
],
[
117,
119
],
[
88,
120
],
[
120,
121
],
[
121,
122
],
[
122,
123
],
[
121,
124
],
[
120,
125
],
[
125,
126
],
[
126,
127
],
[
127,
128
],
[
128,
129
],
[
128,
130
],
[
130,
131
],
[
130,
132
],
[
127,
133
],
[
126,
134
],
[
134,
135
],
[
135,
136
],
[
136,
137
],
[
136,
138
],
[
138,
139
],
[
138,
140
],
[
135,
141
],
[
134,
142
],
[
142,
143
],
[
143,
144
],
[
143,
145
],
[
145,
146
],
[
145,
147
],
[
142,
148
],
[
125,
149
],
[
149,
150
],
[
149,
151
],
[
120,
152
],
[
152,
153
],
[
153,
154
],
[
154,
155
],
[
154,
156
],
[
153,
157
],
[
50,
158
],
[
158,
159
],
[
32,
160
],
[
160,
161
],
[
161,
162
],
[
162,
163
],
[
162,
164
],
[
30,
165
],
[
165,
166
],
[
0,
167
],
[
167,
168
],
[
167,
169
]
] | [
"import java.util.Scanner;\nclass Stac{\n\tint num;\n\tpublic Stac(String str) {\n\t\tnum=Integer.parseInt(str);\n\t}\n\tpublic void Show() {\n\t\tSystem.out.println(num);\n\t}\n}\n\npublic class Main{\n public static void main(String[] args){\n Scanner scan=new Scanner(System.in);\n int i=0;\n String str=\"\";\n Stac[] stac=new Stac[100];\n while(scan.hasNext()) {\n \tstr=scan.next();\n \tif(str.equals(\"+\")) {\n \t\tstac[i-2].num=stac[i-2].num+stac[i-1].num;\n \t\ti-=2;\n \t}\n \telse if(str.equals(\"-\")) {\n \t\tstac[i-2].num=stac[i-2].num-stac[i-1].num;\n \t\ti-=2;\n \t}\n \telse if(str.equals(\"*\")) {\n \t\tstac[i-2].num=stac[i-2].num*stac[i-1].num;\n \t\ti-=2;\n \t}\n \telse {\n \t\tstac[i]=new Stac(str);\n \t}\n \ti++;\n }\n stac[0].Show();\n\t}\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"class Stac{\n\tint num;\n\tpublic Stac(String str) {\n\t\tnum=Integer.parseInt(str);\n\t}\n\tpublic void Show() {\n\t\tSystem.out.println(num);\n\t}\n}",
"Stac",
"int num;",
"num",
"public Stac(String str) {\n\t\tnum=Integer.parseInt(str);\n\t}",
"Stac",
"{\n\t\tnum=Integer.parseInt(str);\n\t}",
"num=Integer.parseInt(str)",
"num",
"Integer.parseInt(str)",
"Integer.parseInt",
"Integer",
"str",
"String str",
"str",
"public void Show() {\n\t\tSystem.out.println(num);\n\t}",
"Show",
"{\n\t\tSystem.out.println(num);\n\t}",
"System.out.println(num)",
"System.out.println",
"System.out",
"System",
"System.out",
"num",
"public class Main{\n public static void main(String[] args){\n Scanner scan=new Scanner(System.in);\n int i=0;\n String str=\"\";\n Stac[] stac=new Stac[100];\n while(scan.hasNext()) {\n \tstr=scan.next();\n \tif(str.equals(\"+\")) {\n \t\tstac[i-2].num=stac[i-2].num+stac[i-1].num;\n \t\ti-=2;\n \t}\n \telse if(str.equals(\"-\")) {\n \t\tstac[i-2].num=stac[i-2].num-stac[i-1].num;\n \t\ti-=2;\n \t}\n \telse if(str.equals(\"*\")) {\n \t\tstac[i-2].num=stac[i-2].num*stac[i-1].num;\n \t\ti-=2;\n \t}\n \telse {\n \t\tstac[i]=new Stac(str);\n \t}\n \ti++;\n }\n stac[0].Show();\n\t}\n}",
"Main",
"public static void main(String[] args){\n Scanner scan=new Scanner(System.in);\n int i=0;\n String str=\"\";\n Stac[] stac=new Stac[100];\n while(scan.hasNext()) {\n \tstr=scan.next();\n \tif(str.equals(\"+\")) {\n \t\tstac[i-2].num=stac[i-2].num+stac[i-1].num;\n \t\ti-=2;\n \t}\n \telse if(str.equals(\"-\")) {\n \t\tstac[i-2].num=stac[i-2].num-stac[i-1].num;\n \t\ti-=2;\n \t}\n \telse if(str.equals(\"*\")) {\n \t\tstac[i-2].num=stac[i-2].num*stac[i-1].num;\n \t\ti-=2;\n \t}\n \telse {\n \t\tstac[i]=new Stac(str);\n \t}\n \ti++;\n }\n stac[0].Show();\n\t}",
"main",
"{\n Scanner scan=new Scanner(System.in);\n int i=0;\n String str=\"\";\n Stac[] stac=new Stac[100];\n while(scan.hasNext()) {\n \tstr=scan.next();\n \tif(str.equals(\"+\")) {\n \t\tstac[i-2].num=stac[i-2].num+stac[i-1].num;\n \t\ti-=2;\n \t}\n \telse if(str.equals(\"-\")) {\n \t\tstac[i-2].num=stac[i-2].num-stac[i-1].num;\n \t\ti-=2;\n \t}\n \telse if(str.equals(\"*\")) {\n \t\tstac[i-2].num=stac[i-2].num*stac[i-1].num;\n \t\ti-=2;\n \t}\n \telse {\n \t\tstac[i]=new Stac(str);\n \t}\n \ti++;\n }\n stac[0].Show();\n\t}",
"Scanner scan=new Scanner(System.in);",
"scan",
"new Scanner(System.in)",
"int i=0;",
"i",
"0",
"String str=\"\";",
"str",
"\"\"",
"Stac[] stac=new Stac[100];",
"stac",
"new Stac[100]",
"100",
"while(scan.hasNext()) {\n \tstr=scan.next();\n \tif(str.equals(\"+\")) {\n \t\tstac[i-2].num=stac[i-2].num+stac[i-1].num;\n \t\ti-=2;\n \t}\n \telse if(str.equals(\"-\")) {\n \t\tstac[i-2].num=stac[i-2].num-stac[i-1].num;\n \t\ti-=2;\n \t}\n \telse if(str.equals(\"*\")) {\n \t\tstac[i-2].num=stac[i-2].num*stac[i-1].num;\n \t\ti-=2;\n \t}\n \telse {\n \t\tstac[i]=new Stac(str);\n \t}\n \ti++;\n }",
"scan.hasNext()",
"scan.hasNext",
"scan",
"{\n \tstr=scan.next();\n \tif(str.equals(\"+\")) {\n \t\tstac[i-2].num=stac[i-2].num+stac[i-1].num;\n \t\ti-=2;\n \t}\n \telse if(str.equals(\"-\")) {\n \t\tstac[i-2].num=stac[i-2].num-stac[i-1].num;\n \t\ti-=2;\n \t}\n \telse if(str.equals(\"*\")) {\n \t\tstac[i-2].num=stac[i-2].num*stac[i-1].num;\n \t\ti-=2;\n \t}\n \telse {\n \t\tstac[i]=new Stac(str);\n \t}\n \ti++;\n }",
"str=scan.next()",
"str",
"scan.next()",
"scan.next",
"scan",
"if(str.equals(\"+\")) {\n \t\tstac[i-2].num=stac[i-2].num+stac[i-1].num;\n \t\ti-=2;\n \t}\n \telse if(str.equals(\"-\")) {\n \t\tstac[i-2].num=stac[i-2].num-stac[i-1].num;\n \t\ti-=2;\n \t}\n \telse if(str.equals(\"*\")) {\n \t\tstac[i-2].num=stac[i-2].num*stac[i-1].num;\n \t\ti-=2;\n \t}\n \telse {\n \t\tstac[i]=new Stac(str);\n \t}",
"str.equals(\"+\")",
"str.equals",
"str",
"\"+\"",
"{\n \t\tstac[i-2].num=stac[i-2].num+stac[i-1].num;\n \t\ti-=2;\n \t}",
"stac[i-2].num=stac[i-2].num+stac[i-1].num",
"stac[i-2].num",
"stac[i-2]",
"stac",
"i-2",
"i",
"2",
"stac[i-2].num",
"stac[i-2].num+stac[i-1].num",
"stac[i-2].num",
"stac[i-2]",
"stac",
"i-2",
"i",
"2",
"stac[i-2].num",
"stac[i-1].num",
"stac[i-1]",
"stac",
"i-1",
"i",
"1",
"stac[i-1].num",
"i-=2",
"i",
"2",
"if(str.equals(\"-\")) {\n \t\tstac[i-2].num=stac[i-2].num-stac[i-1].num;\n \t\ti-=2;\n \t}\n \telse if(str.equals(\"*\")) {\n \t\tstac[i-2].num=stac[i-2].num*stac[i-1].num;\n \t\ti-=2;\n \t}\n \telse {\n \t\tstac[i]=new Stac(str);\n \t}",
"str.equals(\"-\")",
"str.equals",
"str",
"\"-\"",
"{\n \t\tstac[i-2].num=stac[i-2].num-stac[i-1].num;\n \t\ti-=2;\n \t}",
"stac[i-2].num=stac[i-2].num-stac[i-1].num",
"stac[i-2].num",
"stac[i-2]",
"stac",
"i-2",
"i",
"2",
"stac[i-2].num",
"stac[i-2].num-stac[i-1].num",
"stac[i-2].num",
"stac[i-2]",
"stac",
"i-2",
"i",
"2",
"stac[i-2].num",
"stac[i-1].num",
"stac[i-1]",
"stac",
"i-1",
"i",
"1",
"stac[i-1].num",
"i-=2",
"i",
"2",
"if(str.equals(\"*\")) {\n \t\tstac[i-2].num=stac[i-2].num*stac[i-1].num;\n \t\ti-=2;\n \t}\n \telse {\n \t\tstac[i]=new Stac(str);\n \t}",
"str.equals(\"*\")",
"str.equals",
"str",
"\"*\"",
"{\n \t\tstac[i-2].num=stac[i-2].num*stac[i-1].num;\n \t\ti-=2;\n \t}",
"stac[i-2].num=stac[i-2].num*stac[i-1].num",
"stac[i-2].num",
"stac[i-2]",
"stac",
"i-2",
"i",
"2",
"stac[i-2].num",
"stac[i-2].num*stac[i-1].num",
"stac[i-2].num",
"stac[i-2]",
"stac",
"i-2",
"i",
"2",
"stac[i-2].num",
"stac[i-1].num",
"stac[i-1]",
"stac",
"i-1",
"i",
"1",
"stac[i-1].num",
"i-=2",
"i",
"2",
"{\n \t\tstac[i]=new Stac(str);\n \t}",
"stac[i]=new Stac(str)",
"stac[i]",
"stac",
"i",
"new Stac(str)",
"i++",
"i",
"stac[0].Show()",
"stac[0].Show",
"stac[0]",
"stac",
"0",
"String[] args",
"args",
"public class Main{\n public static void main(String[] args){\n Scanner scan=new Scanner(System.in);\n int i=0;\n String str=\"\";\n Stac[] stac=new Stac[100];\n while(scan.hasNext()) {\n \tstr=scan.next();\n \tif(str.equals(\"+\")) {\n \t\tstac[i-2].num=stac[i-2].num+stac[i-1].num;\n \t\ti-=2;\n \t}\n \telse if(str.equals(\"-\")) {\n \t\tstac[i-2].num=stac[i-2].num-stac[i-1].num;\n \t\ti-=2;\n \t}\n \telse if(str.equals(\"*\")) {\n \t\tstac[i-2].num=stac[i-2].num*stac[i-1].num;\n \t\ti-=2;\n \t}\n \telse {\n \t\tstac[i]=new Stac(str);\n \t}\n \ti++;\n }\n stac[0].Show();\n\t}\n}",
"public class Main{\n public static void main(String[] args){\n Scanner scan=new Scanner(System.in);\n int i=0;\n String str=\"\";\n Stac[] stac=new Stac[100];\n while(scan.hasNext()) {\n \tstr=scan.next();\n \tif(str.equals(\"+\")) {\n \t\tstac[i-2].num=stac[i-2].num+stac[i-1].num;\n \t\ti-=2;\n \t}\n \telse if(str.equals(\"-\")) {\n \t\tstac[i-2].num=stac[i-2].num-stac[i-1].num;\n \t\ti-=2;\n \t}\n \telse if(str.equals(\"*\")) {\n \t\tstac[i-2].num=stac[i-2].num*stac[i-1].num;\n \t\ti-=2;\n \t}\n \telse {\n \t\tstac[i]=new Stac(str);\n \t}\n \ti++;\n }\n stac[0].Show();\n\t}\n}",
"Main"
] | import java.util.Scanner;
class Stac{
int num;
public Stac(String str) {
num=Integer.parseInt(str);
}
public void Show() {
System.out.println(num);
}
}
public class Main{
public static void main(String[] args){
Scanner scan=new Scanner(System.in);
int i=0;
String str="";
Stac[] stac=new Stac[100];
while(scan.hasNext()) {
str=scan.next();
if(str.equals("+")) {
stac[i-2].num=stac[i-2].num+stac[i-1].num;
i-=2;
}
else if(str.equals("-")) {
stac[i-2].num=stac[i-2].num-stac[i-1].num;
i-=2;
}
else if(str.equals("*")) {
stac[i-2].num=stac[i-2].num*stac[i-1].num;
i-=2;
}
else {
stac[i]=new Stac(str);
}
i++;
}
stac[0].Show();
}
}
|
[
7,
15,
13,
17,
6,
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,
20,
42,
4,
18,
13,
30,
41,
13,
4,
18,
13,
14,
4,
13,
13,
30,
4,
18,
13,
4,
18,
13,
13,
30,
41,
13,
4,
18,
13,
2,
4,
18,
13,
17,
41,
13,
4,
18,
13,
2,
4,
18,
13,
17,
4,
18,
13,
2,
4,
18,
13,
17,
4,
18,
13,
2,
4,
18,
13,
17,
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,
4,
18,
18,
13,
13,
4,
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
],
[
10,
11
],
[
10,
12
],
[
12,
13
],
[
13,
14
],
[
9,
15
],
[
15,
16
],
[
16,
17
],
[
17,
18
],
[
16,
19
],
[
15,
20
],
[
20,
21
],
[
6,
22
],
[
22,
23
],
[
4,
24
],
[
24,
25
],
[
24,
26
],
[
26,
27
],
[
27,
28
],
[
27,
29
],
[
26,
30
],
[
30,
31
],
[
30,
32
],
[
26,
33
],
[
33,
34
],
[
34,
35
],
[
35,
36
],
[
33,
37
],
[
37,
38
],
[
38,
39
],
[
38,
40
],
[
40,
41
],
[
41,
42
],
[
37,
43
],
[
43,
44
],
[
44,
45
],
[
44,
46
],
[
43,
47
],
[
47,
48
],
[
48,
49
],
[
49,
50
],
[
48,
51
],
[
51,
52
],
[
52,
53
],
[
51,
54
],
[
43,
55
],
[
55,
56
],
[
56,
57
],
[
56,
58
],
[
58,
59
],
[
59,
60
],
[
58,
61
],
[
61,
62
],
[
62,
63
],
[
63,
64
],
[
61,
65
],
[
55,
66
],
[
66,
67
],
[
66,
68
],
[
68,
69
],
[
69,
70
],
[
68,
71
],
[
71,
72
],
[
72,
73
],
[
73,
74
],
[
71,
75
],
[
55,
76
],
[
76,
77
],
[
77,
78
],
[
76,
79
],
[
79,
80
],
[
80,
81
],
[
81,
82
],
[
79,
83
],
[
55,
84
],
[
84,
85
],
[
85,
86
],
[
84,
87
],
[
87,
88
],
[
88,
89
],
[
89,
90
],
[
87,
91
],
[
55,
92
],
[
92,
93
],
[
92,
94
],
[
94,
95
],
[
94,
96
],
[
96,
97
],
[
97,
98
],
[
98,
99
],
[
97,
100
],
[
100,
101
],
[
100,
102
],
[
96,
103
],
[
92,
104
],
[
104,
105
],
[
104,
106
],
[
106,
107
],
[
107,
108
],
[
108,
109
],
[
107,
110
],
[
110,
111
],
[
110,
112
],
[
106,
113
],
[
92,
114
],
[
114,
115
],
[
114,
116
],
[
116,
117
],
[
117,
118
],
[
118,
119
],
[
117,
120
],
[
120,
121
],
[
120,
122
],
[
116,
123
],
[
26,
124
],
[
124,
125
],
[
125,
126
],
[
126,
127
],
[
126,
128
],
[
124,
129
],
[
129,
130
],
[
130,
131
],
[
129,
132
],
[
24,
133
],
[
133,
134
]
] | [
"import java.util.*;\n\nclass Main{\n\n static boolean isNum(String n) {\n\ttry {\n\t Integer.parseInt(n);\n\t return true;\n\t} catch (NumberFormatException e) {\n\t return false;\n\t}\n }\n \n public static void main(String[] args) {\n\tScanner sc = new Scanner(System.in);\n\tArrayList<Integer> num = new ArrayList<>();\n\n\twhile(sc.hasNext()){\n\t String str = sc.next();\n\t if(isNum(str)){\n\t\tnum.add(Integer.parseInt(str));\n\t }\n\t else{\n\t\tint x = num.get(num.size()-2);\n\t\tint y = num.get(num.size()-1);\n\t\tnum.remove(num.size()-2);\n\t\tnum.remove(num.size()-1);\n\t\tswitch(str){\n\t\tcase \"+\":\n\t\t num.add(x+y);\n\t\t break;\n\t\tcase \"-\":\n\t\t num.add(x-y);\n\t\t break;\n\t\tcase \"*\":\n\t\t num.add(x*y);\n\t\t break;\t\t\n\t\t}\n\t }\n\t}\n\tSystem.out.println(num.get(0));\n\n }\n\n}",
"import java.util.*;",
"util.*",
"java",
"class Main{\n\n static boolean isNum(String n) {\n\ttry {\n\t Integer.parseInt(n);\n\t return true;\n\t} catch (NumberFormatException e) {\n\t return false;\n\t}\n }\n \n public static void main(String[] args) {\n\tScanner sc = new Scanner(System.in);\n\tArrayList<Integer> num = new ArrayList<>();\n\n\twhile(sc.hasNext()){\n\t String str = sc.next();\n\t if(isNum(str)){\n\t\tnum.add(Integer.parseInt(str));\n\t }\n\t else{\n\t\tint x = num.get(num.size()-2);\n\t\tint y = num.get(num.size()-1);\n\t\tnum.remove(num.size()-2);\n\t\tnum.remove(num.size()-1);\n\t\tswitch(str){\n\t\tcase \"+\":\n\t\t num.add(x+y);\n\t\t break;\n\t\tcase \"-\":\n\t\t num.add(x-y);\n\t\t break;\n\t\tcase \"*\":\n\t\t num.add(x*y);\n\t\t break;\t\t\n\t\t}\n\t }\n\t}\n\tSystem.out.println(num.get(0));\n\n }\n\n}",
"Main",
"static boolean isNum(String n) {\n\ttry {\n\t Integer.parseInt(n);\n\t return true;\n\t} catch (NumberFormatException e) {\n\t return false;\n\t}\n }",
"isNum",
"{\n\ttry {\n\t Integer.parseInt(n);\n\t return true;\n\t} catch (NumberFormatException e) {\n\t return false;\n\t}\n }",
"try {\n\t Integer.parseInt(n);\n\t return true;\n\t} catch (NumberFormatException e) {\n\t return false;\n\t}",
"catch (NumberFormatException e) {\n\t return false;\n\t}",
"NumberFormatException e",
"{\n\t return false;\n\t}",
"return false;",
"false",
"{\n\t Integer.parseInt(n);\n\t return true;\n\t}",
"Integer.parseInt(n)",
"Integer.parseInt",
"Integer",
"n",
"return true;",
"true",
"String n",
"n",
"public static void main(String[] args) {\n\tScanner sc = new Scanner(System.in);\n\tArrayList<Integer> num = new ArrayList<>();\n\n\twhile(sc.hasNext()){\n\t String str = sc.next();\n\t if(isNum(str)){\n\t\tnum.add(Integer.parseInt(str));\n\t }\n\t else{\n\t\tint x = num.get(num.size()-2);\n\t\tint y = num.get(num.size()-1);\n\t\tnum.remove(num.size()-2);\n\t\tnum.remove(num.size()-1);\n\t\tswitch(str){\n\t\tcase \"+\":\n\t\t num.add(x+y);\n\t\t break;\n\t\tcase \"-\":\n\t\t num.add(x-y);\n\t\t break;\n\t\tcase \"*\":\n\t\t num.add(x*y);\n\t\t break;\t\t\n\t\t}\n\t }\n\t}\n\tSystem.out.println(num.get(0));\n\n }",
"main",
"{\n\tScanner sc = new Scanner(System.in);\n\tArrayList<Integer> num = new ArrayList<>();\n\n\twhile(sc.hasNext()){\n\t String str = sc.next();\n\t if(isNum(str)){\n\t\tnum.add(Integer.parseInt(str));\n\t }\n\t else{\n\t\tint x = num.get(num.size()-2);\n\t\tint y = num.get(num.size()-1);\n\t\tnum.remove(num.size()-2);\n\t\tnum.remove(num.size()-1);\n\t\tswitch(str){\n\t\tcase \"+\":\n\t\t num.add(x+y);\n\t\t break;\n\t\tcase \"-\":\n\t\t num.add(x-y);\n\t\t break;\n\t\tcase \"*\":\n\t\t num.add(x*y);\n\t\t break;\t\t\n\t\t}\n\t }\n\t}\n\tSystem.out.println(num.get(0));\n\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"ArrayList<Integer> num = new ArrayList<>();",
"num",
"new ArrayList<>()",
"while(sc.hasNext()){\n\t String str = sc.next();\n\t if(isNum(str)){\n\t\tnum.add(Integer.parseInt(str));\n\t }\n\t else{\n\t\tint x = num.get(num.size()-2);\n\t\tint y = num.get(num.size()-1);\n\t\tnum.remove(num.size()-2);\n\t\tnum.remove(num.size()-1);\n\t\tswitch(str){\n\t\tcase \"+\":\n\t\t num.add(x+y);\n\t\t break;\n\t\tcase \"-\":\n\t\t num.add(x-y);\n\t\t break;\n\t\tcase \"*\":\n\t\t num.add(x*y);\n\t\t break;\t\t\n\t\t}\n\t }\n\t}",
"sc.hasNext()",
"sc.hasNext",
"sc",
"{\n\t String str = sc.next();\n\t if(isNum(str)){\n\t\tnum.add(Integer.parseInt(str));\n\t }\n\t else{\n\t\tint x = num.get(num.size()-2);\n\t\tint y = num.get(num.size()-1);\n\t\tnum.remove(num.size()-2);\n\t\tnum.remove(num.size()-1);\n\t\tswitch(str){\n\t\tcase \"+\":\n\t\t num.add(x+y);\n\t\t break;\n\t\tcase \"-\":\n\t\t num.add(x-y);\n\t\t break;\n\t\tcase \"*\":\n\t\t num.add(x*y);\n\t\t break;\t\t\n\t\t}\n\t }\n\t}",
"String str = sc.next();",
"str",
"sc.next()",
"sc.next",
"sc",
"if(isNum(str)){\n\t\tnum.add(Integer.parseInt(str));\n\t }\n\t else{\n\t\tint x = num.get(num.size()-2);\n\t\tint y = num.get(num.size()-1);\n\t\tnum.remove(num.size()-2);\n\t\tnum.remove(num.size()-1);\n\t\tswitch(str){\n\t\tcase \"+\":\n\t\t num.add(x+y);\n\t\t break;\n\t\tcase \"-\":\n\t\t num.add(x-y);\n\t\t break;\n\t\tcase \"*\":\n\t\t num.add(x*y);\n\t\t break;\t\t\n\t\t}\n\t }",
"isNum(str)",
"isNum",
"str",
"{\n\t\tnum.add(Integer.parseInt(str));\n\t }",
"num.add(Integer.parseInt(str))",
"num.add",
"num",
"Integer.parseInt(str)",
"Integer.parseInt",
"Integer",
"str",
"{\n\t\tint x = num.get(num.size()-2);\n\t\tint y = num.get(num.size()-1);\n\t\tnum.remove(num.size()-2);\n\t\tnum.remove(num.size()-1);\n\t\tswitch(str){\n\t\tcase \"+\":\n\t\t num.add(x+y);\n\t\t break;\n\t\tcase \"-\":\n\t\t num.add(x-y);\n\t\t break;\n\t\tcase \"*\":\n\t\t num.add(x*y);\n\t\t break;\t\t\n\t\t}\n\t }",
"int x = num.get(num.size()-2);",
"x",
"num.get(num.size()-2)",
"num.get",
"num",
"num.size()-2",
"num.size()",
"num.size",
"num",
"2",
"int y = num.get(num.size()-1);",
"y",
"num.get(num.size()-1)",
"num.get",
"num",
"num.size()-1",
"num.size()",
"num.size",
"num",
"1",
"num.remove(num.size()-2)",
"num.remove",
"num",
"num.size()-2",
"num.size()",
"num.size",
"num",
"2",
"num.remove(num.size()-1)",
"num.remove",
"num",
"num.size()-1",
"num.size()",
"num.size",
"num",
"1",
"switch(str){\n\t\tcase \"+\":\n\t\t num.add(x+y);\n\t\t break;\n\t\tcase \"-\":\n\t\t num.add(x-y);\n\t\t break;\n\t\tcase \"*\":\n\t\t num.add(x*y);\n\t\t break;\t\t\n\t\t}",
"str",
"case \"+\":",
"\"+\"",
"case \"+\":",
"num.add(x+y)",
"num.add",
"num",
"x+y",
"x",
"y",
"break;",
"case \"-\":",
"\"-\"",
"case \"-\":",
"num.add(x-y)",
"num.add",
"num",
"x-y",
"x",
"y",
"break;",
"case \"*\":",
"\"*\"",
"case \"*\":",
"num.add(x*y)",
"num.add",
"num",
"x*y",
"x",
"y",
"break;",
"System.out.println(num.get(0))",
"System.out.println",
"System.out",
"System",
"System.out",
"num.get(0)",
"num.get",
"num",
"0",
"String[] args",
"args"
] | import java.util.*;
class Main{
static boolean isNum(String n) {
try {
Integer.parseInt(n);
return true;
} catch (NumberFormatException e) {
return false;
}
}
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
ArrayList<Integer> num = new ArrayList<>();
while(sc.hasNext()){
String str = sc.next();
if(isNum(str)){
num.add(Integer.parseInt(str));
}
else{
int x = num.get(num.size()-2);
int y = num.get(num.size()-1);
num.remove(num.size()-2);
num.remove(num.size()-1);
switch(str){
case "+":
num.add(x+y);
break;
case "-":
num.add(x-y);
break;
case "*":
num.add(x*y);
break;
}
}
}
System.out.println(num.get(0));
}
}
|
[
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,
41,
13,
18,
13,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
14,
2,
2,
2,
4,
18,
18,
13,
13,
17,
17,
2,
4,
18,
18,
13,
13,
17,
17,
2,
4,
18,
18,
13,
13,
17,
17,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
14,
2,
4,
18,
18,
13,
13,
17,
17,
30,
4,
18,
13,
2,
13,
13,
14,
2,
4,
18,
18,
13,
13,
17,
17,
30,
4,
18,
13,
2,
13,
13,
14,
2,
4,
18,
18,
13,
13,
17,
17,
30,
4,
18,
13,
2,
13,
13,
30,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
4,
18,
18,
13,
13,
1,
40,
13,
30,
30,
0,
13,
17,
0,
13,
2,
4,
18,
18,
13,
13,
13,
17,
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
],
[
182,
8
],
[
182,
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
],
[
29,
31
],
[
31,
32
],
[
31,
33
],
[
11,
34
],
[
34,
35
],
[
35,
36
],
[
36,
37
],
[
36,
38
],
[
34,
39
],
[
39,
40
],
[
39,
41
],
[
34,
42
],
[
42,
43
],
[
43,
44
],
[
34,
45
],
[
46,
46
],
[
46,
47
],
[
47,
48
],
[
49,
49
],
[
49,
50
],
[
50,
51
],
[
51,
52
],
[
52,
53
],
[
53,
54
],
[
53,
55
],
[
51,
56
],
[
50,
57
],
[
49,
58
],
[
58,
59
],
[
59,
60
],
[
60,
61
],
[
61,
62
],
[
61,
63
],
[
59,
64
],
[
58,
65
],
[
49,
66
],
[
66,
67
],
[
67,
68
],
[
68,
69
],
[
69,
70
],
[
69,
71
],
[
67,
72
],
[
66,
73
],
[
47,
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
],
[
87,
88
],
[
88,
89
],
[
89,
90
],
[
89,
91
],
[
87,
92
],
[
86,
93
],
[
85,
94
],
[
94,
95
],
[
95,
96
],
[
96,
97
],
[
95,
98
],
[
98,
99
],
[
98,
100
],
[
85,
101
],
[
101,
102
],
[
102,
103
],
[
103,
104
],
[
104,
105
],
[
105,
106
],
[
105,
107
],
[
103,
108
],
[
102,
109
],
[
101,
110
],
[
110,
111
],
[
111,
112
],
[
112,
113
],
[
111,
114
],
[
114,
115
],
[
114,
116
],
[
101,
117
],
[
117,
118
],
[
118,
119
],
[
119,
120
],
[
120,
121
],
[
121,
122
],
[
121,
123
],
[
119,
124
],
[
118,
125
],
[
117,
126
],
[
126,
127
],
[
127,
128
],
[
128,
129
],
[
127,
130
],
[
130,
131
],
[
130,
132
],
[
47,
133
],
[
133,
134
],
[
134,
135
],
[
134,
136
],
[
133,
137
],
[
137,
138
],
[
138,
139
],
[
139,
140
],
[
139,
141
],
[
137,
142
],
[
142,
143
],
[
142,
144
],
[
144,
145
],
[
145,
146
],
[
146,
147
],
[
146,
148
],
[
137,
149
],
[
149,
150
],
[
150,
151
],
[
137,
152
],
[
153,
153
],
[
153,
154
],
[
154,
155
],
[
154,
156
],
[
153,
157
],
[
157,
158
],
[
157,
159
],
[
159,
160
],
[
160,
161
],
[
161,
162
],
[
162,
163
],
[
162,
164
],
[
160,
165
],
[
159,
166
],
[
133,
167
],
[
167,
168
],
[
168,
169
],
[
167,
170
],
[
11,
171
],
[
171,
172
],
[
172,
173
],
[
173,
174
],
[
173,
175
],
[
171,
176
],
[
176,
177
],
[
177,
178
],
[
9,
179
],
[
179,
180
],
[
0,
181
],
[
181,
182
],
[
181,
183
]
] | [
"import java.util.Scanner;\nimport java.util.Stack;\n\npublic class Main{\n //problem from izu\n public static void main(String[] args) {\n Scanner in = new Scanner(System.in);\n String next = in.nextLine();\n String[] str = next.split(\" \");\n //System.out.println(str[1]);\n Stack<Integer> stack = new Stack<>();\n int length = str.length;\n for(int i = 0; i<length; i++){\n if(str[i].charAt(0)=='+' || str[i].charAt(0)=='-' || str[i].charAt(0)=='*'){\n int a = stack.pop();\n int b = stack.pop();\n if(str[i].charAt(0)=='+'){\n stack.push(a+b);\n } else if(str[i].charAt(0)=='-'){\n stack.push(b-a);\n } else if(str[i].charAt(0)=='*'){\n stack.push(a*b);\n }\n }\n else {\n int temp = 0;\n for(int k = 0; k<str[i].length(); k++){\n temp*=10;\n temp+=(str[i].charAt(k) - '0');\n }\n stack.push(temp);\n //System.out.println(temp);\n }\n }\n System.out.println(stack.pop());\n \n }\n\n}\n",
"import java.util.Scanner;",
"Scanner",
"java.util",
"import java.util.Stack;",
"Stack",
"java.util",
"public class Main{\n //problem from izu\n public static void main(String[] args) {\n Scanner in = new Scanner(System.in);\n String next = in.nextLine();\n String[] str = next.split(\" \");\n //System.out.println(str[1]);\n Stack<Integer> stack = new Stack<>();\n int length = str.length;\n for(int i = 0; i<length; i++){\n if(str[i].charAt(0)=='+' || str[i].charAt(0)=='-' || str[i].charAt(0)=='*'){\n int a = stack.pop();\n int b = stack.pop();\n if(str[i].charAt(0)=='+'){\n stack.push(a+b);\n } else if(str[i].charAt(0)=='-'){\n stack.push(b-a);\n } else if(str[i].charAt(0)=='*'){\n stack.push(a*b);\n }\n }\n else {\n int temp = 0;\n for(int k = 0; k<str[i].length(); k++){\n temp*=10;\n temp+=(str[i].charAt(k) - '0');\n }\n stack.push(temp);\n //System.out.println(temp);\n }\n }\n System.out.println(stack.pop());\n \n }\n\n}",
"Main",
"//problem from izu\n public static void main(String[] args) {\n Scanner in = new Scanner(System.in);\n String next = in.nextLine();\n String[] str = next.split(\" \");\n //System.out.println(str[1]);\n Stack<Integer> stack = new Stack<>();\n int length = str.length;\n for(int i = 0; i<length; i++){\n if(str[i].charAt(0)=='+' || str[i].charAt(0)=='-' || str[i].charAt(0)=='*'){\n int a = stack.pop();\n int b = stack.pop();\n if(str[i].charAt(0)=='+'){\n stack.push(a+b);\n } else if(str[i].charAt(0)=='-'){\n stack.push(b-a);\n } else if(str[i].charAt(0)=='*'){\n stack.push(a*b);\n }\n }\n else {\n int temp = 0;\n for(int k = 0; k<str[i].length(); k++){\n temp*=10;\n temp+=(str[i].charAt(k) - '0');\n }\n stack.push(temp);\n //System.out.println(temp);\n }\n }\n System.out.println(stack.pop());\n \n }",
"main",
"{\n Scanner in = new Scanner(System.in);\n String next = in.nextLine();\n String[] str = next.split(\" \");\n //System.out.println(str[1]);\n Stack<Integer> stack = new Stack<>();\n int length = str.length;\n for(int i = 0; i<length; i++){\n if(str[i].charAt(0)=='+' || str[i].charAt(0)=='-' || str[i].charAt(0)=='*'){\n int a = stack.pop();\n int b = stack.pop();\n if(str[i].charAt(0)=='+'){\n stack.push(a+b);\n } else if(str[i].charAt(0)=='-'){\n stack.push(b-a);\n } else if(str[i].charAt(0)=='*'){\n stack.push(a*b);\n }\n }\n else {\n int temp = 0;\n for(int k = 0; k<str[i].length(); k++){\n temp*=10;\n temp+=(str[i].charAt(k) - '0');\n }\n stack.push(temp);\n //System.out.println(temp);\n }\n }\n System.out.println(stack.pop());\n \n }",
"Scanner in = new Scanner(System.in);",
"in",
"new Scanner(System.in)",
"String next = in.nextLine();",
"next",
"in.nextLine()",
"in.nextLine",
"in",
"String[] str = next.split(\" \");",
"str",
"next.split(\" \")",
"next.split",
"next",
"\" \"",
"Stack<Integer> stack = new Stack<>();",
"stack",
"new Stack<>()",
"int length = str.length;",
"length",
"str.length",
"str",
"str.length",
"for(int i = 0; i<length; i++){\n if(str[i].charAt(0)=='+' || str[i].charAt(0)=='-' || str[i].charAt(0)=='*'){\n int a = stack.pop();\n int b = stack.pop();\n if(str[i].charAt(0)=='+'){\n stack.push(a+b);\n } else if(str[i].charAt(0)=='-'){\n stack.push(b-a);\n } else if(str[i].charAt(0)=='*'){\n stack.push(a*b);\n }\n }\n else {\n int temp = 0;\n for(int k = 0; k<str[i].length(); k++){\n temp*=10;\n temp+=(str[i].charAt(k) - '0');\n }\n stack.push(temp);\n //System.out.println(temp);\n }\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i<length",
"i",
"length",
"i++",
"i++",
"i",
"{\n if(str[i].charAt(0)=='+' || str[i].charAt(0)=='-' || str[i].charAt(0)=='*'){\n int a = stack.pop();\n int b = stack.pop();\n if(str[i].charAt(0)=='+'){\n stack.push(a+b);\n } else if(str[i].charAt(0)=='-'){\n stack.push(b-a);\n } else if(str[i].charAt(0)=='*'){\n stack.push(a*b);\n }\n }\n else {\n int temp = 0;\n for(int k = 0; k<str[i].length(); k++){\n temp*=10;\n temp+=(str[i].charAt(k) - '0');\n }\n stack.push(temp);\n //System.out.println(temp);\n }\n }",
"{\n if(str[i].charAt(0)=='+' || str[i].charAt(0)=='-' || str[i].charAt(0)=='*'){\n int a = stack.pop();\n int b = stack.pop();\n if(str[i].charAt(0)=='+'){\n stack.push(a+b);\n } else if(str[i].charAt(0)=='-'){\n stack.push(b-a);\n } else if(str[i].charAt(0)=='*'){\n stack.push(a*b);\n }\n }\n else {\n int temp = 0;\n for(int k = 0; k<str[i].length(); k++){\n temp*=10;\n temp+=(str[i].charAt(k) - '0');\n }\n stack.push(temp);\n //System.out.println(temp);\n }\n }",
"if(str[i].charAt(0)=='+' || str[i].charAt(0)=='-' || str[i].charAt(0)=='*'){\n int a = stack.pop();\n int b = stack.pop();\n if(str[i].charAt(0)=='+'){\n stack.push(a+b);\n } else if(str[i].charAt(0)=='-'){\n stack.push(b-a);\n } else if(str[i].charAt(0)=='*'){\n stack.push(a*b);\n }\n }\n else {\n int temp = 0;\n for(int k = 0; k<str[i].length(); k++){\n temp*=10;\n temp+=(str[i].charAt(k) - '0');\n }\n stack.push(temp);\n //System.out.println(temp);\n }",
"str[i].charAt(0)=='+' || str[i].charAt(0)=='-' || str[i].charAt(0)=='*'",
"str[i].charAt(0)=='+' || str[i].charAt(0)=='-' || str[i].charAt(0)=='*'",
"str[i].charAt(0)=='+'",
"str[i].charAt(0)",
"str[i].charAt",
"str[i]",
"str",
"i",
"0",
"'+'",
"str[i].charAt(0)=='-'",
"str[i].charAt(0)",
"str[i].charAt",
"str[i]",
"str",
"i",
"0",
"'-'",
"str[i].charAt(0)=='*'",
"str[i].charAt(0)",
"str[i].charAt",
"str[i]",
"str",
"i",
"0",
"'*'",
"{\n int a = stack.pop();\n int b = stack.pop();\n if(str[i].charAt(0)=='+'){\n stack.push(a+b);\n } else if(str[i].charAt(0)=='-'){\n stack.push(b-a);\n } else if(str[i].charAt(0)=='*'){\n stack.push(a*b);\n }\n }",
"int a = stack.pop();",
"a",
"stack.pop()",
"stack.pop",
"stack",
"int b = stack.pop();",
"b",
"stack.pop()",
"stack.pop",
"stack",
"if(str[i].charAt(0)=='+'){\n stack.push(a+b);\n } else if(str[i].charAt(0)=='-'){\n stack.push(b-a);\n } else if(str[i].charAt(0)=='*'){\n stack.push(a*b);\n }",
"str[i].charAt(0)=='+'",
"str[i].charAt(0)",
"str[i].charAt",
"str[i]",
"str",
"i",
"0",
"'+'",
"{\n stack.push(a+b);\n }",
"stack.push(a+b)",
"stack.push",
"stack",
"a+b",
"a",
"b",
"if(str[i].charAt(0)=='-'){\n stack.push(b-a);\n } else if(str[i].charAt(0)=='*'){\n stack.push(a*b);\n }",
"str[i].charAt(0)=='-'",
"str[i].charAt(0)",
"str[i].charAt",
"str[i]",
"str",
"i",
"0",
"'-'",
"{\n stack.push(b-a);\n }",
"stack.push(b-a)",
"stack.push",
"stack",
"b-a",
"b",
"a",
"if(str[i].charAt(0)=='*'){\n stack.push(a*b);\n }",
"str[i].charAt(0)=='*'",
"str[i].charAt(0)",
"str[i].charAt",
"str[i]",
"str",
"i",
"0",
"'*'",
"{\n stack.push(a*b);\n }",
"stack.push(a*b)",
"stack.push",
"stack",
"a*b",
"a",
"b",
"{\n int temp = 0;\n for(int k = 0; k<str[i].length(); k++){\n temp*=10;\n temp+=(str[i].charAt(k) - '0');\n }\n stack.push(temp);\n //System.out.println(temp);\n }",
"int temp = 0;",
"temp",
"0",
"for(int k = 0; k<str[i].length(); k++){\n temp*=10;\n temp+=(str[i].charAt(k) - '0');\n }",
"int k = 0;",
"int k = 0;",
"k",
"0",
"k<str[i].length()",
"k",
"str[i].length()",
"str[i].length",
"str[i]",
"str",
"i",
"k++",
"k++",
"k",
"{\n temp*=10;\n temp+=(str[i].charAt(k) - '0');\n }",
"{\n temp*=10;\n temp+=(str[i].charAt(k) - '0');\n }",
"temp*=10",
"temp",
"10",
"temp+=(str[i].charAt(k) - '0')",
"temp",
"(str[i].charAt(k) - '0')",
"str[i].charAt(k)",
"str[i].charAt",
"str[i]",
"str",
"i",
"k",
"'0'",
"stack.push(temp)",
"stack.push",
"stack",
"temp",
"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 //problem from izu\n public static void main(String[] args) {\n Scanner in = new Scanner(System.in);\n String next = in.nextLine();\n String[] str = next.split(\" \");\n //System.out.println(str[1]);\n Stack<Integer> stack = new Stack<>();\n int length = str.length;\n for(int i = 0; i<length; i++){\n if(str[i].charAt(0)=='+' || str[i].charAt(0)=='-' || str[i].charAt(0)=='*'){\n int a = stack.pop();\n int b = stack.pop();\n if(str[i].charAt(0)=='+'){\n stack.push(a+b);\n } else if(str[i].charAt(0)=='-'){\n stack.push(b-a);\n } else if(str[i].charAt(0)=='*'){\n stack.push(a*b);\n }\n }\n else {\n int temp = 0;\n for(int k = 0; k<str[i].length(); k++){\n temp*=10;\n temp+=(str[i].charAt(k) - '0');\n }\n stack.push(temp);\n //System.out.println(temp);\n }\n }\n System.out.println(stack.pop());\n \n }\n\n}",
"public class Main{\n //problem from izu\n public static void main(String[] args) {\n Scanner in = new Scanner(System.in);\n String next = in.nextLine();\n String[] str = next.split(\" \");\n //System.out.println(str[1]);\n Stack<Integer> stack = new Stack<>();\n int length = str.length;\n for(int i = 0; i<length; i++){\n if(str[i].charAt(0)=='+' || str[i].charAt(0)=='-' || str[i].charAt(0)=='*'){\n int a = stack.pop();\n int b = stack.pop();\n if(str[i].charAt(0)=='+'){\n stack.push(a+b);\n } else if(str[i].charAt(0)=='-'){\n stack.push(b-a);\n } else if(str[i].charAt(0)=='*'){\n stack.push(a*b);\n }\n }\n else {\n int temp = 0;\n for(int k = 0; k<str[i].length(); k++){\n temp*=10;\n temp+=(str[i].charAt(k) - '0');\n }\n stack.push(temp);\n //System.out.println(temp);\n }\n }\n System.out.println(stack.pop());\n \n }\n\n}",
"Main"
] | import java.util.Scanner;
import java.util.Stack;
public class Main{
//problem from izu
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
String next = in.nextLine();
String[] str = next.split(" ");
//System.out.println(str[1]);
Stack<Integer> stack = new Stack<>();
int length = str.length;
for(int i = 0; i<length; i++){
if(str[i].charAt(0)=='+' || str[i].charAt(0)=='-' || str[i].charAt(0)=='*'){
int a = stack.pop();
int b = stack.pop();
if(str[i].charAt(0)=='+'){
stack.push(a+b);
} else if(str[i].charAt(0)=='-'){
stack.push(b-a);
} else if(str[i].charAt(0)=='*'){
stack.push(a*b);
}
}
else {
int temp = 0;
for(int k = 0; k<str[i].length(); k++){
temp*=10;
temp+=(str[i].charAt(k) - '0');
}
stack.push(temp);
//System.out.println(temp);
}
}
System.out.println(stack.pop());
}
}
|
[
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,
14,
4,
18,
18,
13,
13,
17,
30,
41,
13,
4,
18,
13,
2,
4,
18,
13,
17,
4,
18,
13,
2,
4,
18,
13,
17,
41,
13,
4,
18,
13,
2,
4,
18,
13,
17,
4,
18,
13,
2,
4,
18,
13,
17,
4,
18,
13,
2,
13,
13,
9,
14,
4,
18,
18,
13,
13,
17,
30,
41,
13,
4,
18,
13,
2,
4,
18,
13,
17,
4,
18,
13,
2,
4,
18,
13,
17,
41,
13,
4,
18,
13,
2,
4,
18,
13,
17,
4,
18,
13,
2,
4,
18,
13,
17,
4,
18,
13,
2,
13,
13,
9,
14,
4,
18,
18,
13,
13,
17,
30,
41,
13,
4,
18,
13,
2,
4,
18,
13,
17,
4,
18,
13,
2,
4,
18,
13,
17,
41,
13,
4,
18,
13,
2,
4,
18,
13,
17,
4,
18,
13,
2,
4,
18,
13,
17,
4,
18,
13,
2,
13,
13,
9,
41,
13,
4,
18,
13,
18,
13,
13,
4,
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
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
221,
8
],
[
221,
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
],
[
45,
46
],
[
46,
47
],
[
47,
48
],
[
47,
49
],
[
45,
50
],
[
44,
51
],
[
51,
52
],
[
52,
53
],
[
52,
54
],
[
54,
55
],
[
55,
56
],
[
54,
57
],
[
57,
58
],
[
58,
59
],
[
59,
60
],
[
57,
61
],
[
51,
62
],
[
62,
63
],
[
63,
64
],
[
62,
65
],
[
65,
66
],
[
66,
67
],
[
67,
68
],
[
65,
69
],
[
51,
70
],
[
70,
71
],
[
70,
72
],
[
72,
73
],
[
73,
74
],
[
72,
75
],
[
75,
76
],
[
76,
77
],
[
77,
78
],
[
75,
79
],
[
51,
80
],
[
80,
81
],
[
81,
82
],
[
80,
83
],
[
83,
84
],
[
84,
85
],
[
85,
86
],
[
83,
87
],
[
51,
88
],
[
88,
89
],
[
89,
90
],
[
88,
91
],
[
91,
92
],
[
91,
93
],
[
51,
94
],
[
43,
95
],
[
95,
96
],
[
96,
97
],
[
97,
98
],
[
98,
99
],
[
98,
100
],
[
96,
101
],
[
95,
102
],
[
102,
103
],
[
103,
104
],
[
103,
105
],
[
105,
106
],
[
106,
107
],
[
105,
108
],
[
108,
109
],
[
109,
110
],
[
110,
111
],
[
108,
112
],
[
102,
113
],
[
113,
114
],
[
114,
115
],
[
113,
116
],
[
116,
117
],
[
117,
118
],
[
118,
119
],
[
116,
120
],
[
102,
121
],
[
121,
122
],
[
121,
123
],
[
123,
124
],
[
124,
125
],
[
123,
126
],
[
126,
127
],
[
127,
128
],
[
128,
129
],
[
126,
130
],
[
102,
131
],
[
131,
132
],
[
132,
133
],
[
131,
134
],
[
134,
135
],
[
135,
136
],
[
136,
137
],
[
134,
138
],
[
102,
139
],
[
139,
140
],
[
140,
141
],
[
139,
142
],
[
142,
143
],
[
142,
144
],
[
102,
145
],
[
43,
146
],
[
146,
147
],
[
147,
148
],
[
148,
149
],
[
149,
150
],
[
149,
151
],
[
147,
152
],
[
146,
153
],
[
153,
154
],
[
154,
155
],
[
154,
156
],
[
156,
157
],
[
157,
158
],
[
156,
159
],
[
159,
160
],
[
160,
161
],
[
161,
162
],
[
159,
163
],
[
153,
164
],
[
164,
165
],
[
165,
166
],
[
164,
167
],
[
167,
168
],
[
168,
169
],
[
169,
170
],
[
167,
171
],
[
153,
172
],
[
172,
173
],
[
172,
174
],
[
174,
175
],
[
175,
176
],
[
174,
177
],
[
177,
178
],
[
178,
179
],
[
179,
180
],
[
177,
181
],
[
153,
182
],
[
182,
183
],
[
183,
184
],
[
182,
185
],
[
185,
186
],
[
186,
187
],
[
187,
188
],
[
185,
189
],
[
153,
190
],
[
190,
191
],
[
191,
192
],
[
190,
193
],
[
193,
194
],
[
193,
195
],
[
153,
196
],
[
43,
197
],
[
197,
198
],
[
197,
199
],
[
199,
200
],
[
200,
201
],
[
199,
202
],
[
202,
203
],
[
202,
204
],
[
43,
205
],
[
205,
206
],
[
206,
207
],
[
205,
208
],
[
11,
209
],
[
209,
210
],
[
210,
211
],
[
211,
212
],
[
211,
213
],
[
209,
214
],
[
214,
215
],
[
215,
216
],
[
214,
217
],
[
9,
218
],
[
218,
219
],
[
0,
220
],
[
220,
221
],
[
220,
222
]
] | [
"import java.util.ArrayList;\nimport java.util.Scanner;\n\npublic class Main{\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tString string = sc.nextLine();\n\t\tString[] a = string.split(\" \");\n\t\tArrayList<Integer> number = new ArrayList<>();\n\n\t\tfor (int i = 0; i < a.length; i++) {\n\n\t\t\tif (a[i].equals(\"+\")) {\n\t\t\t\tint p = number.get(number.size() - 1);\n\t\t\t\tnumber.remove(number.size() - 1);\n\t\t\t\tint q = number.get(number.size() - 1);\n\t\t\t\tnumber.remove(number.size() - 1);\n\t\t\t\tnumber.add(p + q);\n\t\t\t\tcontinue;\n\n\t\t\t}\n\t\t\tif (a[i].equals(\"-\")) {\n\t\t\t\tint p = number.get(number.size() - 2);\n\t\t\t\tnumber.remove(number.size() - 2);\n\t\t\t\tint q = number.get(number.size() - 1);\n\t\t\t\tnumber.remove(number.size() - 1);\n\t\t\t\tnumber.add(p - q);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (a[i].equals(\"*\")) {\n\t\t\t\tint p = number.get(number.size() - 1);\n\t\t\t\tnumber.remove(number.size() - 1);\n\t\t\t\tint q = number.get(number.size() - 1);\n\t\t\t\tnumber.remove(number.size() - 1);\n\t\t\t\tnumber.add(p * q);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tint n = Integer.parseInt(a[i]);\n\t\t\tnumber.add(n);\n\n\t\t}\n\n\t\tSystem.out.println(number.get(0));\n\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[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tString string = sc.nextLine();\n\t\tString[] a = string.split(\" \");\n\t\tArrayList<Integer> number = new ArrayList<>();\n\n\t\tfor (int i = 0; i < a.length; i++) {\n\n\t\t\tif (a[i].equals(\"+\")) {\n\t\t\t\tint p = number.get(number.size() - 1);\n\t\t\t\tnumber.remove(number.size() - 1);\n\t\t\t\tint q = number.get(number.size() - 1);\n\t\t\t\tnumber.remove(number.size() - 1);\n\t\t\t\tnumber.add(p + q);\n\t\t\t\tcontinue;\n\n\t\t\t}\n\t\t\tif (a[i].equals(\"-\")) {\n\t\t\t\tint p = number.get(number.size() - 2);\n\t\t\t\tnumber.remove(number.size() - 2);\n\t\t\t\tint q = number.get(number.size() - 1);\n\t\t\t\tnumber.remove(number.size() - 1);\n\t\t\t\tnumber.add(p - q);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (a[i].equals(\"*\")) {\n\t\t\t\tint p = number.get(number.size() - 1);\n\t\t\t\tnumber.remove(number.size() - 1);\n\t\t\t\tint q = number.get(number.size() - 1);\n\t\t\t\tnumber.remove(number.size() - 1);\n\t\t\t\tnumber.add(p * q);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tint n = Integer.parseInt(a[i]);\n\t\t\tnumber.add(n);\n\n\t\t}\n\n\t\tSystem.out.println(number.get(0));\n\n\t}\n}",
"Main",
"public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tString string = sc.nextLine();\n\t\tString[] a = string.split(\" \");\n\t\tArrayList<Integer> number = new ArrayList<>();\n\n\t\tfor (int i = 0; i < a.length; i++) {\n\n\t\t\tif (a[i].equals(\"+\")) {\n\t\t\t\tint p = number.get(number.size() - 1);\n\t\t\t\tnumber.remove(number.size() - 1);\n\t\t\t\tint q = number.get(number.size() - 1);\n\t\t\t\tnumber.remove(number.size() - 1);\n\t\t\t\tnumber.add(p + q);\n\t\t\t\tcontinue;\n\n\t\t\t}\n\t\t\tif (a[i].equals(\"-\")) {\n\t\t\t\tint p = number.get(number.size() - 2);\n\t\t\t\tnumber.remove(number.size() - 2);\n\t\t\t\tint q = number.get(number.size() - 1);\n\t\t\t\tnumber.remove(number.size() - 1);\n\t\t\t\tnumber.add(p - q);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (a[i].equals(\"*\")) {\n\t\t\t\tint p = number.get(number.size() - 1);\n\t\t\t\tnumber.remove(number.size() - 1);\n\t\t\t\tint q = number.get(number.size() - 1);\n\t\t\t\tnumber.remove(number.size() - 1);\n\t\t\t\tnumber.add(p * q);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tint n = Integer.parseInt(a[i]);\n\t\t\tnumber.add(n);\n\n\t\t}\n\n\t\tSystem.out.println(number.get(0));\n\n\t}",
"main",
"{\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tString string = sc.nextLine();\n\t\tString[] a = string.split(\" \");\n\t\tArrayList<Integer> number = new ArrayList<>();\n\n\t\tfor (int i = 0; i < a.length; i++) {\n\n\t\t\tif (a[i].equals(\"+\")) {\n\t\t\t\tint p = number.get(number.size() - 1);\n\t\t\t\tnumber.remove(number.size() - 1);\n\t\t\t\tint q = number.get(number.size() - 1);\n\t\t\t\tnumber.remove(number.size() - 1);\n\t\t\t\tnumber.add(p + q);\n\t\t\t\tcontinue;\n\n\t\t\t}\n\t\t\tif (a[i].equals(\"-\")) {\n\t\t\t\tint p = number.get(number.size() - 2);\n\t\t\t\tnumber.remove(number.size() - 2);\n\t\t\t\tint q = number.get(number.size() - 1);\n\t\t\t\tnumber.remove(number.size() - 1);\n\t\t\t\tnumber.add(p - q);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (a[i].equals(\"*\")) {\n\t\t\t\tint p = number.get(number.size() - 1);\n\t\t\t\tnumber.remove(number.size() - 1);\n\t\t\t\tint q = number.get(number.size() - 1);\n\t\t\t\tnumber.remove(number.size() - 1);\n\t\t\t\tnumber.add(p * q);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tint n = Integer.parseInt(a[i]);\n\t\t\tnumber.add(n);\n\n\t\t}\n\n\t\tSystem.out.println(number.get(0));\n\n\t}",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"String string = sc.nextLine();",
"string",
"sc.nextLine()",
"sc.nextLine",
"sc",
"String[] a = string.split(\" \");",
"a",
"string.split(\" \")",
"string.split",
"string",
"\" \"",
"ArrayList<Integer> number = new ArrayList<>();",
"number",
"new ArrayList<>()",
"for (int i = 0; i < a.length; i++) {\n\n\t\t\tif (a[i].equals(\"+\")) {\n\t\t\t\tint p = number.get(number.size() - 1);\n\t\t\t\tnumber.remove(number.size() - 1);\n\t\t\t\tint q = number.get(number.size() - 1);\n\t\t\t\tnumber.remove(number.size() - 1);\n\t\t\t\tnumber.add(p + q);\n\t\t\t\tcontinue;\n\n\t\t\t}\n\t\t\tif (a[i].equals(\"-\")) {\n\t\t\t\tint p = number.get(number.size() - 2);\n\t\t\t\tnumber.remove(number.size() - 2);\n\t\t\t\tint q = number.get(number.size() - 1);\n\t\t\t\tnumber.remove(number.size() - 1);\n\t\t\t\tnumber.add(p - q);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (a[i].equals(\"*\")) {\n\t\t\t\tint p = number.get(number.size() - 1);\n\t\t\t\tnumber.remove(number.size() - 1);\n\t\t\t\tint q = number.get(number.size() - 1);\n\t\t\t\tnumber.remove(number.size() - 1);\n\t\t\t\tnumber.add(p * q);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tint n = Integer.parseInt(a[i]);\n\t\t\tnumber.add(n);\n\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < a.length",
"i",
"a.length",
"a",
"a.length",
"i++",
"i++",
"i",
"{\n\n\t\t\tif (a[i].equals(\"+\")) {\n\t\t\t\tint p = number.get(number.size() - 1);\n\t\t\t\tnumber.remove(number.size() - 1);\n\t\t\t\tint q = number.get(number.size() - 1);\n\t\t\t\tnumber.remove(number.size() - 1);\n\t\t\t\tnumber.add(p + q);\n\t\t\t\tcontinue;\n\n\t\t\t}\n\t\t\tif (a[i].equals(\"-\")) {\n\t\t\t\tint p = number.get(number.size() - 2);\n\t\t\t\tnumber.remove(number.size() - 2);\n\t\t\t\tint q = number.get(number.size() - 1);\n\t\t\t\tnumber.remove(number.size() - 1);\n\t\t\t\tnumber.add(p - q);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (a[i].equals(\"*\")) {\n\t\t\t\tint p = number.get(number.size() - 1);\n\t\t\t\tnumber.remove(number.size() - 1);\n\t\t\t\tint q = number.get(number.size() - 1);\n\t\t\t\tnumber.remove(number.size() - 1);\n\t\t\t\tnumber.add(p * q);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tint n = Integer.parseInt(a[i]);\n\t\t\tnumber.add(n);\n\n\t\t}",
"{\n\n\t\t\tif (a[i].equals(\"+\")) {\n\t\t\t\tint p = number.get(number.size() - 1);\n\t\t\t\tnumber.remove(number.size() - 1);\n\t\t\t\tint q = number.get(number.size() - 1);\n\t\t\t\tnumber.remove(number.size() - 1);\n\t\t\t\tnumber.add(p + q);\n\t\t\t\tcontinue;\n\n\t\t\t}\n\t\t\tif (a[i].equals(\"-\")) {\n\t\t\t\tint p = number.get(number.size() - 2);\n\t\t\t\tnumber.remove(number.size() - 2);\n\t\t\t\tint q = number.get(number.size() - 1);\n\t\t\t\tnumber.remove(number.size() - 1);\n\t\t\t\tnumber.add(p - q);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (a[i].equals(\"*\")) {\n\t\t\t\tint p = number.get(number.size() - 1);\n\t\t\t\tnumber.remove(number.size() - 1);\n\t\t\t\tint q = number.get(number.size() - 1);\n\t\t\t\tnumber.remove(number.size() - 1);\n\t\t\t\tnumber.add(p * q);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tint n = Integer.parseInt(a[i]);\n\t\t\tnumber.add(n);\n\n\t\t}",
"if (a[i].equals(\"+\")) {\n\t\t\t\tint p = number.get(number.size() - 1);\n\t\t\t\tnumber.remove(number.size() - 1);\n\t\t\t\tint q = number.get(number.size() - 1);\n\t\t\t\tnumber.remove(number.size() - 1);\n\t\t\t\tnumber.add(p + q);\n\t\t\t\tcontinue;\n\n\t\t\t}",
"a[i].equals(\"+\")",
"a[i].equals",
"a[i]",
"a",
"i",
"\"+\"",
"{\n\t\t\t\tint p = number.get(number.size() - 1);\n\t\t\t\tnumber.remove(number.size() - 1);\n\t\t\t\tint q = number.get(number.size() - 1);\n\t\t\t\tnumber.remove(number.size() - 1);\n\t\t\t\tnumber.add(p + q);\n\t\t\t\tcontinue;\n\n\t\t\t}",
"int p = number.get(number.size() - 1);",
"p",
"number.get(number.size() - 1)",
"number.get",
"number",
"number.size() - 1",
"number.size()",
"number.size",
"number",
"1",
"number.remove(number.size() - 1)",
"number.remove",
"number",
"number.size() - 1",
"number.size()",
"number.size",
"number",
"1",
"int q = number.get(number.size() - 1);",
"q",
"number.get(number.size() - 1)",
"number.get",
"number",
"number.size() - 1",
"number.size()",
"number.size",
"number",
"1",
"number.remove(number.size() - 1)",
"number.remove",
"number",
"number.size() - 1",
"number.size()",
"number.size",
"number",
"1",
"number.add(p + q)",
"number.add",
"number",
"p + q",
"p",
"q",
"continue;",
"if (a[i].equals(\"-\")) {\n\t\t\t\tint p = number.get(number.size() - 2);\n\t\t\t\tnumber.remove(number.size() - 2);\n\t\t\t\tint q = number.get(number.size() - 1);\n\t\t\t\tnumber.remove(number.size() - 1);\n\t\t\t\tnumber.add(p - q);\n\t\t\t\tcontinue;\n\t\t\t}",
"a[i].equals(\"-\")",
"a[i].equals",
"a[i]",
"a",
"i",
"\"-\"",
"{\n\t\t\t\tint p = number.get(number.size() - 2);\n\t\t\t\tnumber.remove(number.size() - 2);\n\t\t\t\tint q = number.get(number.size() - 1);\n\t\t\t\tnumber.remove(number.size() - 1);\n\t\t\t\tnumber.add(p - q);\n\t\t\t\tcontinue;\n\t\t\t}",
"int p = number.get(number.size() - 2);",
"p",
"number.get(number.size() - 2)",
"number.get",
"number",
"number.size() - 2",
"number.size()",
"number.size",
"number",
"2",
"number.remove(number.size() - 2)",
"number.remove",
"number",
"number.size() - 2",
"number.size()",
"number.size",
"number",
"2",
"int q = number.get(number.size() - 1);",
"q",
"number.get(number.size() - 1)",
"number.get",
"number",
"number.size() - 1",
"number.size()",
"number.size",
"number",
"1",
"number.remove(number.size() - 1)",
"number.remove",
"number",
"number.size() - 1",
"number.size()",
"number.size",
"number",
"1",
"number.add(p - q)",
"number.add",
"number",
"p - q",
"p",
"q",
"continue;",
"if (a[i].equals(\"*\")) {\n\t\t\t\tint p = number.get(number.size() - 1);\n\t\t\t\tnumber.remove(number.size() - 1);\n\t\t\t\tint q = number.get(number.size() - 1);\n\t\t\t\tnumber.remove(number.size() - 1);\n\t\t\t\tnumber.add(p * q);\n\t\t\t\tcontinue;\n\t\t\t}",
"a[i].equals(\"*\")",
"a[i].equals",
"a[i]",
"a",
"i",
"\"*\"",
"{\n\t\t\t\tint p = number.get(number.size() - 1);\n\t\t\t\tnumber.remove(number.size() - 1);\n\t\t\t\tint q = number.get(number.size() - 1);\n\t\t\t\tnumber.remove(number.size() - 1);\n\t\t\t\tnumber.add(p * q);\n\t\t\t\tcontinue;\n\t\t\t}",
"int p = number.get(number.size() - 1);",
"p",
"number.get(number.size() - 1)",
"number.get",
"number",
"number.size() - 1",
"number.size()",
"number.size",
"number",
"1",
"number.remove(number.size() - 1)",
"number.remove",
"number",
"number.size() - 1",
"number.size()",
"number.size",
"number",
"1",
"int q = number.get(number.size() - 1);",
"q",
"number.get(number.size() - 1)",
"number.get",
"number",
"number.size() - 1",
"number.size()",
"number.size",
"number",
"1",
"number.remove(number.size() - 1)",
"number.remove",
"number",
"number.size() - 1",
"number.size()",
"number.size",
"number",
"1",
"number.add(p * q)",
"number.add",
"number",
"p * q",
"p",
"q",
"continue;",
"int n = Integer.parseInt(a[i]);",
"n",
"Integer.parseInt(a[i])",
"Integer.parseInt",
"Integer",
"a[i]",
"a",
"i",
"number.add(n)",
"number.add",
"number",
"n",
"System.out.println(number.get(0))",
"System.out.println",
"System.out",
"System",
"System.out",
"number.get(0)",
"number.get",
"number",
"0",
"String[] args",
"args",
"public class Main{\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tString string = sc.nextLine();\n\t\tString[] a = string.split(\" \");\n\t\tArrayList<Integer> number = new ArrayList<>();\n\n\t\tfor (int i = 0; i < a.length; i++) {\n\n\t\t\tif (a[i].equals(\"+\")) {\n\t\t\t\tint p = number.get(number.size() - 1);\n\t\t\t\tnumber.remove(number.size() - 1);\n\t\t\t\tint q = number.get(number.size() - 1);\n\t\t\t\tnumber.remove(number.size() - 1);\n\t\t\t\tnumber.add(p + q);\n\t\t\t\tcontinue;\n\n\t\t\t}\n\t\t\tif (a[i].equals(\"-\")) {\n\t\t\t\tint p = number.get(number.size() - 2);\n\t\t\t\tnumber.remove(number.size() - 2);\n\t\t\t\tint q = number.get(number.size() - 1);\n\t\t\t\tnumber.remove(number.size() - 1);\n\t\t\t\tnumber.add(p - q);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (a[i].equals(\"*\")) {\n\t\t\t\tint p = number.get(number.size() - 1);\n\t\t\t\tnumber.remove(number.size() - 1);\n\t\t\t\tint q = number.get(number.size() - 1);\n\t\t\t\tnumber.remove(number.size() - 1);\n\t\t\t\tnumber.add(p * q);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tint n = Integer.parseInt(a[i]);\n\t\t\tnumber.add(n);\n\n\t\t}\n\n\t\tSystem.out.println(number.get(0));\n\n\t}\n}",
"public class Main{\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tString string = sc.nextLine();\n\t\tString[] a = string.split(\" \");\n\t\tArrayList<Integer> number = new ArrayList<>();\n\n\t\tfor (int i = 0; i < a.length; i++) {\n\n\t\t\tif (a[i].equals(\"+\")) {\n\t\t\t\tint p = number.get(number.size() - 1);\n\t\t\t\tnumber.remove(number.size() - 1);\n\t\t\t\tint q = number.get(number.size() - 1);\n\t\t\t\tnumber.remove(number.size() - 1);\n\t\t\t\tnumber.add(p + q);\n\t\t\t\tcontinue;\n\n\t\t\t}\n\t\t\tif (a[i].equals(\"-\")) {\n\t\t\t\tint p = number.get(number.size() - 2);\n\t\t\t\tnumber.remove(number.size() - 2);\n\t\t\t\tint q = number.get(number.size() - 1);\n\t\t\t\tnumber.remove(number.size() - 1);\n\t\t\t\tnumber.add(p - q);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (a[i].equals(\"*\")) {\n\t\t\t\tint p = number.get(number.size() - 1);\n\t\t\t\tnumber.remove(number.size() - 1);\n\t\t\t\tint q = number.get(number.size() - 1);\n\t\t\t\tnumber.remove(number.size() - 1);\n\t\t\t\tnumber.add(p * q);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tint n = Integer.parseInt(a[i]);\n\t\t\tnumber.add(n);\n\n\t\t}\n\n\t\tSystem.out.println(number.get(0));\n\n\t}\n}",
"Main"
] | import java.util.ArrayList;
import java.util.Scanner;
public class Main{
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String string = sc.nextLine();
String[] a = string.split(" ");
ArrayList<Integer> number = new ArrayList<>();
for (int i = 0; i < a.length; i++) {
if (a[i].equals("+")) {
int p = number.get(number.size() - 1);
number.remove(number.size() - 1);
int q = number.get(number.size() - 1);
number.remove(number.size() - 1);
number.add(p + q);
continue;
}
if (a[i].equals("-")) {
int p = number.get(number.size() - 2);
number.remove(number.size() - 2);
int q = number.get(number.size() - 1);
number.remove(number.size() - 1);
number.add(p - q);
continue;
}
if (a[i].equals("*")) {
int p = number.get(number.size() - 1);
number.remove(number.size() - 1);
int q = number.get(number.size() - 1);
number.remove(number.size() - 1);
number.add(p * q);
continue;
}
int n = Integer.parseInt(a[i]);
number.add(n);
}
System.out.println(number.get(0));
}
} |
[
7,
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,
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
],
[
13,
14
],
[
13,
15
],
[
0,
16
],
[
16,
17
],
[
16,
18
],
[
0,
19
],
[
19,
20
],
[
19,
21
],
[
0,
22
],
[
182,
23
],
[
182,
24
],
[
24,
25
],
[
24,
26
],
[
26,
27
],
[
27,
28
],
[
27,
29
],
[
26,
30
],
[
30,
31
],
[
30,
32
],
[
32,
33
],
[
33,
34
],
[
34,
35
],
[
35,
36
],
[
32,
37
],
[
26,
38
],
[
38,
39
],
[
38,
40
],
[
26,
41
],
[
41,
42
],
[
41,
43
],
[
26,
44
],
[
44,
45
],
[
44,
46
],
[
26,
47
],
[
47,
48
],
[
48,
49
],
[
49,
50
],
[
49,
51
],
[
47,
52
],
[
52,
53
],
[
52,
54
],
[
54,
55
],
[
54,
56
],
[
47,
57
],
[
57,
58
],
[
58,
59
],
[
47,
60
],
[
61,
61
],
[
61,
62
],
[
62,
63
],
[
63,
64
],
[
64,
65
],
[
65,
66
],
[
65,
67
],
[
63,
68
],
[
62,
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
],
[
80,
83
],
[
83,
84
],
[
83,
85
],
[
69,
86
],
[
61,
87
],
[
87,
88
],
[
88,
89
],
[
89,
90
],
[
90,
91
],
[
90,
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
],
[
94,
111
],
[
61,
112
],
[
112,
113
],
[
113,
114
],
[
114,
115
],
[
115,
116
],
[
115,
117
],
[
113,
118
],
[
112,
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
],
[
61,
137
],
[
137,
138
],
[
138,
139
],
[
139,
140
],
[
140,
141
],
[
140,
142
],
[
138,
143
],
[
137,
144
],
[
144,
145
],
[
145,
146
],
[
145,
147
],
[
147,
148
],
[
148,
149
],
[
144,
150
],
[
150,
151
],
[
150,
152
],
[
152,
153
],
[
153,
154
],
[
144,
155
],
[
155,
156
],
[
156,
157
],
[
155,
158
],
[
158,
159
],
[
158,
160
],
[
144,
161
],
[
61,
162
],
[
162,
163
],
[
163,
164
],
[
162,
165
],
[
165,
166
],
[
166,
167
],
[
165,
168
],
[
168,
169
],
[
168,
170
],
[
26,
171
],
[
171,
172
],
[
172,
173
],
[
173,
174
],
[
173,
175
],
[
171,
176
],
[
176,
177
],
[
177,
178
],
[
24,
179
],
[
179,
180
],
[
0,
181
],
[
181,
182
],
[
181,
183
]
] | [
"import java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\nimport java.util.ArrayDeque;\nimport java.util.LinkedList;\nimport java.util.Queue;\nimport java.util.Stack;\n\npublic class Main {\n\n\tpublic static void main(String args[]) throws IOException {\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tString[] stringArray = br.readLine().split(\"\\\\s\");\n\n\t\tStack<Integer> que = new Stack<Integer>();\n\t\tint a = 0;\n\t\tint b = 0;\n\t\tfor (int i = 0; i < stringArray.length; i++) {\n\t\t\tif (stringArray[i].equals(\"+\")) {\n\t\t\t\ta = que.pop();\n\t\t\t\tb = que.pop();\n\t\t\t\tque.add(b + a);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (stringArray[i].equals(\"-\")) {\n\t\t\t\ta = que.pop();\n\t\t\t\tb = que.pop();\n\t\t\t\tque.add(b - a);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (stringArray[i].equals(\"*\")) {\n\t\t\t\ta = que.pop();\n\t\t\t\tb = que.pop();\n\t\t\t\tque.add(b * a);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (stringArray[i].equals(\"/\")) {\n\t\t\t\ta = que.pop();\n\t\t\t\tb = que.pop();\n\t\t\t\tque.add(b + a);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tque.push(Integer.parseInt(stringArray[i]));\n\t\t}\n\t\tSystem.out.println(que.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",
"import java.util.ArrayDeque;",
"ArrayDeque",
"java.util",
"import java.util.LinkedList;",
"LinkedList",
"java.util",
"import java.util.Queue;",
"Queue",
"java.util",
"import java.util.Stack;",
"Stack",
"java.util",
"public class Main {\n\n\tpublic static void main(String args[]) throws IOException {\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tString[] stringArray = br.readLine().split(\"\\\\s\");\n\n\t\tStack<Integer> que = new Stack<Integer>();\n\t\tint a = 0;\n\t\tint b = 0;\n\t\tfor (int i = 0; i < stringArray.length; i++) {\n\t\t\tif (stringArray[i].equals(\"+\")) {\n\t\t\t\ta = que.pop();\n\t\t\t\tb = que.pop();\n\t\t\t\tque.add(b + a);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (stringArray[i].equals(\"-\")) {\n\t\t\t\ta = que.pop();\n\t\t\t\tb = que.pop();\n\t\t\t\tque.add(b - a);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (stringArray[i].equals(\"*\")) {\n\t\t\t\ta = que.pop();\n\t\t\t\tb = que.pop();\n\t\t\t\tque.add(b * a);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (stringArray[i].equals(\"/\")) {\n\t\t\t\ta = que.pop();\n\t\t\t\tb = que.pop();\n\t\t\t\tque.add(b + a);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tque.push(Integer.parseInt(stringArray[i]));\n\t\t}\n\t\tSystem.out.println(que.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[] stringArray = br.readLine().split(\"\\\\s\");\n\n\t\tStack<Integer> que = new Stack<Integer>();\n\t\tint a = 0;\n\t\tint b = 0;\n\t\tfor (int i = 0; i < stringArray.length; i++) {\n\t\t\tif (stringArray[i].equals(\"+\")) {\n\t\t\t\ta = que.pop();\n\t\t\t\tb = que.pop();\n\t\t\t\tque.add(b + a);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (stringArray[i].equals(\"-\")) {\n\t\t\t\ta = que.pop();\n\t\t\t\tb = que.pop();\n\t\t\t\tque.add(b - a);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (stringArray[i].equals(\"*\")) {\n\t\t\t\ta = que.pop();\n\t\t\t\tb = que.pop();\n\t\t\t\tque.add(b * a);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (stringArray[i].equals(\"/\")) {\n\t\t\t\ta = que.pop();\n\t\t\t\tb = que.pop();\n\t\t\t\tque.add(b + a);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tque.push(Integer.parseInt(stringArray[i]));\n\t\t}\n\t\tSystem.out.println(que.pop());\n\t}",
"main",
"{\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tString[] stringArray = br.readLine().split(\"\\\\s\");\n\n\t\tStack<Integer> que = new Stack<Integer>();\n\t\tint a = 0;\n\t\tint b = 0;\n\t\tfor (int i = 0; i < stringArray.length; i++) {\n\t\t\tif (stringArray[i].equals(\"+\")) {\n\t\t\t\ta = que.pop();\n\t\t\t\tb = que.pop();\n\t\t\t\tque.add(b + a);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (stringArray[i].equals(\"-\")) {\n\t\t\t\ta = que.pop();\n\t\t\t\tb = que.pop();\n\t\t\t\tque.add(b - a);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (stringArray[i].equals(\"*\")) {\n\t\t\t\ta = que.pop();\n\t\t\t\tb = que.pop();\n\t\t\t\tque.add(b * a);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (stringArray[i].equals(\"/\")) {\n\t\t\t\ta = que.pop();\n\t\t\t\tb = que.pop();\n\t\t\t\tque.add(b + a);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tque.push(Integer.parseInt(stringArray[i]));\n\t\t}\n\t\tSystem.out.println(que.pop());\n\t}",
"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\t\t\tif (stringArray[i].equals(\"+\")) {\n\t\t\t\ta = que.pop();\n\t\t\t\tb = que.pop();\n\t\t\t\tque.add(b + a);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (stringArray[i].equals(\"-\")) {\n\t\t\t\ta = que.pop();\n\t\t\t\tb = que.pop();\n\t\t\t\tque.add(b - a);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (stringArray[i].equals(\"*\")) {\n\t\t\t\ta = que.pop();\n\t\t\t\tb = que.pop();\n\t\t\t\tque.add(b * a);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (stringArray[i].equals(\"/\")) {\n\t\t\t\ta = que.pop();\n\t\t\t\tb = que.pop();\n\t\t\t\tque.add(b + a);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tque.push(Integer.parseInt(stringArray[i]));\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < stringArray.length",
"i",
"stringArray.length",
"stringArray",
"stringArray.length",
"i++",
"i++",
"i",
"{\n\t\t\tif (stringArray[i].equals(\"+\")) {\n\t\t\t\ta = que.pop();\n\t\t\t\tb = que.pop();\n\t\t\t\tque.add(b + a);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (stringArray[i].equals(\"-\")) {\n\t\t\t\ta = que.pop();\n\t\t\t\tb = que.pop();\n\t\t\t\tque.add(b - a);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (stringArray[i].equals(\"*\")) {\n\t\t\t\ta = que.pop();\n\t\t\t\tb = que.pop();\n\t\t\t\tque.add(b * a);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (stringArray[i].equals(\"/\")) {\n\t\t\t\ta = que.pop();\n\t\t\t\tb = que.pop();\n\t\t\t\tque.add(b + a);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tque.push(Integer.parseInt(stringArray[i]));\n\t\t}",
"{\n\t\t\tif (stringArray[i].equals(\"+\")) {\n\t\t\t\ta = que.pop();\n\t\t\t\tb = que.pop();\n\t\t\t\tque.add(b + a);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (stringArray[i].equals(\"-\")) {\n\t\t\t\ta = que.pop();\n\t\t\t\tb = que.pop();\n\t\t\t\tque.add(b - a);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (stringArray[i].equals(\"*\")) {\n\t\t\t\ta = que.pop();\n\t\t\t\tb = que.pop();\n\t\t\t\tque.add(b * a);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (stringArray[i].equals(\"/\")) {\n\t\t\t\ta = que.pop();\n\t\t\t\tb = que.pop();\n\t\t\t\tque.add(b + a);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tque.push(Integer.parseInt(stringArray[i]));\n\t\t}",
"if (stringArray[i].equals(\"+\")) {\n\t\t\t\ta = que.pop();\n\t\t\t\tb = que.pop();\n\t\t\t\tque.add(b + a);\n\t\t\t\tcontinue;\n\t\t\t}",
"stringArray[i].equals(\"+\")",
"stringArray[i].equals",
"stringArray[i]",
"stringArray",
"i",
"\"+\"",
"{\n\t\t\t\ta = que.pop();\n\t\t\t\tb = que.pop();\n\t\t\t\tque.add(b + a);\n\t\t\t\tcontinue;\n\t\t\t}",
"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\t\t\t\ta = que.pop();\n\t\t\t\tb = que.pop();\n\t\t\t\tque.add(b - a);\n\t\t\t\tcontinue;\n\t\t\t}",
"stringArray[i].equals(\"-\")",
"stringArray[i].equals",
"stringArray[i]",
"stringArray",
"i",
"\"-\"",
"{\n\t\t\t\ta = que.pop();\n\t\t\t\tb = que.pop();\n\t\t\t\tque.add(b - a);\n\t\t\t\tcontinue;\n\t\t\t}",
"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\t\t\t\ta = que.pop();\n\t\t\t\tb = que.pop();\n\t\t\t\tque.add(b * a);\n\t\t\t\tcontinue;\n\t\t\t}",
"stringArray[i].equals(\"*\")",
"stringArray[i].equals",
"stringArray[i]",
"stringArray",
"i",
"\"*\"",
"{\n\t\t\t\ta = que.pop();\n\t\t\t\tb = que.pop();\n\t\t\t\tque.add(b * a);\n\t\t\t\tcontinue;\n\t\t\t}",
"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\t\t\t\ta = que.pop();\n\t\t\t\tb = que.pop();\n\t\t\t\tque.add(b + a);\n\t\t\t\tcontinue;\n\t\t\t}",
"stringArray[i].equals(\"/\")",
"stringArray[i].equals",
"stringArray[i]",
"stringArray",
"i",
"\"/\"",
"{\n\t\t\t\ta = que.pop();\n\t\t\t\tb = que.pop();\n\t\t\t\tque.add(b + a);\n\t\t\t\tcontinue;\n\t\t\t}",
"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\tpublic static void main(String args[]) throws IOException {\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tString[] stringArray = br.readLine().split(\"\\\\s\");\n\n\t\tStack<Integer> que = new Stack<Integer>();\n\t\tint a = 0;\n\t\tint b = 0;\n\t\tfor (int i = 0; i < stringArray.length; i++) {\n\t\t\tif (stringArray[i].equals(\"+\")) {\n\t\t\t\ta = que.pop();\n\t\t\t\tb = que.pop();\n\t\t\t\tque.add(b + a);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (stringArray[i].equals(\"-\")) {\n\t\t\t\ta = que.pop();\n\t\t\t\tb = que.pop();\n\t\t\t\tque.add(b - a);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (stringArray[i].equals(\"*\")) {\n\t\t\t\ta = que.pop();\n\t\t\t\tb = que.pop();\n\t\t\t\tque.add(b * a);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (stringArray[i].equals(\"/\")) {\n\t\t\t\ta = que.pop();\n\t\t\t\tb = que.pop();\n\t\t\t\tque.add(b + a);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tque.push(Integer.parseInt(stringArray[i]));\n\t\t}\n\t\tSystem.out.println(que.pop());\n\t}\n}",
"public class Main {\n\n\tpublic static void main(String args[]) throws IOException {\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tString[] stringArray = br.readLine().split(\"\\\\s\");\n\n\t\tStack<Integer> que = new Stack<Integer>();\n\t\tint a = 0;\n\t\tint b = 0;\n\t\tfor (int i = 0; i < stringArray.length; i++) {\n\t\t\tif (stringArray[i].equals(\"+\")) {\n\t\t\t\ta = que.pop();\n\t\t\t\tb = que.pop();\n\t\t\t\tque.add(b + a);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (stringArray[i].equals(\"-\")) {\n\t\t\t\ta = que.pop();\n\t\t\t\tb = que.pop();\n\t\t\t\tque.add(b - a);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (stringArray[i].equals(\"*\")) {\n\t\t\t\ta = que.pop();\n\t\t\t\tb = que.pop();\n\t\t\t\tque.add(b * a);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (stringArray[i].equals(\"/\")) {\n\t\t\t\ta = que.pop();\n\t\t\t\tb = que.pop();\n\t\t\t\tque.add(b + a);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tque.push(Integer.parseInt(stringArray[i]));\n\t\t}\n\t\tSystem.out.println(que.pop());\n\t}\n}",
"Main"
] | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayDeque;
import java.util.LinkedList;
import java.util.Queue;
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;
}
que.push(Integer.parseInt(stringArray[i]));
}
System.out.println(que.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,
12,
13,
30,
41,
13,
20,
41,
13,
20,
42,
4,
18,
13,
30,
4,
18,
13,
4,
18,
13,
41,
13,
20,
42,
40,
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,
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,
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
],
[
168,
26
],
[
168,
27
],
[
27,
28
],
[
27,
29
],
[
29,
30
],
[
30,
31
],
[
30,
32
],
[
29,
33
],
[
33,
34
],
[
33,
35
],
[
29,
36
],
[
36,
37
],
[
37,
38
],
[
38,
39
],
[
36,
40
],
[
40,
41
],
[
41,
42
],
[
42,
43
],
[
41,
44
],
[
44,
45
],
[
45,
46
],
[
29,
47
],
[
47,
48
],
[
47,
49
],
[
29,
50
],
[
50,
51
],
[
51,
52
],
[
52,
53
],
[
53,
54
],
[
50,
55
],
[
55,
56
],
[
56,
57
],
[
56,
58
],
[
58,
59
],
[
59,
60
],
[
55,
61
],
[
61,
62
],
[
62,
63
],
[
63,
64
],
[
62,
65
],
[
61,
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
],
[
78,
79
],
[
77,
80
],
[
80,
81
],
[
80,
82
],
[
61,
83
],
[
83,
84
],
[
84,
85
],
[
85,
86
],
[
84,
87
],
[
83,
88
],
[
88,
89
],
[
89,
90
],
[
89,
91
],
[
91,
92
],
[
92,
93
],
[
88,
94
],
[
94,
95
],
[
94,
96
],
[
96,
97
],
[
97,
98
],
[
88,
99
],
[
99,
100
],
[
100,
101
],
[
99,
102
],
[
102,
103
],
[
102,
104
],
[
83,
105
],
[
105,
106
],
[
106,
107
],
[
107,
108
],
[
106,
109
],
[
105,
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
],
[
105,
127
],
[
127,
128
],
[
128,
129
],
[
129,
130
],
[
128,
131
],
[
127,
132
],
[
132,
133
],
[
133,
134
],
[
133,
135
],
[
135,
136
],
[
136,
137
],
[
132,
138
],
[
138,
139
],
[
138,
140
],
[
140,
141
],
[
141,
142
],
[
132,
143
],
[
143,
144
],
[
144,
145
],
[
143,
146
],
[
146,
147
],
[
146,
148
],
[
127,
149
],
[
149,
150
],
[
150,
151
],
[
151,
152
],
[
150,
153
],
[
153,
154
],
[
154,
155
],
[
153,
156
],
[
29,
157
],
[
157,
158
],
[
158,
159
],
[
159,
160
],
[
159,
161
],
[
157,
162
],
[
162,
163
],
[
163,
164
],
[
27,
165
],
[
165,
166
],
[
0,
167
],
[
167,
168
],
[
167,
169
]
] | [
"import java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\nimport java.util.Arrays;\nimport java.util.HashMap;\nimport java.util.LinkedList;\nimport java.util.Map;\nimport java.util.Scanner;\n\npublic class Main {\n\t\n\tpublic static void main(String args[]) {\n\t\tScanner sc = new Scanner(System.in);\n\t\t\n\t\tLinkedList<String> input = new LinkedList<String>();\n\t\twhile(sc.hasNext()){\n\t\t\tinput.addLast(sc.next());\n\t\t}\n\t\t\n\t\tLinkedList<Integer> stack = new LinkedList<Integer>();\n\t\twhile(!input.isEmpty()){\n\t\t\tString ops = input.poll();\n\t\t\t\n\t\t\tif(\"+\".equals(ops)){\n\t\t\t\tfinal int a = stack.poll();\n\t\t\t\tfinal int b = stack.poll();\n\t\t\t\tstack.addFirst(b + a);\t\t\t\t\n\t\t\t}else if(\"-\".equals(ops)){\n\t\t\t\tfinal int a = stack.poll();\n\t\t\t\tfinal int b = stack.poll();\n\t\t\t\tstack.addFirst(b - a);\n\t\t\t}else if(\"*\".equals(ops)){\n\t\t\t\tfinal int a = stack.poll();\n\t\t\t\tfinal int b = stack.poll();\n\t\t\t\tstack.addFirst(b * a);\n\t\t\t}else if(\"/\".equals(ops)){\n\t\t\t\tfinal int a = stack.poll();\n\t\t\t\tfinal int b = stack.poll();\n\t\t\t\tstack.addFirst(b / a);\n\t\t\t}else{\n\t\t\t\tstack.addFirst(Integer.parseInt(ops));\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.BufferedReader;",
"BufferedReader",
"java.io",
"import java.io.IOException;",
"IOException",
"java.io",
"import java.io.InputStreamReader;",
"InputStreamReader",
"java.io",
"import java.util.Arrays;",
"Arrays",
"java.util",
"import java.util.HashMap;",
"HashMap",
"java.util",
"import java.util.LinkedList;",
"LinkedList",
"java.util",
"import java.util.Map;",
"Map",
"java.util",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\t\n\tpublic static void main(String args[]) {\n\t\tScanner sc = new Scanner(System.in);\n\t\t\n\t\tLinkedList<String> input = new LinkedList<String>();\n\t\twhile(sc.hasNext()){\n\t\t\tinput.addLast(sc.next());\n\t\t}\n\t\t\n\t\tLinkedList<Integer> stack = new LinkedList<Integer>();\n\t\twhile(!input.isEmpty()){\n\t\t\tString ops = input.poll();\n\t\t\t\n\t\t\tif(\"+\".equals(ops)){\n\t\t\t\tfinal int a = stack.poll();\n\t\t\t\tfinal int b = stack.poll();\n\t\t\t\tstack.addFirst(b + a);\t\t\t\t\n\t\t\t}else if(\"-\".equals(ops)){\n\t\t\t\tfinal int a = stack.poll();\n\t\t\t\tfinal int b = stack.poll();\n\t\t\t\tstack.addFirst(b - a);\n\t\t\t}else if(\"*\".equals(ops)){\n\t\t\t\tfinal int a = stack.poll();\n\t\t\t\tfinal int b = stack.poll();\n\t\t\t\tstack.addFirst(b * a);\n\t\t\t}else if(\"/\".equals(ops)){\n\t\t\t\tfinal int a = stack.poll();\n\t\t\t\tfinal int b = stack.poll();\n\t\t\t\tstack.addFirst(b / a);\n\t\t\t}else{\n\t\t\t\tstack.addFirst(Integer.parseInt(ops));\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[]) {\n\t\tScanner sc = new Scanner(System.in);\n\t\t\n\t\tLinkedList<String> input = new LinkedList<String>();\n\t\twhile(sc.hasNext()){\n\t\t\tinput.addLast(sc.next());\n\t\t}\n\t\t\n\t\tLinkedList<Integer> stack = new LinkedList<Integer>();\n\t\twhile(!input.isEmpty()){\n\t\t\tString ops = input.poll();\n\t\t\t\n\t\t\tif(\"+\".equals(ops)){\n\t\t\t\tfinal int a = stack.poll();\n\t\t\t\tfinal int b = stack.poll();\n\t\t\t\tstack.addFirst(b + a);\t\t\t\t\n\t\t\t}else if(\"-\".equals(ops)){\n\t\t\t\tfinal int a = stack.poll();\n\t\t\t\tfinal int b = stack.poll();\n\t\t\t\tstack.addFirst(b - a);\n\t\t\t}else if(\"*\".equals(ops)){\n\t\t\t\tfinal int a = stack.poll();\n\t\t\t\tfinal int b = stack.poll();\n\t\t\t\tstack.addFirst(b * a);\n\t\t\t}else if(\"/\".equals(ops)){\n\t\t\t\tfinal int a = stack.poll();\n\t\t\t\tfinal int b = stack.poll();\n\t\t\t\tstack.addFirst(b / a);\n\t\t\t}else{\n\t\t\t\tstack.addFirst(Integer.parseInt(ops));\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\tScanner sc = new Scanner(System.in);\n\t\t\n\t\tLinkedList<String> input = new LinkedList<String>();\n\t\twhile(sc.hasNext()){\n\t\t\tinput.addLast(sc.next());\n\t\t}\n\t\t\n\t\tLinkedList<Integer> stack = new LinkedList<Integer>();\n\t\twhile(!input.isEmpty()){\n\t\t\tString ops = input.poll();\n\t\t\t\n\t\t\tif(\"+\".equals(ops)){\n\t\t\t\tfinal int a = stack.poll();\n\t\t\t\tfinal int b = stack.poll();\n\t\t\t\tstack.addFirst(b + a);\t\t\t\t\n\t\t\t}else if(\"-\".equals(ops)){\n\t\t\t\tfinal int a = stack.poll();\n\t\t\t\tfinal int b = stack.poll();\n\t\t\t\tstack.addFirst(b - a);\n\t\t\t}else if(\"*\".equals(ops)){\n\t\t\t\tfinal int a = stack.poll();\n\t\t\t\tfinal int b = stack.poll();\n\t\t\t\tstack.addFirst(b * a);\n\t\t\t}else if(\"/\".equals(ops)){\n\t\t\t\tfinal int a = stack.poll();\n\t\t\t\tfinal int b = stack.poll();\n\t\t\t\tstack.addFirst(b / a);\n\t\t\t}else{\n\t\t\t\tstack.addFirst(Integer.parseInt(ops));\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(stack.poll());\n\t\t\n\t}",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"LinkedList<String> input = new LinkedList<String>();",
"input",
"new LinkedList<String>()",
"while(sc.hasNext()){\n\t\t\tinput.addLast(sc.next());\n\t\t}",
"sc.hasNext()",
"sc.hasNext",
"sc",
"{\n\t\t\tinput.addLast(sc.next());\n\t\t}",
"input.addLast(sc.next())",
"input.addLast",
"input",
"sc.next()",
"sc.next",
"sc",
"LinkedList<Integer> stack = new LinkedList<Integer>();",
"stack",
"new LinkedList<Integer>()",
"while(!input.isEmpty()){\n\t\t\tString ops = input.poll();\n\t\t\t\n\t\t\tif(\"+\".equals(ops)){\n\t\t\t\tfinal int a = stack.poll();\n\t\t\t\tfinal int b = stack.poll();\n\t\t\t\tstack.addFirst(b + a);\t\t\t\t\n\t\t\t}else if(\"-\".equals(ops)){\n\t\t\t\tfinal int a = stack.poll();\n\t\t\t\tfinal int b = stack.poll();\n\t\t\t\tstack.addFirst(b - a);\n\t\t\t}else if(\"*\".equals(ops)){\n\t\t\t\tfinal int a = stack.poll();\n\t\t\t\tfinal int b = stack.poll();\n\t\t\t\tstack.addFirst(b * a);\n\t\t\t}else if(\"/\".equals(ops)){\n\t\t\t\tfinal int a = stack.poll();\n\t\t\t\tfinal int b = stack.poll();\n\t\t\t\tstack.addFirst(b / a);\n\t\t\t}else{\n\t\t\t\tstack.addFirst(Integer.parseInt(ops));\n\t\t\t}\n\t\t}",
"!input.isEmpty()",
"input.isEmpty()",
"input.isEmpty",
"input",
"{\n\t\t\tString ops = input.poll();\n\t\t\t\n\t\t\tif(\"+\".equals(ops)){\n\t\t\t\tfinal int a = stack.poll();\n\t\t\t\tfinal int b = stack.poll();\n\t\t\t\tstack.addFirst(b + a);\t\t\t\t\n\t\t\t}else if(\"-\".equals(ops)){\n\t\t\t\tfinal int a = stack.poll();\n\t\t\t\tfinal int b = stack.poll();\n\t\t\t\tstack.addFirst(b - a);\n\t\t\t}else if(\"*\".equals(ops)){\n\t\t\t\tfinal int a = stack.poll();\n\t\t\t\tfinal int b = stack.poll();\n\t\t\t\tstack.addFirst(b * a);\n\t\t\t}else if(\"/\".equals(ops)){\n\t\t\t\tfinal int a = stack.poll();\n\t\t\t\tfinal int b = stack.poll();\n\t\t\t\tstack.addFirst(b / a);\n\t\t\t}else{\n\t\t\t\tstack.addFirst(Integer.parseInt(ops));\n\t\t\t}\n\t\t}",
"String ops = input.poll();",
"ops",
"input.poll()",
"input.poll",
"input",
"if(\"+\".equals(ops)){\n\t\t\t\tfinal int a = stack.poll();\n\t\t\t\tfinal int b = stack.poll();\n\t\t\t\tstack.addFirst(b + a);\t\t\t\t\n\t\t\t}else if(\"-\".equals(ops)){\n\t\t\t\tfinal int a = stack.poll();\n\t\t\t\tfinal int b = stack.poll();\n\t\t\t\tstack.addFirst(b - a);\n\t\t\t}else if(\"*\".equals(ops)){\n\t\t\t\tfinal int a = stack.poll();\n\t\t\t\tfinal int b = stack.poll();\n\t\t\t\tstack.addFirst(b * a);\n\t\t\t}else if(\"/\".equals(ops)){\n\t\t\t\tfinal int a = stack.poll();\n\t\t\t\tfinal int b = stack.poll();\n\t\t\t\tstack.addFirst(b / a);\n\t\t\t}else{\n\t\t\t\tstack.addFirst(Integer.parseInt(ops));\n\t\t\t}",
"\"+\".equals(ops)",
"\"+\".equals",
"\"+\"",
"ops",
"{\n\t\t\t\tfinal int a = stack.poll();\n\t\t\t\tfinal int b = stack.poll();\n\t\t\t\tstack.addFirst(b + a);\t\t\t\t\n\t\t\t}",
"final int a = stack.poll();",
"a",
"stack.poll()",
"stack.poll",
"stack",
"final int b = stack.poll();",
"b",
"stack.poll()",
"stack.poll",
"stack",
"stack.addFirst(b + a)",
"stack.addFirst",
"stack",
"b + a",
"b",
"a",
"if(\"-\".equals(ops)){\n\t\t\t\tfinal int a = stack.poll();\n\t\t\t\tfinal int b = stack.poll();\n\t\t\t\tstack.addFirst(b - a);\n\t\t\t}else if(\"*\".equals(ops)){\n\t\t\t\tfinal int a = stack.poll();\n\t\t\t\tfinal int b = stack.poll();\n\t\t\t\tstack.addFirst(b * a);\n\t\t\t}else if(\"/\".equals(ops)){\n\t\t\t\tfinal int a = stack.poll();\n\t\t\t\tfinal int b = stack.poll();\n\t\t\t\tstack.addFirst(b / a);\n\t\t\t}else{\n\t\t\t\tstack.addFirst(Integer.parseInt(ops));\n\t\t\t}",
"\"-\".equals(ops)",
"\"-\".equals",
"\"-\"",
"ops",
"{\n\t\t\t\tfinal int a = stack.poll();\n\t\t\t\tfinal int b = stack.poll();\n\t\t\t\tstack.addFirst(b - a);\n\t\t\t}",
"final int a = stack.poll();",
"a",
"stack.poll()",
"stack.poll",
"stack",
"final int b = stack.poll();",
"b",
"stack.poll()",
"stack.poll",
"stack",
"stack.addFirst(b - a)",
"stack.addFirst",
"stack",
"b - a",
"b",
"a",
"if(\"*\".equals(ops)){\n\t\t\t\tfinal int a = stack.poll();\n\t\t\t\tfinal int b = stack.poll();\n\t\t\t\tstack.addFirst(b * a);\n\t\t\t}else if(\"/\".equals(ops)){\n\t\t\t\tfinal int a = stack.poll();\n\t\t\t\tfinal int b = stack.poll();\n\t\t\t\tstack.addFirst(b / a);\n\t\t\t}else{\n\t\t\t\tstack.addFirst(Integer.parseInt(ops));\n\t\t\t}",
"\"*\".equals(ops)",
"\"*\".equals",
"\"*\"",
"ops",
"{\n\t\t\t\tfinal int a = stack.poll();\n\t\t\t\tfinal int b = stack.poll();\n\t\t\t\tstack.addFirst(b * a);\n\t\t\t}",
"final int a = stack.poll();",
"a",
"stack.poll()",
"stack.poll",
"stack",
"final int b = stack.poll();",
"b",
"stack.poll()",
"stack.poll",
"stack",
"stack.addFirst(b * a)",
"stack.addFirst",
"stack",
"b * a",
"b",
"a",
"if(\"/\".equals(ops)){\n\t\t\t\tfinal int a = stack.poll();\n\t\t\t\tfinal int b = stack.poll();\n\t\t\t\tstack.addFirst(b / a);\n\t\t\t}else{\n\t\t\t\tstack.addFirst(Integer.parseInt(ops));\n\t\t\t}",
"\"/\".equals(ops)",
"\"/\".equals",
"\"/\"",
"ops",
"{\n\t\t\t\tfinal int a = stack.poll();\n\t\t\t\tfinal int b = stack.poll();\n\t\t\t\tstack.addFirst(b / a);\n\t\t\t}",
"final int a = stack.poll();",
"a",
"stack.poll()",
"stack.poll",
"stack",
"final int b = stack.poll();",
"b",
"stack.poll()",
"stack.poll",
"stack",
"stack.addFirst(b / a)",
"stack.addFirst",
"stack",
"b / a",
"b",
"a",
"{\n\t\t\t\tstack.addFirst(Integer.parseInt(ops));\n\t\t\t}",
"stack.addFirst(Integer.parseInt(ops))",
"stack.addFirst",
"stack",
"Integer.parseInt(ops)",
"Integer.parseInt",
"Integer",
"ops",
"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\t\n\tpublic static void main(String args[]) {\n\t\tScanner sc = new Scanner(System.in);\n\t\t\n\t\tLinkedList<String> input = new LinkedList<String>();\n\t\twhile(sc.hasNext()){\n\t\t\tinput.addLast(sc.next());\n\t\t}\n\t\t\n\t\tLinkedList<Integer> stack = new LinkedList<Integer>();\n\t\twhile(!input.isEmpty()){\n\t\t\tString ops = input.poll();\n\t\t\t\n\t\t\tif(\"+\".equals(ops)){\n\t\t\t\tfinal int a = stack.poll();\n\t\t\t\tfinal int b = stack.poll();\n\t\t\t\tstack.addFirst(b + a);\t\t\t\t\n\t\t\t}else if(\"-\".equals(ops)){\n\t\t\t\tfinal int a = stack.poll();\n\t\t\t\tfinal int b = stack.poll();\n\t\t\t\tstack.addFirst(b - a);\n\t\t\t}else if(\"*\".equals(ops)){\n\t\t\t\tfinal int a = stack.poll();\n\t\t\t\tfinal int b = stack.poll();\n\t\t\t\tstack.addFirst(b * a);\n\t\t\t}else if(\"/\".equals(ops)){\n\t\t\t\tfinal int a = stack.poll();\n\t\t\t\tfinal int b = stack.poll();\n\t\t\t\tstack.addFirst(b / a);\n\t\t\t}else{\n\t\t\t\tstack.addFirst(Integer.parseInt(ops));\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\t\n\tpublic static void main(String args[]) {\n\t\tScanner sc = new Scanner(System.in);\n\t\t\n\t\tLinkedList<String> input = new LinkedList<String>();\n\t\twhile(sc.hasNext()){\n\t\t\tinput.addLast(sc.next());\n\t\t}\n\t\t\n\t\tLinkedList<Integer> stack = new LinkedList<Integer>();\n\t\twhile(!input.isEmpty()){\n\t\t\tString ops = input.poll();\n\t\t\t\n\t\t\tif(\"+\".equals(ops)){\n\t\t\t\tfinal int a = stack.poll();\n\t\t\t\tfinal int b = stack.poll();\n\t\t\t\tstack.addFirst(b + a);\t\t\t\t\n\t\t\t}else if(\"-\".equals(ops)){\n\t\t\t\tfinal int a = stack.poll();\n\t\t\t\tfinal int b = stack.poll();\n\t\t\t\tstack.addFirst(b - a);\n\t\t\t}else if(\"*\".equals(ops)){\n\t\t\t\tfinal int a = stack.poll();\n\t\t\t\tfinal int b = stack.poll();\n\t\t\t\tstack.addFirst(b * a);\n\t\t\t}else if(\"/\".equals(ops)){\n\t\t\t\tfinal int a = stack.poll();\n\t\t\t\tfinal int b = stack.poll();\n\t\t\t\tstack.addFirst(b / a);\n\t\t\t}else{\n\t\t\t\tstack.addFirst(Integer.parseInt(ops));\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.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.Map;
import java.util.Scanner;
public class Main {
public static void main(String args[]) {
Scanner sc = new Scanner(System.in);
LinkedList<String> input = new LinkedList<String>();
while(sc.hasNext()){
input.addLast(sc.next());
}
LinkedList<Integer> stack = new LinkedList<Integer>();
while(!input.isEmpty()){
String ops = input.poll();
if("+".equals(ops)){
final int a = stack.poll();
final int b = stack.poll();
stack.addFirst(b + a);
}else if("-".equals(ops)){
final int a = stack.poll();
final int b = stack.poll();
stack.addFirst(b - a);
}else if("*".equals(ops)){
final int a = stack.poll();
final int b = stack.poll();
stack.addFirst(b * a);
}else if("/".equals(ops)){
final int a = stack.poll();
final int b = stack.poll();
stack.addFirst(b / a);
}else{
stack.addFirst(Integer.parseInt(ops));
}
}
System.out.println(stack.poll());
}
} |
[
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,
14,
2,
2,
40,
4,
18,
18,
13,
13,
17,
40,
4,
18,
18,
13,
13,
17,
40,
4,
18,
18,
13,
13,
17,
30,
41,
13,
4,
18,
13,
18,
13,
13,
4,
18,
13,
13,
30,
41,
13,
4,
18,
13,
2,
4,
18,
13,
17,
4,
18,
13,
2,
4,
18,
13,
17,
41,
13,
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,
13,
13,
14,
4,
18,
18,
13,
13,
17,
30,
4,
18,
13,
2,
13,
13,
14,
4,
18,
18,
13,
13,
17,
30,
4,
18,
13,
2,
13,
13,
4,
18,
18,
13,
13,
4,
18,
13,
2,
4,
18,
13,
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
],
[
179,
11
],
[
179,
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
],
[
49,
49
],
[
49,
50
],
[
50,
51
],
[
51,
52
],
[
52,
53
],
[
53,
54
],
[
53,
55
],
[
51,
56
],
[
49,
57
],
[
57,
58
],
[
58,
59
],
[
59,
60
],
[
60,
61
],
[
60,
62
],
[
58,
63
],
[
49,
64
],
[
64,
65
],
[
65,
66
],
[
66,
67
],
[
67,
68
],
[
67,
69
],
[
65,
70
],
[
47,
71
],
[
71,
72
],
[
72,
73
],
[
72,
74
],
[
74,
75
],
[
75,
76
],
[
74,
77
],
[
77,
78
],
[
77,
79
],
[
71,
80
],
[
80,
81
],
[
81,
82
],
[
80,
83
],
[
47,
84
],
[
84,
85
],
[
85,
86
],
[
85,
87
],
[
87,
88
],
[
88,
89
],
[
87,
90
],
[
90,
91
],
[
91,
92
],
[
92,
93
],
[
90,
94
],
[
84,
95
],
[
95,
96
],
[
96,
97
],
[
95,
98
],
[
98,
99
],
[
99,
100
],
[
100,
101
],
[
98,
102
],
[
84,
103
],
[
103,
104
],
[
103,
105
],
[
105,
106
],
[
106,
107
],
[
105,
108
],
[
108,
109
],
[
109,
110
],
[
110,
111
],
[
108,
112
],
[
84,
113
],
[
113,
114
],
[
114,
115
],
[
113,
116
],
[
116,
117
],
[
117,
118
],
[
118,
119
],
[
116,
120
],
[
84,
121
],
[
121,
122
],
[
122,
123
],
[
123,
124
],
[
124,
125
],
[
124,
126
],
[
122,
127
],
[
121,
128
],
[
128,
129
],
[
129,
130
],
[
130,
131
],
[
129,
132
],
[
132,
133
],
[
132,
134
],
[
121,
135
],
[
135,
136
],
[
136,
137
],
[
137,
138
],
[
138,
139
],
[
138,
140
],
[
136,
141
],
[
135,
142
],
[
142,
143
],
[
143,
144
],
[
144,
145
],
[
143,
146
],
[
146,
147
],
[
146,
148
],
[
135,
149
],
[
149,
150
],
[
150,
151
],
[
151,
152
],
[
152,
153
],
[
152,
154
],
[
150,
155
],
[
149,
156
],
[
156,
157
],
[
157,
158
],
[
158,
159
],
[
157,
160
],
[
160,
161
],
[
160,
162
],
[
14,
163
],
[
163,
164
],
[
164,
165
],
[
165,
166
],
[
165,
167
],
[
163,
168
],
[
168,
169
],
[
169,
170
],
[
168,
171
],
[
171,
172
],
[
172,
173
],
[
173,
174
],
[
171,
175
],
[
12,
176
],
[
176,
177
],
[
0,
178
],
[
178,
179
],
[
178,
180
]
] | [
"import java.io.BufferedReader;\nimport java.io.InputStreamReader;\nimport java.util.ArrayList;\n\npublic class Main {\n\tpublic static void main(String[] args)throws Exception{\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n String line = br.readLine();\n String[] str = line.split(\" \");\n ArrayList<Integer> array = new ArrayList<Integer>();\n for(int i=0;i<str.length;i++){\n \tif(!str[i].equals(\"+\")&&!str[i].equals(\"-\")&&!str[i].equals(\"*\")){\n \t\tint tmp = Integer.parseInt(str[i]);\n array.add(tmp);\n \t}else{\n \t\t\tint n_1 = array.get(array.size()-1);\n \t\t\tarray.remove(array.size()-1);\n \t\t\tint n_2 = array.get(array.size()-1);\n \t\t\tarray.remove(array.size()-1);\n \t\tif(str[i].equals(\"+\")){\n \t\t\tarray.add(n_1+n_2);\n \t\t}else if(str[i].equals(\"-\")){\n \t\t\tarray.add(n_2-n_1);\n \t\t}else if(str[i].equals(\"*\")){\n \t\t\tarray.add(n_1*n_2);\n \t\t}\n \t}\n }\n \tSystem.out.println(array.get(array.size()-1));\n\t}\n}",
"import java.io.BufferedReader;",
"BufferedReader",
"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 Exception{\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n String line = br.readLine();\n String[] str = line.split(\" \");\n ArrayList<Integer> array = new ArrayList<Integer>();\n for(int i=0;i<str.length;i++){\n \tif(!str[i].equals(\"+\")&&!str[i].equals(\"-\")&&!str[i].equals(\"*\")){\n \t\tint tmp = Integer.parseInt(str[i]);\n array.add(tmp);\n \t}else{\n \t\t\tint n_1 = array.get(array.size()-1);\n \t\t\tarray.remove(array.size()-1);\n \t\t\tint n_2 = array.get(array.size()-1);\n \t\t\tarray.remove(array.size()-1);\n \t\tif(str[i].equals(\"+\")){\n \t\t\tarray.add(n_1+n_2);\n \t\t}else if(str[i].equals(\"-\")){\n \t\t\tarray.add(n_2-n_1);\n \t\t}else if(str[i].equals(\"*\")){\n \t\t\tarray.add(n_1*n_2);\n \t\t}\n \t}\n }\n \tSystem.out.println(array.get(array.size()-1));\n\t}\n}",
"Main",
"public static void main(String[] args)throws Exception{\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n String line = br.readLine();\n String[] str = line.split(\" \");\n ArrayList<Integer> array = new ArrayList<Integer>();\n for(int i=0;i<str.length;i++){\n \tif(!str[i].equals(\"+\")&&!str[i].equals(\"-\")&&!str[i].equals(\"*\")){\n \t\tint tmp = Integer.parseInt(str[i]);\n array.add(tmp);\n \t}else{\n \t\t\tint n_1 = array.get(array.size()-1);\n \t\t\tarray.remove(array.size()-1);\n \t\t\tint n_2 = array.get(array.size()-1);\n \t\t\tarray.remove(array.size()-1);\n \t\tif(str[i].equals(\"+\")){\n \t\t\tarray.add(n_1+n_2);\n \t\t}else if(str[i].equals(\"-\")){\n \t\t\tarray.add(n_2-n_1);\n \t\t}else if(str[i].equals(\"*\")){\n \t\t\tarray.add(n_1*n_2);\n \t\t}\n \t}\n }\n \tSystem.out.println(array.get(array.size()-1));\n\t}",
"main",
"{\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n String line = br.readLine();\n String[] str = line.split(\" \");\n ArrayList<Integer> array = new ArrayList<Integer>();\n for(int i=0;i<str.length;i++){\n \tif(!str[i].equals(\"+\")&&!str[i].equals(\"-\")&&!str[i].equals(\"*\")){\n \t\tint tmp = Integer.parseInt(str[i]);\n array.add(tmp);\n \t}else{\n \t\t\tint n_1 = array.get(array.size()-1);\n \t\t\tarray.remove(array.size()-1);\n \t\t\tint n_2 = array.get(array.size()-1);\n \t\t\tarray.remove(array.size()-1);\n \t\tif(str[i].equals(\"+\")){\n \t\t\tarray.add(n_1+n_2);\n \t\t}else if(str[i].equals(\"-\")){\n \t\t\tarray.add(n_2-n_1);\n \t\t}else if(str[i].equals(\"*\")){\n \t\t\tarray.add(n_1*n_2);\n \t\t}\n \t}\n }\n \tSystem.out.println(array.get(array.size()-1));\n\t}",
"BufferedReader br = new BufferedReader(new InputStreamReader(System.in));",
"br",
"new BufferedReader(new InputStreamReader(System.in))",
"String line = br.readLine();",
"line",
"br.readLine()",
"br.readLine",
"br",
"String[] str = line.split(\" \");",
"str",
"line.split(\" \")",
"line.split",
"line",
"\" \"",
"ArrayList<Integer> array = new ArrayList<Integer>();",
"array",
"new ArrayList<Integer>()",
"for(int i=0;i<str.length;i++){\n \tif(!str[i].equals(\"+\")&&!str[i].equals(\"-\")&&!str[i].equals(\"*\")){\n \t\tint tmp = Integer.parseInt(str[i]);\n array.add(tmp);\n \t}else{\n \t\t\tint n_1 = array.get(array.size()-1);\n \t\t\tarray.remove(array.size()-1);\n \t\t\tint n_2 = array.get(array.size()-1);\n \t\t\tarray.remove(array.size()-1);\n \t\tif(str[i].equals(\"+\")){\n \t\t\tarray.add(n_1+n_2);\n \t\t}else if(str[i].equals(\"-\")){\n \t\t\tarray.add(n_2-n_1);\n \t\t}else if(str[i].equals(\"*\")){\n \t\t\tarray.add(n_1*n_2);\n \t\t}\n \t}\n }",
"int i=0;",
"int i=0;",
"i",
"0",
"i<str.length",
"i",
"str.length",
"str",
"str.length",
"i++",
"i++",
"i",
"{\n \tif(!str[i].equals(\"+\")&&!str[i].equals(\"-\")&&!str[i].equals(\"*\")){\n \t\tint tmp = Integer.parseInt(str[i]);\n array.add(tmp);\n \t}else{\n \t\t\tint n_1 = array.get(array.size()-1);\n \t\t\tarray.remove(array.size()-1);\n \t\t\tint n_2 = array.get(array.size()-1);\n \t\t\tarray.remove(array.size()-1);\n \t\tif(str[i].equals(\"+\")){\n \t\t\tarray.add(n_1+n_2);\n \t\t}else if(str[i].equals(\"-\")){\n \t\t\tarray.add(n_2-n_1);\n \t\t}else if(str[i].equals(\"*\")){\n \t\t\tarray.add(n_1*n_2);\n \t\t}\n \t}\n }",
"{\n \tif(!str[i].equals(\"+\")&&!str[i].equals(\"-\")&&!str[i].equals(\"*\")){\n \t\tint tmp = Integer.parseInt(str[i]);\n array.add(tmp);\n \t}else{\n \t\t\tint n_1 = array.get(array.size()-1);\n \t\t\tarray.remove(array.size()-1);\n \t\t\tint n_2 = array.get(array.size()-1);\n \t\t\tarray.remove(array.size()-1);\n \t\tif(str[i].equals(\"+\")){\n \t\t\tarray.add(n_1+n_2);\n \t\t}else if(str[i].equals(\"-\")){\n \t\t\tarray.add(n_2-n_1);\n \t\t}else if(str[i].equals(\"*\")){\n \t\t\tarray.add(n_1*n_2);\n \t\t}\n \t}\n }",
"if(!str[i].equals(\"+\")&&!str[i].equals(\"-\")&&!str[i].equals(\"*\")){\n \t\tint tmp = Integer.parseInt(str[i]);\n array.add(tmp);\n \t}else{\n \t\t\tint n_1 = array.get(array.size()-1);\n \t\t\tarray.remove(array.size()-1);\n \t\t\tint n_2 = array.get(array.size()-1);\n \t\t\tarray.remove(array.size()-1);\n \t\tif(str[i].equals(\"+\")){\n \t\t\tarray.add(n_1+n_2);\n \t\t}else if(str[i].equals(\"-\")){\n \t\t\tarray.add(n_2-n_1);\n \t\t}else if(str[i].equals(\"*\")){\n \t\t\tarray.add(n_1*n_2);\n \t\t}\n \t}",
"!str[i].equals(\"+\")&&!str[i].equals(\"-\")&&!str[i].equals(\"*\")",
"!str[i].equals(\"+\")&&!str[i].equals(\"-\")&&!str[i].equals(\"*\")",
"!str[i].equals(\"+\")",
"str[i].equals(\"+\")",
"str[i].equals",
"str[i]",
"str",
"i",
"\"+\"",
"!str[i].equals(\"-\")",
"str[i].equals(\"-\")",
"str[i].equals",
"str[i]",
"str",
"i",
"\"-\"",
"!str[i].equals(\"*\")",
"str[i].equals(\"*\")",
"str[i].equals",
"str[i]",
"str",
"i",
"\"*\"",
"{\n \t\tint tmp = Integer.parseInt(str[i]);\n array.add(tmp);\n \t}",
"int tmp = Integer.parseInt(str[i]);",
"tmp",
"Integer.parseInt(str[i])",
"Integer.parseInt",
"Integer",
"str[i]",
"str",
"i",
"array.add(tmp)",
"array.add",
"array",
"tmp",
"{\n \t\t\tint n_1 = array.get(array.size()-1);\n \t\t\tarray.remove(array.size()-1);\n \t\t\tint n_2 = array.get(array.size()-1);\n \t\t\tarray.remove(array.size()-1);\n \t\tif(str[i].equals(\"+\")){\n \t\t\tarray.add(n_1+n_2);\n \t\t}else if(str[i].equals(\"-\")){\n \t\t\tarray.add(n_2-n_1);\n \t\t}else if(str[i].equals(\"*\")){\n \t\t\tarray.add(n_1*n_2);\n \t\t}\n \t}",
"int n_1 = array.get(array.size()-1);",
"n_1",
"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",
"int n_2 = array.get(array.size()-1);",
"n_2",
"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",
"if(str[i].equals(\"+\")){\n \t\t\tarray.add(n_1+n_2);\n \t\t}else if(str[i].equals(\"-\")){\n \t\t\tarray.add(n_2-n_1);\n \t\t}else if(str[i].equals(\"*\")){\n \t\t\tarray.add(n_1*n_2);\n \t\t}",
"str[i].equals(\"+\")",
"str[i].equals",
"str[i]",
"str",
"i",
"\"+\"",
"{\n \t\t\tarray.add(n_1+n_2);\n \t\t}",
"array.add(n_1+n_2)",
"array.add",
"array",
"n_1+n_2",
"n_1",
"n_2",
"if(str[i].equals(\"-\")){\n \t\t\tarray.add(n_2-n_1);\n \t\t}else if(str[i].equals(\"*\")){\n \t\t\tarray.add(n_1*n_2);\n \t\t}",
"str[i].equals(\"-\")",
"str[i].equals",
"str[i]",
"str",
"i",
"\"-\"",
"{\n \t\t\tarray.add(n_2-n_1);\n \t\t}",
"array.add(n_2-n_1)",
"array.add",
"array",
"n_2-n_1",
"n_2",
"n_1",
"if(str[i].equals(\"*\")){\n \t\t\tarray.add(n_1*n_2);\n \t\t}",
"str[i].equals(\"*\")",
"str[i].equals",
"str[i]",
"str",
"i",
"\"*\"",
"{\n \t\t\tarray.add(n_1*n_2);\n \t\t}",
"array.add(n_1*n_2)",
"array.add",
"array",
"n_1*n_2",
"n_1",
"n_2",
"System.out.println(array.get(array.size()-1))",
"System.out.println",
"System.out",
"System",
"System.out",
"array.get(array.size()-1)",
"array.get",
"array",
"array.size()-1",
"array.size()",
"array.size",
"array",
"1",
"String[] args",
"args",
"public class Main {\n\tpublic static void main(String[] args)throws Exception{\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n String line = br.readLine();\n String[] str = line.split(\" \");\n ArrayList<Integer> array = new ArrayList<Integer>();\n for(int i=0;i<str.length;i++){\n \tif(!str[i].equals(\"+\")&&!str[i].equals(\"-\")&&!str[i].equals(\"*\")){\n \t\tint tmp = Integer.parseInt(str[i]);\n array.add(tmp);\n \t}else{\n \t\t\tint n_1 = array.get(array.size()-1);\n \t\t\tarray.remove(array.size()-1);\n \t\t\tint n_2 = array.get(array.size()-1);\n \t\t\tarray.remove(array.size()-1);\n \t\tif(str[i].equals(\"+\")){\n \t\t\tarray.add(n_1+n_2);\n \t\t}else if(str[i].equals(\"-\")){\n \t\t\tarray.add(n_2-n_1);\n \t\t}else if(str[i].equals(\"*\")){\n \t\t\tarray.add(n_1*n_2);\n \t\t}\n \t}\n }\n \tSystem.out.println(array.get(array.size()-1));\n\t}\n}",
"public class Main {\n\tpublic static void main(String[] args)throws Exception{\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n String line = br.readLine();\n String[] str = line.split(\" \");\n ArrayList<Integer> array = new ArrayList<Integer>();\n for(int i=0;i<str.length;i++){\n \tif(!str[i].equals(\"+\")&&!str[i].equals(\"-\")&&!str[i].equals(\"*\")){\n \t\tint tmp = Integer.parseInt(str[i]);\n array.add(tmp);\n \t}else{\n \t\t\tint n_1 = array.get(array.size()-1);\n \t\t\tarray.remove(array.size()-1);\n \t\t\tint n_2 = array.get(array.size()-1);\n \t\t\tarray.remove(array.size()-1);\n \t\tif(str[i].equals(\"+\")){\n \t\t\tarray.add(n_1+n_2);\n \t\t}else if(str[i].equals(\"-\")){\n \t\t\tarray.add(n_2-n_1);\n \t\t}else if(str[i].equals(\"*\")){\n \t\t\tarray.add(n_1*n_2);\n \t\t}\n \t}\n }\n \tSystem.out.println(array.get(array.size()-1));\n\t}\n}",
"Main"
] | import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
public class Main {
public static void main(String[] args)throws Exception{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String line = br.readLine();
String[] str = line.split(" ");
ArrayList<Integer> array = new ArrayList<Integer>();
for(int i=0;i<str.length;i++){
if(!str[i].equals("+")&&!str[i].equals("-")&&!str[i].equals("*")){
int tmp = Integer.parseInt(str[i]);
array.add(tmp);
}else{
int n_1 = array.get(array.size()-1);
array.remove(array.size()-1);
int n_2 = array.get(array.size()-1);
array.remove(array.size()-1);
if(str[i].equals("+")){
array.add(n_1+n_2);
}else if(str[i].equals("-")){
array.add(n_2-n_1);
}else if(str[i].equals("*")){
array.add(n_1*n_2);
}
}
}
System.out.println(array.get(array.size()-1));
}
} |
[
7,
6,
13,
41,
13,
17,
12,
13,
30,
41,
13,
20,
41,
13,
41,
13,
41,
13,
0,
13,
20,
17,
0,
13,
17,
11,
1,
30,
30,
14,
40,
4,
18,
13,
3,
0,
13,
4,
18,
13,
0,
13,
4,
18,
13,
17,
14,
2,
2,
17,
13,
2,
13,
17,
30,
4,
13,
13,
4,
18,
13,
13,
14,
2,
13,
17,
30,
4,
13,
13,
2,
4,
13,
13,
4,
13,
13,
14,
2,
13,
17,
30,
4,
13,
13,
2,
40,
4,
13,
13,
4,
13,
13,
14,
2,
13,
17,
30,
4,
13,
13,
2,
4,
13,
13,
4,
13,
13,
30,
3,
4,
18,
18,
13,
13,
4,
13,
13,
4,
18,
13,
23,
13,
23,
13,
12,
13,
30,
4,
18,
20,
18,
13,
13,
18,
13,
13,
23,
13,
12,
13,
30,
29,
18,
13,
40,
13,
23,
13,
12,
13,
30,
0,
18,
13,
40,
13,
13,
29,
23,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
164,
2
],
[
164,
3
],
[
3,
4
],
[
3,
5
],
[
164,
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,
22
],
[
22,
23
],
[
22,
24
],
[
8,
25
],
[
25,
26
],
[
25,
27
],
[
28,
28
],
[
28,
29
],
[
29,
30
],
[
30,
31
],
[
31,
32
],
[
32,
33
],
[
29,
34
],
[
28,
35
],
[
35,
36
],
[
35,
37
],
[
37,
38
],
[
38,
39
],
[
28,
40
],
[
40,
41
],
[
40,
42
],
[
42,
43
],
[
43,
44
],
[
42,
45
],
[
28,
46
],
[
46,
47
],
[
47,
48
],
[
48,
49
],
[
48,
50
],
[
47,
51
],
[
51,
52
],
[
51,
53
],
[
46,
54
],
[
54,
55
],
[
55,
56
],
[
55,
57
],
[
55,
58
],
[
58,
59
],
[
59,
60
],
[
58,
61
],
[
46,
62
],
[
62,
63
],
[
63,
64
],
[
63,
65
],
[
62,
66
],
[
66,
67
],
[
67,
68
],
[
67,
69
],
[
67,
70
],
[
70,
71
],
[
71,
72
],
[
71,
73
],
[
70,
74
],
[
74,
75
],
[
74,
76
],
[
62,
77
],
[
77,
78
],
[
78,
79
],
[
78,
80
],
[
77,
81
],
[
81,
82
],
[
82,
83
],
[
82,
84
],
[
82,
85
],
[
85,
86
],
[
86,
87
],
[
87,
88
],
[
87,
89
],
[
85,
90
],
[
90,
91
],
[
90,
92
],
[
77,
93
],
[
93,
94
],
[
94,
95
],
[
94,
96
],
[
93,
97
],
[
97,
98
],
[
98,
99
],
[
98,
100
],
[
98,
101
],
[
101,
102
],
[
102,
103
],
[
102,
104
],
[
101,
105
],
[
105,
106
],
[
105,
107
],
[
93,
108
],
[
108,
109
],
[
8,
110
],
[
110,
111
],
[
111,
112
],
[
112,
113
],
[
112,
114
],
[
110,
115
],
[
115,
116
],
[
115,
117
],
[
8,
118
],
[
118,
119
],
[
119,
120
],
[
6,
121
],
[
121,
122
],
[
6,
123
],
[
123,
124
],
[
164,
125
],
[
125,
126
],
[
125,
127
],
[
127,
128
],
[
128,
129
],
[
129,
130
],
[
128,
131
],
[
131,
132
],
[
131,
133
],
[
128,
134
],
[
134,
135
],
[
134,
136
],
[
125,
137
],
[
137,
138
],
[
164,
139
],
[
139,
140
],
[
139,
141
],
[
141,
142
],
[
142,
143
],
[
143,
144
],
[
143,
145
],
[
145,
146
],
[
139,
147
],
[
147,
148
],
[
164,
149
],
[
149,
150
],
[
149,
151
],
[
151,
152
],
[
152,
153
],
[
153,
154
],
[
153,
155
],
[
155,
156
],
[
152,
157
],
[
151,
158
],
[
149,
159
],
[
159,
160
],
[
149,
161
],
[
161,
162
],
[
0,
163
],
[
163,
164
],
[
163,
165
]
] | [
"public class Main{\n static int top = 0;\n public void run(java.io.InputStream in, java.io.PrintStream out){\n java.util.Scanner sc = new java.util.Scanner(in);\n/*answer*/\n int[] stack;\n String prec;\n char c;\n\n stack = new int[200];\n top = 0;\n\n for(;;){\n if(!sc.hasNext())break;\n prec = sc.next();\n c = prec.charAt(0);\n if('0' <= c && c <= '9'){\n push(stack, Integer.parseInt(prec));\n }else if(c == '+'){\n push(stack, pop(stack) + pop(stack));\n }else if(c == '-'){\n push(stack, -pop(stack) + pop(stack));\n }else if(c == '*'){\n push(stack, pop(stack) * pop(stack));\n }else{\n break;\n }\n }\n\n System.out.println(pop(stack));\n\n sc.close();\n }\n public static void main(String[] args){\n (new Main()).run(System.in, System.out);\n }\n\n private static int pop(int[] stack){\n return stack[--top];\n }\n\n private static void push(int[] stack, int a){\n stack[top++] = a;\n return;\n }\n}",
"public class Main{\n static int top = 0;\n public void run(java.io.InputStream in, java.io.PrintStream out){\n java.util.Scanner sc = new java.util.Scanner(in);\n/*answer*/\n int[] stack;\n String prec;\n char c;\n\n stack = new int[200];\n top = 0;\n\n for(;;){\n if(!sc.hasNext())break;\n prec = sc.next();\n c = prec.charAt(0);\n if('0' <= c && c <= '9'){\n push(stack, Integer.parseInt(prec));\n }else if(c == '+'){\n push(stack, pop(stack) + pop(stack));\n }else if(c == '-'){\n push(stack, -pop(stack) + pop(stack));\n }else if(c == '*'){\n push(stack, pop(stack) * pop(stack));\n }else{\n break;\n }\n }\n\n System.out.println(pop(stack));\n\n sc.close();\n }\n public static void main(String[] args){\n (new Main()).run(System.in, System.out);\n }\n\n private static int pop(int[] stack){\n return stack[--top];\n }\n\n private static void push(int[] stack, int a){\n stack[top++] = a;\n return;\n }\n}",
"Main",
"static int top = 0;",
"top",
"0",
"public void run(java.io.InputStream in, java.io.PrintStream out){\n java.util.Scanner sc = new java.util.Scanner(in);\n/*answer*/\n int[] stack;\n String prec;\n char c;\n\n stack = new int[200];\n top = 0;\n\n for(;;){\n if(!sc.hasNext())break;\n prec = sc.next();\n c = prec.charAt(0);\n if('0' <= c && c <= '9'){\n push(stack, Integer.parseInt(prec));\n }else if(c == '+'){\n push(stack, pop(stack) + pop(stack));\n }else if(c == '-'){\n push(stack, -pop(stack) + pop(stack));\n }else if(c == '*'){\n push(stack, pop(stack) * pop(stack));\n }else{\n break;\n }\n }\n\n System.out.println(pop(stack));\n\n sc.close();\n }",
"run",
"{\n java.util.Scanner sc = new java.util.Scanner(in);\n/*answer*/\n int[] stack;\n String prec;\n char c;\n\n stack = new int[200];\n top = 0;\n\n for(;;){\n if(!sc.hasNext())break;\n prec = sc.next();\n c = prec.charAt(0);\n if('0' <= c && c <= '9'){\n push(stack, Integer.parseInt(prec));\n }else if(c == '+'){\n push(stack, pop(stack) + pop(stack));\n }else if(c == '-'){\n push(stack, -pop(stack) + pop(stack));\n }else if(c == '*'){\n push(stack, pop(stack) * pop(stack));\n }else{\n break;\n }\n }\n\n System.out.println(pop(stack));\n\n sc.close();\n }",
"java.util.Scanner sc = new java.util.Scanner(in);",
"sc",
"new java.util.Scanner(in)",
"int[] stack;",
"stack",
"String prec;",
"prec",
"char c;",
"c",
"stack = new int[200]",
"stack",
"new int[200]",
"200",
"top = 0",
"top",
"0",
"for(;;){\n if(!sc.hasNext())break;\n prec = sc.next();\n c = prec.charAt(0);\n if('0' <= c && c <= '9'){\n push(stack, Integer.parseInt(prec));\n }else if(c == '+'){\n push(stack, pop(stack) + pop(stack));\n }else if(c == '-'){\n push(stack, -pop(stack) + pop(stack));\n }else if(c == '*'){\n push(stack, pop(stack) * pop(stack));\n }else{\n break;\n }\n }",
";",
"{\n if(!sc.hasNext())break;\n prec = sc.next();\n c = prec.charAt(0);\n if('0' <= c && c <= '9'){\n push(stack, Integer.parseInt(prec));\n }else if(c == '+'){\n push(stack, pop(stack) + pop(stack));\n }else if(c == '-'){\n push(stack, -pop(stack) + pop(stack));\n }else if(c == '*'){\n push(stack, pop(stack) * pop(stack));\n }else{\n break;\n }\n }",
"{\n if(!sc.hasNext())break;\n prec = sc.next();\n c = prec.charAt(0);\n if('0' <= c && c <= '9'){\n push(stack, Integer.parseInt(prec));\n }else if(c == '+'){\n push(stack, pop(stack) + pop(stack));\n }else if(c == '-'){\n push(stack, -pop(stack) + pop(stack));\n }else if(c == '*'){\n push(stack, pop(stack) * pop(stack));\n }else{\n break;\n }\n }",
"if(!sc.hasNext())break;",
"!sc.hasNext()",
"sc.hasNext()",
"sc.hasNext",
"sc",
"break;",
"prec = sc.next()",
"prec",
"sc.next()",
"sc.next",
"sc",
"c = prec.charAt(0)",
"c",
"prec.charAt(0)",
"prec.charAt",
"prec",
"0",
"if('0' <= c && c <= '9'){\n push(stack, Integer.parseInt(prec));\n }else if(c == '+'){\n push(stack, pop(stack) + pop(stack));\n }else if(c == '-'){\n push(stack, -pop(stack) + pop(stack));\n }else if(c == '*'){\n push(stack, pop(stack) * pop(stack));\n }else{\n break;\n }",
"'0' <= c && c <= '9'",
"'0' <= c",
"'0'",
"c",
"c <= '9'",
"c",
"'9'",
"{\n push(stack, Integer.parseInt(prec));\n }",
"push(stack, Integer.parseInt(prec))",
"push",
"stack",
"Integer.parseInt(prec)",
"Integer.parseInt",
"Integer",
"prec",
"if(c == '+'){\n push(stack, pop(stack) + pop(stack));\n }else if(c == '-'){\n push(stack, -pop(stack) + pop(stack));\n }else if(c == '*'){\n push(stack, pop(stack) * pop(stack));\n }else{\n break;\n }",
"c == '+'",
"c",
"'+'",
"{\n push(stack, pop(stack) + pop(stack));\n }",
"push(stack, pop(stack) + pop(stack))",
"push",
"stack",
"pop(stack) + pop(stack)",
"pop(stack)",
"pop",
"stack",
"pop(stack)",
"pop",
"stack",
"if(c == '-'){\n push(stack, -pop(stack) + pop(stack));\n }else if(c == '*'){\n push(stack, pop(stack) * pop(stack));\n }else{\n break;\n }",
"c == '-'",
"c",
"'-'",
"{\n push(stack, -pop(stack) + pop(stack));\n }",
"push(stack, -pop(stack) + pop(stack))",
"push",
"stack",
"-pop(stack) + pop(stack)",
"-pop(stack)",
"pop(stack)",
"pop",
"stack",
"pop(stack)",
"pop",
"stack",
"if(c == '*'){\n push(stack, pop(stack) * pop(stack));\n }else{\n break;\n }",
"c == '*'",
"c",
"'*'",
"{\n push(stack, pop(stack) * pop(stack));\n }",
"push(stack, pop(stack) * pop(stack))",
"push",
"stack",
"pop(stack) * pop(stack)",
"pop(stack)",
"pop",
"stack",
"pop(stack)",
"pop",
"stack",
"{\n break;\n }",
"break;",
"System.out.println(pop(stack))",
"System.out.println",
"System.out",
"System",
"System.out",
"pop(stack)",
"pop",
"stack",
"sc.close()",
"sc.close",
"sc",
"java.io.InputStream in",
"in",
"java.io.PrintStream out",
"out",
"public static void main(String[] args){\n (new Main()).run(System.in, System.out);\n }",
"main",
"{\n (new Main()).run(System.in, System.out);\n }",
"(new Main()).run(System.in, System.out)",
"(new Main()).run",
"(new Main())",
"System.in",
"System",
"System.in",
"System.out",
"System",
"System.out",
"String[] args",
"args",
"private static int pop(int[] stack){\n return stack[--top];\n }",
"pop",
"{\n return stack[--top];\n }",
"return stack[--top];",
"stack[--top]",
"stack",
"--top",
"top",
"int[] stack",
"stack",
"private static void push(int[] stack, int a){\n stack[top++] = a;\n return;\n }",
"push",
"{\n stack[top++] = a;\n return;\n }",
"stack[top++] = a",
"stack[top++]",
"stack",
"top++",
"top",
"a",
"return;",
"int[] stack",
"stack",
"int a",
"a",
"public class Main{\n static int top = 0;\n public void run(java.io.InputStream in, java.io.PrintStream out){\n java.util.Scanner sc = new java.util.Scanner(in);\n/*answer*/\n int[] stack;\n String prec;\n char c;\n\n stack = new int[200];\n top = 0;\n\n for(;;){\n if(!sc.hasNext())break;\n prec = sc.next();\n c = prec.charAt(0);\n if('0' <= c && c <= '9'){\n push(stack, Integer.parseInt(prec));\n }else if(c == '+'){\n push(stack, pop(stack) + pop(stack));\n }else if(c == '-'){\n push(stack, -pop(stack) + pop(stack));\n }else if(c == '*'){\n push(stack, pop(stack) * pop(stack));\n }else{\n break;\n }\n }\n\n System.out.println(pop(stack));\n\n sc.close();\n }\n public static void main(String[] args){\n (new Main()).run(System.in, System.out);\n }\n\n private static int pop(int[] stack){\n return stack[--top];\n }\n\n private static void push(int[] stack, int a){\n stack[top++] = a;\n return;\n }\n}",
"public class Main{\n static int top = 0;\n public void run(java.io.InputStream in, java.io.PrintStream out){\n java.util.Scanner sc = new java.util.Scanner(in);\n/*answer*/\n int[] stack;\n String prec;\n char c;\n\n stack = new int[200];\n top = 0;\n\n for(;;){\n if(!sc.hasNext())break;\n prec = sc.next();\n c = prec.charAt(0);\n if('0' <= c && c <= '9'){\n push(stack, Integer.parseInt(prec));\n }else if(c == '+'){\n push(stack, pop(stack) + pop(stack));\n }else if(c == '-'){\n push(stack, -pop(stack) + pop(stack));\n }else if(c == '*'){\n push(stack, pop(stack) * pop(stack));\n }else{\n break;\n }\n }\n\n System.out.println(pop(stack));\n\n sc.close();\n }\n public static void main(String[] args){\n (new Main()).run(System.in, System.out);\n }\n\n private static int pop(int[] stack){\n return stack[--top];\n }\n\n private static void push(int[] stack, int a){\n stack[top++] = a;\n return;\n }\n}",
"Main"
] | public class Main{
static int top = 0;
public void run(java.io.InputStream in, java.io.PrintStream out){
java.util.Scanner sc = new java.util.Scanner(in);
/*answer*/
int[] stack;
String prec;
char c;
stack = new int[200];
top = 0;
for(;;){
if(!sc.hasNext())break;
prec = sc.next();
c = prec.charAt(0);
if('0' <= c && c <= '9'){
push(stack, Integer.parseInt(prec));
}else if(c == '+'){
push(stack, pop(stack) + pop(stack));
}else if(c == '-'){
push(stack, -pop(stack) + pop(stack));
}else if(c == '*'){
push(stack, pop(stack) * pop(stack));
}else{
break;
}
}
System.out.println(pop(stack));
sc.close();
}
public static void main(String[] args){
(new Main()).run(System.in, System.out);
}
private static int pop(int[] stack){
return stack[--top];
}
private static void push(int[] stack, int a){
stack[top++] = a;
return;
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
20,
17,
41,
13,
17,
41,
13,
42,
4,
18,
13,
30,
0,
13,
4,
18,
13,
14,
4,
18,
13,
17,
30,
3,
14,
4,
18,
13,
17,
30,
41,
13,
2,
18,
13,
2,
13,
17,
18,
13,
2,
13,
17,
0,
18,
13,
2,
13,
17,
17,
0,
18,
13,
2,
13,
17,
17,
0,
13,
17,
0,
18,
13,
13,
13,
14,
4,
18,
13,
17,
30,
41,
13,
2,
18,
13,
2,
13,
17,
18,
13,
2,
13,
17,
0,
18,
13,
2,
13,
17,
17,
0,
18,
13,
2,
13,
17,
17,
0,
13,
17,
0,
18,
13,
13,
13,
14,
4,
18,
13,
17,
30,
41,
13,
2,
18,
13,
2,
13,
17,
18,
13,
2,
13,
17,
0,
18,
13,
2,
13,
17,
17,
0,
18,
13,
2,
13,
17,
17,
0,
13,
17,
0,
18,
13,
13,
13,
30,
0,
18,
13,
13,
4,
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
],
[
185,
5
],
[
185,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
8,
16
],
[
16,
17
],
[
16,
18
],
[
8,
19
],
[
19,
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
],
[
32,
33
],
[
33,
34
],
[
32,
35
],
[
31,
36
],
[
36,
37
],
[
25,
38
],
[
38,
39
],
[
39,
40
],
[
40,
41
],
[
39,
42
],
[
38,
43
],
[
43,
44
],
[
44,
45
],
[
44,
46
],
[
46,
47
],
[
47,
48
],
[
47,
49
],
[
49,
50
],
[
49,
51
],
[
46,
52
],
[
52,
53
],
[
52,
54
],
[
54,
55
],
[
54,
56
],
[
43,
57
],
[
57,
58
],
[
58,
59
],
[
58,
60
],
[
60,
61
],
[
60,
62
],
[
57,
63
],
[
43,
64
],
[
64,
65
],
[
65,
66
],
[
65,
67
],
[
67,
68
],
[
67,
69
],
[
64,
70
],
[
43,
71
],
[
71,
72
],
[
71,
73
],
[
43,
74
],
[
74,
75
],
[
75,
76
],
[
75,
77
],
[
74,
78
],
[
38,
79
],
[
79,
80
],
[
80,
81
],
[
81,
82
],
[
80,
83
],
[
79,
84
],
[
84,
85
],
[
85,
86
],
[
85,
87
],
[
87,
88
],
[
88,
89
],
[
88,
90
],
[
90,
91
],
[
90,
92
],
[
87,
93
],
[
93,
94
],
[
93,
95
],
[
95,
96
],
[
95,
97
],
[
84,
98
],
[
98,
99
],
[
99,
100
],
[
99,
101
],
[
101,
102
],
[
101,
103
],
[
98,
104
],
[
84,
105
],
[
105,
106
],
[
106,
107
],
[
106,
108
],
[
108,
109
],
[
108,
110
],
[
105,
111
],
[
84,
112
],
[
112,
113
],
[
112,
114
],
[
84,
115
],
[
115,
116
],
[
116,
117
],
[
116,
118
],
[
115,
119
],
[
79,
120
],
[
120,
121
],
[
121,
122
],
[
122,
123
],
[
121,
124
],
[
120,
125
],
[
125,
126
],
[
126,
127
],
[
126,
128
],
[
128,
129
],
[
129,
130
],
[
129,
131
],
[
131,
132
],
[
131,
133
],
[
128,
134
],
[
134,
135
],
[
134,
136
],
[
136,
137
],
[
136,
138
],
[
125,
139
],
[
139,
140
],
[
140,
141
],
[
140,
142
],
[
142,
143
],
[
142,
144
],
[
139,
145
],
[
125,
146
],
[
146,
147
],
[
147,
148
],
[
147,
149
],
[
149,
150
],
[
149,
151
],
[
146,
152
],
[
125,
153
],
[
153,
154
],
[
153,
155
],
[
125,
156
],
[
156,
157
],
[
157,
158
],
[
157,
159
],
[
156,
160
],
[
120,
161
],
[
161,
162
],
[
162,
163
],
[
163,
164
],
[
163,
165
],
[
162,
166
],
[
166,
167
],
[
167,
168
],
[
166,
169
],
[
25,
170
],
[
170,
171
],
[
8,
172
],
[
172,
173
],
[
173,
174
],
[
174,
175
],
[
174,
176
],
[
172,
177
],
[
177,
178
],
[
177,
179
],
[
179,
180
],
[
179,
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 inp = new Scanner(System.in);\n\n int[] numbers = new int[100];\n int numberPlace = 0;\n String s;\n\n while(inp.hasNext()){\n s = inp.next();\n if (s.equals(\"=\")){\n break;\n }\n if (s.equals(\"+\")){\n int tempHold = numbers[numberPlace-2] + numbers[numberPlace-1];\n\n numbers[numberPlace-1] = 0;\n numbers[numberPlace-2] = 0;\n\n numberPlace -= 2;\n\n numbers[numberPlace] = tempHold;\n } else if (s.equals(\"-\")){\n int tempHold = numbers[numberPlace-2] - numbers[numberPlace-1];\n\n numbers[numberPlace-1] = 0;\n numbers[numberPlace-2] = 0;\n\n numberPlace -= 2;\n\n numbers[numberPlace] = tempHold;\n } else if (s.equals(\"*\")){\n int tempHold = numbers[numberPlace-2] * numbers[numberPlace-1];\n\n numbers[numberPlace-1] = 0;\n numbers[numberPlace-2] = 0;\n\n numberPlace -= 2;\n\n numbers[numberPlace] = tempHold;\n } else {\n numbers[numberPlace] = Integer.parseInt(s);\n }\n\n numberPlace++;\n }\n\n System.out.println(numbers[numberPlace-1]);\n }\n}\n",
"import java.util.*;",
"util.*",
"java",
"public class Main {\n public static void main(String[] args) {\n Scanner inp = new Scanner(System.in);\n\n int[] numbers = new int[100];\n int numberPlace = 0;\n String s;\n\n while(inp.hasNext()){\n s = inp.next();\n if (s.equals(\"=\")){\n break;\n }\n if (s.equals(\"+\")){\n int tempHold = numbers[numberPlace-2] + numbers[numberPlace-1];\n\n numbers[numberPlace-1] = 0;\n numbers[numberPlace-2] = 0;\n\n numberPlace -= 2;\n\n numbers[numberPlace] = tempHold;\n } else if (s.equals(\"-\")){\n int tempHold = numbers[numberPlace-2] - numbers[numberPlace-1];\n\n numbers[numberPlace-1] = 0;\n numbers[numberPlace-2] = 0;\n\n numberPlace -= 2;\n\n numbers[numberPlace] = tempHold;\n } else if (s.equals(\"*\")){\n int tempHold = numbers[numberPlace-2] * numbers[numberPlace-1];\n\n numbers[numberPlace-1] = 0;\n numbers[numberPlace-2] = 0;\n\n numberPlace -= 2;\n\n numbers[numberPlace] = tempHold;\n } else {\n numbers[numberPlace] = Integer.parseInt(s);\n }\n\n numberPlace++;\n }\n\n System.out.println(numbers[numberPlace-1]);\n }\n}",
"Main",
"public static void main(String[] args) {\n Scanner inp = new Scanner(System.in);\n\n int[] numbers = new int[100];\n int numberPlace = 0;\n String s;\n\n while(inp.hasNext()){\n s = inp.next();\n if (s.equals(\"=\")){\n break;\n }\n if (s.equals(\"+\")){\n int tempHold = numbers[numberPlace-2] + numbers[numberPlace-1];\n\n numbers[numberPlace-1] = 0;\n numbers[numberPlace-2] = 0;\n\n numberPlace -= 2;\n\n numbers[numberPlace] = tempHold;\n } else if (s.equals(\"-\")){\n int tempHold = numbers[numberPlace-2] - numbers[numberPlace-1];\n\n numbers[numberPlace-1] = 0;\n numbers[numberPlace-2] = 0;\n\n numberPlace -= 2;\n\n numbers[numberPlace] = tempHold;\n } else if (s.equals(\"*\")){\n int tempHold = numbers[numberPlace-2] * numbers[numberPlace-1];\n\n numbers[numberPlace-1] = 0;\n numbers[numberPlace-2] = 0;\n\n numberPlace -= 2;\n\n numbers[numberPlace] = tempHold;\n } else {\n numbers[numberPlace] = Integer.parseInt(s);\n }\n\n numberPlace++;\n }\n\n System.out.println(numbers[numberPlace-1]);\n }",
"main",
"{\n Scanner inp = new Scanner(System.in);\n\n int[] numbers = new int[100];\n int numberPlace = 0;\n String s;\n\n while(inp.hasNext()){\n s = inp.next();\n if (s.equals(\"=\")){\n break;\n }\n if (s.equals(\"+\")){\n int tempHold = numbers[numberPlace-2] + numbers[numberPlace-1];\n\n numbers[numberPlace-1] = 0;\n numbers[numberPlace-2] = 0;\n\n numberPlace -= 2;\n\n numbers[numberPlace] = tempHold;\n } else if (s.equals(\"-\")){\n int tempHold = numbers[numberPlace-2] - numbers[numberPlace-1];\n\n numbers[numberPlace-1] = 0;\n numbers[numberPlace-2] = 0;\n\n numberPlace -= 2;\n\n numbers[numberPlace] = tempHold;\n } else if (s.equals(\"*\")){\n int tempHold = numbers[numberPlace-2] * numbers[numberPlace-1];\n\n numbers[numberPlace-1] = 0;\n numbers[numberPlace-2] = 0;\n\n numberPlace -= 2;\n\n numbers[numberPlace] = tempHold;\n } else {\n numbers[numberPlace] = Integer.parseInt(s);\n }\n\n numberPlace++;\n }\n\n System.out.println(numbers[numberPlace-1]);\n }",
"Scanner inp = new Scanner(System.in);",
"inp",
"new Scanner(System.in)",
"int[] numbers = new int[100];",
"numbers",
"new int[100]",
"100",
"int numberPlace = 0;",
"numberPlace",
"0",
"String s;",
"s",
"while(inp.hasNext()){\n s = inp.next();\n if (s.equals(\"=\")){\n break;\n }\n if (s.equals(\"+\")){\n int tempHold = numbers[numberPlace-2] + numbers[numberPlace-1];\n\n numbers[numberPlace-1] = 0;\n numbers[numberPlace-2] = 0;\n\n numberPlace -= 2;\n\n numbers[numberPlace] = tempHold;\n } else if (s.equals(\"-\")){\n int tempHold = numbers[numberPlace-2] - numbers[numberPlace-1];\n\n numbers[numberPlace-1] = 0;\n numbers[numberPlace-2] = 0;\n\n numberPlace -= 2;\n\n numbers[numberPlace] = tempHold;\n } else if (s.equals(\"*\")){\n int tempHold = numbers[numberPlace-2] * numbers[numberPlace-1];\n\n numbers[numberPlace-1] = 0;\n numbers[numberPlace-2] = 0;\n\n numberPlace -= 2;\n\n numbers[numberPlace] = tempHold;\n } else {\n numbers[numberPlace] = Integer.parseInt(s);\n }\n\n numberPlace++;\n }",
"inp.hasNext()",
"inp.hasNext",
"inp",
"{\n s = inp.next();\n if (s.equals(\"=\")){\n break;\n }\n if (s.equals(\"+\")){\n int tempHold = numbers[numberPlace-2] + numbers[numberPlace-1];\n\n numbers[numberPlace-1] = 0;\n numbers[numberPlace-2] = 0;\n\n numberPlace -= 2;\n\n numbers[numberPlace] = tempHold;\n } else if (s.equals(\"-\")){\n int tempHold = numbers[numberPlace-2] - numbers[numberPlace-1];\n\n numbers[numberPlace-1] = 0;\n numbers[numberPlace-2] = 0;\n\n numberPlace -= 2;\n\n numbers[numberPlace] = tempHold;\n } else if (s.equals(\"*\")){\n int tempHold = numbers[numberPlace-2] * numbers[numberPlace-1];\n\n numbers[numberPlace-1] = 0;\n numbers[numberPlace-2] = 0;\n\n numberPlace -= 2;\n\n numbers[numberPlace] = tempHold;\n } else {\n numbers[numberPlace] = Integer.parseInt(s);\n }\n\n numberPlace++;\n }",
"s = inp.next()",
"s",
"inp.next()",
"inp.next",
"inp",
"if (s.equals(\"=\")){\n break;\n }",
"s.equals(\"=\")",
"s.equals",
"s",
"\"=\"",
"{\n break;\n }",
"break;",
"if (s.equals(\"+\")){\n int tempHold = numbers[numberPlace-2] + numbers[numberPlace-1];\n\n numbers[numberPlace-1] = 0;\n numbers[numberPlace-2] = 0;\n\n numberPlace -= 2;\n\n numbers[numberPlace] = tempHold;\n } else if (s.equals(\"-\")){\n int tempHold = numbers[numberPlace-2] - numbers[numberPlace-1];\n\n numbers[numberPlace-1] = 0;\n numbers[numberPlace-2] = 0;\n\n numberPlace -= 2;\n\n numbers[numberPlace] = tempHold;\n } else if (s.equals(\"*\")){\n int tempHold = numbers[numberPlace-2] * numbers[numberPlace-1];\n\n numbers[numberPlace-1] = 0;\n numbers[numberPlace-2] = 0;\n\n numberPlace -= 2;\n\n numbers[numberPlace] = tempHold;\n } else {\n numbers[numberPlace] = Integer.parseInt(s);\n }",
"s.equals(\"+\")",
"s.equals",
"s",
"\"+\"",
"{\n int tempHold = numbers[numberPlace-2] + numbers[numberPlace-1];\n\n numbers[numberPlace-1] = 0;\n numbers[numberPlace-2] = 0;\n\n numberPlace -= 2;\n\n numbers[numberPlace] = tempHold;\n }",
"int tempHold = numbers[numberPlace-2] + numbers[numberPlace-1];",
"tempHold",
"numbers[numberPlace-2] + numbers[numberPlace-1]",
"numbers[numberPlace-2]",
"numbers",
"numberPlace-2",
"numberPlace",
"2",
"numbers[numberPlace-1]",
"numbers",
"numberPlace-1",
"numberPlace",
"1",
"numbers[numberPlace-1] = 0",
"numbers[numberPlace-1]",
"numbers",
"numberPlace-1",
"numberPlace",
"1",
"0",
"numbers[numberPlace-2] = 0",
"numbers[numberPlace-2]",
"numbers",
"numberPlace-2",
"numberPlace",
"2",
"0",
"numberPlace -= 2",
"numberPlace",
"2",
"numbers[numberPlace] = tempHold",
"numbers[numberPlace]",
"numbers",
"numberPlace",
"tempHold",
"if (s.equals(\"-\")){\n int tempHold = numbers[numberPlace-2] - numbers[numberPlace-1];\n\n numbers[numberPlace-1] = 0;\n numbers[numberPlace-2] = 0;\n\n numberPlace -= 2;\n\n numbers[numberPlace] = tempHold;\n } else if (s.equals(\"*\")){\n int tempHold = numbers[numberPlace-2] * numbers[numberPlace-1];\n\n numbers[numberPlace-1] = 0;\n numbers[numberPlace-2] = 0;\n\n numberPlace -= 2;\n\n numbers[numberPlace] = tempHold;\n } else {\n numbers[numberPlace] = Integer.parseInt(s);\n }",
"s.equals(\"-\")",
"s.equals",
"s",
"\"-\"",
"{\n int tempHold = numbers[numberPlace-2] - numbers[numberPlace-1];\n\n numbers[numberPlace-1] = 0;\n numbers[numberPlace-2] = 0;\n\n numberPlace -= 2;\n\n numbers[numberPlace] = tempHold;\n }",
"int tempHold = numbers[numberPlace-2] - numbers[numberPlace-1];",
"tempHold",
"numbers[numberPlace-2] - numbers[numberPlace-1]",
"numbers[numberPlace-2]",
"numbers",
"numberPlace-2",
"numberPlace",
"2",
"numbers[numberPlace-1]",
"numbers",
"numberPlace-1",
"numberPlace",
"1",
"numbers[numberPlace-1] = 0",
"numbers[numberPlace-1]",
"numbers",
"numberPlace-1",
"numberPlace",
"1",
"0",
"numbers[numberPlace-2] = 0",
"numbers[numberPlace-2]",
"numbers",
"numberPlace-2",
"numberPlace",
"2",
"0",
"numberPlace -= 2",
"numberPlace",
"2",
"numbers[numberPlace] = tempHold",
"numbers[numberPlace]",
"numbers",
"numberPlace",
"tempHold",
"if (s.equals(\"*\")){\n int tempHold = numbers[numberPlace-2] * numbers[numberPlace-1];\n\n numbers[numberPlace-1] = 0;\n numbers[numberPlace-2] = 0;\n\n numberPlace -= 2;\n\n numbers[numberPlace] = tempHold;\n } else {\n numbers[numberPlace] = Integer.parseInt(s);\n }",
"s.equals(\"*\")",
"s.equals",
"s",
"\"*\"",
"{\n int tempHold = numbers[numberPlace-2] * numbers[numberPlace-1];\n\n numbers[numberPlace-1] = 0;\n numbers[numberPlace-2] = 0;\n\n numberPlace -= 2;\n\n numbers[numberPlace] = tempHold;\n }",
"int tempHold = numbers[numberPlace-2] * numbers[numberPlace-1];",
"tempHold",
"numbers[numberPlace-2] * numbers[numberPlace-1]",
"numbers[numberPlace-2]",
"numbers",
"numberPlace-2",
"numberPlace",
"2",
"numbers[numberPlace-1]",
"numbers",
"numberPlace-1",
"numberPlace",
"1",
"numbers[numberPlace-1] = 0",
"numbers[numberPlace-1]",
"numbers",
"numberPlace-1",
"numberPlace",
"1",
"0",
"numbers[numberPlace-2] = 0",
"numbers[numberPlace-2]",
"numbers",
"numberPlace-2",
"numberPlace",
"2",
"0",
"numberPlace -= 2",
"numberPlace",
"2",
"numbers[numberPlace] = tempHold",
"numbers[numberPlace]",
"numbers",
"numberPlace",
"tempHold",
"{\n numbers[numberPlace] = Integer.parseInt(s);\n }",
"numbers[numberPlace] = Integer.parseInt(s)",
"numbers[numberPlace]",
"numbers",
"numberPlace",
"Integer.parseInt(s)",
"Integer.parseInt",
"Integer",
"s",
"numberPlace++",
"numberPlace",
"System.out.println(numbers[numberPlace-1])",
"System.out.println",
"System.out",
"System",
"System.out",
"numbers[numberPlace-1]",
"numbers",
"numberPlace-1",
"numberPlace",
"1",
"String[] args",
"args",
"public class Main {\n public static void main(String[] args) {\n Scanner inp = new Scanner(System.in);\n\n int[] numbers = new int[100];\n int numberPlace = 0;\n String s;\n\n while(inp.hasNext()){\n s = inp.next();\n if (s.equals(\"=\")){\n break;\n }\n if (s.equals(\"+\")){\n int tempHold = numbers[numberPlace-2] + numbers[numberPlace-1];\n\n numbers[numberPlace-1] = 0;\n numbers[numberPlace-2] = 0;\n\n numberPlace -= 2;\n\n numbers[numberPlace] = tempHold;\n } else if (s.equals(\"-\")){\n int tempHold = numbers[numberPlace-2] - numbers[numberPlace-1];\n\n numbers[numberPlace-1] = 0;\n numbers[numberPlace-2] = 0;\n\n numberPlace -= 2;\n\n numbers[numberPlace] = tempHold;\n } else if (s.equals(\"*\")){\n int tempHold = numbers[numberPlace-2] * numbers[numberPlace-1];\n\n numbers[numberPlace-1] = 0;\n numbers[numberPlace-2] = 0;\n\n numberPlace -= 2;\n\n numbers[numberPlace] = tempHold;\n } else {\n numbers[numberPlace] = Integer.parseInt(s);\n }\n\n numberPlace++;\n }\n\n System.out.println(numbers[numberPlace-1]);\n }\n}",
"public class Main {\n public static void main(String[] args) {\n Scanner inp = new Scanner(System.in);\n\n int[] numbers = new int[100];\n int numberPlace = 0;\n String s;\n\n while(inp.hasNext()){\n s = inp.next();\n if (s.equals(\"=\")){\n break;\n }\n if (s.equals(\"+\")){\n int tempHold = numbers[numberPlace-2] + numbers[numberPlace-1];\n\n numbers[numberPlace-1] = 0;\n numbers[numberPlace-2] = 0;\n\n numberPlace -= 2;\n\n numbers[numberPlace] = tempHold;\n } else if (s.equals(\"-\")){\n int tempHold = numbers[numberPlace-2] - numbers[numberPlace-1];\n\n numbers[numberPlace-1] = 0;\n numbers[numberPlace-2] = 0;\n\n numberPlace -= 2;\n\n numbers[numberPlace] = tempHold;\n } else if (s.equals(\"*\")){\n int tempHold = numbers[numberPlace-2] * numbers[numberPlace-1];\n\n numbers[numberPlace-1] = 0;\n numbers[numberPlace-2] = 0;\n\n numberPlace -= 2;\n\n numbers[numberPlace] = tempHold;\n } else {\n numbers[numberPlace] = Integer.parseInt(s);\n }\n\n numberPlace++;\n }\n\n System.out.println(numbers[numberPlace-1]);\n }\n}",
"Main"
] | import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner inp = new Scanner(System.in);
int[] numbers = new int[100];
int numberPlace = 0;
String s;
while(inp.hasNext()){
s = inp.next();
if (s.equals("=")){
break;
}
if (s.equals("+")){
int tempHold = numbers[numberPlace-2] + numbers[numberPlace-1];
numbers[numberPlace-1] = 0;
numbers[numberPlace-2] = 0;
numberPlace -= 2;
numbers[numberPlace] = tempHold;
} else if (s.equals("-")){
int tempHold = numbers[numberPlace-2] - numbers[numberPlace-1];
numbers[numberPlace-1] = 0;
numbers[numberPlace-2] = 0;
numberPlace -= 2;
numbers[numberPlace] = tempHold;
} else if (s.equals("*")){
int tempHold = numbers[numberPlace-2] * numbers[numberPlace-1];
numbers[numberPlace-1] = 0;
numbers[numberPlace-2] = 0;
numberPlace -= 2;
numbers[numberPlace] = tempHold;
} else {
numbers[numberPlace] = Integer.parseInt(s);
}
numberPlace++;
}
System.out.println(numbers[numberPlace-1]);
}
}
|
[
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,
28,
13,
13,
30,
30,
14,
4,
13,
13,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
4,
13,
13,
13,
13,
4,
18,
13,
13,
30,
4,
18,
13,
4,
18,
13,
13,
4,
18,
18,
13,
13,
4,
18,
13,
23,
13,
12,
13,
30,
35,
13,
34,
17,
1,
34,
17,
1,
34,
17,
1,
34,
17,
1,
29,
17,
34,
1,
29,
17,
23,
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,
34,
17,
1,
29,
2,
13,
13,
34,
1,
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
],
[
147,
11
],
[
147,
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
],
[
29,
31
],
[
29,
32
],
[
33,
33
],
[
33,
34
],
[
34,
35
],
[
35,
36
],
[
35,
37
],
[
34,
38
],
[
38,
39
],
[
39,
40
],
[
39,
41
],
[
41,
42
],
[
42,
43
],
[
38,
44
],
[
44,
45
],
[
44,
46
],
[
46,
47
],
[
47,
48
],
[
38,
49
],
[
49,
50
],
[
49,
51
],
[
51,
52
],
[
51,
53
],
[
51,
54
],
[
51,
55
],
[
38,
56
],
[
56,
57
],
[
57,
58
],
[
56,
59
],
[
34,
60
],
[
60,
61
],
[
61,
62
],
[
62,
63
],
[
61,
64
],
[
64,
65
],
[
65,
66
],
[
64,
67
],
[
14,
68
],
[
68,
69
],
[
69,
70
],
[
70,
71
],
[
70,
72
],
[
68,
73
],
[
73,
74
],
[
74,
75
],
[
12,
76
],
[
76,
77
],
[
147,
78
],
[
78,
79
],
[
78,
80
],
[
80,
81
],
[
81,
82
],
[
81,
83
],
[
83,
84
],
[
83,
85
],
[
81,
86
],
[
86,
87
],
[
86,
88
],
[
81,
89
],
[
89,
90
],
[
89,
91
],
[
81,
92
],
[
92,
93
],
[
92,
94
],
[
94,
95
],
[
95,
96
],
[
81,
97
],
[
97,
98
],
[
98,
99
],
[
99,
100
],
[
78,
101
],
[
101,
102
],
[
147,
103
],
[
103,
104
],
[
103,
105
],
[
105,
106
],
[
106,
107
],
[
106,
108
],
[
108,
109
],
[
108,
110
],
[
110,
111
],
[
111,
112
],
[
112,
113
],
[
112,
114
],
[
106,
115
],
[
115,
116
],
[
115,
117
],
[
117,
118
],
[
118,
119
],
[
119,
120
],
[
119,
121
],
[
106,
122
],
[
122,
123
],
[
122,
124
],
[
124,
125
],
[
125,
126
],
[
126,
127
],
[
126,
128
],
[
106,
129
],
[
129,
130
],
[
129,
131
],
[
131,
132
],
[
132,
133
],
[
133,
134
],
[
133,
135
],
[
106,
136
],
[
136,
137
],
[
137,
138
],
[
138,
139
],
[
103,
140
],
[
140,
141
],
[
103,
142
],
[
142,
143
],
[
103,
144
],
[
144,
145
],
[
0,
146
],
[
146,
147
],
[
146,
148
]
] | [
"import java.io.BufferedReader;\nimport java.io.InputStreamReader;\nimport java.util.Stack;\n\npublic class Main {\n\n public static void main(String[] args) throws Exception {\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n String[] array = br.readLine().split(\" \");\n\n Stack<Integer> stack = new Stack<>();\n\n for (String s : array) {\n if (isOperator(s)) {\n int a = stack.pop();\n int b = stack.pop();\n int c = calculate(b, a, s);\n stack.push(c);\n } else {\n stack.push(Integer.parseInt(s));\n }\n }\n\n System.out.println(stack.pop());\n }\n\n private static boolean isOperator(String s) {\n switch (s) {\n case \"+\":\n case \"-\":\n case \"*\":\n case \"/\":\n return true;\n default:\n return false;\n }\n }\n\n private static int calculate(int a, int b, String op) {\n switch (op) {\n case \"+\":\n return a + b;\n case \"-\":\n return a - b;\n case \"*\":\n return a * b;\n case \"/\":\n return a / b;\n default:\n return 0;\n }\n }\n}",
"import java.io.BufferedReader;",
"BufferedReader",
"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 Exception {\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n String[] array = br.readLine().split(\" \");\n\n Stack<Integer> stack = new Stack<>();\n\n for (String s : array) {\n if (isOperator(s)) {\n int a = stack.pop();\n int b = stack.pop();\n int c = calculate(b, a, s);\n stack.push(c);\n } else {\n stack.push(Integer.parseInt(s));\n }\n }\n\n System.out.println(stack.pop());\n }\n\n private static boolean isOperator(String s) {\n switch (s) {\n case \"+\":\n case \"-\":\n case \"*\":\n case \"/\":\n return true;\n default:\n return false;\n }\n }\n\n private static int calculate(int a, int b, String op) {\n switch (op) {\n case \"+\":\n return a + b;\n case \"-\":\n return a - b;\n case \"*\":\n return a * b;\n case \"/\":\n return a / b;\n default:\n return 0;\n }\n }\n}",
"Main",
"public static void main(String[] args) throws Exception {\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n String[] array = br.readLine().split(\" \");\n\n Stack<Integer> stack = new Stack<>();\n\n for (String s : array) {\n if (isOperator(s)) {\n int a = stack.pop();\n int b = stack.pop();\n int c = calculate(b, a, s);\n stack.push(c);\n } else {\n stack.push(Integer.parseInt(s));\n }\n }\n\n System.out.println(stack.pop());\n }",
"main",
"{\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n String[] array = br.readLine().split(\" \");\n\n Stack<Integer> stack = new Stack<>();\n\n for (String s : array) {\n if (isOperator(s)) {\n int a = stack.pop();\n int b = stack.pop();\n int c = calculate(b, a, s);\n stack.push(c);\n } else {\n stack.push(Integer.parseInt(s));\n }\n }\n\n System.out.println(stack.pop());\n }",
"BufferedReader br = new BufferedReader(new InputStreamReader(System.in));",
"br",
"new BufferedReader(new InputStreamReader(System.in))",
"String[] array = br.readLine().split(\" \");",
"array",
"br.readLine().split(\" \")",
"br.readLine().split",
"br.readLine()",
"br.readLine",
"br",
"\" \"",
"Stack<Integer> stack = new Stack<>();",
"stack",
"new Stack<>()",
"for (String s : array) {\n if (isOperator(s)) {\n int a = stack.pop();\n int b = stack.pop();\n int c = calculate(b, a, s);\n stack.push(c);\n } else {\n stack.push(Integer.parseInt(s));\n }\n }",
"String s",
"array",
"{\n if (isOperator(s)) {\n int a = stack.pop();\n int b = stack.pop();\n int c = calculate(b, a, s);\n stack.push(c);\n } else {\n stack.push(Integer.parseInt(s));\n }\n }",
"{\n if (isOperator(s)) {\n int a = stack.pop();\n int b = stack.pop();\n int c = calculate(b, a, s);\n stack.push(c);\n } else {\n stack.push(Integer.parseInt(s));\n }\n }",
"if (isOperator(s)) {\n int a = stack.pop();\n int b = stack.pop();\n int c = calculate(b, a, s);\n stack.push(c);\n } else {\n stack.push(Integer.parseInt(s));\n }",
"isOperator(s)",
"isOperator",
"s",
"{\n int a = stack.pop();\n int b = stack.pop();\n int c = calculate(b, a, s);\n stack.push(c);\n }",
"int a = stack.pop();",
"a",
"stack.pop()",
"stack.pop",
"stack",
"int b = stack.pop();",
"b",
"stack.pop()",
"stack.pop",
"stack",
"int c = calculate(b, a, s);",
"c",
"calculate(b, a, s)",
"calculate",
"b",
"a",
"s",
"stack.push(c)",
"stack.push",
"stack",
"c",
"{\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 boolean isOperator(String s) {\n switch (s) {\n case \"+\":\n case \"-\":\n case \"*\":\n case \"/\":\n return true;\n default:\n return false;\n }\n }",
"isOperator",
"{\n switch (s) {\n case \"+\":\n case \"-\":\n case \"*\":\n case \"/\":\n return true;\n default:\n return false;\n }\n }",
"switch (s) {\n case \"+\":\n case \"-\":\n case \"*\":\n case \"/\":\n return true;\n default:\n return false;\n }",
"s",
"case \"+\":",
"\"+\"",
"case \"+\":",
"case \"-\":",
"\"-\"",
"case \"-\":",
"case \"*\":",
"\"*\"",
"case \"*\":",
"case \"/\":",
"\"/\"",
"case \"/\":",
"return true;",
"true",
"default:",
"default:",
"return false;",
"false",
"String s",
"s",
"private static int calculate(int a, int b, String op) {\n switch (op) {\n case \"+\":\n return a + b;\n case \"-\":\n return a - b;\n case \"*\":\n return a * b;\n case \"/\":\n return a / b;\n default:\n return 0;\n }\n }",
"calculate",
"{\n switch (op) {\n case \"+\":\n return a + b;\n case \"-\":\n return a - b;\n case \"*\":\n return a * b;\n case \"/\":\n return a / b;\n default:\n return 0;\n }\n }",
"switch (op) {\n case \"+\":\n return a + b;\n case \"-\":\n return a - b;\n case \"*\":\n return a * b;\n case \"/\":\n return a / b;\n default:\n return 0;\n }",
"op",
"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",
"case \"/\":",
"\"/\"",
"case \"/\":",
"return a / b;",
"a / b",
"a",
"b",
"default:",
"default:",
"return 0;",
"0",
"int a",
"a",
"int b",
"b",
"String op",
"op",
"public class Main {\n\n public static void main(String[] args) throws Exception {\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n String[] array = br.readLine().split(\" \");\n\n Stack<Integer> stack = new Stack<>();\n\n for (String s : array) {\n if (isOperator(s)) {\n int a = stack.pop();\n int b = stack.pop();\n int c = calculate(b, a, s);\n stack.push(c);\n } else {\n stack.push(Integer.parseInt(s));\n }\n }\n\n System.out.println(stack.pop());\n }\n\n private static boolean isOperator(String s) {\n switch (s) {\n case \"+\":\n case \"-\":\n case \"*\":\n case \"/\":\n return true;\n default:\n return false;\n }\n }\n\n private static int calculate(int a, int b, String op) {\n switch (op) {\n case \"+\":\n return a + b;\n case \"-\":\n return a - b;\n case \"*\":\n return a * b;\n case \"/\":\n return a / b;\n default:\n return 0;\n }\n }\n}",
"public class Main {\n\n public static void main(String[] args) throws Exception {\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n String[] array = br.readLine().split(\" \");\n\n Stack<Integer> stack = new Stack<>();\n\n for (String s : array) {\n if (isOperator(s)) {\n int a = stack.pop();\n int b = stack.pop();\n int c = calculate(b, a, s);\n stack.push(c);\n } else {\n stack.push(Integer.parseInt(s));\n }\n }\n\n System.out.println(stack.pop());\n }\n\n private static boolean isOperator(String s) {\n switch (s) {\n case \"+\":\n case \"-\":\n case \"*\":\n case \"/\":\n return true;\n default:\n return false;\n }\n }\n\n private static int calculate(int a, int b, String op) {\n switch (op) {\n case \"+\":\n return a + b;\n case \"-\":\n return a - b;\n case \"*\":\n return a * b;\n case \"/\":\n return a / b;\n default:\n return 0;\n }\n }\n}",
"Main"
] | import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Stack;
public class Main {
public static void main(String[] args) throws Exception {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String[] array = br.readLine().split(" ");
Stack<Integer> stack = new Stack<>();
for (String s : array) {
if (isOperator(s)) {
int a = stack.pop();
int b = stack.pop();
int c = calculate(b, a, s);
stack.push(c);
} else {
stack.push(Integer.parseInt(s));
}
}
System.out.println(stack.pop());
}
private static boolean isOperator(String s) {
switch (s) {
case "+":
case "-":
case "*":
case "/":
return true;
default:
return false;
}
}
private static int calculate(int a, int b, String op) {
switch (op) {
case "+":
return a + b;
case "-":
return a - b;
case "*":
return a * b;
case "/":
return a / b;
default:
return 0;
}
}
} |
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
38,
30,
41,
13,
20,
41,
13,
20,
41,
13,
17,
42,
4,
18,
13,
30,
41,
13,
4,
18,
13,
41,
13,
17,
41,
13,
20,
17,
0,
18,
13,
17,
20,
0,
18,
13,
17,
20,
0,
18,
13,
17,
20,
28,
13,
13,
30,
30,
14,
4,
18,
13,
13,
0,
13,
17,
14,
40,
13,
30,
14,
13,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
4,
18,
13,
4,
13,
13,
13,
13,
30,
4,
18,
13,
4,
18,
13,
13,
4,
18,
18,
13,
13,
4,
18,
13,
23,
13,
12,
13,
30,
41,
13,
17,
14,
4,
18,
13,
17,
0,
13,
2,
13,
13,
14,
4,
18,
13,
17,
0,
13,
2,
13,
13,
14,
4,
18,
13,
17,
0,
13,
2,
13,
13,
29,
13,
23,
13,
23,
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
],
[
16,
17
],
[
17,
18
],
[
17,
19
],
[
16,
20
],
[
20,
21
],
[
20,
22
],
[
16,
23
],
[
23,
24
],
[
23,
25
],
[
16,
26
],
[
26,
27
],
[
27,
28
],
[
28,
29
],
[
26,
30
],
[
30,
31
],
[
31,
32
],
[
31,
33
],
[
33,
34
],
[
34,
35
],
[
30,
36
],
[
36,
37
],
[
36,
38
],
[
30,
39
],
[
39,
40
],
[
39,
41
],
[
30,
43
],
[
43,
44
],
[
44,
45
],
[
44,
46
],
[
43,
47
],
[
30,
48
],
[
48,
49
],
[
49,
50
],
[
49,
51
],
[
48,
52
],
[
30,
53
],
[
53,
54
],
[
54,
55
],
[
54,
56
],
[
53,
57
],
[
30,
58
],
[
58,
59
],
[
58,
60
],
[
58,
61
],
[
62,
62
],
[
62,
63
],
[
63,
64
],
[
64,
65
],
[
65,
66
],
[
64,
67
],
[
63,
68
],
[
68,
69
],
[
68,
70
],
[
30,
71
],
[
71,
72
],
[
72,
73
],
[
71,
74
],
[
74,
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
],
[
91,
94
],
[
91,
95
],
[
75,
96
],
[
96,
97
],
[
97,
98
],
[
98,
99
],
[
97,
100
],
[
100,
101
],
[
101,
102
],
[
100,
103
],
[
16,
104
],
[
104,
105
],
[
105,
106
],
[
106,
107
],
[
106,
108
],
[
104,
109
],
[
109,
110
],
[
110,
111
],
[
12,
112
],
[
112,
113
],
[
10,
114
],
[
114,
115
],
[
114,
116
],
[
116,
117
],
[
117,
118
],
[
117,
119
],
[
116,
120
],
[
120,
121
],
[
121,
122
],
[
122,
123
],
[
121,
124
],
[
120,
125
],
[
125,
126
],
[
125,
127
],
[
127,
128
],
[
127,
129
],
[
116,
130
],
[
130,
131
],
[
131,
132
],
[
132,
133
],
[
131,
134
],
[
130,
135
],
[
135,
136
],
[
135,
137
],
[
137,
138
],
[
137,
139
],
[
116,
140
],
[
140,
141
],
[
141,
142
],
[
142,
143
],
[
141,
144
],
[
140,
145
],
[
145,
146
],
[
145,
147
],
[
147,
148
],
[
147,
149
],
[
116,
150
],
[
150,
151
],
[
114,
152
],
[
152,
153
],
[
114,
154
],
[
154,
155
],
[
114,
156
],
[
156,
157
]
] | [
"import java.util.ArrayDeque;\nimport java.util.Deque;\nimport java.util.Scanner;\nclass Main {\n\tpublic static void main(String[] args){\n\t\ttry(Scanner sc = new Scanner(System.in)){\n\t\t\tDeque<Integer> operando=new ArrayDeque<>();\n\t\t\tboolean isEOF=false;\n\t\t\twhile(sc.hasNext()){\n\t\t\t\tString order=sc.next();\n\t\t\t\tboolean isOperator = false;\n\t\t\t\tString[] Operator= new String[3];\n\t\t\t\tOperator[0]=new String(\"+\");\n\t\t\t\tOperator[1]=new String(\"*\");\n\t\t\t\tOperator[2]=new String(\"-\");\n\t\t\t\tfor(String s: Operator){\n\t\t\t\t\tif(order.equals(s)) isOperator=true;\n\t\t\t\t}\n\t\t\t\t//if(order.equals(\"EOF\")) isEOF=true;\n\t\t\t\tif(!isEOF){\n\t\t\t\t\tif(isOperator){\n\t\t\t\t\t\tint a = operando.pollFirst();\n\t\t\t\t\t\tint b = operando.pollFirst();\n\t\t\t\t\t\toperando.addFirst(calc(a,b,order));\n\t\t\t\t\t}else{\n\t\t\t\t\t\toperando.addFirst(Integer.parseInt(order));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(operando.pollFirst());\n\t\t}\n\t}\n\tpublic static int calc(int a, int b, String s){\n\t\tint ans=0;\n\t\tif(s.equals(\"+\"))ans= a+b;\n\t\tif(s.equals(\"-\"))ans= b-a;\n\t\tif(s.equals(\"*\"))ans= a*b;\n\t\treturn ans;\n\t}\n}",
"import java.util.ArrayDeque;",
"ArrayDeque",
"java.util",
"import java.util.Deque;",
"Deque",
"java.util",
"import java.util.Scanner;",
"Scanner",
"java.util",
"class Main {\n\tpublic static void main(String[] args){\n\t\ttry(Scanner sc = new Scanner(System.in)){\n\t\t\tDeque<Integer> operando=new ArrayDeque<>();\n\t\t\tboolean isEOF=false;\n\t\t\twhile(sc.hasNext()){\n\t\t\t\tString order=sc.next();\n\t\t\t\tboolean isOperator = false;\n\t\t\t\tString[] Operator= new String[3];\n\t\t\t\tOperator[0]=new String(\"+\");\n\t\t\t\tOperator[1]=new String(\"*\");\n\t\t\t\tOperator[2]=new String(\"-\");\n\t\t\t\tfor(String s: Operator){\n\t\t\t\t\tif(order.equals(s)) isOperator=true;\n\t\t\t\t}\n\t\t\t\t//if(order.equals(\"EOF\")) isEOF=true;\n\t\t\t\tif(!isEOF){\n\t\t\t\t\tif(isOperator){\n\t\t\t\t\t\tint a = operando.pollFirst();\n\t\t\t\t\t\tint b = operando.pollFirst();\n\t\t\t\t\t\toperando.addFirst(calc(a,b,order));\n\t\t\t\t\t}else{\n\t\t\t\t\t\toperando.addFirst(Integer.parseInt(order));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(operando.pollFirst());\n\t\t}\n\t}\n\tpublic static int calc(int a, int b, String s){\n\t\tint ans=0;\n\t\tif(s.equals(\"+\"))ans= a+b;\n\t\tif(s.equals(\"-\"))ans= b-a;\n\t\tif(s.equals(\"*\"))ans= a*b;\n\t\treturn ans;\n\t}\n}",
"Main",
"public static void main(String[] args){\n\t\ttry(Scanner sc = new Scanner(System.in)){\n\t\t\tDeque<Integer> operando=new ArrayDeque<>();\n\t\t\tboolean isEOF=false;\n\t\t\twhile(sc.hasNext()){\n\t\t\t\tString order=sc.next();\n\t\t\t\tboolean isOperator = false;\n\t\t\t\tString[] Operator= new String[3];\n\t\t\t\tOperator[0]=new String(\"+\");\n\t\t\t\tOperator[1]=new String(\"*\");\n\t\t\t\tOperator[2]=new String(\"-\");\n\t\t\t\tfor(String s: Operator){\n\t\t\t\t\tif(order.equals(s)) isOperator=true;\n\t\t\t\t}\n\t\t\t\t//if(order.equals(\"EOF\")) isEOF=true;\n\t\t\t\tif(!isEOF){\n\t\t\t\t\tif(isOperator){\n\t\t\t\t\t\tint a = operando.pollFirst();\n\t\t\t\t\t\tint b = operando.pollFirst();\n\t\t\t\t\t\toperando.addFirst(calc(a,b,order));\n\t\t\t\t\t}else{\n\t\t\t\t\t\toperando.addFirst(Integer.parseInt(order));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(operando.pollFirst());\n\t\t}\n\t}",
"main",
"{\n\t\ttry(Scanner sc = new Scanner(System.in)){\n\t\t\tDeque<Integer> operando=new ArrayDeque<>();\n\t\t\tboolean isEOF=false;\n\t\t\twhile(sc.hasNext()){\n\t\t\t\tString order=sc.next();\n\t\t\t\tboolean isOperator = false;\n\t\t\t\tString[] Operator= new String[3];\n\t\t\t\tOperator[0]=new String(\"+\");\n\t\t\t\tOperator[1]=new String(\"*\");\n\t\t\t\tOperator[2]=new String(\"-\");\n\t\t\t\tfor(String s: Operator){\n\t\t\t\t\tif(order.equals(s)) isOperator=true;\n\t\t\t\t}\n\t\t\t\t//if(order.equals(\"EOF\")) isEOF=true;\n\t\t\t\tif(!isEOF){\n\t\t\t\t\tif(isOperator){\n\t\t\t\t\t\tint a = operando.pollFirst();\n\t\t\t\t\t\tint b = operando.pollFirst();\n\t\t\t\t\t\toperando.addFirst(calc(a,b,order));\n\t\t\t\t\t}else{\n\t\t\t\t\t\toperando.addFirst(Integer.parseInt(order));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(operando.pollFirst());\n\t\t}\n\t}",
"try(Scanner sc = new Scanner(System.in)){\n\t\t\tDeque<Integer> operando=new ArrayDeque<>();\n\t\t\tboolean isEOF=false;\n\t\t\twhile(sc.hasNext()){\n\t\t\t\tString order=sc.next();\n\t\t\t\tboolean isOperator = false;\n\t\t\t\tString[] Operator= new String[3];\n\t\t\t\tOperator[0]=new String(\"+\");\n\t\t\t\tOperator[1]=new String(\"*\");\n\t\t\t\tOperator[2]=new String(\"-\");\n\t\t\t\tfor(String s: Operator){\n\t\t\t\t\tif(order.equals(s)) isOperator=true;\n\t\t\t\t}\n\t\t\t\t//if(order.equals(\"EOF\")) isEOF=true;\n\t\t\t\tif(!isEOF){\n\t\t\t\t\tif(isOperator){\n\t\t\t\t\t\tint a = operando.pollFirst();\n\t\t\t\t\t\tint b = operando.pollFirst();\n\t\t\t\t\t\toperando.addFirst(calc(a,b,order));\n\t\t\t\t\t}else{\n\t\t\t\t\t\toperando.addFirst(Integer.parseInt(order));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(operando.pollFirst());\n\t\t}",
"{\n\t\t\tDeque<Integer> operando=new ArrayDeque<>();\n\t\t\tboolean isEOF=false;\n\t\t\twhile(sc.hasNext()){\n\t\t\t\tString order=sc.next();\n\t\t\t\tboolean isOperator = false;\n\t\t\t\tString[] Operator= new String[3];\n\t\t\t\tOperator[0]=new String(\"+\");\n\t\t\t\tOperator[1]=new String(\"*\");\n\t\t\t\tOperator[2]=new String(\"-\");\n\t\t\t\tfor(String s: Operator){\n\t\t\t\t\tif(order.equals(s)) isOperator=true;\n\t\t\t\t}\n\t\t\t\t//if(order.equals(\"EOF\")) isEOF=true;\n\t\t\t\tif(!isEOF){\n\t\t\t\t\tif(isOperator){\n\t\t\t\t\t\tint a = operando.pollFirst();\n\t\t\t\t\t\tint b = operando.pollFirst();\n\t\t\t\t\t\toperando.addFirst(calc(a,b,order));\n\t\t\t\t\t}else{\n\t\t\t\t\t\toperando.addFirst(Integer.parseInt(order));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(operando.pollFirst());\n\t\t}",
"Scanner sc = new Scanner(System.in)",
"Scanner sc = new Scanner(System.in)",
"new Scanner(System.in)",
"Deque<Integer> operando=new ArrayDeque<>();",
"operando",
"new ArrayDeque<>()",
"boolean isEOF=false;",
"isEOF",
"false",
"while(sc.hasNext()){\n\t\t\t\tString order=sc.next();\n\t\t\t\tboolean isOperator = false;\n\t\t\t\tString[] Operator= new String[3];\n\t\t\t\tOperator[0]=new String(\"+\");\n\t\t\t\tOperator[1]=new String(\"*\");\n\t\t\t\tOperator[2]=new String(\"-\");\n\t\t\t\tfor(String s: Operator){\n\t\t\t\t\tif(order.equals(s)) isOperator=true;\n\t\t\t\t}\n\t\t\t\t//if(order.equals(\"EOF\")) isEOF=true;\n\t\t\t\tif(!isEOF){\n\t\t\t\t\tif(isOperator){\n\t\t\t\t\t\tint a = operando.pollFirst();\n\t\t\t\t\t\tint b = operando.pollFirst();\n\t\t\t\t\t\toperando.addFirst(calc(a,b,order));\n\t\t\t\t\t}else{\n\t\t\t\t\t\toperando.addFirst(Integer.parseInt(order));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}",
"sc.hasNext()",
"sc.hasNext",
"sc",
"{\n\t\t\t\tString order=sc.next();\n\t\t\t\tboolean isOperator = false;\n\t\t\t\tString[] Operator= new String[3];\n\t\t\t\tOperator[0]=new String(\"+\");\n\t\t\t\tOperator[1]=new String(\"*\");\n\t\t\t\tOperator[2]=new String(\"-\");\n\t\t\t\tfor(String s: Operator){\n\t\t\t\t\tif(order.equals(s)) isOperator=true;\n\t\t\t\t}\n\t\t\t\t//if(order.equals(\"EOF\")) isEOF=true;\n\t\t\t\tif(!isEOF){\n\t\t\t\t\tif(isOperator){\n\t\t\t\t\t\tint a = operando.pollFirst();\n\t\t\t\t\t\tint b = operando.pollFirst();\n\t\t\t\t\t\toperando.addFirst(calc(a,b,order));\n\t\t\t\t\t}else{\n\t\t\t\t\t\toperando.addFirst(Integer.parseInt(order));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}",
"String order=sc.next();",
"order",
"sc.next()",
"sc.next",
"sc",
"boolean isOperator = false;",
"isOperator",
"false",
"String[] Operator= new String[3];",
"Operator",
"new String[3]",
"3",
"Operator[0]=new String(\"+\")",
"Operator[0]",
"Operator",
"0",
"new String(\"+\")",
"Operator[1]=new String(\"*\")",
"Operator[1]",
"Operator",
"1",
"new String(\"*\")",
"Operator[2]=new String(\"-\")",
"Operator[2]",
"Operator",
"2",
"new String(\"-\")",
"for(String s: Operator){\n\t\t\t\t\tif(order.equals(s)) isOperator=true;\n\t\t\t\t}",
"String s",
"Operator",
"{\n\t\t\t\t\tif(order.equals(s)) isOperator=true;\n\t\t\t\t}",
"{\n\t\t\t\t\tif(order.equals(s)) isOperator=true;\n\t\t\t\t}",
"if(order.equals(s)) isOperator=true;",
"order.equals(s)",
"order.equals",
"order",
"s",
"isOperator=true",
"isOperator",
"true",
"if(!isEOF){\n\t\t\t\t\tif(isOperator){\n\t\t\t\t\t\tint a = operando.pollFirst();\n\t\t\t\t\t\tint b = operando.pollFirst();\n\t\t\t\t\t\toperando.addFirst(calc(a,b,order));\n\t\t\t\t\t}else{\n\t\t\t\t\t\toperando.addFirst(Integer.parseInt(order));\n\t\t\t\t\t}\n\t\t\t\t}",
"!isEOF",
"isEOF",
"{\n\t\t\t\t\tif(isOperator){\n\t\t\t\t\t\tint a = operando.pollFirst();\n\t\t\t\t\t\tint b = operando.pollFirst();\n\t\t\t\t\t\toperando.addFirst(calc(a,b,order));\n\t\t\t\t\t}else{\n\t\t\t\t\t\toperando.addFirst(Integer.parseInt(order));\n\t\t\t\t\t}\n\t\t\t\t}",
"if(isOperator){\n\t\t\t\t\t\tint a = operando.pollFirst();\n\t\t\t\t\t\tint b = operando.pollFirst();\n\t\t\t\t\t\toperando.addFirst(calc(a,b,order));\n\t\t\t\t\t}else{\n\t\t\t\t\t\toperando.addFirst(Integer.parseInt(order));\n\t\t\t\t\t}",
"isOperator",
"{\n\t\t\t\t\t\tint a = operando.pollFirst();\n\t\t\t\t\t\tint b = operando.pollFirst();\n\t\t\t\t\t\toperando.addFirst(calc(a,b,order));\n\t\t\t\t\t}",
"int a = operando.pollFirst();",
"a",
"operando.pollFirst()",
"operando.pollFirst",
"operando",
"int b = operando.pollFirst();",
"b",
"operando.pollFirst()",
"operando.pollFirst",
"operando",
"operando.addFirst(calc(a,b,order))",
"operando.addFirst",
"operando",
"calc(a,b,order)",
"calc",
"a",
"b",
"order",
"{\n\t\t\t\t\t\toperando.addFirst(Integer.parseInt(order));\n\t\t\t\t\t}",
"operando.addFirst(Integer.parseInt(order))",
"operando.addFirst",
"operando",
"Integer.parseInt(order)",
"Integer.parseInt",
"Integer",
"order",
"System.out.println(operando.pollFirst())",
"System.out.println",
"System.out",
"System",
"System.out",
"operando.pollFirst()",
"operando.pollFirst",
"operando",
"String[] args",
"args",
"public static int calc(int a, int b, String s){\n\t\tint ans=0;\n\t\tif(s.equals(\"+\"))ans= a+b;\n\t\tif(s.equals(\"-\"))ans= b-a;\n\t\tif(s.equals(\"*\"))ans= a*b;\n\t\treturn ans;\n\t}",
"calc",
"{\n\t\tint ans=0;\n\t\tif(s.equals(\"+\"))ans= a+b;\n\t\tif(s.equals(\"-\"))ans= b-a;\n\t\tif(s.equals(\"*\"))ans= a*b;\n\t\treturn ans;\n\t}",
"int ans=0;",
"ans",
"0",
"if(s.equals(\"+\"))ans= a+b;",
"s.equals(\"+\")",
"s.equals",
"s",
"\"+\"",
"ans= a+b",
"ans",
"a+b",
"a",
"b",
"if(s.equals(\"-\"))ans= b-a;",
"s.equals(\"-\")",
"s.equals",
"s",
"\"-\"",
"ans= b-a",
"ans",
"b-a",
"b",
"a",
"if(s.equals(\"*\"))ans= a*b;",
"s.equals(\"*\")",
"s.equals",
"s",
"\"*\"",
"ans= a*b",
"ans",
"a*b",
"a",
"b",
"return ans;",
"ans",
"int a",
"a",
"int b",
"b",
"String s",
"s"
] | import java.util.ArrayDeque;
import java.util.Deque;
import java.util.Scanner;
class Main {
public static void main(String[] args){
try(Scanner sc = new Scanner(System.in)){
Deque<Integer> operando=new ArrayDeque<>();
boolean isEOF=false;
while(sc.hasNext()){
String order=sc.next();
boolean isOperator = false;
String[] Operator= new String[3];
Operator[0]=new String("+");
Operator[1]=new String("*");
Operator[2]=new String("-");
for(String s: Operator){
if(order.equals(s)) isOperator=true;
}
//if(order.equals("EOF")) isEOF=true;
if(!isEOF){
if(isOperator){
int a = operando.pollFirst();
int b = operando.pollFirst();
operando.addFirst(calc(a,b,order));
}else{
operando.addFirst(Integer.parseInt(order));
}
}
}
System.out.println(operando.pollFirst());
}
}
public static int calc(int a, int b, String s){
int ans=0;
if(s.equals("+"))ans= a+b;
if(s.equals("-"))ans= b-a;
if(s.equals("*"))ans= a*b;
return ans;
}
} |
[
7,
15,
13,
17,
6,
13,
41,
13,
20,
17,
41,
13,
17,
12,
13,
30,
14,
2,
13,
17,
30,
4,
18,
18,
13,
13,
17,
4,
18,
13,
17,
40,
13,
0,
18,
13,
13,
13,
23,
13,
12,
13,
30,
14,
2,
13,
17,
30,
4,
18,
18,
13,
13,
17,
4,
18,
13,
17,
40,
13,
29,
18,
13,
2,
13,
17,
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,
4,
18,
13,
17,
41,
13,
18,
13,
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,
13,
41,
13,
4,
13,
41,
13,
2,
13,
13,
4,
13,
13,
14,
4,
18,
18,
13,
13,
17,
30,
41,
13,
4,
13,
41,
13,
4,
13,
41,
13,
2,
13,
13,
4,
13,
13,
14,
4,
18,
18,
13,
13,
17,
30,
41,
13,
4,
13,
41,
13,
4,
13,
41,
13,
2,
13,
13,
4,
13,
13,
14,
4,
13,
18,
13,
13,
30,
41,
13,
4,
18,
13,
18,
13,
13,
4,
13,
13,
4,
18,
18,
13,
13,
18,
13,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
217,
5
],
[
217,
6
],
[
6,
7
],
[
6,
8
],
[
217,
10
],
[
10,
11
],
[
10,
12
],
[
217,
13
],
[
13,
14
],
[
13,
15
],
[
15,
16
],
[
16,
17
],
[
17,
18
],
[
17,
19
],
[
16,
20
],
[
20,
21
],
[
21,
22
],
[
22,
23
],
[
23,
24
],
[
23,
25
],
[
21,
26
],
[
20,
27
],
[
27,
28
],
[
28,
29
],
[
27,
30
],
[
16,
31
],
[
31,
32
],
[
15,
33
],
[
33,
34
],
[
34,
35
],
[
34,
36
],
[
33,
37
],
[
13,
38
],
[
38,
39
],
[
217,
40
],
[
40,
41
],
[
40,
42
],
[
42,
43
],
[
43,
44
],
[
44,
45
],
[
44,
46
],
[
43,
47
],
[
47,
48
],
[
48,
49
],
[
49,
50
],
[
50,
51
],
[
50,
52
],
[
48,
53
],
[
47,
54
],
[
54,
55
],
[
55,
56
],
[
54,
57
],
[
43,
58
],
[
58,
59
],
[
42,
60
],
[
60,
61
],
[
61,
62
],
[
61,
63
],
[
63,
64
],
[
63,
65
],
[
217,
66
],
[
66,
67
],
[
66,
68
],
[
68,
69
],
[
69,
70
],
[
70,
71
],
[
70,
72
],
[
72,
73
],
[
73,
74
],
[
69,
75
],
[
75,
76
],
[
76,
77
],
[
77,
78
],
[
76,
79
],
[
75,
80
],
[
80,
81
],
[
66,
82
],
[
82,
83
],
[
217,
84
],
[
84,
85
],
[
84,
86
],
[
86,
87
],
[
87,
88
],
[
87,
89
],
[
86,
90
],
[
90,
91
],
[
90,
92
],
[
92,
93
],
[
93,
94
],
[
94,
95
],
[
95,
96
],
[
92,
97
],
[
86,
98
],
[
98,
99
],
[
98,
100
],
[
100,
101
],
[
100,
102
],
[
86,
103
],
[
103,
104
],
[
104,
105
],
[
105,
106
],
[
105,
107
],
[
103,
108
],
[
108,
109
],
[
108,
110
],
[
103,
111
],
[
111,
112
],
[
112,
113
],
[
103,
114
],
[
115,
115
],
[
115,
116
],
[
116,
117
],
[
117,
118
],
[
118,
119
],
[
119,
120
],
[
119,
121
],
[
117,
122
],
[
116,
123
],
[
123,
124
],
[
124,
125
],
[
124,
126
],
[
126,
127
],
[
123,
128
],
[
128,
129
],
[
128,
130
],
[
130,
131
],
[
123,
132
],
[
132,
133
],
[
132,
134
],
[
134,
135
],
[
134,
136
],
[
123,
137
],
[
137,
138
],
[
137,
139
],
[
116,
140
],
[
140,
141
],
[
141,
142
],
[
142,
143
],
[
143,
144
],
[
143,
145
],
[
141,
146
],
[
140,
147
],
[
147,
148
],
[
148,
149
],
[
148,
150
],
[
150,
151
],
[
147,
152
],
[
152,
153
],
[
152,
154
],
[
154,
155
],
[
147,
156
],
[
156,
157
],
[
156,
158
],
[
158,
159
],
[
158,
160
],
[
147,
161
],
[
161,
162
],
[
161,
163
],
[
140,
164
],
[
164,
165
],
[
165,
166
],
[
166,
167
],
[
167,
168
],
[
167,
169
],
[
165,
170
],
[
164,
171
],
[
171,
172
],
[
172,
173
],
[
172,
174
],
[
174,
175
],
[
171,
176
],
[
176,
177
],
[
176,
178
],
[
178,
179
],
[
171,
180
],
[
180,
181
],
[
180,
182
],
[
182,
183
],
[
182,
184
],
[
171,
185
],
[
185,
186
],
[
185,
187
],
[
164,
188
],
[
188,
189
],
[
189,
190
],
[
189,
191
],
[
191,
192
],
[
191,
193
],
[
188,
194
],
[
194,
195
],
[
195,
196
],
[
195,
197
],
[
197,
198
],
[
198,
199
],
[
197,
200
],
[
200,
201
],
[
200,
202
],
[
194,
203
],
[
203,
204
],
[
203,
205
],
[
86,
206
],
[
206,
207
],
[
207,
208
],
[
208,
209
],
[
208,
210
],
[
206,
211
],
[
211,
212
],
[
211,
213
],
[
84,
214
],
[
214,
215
],
[
0,
216
],
[
216,
217
],
[
216,
218
]
] | [
"import java.util.Scanner;\n\npublic class Main {\n\tstatic int[] str = new int[300];\n\tstatic int i = 0;\n\tstatic void push(int k) {\n\t\tif (i >=299){\n\t\t\tSystem.out.print(\"?????????????????????\");\n\t\t\tSystem.exit(1);\n\t\t}else\n\t\t\ti++;\n\t\t\tstr[i] = k;\n\t\t}\n\tstatic int pop() {\n\t\tif (i == 0){\n\t\t\tSystem.out.print(\"??¢??????????????????\");\n\t\t\tSystem.exit(1);\n\t\t}else\n\t\ti--;\n\t\treturn str[i+1];\n\n\t}\n\tstatic boolean isNumber(String j) {\n\t try {\n\t Integer.parseInt(j);\n\t return true;\n\t } catch (NumberFormatException e) {\n\t return false;\n\t }\n\t}\n\n\tpublic static void main(String[] args){\n\t\tScanner in = new Scanner(System.in);\n\t\tString[] array = in.nextLine().split(\" \");\n\t\tint size = array.length;\n\t\tfor (int h=0;h<size;h++){\n\t\t\tif (array[h].equals(\"+\")){\n\t\t\t\tint b = pop();\n\t\t\t\tint c = pop();\n\t\t\t\tint d = c + b;\n\t\t\t\tpush(d);\n\t\t\t}\n\t\t\telse if (array[h].equals(\"-\")){\n\t\t\t\tint b = pop();\n\t\t\t\tint c = pop();\n\t\t\t\tint d = c - b;\n\t\t\t\tpush(d);\n\t\t\t}\n\t\t\telse if (array[h].equals(\"*\")){\n\t\t\t\tint b = pop();\n\t\t\t\tint c = pop();\n\t\t\t\tint d = c * b;\n\t\t\t\tpush(d);\n\t\t\t}\n\t\t\telse\n\t\t\t\tif (isNumber(array[h])){\n\t\t\t\tint k = Integer.parseInt(array[h]);\n\t\t\t\tpush(k);\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(str[i]);\n\t}\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\tstatic int[] str = new int[300];\n\tstatic int i = 0;\n\tstatic void push(int k) {\n\t\tif (i >=299){\n\t\t\tSystem.out.print(\"?????????????????????\");\n\t\t\tSystem.exit(1);\n\t\t}else\n\t\t\ti++;\n\t\t\tstr[i] = k;\n\t\t}\n\tstatic int pop() {\n\t\tif (i == 0){\n\t\t\tSystem.out.print(\"??¢??????????????????\");\n\t\t\tSystem.exit(1);\n\t\t}else\n\t\ti--;\n\t\treturn str[i+1];\n\n\t}\n\tstatic boolean isNumber(String j) {\n\t try {\n\t Integer.parseInt(j);\n\t return true;\n\t } catch (NumberFormatException e) {\n\t return false;\n\t }\n\t}\n\n\tpublic static void main(String[] args){\n\t\tScanner in = new Scanner(System.in);\n\t\tString[] array = in.nextLine().split(\" \");\n\t\tint size = array.length;\n\t\tfor (int h=0;h<size;h++){\n\t\t\tif (array[h].equals(\"+\")){\n\t\t\t\tint b = pop();\n\t\t\t\tint c = pop();\n\t\t\t\tint d = c + b;\n\t\t\t\tpush(d);\n\t\t\t}\n\t\t\telse if (array[h].equals(\"-\")){\n\t\t\t\tint b = pop();\n\t\t\t\tint c = pop();\n\t\t\t\tint d = c - b;\n\t\t\t\tpush(d);\n\t\t\t}\n\t\t\telse if (array[h].equals(\"*\")){\n\t\t\t\tint b = pop();\n\t\t\t\tint c = pop();\n\t\t\t\tint d = c * b;\n\t\t\t\tpush(d);\n\t\t\t}\n\t\t\telse\n\t\t\t\tif (isNumber(array[h])){\n\t\t\t\tint k = Integer.parseInt(array[h]);\n\t\t\t\tpush(k);\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(str[i]);\n\t}\n}",
"Main",
"static int[] str = new int[300];",
"str",
"new int[300]",
"300",
"static int i = 0;",
"i",
"0",
"static void push(int k) {\n\t\tif (i >=299){\n\t\t\tSystem.out.print(\"?????????????????????\");\n\t\t\tSystem.exit(1);\n\t\t}else\n\t\t\ti++;\n\t\t\tstr[i] = k;\n\t\t}",
"push",
"{\n\t\tif (i >=299){\n\t\t\tSystem.out.print(\"?????????????????????\");\n\t\t\tSystem.exit(1);\n\t\t}else\n\t\t\ti++;\n\t\t\tstr[i] = k;\n\t\t}",
"if (i >=299){\n\t\t\tSystem.out.print(\"?????????????????????\");\n\t\t\tSystem.exit(1);\n\t\t}else\n\t\t\ti++;",
"i >=299",
"i",
"299",
"{\n\t\t\tSystem.out.print(\"?????????????????????\");\n\t\t\tSystem.exit(1);\n\t\t}",
"System.out.print(\"?????????????????????\")",
"System.out.print",
"System.out",
"System",
"System.out",
"\"?????????????????????\"",
"System.exit(1)",
"System.exit",
"System",
"1",
"i++",
"i",
"str[i] = k",
"str[i]",
"str",
"i",
"k",
"int k",
"k",
"static int pop() {\n\t\tif (i == 0){\n\t\t\tSystem.out.print(\"??¢??????????????????\");\n\t\t\tSystem.exit(1);\n\t\t}else\n\t\ti--;\n\t\treturn str[i+1];\n\n\t}",
"pop",
"{\n\t\tif (i == 0){\n\t\t\tSystem.out.print(\"??¢??????????????????\");\n\t\t\tSystem.exit(1);\n\t\t}else\n\t\ti--;\n\t\treturn str[i+1];\n\n\t}",
"if (i == 0){\n\t\t\tSystem.out.print(\"??¢??????????????????\");\n\t\t\tSystem.exit(1);\n\t\t}else\n\t\ti--;",
"i == 0",
"i",
"0",
"{\n\t\t\tSystem.out.print(\"??¢??????????????????\");\n\t\t\tSystem.exit(1);\n\t\t}",
"System.out.print(\"??¢??????????????????\")",
"System.out.print",
"System.out",
"System",
"System.out",
"\"??¢??????????????????\"",
"System.exit(1)",
"System.exit",
"System",
"1",
"i--",
"i",
"return str[i+1];",
"str[i+1]",
"str",
"i+1",
"i",
"1",
"static boolean isNumber(String j) {\n\t try {\n\t Integer.parseInt(j);\n\t return true;\n\t } catch (NumberFormatException e) {\n\t return false;\n\t }\n\t}",
"isNumber",
"{\n\t try {\n\t Integer.parseInt(j);\n\t return true;\n\t } catch (NumberFormatException e) {\n\t return false;\n\t }\n\t}",
"try {\n\t Integer.parseInt(j);\n\t return true;\n\t } catch (NumberFormatException e) {\n\t return false;\n\t }",
"catch (NumberFormatException e) {\n\t return false;\n\t }",
"NumberFormatException e",
"{\n\t return false;\n\t }",
"return false;",
"false",
"{\n\t Integer.parseInt(j);\n\t return true;\n\t }",
"Integer.parseInt(j)",
"Integer.parseInt",
"Integer",
"j",
"return true;",
"true",
"String j",
"j",
"public static void main(String[] args){\n\t\tScanner in = new Scanner(System.in);\n\t\tString[] array = in.nextLine().split(\" \");\n\t\tint size = array.length;\n\t\tfor (int h=0;h<size;h++){\n\t\t\tif (array[h].equals(\"+\")){\n\t\t\t\tint b = pop();\n\t\t\t\tint c = pop();\n\t\t\t\tint d = c + b;\n\t\t\t\tpush(d);\n\t\t\t}\n\t\t\telse if (array[h].equals(\"-\")){\n\t\t\t\tint b = pop();\n\t\t\t\tint c = pop();\n\t\t\t\tint d = c - b;\n\t\t\t\tpush(d);\n\t\t\t}\n\t\t\telse if (array[h].equals(\"*\")){\n\t\t\t\tint b = pop();\n\t\t\t\tint c = pop();\n\t\t\t\tint d = c * b;\n\t\t\t\tpush(d);\n\t\t\t}\n\t\t\telse\n\t\t\t\tif (isNumber(array[h])){\n\t\t\t\tint k = Integer.parseInt(array[h]);\n\t\t\t\tpush(k);\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(str[i]);\n\t}",
"main",
"{\n\t\tScanner in = new Scanner(System.in);\n\t\tString[] array = in.nextLine().split(\" \");\n\t\tint size = array.length;\n\t\tfor (int h=0;h<size;h++){\n\t\t\tif (array[h].equals(\"+\")){\n\t\t\t\tint b = pop();\n\t\t\t\tint c = pop();\n\t\t\t\tint d = c + b;\n\t\t\t\tpush(d);\n\t\t\t}\n\t\t\telse if (array[h].equals(\"-\")){\n\t\t\t\tint b = pop();\n\t\t\t\tint c = pop();\n\t\t\t\tint d = c - b;\n\t\t\t\tpush(d);\n\t\t\t}\n\t\t\telse if (array[h].equals(\"*\")){\n\t\t\t\tint b = pop();\n\t\t\t\tint c = pop();\n\t\t\t\tint d = c * b;\n\t\t\t\tpush(d);\n\t\t\t}\n\t\t\telse\n\t\t\t\tif (isNumber(array[h])){\n\t\t\t\tint k = Integer.parseInt(array[h]);\n\t\t\t\tpush(k);\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(str[i]);\n\t}",
"Scanner in = new Scanner(System.in);",
"in",
"new Scanner(System.in)",
"String[] array = in.nextLine().split(\" \");",
"array",
"in.nextLine().split(\" \")",
"in.nextLine().split",
"in.nextLine()",
"in.nextLine",
"in",
"\" \"",
"int size = array.length;",
"size",
"array.length",
"array",
"array.length",
"for (int h=0;h<size;h++){\n\t\t\tif (array[h].equals(\"+\")){\n\t\t\t\tint b = pop();\n\t\t\t\tint c = pop();\n\t\t\t\tint d = c + b;\n\t\t\t\tpush(d);\n\t\t\t}\n\t\t\telse if (array[h].equals(\"-\")){\n\t\t\t\tint b = pop();\n\t\t\t\tint c = pop();\n\t\t\t\tint d = c - b;\n\t\t\t\tpush(d);\n\t\t\t}\n\t\t\telse if (array[h].equals(\"*\")){\n\t\t\t\tint b = pop();\n\t\t\t\tint c = pop();\n\t\t\t\tint d = c * b;\n\t\t\t\tpush(d);\n\t\t\t}\n\t\t\telse\n\t\t\t\tif (isNumber(array[h])){\n\t\t\t\tint k = Integer.parseInt(array[h]);\n\t\t\t\tpush(k);\n\t\t\t}\n\t\t}",
"int h=0;",
"int h=0;",
"h",
"0",
"h<size",
"h",
"size",
"h++",
"h++",
"h",
"{\n\t\t\tif (array[h].equals(\"+\")){\n\t\t\t\tint b = pop();\n\t\t\t\tint c = pop();\n\t\t\t\tint d = c + b;\n\t\t\t\tpush(d);\n\t\t\t}\n\t\t\telse if (array[h].equals(\"-\")){\n\t\t\t\tint b = pop();\n\t\t\t\tint c = pop();\n\t\t\t\tint d = c - b;\n\t\t\t\tpush(d);\n\t\t\t}\n\t\t\telse if (array[h].equals(\"*\")){\n\t\t\t\tint b = pop();\n\t\t\t\tint c = pop();\n\t\t\t\tint d = c * b;\n\t\t\t\tpush(d);\n\t\t\t}\n\t\t\telse\n\t\t\t\tif (isNumber(array[h])){\n\t\t\t\tint k = Integer.parseInt(array[h]);\n\t\t\t\tpush(k);\n\t\t\t}\n\t\t}",
"{\n\t\t\tif (array[h].equals(\"+\")){\n\t\t\t\tint b = pop();\n\t\t\t\tint c = pop();\n\t\t\t\tint d = c + b;\n\t\t\t\tpush(d);\n\t\t\t}\n\t\t\telse if (array[h].equals(\"-\")){\n\t\t\t\tint b = pop();\n\t\t\t\tint c = pop();\n\t\t\t\tint d = c - b;\n\t\t\t\tpush(d);\n\t\t\t}\n\t\t\telse if (array[h].equals(\"*\")){\n\t\t\t\tint b = pop();\n\t\t\t\tint c = pop();\n\t\t\t\tint d = c * b;\n\t\t\t\tpush(d);\n\t\t\t}\n\t\t\telse\n\t\t\t\tif (isNumber(array[h])){\n\t\t\t\tint k = Integer.parseInt(array[h]);\n\t\t\t\tpush(k);\n\t\t\t}\n\t\t}",
"if (array[h].equals(\"+\")){\n\t\t\t\tint b = pop();\n\t\t\t\tint c = pop();\n\t\t\t\tint d = c + b;\n\t\t\t\tpush(d);\n\t\t\t}\n\t\t\telse if (array[h].equals(\"-\")){\n\t\t\t\tint b = pop();\n\t\t\t\tint c = pop();\n\t\t\t\tint d = c - b;\n\t\t\t\tpush(d);\n\t\t\t}\n\t\t\telse if (array[h].equals(\"*\")){\n\t\t\t\tint b = pop();\n\t\t\t\tint c = pop();\n\t\t\t\tint d = c * b;\n\t\t\t\tpush(d);\n\t\t\t}\n\t\t\telse\n\t\t\t\tif (isNumber(array[h])){\n\t\t\t\tint k = Integer.parseInt(array[h]);\n\t\t\t\tpush(k);\n\t\t\t}",
"array[h].equals(\"+\")",
"array[h].equals",
"array[h]",
"array",
"h",
"\"+\"",
"{\n\t\t\t\tint b = pop();\n\t\t\t\tint c = pop();\n\t\t\t\tint d = c + b;\n\t\t\t\tpush(d);\n\t\t\t}",
"int b = pop();",
"b",
"pop()",
"pop",
"int c = pop();",
"c",
"pop()",
"pop",
"int d = c + b;",
"d",
"c + b",
"c",
"b",
"push(d)",
"push",
"d",
"if (array[h].equals(\"-\")){\n\t\t\t\tint b = pop();\n\t\t\t\tint c = pop();\n\t\t\t\tint d = c - b;\n\t\t\t\tpush(d);\n\t\t\t}\n\t\t\telse if (array[h].equals(\"*\")){\n\t\t\t\tint b = pop();\n\t\t\t\tint c = pop();\n\t\t\t\tint d = c * b;\n\t\t\t\tpush(d);\n\t\t\t}\n\t\t\telse\n\t\t\t\tif (isNumber(array[h])){\n\t\t\t\tint k = Integer.parseInt(array[h]);\n\t\t\t\tpush(k);\n\t\t\t}",
"array[h].equals(\"-\")",
"array[h].equals",
"array[h]",
"array",
"h",
"\"-\"",
"{\n\t\t\t\tint b = pop();\n\t\t\t\tint c = pop();\n\t\t\t\tint d = c - b;\n\t\t\t\tpush(d);\n\t\t\t}",
"int b = pop();",
"b",
"pop()",
"pop",
"int c = pop();",
"c",
"pop()",
"pop",
"int d = c - b;",
"d",
"c - b",
"c",
"b",
"push(d)",
"push",
"d",
"if (array[h].equals(\"*\")){\n\t\t\t\tint b = pop();\n\t\t\t\tint c = pop();\n\t\t\t\tint d = c * b;\n\t\t\t\tpush(d);\n\t\t\t}\n\t\t\telse\n\t\t\t\tif (isNumber(array[h])){\n\t\t\t\tint k = Integer.parseInt(array[h]);\n\t\t\t\tpush(k);\n\t\t\t}",
"array[h].equals(\"*\")",
"array[h].equals",
"array[h]",
"array",
"h",
"\"*\"",
"{\n\t\t\t\tint b = pop();\n\t\t\t\tint c = pop();\n\t\t\t\tint d = c * b;\n\t\t\t\tpush(d);\n\t\t\t}",
"int b = pop();",
"b",
"pop()",
"pop",
"int c = pop();",
"c",
"pop()",
"pop",
"int d = c * b;",
"d",
"c * b",
"c",
"b",
"push(d)",
"push",
"d",
"if (isNumber(array[h])){\n\t\t\t\tint k = Integer.parseInt(array[h]);\n\t\t\t\tpush(k);\n\t\t\t}",
"isNumber(array[h])",
"isNumber",
"array[h]",
"array",
"h",
"{\n\t\t\t\tint k = Integer.parseInt(array[h]);\n\t\t\t\tpush(k);\n\t\t\t}",
"int k = Integer.parseInt(array[h]);",
"k",
"Integer.parseInt(array[h])",
"Integer.parseInt",
"Integer",
"array[h]",
"array",
"h",
"push(k)",
"push",
"k",
"System.out.println(str[i])",
"System.out.println",
"System.out",
"System",
"System.out",
"str[i]",
"str",
"i",
"String[] args",
"args",
"public class Main {\n\tstatic int[] str = new int[300];\n\tstatic int i = 0;\n\tstatic void push(int k) {\n\t\tif (i >=299){\n\t\t\tSystem.out.print(\"?????????????????????\");\n\t\t\tSystem.exit(1);\n\t\t}else\n\t\t\ti++;\n\t\t\tstr[i] = k;\n\t\t}\n\tstatic int pop() {\n\t\tif (i == 0){\n\t\t\tSystem.out.print(\"??¢??????????????????\");\n\t\t\tSystem.exit(1);\n\t\t}else\n\t\ti--;\n\t\treturn str[i+1];\n\n\t}\n\tstatic boolean isNumber(String j) {\n\t try {\n\t Integer.parseInt(j);\n\t return true;\n\t } catch (NumberFormatException e) {\n\t return false;\n\t }\n\t}\n\n\tpublic static void main(String[] args){\n\t\tScanner in = new Scanner(System.in);\n\t\tString[] array = in.nextLine().split(\" \");\n\t\tint size = array.length;\n\t\tfor (int h=0;h<size;h++){\n\t\t\tif (array[h].equals(\"+\")){\n\t\t\t\tint b = pop();\n\t\t\t\tint c = pop();\n\t\t\t\tint d = c + b;\n\t\t\t\tpush(d);\n\t\t\t}\n\t\t\telse if (array[h].equals(\"-\")){\n\t\t\t\tint b = pop();\n\t\t\t\tint c = pop();\n\t\t\t\tint d = c - b;\n\t\t\t\tpush(d);\n\t\t\t}\n\t\t\telse if (array[h].equals(\"*\")){\n\t\t\t\tint b = pop();\n\t\t\t\tint c = pop();\n\t\t\t\tint d = c * b;\n\t\t\t\tpush(d);\n\t\t\t}\n\t\t\telse\n\t\t\t\tif (isNumber(array[h])){\n\t\t\t\tint k = Integer.parseInt(array[h]);\n\t\t\t\tpush(k);\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(str[i]);\n\t}\n}",
"public class Main {\n\tstatic int[] str = new int[300];\n\tstatic int i = 0;\n\tstatic void push(int k) {\n\t\tif (i >=299){\n\t\t\tSystem.out.print(\"?????????????????????\");\n\t\t\tSystem.exit(1);\n\t\t}else\n\t\t\ti++;\n\t\t\tstr[i] = k;\n\t\t}\n\tstatic int pop() {\n\t\tif (i == 0){\n\t\t\tSystem.out.print(\"??¢??????????????????\");\n\t\t\tSystem.exit(1);\n\t\t}else\n\t\ti--;\n\t\treturn str[i+1];\n\n\t}\n\tstatic boolean isNumber(String j) {\n\t try {\n\t Integer.parseInt(j);\n\t return true;\n\t } catch (NumberFormatException e) {\n\t return false;\n\t }\n\t}\n\n\tpublic static void main(String[] args){\n\t\tScanner in = new Scanner(System.in);\n\t\tString[] array = in.nextLine().split(\" \");\n\t\tint size = array.length;\n\t\tfor (int h=0;h<size;h++){\n\t\t\tif (array[h].equals(\"+\")){\n\t\t\t\tint b = pop();\n\t\t\t\tint c = pop();\n\t\t\t\tint d = c + b;\n\t\t\t\tpush(d);\n\t\t\t}\n\t\t\telse if (array[h].equals(\"-\")){\n\t\t\t\tint b = pop();\n\t\t\t\tint c = pop();\n\t\t\t\tint d = c - b;\n\t\t\t\tpush(d);\n\t\t\t}\n\t\t\telse if (array[h].equals(\"*\")){\n\t\t\t\tint b = pop();\n\t\t\t\tint c = pop();\n\t\t\t\tint d = c * b;\n\t\t\t\tpush(d);\n\t\t\t}\n\t\t\telse\n\t\t\t\tif (isNumber(array[h])){\n\t\t\t\tint k = Integer.parseInt(array[h]);\n\t\t\t\tpush(k);\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(str[i]);\n\t}\n}",
"Main"
] | import java.util.Scanner;
public class Main {
static int[] str = new int[300];
static int i = 0;
static void push(int k) {
if (i >=299){
System.out.print("?????????????????????");
System.exit(1);
}else
i++;
str[i] = k;
}
static int pop() {
if (i == 0){
System.out.print("??¢??????????????????");
System.exit(1);
}else
i--;
return str[i+1];
}
static boolean isNumber(String j) {
try {
Integer.parseInt(j);
return true;
} catch (NumberFormatException e) {
return false;
}
}
public static void main(String[] args){
Scanner in = new Scanner(System.in);
String[] array = in.nextLine().split(" ");
int size = array.length;
for (int h=0;h<size;h++){
if (array[h].equals("+")){
int b = pop();
int c = pop();
int d = c + b;
push(d);
}
else if (array[h].equals("-")){
int b = pop();
int c = pop();
int d = c - b;
push(d);
}
else if (array[h].equals("*")){
int b = pop();
int c = pop();
int d = c * b;
push(d);
}
else
if (isNumber(array[h])){
int k = Integer.parseInt(array[h]);
push(k);
}
}
System.out.println(str[i]);
}
} |
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
41,
13,
41,
13,
41,
13,
17,
41,
13,
20,
41,
13,
20,
42,
4,
18,
13,
30,
0,
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,
0,
13,
4,
18,
13,
14,
4,
18,
13,
17,
0,
13,
2,
13,
13,
14,
4,
18,
13,
17,
0,
13,
2,
13,
13,
14,
4,
18,
13,
17,
0,
13,
2,
13,
13,
4,
18,
13,
13,
30,
4,
18,
13,
4,
18,
13,
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
],
[
114,
8
],
[
114,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
11,
14
],
[
14,
15
],
[
11,
16
],
[
16,
17
],
[
11,
18
],
[
18,
19
],
[
18,
20
],
[
11,
21
],
[
21,
22
],
[
21,
23
],
[
11,
24
],
[
24,
25
],
[
24,
26
],
[
11,
27
],
[
27,
28
],
[
28,
29
],
[
29,
30
],
[
27,
31
],
[
31,
32
],
[
32,
33
],
[
32,
34
],
[
34,
35
],
[
35,
36
],
[
31,
37
],
[
37,
38
],
[
39,
39
],
[
39,
40
],
[
40,
41
],
[
41,
42
],
[
40,
43
],
[
39,
44
],
[
44,
45
],
[
45,
46
],
[
44,
47
],
[
39,
48
],
[
48,
49
],
[
49,
50
],
[
48,
51
],
[
37,
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
],
[
65,
66
],
[
64,
67
],
[
63,
68
],
[
68,
69
],
[
68,
70
],
[
70,
71
],
[
70,
72
],
[
63,
73
],
[
73,
74
],
[
74,
75
],
[
75,
76
],
[
74,
77
],
[
73,
78
],
[
78,
79
],
[
78,
80
],
[
80,
81
],
[
80,
82
],
[
73,
83
],
[
83,
84
],
[
84,
85
],
[
85,
86
],
[
84,
87
],
[
83,
88
],
[
88,
89
],
[
88,
90
],
[
90,
91
],
[
90,
92
],
[
52,
93
],
[
93,
94
],
[
94,
95
],
[
93,
96
],
[
37,
97
],
[
97,
98
],
[
98,
99
],
[
99,
100
],
[
98,
101
],
[
101,
102
],
[
102,
103
],
[
101,
104
],
[
11,
105
],
[
105,
106
],
[
106,
107
],
[
107,
108
],
[
107,
109
],
[
105,
110
],
[
9,
111
],
[
111,
112
],
[
0,
113
],
[
113,
114
],
[
113,
115
]
] | [
"import java.util.Scanner;\nimport java.util.Stack;\n\npublic class Main {\n\tpublic static void main(String[] args){\n\t\tString str;\n\t\tint num1, num2, result = 0;\n\t\tScanner in = new Scanner(System.in);\n\t\tStack<Integer> poland = new Stack<Integer>();\n\n\t\twhile(in.hasNext()){\n\t\t\tstr = in.next();\n\n\t\t\tif(str.equals(\"+\") || str.equals(\"-\") || str.equals(\"*\")){\n\t\t\t\tnum1 = poland.pop();\n\t\t\t\tnum2 = poland.pop();\n\t\t\t\tif(str.equals(\"+\")) result = num2 + num1;\n\t\t\t\telse if(str.equals(\"-\")) result = num2 - num1;\n\t\t\t\telse if(str.equals(\"*\")) result = num2 * num1;\n\t\t\t\tpoland.push(result);\n\t\t\t}\n\t\t\telse{\n\t\t\t\tpoland.push(Integer.parseInt(str));\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(result);\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\tString str;\n\t\tint num1, num2, result = 0;\n\t\tScanner in = new Scanner(System.in);\n\t\tStack<Integer> poland = new Stack<Integer>();\n\n\t\twhile(in.hasNext()){\n\t\t\tstr = in.next();\n\n\t\t\tif(str.equals(\"+\") || str.equals(\"-\") || str.equals(\"*\")){\n\t\t\t\tnum1 = poland.pop();\n\t\t\t\tnum2 = poland.pop();\n\t\t\t\tif(str.equals(\"+\")) result = num2 + num1;\n\t\t\t\telse if(str.equals(\"-\")) result = num2 - num1;\n\t\t\t\telse if(str.equals(\"*\")) result = num2 * num1;\n\t\t\t\tpoland.push(result);\n\t\t\t}\n\t\t\telse{\n\t\t\t\tpoland.push(Integer.parseInt(str));\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(result);\n\t}\n}",
"Main",
"public static void main(String[] args){\n\t\tString str;\n\t\tint num1, num2, result = 0;\n\t\tScanner in = new Scanner(System.in);\n\t\tStack<Integer> poland = new Stack<Integer>();\n\n\t\twhile(in.hasNext()){\n\t\t\tstr = in.next();\n\n\t\t\tif(str.equals(\"+\") || str.equals(\"-\") || str.equals(\"*\")){\n\t\t\t\tnum1 = poland.pop();\n\t\t\t\tnum2 = poland.pop();\n\t\t\t\tif(str.equals(\"+\")) result = num2 + num1;\n\t\t\t\telse if(str.equals(\"-\")) result = num2 - num1;\n\t\t\t\telse if(str.equals(\"*\")) result = num2 * num1;\n\t\t\t\tpoland.push(result);\n\t\t\t}\n\t\t\telse{\n\t\t\t\tpoland.push(Integer.parseInt(str));\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(result);\n\t}",
"main",
"{\n\t\tString str;\n\t\tint num1, num2, result = 0;\n\t\tScanner in = new Scanner(System.in);\n\t\tStack<Integer> poland = new Stack<Integer>();\n\n\t\twhile(in.hasNext()){\n\t\t\tstr = in.next();\n\n\t\t\tif(str.equals(\"+\") || str.equals(\"-\") || str.equals(\"*\")){\n\t\t\t\tnum1 = poland.pop();\n\t\t\t\tnum2 = poland.pop();\n\t\t\t\tif(str.equals(\"+\")) result = num2 + num1;\n\t\t\t\telse if(str.equals(\"-\")) result = num2 - num1;\n\t\t\t\telse if(str.equals(\"*\")) result = num2 * num1;\n\t\t\t\tpoland.push(result);\n\t\t\t}\n\t\t\telse{\n\t\t\t\tpoland.push(Integer.parseInt(str));\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(result);\n\t}",
"String str;",
"str",
"int num1",
"num1",
"num2",
"num2",
"result = 0;",
"result",
"0",
"Scanner in = new Scanner(System.in);",
"in",
"new Scanner(System.in)",
"Stack<Integer> poland = new Stack<Integer>();",
"poland",
"new Stack<Integer>()",
"while(in.hasNext()){\n\t\t\tstr = in.next();\n\n\t\t\tif(str.equals(\"+\") || str.equals(\"-\") || str.equals(\"*\")){\n\t\t\t\tnum1 = poland.pop();\n\t\t\t\tnum2 = poland.pop();\n\t\t\t\tif(str.equals(\"+\")) result = num2 + num1;\n\t\t\t\telse if(str.equals(\"-\")) result = num2 - num1;\n\t\t\t\telse if(str.equals(\"*\")) result = num2 * num1;\n\t\t\t\tpoland.push(result);\n\t\t\t}\n\t\t\telse{\n\t\t\t\tpoland.push(Integer.parseInt(str));\n\t\t\t}\n\t\t}",
"in.hasNext()",
"in.hasNext",
"in",
"{\n\t\t\tstr = in.next();\n\n\t\t\tif(str.equals(\"+\") || str.equals(\"-\") || str.equals(\"*\")){\n\t\t\t\tnum1 = poland.pop();\n\t\t\t\tnum2 = poland.pop();\n\t\t\t\tif(str.equals(\"+\")) result = num2 + num1;\n\t\t\t\telse if(str.equals(\"-\")) result = num2 - num1;\n\t\t\t\telse if(str.equals(\"*\")) result = num2 * num1;\n\t\t\t\tpoland.push(result);\n\t\t\t}\n\t\t\telse{\n\t\t\t\tpoland.push(Integer.parseInt(str));\n\t\t\t}\n\t\t}",
"str = in.next()",
"str",
"in.next()",
"in.next",
"in",
"if(str.equals(\"+\") || str.equals(\"-\") || str.equals(\"*\")){\n\t\t\t\tnum1 = poland.pop();\n\t\t\t\tnum2 = poland.pop();\n\t\t\t\tif(str.equals(\"+\")) result = num2 + num1;\n\t\t\t\telse if(str.equals(\"-\")) result = num2 - num1;\n\t\t\t\telse if(str.equals(\"*\")) result = num2 * num1;\n\t\t\t\tpoland.push(result);\n\t\t\t}\n\t\t\telse{\n\t\t\t\tpoland.push(Integer.parseInt(str));\n\t\t\t}",
"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",
"\"*\"",
"{\n\t\t\t\tnum1 = poland.pop();\n\t\t\t\tnum2 = poland.pop();\n\t\t\t\tif(str.equals(\"+\")) result = num2 + num1;\n\t\t\t\telse if(str.equals(\"-\")) result = num2 - num1;\n\t\t\t\telse if(str.equals(\"*\")) result = num2 * num1;\n\t\t\t\tpoland.push(result);\n\t\t\t}",
"num1 = poland.pop()",
"num1",
"poland.pop()",
"poland.pop",
"poland",
"num2 = poland.pop()",
"num2",
"poland.pop()",
"poland.pop",
"poland",
"if(str.equals(\"+\")) result = num2 + num1;\n\t\t\t\telse if(str.equals(\"-\")) result = num2 - num1;\n\t\t\t\telse if(str.equals(\"*\")) result = num2 * num1;",
"str.equals(\"+\")",
"str.equals",
"str",
"\"+\"",
"result = num2 + num1",
"result",
"num2 + num1",
"num2",
"num1",
"if(str.equals(\"-\")) result = num2 - num1;\n\t\t\t\telse if(str.equals(\"*\")) result = num2 * num1;",
"str.equals(\"-\")",
"str.equals",
"str",
"\"-\"",
"result = num2 - num1",
"result",
"num2 - num1",
"num2",
"num1",
"if(str.equals(\"*\")) result = num2 * num1;",
"str.equals(\"*\")",
"str.equals",
"str",
"\"*\"",
"result = num2 * num1",
"result",
"num2 * num1",
"num2",
"num1",
"poland.push(result)",
"poland.push",
"poland",
"result",
"{\n\t\t\t\tpoland.push(Integer.parseInt(str));\n\t\t\t}",
"poland.push(Integer.parseInt(str))",
"poland.push",
"poland",
"Integer.parseInt(str)",
"Integer.parseInt",
"Integer",
"str",
"System.out.println(result)",
"System.out.println",
"System.out",
"System",
"System.out",
"result",
"String[] args",
"args",
"public class Main {\n\tpublic static void main(String[] args){\n\t\tString str;\n\t\tint num1, num2, result = 0;\n\t\tScanner in = new Scanner(System.in);\n\t\tStack<Integer> poland = new Stack<Integer>();\n\n\t\twhile(in.hasNext()){\n\t\t\tstr = in.next();\n\n\t\t\tif(str.equals(\"+\") || str.equals(\"-\") || str.equals(\"*\")){\n\t\t\t\tnum1 = poland.pop();\n\t\t\t\tnum2 = poland.pop();\n\t\t\t\tif(str.equals(\"+\")) result = num2 + num1;\n\t\t\t\telse if(str.equals(\"-\")) result = num2 - num1;\n\t\t\t\telse if(str.equals(\"*\")) result = num2 * num1;\n\t\t\t\tpoland.push(result);\n\t\t\t}\n\t\t\telse{\n\t\t\t\tpoland.push(Integer.parseInt(str));\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(result);\n\t}\n}",
"public class Main {\n\tpublic static void main(String[] args){\n\t\tString str;\n\t\tint num1, num2, result = 0;\n\t\tScanner in = new Scanner(System.in);\n\t\tStack<Integer> poland = new Stack<Integer>();\n\n\t\twhile(in.hasNext()){\n\t\t\tstr = in.next();\n\n\t\t\tif(str.equals(\"+\") || str.equals(\"-\") || str.equals(\"*\")){\n\t\t\t\tnum1 = poland.pop();\n\t\t\t\tnum2 = poland.pop();\n\t\t\t\tif(str.equals(\"+\")) result = num2 + num1;\n\t\t\t\telse if(str.equals(\"-\")) result = num2 - num1;\n\t\t\t\telse if(str.equals(\"*\")) result = num2 * num1;\n\t\t\t\tpoland.push(result);\n\t\t\t}\n\t\t\telse{\n\t\t\t\tpoland.push(Integer.parseInt(str));\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(result);\n\t}\n}",
"Main"
] | import java.util.Scanner;
import java.util.Stack;
public class Main {
public static void main(String[] args){
String str;
int num1, num2, result = 0;
Scanner in = new Scanner(System.in);
Stack<Integer> poland = new Stack<Integer>();
while(in.hasNext()){
str = in.next();
if(str.equals("+") || str.equals("-") || str.equals("*")){
num1 = poland.pop();
num2 = poland.pop();
if(str.equals("+")) result = num2 + num1;
else if(str.equals("-")) result = num2 - num1;
else if(str.equals("*")) result = num2 * num1;
poland.push(result);
}
else{
poland.push(Integer.parseInt(str));
}
}
System.out.println(result);
}
} |
[
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,
41,
13,
18,
13,
13,
41,
13,
17,
42,
2,
13,
13,
30,
14,
4,
18,
17,
18,
13,
13,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
2,
13,
13,
4,
18,
13,
13,
14,
4,
18,
17,
18,
13,
13,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
2,
13,
13,
4,
18,
13,
13,
14,
4,
18,
17,
18,
13,
13,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
2,
13,
13,
4,
18,
13,
13,
30,
4,
18,
13,
4,
18,
13,
18,
13,
13,
40,
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
],
[
149,
8
],
[
149,
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
],
[
29,
31
],
[
31,
32
],
[
31,
33
],
[
11,
34
],
[
34,
35
],
[
34,
36
],
[
11,
37
],
[
37,
38
],
[
38,
39
],
[
38,
40
],
[
37,
41
],
[
41,
42
],
[
42,
43
],
[
43,
44
],
[
44,
45
],
[
43,
46
],
[
46,
47
],
[
46,
48
],
[
42,
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
],
[
42,
69
],
[
69,
70
],
[
70,
71
],
[
71,
72
],
[
70,
73
],
[
73,
74
],
[
73,
75
],
[
69,
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
],
[
87,
89
],
[
89,
90
],
[
89,
91
],
[
76,
92
],
[
92,
93
],
[
93,
94
],
[
92,
95
],
[
69,
96
],
[
96,
97
],
[
97,
98
],
[
98,
99
],
[
97,
100
],
[
100,
101
],
[
100,
102
],
[
96,
103
],
[
103,
104
],
[
104,
105
],
[
104,
106
],
[
106,
107
],
[
107,
108
],
[
103,
109
],
[
109,
110
],
[
109,
111
],
[
111,
112
],
[
112,
113
],
[
103,
114
],
[
114,
115
],
[
114,
116
],
[
116,
117
],
[
116,
118
],
[
103,
119
],
[
119,
120
],
[
120,
121
],
[
119,
122
],
[
96,
123
],
[
123,
124
],
[
124,
125
],
[
125,
126
],
[
124,
127
],
[
127,
128
],
[
128,
129
],
[
127,
130
],
[
130,
131
],
[
130,
132
],
[
41,
133
],
[
133,
134
],
[
11,
135
],
[
135,
136
],
[
136,
137
],
[
137,
138
],
[
137,
139
],
[
135,
140
],
[
140,
141
],
[
141,
142
],
[
11,
143
],
[
143,
144
],
[
144,
145
],
[
9,
146
],
[
146,
147
],
[
0,
148
],
[
148,
149
],
[
148,
150
]
] | [
"\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 scanner = new Scanner(System.in);\n\t\tString string = scanner.nextLine();\n\t\tString [ ] strings = string.split(\" \");\n\t\tint size = strings.length;\n\t\tint i = 0;\n\t\twhile( i<size ){\n\t\t\tif(\"+\".equals(strings[i])){\n\t\t\t\tint a = stack.pop();\n\t\t\t\tint b = stack.pop();\n\t\t\t\tint c = a+b;\n\t\t\t\tstack.push(c);\n\t\t\t}else if(\"-\".equals(strings[i])){\n\t\t\t\tint a = stack.pop();\n\t\t\t\tint b = stack.pop();\n\t\t\t\tint c = b-a;\n\t\t\t\tstack.push(c);\n\t\t\t}else if(\"*\".equals(strings[i])){\n\t\t\t\tint a = stack.pop();\n\t\t\t\tint b = stack.pop();\n\t\t\t\tint c = b*a;\n\t\t\t\tstack.push(c);\n\t\t\t}else{\n\t\t\t\tstack.push(Integer.parseInt(strings[i]));\n\t\t\t\t\n\t\t\t}\n\t\t\ti++;\n\t\t}\n\t\t\n\t\tSystem.out.println(stack.pop());\n\t\tscanner.close();\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\tStack<Integer> stack = new Stack<Integer>();\n\t\tScanner scanner = new Scanner(System.in);\n\t\tString string = scanner.nextLine();\n\t\tString [ ] strings = string.split(\" \");\n\t\tint size = strings.length;\n\t\tint i = 0;\n\t\twhile( i<size ){\n\t\t\tif(\"+\".equals(strings[i])){\n\t\t\t\tint a = stack.pop();\n\t\t\t\tint b = stack.pop();\n\t\t\t\tint c = a+b;\n\t\t\t\tstack.push(c);\n\t\t\t}else if(\"-\".equals(strings[i])){\n\t\t\t\tint a = stack.pop();\n\t\t\t\tint b = stack.pop();\n\t\t\t\tint c = b-a;\n\t\t\t\tstack.push(c);\n\t\t\t}else if(\"*\".equals(strings[i])){\n\t\t\t\tint a = stack.pop();\n\t\t\t\tint b = stack.pop();\n\t\t\t\tint c = b*a;\n\t\t\t\tstack.push(c);\n\t\t\t}else{\n\t\t\t\tstack.push(Integer.parseInt(strings[i]));\n\t\t\t\t\n\t\t\t}\n\t\t\ti++;\n\t\t}\n\t\t\n\t\tSystem.out.println(stack.pop());\n\t\tscanner.close();\n\t}\n}",
"Main",
"public static void main(String [] args){\n\t\tStack<Integer> stack = new Stack<Integer>();\n\t\tScanner scanner = new Scanner(System.in);\n\t\tString string = scanner.nextLine();\n\t\tString [ ] strings = string.split(\" \");\n\t\tint size = strings.length;\n\t\tint i = 0;\n\t\twhile( i<size ){\n\t\t\tif(\"+\".equals(strings[i])){\n\t\t\t\tint a = stack.pop();\n\t\t\t\tint b = stack.pop();\n\t\t\t\tint c = a+b;\n\t\t\t\tstack.push(c);\n\t\t\t}else if(\"-\".equals(strings[i])){\n\t\t\t\tint a = stack.pop();\n\t\t\t\tint b = stack.pop();\n\t\t\t\tint c = b-a;\n\t\t\t\tstack.push(c);\n\t\t\t}else if(\"*\".equals(strings[i])){\n\t\t\t\tint a = stack.pop();\n\t\t\t\tint b = stack.pop();\n\t\t\t\tint c = b*a;\n\t\t\t\tstack.push(c);\n\t\t\t}else{\n\t\t\t\tstack.push(Integer.parseInt(strings[i]));\n\t\t\t\t\n\t\t\t}\n\t\t\ti++;\n\t\t}\n\t\t\n\t\tSystem.out.println(stack.pop());\n\t\tscanner.close();\n\t}",
"main",
"{\n\t\tStack<Integer> stack = new Stack<Integer>();\n\t\tScanner scanner = new Scanner(System.in);\n\t\tString string = scanner.nextLine();\n\t\tString [ ] strings = string.split(\" \");\n\t\tint size = strings.length;\n\t\tint i = 0;\n\t\twhile( i<size ){\n\t\t\tif(\"+\".equals(strings[i])){\n\t\t\t\tint a = stack.pop();\n\t\t\t\tint b = stack.pop();\n\t\t\t\tint c = a+b;\n\t\t\t\tstack.push(c);\n\t\t\t}else if(\"-\".equals(strings[i])){\n\t\t\t\tint a = stack.pop();\n\t\t\t\tint b = stack.pop();\n\t\t\t\tint c = b-a;\n\t\t\t\tstack.push(c);\n\t\t\t}else if(\"*\".equals(strings[i])){\n\t\t\t\tint a = stack.pop();\n\t\t\t\tint b = stack.pop();\n\t\t\t\tint c = b*a;\n\t\t\t\tstack.push(c);\n\t\t\t}else{\n\t\t\t\tstack.push(Integer.parseInt(strings[i]));\n\t\t\t\t\n\t\t\t}\n\t\t\ti++;\n\t\t}\n\t\t\n\t\tSystem.out.println(stack.pop());\n\t\tscanner.close();\n\t}",
"Stack<Integer> stack = new Stack<Integer>();",
"stack",
"new Stack<Integer>()",
"Scanner scanner = new Scanner(System.in);",
"scanner",
"new Scanner(System.in)",
"String string = scanner.nextLine();",
"string",
"scanner.nextLine()",
"scanner.nextLine",
"scanner",
"String [ ] strings = string.split(\" \");",
"strings",
"string.split(\" \")",
"string.split",
"string",
"\" \"",
"int size = strings.length;",
"size",
"strings.length",
"strings",
"strings.length",
"int i = 0;",
"i",
"0",
"while( i<size ){\n\t\t\tif(\"+\".equals(strings[i])){\n\t\t\t\tint a = stack.pop();\n\t\t\t\tint b = stack.pop();\n\t\t\t\tint c = a+b;\n\t\t\t\tstack.push(c);\n\t\t\t}else if(\"-\".equals(strings[i])){\n\t\t\t\tint a = stack.pop();\n\t\t\t\tint b = stack.pop();\n\t\t\t\tint c = b-a;\n\t\t\t\tstack.push(c);\n\t\t\t}else if(\"*\".equals(strings[i])){\n\t\t\t\tint a = stack.pop();\n\t\t\t\tint b = stack.pop();\n\t\t\t\tint c = b*a;\n\t\t\t\tstack.push(c);\n\t\t\t}else{\n\t\t\t\tstack.push(Integer.parseInt(strings[i]));\n\t\t\t\t\n\t\t\t}\n\t\t\ti++;\n\t\t}",
"i<size",
"i",
"size",
"{\n\t\t\tif(\"+\".equals(strings[i])){\n\t\t\t\tint a = stack.pop();\n\t\t\t\tint b = stack.pop();\n\t\t\t\tint c = a+b;\n\t\t\t\tstack.push(c);\n\t\t\t}else if(\"-\".equals(strings[i])){\n\t\t\t\tint a = stack.pop();\n\t\t\t\tint b = stack.pop();\n\t\t\t\tint c = b-a;\n\t\t\t\tstack.push(c);\n\t\t\t}else if(\"*\".equals(strings[i])){\n\t\t\t\tint a = stack.pop();\n\t\t\t\tint b = stack.pop();\n\t\t\t\tint c = b*a;\n\t\t\t\tstack.push(c);\n\t\t\t}else{\n\t\t\t\tstack.push(Integer.parseInt(strings[i]));\n\t\t\t\t\n\t\t\t}\n\t\t\ti++;\n\t\t}",
"if(\"+\".equals(strings[i])){\n\t\t\t\tint a = stack.pop();\n\t\t\t\tint b = stack.pop();\n\t\t\t\tint c = a+b;\n\t\t\t\tstack.push(c);\n\t\t\t}else if(\"-\".equals(strings[i])){\n\t\t\t\tint a = stack.pop();\n\t\t\t\tint b = stack.pop();\n\t\t\t\tint c = b-a;\n\t\t\t\tstack.push(c);\n\t\t\t}else if(\"*\".equals(strings[i])){\n\t\t\t\tint a = stack.pop();\n\t\t\t\tint b = stack.pop();\n\t\t\t\tint c = b*a;\n\t\t\t\tstack.push(c);\n\t\t\t}else{\n\t\t\t\tstack.push(Integer.parseInt(strings[i]));\n\t\t\t\t\n\t\t\t}",
"\"+\".equals(strings[i])",
"\"+\".equals",
"\"+\"",
"strings[i]",
"strings",
"i",
"{\n\t\t\t\tint a = stack.pop();\n\t\t\t\tint b = stack.pop();\n\t\t\t\tint c = a+b;\n\t\t\t\tstack.push(c);\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 c = a+b;",
"c",
"a+b",
"a",
"b",
"stack.push(c)",
"stack.push",
"stack",
"c",
"if(\"-\".equals(strings[i])){\n\t\t\t\tint a = stack.pop();\n\t\t\t\tint b = stack.pop();\n\t\t\t\tint c = b-a;\n\t\t\t\tstack.push(c);\n\t\t\t}else if(\"*\".equals(strings[i])){\n\t\t\t\tint a = stack.pop();\n\t\t\t\tint b = stack.pop();\n\t\t\t\tint c = b*a;\n\t\t\t\tstack.push(c);\n\t\t\t}else{\n\t\t\t\tstack.push(Integer.parseInt(strings[i]));\n\t\t\t\t\n\t\t\t}",
"\"-\".equals(strings[i])",
"\"-\".equals",
"\"-\"",
"strings[i]",
"strings",
"i",
"{\n\t\t\t\tint a = stack.pop();\n\t\t\t\tint b = stack.pop();\n\t\t\t\tint c = b-a;\n\t\t\t\tstack.push(c);\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 c = b-a;",
"c",
"b-a",
"b",
"a",
"stack.push(c)",
"stack.push",
"stack",
"c",
"if(\"*\".equals(strings[i])){\n\t\t\t\tint a = stack.pop();\n\t\t\t\tint b = stack.pop();\n\t\t\t\tint c = b*a;\n\t\t\t\tstack.push(c);\n\t\t\t}else{\n\t\t\t\tstack.push(Integer.parseInt(strings[i]));\n\t\t\t\t\n\t\t\t}",
"\"*\".equals(strings[i])",
"\"*\".equals",
"\"*\"",
"strings[i]",
"strings",
"i",
"{\n\t\t\t\tint a = stack.pop();\n\t\t\t\tint b = stack.pop();\n\t\t\t\tint c = b*a;\n\t\t\t\tstack.push(c);\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 c = b*a;",
"c",
"b*a",
"b",
"a",
"stack.push(c)",
"stack.push",
"stack",
"c",
"{\n\t\t\t\tstack.push(Integer.parseInt(strings[i]));\n\t\t\t\t\n\t\t\t}",
"stack.push(Integer.parseInt(strings[i]))",
"stack.push",
"stack",
"Integer.parseInt(strings[i])",
"Integer.parseInt",
"Integer",
"strings[i]",
"strings",
"i",
"i++",
"i",
"System.out.println(stack.pop())",
"System.out.println",
"System.out",
"System",
"System.out",
"stack.pop()",
"stack.pop",
"stack",
"scanner.close()",
"scanner.close",
"scanner",
"String [] args",
"args",
"public class Main {\n\tpublic static void main(String [] args){\n\t\tStack<Integer> stack = new Stack<Integer>();\n\t\tScanner scanner = new Scanner(System.in);\n\t\tString string = scanner.nextLine();\n\t\tString [ ] strings = string.split(\" \");\n\t\tint size = strings.length;\n\t\tint i = 0;\n\t\twhile( i<size ){\n\t\t\tif(\"+\".equals(strings[i])){\n\t\t\t\tint a = stack.pop();\n\t\t\t\tint b = stack.pop();\n\t\t\t\tint c = a+b;\n\t\t\t\tstack.push(c);\n\t\t\t}else if(\"-\".equals(strings[i])){\n\t\t\t\tint a = stack.pop();\n\t\t\t\tint b = stack.pop();\n\t\t\t\tint c = b-a;\n\t\t\t\tstack.push(c);\n\t\t\t}else if(\"*\".equals(strings[i])){\n\t\t\t\tint a = stack.pop();\n\t\t\t\tint b = stack.pop();\n\t\t\t\tint c = b*a;\n\t\t\t\tstack.push(c);\n\t\t\t}else{\n\t\t\t\tstack.push(Integer.parseInt(strings[i]));\n\t\t\t\t\n\t\t\t}\n\t\t\ti++;\n\t\t}\n\t\t\n\t\tSystem.out.println(stack.pop());\n\t\tscanner.close();\n\t}\n}",
"public class Main {\n\tpublic static void main(String [] args){\n\t\tStack<Integer> stack = new Stack<Integer>();\n\t\tScanner scanner = new Scanner(System.in);\n\t\tString string = scanner.nextLine();\n\t\tString [ ] strings = string.split(\" \");\n\t\tint size = strings.length;\n\t\tint i = 0;\n\t\twhile( i<size ){\n\t\t\tif(\"+\".equals(strings[i])){\n\t\t\t\tint a = stack.pop();\n\t\t\t\tint b = stack.pop();\n\t\t\t\tint c = a+b;\n\t\t\t\tstack.push(c);\n\t\t\t}else if(\"-\".equals(strings[i])){\n\t\t\t\tint a = stack.pop();\n\t\t\t\tint b = stack.pop();\n\t\t\t\tint c = b-a;\n\t\t\t\tstack.push(c);\n\t\t\t}else if(\"*\".equals(strings[i])){\n\t\t\t\tint a = stack.pop();\n\t\t\t\tint b = stack.pop();\n\t\t\t\tint c = b*a;\n\t\t\t\tstack.push(c);\n\t\t\t}else{\n\t\t\t\tstack.push(Integer.parseInt(strings[i]));\n\t\t\t\t\n\t\t\t}\n\t\t\ti++;\n\t\t}\n\t\t\n\t\tSystem.out.println(stack.pop());\n\t\tscanner.close();\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 scanner = new Scanner(System.in);
String string = scanner.nextLine();
String [ ] strings = string.split(" ");
int size = strings.length;
int i = 0;
while( i<size ){
if("+".equals(strings[i])){
int a = stack.pop();
int b = stack.pop();
int c = a+b;
stack.push(c);
}else if("-".equals(strings[i])){
int a = stack.pop();
int b = stack.pop();
int c = b-a;
stack.push(c);
}else if("*".equals(strings[i])){
int a = stack.pop();
int b = stack.pop();
int c = b*a;
stack.push(c);
}else{
stack.push(Integer.parseInt(strings[i]));
}
i++;
}
System.out.println(stack.pop());
scanner.close();
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
17,
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
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
19,
22
],
[
19,
23
],
[
8,
24
],
[
24,
25
],
[
24,
26
],
[
27,
28
],
[
27,
29
],
[
8,
30
],
[
30,
31
],
[
30,
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
],
[
50,
51
],
[
51,
52
],
[
51,
53
],
[
49,
54
],
[
48,
55
],
[
55,
56
],
[
55,
57
],
[
57,
58
],
[
58,
59
],
[
57,
60
],
[
60,
61
],
[
61,
62
],
[
61,
63
],
[
63,
64
],
[
63,
65
],
[
60,
66
],
[
66,
67
],
[
67,
68
],
[
67,
69
],
[
69,
70
],
[
69,
71
],
[
66,
72
],
[
72,
73
],
[
72,
74
],
[
57,
75
],
[
48,
76
],
[
76,
77
],
[
76,
78
],
[
78,
79
],
[
79,
80
],
[
78,
81
],
[
81,
82
],
[
82,
83
],
[
82,
84
],
[
84,
85
],
[
84,
86
],
[
81,
87
],
[
87,
88
],
[
88,
89
],
[
88,
90
],
[
90,
91
],
[
90,
92
],
[
87,
93
],
[
93,
94
],
[
93,
95
],
[
78,
96
],
[
48,
97
],
[
97,
98
],
[
97,
99
],
[
99,
100
],
[
100,
101
],
[
99,
102
],
[
102,
103
],
[
103,
104
],
[
103,
105
],
[
105,
106
],
[
105,
107
],
[
102,
108
],
[
108,
109
],
[
109,
110
],
[
109,
111
],
[
111,
112
],
[
111,
113
],
[
108,
114
],
[
114,
115
],
[
114,
116
],
[
99,
117
],
[
48,
118
],
[
118,
119
],
[
119,
120
],
[
120,
121
],
[
121,
122
],
[
121,
123
],
[
120,
124
],
[
124,
125
],
[
125,
126
],
[
124,
127
],
[
127,
128
],
[
127,
129
],
[
119,
130
],
[
130,
131
],
[
119,
132
],
[
8,
133
],
[
133,
134
],
[
134,
135
],
[
135,
136
],
[
135,
137
],
[
133,
138
],
[
138,
139
],
[
138,
140
],
[
6,
141
],
[
141,
142
]
] | [
"import java.util.*;\n\nclass Main{\n public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n\n String str = sc.nextLine();\n String[] str_split = str.split(\" \",0);\n\n int[] nums = new int[str_split.length];\n int top = 0;\n\n for(int i = 0;i < str_split.length;i++){\n switch(str_split[i].charAt(0)){\n case '+':\n top--;\n nums[top - 1] = nums[top - 1] + nums[top];\n break;\n case '-':\n top--;\n nums[top - 1] = nums[top - 1] - nums[top];\n break;\n case '*':\n top--;\n nums[top - 1] = nums[top - 1] * nums[top];\n break;\n default:\n nums[top] = Integer.parseInt(str_split[i]);\n top++;\n break;\n }\n }\n System.out.println(nums[0]);\n }\n}",
"import java.util.*;",
"util.*",
"java",
"class Main{\n public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n\n String str = sc.nextLine();\n String[] str_split = str.split(\" \",0);\n\n int[] nums = new int[str_split.length];\n int top = 0;\n\n for(int i = 0;i < str_split.length;i++){\n switch(str_split[i].charAt(0)){\n case '+':\n top--;\n nums[top - 1] = nums[top - 1] + nums[top];\n break;\n case '-':\n top--;\n nums[top - 1] = nums[top - 1] - nums[top];\n break;\n case '*':\n top--;\n nums[top - 1] = nums[top - 1] * nums[top];\n break;\n default:\n nums[top] = Integer.parseInt(str_split[i]);\n top++;\n break;\n }\n }\n System.out.println(nums[0]);\n }\n}",
"Main",
"public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n\n String str = sc.nextLine();\n String[] str_split = str.split(\" \",0);\n\n int[] nums = new int[str_split.length];\n int top = 0;\n\n for(int i = 0;i < str_split.length;i++){\n switch(str_split[i].charAt(0)){\n case '+':\n top--;\n nums[top - 1] = nums[top - 1] + nums[top];\n break;\n case '-':\n top--;\n nums[top - 1] = nums[top - 1] - nums[top];\n break;\n case '*':\n top--;\n nums[top - 1] = nums[top - 1] * nums[top];\n break;\n default:\n nums[top] = Integer.parseInt(str_split[i]);\n top++;\n break;\n }\n }\n System.out.println(nums[0]);\n }",
"main",
"{\n Scanner sc = new Scanner(System.in);\n\n String str = sc.nextLine();\n String[] str_split = str.split(\" \",0);\n\n int[] nums = new int[str_split.length];\n int top = 0;\n\n for(int i = 0;i < str_split.length;i++){\n switch(str_split[i].charAt(0)){\n case '+':\n top--;\n nums[top - 1] = nums[top - 1] + nums[top];\n break;\n case '-':\n top--;\n nums[top - 1] = nums[top - 1] - nums[top];\n break;\n case '*':\n top--;\n nums[top - 1] = nums[top - 1] * nums[top];\n break;\n default:\n nums[top] = Integer.parseInt(str_split[i]);\n top++;\n break;\n }\n }\n System.out.println(nums[0]);\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"String str = sc.nextLine();",
"str",
"sc.nextLine()",
"sc.nextLine",
"sc",
"String[] str_split = str.split(\" \",0);",
"str_split",
"str.split(\" \",0)",
"str.split",
"str",
"\" \"",
"0",
"int[] nums = new int[str_split.length];",
"nums",
"new int[str_split.length]",
"str_split.length",
"str_split",
"str_split.length",
"int top = 0;",
"top",
"0",
"for(int i = 0;i < str_split.length;i++){\n switch(str_split[i].charAt(0)){\n case '+':\n top--;\n nums[top - 1] = nums[top - 1] + nums[top];\n break;\n case '-':\n top--;\n nums[top - 1] = nums[top - 1] - nums[top];\n break;\n case '*':\n top--;\n nums[top - 1] = nums[top - 1] * nums[top];\n break;\n default:\n nums[top] = Integer.parseInt(str_split[i]);\n top++;\n break;\n }\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < str_split.length",
"i",
"str_split.length",
"str_split",
"str_split.length",
"i++",
"i++",
"i",
"{\n switch(str_split[i].charAt(0)){\n case '+':\n top--;\n nums[top - 1] = nums[top - 1] + nums[top];\n break;\n case '-':\n top--;\n nums[top - 1] = nums[top - 1] - nums[top];\n break;\n case '*':\n top--;\n nums[top - 1] = nums[top - 1] * nums[top];\n break;\n default:\n nums[top] = Integer.parseInt(str_split[i]);\n top++;\n break;\n }\n }",
"{\n switch(str_split[i].charAt(0)){\n case '+':\n top--;\n nums[top - 1] = nums[top - 1] + nums[top];\n break;\n case '-':\n top--;\n nums[top - 1] = nums[top - 1] - nums[top];\n break;\n case '*':\n top--;\n nums[top - 1] = nums[top - 1] * nums[top];\n break;\n default:\n nums[top] = Integer.parseInt(str_split[i]);\n top++;\n break;\n }\n }",
"switch(str_split[i].charAt(0)){\n case '+':\n top--;\n nums[top - 1] = nums[top - 1] + nums[top];\n break;\n case '-':\n top--;\n nums[top - 1] = nums[top - 1] - nums[top];\n break;\n case '*':\n top--;\n nums[top - 1] = nums[top - 1] * nums[top];\n break;\n default:\n nums[top] = Integer.parseInt(str_split[i]);\n top++;\n break;\n }",
"str_split[i].charAt(0)",
"str_split[i].charAt",
"str_split[i]",
"str_split",
"i",
"0",
"case '+':",
"'+'",
"case '+':",
"top--",
"top",
"nums[top - 1] = nums[top - 1] + nums[top]",
"nums[top - 1]",
"nums",
"top - 1",
"top",
"1",
"nums[top - 1] + nums[top]",
"nums[top - 1]",
"nums",
"top - 1",
"top",
"1",
"nums[top]",
"nums",
"top",
"break;",
"case '-':",
"'-'",
"case '-':",
"top--",
"top",
"nums[top - 1] = nums[top - 1] - nums[top]",
"nums[top - 1]",
"nums",
"top - 1",
"top",
"1",
"nums[top - 1] - nums[top]",
"nums[top - 1]",
"nums",
"top - 1",
"top",
"1",
"nums[top]",
"nums",
"top",
"break;",
"case '*':",
"'*'",
"case '*':",
"top--",
"top",
"nums[top - 1] = nums[top - 1] * nums[top]",
"nums[top - 1]",
"nums",
"top - 1",
"top",
"1",
"nums[top - 1] * nums[top]",
"nums[top - 1]",
"nums",
"top - 1",
"top",
"1",
"nums[top]",
"nums",
"top",
"break;",
"default:",
"default:",
"nums[top] = Integer.parseInt(str_split[i])",
"nums[top]",
"nums",
"top",
"Integer.parseInt(str_split[i])",
"Integer.parseInt",
"Integer",
"str_split[i]",
"str_split",
"i",
"top++",
"top",
"break;",
"System.out.println(nums[0])",
"System.out.println",
"System.out",
"System",
"System.out",
"nums[0]",
"nums",
"0",
"String[] args",
"args"
] | import java.util.*;
class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
String str = sc.nextLine();
String[] str_split = str.split(" ",0);
int[] nums = new int[str_split.length];
int top = 0;
for(int i = 0;i < str_split.length;i++){
switch(str_split[i].charAt(0)){
case '+':
top--;
nums[top - 1] = nums[top - 1] + nums[top];
break;
case '-':
top--;
nums[top - 1] = nums[top - 1] - nums[top];
break;
case '*':
top--;
nums[top - 1] = nums[top - 1] * nums[top];
break;
default:
nums[top] = Integer.parseInt(str_split[i]);
top++;
break;
}
}
System.out.println(nums[0]);
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
41,
13,
41,
13,
20,
17,
12,
13,
30,
0,
13,
17,
29,
12,
13,
30,
14,
2,
13,
17,
29,
17,
29,
17,
12,
13,
30,
14,
2,
13,
17,
29,
17,
29,
17,
12,
13,
30,
14,
4,
13,
4,
18,
18,
13,
13,
17,
0,
18,
13,
40,
13,
13,
23,
13,
12,
13,
30,
14,
4,
13,
4,
18,
18,
13,
13,
17,
29,
18,
13,
40,
13,
12,
13,
30,
38,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
41,
13,
0,
18,
13,
17,
17,
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,
0,
13,
4,
18,
13,
4,
13,
0,
13,
4,
18,
13,
4,
13,
4,
13,
4,
18,
13,
2,
13,
13,
14,
4,
18,
18,
13,
13,
17,
30,
0,
13,
4,
18,
13,
4,
13,
0,
13,
4,
18,
13,
4,
13,
4,
13,
4,
18,
13,
2,
13,
13,
14,
4,
18,
18,
13,
13,
17,
30,
0,
13,
4,
18,
13,
4,
13,
0,
13,
4,
18,
13,
4,
13,
4,
13,
4,
18,
13,
2,
13,
13,
30,
4,
13,
18,
13,
13,
41,
13,
4,
13,
4,
18,
18,
13,
13,
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
],
[
13,
17
],
[
17,
18
],
[
17,
19
],
[
13,
21
],
[
21,
22
],
[
21,
23
],
[
23,
24
],
[
24,
25
],
[
24,
26
],
[
23,
27
],
[
13,
28
],
[
28,
29
],
[
28,
30
],
[
30,
31
],
[
31,
32
],
[
32,
33
],
[
32,
34
],
[
31,
35
],
[
35,
36
],
[
30,
37
],
[
37,
38
],
[
13,
39
],
[
39,
40
],
[
39,
41
],
[
41,
42
],
[
42,
43
],
[
43,
44
],
[
43,
45
],
[
42,
46
],
[
46,
47
],
[
41,
48
],
[
48,
49
],
[
13,
50
],
[
50,
51
],
[
50,
52
],
[
52,
53
],
[
53,
54
],
[
54,
55
],
[
53,
56
],
[
56,
57
],
[
57,
58
],
[
58,
59
],
[
58,
60
],
[
56,
61
],
[
52,
62
],
[
62,
63
],
[
63,
64
],
[
63,
65
],
[
65,
66
],
[
62,
67
],
[
50,
68
],
[
68,
69
],
[
13,
70
],
[
70,
71
],
[
70,
72
],
[
72,
73
],
[
73,
74
],
[
74,
75
],
[
73,
76
],
[
76,
77
],
[
77,
78
],
[
78,
79
],
[
78,
80
],
[
76,
81
],
[
72,
82
],
[
82,
83
],
[
83,
84
],
[
83,
85
],
[
85,
86
],
[
13,
87
],
[
87,
88
],
[
87,
89
],
[
89,
90
],
[
90,
91
],
[
91,
92
],
[
92,
93
],
[
92,
94
],
[
91,
95
],
[
95,
96
],
[
95,
97
],
[
97,
98
],
[
98,
99
],
[
91,
100
],
[
100,
101
],
[
91,
102
],
[
102,
103
],
[
91,
104
],
[
104,
105
],
[
105,
106
],
[
105,
107
],
[
104,
108
],
[
91,
109
],
[
109,
110
],
[
109,
111
],
[
111,
112
],
[
112,
113
],
[
111,
114
],
[
91,
115
],
[
115,
116
],
[
116,
117
],
[
117,
118
],
[
117,
119
],
[
115,
120
],
[
120,
121
],
[
120,
122
],
[
122,
123
],
[
122,
124
],
[
115,
125
],
[
125,
126
],
[
126,
127
],
[
115,
128
],
[
129,
129
],
[
129,
130
],
[
130,
131
],
[
131,
132
],
[
132,
133
],
[
133,
134
],
[
133,
135
],
[
131,
136
],
[
130,
137
],
[
137,
138
],
[
138,
139
],
[
138,
140
],
[
140,
141
],
[
141,
142
],
[
140,
143
],
[
143,
144
],
[
137,
145
],
[
145,
146
],
[
145,
147
],
[
147,
148
],
[
148,
149
],
[
147,
150
],
[
150,
151
],
[
137,
152
],
[
152,
153
],
[
152,
154
],
[
154,
155
],
[
155,
156
],
[
154,
157
],
[
157,
158
],
[
157,
159
],
[
130,
160
],
[
160,
161
],
[
161,
162
],
[
162,
163
],
[
163,
164
],
[
163,
165
],
[
161,
166
],
[
160,
167
],
[
167,
168
],
[
168,
169
],
[
168,
170
],
[
170,
171
],
[
171,
172
],
[
170,
173
],
[
173,
174
],
[
167,
175
],
[
175,
176
],
[
175,
177
],
[
177,
178
],
[
178,
179
],
[
177,
180
],
[
180,
181
],
[
167,
182
],
[
182,
183
],
[
182,
184
],
[
184,
185
],
[
185,
186
],
[
184,
187
],
[
187,
188
],
[
187,
189
],
[
160,
190
],
[
190,
191
],
[
191,
192
],
[
192,
193
],
[
193,
194
],
[
193,
195
],
[
191,
196
],
[
190,
197
],
[
197,
198
],
[
198,
199
],
[
198,
200
],
[
200,
201
],
[
201,
202
],
[
200,
203
],
[
203,
204
],
[
197,
205
],
[
205,
206
],
[
205,
207
],
[
207,
208
],
[
208,
209
],
[
207,
210
],
[
210,
211
],
[
197,
212
],
[
212,
213
],
[
212,
214
],
[
214,
215
],
[
215,
216
],
[
214,
217
],
[
217,
218
],
[
217,
219
],
[
190,
220
],
[
220,
221
],
[
221,
222
],
[
221,
223
],
[
223,
224
],
[
223,
225
],
[
89,
226
],
[
226,
227
],
[
226,
228
],
[
228,
229
],
[
89,
230
],
[
230,
231
],
[
231,
232
],
[
232,
233
],
[
232,
234
],
[
230,
235
],
[
87,
236
],
[
236,
237
]
] | [
"import java.util.Scanner;\nimport java.lang.Math;\nimport java.lang.System;\nimport java.io.*;\nclass Main{\n\n private static int top;\n private static String[] s=new String[1000];\n\n public static void initialize(){\n top=0;\n return;\n }\n\n public static boolean isEmpty(){\n if(top==0)\n return true;\n return false;\n }\n\n public static boolean isFull(){\n if(top>=1000)\n return true;\n return false;\n }\n\n public static void push(String str){\n if(isFull()) System.out.println(\"Error\");\n s[++top]=str;\n }\n\n public static String pop(){\n if(isEmpty()) System.out.println(\"Error\");\n return s[top--];\n }\n\n public static void main(String args[]) throws Exception{\n try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {\n String line= br.readLine();\n int a,b;\n s[0]=null;\n\n //while ((line = br.readLine()) != null) {\n //System.out.println(line);\n String[] str = line.split(\" \");\n for(int i=0;i<str.length;i++){\n //System.out.println(str[i]);\n if(str[i].equals(\"+\")){\n b=Integer.parseInt(pop());\n a=Integer.parseInt(pop());\n push(String.valueOf(a+b));\n //System.out.println(a+b);\n }\n else if(str[i].equals(\"-\")){\n b=Integer.parseInt(pop());\n a=Integer.parseInt(pop());\n push(String.valueOf(a-b));\n //System.out.println(a-b);\n }\n else if(str[i].equals(\"*\")){\n b=Integer.parseInt(pop());\n a=Integer.parseInt(pop());\n push(String.valueOf(a*b));\n //System.out.println(a*b);\n }\n else{\n push(str[i]);\n }\n }\n\n //System.out.println(\"done\");\n }\n //System.out.println(\"done\");\n String answer=pop();\n System.out.println(answer);\n //}\n }\n}\n",
"import java.util.Scanner;",
"Scanner",
"java.util",
"import java.lang.Math;",
"Math",
"java.lang",
"import java.lang.System;",
"System",
"java.lang",
"import java.io.*;",
"io.*",
"java",
"class Main{\n\n private static int top;\n private static String[] s=new String[1000];\n\n public static void initialize(){\n top=0;\n return;\n }\n\n public static boolean isEmpty(){\n if(top==0)\n return true;\n return false;\n }\n\n public static boolean isFull(){\n if(top>=1000)\n return true;\n return false;\n }\n\n public static void push(String str){\n if(isFull()) System.out.println(\"Error\");\n s[++top]=str;\n }\n\n public static String pop(){\n if(isEmpty()) System.out.println(\"Error\");\n return s[top--];\n }\n\n public static void main(String args[]) throws Exception{\n try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {\n String line= br.readLine();\n int a,b;\n s[0]=null;\n\n //while ((line = br.readLine()) != null) {\n //System.out.println(line);\n String[] str = line.split(\" \");\n for(int i=0;i<str.length;i++){\n //System.out.println(str[i]);\n if(str[i].equals(\"+\")){\n b=Integer.parseInt(pop());\n a=Integer.parseInt(pop());\n push(String.valueOf(a+b));\n //System.out.println(a+b);\n }\n else if(str[i].equals(\"-\")){\n b=Integer.parseInt(pop());\n a=Integer.parseInt(pop());\n push(String.valueOf(a-b));\n //System.out.println(a-b);\n }\n else if(str[i].equals(\"*\")){\n b=Integer.parseInt(pop());\n a=Integer.parseInt(pop());\n push(String.valueOf(a*b));\n //System.out.println(a*b);\n }\n else{\n push(str[i]);\n }\n }\n\n //System.out.println(\"done\");\n }\n //System.out.println(\"done\");\n String answer=pop();\n System.out.println(answer);\n //}\n }\n}",
"Main",
"private static int top;",
"top",
"private static String[] s=new String[1000];",
"s",
"new String[1000]",
"1000",
"public static void initialize(){\n top=0;\n return;\n }",
"initialize",
"{\n top=0;\n return;\n }",
"top=0",
"top",
"0",
"return;",
"public static boolean isEmpty(){\n if(top==0)\n return true;\n return false;\n }",
"isEmpty",
"{\n if(top==0)\n return true;\n return false;\n }",
"if(top==0)\n return true;",
"top==0",
"top",
"0",
"return true;",
"true",
"return false;",
"false",
"public static boolean isFull(){\n if(top>=1000)\n return true;\n return false;\n }",
"isFull",
"{\n if(top>=1000)\n return true;\n return false;\n }",
"if(top>=1000)\n return true;",
"top>=1000",
"top",
"1000",
"return true;",
"true",
"return false;",
"false",
"public static void push(String str){\n if(isFull()) System.out.println(\"Error\");\n s[++top]=str;\n }",
"push",
"{\n if(isFull()) System.out.println(\"Error\");\n s[++top]=str;\n }",
"if(isFull()) System.out.println(\"Error\");",
"isFull()",
"isFull",
"System.out.println(\"Error\")",
"System.out.println",
"System.out",
"System",
"System.out",
"\"Error\"",
"s[++top]=str",
"s[++top]",
"s",
"++top",
"top",
"str",
"String str",
"str",
"public static String pop(){\n if(isEmpty()) System.out.println(\"Error\");\n return s[top--];\n }",
"pop",
"{\n if(isEmpty()) System.out.println(\"Error\");\n return s[top--];\n }",
"if(isEmpty()) System.out.println(\"Error\");",
"isEmpty()",
"isEmpty",
"System.out.println(\"Error\")",
"System.out.println",
"System.out",
"System",
"System.out",
"\"Error\"",
"return s[top--];",
"s[top--]",
"s",
"top--",
"top",
"public static void main(String args[]) throws Exception{\n try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {\n String line= br.readLine();\n int a,b;\n s[0]=null;\n\n //while ((line = br.readLine()) != null) {\n //System.out.println(line);\n String[] str = line.split(\" \");\n for(int i=0;i<str.length;i++){\n //System.out.println(str[i]);\n if(str[i].equals(\"+\")){\n b=Integer.parseInt(pop());\n a=Integer.parseInt(pop());\n push(String.valueOf(a+b));\n //System.out.println(a+b);\n }\n else if(str[i].equals(\"-\")){\n b=Integer.parseInt(pop());\n a=Integer.parseInt(pop());\n push(String.valueOf(a-b));\n //System.out.println(a-b);\n }\n else if(str[i].equals(\"*\")){\n b=Integer.parseInt(pop());\n a=Integer.parseInt(pop());\n push(String.valueOf(a*b));\n //System.out.println(a*b);\n }\n else{\n push(str[i]);\n }\n }\n\n //System.out.println(\"done\");\n }\n //System.out.println(\"done\");\n String answer=pop();\n System.out.println(answer);\n //}\n }",
"main",
"{\n try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {\n String line= br.readLine();\n int a,b;\n s[0]=null;\n\n //while ((line = br.readLine()) != null) {\n //System.out.println(line);\n String[] str = line.split(\" \");\n for(int i=0;i<str.length;i++){\n //System.out.println(str[i]);\n if(str[i].equals(\"+\")){\n b=Integer.parseInt(pop());\n a=Integer.parseInt(pop());\n push(String.valueOf(a+b));\n //System.out.println(a+b);\n }\n else if(str[i].equals(\"-\")){\n b=Integer.parseInt(pop());\n a=Integer.parseInt(pop());\n push(String.valueOf(a-b));\n //System.out.println(a-b);\n }\n else if(str[i].equals(\"*\")){\n b=Integer.parseInt(pop());\n a=Integer.parseInt(pop());\n push(String.valueOf(a*b));\n //System.out.println(a*b);\n }\n else{\n push(str[i]);\n }\n }\n\n //System.out.println(\"done\");\n }\n //System.out.println(\"done\");\n String answer=pop();\n System.out.println(answer);\n //}\n }",
"try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {\n String line= br.readLine();\n int a,b;\n s[0]=null;\n\n //while ((line = br.readLine()) != null) {\n //System.out.println(line);\n String[] str = line.split(\" \");\n for(int i=0;i<str.length;i++){\n //System.out.println(str[i]);\n if(str[i].equals(\"+\")){\n b=Integer.parseInt(pop());\n a=Integer.parseInt(pop());\n push(String.valueOf(a+b));\n //System.out.println(a+b);\n }\n else if(str[i].equals(\"-\")){\n b=Integer.parseInt(pop());\n a=Integer.parseInt(pop());\n push(String.valueOf(a-b));\n //System.out.println(a-b);\n }\n else if(str[i].equals(\"*\")){\n b=Integer.parseInt(pop());\n a=Integer.parseInt(pop());\n push(String.valueOf(a*b));\n //System.out.println(a*b);\n }\n else{\n push(str[i]);\n }\n }\n\n //System.out.println(\"done\");\n }",
"{\n String line= br.readLine();\n int a,b;\n s[0]=null;\n\n //while ((line = br.readLine()) != null) {\n //System.out.println(line);\n String[] str = line.split(\" \");\n for(int i=0;i<str.length;i++){\n //System.out.println(str[i]);\n if(str[i].equals(\"+\")){\n b=Integer.parseInt(pop());\n a=Integer.parseInt(pop());\n push(String.valueOf(a+b));\n //System.out.println(a+b);\n }\n else if(str[i].equals(\"-\")){\n b=Integer.parseInt(pop());\n a=Integer.parseInt(pop());\n push(String.valueOf(a-b));\n //System.out.println(a-b);\n }\n else if(str[i].equals(\"*\")){\n b=Integer.parseInt(pop());\n a=Integer.parseInt(pop());\n push(String.valueOf(a*b));\n //System.out.println(a*b);\n }\n else{\n push(str[i]);\n }\n }\n\n //System.out.println(\"done\");\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();",
"line",
"br.readLine()",
"br.readLine",
"br",
"int a",
"a",
"b;",
"b",
"s[0]=null",
"s[0]",
"s",
"0",
"null",
"String[] str = line.split(\" \");",
"str",
"line.split(\" \")",
"line.split",
"line",
"\" \"",
"for(int i=0;i<str.length;i++){\n //System.out.println(str[i]);\n if(str[i].equals(\"+\")){\n b=Integer.parseInt(pop());\n a=Integer.parseInt(pop());\n push(String.valueOf(a+b));\n //System.out.println(a+b);\n }\n else if(str[i].equals(\"-\")){\n b=Integer.parseInt(pop());\n a=Integer.parseInt(pop());\n push(String.valueOf(a-b));\n //System.out.println(a-b);\n }\n else if(str[i].equals(\"*\")){\n b=Integer.parseInt(pop());\n a=Integer.parseInt(pop());\n push(String.valueOf(a*b));\n //System.out.println(a*b);\n }\n else{\n push(str[i]);\n }\n }",
"int i=0;",
"int i=0;",
"i",
"0",
"i<str.length",
"i",
"str.length",
"str",
"str.length",
"i++",
"i++",
"i",
"{\n //System.out.println(str[i]);\n if(str[i].equals(\"+\")){\n b=Integer.parseInt(pop());\n a=Integer.parseInt(pop());\n push(String.valueOf(a+b));\n //System.out.println(a+b);\n }\n else if(str[i].equals(\"-\")){\n b=Integer.parseInt(pop());\n a=Integer.parseInt(pop());\n push(String.valueOf(a-b));\n //System.out.println(a-b);\n }\n else if(str[i].equals(\"*\")){\n b=Integer.parseInt(pop());\n a=Integer.parseInt(pop());\n push(String.valueOf(a*b));\n //System.out.println(a*b);\n }\n else{\n push(str[i]);\n }\n }",
"{\n //System.out.println(str[i]);\n if(str[i].equals(\"+\")){\n b=Integer.parseInt(pop());\n a=Integer.parseInt(pop());\n push(String.valueOf(a+b));\n //System.out.println(a+b);\n }\n else if(str[i].equals(\"-\")){\n b=Integer.parseInt(pop());\n a=Integer.parseInt(pop());\n push(String.valueOf(a-b));\n //System.out.println(a-b);\n }\n else if(str[i].equals(\"*\")){\n b=Integer.parseInt(pop());\n a=Integer.parseInt(pop());\n push(String.valueOf(a*b));\n //System.out.println(a*b);\n }\n else{\n push(str[i]);\n }\n }",
"if(str[i].equals(\"+\")){\n b=Integer.parseInt(pop());\n a=Integer.parseInt(pop());\n push(String.valueOf(a+b));\n //System.out.println(a+b);\n }\n else if(str[i].equals(\"-\")){\n b=Integer.parseInt(pop());\n a=Integer.parseInt(pop());\n push(String.valueOf(a-b));\n //System.out.println(a-b);\n }\n else if(str[i].equals(\"*\")){\n b=Integer.parseInt(pop());\n a=Integer.parseInt(pop());\n push(String.valueOf(a*b));\n //System.out.println(a*b);\n }\n else{\n push(str[i]);\n }",
"str[i].equals(\"+\")",
"str[i].equals",
"str[i]",
"str",
"i",
"\"+\"",
"{\n b=Integer.parseInt(pop());\n a=Integer.parseInt(pop());\n push(String.valueOf(a+b));\n //System.out.println(a+b);\n }",
"b=Integer.parseInt(pop())",
"b",
"Integer.parseInt(pop())",
"Integer.parseInt",
"Integer",
"pop()",
"pop",
"a=Integer.parseInt(pop())",
"a",
"Integer.parseInt(pop())",
"Integer.parseInt",
"Integer",
"pop()",
"pop",
"push(String.valueOf(a+b))",
"push",
"String.valueOf(a+b)",
"String.valueOf",
"String",
"a+b",
"a",
"b",
"if(str[i].equals(\"-\")){\n b=Integer.parseInt(pop());\n a=Integer.parseInt(pop());\n push(String.valueOf(a-b));\n //System.out.println(a-b);\n }\n else if(str[i].equals(\"*\")){\n b=Integer.parseInt(pop());\n a=Integer.parseInt(pop());\n push(String.valueOf(a*b));\n //System.out.println(a*b);\n }\n else{\n push(str[i]);\n }",
"str[i].equals(\"-\")",
"str[i].equals",
"str[i]",
"str",
"i",
"\"-\"",
"{\n b=Integer.parseInt(pop());\n a=Integer.parseInt(pop());\n push(String.valueOf(a-b));\n //System.out.println(a-b);\n }",
"b=Integer.parseInt(pop())",
"b",
"Integer.parseInt(pop())",
"Integer.parseInt",
"Integer",
"pop()",
"pop",
"a=Integer.parseInt(pop())",
"a",
"Integer.parseInt(pop())",
"Integer.parseInt",
"Integer",
"pop()",
"pop",
"push(String.valueOf(a-b))",
"push",
"String.valueOf(a-b)",
"String.valueOf",
"String",
"a-b",
"a",
"b",
"if(str[i].equals(\"*\")){\n b=Integer.parseInt(pop());\n a=Integer.parseInt(pop());\n push(String.valueOf(a*b));\n //System.out.println(a*b);\n }\n else{\n push(str[i]);\n }",
"str[i].equals(\"*\")",
"str[i].equals",
"str[i]",
"str",
"i",
"\"*\"",
"{\n b=Integer.parseInt(pop());\n a=Integer.parseInt(pop());\n push(String.valueOf(a*b));\n //System.out.println(a*b);\n }",
"b=Integer.parseInt(pop())",
"b",
"Integer.parseInt(pop())",
"Integer.parseInt",
"Integer",
"pop()",
"pop",
"a=Integer.parseInt(pop())",
"a",
"Integer.parseInt(pop())",
"Integer.parseInt",
"Integer",
"pop()",
"pop",
"push(String.valueOf(a*b))",
"push",
"String.valueOf(a*b)",
"String.valueOf",
"String",
"a*b",
"a",
"b",
"{\n push(str[i]);\n }",
"push(str[i])",
"push",
"str[i]",
"str",
"i",
"String answer=pop();",
"answer",
"pop()",
"pop",
"System.out.println(answer)",
"System.out.println",
"System.out",
"System",
"System.out",
"answer",
"String args[]",
"args"
] | import java.util.Scanner;
import java.lang.Math;
import java.lang.System;
import java.io.*;
class Main{
private static int top;
private static String[] s=new String[1000];
public static void initialize(){
top=0;
return;
}
public static boolean isEmpty(){
if(top==0)
return true;
return false;
}
public static boolean isFull(){
if(top>=1000)
return true;
return false;
}
public static void push(String str){
if(isFull()) System.out.println("Error");
s[++top]=str;
}
public static String pop(){
if(isEmpty()) System.out.println("Error");
return s[top--];
}
public static void main(String args[]) throws Exception{
try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {
String line= br.readLine();
int a,b;
s[0]=null;
//while ((line = br.readLine()) != null) {
//System.out.println(line);
String[] str = line.split(" ");
for(int i=0;i<str.length;i++){
//System.out.println(str[i]);
if(str[i].equals("+")){
b=Integer.parseInt(pop());
a=Integer.parseInt(pop());
push(String.valueOf(a+b));
//System.out.println(a+b);
}
else if(str[i].equals("-")){
b=Integer.parseInt(pop());
a=Integer.parseInt(pop());
push(String.valueOf(a-b));
//System.out.println(a-b);
}
else if(str[i].equals("*")){
b=Integer.parseInt(pop());
a=Integer.parseInt(pop());
push(String.valueOf(a*b));
//System.out.println(a*b);
}
else{
push(str[i]);
}
}
//System.out.println("done");
}
//System.out.println("done");
String answer=pop();
System.out.println(answer);
//}
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
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,
4,
18,
13,
2,
4,
18,
13,
4,
18,
13,
14,
4,
18,
13,
17,
30,
4,
18,
13,
2,
4,
18,
13,
4,
18,
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
],
[
111,
8
],
[
111,
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
],
[
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
],
[
44,
45
],
[
45,
46
],
[
44,
47
],
[
43,
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
],
[
43,
65
],
[
65,
66
],
[
66,
67
],
[
67,
68
],
[
66,
69
],
[
65,
70
],
[
70,
71
],
[
71,
72
],
[
72,
73
],
[
71,
74
],
[
74,
75
],
[
75,
76
],
[
76,
77
],
[
74,
78
],
[
78,
79
],
[
79,
80
],
[
65,
81
],
[
81,
82
],
[
82,
83
],
[
83,
84
],
[
82,
85
],
[
81,
86
],
[
86,
87
],
[
87,
88
],
[
88,
89
],
[
87,
90
],
[
90,
91
],
[
91,
92
],
[
92,
93
],
[
90,
94
],
[
94,
95
],
[
95,
96
],
[
11,
97
],
[
97,
98
],
[
98,
99
],
[
99,
100
],
[
99,
101
],
[
97,
102
],
[
102,
103
],
[
103,
104
],
[
11,
105
],
[
105,
106
],
[
106,
107
],
[
9,
108
],
[
108,
109
],
[
0,
110
],
[
110,
111
],
[
110,
112
]
] | [
"import java.util.Scanner;\nimport java.util.Stack;\n\npublic class Main{\n\tpublic static void main(String[] args)\n\t{\n\t\tStack<Integer> s1 = new Stack<>();\n\t\tScanner in1 = new Scanner(System.in);\n\t\tScanner in = new Scanner(in1.nextLine());\n\t\twhile(in.hasNext())\n\t\t{\n\t\t\tif(in.hasNextInt())\n\t\t\t{\n\t\t\t\ts1.push(in.nextInt());\n\t\t\t}else\n\t\t\t{\n\t\t\t\tString symbol = in.next();\t\n\t\t\t\t\n\t\t\t\tif(symbol.equals(\"-\"))\n\t\t\t\t{\n\t\t\t\t\tint val1 = s1.pop();\n\t\t\t\t\tint val2 = s1.pop();\n\t\t\t\t\ts1.push(val2 - val1);\n\t\t\t\t}else if(symbol.equals(\"+\"))\n\t\t\t\t{\n\t\t\t\t\ts1.push(s1.pop() + s1.pop());\n\t\t\t\t}else if(symbol.equals(\"*\"))\n\t\t\t\t{\n\t\t\t\t\ts1.push(s1.pop() * s1.pop());\n\t\t\t\t}\n\t\t\t}\n\t\t\t//System.out.println(s1.peek());\n\t\t}\n\t\tSystem.out.println(s1.pop());\n\t\tin.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{\n\t\tStack<Integer> s1 = new Stack<>();\n\t\tScanner in1 = new Scanner(System.in);\n\t\tScanner in = new Scanner(in1.nextLine());\n\t\twhile(in.hasNext())\n\t\t{\n\t\t\tif(in.hasNextInt())\n\t\t\t{\n\t\t\t\ts1.push(in.nextInt());\n\t\t\t}else\n\t\t\t{\n\t\t\t\tString symbol = in.next();\t\n\t\t\t\t\n\t\t\t\tif(symbol.equals(\"-\"))\n\t\t\t\t{\n\t\t\t\t\tint val1 = s1.pop();\n\t\t\t\t\tint val2 = s1.pop();\n\t\t\t\t\ts1.push(val2 - val1);\n\t\t\t\t}else if(symbol.equals(\"+\"))\n\t\t\t\t{\n\t\t\t\t\ts1.push(s1.pop() + s1.pop());\n\t\t\t\t}else if(symbol.equals(\"*\"))\n\t\t\t\t{\n\t\t\t\t\ts1.push(s1.pop() * s1.pop());\n\t\t\t\t}\n\t\t\t}\n\t\t\t//System.out.println(s1.peek());\n\t\t}\n\t\tSystem.out.println(s1.pop());\n\t\tin.close();\n\t}\n}",
"Main",
"public static void main(String[] args)\n\t{\n\t\tStack<Integer> s1 = new Stack<>();\n\t\tScanner in1 = new Scanner(System.in);\n\t\tScanner in = new Scanner(in1.nextLine());\n\t\twhile(in.hasNext())\n\t\t{\n\t\t\tif(in.hasNextInt())\n\t\t\t{\n\t\t\t\ts1.push(in.nextInt());\n\t\t\t}else\n\t\t\t{\n\t\t\t\tString symbol = in.next();\t\n\t\t\t\t\n\t\t\t\tif(symbol.equals(\"-\"))\n\t\t\t\t{\n\t\t\t\t\tint val1 = s1.pop();\n\t\t\t\t\tint val2 = s1.pop();\n\t\t\t\t\ts1.push(val2 - val1);\n\t\t\t\t}else if(symbol.equals(\"+\"))\n\t\t\t\t{\n\t\t\t\t\ts1.push(s1.pop() + s1.pop());\n\t\t\t\t}else if(symbol.equals(\"*\"))\n\t\t\t\t{\n\t\t\t\t\ts1.push(s1.pop() * s1.pop());\n\t\t\t\t}\n\t\t\t}\n\t\t\t//System.out.println(s1.peek());\n\t\t}\n\t\tSystem.out.println(s1.pop());\n\t\tin.close();\n\t}",
"main",
"{\n\t\tStack<Integer> s1 = new Stack<>();\n\t\tScanner in1 = new Scanner(System.in);\n\t\tScanner in = new Scanner(in1.nextLine());\n\t\twhile(in.hasNext())\n\t\t{\n\t\t\tif(in.hasNextInt())\n\t\t\t{\n\t\t\t\ts1.push(in.nextInt());\n\t\t\t}else\n\t\t\t{\n\t\t\t\tString symbol = in.next();\t\n\t\t\t\t\n\t\t\t\tif(symbol.equals(\"-\"))\n\t\t\t\t{\n\t\t\t\t\tint val1 = s1.pop();\n\t\t\t\t\tint val2 = s1.pop();\n\t\t\t\t\ts1.push(val2 - val1);\n\t\t\t\t}else if(symbol.equals(\"+\"))\n\t\t\t\t{\n\t\t\t\t\ts1.push(s1.pop() + s1.pop());\n\t\t\t\t}else if(symbol.equals(\"*\"))\n\t\t\t\t{\n\t\t\t\t\ts1.push(s1.pop() * s1.pop());\n\t\t\t\t}\n\t\t\t}\n\t\t\t//System.out.println(s1.peek());\n\t\t}\n\t\tSystem.out.println(s1.pop());\n\t\tin.close();\n\t}",
"Stack<Integer> s1 = new Stack<>();",
"s1",
"new Stack<>()",
"Scanner in1 = new Scanner(System.in);",
"in1",
"new Scanner(System.in)",
"Scanner in = new Scanner(in1.nextLine());",
"in",
"new Scanner(in1.nextLine())",
"while(in.hasNext())\n\t\t{\n\t\t\tif(in.hasNextInt())\n\t\t\t{\n\t\t\t\ts1.push(in.nextInt());\n\t\t\t}else\n\t\t\t{\n\t\t\t\tString symbol = in.next();\t\n\t\t\t\t\n\t\t\t\tif(symbol.equals(\"-\"))\n\t\t\t\t{\n\t\t\t\t\tint val1 = s1.pop();\n\t\t\t\t\tint val2 = s1.pop();\n\t\t\t\t\ts1.push(val2 - val1);\n\t\t\t\t}else if(symbol.equals(\"+\"))\n\t\t\t\t{\n\t\t\t\t\ts1.push(s1.pop() + s1.pop());\n\t\t\t\t}else if(symbol.equals(\"*\"))\n\t\t\t\t{\n\t\t\t\t\ts1.push(s1.pop() * s1.pop());\n\t\t\t\t}\n\t\t\t}\n\t\t\t//System.out.println(s1.peek());\n\t\t}",
"in.hasNext()",
"in.hasNext",
"in",
"{\n\t\t\tif(in.hasNextInt())\n\t\t\t{\n\t\t\t\ts1.push(in.nextInt());\n\t\t\t}else\n\t\t\t{\n\t\t\t\tString symbol = in.next();\t\n\t\t\t\t\n\t\t\t\tif(symbol.equals(\"-\"))\n\t\t\t\t{\n\t\t\t\t\tint val1 = s1.pop();\n\t\t\t\t\tint val2 = s1.pop();\n\t\t\t\t\ts1.push(val2 - val1);\n\t\t\t\t}else if(symbol.equals(\"+\"))\n\t\t\t\t{\n\t\t\t\t\ts1.push(s1.pop() + s1.pop());\n\t\t\t\t}else if(symbol.equals(\"*\"))\n\t\t\t\t{\n\t\t\t\t\ts1.push(s1.pop() * s1.pop());\n\t\t\t\t}\n\t\t\t}\n\t\t\t//System.out.println(s1.peek());\n\t\t}",
"if(in.hasNextInt())\n\t\t\t{\n\t\t\t\ts1.push(in.nextInt());\n\t\t\t}else\n\t\t\t{\n\t\t\t\tString symbol = in.next();\t\n\t\t\t\t\n\t\t\t\tif(symbol.equals(\"-\"))\n\t\t\t\t{\n\t\t\t\t\tint val1 = s1.pop();\n\t\t\t\t\tint val2 = s1.pop();\n\t\t\t\t\ts1.push(val2 - val1);\n\t\t\t\t}else if(symbol.equals(\"+\"))\n\t\t\t\t{\n\t\t\t\t\ts1.push(s1.pop() + s1.pop());\n\t\t\t\t}else if(symbol.equals(\"*\"))\n\t\t\t\t{\n\t\t\t\t\ts1.push(s1.pop() * s1.pop());\n\t\t\t\t}\n\t\t\t}",
"in.hasNextInt()",
"in.hasNextInt",
"in",
"{\n\t\t\t\ts1.push(in.nextInt());\n\t\t\t}",
"s1.push(in.nextInt())",
"s1.push",
"s1",
"in.nextInt()",
"in.nextInt",
"in",
"{\n\t\t\t\tString symbol = in.next();\t\n\t\t\t\t\n\t\t\t\tif(symbol.equals(\"-\"))\n\t\t\t\t{\n\t\t\t\t\tint val1 = s1.pop();\n\t\t\t\t\tint val2 = s1.pop();\n\t\t\t\t\ts1.push(val2 - val1);\n\t\t\t\t}else if(symbol.equals(\"+\"))\n\t\t\t\t{\n\t\t\t\t\ts1.push(s1.pop() + s1.pop());\n\t\t\t\t}else if(symbol.equals(\"*\"))\n\t\t\t\t{\n\t\t\t\t\ts1.push(s1.pop() * s1.pop());\n\t\t\t\t}\n\t\t\t}",
"String symbol = in.next();",
"symbol",
"in.next()",
"in.next",
"in",
"if(symbol.equals(\"-\"))\n\t\t\t\t{\n\t\t\t\t\tint val1 = s1.pop();\n\t\t\t\t\tint val2 = s1.pop();\n\t\t\t\t\ts1.push(val2 - val1);\n\t\t\t\t}else if(symbol.equals(\"+\"))\n\t\t\t\t{\n\t\t\t\t\ts1.push(s1.pop() + s1.pop());\n\t\t\t\t}else if(symbol.equals(\"*\"))\n\t\t\t\t{\n\t\t\t\t\ts1.push(s1.pop() * s1.pop());\n\t\t\t\t}",
"symbol.equals(\"-\")",
"symbol.equals",
"symbol",
"\"-\"",
"{\n\t\t\t\t\tint val1 = s1.pop();\n\t\t\t\t\tint val2 = s1.pop();\n\t\t\t\t\ts1.push(val2 - val1);\n\t\t\t\t}",
"int val1 = s1.pop();",
"val1",
"s1.pop()",
"s1.pop",
"s1",
"int val2 = s1.pop();",
"val2",
"s1.pop()",
"s1.pop",
"s1",
"s1.push(val2 - val1)",
"s1.push",
"s1",
"val2 - val1",
"val2",
"val1",
"if(symbol.equals(\"+\"))\n\t\t\t\t{\n\t\t\t\t\ts1.push(s1.pop() + s1.pop());\n\t\t\t\t}else if(symbol.equals(\"*\"))\n\t\t\t\t{\n\t\t\t\t\ts1.push(s1.pop() * s1.pop());\n\t\t\t\t}",
"symbol.equals(\"+\")",
"symbol.equals",
"symbol",
"\"+\"",
"{\n\t\t\t\t\ts1.push(s1.pop() + s1.pop());\n\t\t\t\t}",
"s1.push(s1.pop() + s1.pop())",
"s1.push",
"s1",
"s1.pop() + s1.pop()",
"s1.pop()",
"s1.pop",
"s1",
"s1.pop()",
"s1.pop",
"s1",
"if(symbol.equals(\"*\"))\n\t\t\t\t{\n\t\t\t\t\ts1.push(s1.pop() * s1.pop());\n\t\t\t\t}",
"symbol.equals(\"*\")",
"symbol.equals",
"symbol",
"\"*\"",
"{\n\t\t\t\t\ts1.push(s1.pop() * s1.pop());\n\t\t\t\t}",
"s1.push(s1.pop() * s1.pop())",
"s1.push",
"s1",
"s1.pop() * s1.pop()",
"s1.pop()",
"s1.pop",
"s1",
"s1.pop()",
"s1.pop",
"s1",
"System.out.println(s1.pop())",
"System.out.println",
"System.out",
"System",
"System.out",
"s1.pop()",
"s1.pop",
"s1",
"in.close()",
"in.close",
"in",
"String[] args",
"args",
"public class Main{\n\tpublic static void main(String[] args)\n\t{\n\t\tStack<Integer> s1 = new Stack<>();\n\t\tScanner in1 = new Scanner(System.in);\n\t\tScanner in = new Scanner(in1.nextLine());\n\t\twhile(in.hasNext())\n\t\t{\n\t\t\tif(in.hasNextInt())\n\t\t\t{\n\t\t\t\ts1.push(in.nextInt());\n\t\t\t}else\n\t\t\t{\n\t\t\t\tString symbol = in.next();\t\n\t\t\t\t\n\t\t\t\tif(symbol.equals(\"-\"))\n\t\t\t\t{\n\t\t\t\t\tint val1 = s1.pop();\n\t\t\t\t\tint val2 = s1.pop();\n\t\t\t\t\ts1.push(val2 - val1);\n\t\t\t\t}else if(symbol.equals(\"+\"))\n\t\t\t\t{\n\t\t\t\t\ts1.push(s1.pop() + s1.pop());\n\t\t\t\t}else if(symbol.equals(\"*\"))\n\t\t\t\t{\n\t\t\t\t\ts1.push(s1.pop() * s1.pop());\n\t\t\t\t}\n\t\t\t}\n\t\t\t//System.out.println(s1.peek());\n\t\t}\n\t\tSystem.out.println(s1.pop());\n\t\tin.close();\n\t}\n}",
"public class Main{\n\tpublic static void main(String[] args)\n\t{\n\t\tStack<Integer> s1 = new Stack<>();\n\t\tScanner in1 = new Scanner(System.in);\n\t\tScanner in = new Scanner(in1.nextLine());\n\t\twhile(in.hasNext())\n\t\t{\n\t\t\tif(in.hasNextInt())\n\t\t\t{\n\t\t\t\ts1.push(in.nextInt());\n\t\t\t}else\n\t\t\t{\n\t\t\t\tString symbol = in.next();\t\n\t\t\t\t\n\t\t\t\tif(symbol.equals(\"-\"))\n\t\t\t\t{\n\t\t\t\t\tint val1 = s1.pop();\n\t\t\t\t\tint val2 = s1.pop();\n\t\t\t\t\ts1.push(val2 - val1);\n\t\t\t\t}else if(symbol.equals(\"+\"))\n\t\t\t\t{\n\t\t\t\t\ts1.push(s1.pop() + s1.pop());\n\t\t\t\t}else if(symbol.equals(\"*\"))\n\t\t\t\t{\n\t\t\t\t\ts1.push(s1.pop() * s1.pop());\n\t\t\t\t}\n\t\t\t}\n\t\t\t//System.out.println(s1.peek());\n\t\t}\n\t\tSystem.out.println(s1.pop());\n\t\tin.close();\n\t}\n}",
"Main"
] | import java.util.Scanner;
import java.util.Stack;
public class Main{
public static void main(String[] args)
{
Stack<Integer> s1 = new Stack<>();
Scanner in1 = new Scanner(System.in);
Scanner in = new Scanner(in1.nextLine());
while(in.hasNext())
{
if(in.hasNextInt())
{
s1.push(in.nextInt());
}else
{
String symbol = in.next();
if(symbol.equals("-"))
{
int val1 = s1.pop();
int val2 = s1.pop();
s1.push(val2 - val1);
}else if(symbol.equals("+"))
{
s1.push(s1.pop() + s1.pop());
}else if(symbol.equals("*"))
{
s1.push(s1.pop() * s1.pop());
}
}
//System.out.println(s1.peek());
}
System.out.println(s1.pop());
in.close();
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
20,
41,
13,
41,
13,
41,
13,
17,
41,
13,
41,
13,
0,
13,
4,
18,
4,
18,
13,
17,
17,
0,
13,
18,
13,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
14,
4,
18,
18,
13,
13,
17,
30,
4,
18,
13,
17,
14,
4,
18,
18,
13,
13,
17,
30,
4,
18,
13,
17,
14,
4,
18,
18,
13,
13,
17,
30,
4,
18,
13,
17,
30,
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,
20,
17,
41,
13,
12,
13,
30,
11,
1,
41,
13,
17,
2,
13,
17,
1,
40,
13,
30,
30,
0,
18,
13,
13,
17,
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,
0,
18,
13,
2,
13,
17,
17,
40,
13,
29,
13,
12,
13,
30,
41,
13,
41,
13,
41,
13,
0,
13,
4,
13,
0,
13,
4,
13,
35,
13,
34,
17,
1,
0,
13,
2,
13,
13,
3,
34,
17,
1,
0,
13,
2,
13,
13,
3,
34,
1,
0,
13,
2,
13,
13,
3,
4,
13,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
231,
8
],
[
231,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
12,
14
],
[
11,
15
],
[
15,
16
],
[
15,
17
],
[
11,
18
],
[
18,
19
],
[
11,
20
],
[
20,
21
],
[
11,
22
],
[
22,
23
],
[
22,
24
],
[
11,
25
],
[
25,
26
],
[
11,
27
],
[
27,
28
],
[
11,
29
],
[
29,
30
],
[
29,
31
],
[
31,
32
],
[
32,
33
],
[
33,
34
],
[
34,
35
],
[
31,
36
],
[
31,
37
],
[
11,
38
],
[
38,
39
],
[
38,
40
],
[
40,
41
],
[
40,
42
],
[
11,
43
],
[
43,
44
],
[
44,
45
],
[
45,
46
],
[
45,
47
],
[
43,
48
],
[
48,
49
],
[
48,
50
],
[
43,
51
],
[
51,
52
],
[
52,
53
],
[
43,
54
],
[
55,
55
],
[
55,
56
],
[
56,
57
],
[
57,
58
],
[
58,
59
],
[
59,
60
],
[
59,
61
],
[
57,
62
],
[
56,
63
],
[
63,
64
],
[
64,
65
],
[
65,
66
],
[
64,
67
],
[
56,
68
],
[
68,
69
],
[
69,
70
],
[
70,
71
],
[
71,
72
],
[
71,
73
],
[
69,
74
],
[
68,
75
],
[
75,
76
],
[
76,
77
],
[
77,
78
],
[
76,
79
],
[
68,
80
],
[
80,
81
],
[
81,
82
],
[
82,
83
],
[
83,
84
],
[
83,
85
],
[
81,
86
],
[
80,
87
],
[
87,
88
],
[
88,
89
],
[
89,
90
],
[
88,
91
],
[
80,
92
],
[
92,
93
],
[
93,
94
],
[
93,
95
],
[
95,
96
],
[
96,
97
],
[
95,
98
],
[
98,
99
],
[
98,
100
],
[
92,
101
],
[
101,
102
],
[
102,
103
],
[
101,
104
],
[
11,
105
],
[
105,
106
],
[
106,
107
],
[
107,
108
],
[
107,
109
],
[
105,
110
],
[
110,
111
],
[
111,
112
],
[
9,
113
],
[
113,
114
],
[
0,
115
],
[
115,
116
],
[
115,
117
],
[
117,
118
],
[
117,
119
],
[
115,
121
],
[
121,
122
],
[
115,
123
],
[
123,
124
],
[
123,
125
],
[
125,
126
],
[
126,
127
],
[
127,
128
],
[
128,
129
],
[
128,
130
],
[
126,
131
],
[
131,
132
],
[
131,
133
],
[
126,
134
],
[
134,
135
],
[
135,
136
],
[
126,
137
],
[
138,
138
],
[
138,
139
],
[
139,
140
],
[
140,
141
],
[
140,
142
],
[
139,
143
],
[
125,
144
],
[
144,
145
],
[
144,
146
],
[
115,
147
],
[
147,
148
],
[
147,
149
],
[
149,
150
],
[
150,
151
],
[
151,
152
],
[
151,
153
],
[
150,
154
],
[
149,
155
],
[
155,
156
],
[
147,
157
],
[
157,
158
],
[
115,
159
],
[
159,
160
],
[
159,
161
],
[
161,
162
],
[
162,
163
],
[
162,
164
],
[
164,
165
],
[
164,
166
],
[
166,
167
],
[
166,
168
],
[
161,
169
],
[
169,
170
],
[
170,
171
],
[
170,
172
],
[
172,
173
],
[
172,
174
],
[
169,
175
],
[
161,
176
],
[
176,
177
],
[
161,
178
],
[
178,
179
],
[
115,
180
],
[
180,
181
],
[
180,
182
],
[
182,
183
],
[
183,
184
],
[
182,
185
],
[
185,
186
],
[
182,
187
],
[
187,
188
],
[
182,
189
],
[
189,
190
],
[
189,
191
],
[
191,
192
],
[
182,
193
],
[
193,
194
],
[
193,
195
],
[
195,
196
],
[
182,
197
],
[
197,
198
],
[
197,
199
],
[
199,
200
],
[
199,
201
],
[
201,
202
],
[
202,
203
],
[
202,
204
],
[
204,
205
],
[
204,
206
],
[
201,
207
],
[
197,
208
],
[
208,
209
],
[
208,
210
],
[
210,
211
],
[
211,
212
],
[
211,
213
],
[
213,
214
],
[
213,
215
],
[
210,
216
],
[
197,
217
],
[
217,
218
],
[
218,
219
],
[
219,
220
],
[
219,
221
],
[
221,
222
],
[
221,
223
],
[
218,
224
],
[
182,
225
],
[
225,
226
],
[
225,
227
],
[
180,
228
],
[
228,
229
],
[
0,
230
],
[
230,
231
],
[
230,
232
]
] | [
"import java.util.*;\nimport java.io.*;\n\npublic class Main{\n\tpublic static void main(String args[]) throws IOException{\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\toperateStack ost = new operateStack();\n\t\tString[] str;\n\t\tint len, top = 0;\n\t\tlong op, cal;\n\t\t\n\t\tstr = br.readLine().split(\" \", 0);\n\t\tlen = str.length;\n\t\t\n\t\tfor(int i = 0; i < len; i++){\n\t\t\t\n\t\t\tif(str[i].equals(\"+\")){\n\t\t\t\tost.calc(1);\n\t\t\t}\n\t\t\telse if(str[i].equals(\"-\")){\n\t\t\t\tost.calc(2);\n\t\t\t}\n\t\t\telse if(str[i].equals(\"*\")){\n\t\t\t\tost.calc(3);\n\t\t\t}\n\t\t\telse{\n\t\t\t\top = Long.parseLong(str[i]);\n\t\t\t\tost.push(op);\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(ost.pop());\n\t}\n}\n\nclass operateStack{\n\tlong[] stack = new long[100];\n\tint top;\n\t\n\toperateStack(){\n\t\tfor(int i = 0; i < 100; i++){\n\t\t\tstack[i] = 0;\n\t\t}\n\t\ttop = 0;\n\t}\n\t\n\tvoid push(long op){\n\t\tstack[top] = op;\n\t\ttop ++;\n\t}\n\t\n\tlong pop(){\n\t\tlong op = stack[top - 1];\n\t\tstack[top - 1] = 0;\n\t\ttop --;\n\t\t\n\t\treturn op;\n\t}\n\t\n\tvoid calc(int flag){\n\t\tlong op, op2;\n\t\tlong cal;\n\t\t\n\t\top = pop();\n\t\top2 = pop();\n\t\t\n\t\tswitch(flag){\n\t\tcase 1:\n\t\t\tcal = op2 + op;\n\t\t\tbreak;\n\t\tcase 2:\n\t\t\tcal = op2 - op;\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tcal = op2 * op;\n\t\t\tbreak;\n\t\t}\n\t\t\n\t\tpush(cal);\n\t}\n}",
"import java.util.*;",
"util.*",
"java",
"import java.io.*;",
"io.*",
"java",
"public class Main{\n\tpublic static void main(String args[]) throws IOException{\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\toperateStack ost = new operateStack();\n\t\tString[] str;\n\t\tint len, top = 0;\n\t\tlong op, cal;\n\t\t\n\t\tstr = br.readLine().split(\" \", 0);\n\t\tlen = str.length;\n\t\t\n\t\tfor(int i = 0; i < len; i++){\n\t\t\t\n\t\t\tif(str[i].equals(\"+\")){\n\t\t\t\tost.calc(1);\n\t\t\t}\n\t\t\telse if(str[i].equals(\"-\")){\n\t\t\t\tost.calc(2);\n\t\t\t}\n\t\t\telse if(str[i].equals(\"*\")){\n\t\t\t\tost.calc(3);\n\t\t\t}\n\t\t\telse{\n\t\t\t\top = Long.parseLong(str[i]);\n\t\t\t\tost.push(op);\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(ost.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\toperateStack ost = new operateStack();\n\t\tString[] str;\n\t\tint len, top = 0;\n\t\tlong op, cal;\n\t\t\n\t\tstr = br.readLine().split(\" \", 0);\n\t\tlen = str.length;\n\t\t\n\t\tfor(int i = 0; i < len; i++){\n\t\t\t\n\t\t\tif(str[i].equals(\"+\")){\n\t\t\t\tost.calc(1);\n\t\t\t}\n\t\t\telse if(str[i].equals(\"-\")){\n\t\t\t\tost.calc(2);\n\t\t\t}\n\t\t\telse if(str[i].equals(\"*\")){\n\t\t\t\tost.calc(3);\n\t\t\t}\n\t\t\telse{\n\t\t\t\top = Long.parseLong(str[i]);\n\t\t\t\tost.push(op);\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(ost.pop());\n\t}",
"main",
"{\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\toperateStack ost = new operateStack();\n\t\tString[] str;\n\t\tint len, top = 0;\n\t\tlong op, cal;\n\t\t\n\t\tstr = br.readLine().split(\" \", 0);\n\t\tlen = str.length;\n\t\t\n\t\tfor(int i = 0; i < len; i++){\n\t\t\t\n\t\t\tif(str[i].equals(\"+\")){\n\t\t\t\tost.calc(1);\n\t\t\t}\n\t\t\telse if(str[i].equals(\"-\")){\n\t\t\t\tost.calc(2);\n\t\t\t}\n\t\t\telse if(str[i].equals(\"*\")){\n\t\t\t\tost.calc(3);\n\t\t\t}\n\t\t\telse{\n\t\t\t\top = Long.parseLong(str[i]);\n\t\t\t\tost.push(op);\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(ost.pop());\n\t}",
"BufferedReader br = new BufferedReader(new InputStreamReader(System.in));",
"br",
"new BufferedReader(new InputStreamReader(System.in))",
"operateStack ost = new operateStack();",
"ost",
"new operateStack()",
"String[] str;",
"str",
"int len",
"len",
"top = 0;",
"top",
"0",
"long op",
"op",
"cal;",
"cal",
"str = br.readLine().split(\" \", 0)",
"str",
"br.readLine().split(\" \", 0)",
"br.readLine().split",
"br.readLine()",
"br.readLine",
"br",
"\" \"",
"0",
"len = str.length",
"len",
"str.length",
"str",
"str.length",
"for(int i = 0; i < len; i++){\n\t\t\t\n\t\t\tif(str[i].equals(\"+\")){\n\t\t\t\tost.calc(1);\n\t\t\t}\n\t\t\telse if(str[i].equals(\"-\")){\n\t\t\t\tost.calc(2);\n\t\t\t}\n\t\t\telse if(str[i].equals(\"*\")){\n\t\t\t\tost.calc(3);\n\t\t\t}\n\t\t\telse{\n\t\t\t\top = Long.parseLong(str[i]);\n\t\t\t\tost.push(op);\n\t\t\t}\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < len",
"i",
"len",
"i++",
"i++",
"i",
"{\n\t\t\t\n\t\t\tif(str[i].equals(\"+\")){\n\t\t\t\tost.calc(1);\n\t\t\t}\n\t\t\telse if(str[i].equals(\"-\")){\n\t\t\t\tost.calc(2);\n\t\t\t}\n\t\t\telse if(str[i].equals(\"*\")){\n\t\t\t\tost.calc(3);\n\t\t\t}\n\t\t\telse{\n\t\t\t\top = Long.parseLong(str[i]);\n\t\t\t\tost.push(op);\n\t\t\t}\n\t\t}",
"{\n\t\t\t\n\t\t\tif(str[i].equals(\"+\")){\n\t\t\t\tost.calc(1);\n\t\t\t}\n\t\t\telse if(str[i].equals(\"-\")){\n\t\t\t\tost.calc(2);\n\t\t\t}\n\t\t\telse if(str[i].equals(\"*\")){\n\t\t\t\tost.calc(3);\n\t\t\t}\n\t\t\telse{\n\t\t\t\top = Long.parseLong(str[i]);\n\t\t\t\tost.push(op);\n\t\t\t}\n\t\t}",
"if(str[i].equals(\"+\")){\n\t\t\t\tost.calc(1);\n\t\t\t}\n\t\t\telse if(str[i].equals(\"-\")){\n\t\t\t\tost.calc(2);\n\t\t\t}\n\t\t\telse if(str[i].equals(\"*\")){\n\t\t\t\tost.calc(3);\n\t\t\t}\n\t\t\telse{\n\t\t\t\top = Long.parseLong(str[i]);\n\t\t\t\tost.push(op);\n\t\t\t}",
"str[i].equals(\"+\")",
"str[i].equals",
"str[i]",
"str",
"i",
"\"+\"",
"{\n\t\t\t\tost.calc(1);\n\t\t\t}",
"ost.calc(1)",
"ost.calc",
"ost",
"1",
"if(str[i].equals(\"-\")){\n\t\t\t\tost.calc(2);\n\t\t\t}\n\t\t\telse if(str[i].equals(\"*\")){\n\t\t\t\tost.calc(3);\n\t\t\t}\n\t\t\telse{\n\t\t\t\top = Long.parseLong(str[i]);\n\t\t\t\tost.push(op);\n\t\t\t}",
"str[i].equals(\"-\")",
"str[i].equals",
"str[i]",
"str",
"i",
"\"-\"",
"{\n\t\t\t\tost.calc(2);\n\t\t\t}",
"ost.calc(2)",
"ost.calc",
"ost",
"2",
"if(str[i].equals(\"*\")){\n\t\t\t\tost.calc(3);\n\t\t\t}\n\t\t\telse{\n\t\t\t\top = Long.parseLong(str[i]);\n\t\t\t\tost.push(op);\n\t\t\t}",
"str[i].equals(\"*\")",
"str[i].equals",
"str[i]",
"str",
"i",
"\"*\"",
"{\n\t\t\t\tost.calc(3);\n\t\t\t}",
"ost.calc(3)",
"ost.calc",
"ost",
"3",
"{\n\t\t\t\top = Long.parseLong(str[i]);\n\t\t\t\tost.push(op);\n\t\t\t}",
"op = Long.parseLong(str[i])",
"op",
"Long.parseLong(str[i])",
"Long.parseLong",
"Long",
"str[i]",
"str",
"i",
"ost.push(op)",
"ost.push",
"ost",
"op",
"System.out.println(ost.pop())",
"System.out.println",
"System.out",
"System",
"System.out",
"ost.pop()",
"ost.pop",
"ost",
"String args[]",
"args",
"class operateStack{\n\tlong[] stack = new long[100];\n\tint top;\n\t\n\toperateStack(){\n\t\tfor(int i = 0; i < 100; i++){\n\t\t\tstack[i] = 0;\n\t\t}\n\t\ttop = 0;\n\t}\n\t\n\tvoid push(long op){\n\t\tstack[top] = op;\n\t\ttop ++;\n\t}\n\t\n\tlong pop(){\n\t\tlong op = stack[top - 1];\n\t\tstack[top - 1] = 0;\n\t\ttop --;\n\t\t\n\t\treturn op;\n\t}\n\t\n\tvoid calc(int flag){\n\t\tlong op, op2;\n\t\tlong cal;\n\t\t\n\t\top = pop();\n\t\top2 = pop();\n\t\t\n\t\tswitch(flag){\n\t\tcase 1:\n\t\t\tcal = op2 + op;\n\t\t\tbreak;\n\t\tcase 2:\n\t\t\tcal = op2 - op;\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tcal = op2 * op;\n\t\t\tbreak;\n\t\t}\n\t\t\n\t\tpush(cal);\n\t}\n}",
"operateStack",
"long[] stack = new long[100];",
"stack",
"new long[100]",
"100",
"int top;",
"top",
"operateStack(){\n\t\tfor(int i = 0; i < 100; i++){\n\t\t\tstack[i] = 0;\n\t\t}\n\t\ttop = 0;\n\t}",
"operateStack",
"{\n\t\tfor(int i = 0; i < 100; i++){\n\t\t\tstack[i] = 0;\n\t\t}\n\t\ttop = 0;\n\t}",
"for(int i = 0; i < 100; i++){\n\t\t\tstack[i] = 0;\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < 100",
"i",
"100",
"i++",
"i++",
"i",
"{\n\t\t\tstack[i] = 0;\n\t\t}",
"{\n\t\t\tstack[i] = 0;\n\t\t}",
"stack[i] = 0",
"stack[i]",
"stack",
"i",
"0",
"top = 0",
"top",
"0",
"void push(long op){\n\t\tstack[top] = op;\n\t\ttop ++;\n\t}",
"push",
"{\n\t\tstack[top] = op;\n\t\ttop ++;\n\t}",
"stack[top] = op",
"stack[top]",
"stack",
"top",
"op",
"top ++",
"top",
"long op",
"op",
"long pop(){\n\t\tlong op = stack[top - 1];\n\t\tstack[top - 1] = 0;\n\t\ttop --;\n\t\t\n\t\treturn op;\n\t}",
"pop",
"{\n\t\tlong op = stack[top - 1];\n\t\tstack[top - 1] = 0;\n\t\ttop --;\n\t\t\n\t\treturn op;\n\t}",
"long op = stack[top - 1];",
"op",
"stack[top - 1]",
"stack",
"top - 1",
"top",
"1",
"stack[top - 1] = 0",
"stack[top - 1]",
"stack",
"top - 1",
"top",
"1",
"0",
"top --",
"top",
"return op;",
"op",
"void calc(int flag){\n\t\tlong op, op2;\n\t\tlong cal;\n\t\t\n\t\top = pop();\n\t\top2 = pop();\n\t\t\n\t\tswitch(flag){\n\t\tcase 1:\n\t\t\tcal = op2 + op;\n\t\t\tbreak;\n\t\tcase 2:\n\t\t\tcal = op2 - op;\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tcal = op2 * op;\n\t\t\tbreak;\n\t\t}\n\t\t\n\t\tpush(cal);\n\t}",
"calc",
"{\n\t\tlong op, op2;\n\t\tlong cal;\n\t\t\n\t\top = pop();\n\t\top2 = pop();\n\t\t\n\t\tswitch(flag){\n\t\tcase 1:\n\t\t\tcal = op2 + op;\n\t\t\tbreak;\n\t\tcase 2:\n\t\t\tcal = op2 - op;\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tcal = op2 * op;\n\t\t\tbreak;\n\t\t}\n\t\t\n\t\tpush(cal);\n\t}",
"long op",
"op",
"op2;",
"op2",
"long cal;",
"cal",
"op = pop()",
"op",
"pop()",
"pop",
"op2 = pop()",
"op2",
"pop()",
"pop",
"switch(flag){\n\t\tcase 1:\n\t\t\tcal = op2 + op;\n\t\t\tbreak;\n\t\tcase 2:\n\t\t\tcal = op2 - op;\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tcal = op2 * op;\n\t\t\tbreak;\n\t\t}",
"flag",
"case 1:",
"1",
"case 1:",
"cal = op2 + op",
"cal",
"op2 + op",
"op2",
"op",
"break;",
"case 2:",
"2",
"case 2:",
"cal = op2 - op",
"cal",
"op2 - op",
"op2",
"op",
"break;",
"default:",
"default:",
"cal = op2 * op",
"cal",
"op2 * op",
"op2",
"op",
"break;",
"push(cal)",
"push",
"cal",
"int flag",
"flag",
"public class Main{\n\tpublic static void main(String args[]) throws IOException{\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\toperateStack ost = new operateStack();\n\t\tString[] str;\n\t\tint len, top = 0;\n\t\tlong op, cal;\n\t\t\n\t\tstr = br.readLine().split(\" \", 0);\n\t\tlen = str.length;\n\t\t\n\t\tfor(int i = 0; i < len; i++){\n\t\t\t\n\t\t\tif(str[i].equals(\"+\")){\n\t\t\t\tost.calc(1);\n\t\t\t}\n\t\t\telse if(str[i].equals(\"-\")){\n\t\t\t\tost.calc(2);\n\t\t\t}\n\t\t\telse if(str[i].equals(\"*\")){\n\t\t\t\tost.calc(3);\n\t\t\t}\n\t\t\telse{\n\t\t\t\top = Long.parseLong(str[i]);\n\t\t\t\tost.push(op);\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(ost.pop());\n\t}\n}",
"public class Main{\n\tpublic static void main(String args[]) throws IOException{\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\toperateStack ost = new operateStack();\n\t\tString[] str;\n\t\tint len, top = 0;\n\t\tlong op, cal;\n\t\t\n\t\tstr = br.readLine().split(\" \", 0);\n\t\tlen = str.length;\n\t\t\n\t\tfor(int i = 0; i < len; i++){\n\t\t\t\n\t\t\tif(str[i].equals(\"+\")){\n\t\t\t\tost.calc(1);\n\t\t\t}\n\t\t\telse if(str[i].equals(\"-\")){\n\t\t\t\tost.calc(2);\n\t\t\t}\n\t\t\telse if(str[i].equals(\"*\")){\n\t\t\t\tost.calc(3);\n\t\t\t}\n\t\t\telse{\n\t\t\t\top = Long.parseLong(str[i]);\n\t\t\t\tost.push(op);\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(ost.pop());\n\t}\n}",
"Main"
] | import java.util.*;
import java.io.*;
public class Main{
public static void main(String args[]) throws IOException{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
operateStack ost = new operateStack();
String[] str;
int len, top = 0;
long op, cal;
str = br.readLine().split(" ", 0);
len = str.length;
for(int i = 0; i < len; i++){
if(str[i].equals("+")){
ost.calc(1);
}
else if(str[i].equals("-")){
ost.calc(2);
}
else if(str[i].equals("*")){
ost.calc(3);
}
else{
op = Long.parseLong(str[i]);
ost.push(op);
}
}
System.out.println(ost.pop());
}
}
class operateStack{
long[] stack = new long[100];
int top;
operateStack(){
for(int i = 0; i < 100; i++){
stack[i] = 0;
}
top = 0;
}
void push(long op){
stack[top] = op;
top ++;
}
long pop(){
long op = stack[top - 1];
stack[top - 1] = 0;
top --;
return op;
}
void calc(int flag){
long op, op2;
long cal;
op = pop();
op2 = pop();
switch(flag){
case 1:
cal = op2 + op;
break;
case 2:
cal = op2 - op;
break;
default:
cal = op2 * op;
break;
}
push(cal);
}
} |
[
7,
15,
13,
17,
6,
13,
41,
13,
12,
13,
30,
12,
13,
30,
4,
18,
20,
23,
13,
12,
13,
30,
0,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
17,
41,
13,
20,
28,
13,
13,
30,
30,
38,
5,
13,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
4,
18,
13,
4,
13,
13,
13,
13,
30,
41,
13,
4,
18,
13,
13,
4,
18,
13,
13,
4,
18,
18,
13,
13,
4,
18,
13,
12,
13,
30,
14,
4,
18,
17,
13,
30,
29,
2,
13,
13,
14,
4,
18,
17,
13,
30,
29,
2,
13,
13,
30,
29,
2,
13,
13,
23,
13,
23,
13,
23,
13,
6,
13,
41,
13,
41,
13,
12,
13,
30,
0,
18,
36,
13,
40,
17,
0,
13,
20,
17,
12,
13,
30,
40,
13,
0,
18,
13,
13,
13,
23,
13,
12,
13,
30,
14,
4,
13,
30,
29,
17,
30,
41,
13,
18,
13,
13,
0,
18,
13,
13,
17,
40,
13,
29,
13,
12,
13,
30,
14,
2,
13,
40,
17,
30,
29,
17,
30,
29,
17,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
189,
5
],
[
189,
6
],
[
6,
7
],
[
189,
8
],
[
8,
9
],
[
8,
10
],
[
189,
11
],
[
11,
12
],
[
11,
13
],
[
13,
14
],
[
14,
15
],
[
15,
16
],
[
11,
17
],
[
17,
18
],
[
189,
19
],
[
19,
20
],
[
19,
21
],
[
21,
22
],
[
22,
23
],
[
22,
24
],
[
21,
25
],
[
25,
26
],
[
25,
27
],
[
27,
28
],
[
28,
29
],
[
21,
30
],
[
30,
31
],
[
30,
32
],
[
32,
33
],
[
33,
34
],
[
32,
35
],
[
21,
36
],
[
36,
37
],
[
36,
38
],
[
21,
39
],
[
39,
40
],
[
39,
41
],
[
39,
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
],
[
58,
61
],
[
61,
62
],
[
61,
63
],
[
61,
64
],
[
61,
65
],
[
44,
66
],
[
66,
67
],
[
67,
68
],
[
67,
69
],
[
69,
70
],
[
70,
71
],
[
69,
72
],
[
66,
73
],
[
73,
74
],
[
74,
75
],
[
73,
76
],
[
21,
77
],
[
77,
78
],
[
78,
79
],
[
79,
80
],
[
79,
81
],
[
77,
82
],
[
82,
83
],
[
83,
84
],
[
189,
85
],
[
85,
86
],
[
85,
87
],
[
87,
88
],
[
88,
89
],
[
89,
90
],
[
90,
91
],
[
89,
92
],
[
88,
93
],
[
93,
94
],
[
94,
95
],
[
95,
96
],
[
95,
97
],
[
88,
98
],
[
98,
99
],
[
99,
100
],
[
100,
101
],
[
99,
102
],
[
98,
103
],
[
103,
104
],
[
104,
105
],
[
105,
106
],
[
105,
107
],
[
98,
108
],
[
108,
109
],
[
109,
110
],
[
110,
111
],
[
110,
112
],
[
85,
113
],
[
113,
114
],
[
85,
115
],
[
115,
116
],
[
85,
117
],
[
117,
118
],
[
0,
119
],
[
119,
120
],
[
119,
121
],
[
121,
122
],
[
119,
123
],
[
123,
124
],
[
119,
125
],
[
125,
126
],
[
125,
127
],
[
127,
128
],
[
128,
129
],
[
129,
130
],
[
129,
131
],
[
128,
132
],
[
132,
133
],
[
127,
134
],
[
134,
135
],
[
134,
136
],
[
119,
138
],
[
138,
139
],
[
138,
140
],
[
140,
141
],
[
141,
142
],
[
140,
143
],
[
143,
144
],
[
144,
145
],
[
144,
146
],
[
143,
147
],
[
138,
148
],
[
148,
149
],
[
119,
150
],
[
150,
151
],
[
150,
152
],
[
152,
153
],
[
153,
154
],
[
154,
155
],
[
153,
156
],
[
156,
157
],
[
157,
158
],
[
153,
159
],
[
159,
160
],
[
160,
161
],
[
160,
162
],
[
162,
163
],
[
162,
164
],
[
159,
165
],
[
165,
166
],
[
166,
167
],
[
166,
168
],
[
165,
169
],
[
159,
170
],
[
170,
171
],
[
159,
172
],
[
172,
173
],
[
119,
174
],
[
174,
175
],
[
174,
176
],
[
176,
177
],
[
177,
178
],
[
178,
179
],
[
178,
180
],
[
180,
181
],
[
177,
182
],
[
182,
183
],
[
183,
184
],
[
177,
185
],
[
185,
186
],
[
186,
187
],
[
0,
188
],
[
188,
189
],
[
188,
190
]
] | [
"import java.util.Scanner;\n\npublic class Main {\n\n public Main() {\n }\n\n public static void main(String[] args) {\n new Main().solve();\n }\n\n private Scanner sc;\n\n private void solve() {\n sc = new Scanner(System.in);\n String f = sc.nextLine();\n String[] arr = f.split(\" \");\n MyStack stack = new MyStack();\n for (String s : arr) {\n try {\n int n = Integer.parseInt(s);\n stack.push(n);\n } catch (Exception e) {\n int n1 = (int) stack.pop();\n int n2 = (int) stack.pop();\n stack.push(calc(n1, n2, s));\n }\n }\n System.out.println(stack.pop());\n }\n\n private int calc(int n1, int n2, String o) {\n if (\"+\".equals(o)) {\n return n2 + n1;\n } else if (\"-\".equals(o)) {\n return n2 - n1;\n } else {\n return n2 * n1;\n }\n }\n\n}\n\nclass MyStack {\n int tail;\n Object[] arr;\n\n public MyStack() {\n this.tail = -1;\n arr = new Object[100];\n }\n\n public void push(Object o) {\n tail++;\n arr[tail] = o;\n }\n\n public Object pop() {\n if (isEmpty()) {\n return null;\n } else {\n Object r = arr[tail];\n arr[tail] = null;\n tail--;\n return r;\n }\n }\n\n public boolean isEmpty() {\n if (tail == -1) {\n return true;\n } else {\n return false;\n }\n }\n\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\n public Main() {\n }\n\n public static void main(String[] args) {\n new Main().solve();\n }\n\n private Scanner sc;\n\n private void solve() {\n sc = new Scanner(System.in);\n String f = sc.nextLine();\n String[] arr = f.split(\" \");\n MyStack stack = new MyStack();\n for (String s : arr) {\n try {\n int n = Integer.parseInt(s);\n stack.push(n);\n } catch (Exception e) {\n int n1 = (int) stack.pop();\n int n2 = (int) stack.pop();\n stack.push(calc(n1, n2, s));\n }\n }\n System.out.println(stack.pop());\n }\n\n private int calc(int n1, int n2, String o) {\n if (\"+\".equals(o)) {\n return n2 + n1;\n } else if (\"-\".equals(o)) {\n return n2 - n1;\n } else {\n return n2 * n1;\n }\n }\n\n}",
"Main",
"private Scanner sc;",
"sc",
"public Main() {\n }",
"Main",
"{\n }",
"public static void main(String[] args) {\n new Main().solve();\n }",
"main",
"{\n new Main().solve();\n }",
"new Main().solve()",
"new Main().solve",
"new Main()",
"String[] args",
"args",
"private void solve() {\n sc = new Scanner(System.in);\n String f = sc.nextLine();\n String[] arr = f.split(\" \");\n MyStack stack = new MyStack();\n for (String s : arr) {\n try {\n int n = Integer.parseInt(s);\n stack.push(n);\n } catch (Exception e) {\n int n1 = (int) stack.pop();\n int n2 = (int) stack.pop();\n stack.push(calc(n1, n2, s));\n }\n }\n System.out.println(stack.pop());\n }",
"solve",
"{\n sc = new Scanner(System.in);\n String f = sc.nextLine();\n String[] arr = f.split(\" \");\n MyStack stack = new MyStack();\n for (String s : arr) {\n try {\n int n = Integer.parseInt(s);\n stack.push(n);\n } catch (Exception e) {\n int n1 = (int) stack.pop();\n int n2 = (int) stack.pop();\n stack.push(calc(n1, n2, s));\n }\n }\n System.out.println(stack.pop());\n }",
"sc = new Scanner(System.in)",
"sc",
"new Scanner(System.in)",
"String f = sc.nextLine();",
"f",
"sc.nextLine()",
"sc.nextLine",
"sc",
"String[] arr = f.split(\" \");",
"arr",
"f.split(\" \")",
"f.split",
"f",
"\" \"",
"MyStack stack = new MyStack();",
"stack",
"new MyStack()",
"for (String s : arr) {\n try {\n int n = Integer.parseInt(s);\n stack.push(n);\n } catch (Exception e) {\n int n1 = (int) stack.pop();\n int n2 = (int) stack.pop();\n stack.push(calc(n1, n2, s));\n }\n }",
"String s",
"arr",
"{\n try {\n int n = Integer.parseInt(s);\n stack.push(n);\n } catch (Exception e) {\n int n1 = (int) stack.pop();\n int n2 = (int) stack.pop();\n stack.push(calc(n1, n2, s));\n }\n }",
"{\n try {\n int n = Integer.parseInt(s);\n stack.push(n);\n } catch (Exception e) {\n int n1 = (int) stack.pop();\n int n2 = (int) stack.pop();\n stack.push(calc(n1, n2, s));\n }\n }",
"try {\n int n = Integer.parseInt(s);\n stack.push(n);\n } catch (Exception e) {\n int n1 = (int) stack.pop();\n int n2 = (int) stack.pop();\n stack.push(calc(n1, n2, s));\n }",
"catch (Exception e) {\n int n1 = (int) stack.pop();\n int n2 = (int) stack.pop();\n stack.push(calc(n1, n2, s));\n }",
"Exception e",
"{\n int n1 = (int) stack.pop();\n int n2 = (int) stack.pop();\n stack.push(calc(n1, n2, s));\n }",
"int n1 = (int) stack.pop();",
"n1",
"(int) stack.pop()",
"stack.pop",
"stack",
"int n2 = (int) stack.pop();",
"n2",
"(int) stack.pop()",
"stack.pop",
"stack",
"stack.push(calc(n1, n2, s))",
"stack.push",
"stack",
"calc(n1, n2, s)",
"calc",
"n1",
"n2",
"s",
"{\n int n = Integer.parseInt(s);\n stack.push(n);\n }",
"int n = Integer.parseInt(s);",
"n",
"Integer.parseInt(s)",
"Integer.parseInt",
"Integer",
"s",
"stack.push(n)",
"stack.push",
"stack",
"n",
"System.out.println(stack.pop())",
"System.out.println",
"System.out",
"System",
"System.out",
"stack.pop()",
"stack.pop",
"stack",
"private int calc(int n1, int n2, String o) {\n if (\"+\".equals(o)) {\n return n2 + n1;\n } else if (\"-\".equals(o)) {\n return n2 - n1;\n } else {\n return n2 * n1;\n }\n }",
"calc",
"{\n if (\"+\".equals(o)) {\n return n2 + n1;\n } else if (\"-\".equals(o)) {\n return n2 - n1;\n } else {\n return n2 * n1;\n }\n }",
"if (\"+\".equals(o)) {\n return n2 + n1;\n } else if (\"-\".equals(o)) {\n return n2 - n1;\n } else {\n return n2 * n1;\n }",
"\"+\".equals(o)",
"\"+\".equals",
"\"+\"",
"o",
"{\n return n2 + n1;\n }",
"return n2 + n1;",
"n2 + n1",
"n2",
"n1",
"if (\"-\".equals(o)) {\n return n2 - n1;\n } else {\n return n2 * n1;\n }",
"\"-\".equals(o)",
"\"-\".equals",
"\"-\"",
"o",
"{\n return n2 - n1;\n }",
"return n2 - n1;",
"n2 - n1",
"n2",
"n1",
"{\n return n2 * n1;\n }",
"return n2 * n1;",
"n2 * n1",
"n2",
"n1",
"int n1",
"n1",
"int n2",
"n2",
"String o",
"o",
"class MyStack {\n int tail;\n Object[] arr;\n\n public MyStack() {\n this.tail = -1;\n arr = new Object[100];\n }\n\n public void push(Object o) {\n tail++;\n arr[tail] = o;\n }\n\n public Object pop() {\n if (isEmpty()) {\n return null;\n } else {\n Object r = arr[tail];\n arr[tail] = null;\n tail--;\n return r;\n }\n }\n\n public boolean isEmpty() {\n if (tail == -1) {\n return true;\n } else {\n return false;\n }\n }\n\n}",
"MyStack",
"int tail;",
"tail",
"Object[] arr;",
"arr",
"public MyStack() {\n this.tail = -1;\n arr = new Object[100];\n }",
"MyStack",
"{\n this.tail = -1;\n arr = new Object[100];\n }",
"this.tail = -1",
"this.tail",
"this",
"this.tail",
"-1",
"1",
"arr = new Object[100]",
"arr",
"new Object[100]",
"100",
"public void push(Object o) {\n tail++;\n arr[tail] = o;\n }",
"push",
"{\n tail++;\n arr[tail] = o;\n }",
"tail++",
"tail",
"arr[tail] = o",
"arr[tail]",
"arr",
"tail",
"o",
"Object o",
"o",
"public Object pop() {\n if (isEmpty()) {\n return null;\n } else {\n Object r = arr[tail];\n arr[tail] = null;\n tail--;\n return r;\n }\n }",
"pop",
"{\n if (isEmpty()) {\n return null;\n } else {\n Object r = arr[tail];\n arr[tail] = null;\n tail--;\n return r;\n }\n }",
"if (isEmpty()) {\n return null;\n } else {\n Object r = arr[tail];\n arr[tail] = null;\n tail--;\n return r;\n }",
"isEmpty()",
"isEmpty",
"{\n return null;\n }",
"return null;",
"null",
"{\n Object r = arr[tail];\n arr[tail] = null;\n tail--;\n return r;\n }",
"Object r = arr[tail];",
"r",
"arr[tail]",
"arr",
"tail",
"arr[tail] = null",
"arr[tail]",
"arr",
"tail",
"null",
"tail--",
"tail",
"return r;",
"r",
"public boolean isEmpty() {\n if (tail == -1) {\n return true;\n } else {\n return false;\n }\n }",
"isEmpty",
"{\n if (tail == -1) {\n return true;\n } else {\n return false;\n }\n }",
"if (tail == -1) {\n return true;\n } else {\n return false;\n }",
"tail == -1",
"tail",
"-1",
"1",
"{\n return true;\n }",
"return true;",
"true",
"{\n return false;\n }",
"return false;",
"false",
"public class Main {\n\n public Main() {\n }\n\n public static void main(String[] args) {\n new Main().solve();\n }\n\n private Scanner sc;\n\n private void solve() {\n sc = new Scanner(System.in);\n String f = sc.nextLine();\n String[] arr = f.split(\" \");\n MyStack stack = new MyStack();\n for (String s : arr) {\n try {\n int n = Integer.parseInt(s);\n stack.push(n);\n } catch (Exception e) {\n int n1 = (int) stack.pop();\n int n2 = (int) stack.pop();\n stack.push(calc(n1, n2, s));\n }\n }\n System.out.println(stack.pop());\n }\n\n private int calc(int n1, int n2, String o) {\n if (\"+\".equals(o)) {\n return n2 + n1;\n } else if (\"-\".equals(o)) {\n return n2 - n1;\n } else {\n return n2 * n1;\n }\n }\n\n}",
"public class Main {\n\n public Main() {\n }\n\n public static void main(String[] args) {\n new Main().solve();\n }\n\n private Scanner sc;\n\n private void solve() {\n sc = new Scanner(System.in);\n String f = sc.nextLine();\n String[] arr = f.split(\" \");\n MyStack stack = new MyStack();\n for (String s : arr) {\n try {\n int n = Integer.parseInt(s);\n stack.push(n);\n } catch (Exception e) {\n int n1 = (int) stack.pop();\n int n2 = (int) stack.pop();\n stack.push(calc(n1, n2, s));\n }\n }\n System.out.println(stack.pop());\n }\n\n private int calc(int n1, int n2, String o) {\n if (\"+\".equals(o)) {\n return n2 + n1;\n } else if (\"-\".equals(o)) {\n return n2 - n1;\n } else {\n return n2 * n1;\n }\n }\n\n}",
"Main"
] | import java.util.Scanner;
public class Main {
public Main() {
}
public static void main(String[] args) {
new Main().solve();
}
private Scanner sc;
private void solve() {
sc = new Scanner(System.in);
String f = sc.nextLine();
String[] arr = f.split(" ");
MyStack stack = new MyStack();
for (String s : arr) {
try {
int n = Integer.parseInt(s);
stack.push(n);
} catch (Exception e) {
int n1 = (int) stack.pop();
int n2 = (int) stack.pop();
stack.push(calc(n1, n2, s));
}
}
System.out.println(stack.pop());
}
private int calc(int n1, int n2, String o) {
if ("+".equals(o)) {
return n2 + n1;
} else if ("-".equals(o)) {
return n2 - n1;
} else {
return n2 * n1;
}
}
}
class MyStack {
int tail;
Object[] arr;
public MyStack() {
this.tail = -1;
arr = new Object[100];
}
public void push(Object o) {
tail++;
arr[tail] = o;
}
public Object pop() {
if (isEmpty()) {
return null;
} else {
Object r = arr[tail];
arr[tail] = null;
tail--;
return r;
}
}
public boolean isEmpty() {
if (tail == -1) {
return true;
} else {
return false;
}
}
} |
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
41,
13,
17,
41,
13,
20,
13,
41,
13,
17,
12,
13,
30,
14,
2,
4,
13,
13,
4,
13,
0,
18,
13,
13,
13,
40,
13,
23,
13,
12,
13,
30,
41,
13,
4,
13,
41,
13,
20,
2,
13,
17,
4,
18,
13,
13,
17,
13,
17,
13,
0,
13,
13,
0,
13,
17,
12,
13,
30,
41,
13,
17,
14,
4,
13,
30,
4,
18,
18,
13,
13,
17,
30,
40,
13,
0,
13,
18,
13,
13,
0,
18,
13,
13,
17,
4,
13,
29,
13,
12,
13,
30,
41,
13,
4,
13,
14,
2,
13,
2,
2,
13,
17,
17,
30,
0,
13,
2,
13,
17,
41,
13,
20,
13,
4,
18,
13,
13,
17,
13,
17,
13,
0,
13,
13,
12,
13,
30,
29,
13,
12,
13,
30,
29,
2,
13,
17,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
4,
18,
13,
17,
41,
13,
20,
41,
13,
41,
13,
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,
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
],
[
260,
11
],
[
260,
12
],
[
12,
13
],
[
12,
14
],
[
260,
15
],
[
15,
16
],
[
15,
17
],
[
260,
19
],
[
19,
20
],
[
19,
21
],
[
260,
22
],
[
22,
23
],
[
22,
24
],
[
24,
25
],
[
25,
26
],
[
26,
27
],
[
27,
28
],
[
26,
29
],
[
25,
30
],
[
30,
31
],
[
24,
32
],
[
32,
33
],
[
33,
34
],
[
33,
35
],
[
32,
36
],
[
24,
37
],
[
37,
38
],
[
22,
39
],
[
39,
40
],
[
260,
41
],
[
41,
42
],
[
41,
43
],
[
43,
44
],
[
44,
45
],
[
44,
46
],
[
46,
47
],
[
43,
48
],
[
48,
49
],
[
48,
50
],
[
51,
52
],
[
51,
53
],
[
43,
54
],
[
54,
55
],
[
55,
56
],
[
54,
57
],
[
54,
58
],
[
54,
59
],
[
54,
60
],
[
54,
61
],
[
43,
62
],
[
62,
63
],
[
62,
64
],
[
43,
65
],
[
65,
66
],
[
65,
67
],
[
260,
68
],
[
68,
69
],
[
68,
70
],
[
70,
71
],
[
71,
72
],
[
71,
73
],
[
70,
74
],
[
74,
75
],
[
75,
76
],
[
74,
77
],
[
77,
78
],
[
78,
79
],
[
79,
80
],
[
80,
81
],
[
80,
82
],
[
78,
83
],
[
74,
84
],
[
84,
85
],
[
85,
86
],
[
84,
87
],
[
87,
88
],
[
87,
89
],
[
89,
90
],
[
89,
91
],
[
84,
92
],
[
92,
93
],
[
93,
94
],
[
93,
95
],
[
92,
96
],
[
84,
97
],
[
97,
98
],
[
70,
99
],
[
99,
100
],
[
260,
101
],
[
101,
102
],
[
101,
103
],
[
103,
104
],
[
104,
105
],
[
104,
106
],
[
106,
107
],
[
103,
108
],
[
108,
109
],
[
109,
110
],
[
109,
111
],
[
111,
112
],
[
112,
113
],
[
112,
114
],
[
111,
115
],
[
108,
116
],
[
116,
117
],
[
117,
118
],
[
117,
119
],
[
119,
120
],
[
119,
121
],
[
103,
122
],
[
122,
123
],
[
122,
124
],
[
103,
126
],
[
126,
127
],
[
127,
128
],
[
126,
129
],
[
126,
130
],
[
126,
131
],
[
126,
132
],
[
126,
133
],
[
103,
134
],
[
134,
135
],
[
134,
136
],
[
260,
137
],
[
137,
138
],
[
137,
139
],
[
139,
140
],
[
140,
141
],
[
260,
142
],
[
142,
143
],
[
142,
144
],
[
144,
145
],
[
145,
146
],
[
146,
147
],
[
146,
148
],
[
260,
149
],
[
149,
150
],
[
149,
151
],
[
151,
152
],
[
152,
153
],
[
152,
154
],
[
151,
155
],
[
155,
156
],
[
155,
157
],
[
157,
158
],
[
158,
159
],
[
159,
160
],
[
160,
161
],
[
157,
162
],
[
151,
163
],
[
163,
164
],
[
163,
165
],
[
151,
166
],
[
166,
167
],
[
151,
168
],
[
168,
169
],
[
151,
170
],
[
170,
171
],
[
170,
172
],
[
170,
173
],
[
174,
174
],
[
174,
175
],
[
175,
176
],
[
176,
177
],
[
177,
178
],
[
176,
179
],
[
175,
180
],
[
180,
181
],
[
181,
182
],
[
181,
183
],
[
183,
184
],
[
184,
185
],
[
180,
186
],
[
186,
187
],
[
186,
188
],
[
188,
189
],
[
189,
190
],
[
180,
191
],
[
191,
192
],
[
192,
193
],
[
191,
194
],
[
194,
195
],
[
194,
196
],
[
175,
197
],
[
197,
198
],
[
198,
199
],
[
199,
200
],
[
198,
201
],
[
197,
202
],
[
202,
203
],
[
203,
204
],
[
203,
205
],
[
205,
206
],
[
206,
207
],
[
202,
208
],
[
208,
209
],
[
208,
210
],
[
210,
211
],
[
211,
212
],
[
202,
213
],
[
213,
214
],
[
214,
215
],
[
213,
216
],
[
216,
217
],
[
216,
218
],
[
197,
219
],
[
219,
220
],
[
220,
221
],
[
221,
222
],
[
220,
223
],
[
219,
224
],
[
224,
225
],
[
225,
226
],
[
225,
227
],
[
227,
228
],
[
228,
229
],
[
224,
230
],
[
230,
231
],
[
230,
232
],
[
232,
233
],
[
233,
234
],
[
224,
235
],
[
235,
236
],
[
236,
237
],
[
235,
238
],
[
238,
239
],
[
238,
240
],
[
219,
241
],
[
241,
242
],
[
242,
243
],
[
243,
244
],
[
242,
245
],
[
245,
246
],
[
246,
247
],
[
245,
248
],
[
151,
249
],
[
249,
250
],
[
250,
251
],
[
251,
252
],
[
251,
253
],
[
249,
254
],
[
254,
255
],
[
255,
256
],
[
149,
257
],
[
257,
258
],
[
0,
259
],
[
259,
260
],
[
259,
261
]
] | [
"\n\nimport java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\n\npublic class Main {\n int capacity = 2;\n int[] stack = new int[capacity];\n int top = 0;\n\n public void push(int data) {\n if(size() == capacity)\n expand();\n\n stack[top] = data;\n top++;\n }\n\n private void expand() {\n int length = size();\n int[] newStack = new int[capacity * 2];\n System.arraycopy(stack, 0 , newStack, 0, length);\n stack = newStack;\n capacity *= 2;\n }\n\n public int pop() {\n int data = 0;\n\n if(isEmpty())\n {\n System.out.println(\"stack is empty\");\n } else {\n top--;\n data = stack[top];\n stack[top] = 0;\n shrink();\n }\n return data;\n }\n\n public void shrink() {\n int length = size();\n if(length <= (capacity/2)/2)\n {\n capacity = capacity / 2;\n }\n int[] newStack = new int[capacity];\n System.arraycopy(stack, 0 , newStack, 0, length);\n stack = newStack;\n }\n\n public int size() {\n return top;\n }\n\n public boolean isEmpty() {\n return top <= 0;\n }\n\n public static void main(String[] args) throws IOException {\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n String[] lines = br.readLine().split(\" \");\n Main stack1 = new Main();\n int a, b;\n\n for(String s : lines)\n {\n if(s.equals(\"+\"))\n {\n a = stack1.pop();\n b = stack1.pop();\n stack1.push(a+b);\n } else if(s.equals(\"-\"))\n {\n a = stack1.pop();\n b = stack1.pop();\n stack1.push(b-a);\n } else if(s.equals(\"*\"))\n {\n a = stack1.pop();\n b = stack1.pop();\n stack1.push(a*b);\n } else {\n stack1.push(Integer.parseInt(s));\n }\n }\n System.out.println(stack1.pop());\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 int capacity = 2;\n int[] stack = new int[capacity];\n int top = 0;\n\n public void push(int data) {\n if(size() == capacity)\n expand();\n\n stack[top] = data;\n top++;\n }\n\n private void expand() {\n int length = size();\n int[] newStack = new int[capacity * 2];\n System.arraycopy(stack, 0 , newStack, 0, length);\n stack = newStack;\n capacity *= 2;\n }\n\n public int pop() {\n int data = 0;\n\n if(isEmpty())\n {\n System.out.println(\"stack is empty\");\n } else {\n top--;\n data = stack[top];\n stack[top] = 0;\n shrink();\n }\n return data;\n }\n\n public void shrink() {\n int length = size();\n if(length <= (capacity/2)/2)\n {\n capacity = capacity / 2;\n }\n int[] newStack = new int[capacity];\n System.arraycopy(stack, 0 , newStack, 0, length);\n stack = newStack;\n }\n\n public int size() {\n return top;\n }\n\n public boolean isEmpty() {\n return top <= 0;\n }\n\n public static void main(String[] args) throws IOException {\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n String[] lines = br.readLine().split(\" \");\n Main stack1 = new Main();\n int a, b;\n\n for(String s : lines)\n {\n if(s.equals(\"+\"))\n {\n a = stack1.pop();\n b = stack1.pop();\n stack1.push(a+b);\n } else if(s.equals(\"-\"))\n {\n a = stack1.pop();\n b = stack1.pop();\n stack1.push(b-a);\n } else if(s.equals(\"*\"))\n {\n a = stack1.pop();\n b = stack1.pop();\n stack1.push(a*b);\n } else {\n stack1.push(Integer.parseInt(s));\n }\n }\n System.out.println(stack1.pop());\n }\n}",
"Main",
"int capacity = 2;",
"capacity",
"2",
"int[] stack = new int[capacity];",
"stack",
"new int[capacity]",
"capacity",
"int top = 0;",
"top",
"0",
"public void push(int data) {\n if(size() == capacity)\n expand();\n\n stack[top] = data;\n top++;\n }",
"push",
"{\n if(size() == capacity)\n expand();\n\n stack[top] = data;\n top++;\n }",
"if(size() == capacity)\n expand();",
"size() == capacity",
"size()",
"size",
"capacity",
"expand()",
"expand",
"stack[top] = data",
"stack[top]",
"stack",
"top",
"data",
"top++",
"top",
"int data",
"data",
"private void expand() {\n int length = size();\n int[] newStack = new int[capacity * 2];\n System.arraycopy(stack, 0 , newStack, 0, length);\n stack = newStack;\n capacity *= 2;\n }",
"expand",
"{\n int length = size();\n int[] newStack = new int[capacity * 2];\n System.arraycopy(stack, 0 , newStack, 0, length);\n stack = newStack;\n capacity *= 2;\n }",
"int length = size();",
"length",
"size()",
"size",
"int[] newStack = new int[capacity * 2];",
"newStack",
"new int[capacity * 2]",
"capacity * 2",
"capacity",
"2",
"System.arraycopy(stack, 0 , newStack, 0, length)",
"System.arraycopy",
"System",
"stack",
"0",
"newStack",
"0",
"length",
"stack = newStack",
"stack",
"newStack",
"capacity *= 2",
"capacity",
"2",
"public int pop() {\n int data = 0;\n\n if(isEmpty())\n {\n System.out.println(\"stack is empty\");\n } else {\n top--;\n data = stack[top];\n stack[top] = 0;\n shrink();\n }\n return data;\n }",
"pop",
"{\n int data = 0;\n\n if(isEmpty())\n {\n System.out.println(\"stack is empty\");\n } else {\n top--;\n data = stack[top];\n stack[top] = 0;\n shrink();\n }\n return data;\n }",
"int data = 0;",
"data",
"0",
"if(isEmpty())\n {\n System.out.println(\"stack is empty\");\n } else {\n top--;\n data = stack[top];\n stack[top] = 0;\n shrink();\n }",
"isEmpty()",
"isEmpty",
"{\n System.out.println(\"stack is empty\");\n }",
"System.out.println(\"stack is empty\")",
"System.out.println",
"System.out",
"System",
"System.out",
"\"stack is empty\"",
"{\n top--;\n data = stack[top];\n stack[top] = 0;\n shrink();\n }",
"top--",
"top",
"data = stack[top]",
"data",
"stack[top]",
"stack",
"top",
"stack[top] = 0",
"stack[top]",
"stack",
"top",
"0",
"shrink()",
"shrink",
"return data;",
"data",
"public void shrink() {\n int length = size();\n if(length <= (capacity/2)/2)\n {\n capacity = capacity / 2;\n }\n int[] newStack = new int[capacity];\n System.arraycopy(stack, 0 , newStack, 0, length);\n stack = newStack;\n }",
"shrink",
"{\n int length = size();\n if(length <= (capacity/2)/2)\n {\n capacity = capacity / 2;\n }\n int[] newStack = new int[capacity];\n System.arraycopy(stack, 0 , newStack, 0, length);\n stack = newStack;\n }",
"int length = size();",
"length",
"size()",
"size",
"if(length <= (capacity/2)/2)\n {\n capacity = capacity / 2;\n }",
"length <= (capacity/2)/2",
"length",
"(capacity/2)/2",
"(capacity/2)",
"capacity",
"2",
"2",
"{\n capacity = capacity / 2;\n }",
"capacity = capacity / 2",
"capacity",
"capacity / 2",
"capacity",
"2",
"int[] newStack = new int[capacity];",
"newStack",
"new int[capacity]",
"capacity",
"System.arraycopy(stack, 0 , newStack, 0, length)",
"System.arraycopy",
"System",
"stack",
"0",
"newStack",
"0",
"length",
"stack = newStack",
"stack",
"newStack",
"public int size() {\n return top;\n }",
"size",
"{\n return top;\n }",
"return top;",
"top",
"public boolean isEmpty() {\n return top <= 0;\n }",
"isEmpty",
"{\n return top <= 0;\n }",
"return top <= 0;",
"top <= 0",
"top",
"0",
"public static void main(String[] args) throws IOException {\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n String[] lines = br.readLine().split(\" \");\n Main stack1 = new Main();\n int a, b;\n\n for(String s : lines)\n {\n if(s.equals(\"+\"))\n {\n a = stack1.pop();\n b = stack1.pop();\n stack1.push(a+b);\n } else if(s.equals(\"-\"))\n {\n a = stack1.pop();\n b = stack1.pop();\n stack1.push(b-a);\n } else if(s.equals(\"*\"))\n {\n a = stack1.pop();\n b = stack1.pop();\n stack1.push(a*b);\n } else {\n stack1.push(Integer.parseInt(s));\n }\n }\n System.out.println(stack1.pop());\n }",
"main",
"{\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n String[] lines = br.readLine().split(\" \");\n Main stack1 = new Main();\n int a, b;\n\n for(String s : lines)\n {\n if(s.equals(\"+\"))\n {\n a = stack1.pop();\n b = stack1.pop();\n stack1.push(a+b);\n } else if(s.equals(\"-\"))\n {\n a = stack1.pop();\n b = stack1.pop();\n stack1.push(b-a);\n } else if(s.equals(\"*\"))\n {\n a = stack1.pop();\n b = stack1.pop();\n stack1.push(a*b);\n } else {\n stack1.push(Integer.parseInt(s));\n }\n }\n System.out.println(stack1.pop());\n }",
"BufferedReader br = new BufferedReader(new InputStreamReader(System.in));",
"br",
"new BufferedReader(new InputStreamReader(System.in))",
"String[] lines = br.readLine().split(\" \");",
"lines",
"br.readLine().split(\" \")",
"br.readLine().split",
"br.readLine()",
"br.readLine",
"br",
"\" \"",
"Main stack1 = new Main();",
"stack1",
"new Main()",
"int a",
"a",
"b;",
"b",
"for(String s : lines)\n {\n if(s.equals(\"+\"))\n {\n a = stack1.pop();\n b = stack1.pop();\n stack1.push(a+b);\n } else if(s.equals(\"-\"))\n {\n a = stack1.pop();\n b = stack1.pop();\n stack1.push(b-a);\n } else if(s.equals(\"*\"))\n {\n a = stack1.pop();\n b = stack1.pop();\n stack1.push(a*b);\n } else {\n stack1.push(Integer.parseInt(s));\n }\n }",
"String s",
"lines",
"{\n if(s.equals(\"+\"))\n {\n a = stack1.pop();\n b = stack1.pop();\n stack1.push(a+b);\n } else if(s.equals(\"-\"))\n {\n a = stack1.pop();\n b = stack1.pop();\n stack1.push(b-a);\n } else if(s.equals(\"*\"))\n {\n a = stack1.pop();\n b = stack1.pop();\n stack1.push(a*b);\n } else {\n stack1.push(Integer.parseInt(s));\n }\n }",
"{\n if(s.equals(\"+\"))\n {\n a = stack1.pop();\n b = stack1.pop();\n stack1.push(a+b);\n } else if(s.equals(\"-\"))\n {\n a = stack1.pop();\n b = stack1.pop();\n stack1.push(b-a);\n } else if(s.equals(\"*\"))\n {\n a = stack1.pop();\n b = stack1.pop();\n stack1.push(a*b);\n } else {\n stack1.push(Integer.parseInt(s));\n }\n }",
"if(s.equals(\"+\"))\n {\n a = stack1.pop();\n b = stack1.pop();\n stack1.push(a+b);\n } else if(s.equals(\"-\"))\n {\n a = stack1.pop();\n b = stack1.pop();\n stack1.push(b-a);\n } else if(s.equals(\"*\"))\n {\n a = stack1.pop();\n b = stack1.pop();\n stack1.push(a*b);\n } else {\n stack1.push(Integer.parseInt(s));\n }",
"s.equals(\"+\")",
"s.equals",
"s",
"\"+\"",
"{\n a = stack1.pop();\n b = stack1.pop();\n stack1.push(a+b);\n }",
"a = stack1.pop()",
"a",
"stack1.pop()",
"stack1.pop",
"stack1",
"b = stack1.pop()",
"b",
"stack1.pop()",
"stack1.pop",
"stack1",
"stack1.push(a+b)",
"stack1.push",
"stack1",
"a+b",
"a",
"b",
"if(s.equals(\"-\"))\n {\n a = stack1.pop();\n b = stack1.pop();\n stack1.push(b-a);\n } else if(s.equals(\"*\"))\n {\n a = stack1.pop();\n b = stack1.pop();\n stack1.push(a*b);\n } else {\n stack1.push(Integer.parseInt(s));\n }",
"s.equals(\"-\")",
"s.equals",
"s",
"\"-\"",
"{\n a = stack1.pop();\n b = stack1.pop();\n stack1.push(b-a);\n }",
"a = stack1.pop()",
"a",
"stack1.pop()",
"stack1.pop",
"stack1",
"b = stack1.pop()",
"b",
"stack1.pop()",
"stack1.pop",
"stack1",
"stack1.push(b-a)",
"stack1.push",
"stack1",
"b-a",
"b",
"a",
"if(s.equals(\"*\"))\n {\n a = stack1.pop();\n b = stack1.pop();\n stack1.push(a*b);\n } else {\n stack1.push(Integer.parseInt(s));\n }",
"s.equals(\"*\")",
"s.equals",
"s",
"\"*\"",
"{\n a = stack1.pop();\n b = stack1.pop();\n stack1.push(a*b);\n }",
"a = stack1.pop()",
"a",
"stack1.pop()",
"stack1.pop",
"stack1",
"b = stack1.pop()",
"b",
"stack1.pop()",
"stack1.pop",
"stack1",
"stack1.push(a*b)",
"stack1.push",
"stack1",
"a*b",
"a",
"b",
"{\n stack1.push(Integer.parseInt(s));\n }",
"stack1.push(Integer.parseInt(s))",
"stack1.push",
"stack1",
"Integer.parseInt(s)",
"Integer.parseInt",
"Integer",
"s",
"System.out.println(stack1.pop())",
"System.out.println",
"System.out",
"System",
"System.out",
"stack1.pop()",
"stack1.pop",
"stack1",
"String[] args",
"args",
"public class Main {\n int capacity = 2;\n int[] stack = new int[capacity];\n int top = 0;\n\n public void push(int data) {\n if(size() == capacity)\n expand();\n\n stack[top] = data;\n top++;\n }\n\n private void expand() {\n int length = size();\n int[] newStack = new int[capacity * 2];\n System.arraycopy(stack, 0 , newStack, 0, length);\n stack = newStack;\n capacity *= 2;\n }\n\n public int pop() {\n int data = 0;\n\n if(isEmpty())\n {\n System.out.println(\"stack is empty\");\n } else {\n top--;\n data = stack[top];\n stack[top] = 0;\n shrink();\n }\n return data;\n }\n\n public void shrink() {\n int length = size();\n if(length <= (capacity/2)/2)\n {\n capacity = capacity / 2;\n }\n int[] newStack = new int[capacity];\n System.arraycopy(stack, 0 , newStack, 0, length);\n stack = newStack;\n }\n\n public int size() {\n return top;\n }\n\n public boolean isEmpty() {\n return top <= 0;\n }\n\n public static void main(String[] args) throws IOException {\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n String[] lines = br.readLine().split(\" \");\n Main stack1 = new Main();\n int a, b;\n\n for(String s : lines)\n {\n if(s.equals(\"+\"))\n {\n a = stack1.pop();\n b = stack1.pop();\n stack1.push(a+b);\n } else if(s.equals(\"-\"))\n {\n a = stack1.pop();\n b = stack1.pop();\n stack1.push(b-a);\n } else if(s.equals(\"*\"))\n {\n a = stack1.pop();\n b = stack1.pop();\n stack1.push(a*b);\n } else {\n stack1.push(Integer.parseInt(s));\n }\n }\n System.out.println(stack1.pop());\n }\n}",
"public class Main {\n int capacity = 2;\n int[] stack = new int[capacity];\n int top = 0;\n\n public void push(int data) {\n if(size() == capacity)\n expand();\n\n stack[top] = data;\n top++;\n }\n\n private void expand() {\n int length = size();\n int[] newStack = new int[capacity * 2];\n System.arraycopy(stack, 0 , newStack, 0, length);\n stack = newStack;\n capacity *= 2;\n }\n\n public int pop() {\n int data = 0;\n\n if(isEmpty())\n {\n System.out.println(\"stack is empty\");\n } else {\n top--;\n data = stack[top];\n stack[top] = 0;\n shrink();\n }\n return data;\n }\n\n public void shrink() {\n int length = size();\n if(length <= (capacity/2)/2)\n {\n capacity = capacity / 2;\n }\n int[] newStack = new int[capacity];\n System.arraycopy(stack, 0 , newStack, 0, length);\n stack = newStack;\n }\n\n public int size() {\n return top;\n }\n\n public boolean isEmpty() {\n return top <= 0;\n }\n\n public static void main(String[] args) throws IOException {\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n String[] lines = br.readLine().split(\" \");\n Main stack1 = new Main();\n int a, b;\n\n for(String s : lines)\n {\n if(s.equals(\"+\"))\n {\n a = stack1.pop();\n b = stack1.pop();\n stack1.push(a+b);\n } else if(s.equals(\"-\"))\n {\n a = stack1.pop();\n b = stack1.pop();\n stack1.push(b-a);\n } else if(s.equals(\"*\"))\n {\n a = stack1.pop();\n b = stack1.pop();\n stack1.push(a*b);\n } else {\n stack1.push(Integer.parseInt(s));\n }\n }\n System.out.println(stack1.pop());\n }\n}",
"Main"
] |
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Main {
int capacity = 2;
int[] stack = new int[capacity];
int top = 0;
public void push(int data) {
if(size() == capacity)
expand();
stack[top] = data;
top++;
}
private void expand() {
int length = size();
int[] newStack = new int[capacity * 2];
System.arraycopy(stack, 0 , newStack, 0, length);
stack = newStack;
capacity *= 2;
}
public int pop() {
int data = 0;
if(isEmpty())
{
System.out.println("stack is empty");
} else {
top--;
data = stack[top];
stack[top] = 0;
shrink();
}
return data;
}
public void shrink() {
int length = size();
if(length <= (capacity/2)/2)
{
capacity = capacity / 2;
}
int[] newStack = new int[capacity];
System.arraycopy(stack, 0 , newStack, 0, length);
stack = newStack;
}
public int size() {
return top;
}
public boolean isEmpty() {
return top <= 0;
}
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String[] lines = br.readLine().split(" ");
Main stack1 = new Main();
int a, b;
for(String s : lines)
{
if(s.equals("+"))
{
a = stack1.pop();
b = stack1.pop();
stack1.push(a+b);
} else if(s.equals("-"))
{
a = stack1.pop();
b = stack1.pop();
stack1.push(b-a);
} else if(s.equals("*"))
{
a = stack1.pop();
b = stack1.pop();
stack1.push(a*b);
} else {
stack1.push(Integer.parseInt(s));
}
}
System.out.println(stack1.pop());
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
41,
13,
20,
12,
13,
30,
41,
13,
4,
18,
4,
18,
13,
17,
41,
13,
20,
28,
13,
13,
30,
30,
4,
18,
13,
13,
41,
13,
20,
42,
40,
4,
18,
13,
30,
41,
13,
4,
18,
13,
38,
5,
13,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
17,
35,
13,
34,
17,
1,
0,
13,
2,
13,
13,
3,
34,
17,
1,
0,
13,
2,
13,
13,
3,
34,
17,
1,
0,
13,
2,
13,
13,
3,
4,
18,
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
],
[
10,
11
],
[
10,
12
],
[
0,
13
],
[
127,
14
],
[
127,
15
],
[
15,
16
],
[
15,
17
],
[
127,
18
],
[
18,
19
],
[
18,
20
],
[
20,
21
],
[
21,
22
],
[
21,
23
],
[
23,
24
],
[
24,
25
],
[
25,
26
],
[
26,
27
],
[
23,
28
],
[
20,
29
],
[
29,
30
],
[
29,
31
],
[
20,
32
],
[
32,
33
],
[
32,
34
],
[
32,
35
],
[
36,
36
],
[
36,
37
],
[
37,
38
],
[
38,
39
],
[
37,
40
],
[
20,
41
],
[
41,
42
],
[
41,
43
],
[
20,
44
],
[
44,
45
],
[
45,
46
],
[
46,
47
],
[
47,
48
],
[
44,
49
],
[
49,
50
],
[
50,
51
],
[
50,
52
],
[
52,
53
],
[
53,
54
],
[
49,
55
],
[
55,
56
],
[
56,
57
],
[
56,
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
],
[
69,
71
],
[
58,
72
],
[
72,
73
],
[
72,
74
],
[
74,
75
],
[
74,
76
],
[
76,
77
],
[
77,
78
],
[
77,
79
],
[
79,
80
],
[
79,
81
],
[
76,
82
],
[
72,
83
],
[
83,
84
],
[
83,
85
],
[
85,
86
],
[
86,
87
],
[
86,
88
],
[
88,
89
],
[
88,
90
],
[
85,
91
],
[
72,
92
],
[
92,
93
],
[
92,
94
],
[
94,
95
],
[
95,
96
],
[
95,
97
],
[
97,
98
],
[
97,
99
],
[
94,
100
],
[
58,
101
],
[
101,
102
],
[
102,
103
],
[
101,
104
],
[
55,
105
],
[
105,
106
],
[
106,
107
],
[
106,
108
],
[
108,
109
],
[
109,
110
],
[
108,
111
],
[
105,
112
],
[
112,
113
],
[
113,
114
],
[
112,
115
],
[
20,
116
],
[
116,
117
],
[
117,
118
],
[
118,
119
],
[
118,
120
],
[
116,
121
],
[
121,
122
],
[
122,
123
],
[
18,
124
],
[
124,
125
],
[
0,
126
],
[
126,
127
],
[
126,
128
]
] | [
"import java.io.BufferedReader;\nimport java.io.InputStreamReader;\nimport java.util.ArrayDeque;\nimport java.util.Deque;\n\npublic class Main {\n\tprivate static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\n\tpublic static void main(String[] args) throws Exception {\n\t\tString[] array = br.readLine().split(\" \");\n\t\tDeque<String> mainDeque = new ArrayDeque<>();\n\t\tfor(String str: array){\n\t\t\tmainDeque.offerLast(str);\n\t\t}\n\t\tDeque<Integer> intDeque = new ArrayDeque<>();\n\t\t\n\t\twhile(!mainDeque.isEmpty()){\n\t\t\tString str = mainDeque.pop();\n\t\t\ttry{\n\t\t\t\tint iv = Integer.parseInt(str);\n\t\t\t\tintDeque.push(iv);\n\t\t\t}catch(NumberFormatException e){\n\t\t\t\tint v2 = intDeque.pop();\n\t\t\t\tint v1 = intDeque.pop();\n\t\t\t\t\n\t\t\t\tint result = 0;\n\t\t\t\tswitch (str) {\n\t\t\t\tcase \"+\":\n\t\t\t\t\tresult = v1 + v2;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"-\":\n\t\t\t\t\tresult = v1 - v2;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"*\":\n\t\t\t\t\tresult = v1 * v2;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tintDeque.push(result);\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(intDeque.pop());\n\t}\n}\n",
"import java.io.BufferedReader;",
"BufferedReader",
"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\tprivate static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\n\tpublic static void main(String[] args) throws Exception {\n\t\tString[] array = br.readLine().split(\" \");\n\t\tDeque<String> mainDeque = new ArrayDeque<>();\n\t\tfor(String str: array){\n\t\t\tmainDeque.offerLast(str);\n\t\t}\n\t\tDeque<Integer> intDeque = new ArrayDeque<>();\n\t\t\n\t\twhile(!mainDeque.isEmpty()){\n\t\t\tString str = mainDeque.pop();\n\t\t\ttry{\n\t\t\t\tint iv = Integer.parseInt(str);\n\t\t\t\tintDeque.push(iv);\n\t\t\t}catch(NumberFormatException e){\n\t\t\t\tint v2 = intDeque.pop();\n\t\t\t\tint v1 = intDeque.pop();\n\t\t\t\t\n\t\t\t\tint result = 0;\n\t\t\t\tswitch (str) {\n\t\t\t\tcase \"+\":\n\t\t\t\t\tresult = v1 + v2;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"-\":\n\t\t\t\t\tresult = v1 - v2;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"*\":\n\t\t\t\t\tresult = v1 * v2;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tintDeque.push(result);\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(intDeque.pop());\n\t}\n}",
"Main",
"private static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));",
"br",
"new BufferedReader(new InputStreamReader(System.in))",
"public static void main(String[] args) throws Exception {\n\t\tString[] array = br.readLine().split(\" \");\n\t\tDeque<String> mainDeque = new ArrayDeque<>();\n\t\tfor(String str: array){\n\t\t\tmainDeque.offerLast(str);\n\t\t}\n\t\tDeque<Integer> intDeque = new ArrayDeque<>();\n\t\t\n\t\twhile(!mainDeque.isEmpty()){\n\t\t\tString str = mainDeque.pop();\n\t\t\ttry{\n\t\t\t\tint iv = Integer.parseInt(str);\n\t\t\t\tintDeque.push(iv);\n\t\t\t}catch(NumberFormatException e){\n\t\t\t\tint v2 = intDeque.pop();\n\t\t\t\tint v1 = intDeque.pop();\n\t\t\t\t\n\t\t\t\tint result = 0;\n\t\t\t\tswitch (str) {\n\t\t\t\tcase \"+\":\n\t\t\t\t\tresult = v1 + v2;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"-\":\n\t\t\t\t\tresult = v1 - v2;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"*\":\n\t\t\t\t\tresult = v1 * v2;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tintDeque.push(result);\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(intDeque.pop());\n\t}",
"main",
"{\n\t\tString[] array = br.readLine().split(\" \");\n\t\tDeque<String> mainDeque = new ArrayDeque<>();\n\t\tfor(String str: array){\n\t\t\tmainDeque.offerLast(str);\n\t\t}\n\t\tDeque<Integer> intDeque = new ArrayDeque<>();\n\t\t\n\t\twhile(!mainDeque.isEmpty()){\n\t\t\tString str = mainDeque.pop();\n\t\t\ttry{\n\t\t\t\tint iv = Integer.parseInt(str);\n\t\t\t\tintDeque.push(iv);\n\t\t\t}catch(NumberFormatException e){\n\t\t\t\tint v2 = intDeque.pop();\n\t\t\t\tint v1 = intDeque.pop();\n\t\t\t\t\n\t\t\t\tint result = 0;\n\t\t\t\tswitch (str) {\n\t\t\t\tcase \"+\":\n\t\t\t\t\tresult = v1 + v2;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"-\":\n\t\t\t\t\tresult = v1 - v2;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"*\":\n\t\t\t\t\tresult = v1 * v2;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tintDeque.push(result);\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(intDeque.pop());\n\t}",
"String[] array = br.readLine().split(\" \");",
"array",
"br.readLine().split(\" \")",
"br.readLine().split",
"br.readLine()",
"br.readLine",
"br",
"\" \"",
"Deque<String> mainDeque = new ArrayDeque<>();",
"mainDeque",
"new ArrayDeque<>()",
"for(String str: array){\n\t\t\tmainDeque.offerLast(str);\n\t\t}",
"String str",
"array",
"{\n\t\t\tmainDeque.offerLast(str);\n\t\t}",
"{\n\t\t\tmainDeque.offerLast(str);\n\t\t}",
"mainDeque.offerLast(str)",
"mainDeque.offerLast",
"mainDeque",
"str",
"Deque<Integer> intDeque = new ArrayDeque<>();",
"intDeque",
"new ArrayDeque<>()",
"while(!mainDeque.isEmpty()){\n\t\t\tString str = mainDeque.pop();\n\t\t\ttry{\n\t\t\t\tint iv = Integer.parseInt(str);\n\t\t\t\tintDeque.push(iv);\n\t\t\t}catch(NumberFormatException e){\n\t\t\t\tint v2 = intDeque.pop();\n\t\t\t\tint v1 = intDeque.pop();\n\t\t\t\t\n\t\t\t\tint result = 0;\n\t\t\t\tswitch (str) {\n\t\t\t\tcase \"+\":\n\t\t\t\t\tresult = v1 + v2;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"-\":\n\t\t\t\t\tresult = v1 - v2;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"*\":\n\t\t\t\t\tresult = v1 * v2;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tintDeque.push(result);\n\t\t\t}\n\t\t}",
"!mainDeque.isEmpty()",
"mainDeque.isEmpty()",
"mainDeque.isEmpty",
"mainDeque",
"{\n\t\t\tString str = mainDeque.pop();\n\t\t\ttry{\n\t\t\t\tint iv = Integer.parseInt(str);\n\t\t\t\tintDeque.push(iv);\n\t\t\t}catch(NumberFormatException e){\n\t\t\t\tint v2 = intDeque.pop();\n\t\t\t\tint v1 = intDeque.pop();\n\t\t\t\t\n\t\t\t\tint result = 0;\n\t\t\t\tswitch (str) {\n\t\t\t\tcase \"+\":\n\t\t\t\t\tresult = v1 + v2;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"-\":\n\t\t\t\t\tresult = v1 - v2;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"*\":\n\t\t\t\t\tresult = v1 * v2;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tintDeque.push(result);\n\t\t\t}\n\t\t}",
"String str = mainDeque.pop();",
"str",
"mainDeque.pop()",
"mainDeque.pop",
"mainDeque",
"try{\n\t\t\t\tint iv = Integer.parseInt(str);\n\t\t\t\tintDeque.push(iv);\n\t\t\t}catch(NumberFormatException e){\n\t\t\t\tint v2 = intDeque.pop();\n\t\t\t\tint v1 = intDeque.pop();\n\t\t\t\t\n\t\t\t\tint result = 0;\n\t\t\t\tswitch (str) {\n\t\t\t\tcase \"+\":\n\t\t\t\t\tresult = v1 + v2;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"-\":\n\t\t\t\t\tresult = v1 - v2;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"*\":\n\t\t\t\t\tresult = v1 * v2;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tintDeque.push(result);\n\t\t\t}",
"catch(NumberFormatException e){\n\t\t\t\tint v2 = intDeque.pop();\n\t\t\t\tint v1 = intDeque.pop();\n\t\t\t\t\n\t\t\t\tint result = 0;\n\t\t\t\tswitch (str) {\n\t\t\t\tcase \"+\":\n\t\t\t\t\tresult = v1 + v2;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"-\":\n\t\t\t\t\tresult = v1 - v2;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"*\":\n\t\t\t\t\tresult = v1 * v2;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tintDeque.push(result);\n\t\t\t}",
"NumberFormatException e",
"{\n\t\t\t\tint v2 = intDeque.pop();\n\t\t\t\tint v1 = intDeque.pop();\n\t\t\t\t\n\t\t\t\tint result = 0;\n\t\t\t\tswitch (str) {\n\t\t\t\tcase \"+\":\n\t\t\t\t\tresult = v1 + v2;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"-\":\n\t\t\t\t\tresult = v1 - v2;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"*\":\n\t\t\t\t\tresult = v1 * v2;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tintDeque.push(result);\n\t\t\t}",
"int v2 = intDeque.pop();",
"v2",
"intDeque.pop()",
"intDeque.pop",
"intDeque",
"int v1 = intDeque.pop();",
"v1",
"intDeque.pop()",
"intDeque.pop",
"intDeque",
"int result = 0;",
"result",
"0",
"switch (str) {\n\t\t\t\tcase \"+\":\n\t\t\t\t\tresult = v1 + v2;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"-\":\n\t\t\t\t\tresult = v1 - v2;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"*\":\n\t\t\t\t\tresult = v1 * v2;\n\t\t\t\t\tbreak;\n\t\t\t\t}",
"str",
"case \"+\":",
"\"+\"",
"case \"+\":",
"result = v1 + v2",
"result",
"v1 + v2",
"v1",
"v2",
"break;",
"case \"-\":",
"\"-\"",
"case \"-\":",
"result = v1 - v2",
"result",
"v1 - v2",
"v1",
"v2",
"break;",
"case \"*\":",
"\"*\"",
"case \"*\":",
"result = v1 * v2",
"result",
"v1 * v2",
"v1",
"v2",
"break;",
"intDeque.push(result)",
"intDeque.push",
"intDeque",
"result",
"{\n\t\t\t\tint iv = Integer.parseInt(str);\n\t\t\t\tintDeque.push(iv);\n\t\t\t}",
"int iv = Integer.parseInt(str);",
"iv",
"Integer.parseInt(str)",
"Integer.parseInt",
"Integer",
"str",
"intDeque.push(iv)",
"intDeque.push",
"intDeque",
"iv",
"System.out.println(intDeque.pop())",
"System.out.println",
"System.out",
"System",
"System.out",
"intDeque.pop()",
"intDeque.pop",
"intDeque",
"String[] args",
"args",
"public class Main {\n\tprivate static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\n\tpublic static void main(String[] args) throws Exception {\n\t\tString[] array = br.readLine().split(\" \");\n\t\tDeque<String> mainDeque = new ArrayDeque<>();\n\t\tfor(String str: array){\n\t\t\tmainDeque.offerLast(str);\n\t\t}\n\t\tDeque<Integer> intDeque = new ArrayDeque<>();\n\t\t\n\t\twhile(!mainDeque.isEmpty()){\n\t\t\tString str = mainDeque.pop();\n\t\t\ttry{\n\t\t\t\tint iv = Integer.parseInt(str);\n\t\t\t\tintDeque.push(iv);\n\t\t\t}catch(NumberFormatException e){\n\t\t\t\tint v2 = intDeque.pop();\n\t\t\t\tint v1 = intDeque.pop();\n\t\t\t\t\n\t\t\t\tint result = 0;\n\t\t\t\tswitch (str) {\n\t\t\t\tcase \"+\":\n\t\t\t\t\tresult = v1 + v2;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"-\":\n\t\t\t\t\tresult = v1 - v2;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"*\":\n\t\t\t\t\tresult = v1 * v2;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tintDeque.push(result);\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(intDeque.pop());\n\t}\n}",
"public class Main {\n\tprivate static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\n\tpublic static void main(String[] args) throws Exception {\n\t\tString[] array = br.readLine().split(\" \");\n\t\tDeque<String> mainDeque = new ArrayDeque<>();\n\t\tfor(String str: array){\n\t\t\tmainDeque.offerLast(str);\n\t\t}\n\t\tDeque<Integer> intDeque = new ArrayDeque<>();\n\t\t\n\t\twhile(!mainDeque.isEmpty()){\n\t\t\tString str = mainDeque.pop();\n\t\t\ttry{\n\t\t\t\tint iv = Integer.parseInt(str);\n\t\t\t\tintDeque.push(iv);\n\t\t\t}catch(NumberFormatException e){\n\t\t\t\tint v2 = intDeque.pop();\n\t\t\t\tint v1 = intDeque.pop();\n\t\t\t\t\n\t\t\t\tint result = 0;\n\t\t\t\tswitch (str) {\n\t\t\t\tcase \"+\":\n\t\t\t\t\tresult = v1 + v2;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"-\":\n\t\t\t\t\tresult = v1 - v2;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"*\":\n\t\t\t\t\tresult = v1 * v2;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tintDeque.push(result);\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(intDeque.pop());\n\t}\n}",
"Main"
] | import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayDeque;
import java.util.Deque;
public class Main {
private static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
public static void main(String[] args) throws Exception {
String[] array = br.readLine().split(" ");
Deque<String> mainDeque = new ArrayDeque<>();
for(String str: array){
mainDeque.offerLast(str);
}
Deque<Integer> intDeque = new ArrayDeque<>();
while(!mainDeque.isEmpty()){
String str = mainDeque.pop();
try{
int iv = Integer.parseInt(str);
intDeque.push(iv);
}catch(NumberFormatException e){
int v2 = intDeque.pop();
int v1 = intDeque.pop();
int result = 0;
switch (str) {
case "+":
result = v1 + v2;
break;
case "-":
result = v1 - v2;
break;
case "*":
result = v1 * v2;
break;
}
intDeque.push(result);
}
}
System.out.println(intDeque.pop());
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
17,
41,
13,
20,
17,
28,
13,
4,
18,
13,
17,
30,
30,
14,
4,
18,
13,
17,
30,
0,
18,
13,
2,
13,
17,
18,
13,
2,
13,
17,
40,
13,
14,
4,
18,
13,
17,
30,
0,
18,
13,
2,
13,
17,
18,
13,
2,
13,
17,
40,
13,
14,
4,
18,
13,
17,
30,
0,
18,
13,
2,
13,
17,
18,
13,
2,
13,
17,
40,
13,
30,
0,
18,
13,
40,
13,
4,
18,
13,
13,
4,
18,
18,
13,
13,
18,
13,
17,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
113,
8
],
[
113,
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
],
[
11,
23
],
[
23,
24
],
[
23,
25
],
[
11,
27
],
[
27,
28
],
[
27,
29
],
[
29,
30
],
[
30,
31
],
[
29,
32
],
[
27,
33
],
[
34,
34
],
[
34,
35
],
[
35,
36
],
[
36,
37
],
[
37,
38
],
[
36,
39
],
[
35,
40
],
[
40,
41
],
[
41,
42
],
[
42,
43
],
[
42,
44
],
[
44,
45
],
[
44,
46
],
[
41,
47
],
[
47,
48
],
[
47,
49
],
[
49,
50
],
[
49,
51
],
[
40,
52
],
[
52,
53
],
[
35,
54
],
[
54,
55
],
[
55,
56
],
[
56,
57
],
[
55,
58
],
[
54,
59
],
[
59,
60
],
[
60,
61
],
[
61,
62
],
[
61,
63
],
[
63,
64
],
[
63,
65
],
[
60,
66
],
[
66,
67
],
[
66,
68
],
[
68,
69
],
[
68,
70
],
[
59,
71
],
[
71,
72
],
[
54,
73
],
[
73,
74
],
[
74,
75
],
[
75,
76
],
[
74,
77
],
[
73,
78
],
[
78,
79
],
[
79,
80
],
[
80,
81
],
[
80,
82
],
[
82,
83
],
[
82,
84
],
[
79,
85
],
[
85,
86
],
[
85,
87
],
[
87,
88
],
[
87,
89
],
[
78,
90
],
[
90,
91
],
[
73,
92
],
[
92,
93
],
[
93,
94
],
[
94,
95
],
[
94,
96
],
[
96,
97
],
[
93,
98
],
[
98,
99
],
[
99,
100
],
[
98,
101
],
[
11,
102
],
[
102,
103
],
[
103,
104
],
[
104,
105
],
[
104,
106
],
[
102,
107
],
[
107,
108
],
[
107,
109
],
[
9,
110
],
[
110,
111
],
[
0,
112
],
[
112,
113
],
[
112,
114
]
] | [
"import java.io.BufferedReader;\nimport java.io.InputStreamReader;\n\npublic class Main {\n public static void main(String[] args) throws Exception {\n BufferedReader r = new BufferedReader(new InputStreamReader(System.in));\n String line = r.readLine();\n int opIndex = 0;\n int[] ops = new int[100];\n for (String elem : line.split(\" \")) {\n if (elem.equals(\"+\")) {\n ops[opIndex - 2] += ops[opIndex - 1];\n opIndex--;\n } else if (elem.equals(\"-\")) {\n ops[opIndex - 2] -= ops[opIndex - 1];\n opIndex--;\n } else if (elem.equals(\"*\")) {\n ops[opIndex - 2] *= ops[opIndex - 1];\n opIndex--;\n } else {\n ops[opIndex++] = Integer.parseInt(elem);\n }\n }\n System.out.println(ops[0]);\n }\n}",
"import java.io.BufferedReader;",
"BufferedReader",
"java.io",
"import java.io.InputStreamReader;",
"InputStreamReader",
"java.io",
"public class Main {\n public static void main(String[] args) throws Exception {\n BufferedReader r = new BufferedReader(new InputStreamReader(System.in));\n String line = r.readLine();\n int opIndex = 0;\n int[] ops = new int[100];\n for (String elem : line.split(\" \")) {\n if (elem.equals(\"+\")) {\n ops[opIndex - 2] += ops[opIndex - 1];\n opIndex--;\n } else if (elem.equals(\"-\")) {\n ops[opIndex - 2] -= ops[opIndex - 1];\n opIndex--;\n } else if (elem.equals(\"*\")) {\n ops[opIndex - 2] *= ops[opIndex - 1];\n opIndex--;\n } else {\n ops[opIndex++] = Integer.parseInt(elem);\n }\n }\n System.out.println(ops[0]);\n }\n}",
"Main",
"public static void main(String[] args) throws Exception {\n BufferedReader r = new BufferedReader(new InputStreamReader(System.in));\n String line = r.readLine();\n int opIndex = 0;\n int[] ops = new int[100];\n for (String elem : line.split(\" \")) {\n if (elem.equals(\"+\")) {\n ops[opIndex - 2] += ops[opIndex - 1];\n opIndex--;\n } else if (elem.equals(\"-\")) {\n ops[opIndex - 2] -= ops[opIndex - 1];\n opIndex--;\n } else if (elem.equals(\"*\")) {\n ops[opIndex - 2] *= ops[opIndex - 1];\n opIndex--;\n } else {\n ops[opIndex++] = Integer.parseInt(elem);\n }\n }\n System.out.println(ops[0]);\n }",
"main",
"{\n BufferedReader r = new BufferedReader(new InputStreamReader(System.in));\n String line = r.readLine();\n int opIndex = 0;\n int[] ops = new int[100];\n for (String elem : line.split(\" \")) {\n if (elem.equals(\"+\")) {\n ops[opIndex - 2] += ops[opIndex - 1];\n opIndex--;\n } else if (elem.equals(\"-\")) {\n ops[opIndex - 2] -= ops[opIndex - 1];\n opIndex--;\n } else if (elem.equals(\"*\")) {\n ops[opIndex - 2] *= ops[opIndex - 1];\n opIndex--;\n } else {\n ops[opIndex++] = Integer.parseInt(elem);\n }\n }\n System.out.println(ops[0]);\n }",
"BufferedReader r = new BufferedReader(new InputStreamReader(System.in));",
"r",
"new BufferedReader(new InputStreamReader(System.in))",
"String line = r.readLine();",
"line",
"r.readLine()",
"r.readLine",
"r",
"int opIndex = 0;",
"opIndex",
"0",
"int[] ops = new int[100];",
"ops",
"new int[100]",
"100",
"for (String elem : line.split(\" \")) {\n if (elem.equals(\"+\")) {\n ops[opIndex - 2] += ops[opIndex - 1];\n opIndex--;\n } else if (elem.equals(\"-\")) {\n ops[opIndex - 2] -= ops[opIndex - 1];\n opIndex--;\n } else if (elem.equals(\"*\")) {\n ops[opIndex - 2] *= ops[opIndex - 1];\n opIndex--;\n } else {\n ops[opIndex++] = Integer.parseInt(elem);\n }\n }",
"String elem",
"line.split(\" \")",
"line.split",
"line",
"\" \"",
"{\n if (elem.equals(\"+\")) {\n ops[opIndex - 2] += ops[opIndex - 1];\n opIndex--;\n } else if (elem.equals(\"-\")) {\n ops[opIndex - 2] -= ops[opIndex - 1];\n opIndex--;\n } else if (elem.equals(\"*\")) {\n ops[opIndex - 2] *= ops[opIndex - 1];\n opIndex--;\n } else {\n ops[opIndex++] = Integer.parseInt(elem);\n }\n }",
"{\n if (elem.equals(\"+\")) {\n ops[opIndex - 2] += ops[opIndex - 1];\n opIndex--;\n } else if (elem.equals(\"-\")) {\n ops[opIndex - 2] -= ops[opIndex - 1];\n opIndex--;\n } else if (elem.equals(\"*\")) {\n ops[opIndex - 2] *= ops[opIndex - 1];\n opIndex--;\n } else {\n ops[opIndex++] = Integer.parseInt(elem);\n }\n }",
"if (elem.equals(\"+\")) {\n ops[opIndex - 2] += ops[opIndex - 1];\n opIndex--;\n } else if (elem.equals(\"-\")) {\n ops[opIndex - 2] -= ops[opIndex - 1];\n opIndex--;\n } else if (elem.equals(\"*\")) {\n ops[opIndex - 2] *= ops[opIndex - 1];\n opIndex--;\n } else {\n ops[opIndex++] = Integer.parseInt(elem);\n }",
"elem.equals(\"+\")",
"elem.equals",
"elem",
"\"+\"",
"{\n ops[opIndex - 2] += ops[opIndex - 1];\n opIndex--;\n }",
"ops[opIndex - 2] += ops[opIndex - 1]",
"ops[opIndex - 2]",
"ops",
"opIndex - 2",
"opIndex",
"2",
"ops[opIndex - 1]",
"ops",
"opIndex - 1",
"opIndex",
"1",
"opIndex--",
"opIndex",
"if (elem.equals(\"-\")) {\n ops[opIndex - 2] -= ops[opIndex - 1];\n opIndex--;\n } else if (elem.equals(\"*\")) {\n ops[opIndex - 2] *= ops[opIndex - 1];\n opIndex--;\n } else {\n ops[opIndex++] = Integer.parseInt(elem);\n }",
"elem.equals(\"-\")",
"elem.equals",
"elem",
"\"-\"",
"{\n ops[opIndex - 2] -= ops[opIndex - 1];\n opIndex--;\n }",
"ops[opIndex - 2] -= ops[opIndex - 1]",
"ops[opIndex - 2]",
"ops",
"opIndex - 2",
"opIndex",
"2",
"ops[opIndex - 1]",
"ops",
"opIndex - 1",
"opIndex",
"1",
"opIndex--",
"opIndex",
"if (elem.equals(\"*\")) {\n ops[opIndex - 2] *= ops[opIndex - 1];\n opIndex--;\n } else {\n ops[opIndex++] = Integer.parseInt(elem);\n }",
"elem.equals(\"*\")",
"elem.equals",
"elem",
"\"*\"",
"{\n ops[opIndex - 2] *= ops[opIndex - 1];\n opIndex--;\n }",
"ops[opIndex - 2] *= ops[opIndex - 1]",
"ops[opIndex - 2]",
"ops",
"opIndex - 2",
"opIndex",
"2",
"ops[opIndex - 1]",
"ops",
"opIndex - 1",
"opIndex",
"1",
"opIndex--",
"opIndex",
"{\n ops[opIndex++] = Integer.parseInt(elem);\n }",
"ops[opIndex++] = Integer.parseInt(elem)",
"ops[opIndex++]",
"ops",
"opIndex++",
"opIndex",
"Integer.parseInt(elem)",
"Integer.parseInt",
"Integer",
"elem",
"System.out.println(ops[0])",
"System.out.println",
"System.out",
"System",
"System.out",
"ops[0]",
"ops",
"0",
"String[] args",
"args",
"public class Main {\n public static void main(String[] args) throws Exception {\n BufferedReader r = new BufferedReader(new InputStreamReader(System.in));\n String line = r.readLine();\n int opIndex = 0;\n int[] ops = new int[100];\n for (String elem : line.split(\" \")) {\n if (elem.equals(\"+\")) {\n ops[opIndex - 2] += ops[opIndex - 1];\n opIndex--;\n } else if (elem.equals(\"-\")) {\n ops[opIndex - 2] -= ops[opIndex - 1];\n opIndex--;\n } else if (elem.equals(\"*\")) {\n ops[opIndex - 2] *= ops[opIndex - 1];\n opIndex--;\n } else {\n ops[opIndex++] = Integer.parseInt(elem);\n }\n }\n System.out.println(ops[0]);\n }\n}",
"public class Main {\n public static void main(String[] args) throws Exception {\n BufferedReader r = new BufferedReader(new InputStreamReader(System.in));\n String line = r.readLine();\n int opIndex = 0;\n int[] ops = new int[100];\n for (String elem : line.split(\" \")) {\n if (elem.equals(\"+\")) {\n ops[opIndex - 2] += ops[opIndex - 1];\n opIndex--;\n } else if (elem.equals(\"-\")) {\n ops[opIndex - 2] -= ops[opIndex - 1];\n opIndex--;\n } else if (elem.equals(\"*\")) {\n ops[opIndex - 2] *= ops[opIndex - 1];\n opIndex--;\n } else {\n ops[opIndex++] = Integer.parseInt(elem);\n }\n }\n System.out.println(ops[0]);\n }\n}",
"Main"
] | import java.io.BufferedReader;
import java.io.InputStreamReader;
public class Main {
public static void main(String[] args) throws Exception {
BufferedReader r = new BufferedReader(new InputStreamReader(System.in));
String line = r.readLine();
int opIndex = 0;
int[] ops = new int[100];
for (String elem : line.split(" ")) {
if (elem.equals("+")) {
ops[opIndex - 2] += ops[opIndex - 1];
opIndex--;
} else if (elem.equals("-")) {
ops[opIndex - 2] -= ops[opIndex - 1];
opIndex--;
} else if (elem.equals("*")) {
ops[opIndex - 2] *= ops[opIndex - 1];
opIndex--;
} else {
ops[opIndex++] = Integer.parseInt(elem);
}
}
System.out.println(ops[0]);
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
20,
17,
41,
13,
17,
42,
4,
18,
13,
30,
41,
13,
4,
18,
13,
35,
13,
34,
17,
1,
0,
18,
13,
2,
13,
17,
18,
13,
2,
13,
17,
40,
13,
3,
34,
17,
1,
0,
18,
13,
2,
13,
17,
18,
13,
2,
13,
17,
40,
13,
3,
34,
17,
1,
0,
18,
13,
2,
13,
17,
18,
13,
2,
13,
17,
40,
13,
3,
34,
1,
0,
18,
13,
13,
4,
18,
13,
13,
40,
13,
4,
18,
18,
13,
13,
18,
13,
17,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
105,
5
],
[
105,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
8,
16
],
[
16,
17
],
[
16,
18
],
[
8,
19
],
[
19,
20
],
[
20,
21
],
[
21,
22
],
[
19,
23
],
[
23,
24
],
[
24,
25
],
[
24,
26
],
[
26,
27
],
[
27,
28
],
[
23,
29
],
[
29,
30
],
[
29,
31
],
[
31,
32
],
[
31,
33
],
[
33,
34
],
[
34,
35
],
[
35,
36
],
[
35,
37
],
[
37,
38
],
[
37,
39
],
[
34,
40
],
[
40,
41
],
[
40,
42
],
[
42,
43
],
[
42,
44
],
[
33,
45
],
[
45,
46
],
[
33,
47
],
[
29,
48
],
[
48,
49
],
[
48,
50
],
[
50,
51
],
[
51,
52
],
[
52,
53
],
[
52,
54
],
[
54,
55
],
[
54,
56
],
[
51,
57
],
[
57,
58
],
[
57,
59
],
[
59,
60
],
[
59,
61
],
[
50,
62
],
[
62,
63
],
[
50,
64
],
[
29,
65
],
[
65,
66
],
[
65,
67
],
[
67,
68
],
[
68,
69
],
[
69,
70
],
[
69,
71
],
[
71,
72
],
[
71,
73
],
[
68,
74
],
[
74,
75
],
[
74,
76
],
[
76,
77
],
[
76,
78
],
[
67,
79
],
[
79,
80
],
[
67,
81
],
[
29,
82
],
[
82,
83
],
[
83,
84
],
[
84,
85
],
[
85,
86
],
[
85,
87
],
[
84,
88
],
[
88,
89
],
[
89,
90
],
[
88,
91
],
[
83,
92
],
[
92,
93
],
[
8,
94
],
[
94,
95
],
[
95,
96
],
[
96,
97
],
[
96,
98
],
[
94,
99
],
[
99,
100
],
[
99,
101
],
[
6,
102
],
[
102,
103
],
[
0,
104
],
[
104,
105
],
[
104,
106
]
] | [
"import java.util.Scanner;\npublic class Main{\n public static void main(String[] args){\n Scanner scan = new Scanner(System.in);\n \tint[] stack = new int[100];\n \tint now = 0;\n \twhile(scan.hasNext()){\n \t\tString line = scan.next();\n \t\tswitch(line){\n \t\t\tcase \"+\":\n \t\t\t\tstack[now - 2] += stack[now - 1];\n \t\t\t\tnow--;\n \t\t\t\tbreak;\n \t\t\tcase \"-\":\n \t\t\t\tstack[now - 2] -= stack[now - 1];\n \t\t\t\tnow--;\n \t\t\t\tbreak;\n \t\t\tcase \"*\":\n \t\t\t\tstack[now - 2] *= stack[now - 1];\n \t\t\t\tnow--;\n \t\t\t\tbreak;\n \t\t\tdefault:\n\t \t\t\tstack[now] = Integer.parseInt(line);\n \t\t\t\tnow++;\n \t\t}\n \t}\n \tSystem.out.println(stack[0]);\n }\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main{\n public static void main(String[] args){\n Scanner scan = new Scanner(System.in);\n \tint[] stack = new int[100];\n \tint now = 0;\n \twhile(scan.hasNext()){\n \t\tString line = scan.next();\n \t\tswitch(line){\n \t\t\tcase \"+\":\n \t\t\t\tstack[now - 2] += stack[now - 1];\n \t\t\t\tnow--;\n \t\t\t\tbreak;\n \t\t\tcase \"-\":\n \t\t\t\tstack[now - 2] -= stack[now - 1];\n \t\t\t\tnow--;\n \t\t\t\tbreak;\n \t\t\tcase \"*\":\n \t\t\t\tstack[now - 2] *= stack[now - 1];\n \t\t\t\tnow--;\n \t\t\t\tbreak;\n \t\t\tdefault:\n\t \t\t\tstack[now] = Integer.parseInt(line);\n \t\t\t\tnow++;\n \t\t}\n \t}\n \tSystem.out.println(stack[0]);\n }\n}",
"Main",
"public static void main(String[] args){\n Scanner scan = new Scanner(System.in);\n \tint[] stack = new int[100];\n \tint now = 0;\n \twhile(scan.hasNext()){\n \t\tString line = scan.next();\n \t\tswitch(line){\n \t\t\tcase \"+\":\n \t\t\t\tstack[now - 2] += stack[now - 1];\n \t\t\t\tnow--;\n \t\t\t\tbreak;\n \t\t\tcase \"-\":\n \t\t\t\tstack[now - 2] -= stack[now - 1];\n \t\t\t\tnow--;\n \t\t\t\tbreak;\n \t\t\tcase \"*\":\n \t\t\t\tstack[now - 2] *= stack[now - 1];\n \t\t\t\tnow--;\n \t\t\t\tbreak;\n \t\t\tdefault:\n\t \t\t\tstack[now] = Integer.parseInt(line);\n \t\t\t\tnow++;\n \t\t}\n \t}\n \tSystem.out.println(stack[0]);\n }",
"main",
"{\n Scanner scan = new Scanner(System.in);\n \tint[] stack = new int[100];\n \tint now = 0;\n \twhile(scan.hasNext()){\n \t\tString line = scan.next();\n \t\tswitch(line){\n \t\t\tcase \"+\":\n \t\t\t\tstack[now - 2] += stack[now - 1];\n \t\t\t\tnow--;\n \t\t\t\tbreak;\n \t\t\tcase \"-\":\n \t\t\t\tstack[now - 2] -= stack[now - 1];\n \t\t\t\tnow--;\n \t\t\t\tbreak;\n \t\t\tcase \"*\":\n \t\t\t\tstack[now - 2] *= stack[now - 1];\n \t\t\t\tnow--;\n \t\t\t\tbreak;\n \t\t\tdefault:\n\t \t\t\tstack[now] = Integer.parseInt(line);\n \t\t\t\tnow++;\n \t\t}\n \t}\n \tSystem.out.println(stack[0]);\n }",
"Scanner scan = new Scanner(System.in);",
"scan",
"new Scanner(System.in)",
"int[] stack = new int[100];",
"stack",
"new int[100]",
"100",
"int now = 0;",
"now",
"0",
"while(scan.hasNext()){\n \t\tString line = scan.next();\n \t\tswitch(line){\n \t\t\tcase \"+\":\n \t\t\t\tstack[now - 2] += stack[now - 1];\n \t\t\t\tnow--;\n \t\t\t\tbreak;\n \t\t\tcase \"-\":\n \t\t\t\tstack[now - 2] -= stack[now - 1];\n \t\t\t\tnow--;\n \t\t\t\tbreak;\n \t\t\tcase \"*\":\n \t\t\t\tstack[now - 2] *= stack[now - 1];\n \t\t\t\tnow--;\n \t\t\t\tbreak;\n \t\t\tdefault:\n\t \t\t\tstack[now] = Integer.parseInt(line);\n \t\t\t\tnow++;\n \t\t}\n \t}",
"scan.hasNext()",
"scan.hasNext",
"scan",
"{\n \t\tString line = scan.next();\n \t\tswitch(line){\n \t\t\tcase \"+\":\n \t\t\t\tstack[now - 2] += stack[now - 1];\n \t\t\t\tnow--;\n \t\t\t\tbreak;\n \t\t\tcase \"-\":\n \t\t\t\tstack[now - 2] -= stack[now - 1];\n \t\t\t\tnow--;\n \t\t\t\tbreak;\n \t\t\tcase \"*\":\n \t\t\t\tstack[now - 2] *= stack[now - 1];\n \t\t\t\tnow--;\n \t\t\t\tbreak;\n \t\t\tdefault:\n\t \t\t\tstack[now] = Integer.parseInt(line);\n \t\t\t\tnow++;\n \t\t}\n \t}",
"String line = scan.next();",
"line",
"scan.next()",
"scan.next",
"scan",
"switch(line){\n \t\t\tcase \"+\":\n \t\t\t\tstack[now - 2] += stack[now - 1];\n \t\t\t\tnow--;\n \t\t\t\tbreak;\n \t\t\tcase \"-\":\n \t\t\t\tstack[now - 2] -= stack[now - 1];\n \t\t\t\tnow--;\n \t\t\t\tbreak;\n \t\t\tcase \"*\":\n \t\t\t\tstack[now - 2] *= stack[now - 1];\n \t\t\t\tnow--;\n \t\t\t\tbreak;\n \t\t\tdefault:\n\t \t\t\tstack[now] = Integer.parseInt(line);\n \t\t\t\tnow++;\n \t\t}",
"line",
"case \"+\":",
"\"+\"",
"case \"+\":",
"stack[now - 2] += stack[now - 1]",
"stack[now - 2]",
"stack",
"now - 2",
"now",
"2",
"stack[now - 1]",
"stack",
"now - 1",
"now",
"1",
"now--",
"now",
"break;",
"case \"-\":",
"\"-\"",
"case \"-\":",
"stack[now - 2] -= stack[now - 1]",
"stack[now - 2]",
"stack",
"now - 2",
"now",
"2",
"stack[now - 1]",
"stack",
"now - 1",
"now",
"1",
"now--",
"now",
"break;",
"case \"*\":",
"\"*\"",
"case \"*\":",
"stack[now - 2] *= stack[now - 1]",
"stack[now - 2]",
"stack",
"now - 2",
"now",
"2",
"stack[now - 1]",
"stack",
"now - 1",
"now",
"1",
"now--",
"now",
"break;",
"default:",
"default:",
"stack[now] = Integer.parseInt(line)",
"stack[now]",
"stack",
"now",
"Integer.parseInt(line)",
"Integer.parseInt",
"Integer",
"line",
"now++",
"now",
"System.out.println(stack[0])",
"System.out.println",
"System.out",
"System",
"System.out",
"stack[0]",
"stack",
"0",
"String[] args",
"args",
"public class Main{\n public static void main(String[] args){\n Scanner scan = new Scanner(System.in);\n \tint[] stack = new int[100];\n \tint now = 0;\n \twhile(scan.hasNext()){\n \t\tString line = scan.next();\n \t\tswitch(line){\n \t\t\tcase \"+\":\n \t\t\t\tstack[now - 2] += stack[now - 1];\n \t\t\t\tnow--;\n \t\t\t\tbreak;\n \t\t\tcase \"-\":\n \t\t\t\tstack[now - 2] -= stack[now - 1];\n \t\t\t\tnow--;\n \t\t\t\tbreak;\n \t\t\tcase \"*\":\n \t\t\t\tstack[now - 2] *= stack[now - 1];\n \t\t\t\tnow--;\n \t\t\t\tbreak;\n \t\t\tdefault:\n\t \t\t\tstack[now] = Integer.parseInt(line);\n \t\t\t\tnow++;\n \t\t}\n \t}\n \tSystem.out.println(stack[0]);\n }\n}",
"public class Main{\n public static void main(String[] args){\n Scanner scan = new Scanner(System.in);\n \tint[] stack = new int[100];\n \tint now = 0;\n \twhile(scan.hasNext()){\n \t\tString line = scan.next();\n \t\tswitch(line){\n \t\t\tcase \"+\":\n \t\t\t\tstack[now - 2] += stack[now - 1];\n \t\t\t\tnow--;\n \t\t\t\tbreak;\n \t\t\tcase \"-\":\n \t\t\t\tstack[now - 2] -= stack[now - 1];\n \t\t\t\tnow--;\n \t\t\t\tbreak;\n \t\t\tcase \"*\":\n \t\t\t\tstack[now - 2] *= stack[now - 1];\n \t\t\t\tnow--;\n \t\t\t\tbreak;\n \t\t\tdefault:\n\t \t\t\tstack[now] = Integer.parseInt(line);\n \t\t\t\tnow++;\n \t\t}\n \t}\n \tSystem.out.println(stack[0]);\n }\n}",
"Main"
] | import java.util.Scanner;
public class Main{
public static void main(String[] args){
Scanner scan = new Scanner(System.in);
int[] stack = new int[100];
int now = 0;
while(scan.hasNext()){
String line = scan.next();
switch(line){
case "+":
stack[now - 2] += stack[now - 1];
now--;
break;
case "-":
stack[now - 2] -= stack[now - 1];
now--;
break;
case "*":
stack[now - 2] *= stack[now - 1];
now--;
break;
default:
stack[now] = Integer.parseInt(line);
now++;
}
}
System.out.println(stack[0]);
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
38,
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,
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,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
2,
13,
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
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
10,
11
],
[
10,
12
],
[
0,
13
],
[
148,
14
],
[
148,
15
],
[
15,
16
],
[
15,
17
],
[
17,
18
],
[
18,
19
],
[
18,
20
],
[
17,
21
],
[
21,
22
],
[
22,
23
],
[
23,
24
],
[
23,
25
],
[
22,
26
],
[
26,
27
],
[
26,
28
],
[
28,
29
],
[
29,
30
],
[
22,
31
],
[
31,
32
],
[
31,
33
],
[
33,
34
],
[
34,
35
],
[
33,
36
],
[
22,
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
],
[
60,
62
],
[
62,
63
],
[
63,
64
],
[
64,
65
],
[
62,
66
],
[
66,
67
],
[
67,
68
],
[
59,
69
],
[
69,
70
],
[
70,
71
],
[
69,
72
],
[
52,
73
],
[
73,
74
],
[
74,
75
],
[
75,
76
],
[
76,
77
],
[
76,
78
],
[
74,
79
],
[
73,
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
],
[
91,
93
],
[
93,
94
],
[
93,
95
],
[
80,
96
],
[
96,
97
],
[
97,
98
],
[
96,
99
],
[
73,
100
],
[
100,
101
],
[
101,
102
],
[
102,
103
],
[
103,
104
],
[
103,
105
],
[
101,
106
],
[
100,
107
],
[
107,
108
],
[
108,
109
],
[
108,
110
],
[
110,
111
],
[
111,
112
],
[
107,
113
],
[
113,
114
],
[
113,
115
],
[
115,
116
],
[
116,
117
],
[
107,
118
],
[
118,
119
],
[
118,
120
],
[
120,
121
],
[
120,
122
],
[
107,
123
],
[
123,
124
],
[
124,
125
],
[
123,
126
],
[
100,
127
],
[
127,
128
],
[
128,
129
],
[
129,
130
],
[
128,
131
],
[
131,
132
],
[
132,
133
],
[
131,
134
],
[
134,
135
],
[
134,
136
],
[
22,
137
],
[
137,
138
],
[
138,
139
],
[
139,
140
],
[
139,
141
],
[
137,
142
],
[
142,
143
],
[
143,
144
],
[
15,
145
],
[
145,
146
],
[
0,
147
],
[
147,
148
],
[
147,
149
]
] | [
"import java.io.BufferedReader;\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 Exception {\n // TODO ?????????????????????????????????????????????\n // System.out.println(\"0\".compareTo(\"1\"));\n\t\tDeque<Integer> stack = new ArrayDeque<Integer>();\n\n try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {\n String line=br.readLine();\n String[] str=line.split(\" \");\n \n for(int i=0;i<str.length;i++){\n \tif(str[i].equals(\"+\")){\n \t\tint a=stack.pop()+stack.pop();\n \t\tstack.push(a);\n \t}else if(str[i].equals(\"-\")){\n \t\tint aa=stack.pop();\n \t\tint bb=stack.pop();\n \t\tint a=bb-aa;\n \t\tstack.push(a);\n \t}else if(str[i].equals(\"*\")){\n \t\tint aa=stack.pop();\n \t\tint bb=stack.pop();\n \t\tint a=aa*bb;\n \t\tstack.push(a);\n \t}else{\n \t\tstack.push(Integer.parseInt(str[i]));\n \t}\n }\n System.out.println(stack.pop());\n }\n\t}\n\n}",
"import java.io.BufferedReader;",
"BufferedReader",
"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 Exception {\n // TODO ?????????????????????????????????????????????\n // System.out.println(\"0\".compareTo(\"1\"));\n\t\tDeque<Integer> stack = new ArrayDeque<Integer>();\n\n try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {\n String line=br.readLine();\n String[] str=line.split(\" \");\n \n for(int i=0;i<str.length;i++){\n \tif(str[i].equals(\"+\")){\n \t\tint a=stack.pop()+stack.pop();\n \t\tstack.push(a);\n \t}else if(str[i].equals(\"-\")){\n \t\tint aa=stack.pop();\n \t\tint bb=stack.pop();\n \t\tint a=bb-aa;\n \t\tstack.push(a);\n \t}else if(str[i].equals(\"*\")){\n \t\tint aa=stack.pop();\n \t\tint bb=stack.pop();\n \t\tint a=aa*bb;\n \t\tstack.push(a);\n \t}else{\n \t\tstack.push(Integer.parseInt(str[i]));\n \t}\n }\n System.out.println(stack.pop());\n }\n\t}\n\n}",
"Main",
"public static void main(String[] args) throws Exception {\n // TODO ?????????????????????????????????????????????\n // System.out.println(\"0\".compareTo(\"1\"));\n\t\tDeque<Integer> stack = new ArrayDeque<Integer>();\n\n try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {\n String line=br.readLine();\n String[] str=line.split(\" \");\n \n for(int i=0;i<str.length;i++){\n \tif(str[i].equals(\"+\")){\n \t\tint a=stack.pop()+stack.pop();\n \t\tstack.push(a);\n \t}else if(str[i].equals(\"-\")){\n \t\tint aa=stack.pop();\n \t\tint bb=stack.pop();\n \t\tint a=bb-aa;\n \t\tstack.push(a);\n \t}else if(str[i].equals(\"*\")){\n \t\tint aa=stack.pop();\n \t\tint bb=stack.pop();\n \t\tint a=aa*bb;\n \t\tstack.push(a);\n \t}else{\n \t\tstack.push(Integer.parseInt(str[i]));\n \t}\n }\n System.out.println(stack.pop());\n }\n\t}",
"main",
"{\n // TODO ?????????????????????????????????????????????\n // System.out.println(\"0\".compareTo(\"1\"));\n\t\tDeque<Integer> stack = new ArrayDeque<Integer>();\n\n try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {\n String line=br.readLine();\n String[] str=line.split(\" \");\n \n for(int i=0;i<str.length;i++){\n \tif(str[i].equals(\"+\")){\n \t\tint a=stack.pop()+stack.pop();\n \t\tstack.push(a);\n \t}else if(str[i].equals(\"-\")){\n \t\tint aa=stack.pop();\n \t\tint bb=stack.pop();\n \t\tint a=bb-aa;\n \t\tstack.push(a);\n \t}else if(str[i].equals(\"*\")){\n \t\tint aa=stack.pop();\n \t\tint bb=stack.pop();\n \t\tint a=aa*bb;\n \t\tstack.push(a);\n \t}else{\n \t\tstack.push(Integer.parseInt(str[i]));\n \t}\n }\n System.out.println(stack.pop());\n }\n\t}",
"Deque<Integer> stack = new ArrayDeque<Integer>();",
"stack",
"new ArrayDeque<Integer>()",
"try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {\n String line=br.readLine();\n String[] str=line.split(\" \");\n \n for(int i=0;i<str.length;i++){\n \tif(str[i].equals(\"+\")){\n \t\tint a=stack.pop()+stack.pop();\n \t\tstack.push(a);\n \t}else if(str[i].equals(\"-\")){\n \t\tint aa=stack.pop();\n \t\tint bb=stack.pop();\n \t\tint a=bb-aa;\n \t\tstack.push(a);\n \t}else if(str[i].equals(\"*\")){\n \t\tint aa=stack.pop();\n \t\tint bb=stack.pop();\n \t\tint a=aa*bb;\n \t\tstack.push(a);\n \t}else{\n \t\tstack.push(Integer.parseInt(str[i]));\n \t}\n }\n System.out.println(stack.pop());\n }",
"{\n String line=br.readLine();\n String[] str=line.split(\" \");\n \n for(int i=0;i<str.length;i++){\n \tif(str[i].equals(\"+\")){\n \t\tint a=stack.pop()+stack.pop();\n \t\tstack.push(a);\n \t}else if(str[i].equals(\"-\")){\n \t\tint aa=stack.pop();\n \t\tint bb=stack.pop();\n \t\tint a=bb-aa;\n \t\tstack.push(a);\n \t}else if(str[i].equals(\"*\")){\n \t\tint aa=stack.pop();\n \t\tint bb=stack.pop();\n \t\tint a=aa*bb;\n \t\tstack.push(a);\n \t}else{\n \t\tstack.push(Integer.parseInt(str[i]));\n \t}\n }\n System.out.println(stack.pop());\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();",
"line",
"br.readLine()",
"br.readLine",
"br",
"String[] str=line.split(\" \");",
"str",
"line.split(\" \")",
"line.split",
"line",
"\" \"",
"for(int i=0;i<str.length;i++){\n \tif(str[i].equals(\"+\")){\n \t\tint a=stack.pop()+stack.pop();\n \t\tstack.push(a);\n \t}else if(str[i].equals(\"-\")){\n \t\tint aa=stack.pop();\n \t\tint bb=stack.pop();\n \t\tint a=bb-aa;\n \t\tstack.push(a);\n \t}else if(str[i].equals(\"*\")){\n \t\tint aa=stack.pop();\n \t\tint bb=stack.pop();\n \t\tint a=aa*bb;\n \t\tstack.push(a);\n \t}else{\n \t\tstack.push(Integer.parseInt(str[i]));\n \t}\n }",
"int i=0;",
"int i=0;",
"i",
"0",
"i<str.length",
"i",
"str.length",
"str",
"str.length",
"i++",
"i++",
"i",
"{\n \tif(str[i].equals(\"+\")){\n \t\tint a=stack.pop()+stack.pop();\n \t\tstack.push(a);\n \t}else if(str[i].equals(\"-\")){\n \t\tint aa=stack.pop();\n \t\tint bb=stack.pop();\n \t\tint a=bb-aa;\n \t\tstack.push(a);\n \t}else if(str[i].equals(\"*\")){\n \t\tint aa=stack.pop();\n \t\tint bb=stack.pop();\n \t\tint a=aa*bb;\n \t\tstack.push(a);\n \t}else{\n \t\tstack.push(Integer.parseInt(str[i]));\n \t}\n }",
"{\n \tif(str[i].equals(\"+\")){\n \t\tint a=stack.pop()+stack.pop();\n \t\tstack.push(a);\n \t}else if(str[i].equals(\"-\")){\n \t\tint aa=stack.pop();\n \t\tint bb=stack.pop();\n \t\tint a=bb-aa;\n \t\tstack.push(a);\n \t}else if(str[i].equals(\"*\")){\n \t\tint aa=stack.pop();\n \t\tint bb=stack.pop();\n \t\tint a=aa*bb;\n \t\tstack.push(a);\n \t}else{\n \t\tstack.push(Integer.parseInt(str[i]));\n \t}\n }",
"if(str[i].equals(\"+\")){\n \t\tint a=stack.pop()+stack.pop();\n \t\tstack.push(a);\n \t}else if(str[i].equals(\"-\")){\n \t\tint aa=stack.pop();\n \t\tint bb=stack.pop();\n \t\tint a=bb-aa;\n \t\tstack.push(a);\n \t}else if(str[i].equals(\"*\")){\n \t\tint aa=stack.pop();\n \t\tint bb=stack.pop();\n \t\tint a=aa*bb;\n \t\tstack.push(a);\n \t}else{\n \t\tstack.push(Integer.parseInt(str[i]));\n \t}",
"str[i].equals(\"+\")",
"str[i].equals",
"str[i]",
"str",
"i",
"\"+\"",
"{\n \t\tint a=stack.pop()+stack.pop();\n \t\tstack.push(a);\n \t}",
"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(str[i].equals(\"-\")){\n \t\tint aa=stack.pop();\n \t\tint bb=stack.pop();\n \t\tint a=bb-aa;\n \t\tstack.push(a);\n \t}else if(str[i].equals(\"*\")){\n \t\tint aa=stack.pop();\n \t\tint bb=stack.pop();\n \t\tint a=aa*bb;\n \t\tstack.push(a);\n \t}else{\n \t\tstack.push(Integer.parseInt(str[i]));\n \t}",
"str[i].equals(\"-\")",
"str[i].equals",
"str[i]",
"str",
"i",
"\"-\"",
"{\n \t\tint aa=stack.pop();\n \t\tint bb=stack.pop();\n \t\tint a=bb-aa;\n \t\tstack.push(a);\n \t}",
"int aa=stack.pop();",
"aa",
"stack.pop()",
"stack.pop",
"stack",
"int bb=stack.pop();",
"bb",
"stack.pop()",
"stack.pop",
"stack",
"int a=bb-aa;",
"a",
"bb-aa",
"bb",
"aa",
"stack.push(a)",
"stack.push",
"stack",
"a",
"if(str[i].equals(\"*\")){\n \t\tint aa=stack.pop();\n \t\tint bb=stack.pop();\n \t\tint a=aa*bb;\n \t\tstack.push(a);\n \t}else{\n \t\tstack.push(Integer.parseInt(str[i]));\n \t}",
"str[i].equals(\"*\")",
"str[i].equals",
"str[i]",
"str",
"i",
"\"*\"",
"{\n \t\tint aa=stack.pop();\n \t\tint bb=stack.pop();\n \t\tint a=aa*bb;\n \t\tstack.push(a);\n \t}",
"int aa=stack.pop();",
"aa",
"stack.pop()",
"stack.pop",
"stack",
"int bb=stack.pop();",
"bb",
"stack.pop()",
"stack.pop",
"stack",
"int a=aa*bb;",
"a",
"aa*bb",
"aa",
"bb",
"stack.push(a)",
"stack.push",
"stack",
"a",
"{\n \t\tstack.push(Integer.parseInt(str[i]));\n \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\n\tpublic static void main(String[] args) throws Exception {\n // TODO ?????????????????????????????????????????????\n // System.out.println(\"0\".compareTo(\"1\"));\n\t\tDeque<Integer> stack = new ArrayDeque<Integer>();\n\n try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {\n String line=br.readLine();\n String[] str=line.split(\" \");\n \n for(int i=0;i<str.length;i++){\n \tif(str[i].equals(\"+\")){\n \t\tint a=stack.pop()+stack.pop();\n \t\tstack.push(a);\n \t}else if(str[i].equals(\"-\")){\n \t\tint aa=stack.pop();\n \t\tint bb=stack.pop();\n \t\tint a=bb-aa;\n \t\tstack.push(a);\n \t}else if(str[i].equals(\"*\")){\n \t\tint aa=stack.pop();\n \t\tint bb=stack.pop();\n \t\tint a=aa*bb;\n \t\tstack.push(a);\n \t}else{\n \t\tstack.push(Integer.parseInt(str[i]));\n \t}\n }\n System.out.println(stack.pop());\n }\n\t}\n\n}",
"public class Main {\n\n\tpublic static void main(String[] args) throws Exception {\n // TODO ?????????????????????????????????????????????\n // System.out.println(\"0\".compareTo(\"1\"));\n\t\tDeque<Integer> stack = new ArrayDeque<Integer>();\n\n try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {\n String line=br.readLine();\n String[] str=line.split(\" \");\n \n for(int i=0;i<str.length;i++){\n \tif(str[i].equals(\"+\")){\n \t\tint a=stack.pop()+stack.pop();\n \t\tstack.push(a);\n \t}else if(str[i].equals(\"-\")){\n \t\tint aa=stack.pop();\n \t\tint bb=stack.pop();\n \t\tint a=bb-aa;\n \t\tstack.push(a);\n \t}else if(str[i].equals(\"*\")){\n \t\tint aa=stack.pop();\n \t\tint bb=stack.pop();\n \t\tint a=aa*bb;\n \t\tstack.push(a);\n \t}else{\n \t\tstack.push(Integer.parseInt(str[i]));\n \t}\n }\n System.out.println(stack.pop());\n }\n\t}\n\n}",
"Main"
] | import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayDeque;
import java.util.Deque;
public class Main {
public static void main(String[] args) throws Exception {
// TODO ?????????????????????????????????????????????
// System.out.println("0".compareTo("1"));
Deque<Integer> stack = new ArrayDeque<Integer>();
try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {
String line=br.readLine();
String[] str=line.split(" ");
for(int i=0;i<str.length;i++){
if(str[i].equals("+")){
int a=stack.pop()+stack.pop();
stack.push(a);
}else if(str[i].equals("-")){
int aa=stack.pop();
int bb=stack.pop();
int a=bb-aa;
stack.push(a);
}else if(str[i].equals("*")){
int aa=stack.pop();
int bb=stack.pop();
int a=aa*bb;
stack.push(a);
}else{
stack.push(Integer.parseInt(str[i]));
}
}
System.out.println(stack.pop());
}
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
20,
41,
13,
41,
13,
41,
13,
41,
13,
41,
13,
41,
13,
0,
13,
17,
42,
4,
18,
13,
30,
14,
2,
4,
18,
13,
17,
30,
4,
18,
13,
4,
18,
13,
30,
0,
13,
4,
18,
13,
14,
2,
4,
18,
13,
17,
17,
30,
0,
13,
4,
18,
13,
0,
13,
4,
18,
13,
4,
18,
13,
2,
13,
13,
14,
2,
4,
18,
13,
17,
17,
30,
0,
13,
4,
18,
13,
0,
13,
4,
18,
13,
4,
18,
13,
2,
13,
13,
14,
2,
4,
18,
13,
17,
17,
30,
0,
13,
4,
18,
13,
0,
13,
4,
18,
13,
4,
18,
13,
2,
13,
13,
4,
18,
18,
13,
13,
18,
18,
13,
13,
17,
4,
18,
13,
23,
13,
6,
13,
41,
13,
20,
17,
41,
13,
17,
12,
13,
30,
0,
18,
13,
13,
13,
40,
13,
23,
13,
12,
13,
30,
40,
13,
41,
13,
18,
13,
13,
29,
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
],
[
8,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
8,
19
],
[
19,
20
],
[
8,
21
],
[
21,
22
],
[
8,
23
],
[
23,
24
],
[
8,
25
],
[
25,
26
],
[
8,
27
],
[
27,
28
],
[
27,
29
],
[
8,
30
],
[
30,
31
],
[
31,
32
],
[
32,
33
],
[
30,
34
],
[
34,
35
],
[
35,
36
],
[
36,
37
],
[
37,
38
],
[
38,
39
],
[
36,
40
],
[
35,
41
],
[
41,
42
],
[
42,
43
],
[
43,
44
],
[
42,
45
],
[
45,
46
],
[
46,
47
],
[
35,
48
],
[
48,
49
],
[
49,
50
],
[
49,
51
],
[
51,
52
],
[
52,
53
],
[
48,
54
],
[
54,
55
],
[
55,
56
],
[
56,
57
],
[
57,
58
],
[
56,
59
],
[
55,
60
],
[
54,
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
],
[
54,
78
],
[
78,
79
],
[
79,
80
],
[
80,
81
],
[
81,
82
],
[
80,
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
],
[
78,
102
],
[
102,
103
],
[
103,
104
],
[
104,
105
],
[
105,
106
],
[
104,
107
],
[
103,
108
],
[
102,
109
],
[
109,
110
],
[
110,
111
],
[
110,
112
],
[
112,
113
],
[
113,
114
],
[
109,
115
],
[
115,
116
],
[
115,
117
],
[
117,
118
],
[
118,
119
],
[
109,
120
],
[
120,
121
],
[
121,
122
],
[
120,
123
],
[
123,
124
],
[
123,
125
],
[
8,
126
],
[
126,
127
],
[
127,
128
],
[
128,
129
],
[
128,
130
],
[
126,
131
],
[
131,
132
],
[
132,
133
],
[
132,
134
],
[
131,
135
],
[
8,
136
],
[
136,
137
],
[
137,
138
],
[
6,
139
],
[
139,
140
],
[
4,
141
],
[
141,
142
],
[
141,
143
],
[
143,
144
],
[
143,
145
],
[
141,
147
],
[
147,
148
],
[
147,
149
],
[
141,
150
],
[
150,
151
],
[
150,
152
],
[
152,
153
],
[
153,
154
],
[
154,
155
],
[
154,
156
],
[
153,
157
],
[
152,
158
],
[
158,
159
],
[
150,
160
],
[
160,
161
],
[
141,
162
],
[
162,
163
],
[
162,
164
],
[
164,
165
],
[
165,
166
],
[
164,
167
],
[
167,
168
],
[
167,
169
],
[
169,
170
],
[
169,
171
],
[
164,
172
],
[
172,
173
]
] | [
"import java.util.*;\n\nclass Main\n{\n\n //------------stack-------------\n static class Stack\n {\n\tint[] stack = new int[100];\n\tint head=0;\n\t\n\tvoid push(int n)\n\t{\n\t stack[head]=n;\n\t head++;\n\t}\n\t\n\tint pop()\n\t{\n\t head--;\n\t int i=stack[head];\n\t return i;\n\t}\n }\n \n //-----------Main---------------\n public static void main(String args[])\n {\n\tScanner sc = new Scanner(System.in);\n\tMain.Stack stack = new Main.Stack();\n\tString s;\n\tint x, y;\n\tint i, j, k;\n\n\ti=0;\n\twhile(sc.hasNext())\n\t {\n\t\t//Read number\n\t\tif(sc.hasNextInt()==true)\n\t\t {\n\t\t\tstack.push(sc.nextInt());\n\t\t }\n\t\t//Read operand\n\t\telse\n\t\t {\n\t\t\ts=sc.next();\n\t\t\t//+\n\t\t\tif(s.equals(\"+\")==true)\n\t\t\t {\n\t\t\t\tx=stack.pop();\n\t\t\t\ty=stack.pop();\n\t\t\t\tstack.push(y+x);\n\t\t\t }\n\t\t\n\t\t\t//-\n\t\t\telse if(s.equals(\"-\")==true)\n\t\t\t {\n\t\t\t\tx=stack.pop();\n\t\t\t\ty=stack.pop();\n\t\t\t\tstack.push(y-x);\n\t\t\t }\n\t\t\t//*\n\t\t\telse if(s.equals(\"*\")==true)\n\t\t\t {\t\t\t\t\n\t\t\t\tx=stack.pop();\n\t\t\t\ty=stack.pop();\n\t\t\t\tstack.push(y*x);\n\t\t\t }\n\t\t\t//else if(s.equals(null)==true)break;\n\t\t }\n\t }\n \n \n\t//print\n\tSystem.out.println(stack.stack[0]);\n\tsc.close();\n \n }\n\n}",
"import java.util.*;",
"util.*",
"java",
"class Main\n{\n\n //------------stack-------------\n static class Stack\n {\n\tint[] stack = new int[100];\n\tint head=0;\n\t\n\tvoid push(int n)\n\t{\n\t stack[head]=n;\n\t head++;\n\t}\n\t\n\tint pop()\n\t{\n\t head--;\n\t int i=stack[head];\n\t return i;\n\t}\n }\n \n //-----------Main---------------\n public static void main(String args[])\n {\n\tScanner sc = new Scanner(System.in);\n\tMain.Stack stack = new Main.Stack();\n\tString s;\n\tint x, y;\n\tint i, j, k;\n\n\ti=0;\n\twhile(sc.hasNext())\n\t {\n\t\t//Read number\n\t\tif(sc.hasNextInt()==true)\n\t\t {\n\t\t\tstack.push(sc.nextInt());\n\t\t }\n\t\t//Read operand\n\t\telse\n\t\t {\n\t\t\ts=sc.next();\n\t\t\t//+\n\t\t\tif(s.equals(\"+\")==true)\n\t\t\t {\n\t\t\t\tx=stack.pop();\n\t\t\t\ty=stack.pop();\n\t\t\t\tstack.push(y+x);\n\t\t\t }\n\t\t\n\t\t\t//-\n\t\t\telse if(s.equals(\"-\")==true)\n\t\t\t {\n\t\t\t\tx=stack.pop();\n\t\t\t\ty=stack.pop();\n\t\t\t\tstack.push(y-x);\n\t\t\t }\n\t\t\t//*\n\t\t\telse if(s.equals(\"*\")==true)\n\t\t\t {\t\t\t\t\n\t\t\t\tx=stack.pop();\n\t\t\t\ty=stack.pop();\n\t\t\t\tstack.push(y*x);\n\t\t\t }\n\t\t\t//else if(s.equals(null)==true)break;\n\t\t }\n\t }\n \n \n\t//print\n\tSystem.out.println(stack.stack[0]);\n\tsc.close();\n \n }\n\n}",
"Main",
"//-----------Main---------------\n public static void main(String args[])\n {\n\tScanner sc = new Scanner(System.in);\n\tMain.Stack stack = new Main.Stack();\n\tString s;\n\tint x, y;\n\tint i, j, k;\n\n\ti=0;\n\twhile(sc.hasNext())\n\t {\n\t\t//Read number\n\t\tif(sc.hasNextInt()==true)\n\t\t {\n\t\t\tstack.push(sc.nextInt());\n\t\t }\n\t\t//Read operand\n\t\telse\n\t\t {\n\t\t\ts=sc.next();\n\t\t\t//+\n\t\t\tif(s.equals(\"+\")==true)\n\t\t\t {\n\t\t\t\tx=stack.pop();\n\t\t\t\ty=stack.pop();\n\t\t\t\tstack.push(y+x);\n\t\t\t }\n\t\t\n\t\t\t//-\n\t\t\telse if(s.equals(\"-\")==true)\n\t\t\t {\n\t\t\t\tx=stack.pop();\n\t\t\t\ty=stack.pop();\n\t\t\t\tstack.push(y-x);\n\t\t\t }\n\t\t\t//*\n\t\t\telse if(s.equals(\"*\")==true)\n\t\t\t {\t\t\t\t\n\t\t\t\tx=stack.pop();\n\t\t\t\ty=stack.pop();\n\t\t\t\tstack.push(y*x);\n\t\t\t }\n\t\t\t//else if(s.equals(null)==true)break;\n\t\t }\n\t }\n \n \n\t//print\n\tSystem.out.println(stack.stack[0]);\n\tsc.close();\n \n }",
"main",
"{\n\tScanner sc = new Scanner(System.in);\n\tMain.Stack stack = new Main.Stack();\n\tString s;\n\tint x, y;\n\tint i, j, k;\n\n\ti=0;\n\twhile(sc.hasNext())\n\t {\n\t\t//Read number\n\t\tif(sc.hasNextInt()==true)\n\t\t {\n\t\t\tstack.push(sc.nextInt());\n\t\t }\n\t\t//Read operand\n\t\telse\n\t\t {\n\t\t\ts=sc.next();\n\t\t\t//+\n\t\t\tif(s.equals(\"+\")==true)\n\t\t\t {\n\t\t\t\tx=stack.pop();\n\t\t\t\ty=stack.pop();\n\t\t\t\tstack.push(y+x);\n\t\t\t }\n\t\t\n\t\t\t//-\n\t\t\telse if(s.equals(\"-\")==true)\n\t\t\t {\n\t\t\t\tx=stack.pop();\n\t\t\t\ty=stack.pop();\n\t\t\t\tstack.push(y-x);\n\t\t\t }\n\t\t\t//*\n\t\t\telse if(s.equals(\"*\")==true)\n\t\t\t {\t\t\t\t\n\t\t\t\tx=stack.pop();\n\t\t\t\ty=stack.pop();\n\t\t\t\tstack.push(y*x);\n\t\t\t }\n\t\t\t//else if(s.equals(null)==true)break;\n\t\t }\n\t }\n \n \n\t//print\n\tSystem.out.println(stack.stack[0]);\n\tsc.close();\n \n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"Main.Stack stack = new Main.Stack();",
"stack",
"new Main.Stack()",
"String s;",
"s",
"int x",
"x",
"y;",
"y",
"int i",
"i",
"j",
"j",
"k;",
"k",
"i=0",
"i",
"0",
"while(sc.hasNext())\n\t {\n\t\t//Read number\n\t\tif(sc.hasNextInt()==true)\n\t\t {\n\t\t\tstack.push(sc.nextInt());\n\t\t }\n\t\t//Read operand\n\t\telse\n\t\t {\n\t\t\ts=sc.next();\n\t\t\t//+\n\t\t\tif(s.equals(\"+\")==true)\n\t\t\t {\n\t\t\t\tx=stack.pop();\n\t\t\t\ty=stack.pop();\n\t\t\t\tstack.push(y+x);\n\t\t\t }\n\t\t\n\t\t\t//-\n\t\t\telse if(s.equals(\"-\")==true)\n\t\t\t {\n\t\t\t\tx=stack.pop();\n\t\t\t\ty=stack.pop();\n\t\t\t\tstack.push(y-x);\n\t\t\t }\n\t\t\t//*\n\t\t\telse if(s.equals(\"*\")==true)\n\t\t\t {\t\t\t\t\n\t\t\t\tx=stack.pop();\n\t\t\t\ty=stack.pop();\n\t\t\t\tstack.push(y*x);\n\t\t\t }\n\t\t\t//else if(s.equals(null)==true)break;\n\t\t }\n\t }",
"sc.hasNext()",
"sc.hasNext",
"sc",
"{\n\t\t//Read number\n\t\tif(sc.hasNextInt()==true)\n\t\t {\n\t\t\tstack.push(sc.nextInt());\n\t\t }\n\t\t//Read operand\n\t\telse\n\t\t {\n\t\t\ts=sc.next();\n\t\t\t//+\n\t\t\tif(s.equals(\"+\")==true)\n\t\t\t {\n\t\t\t\tx=stack.pop();\n\t\t\t\ty=stack.pop();\n\t\t\t\tstack.push(y+x);\n\t\t\t }\n\t\t\n\t\t\t//-\n\t\t\telse if(s.equals(\"-\")==true)\n\t\t\t {\n\t\t\t\tx=stack.pop();\n\t\t\t\ty=stack.pop();\n\t\t\t\tstack.push(y-x);\n\t\t\t }\n\t\t\t//*\n\t\t\telse if(s.equals(\"*\")==true)\n\t\t\t {\t\t\t\t\n\t\t\t\tx=stack.pop();\n\t\t\t\ty=stack.pop();\n\t\t\t\tstack.push(y*x);\n\t\t\t }\n\t\t\t//else if(s.equals(null)==true)break;\n\t\t }\n\t }",
"if(sc.hasNextInt()==true)\n\t\t {\n\t\t\tstack.push(sc.nextInt());\n\t\t }\n\t\t//Read operand\n\t\telse\n\t\t {\n\t\t\ts=sc.next();\n\t\t\t//+\n\t\t\tif(s.equals(\"+\")==true)\n\t\t\t {\n\t\t\t\tx=stack.pop();\n\t\t\t\ty=stack.pop();\n\t\t\t\tstack.push(y+x);\n\t\t\t }\n\t\t\n\t\t\t//-\n\t\t\telse if(s.equals(\"-\")==true)\n\t\t\t {\n\t\t\t\tx=stack.pop();\n\t\t\t\ty=stack.pop();\n\t\t\t\tstack.push(y-x);\n\t\t\t }\n\t\t\t//*\n\t\t\telse if(s.equals(\"*\")==true)\n\t\t\t {\t\t\t\t\n\t\t\t\tx=stack.pop();\n\t\t\t\ty=stack.pop();\n\t\t\t\tstack.push(y*x);\n\t\t\t }\n\t\t\t//else if(s.equals(null)==true)break;\n\t\t }",
"sc.hasNextInt()==true",
"sc.hasNextInt()",
"sc.hasNextInt",
"sc",
"true",
"{\n\t\t\tstack.push(sc.nextInt());\n\t\t }",
"stack.push(sc.nextInt())",
"stack.push",
"stack",
"sc.nextInt()",
"sc.nextInt",
"sc",
"{\n\t\t\ts=sc.next();\n\t\t\t//+\n\t\t\tif(s.equals(\"+\")==true)\n\t\t\t {\n\t\t\t\tx=stack.pop();\n\t\t\t\ty=stack.pop();\n\t\t\t\tstack.push(y+x);\n\t\t\t }\n\t\t\n\t\t\t//-\n\t\t\telse if(s.equals(\"-\")==true)\n\t\t\t {\n\t\t\t\tx=stack.pop();\n\t\t\t\ty=stack.pop();\n\t\t\t\tstack.push(y-x);\n\t\t\t }\n\t\t\t//*\n\t\t\telse if(s.equals(\"*\")==true)\n\t\t\t {\t\t\t\t\n\t\t\t\tx=stack.pop();\n\t\t\t\ty=stack.pop();\n\t\t\t\tstack.push(y*x);\n\t\t\t }\n\t\t\t//else if(s.equals(null)==true)break;\n\t\t }",
"s=sc.next()",
"s",
"sc.next()",
"sc.next",
"sc",
"if(s.equals(\"+\")==true)\n\t\t\t {\n\t\t\t\tx=stack.pop();\n\t\t\t\ty=stack.pop();\n\t\t\t\tstack.push(y+x);\n\t\t\t }\n\t\t\n\t\t\t//-\n\t\t\telse if(s.equals(\"-\")==true)\n\t\t\t {\n\t\t\t\tx=stack.pop();\n\t\t\t\ty=stack.pop();\n\t\t\t\tstack.push(y-x);\n\t\t\t }\n\t\t\t//*\n\t\t\telse if(s.equals(\"*\")==true)\n\t\t\t {\t\t\t\t\n\t\t\t\tx=stack.pop();\n\t\t\t\ty=stack.pop();\n\t\t\t\tstack.push(y*x);\n\t\t\t }",
"s.equals(\"+\")==true",
"s.equals(\"+\")",
"s.equals",
"s",
"\"+\"",
"true",
"{\n\t\t\t\tx=stack.pop();\n\t\t\t\ty=stack.pop();\n\t\t\t\tstack.push(y+x);\n\t\t\t }",
"x=stack.pop()",
"x",
"stack.pop()",
"stack.pop",
"stack",
"y=stack.pop()",
"y",
"stack.pop()",
"stack.pop",
"stack",
"stack.push(y+x)",
"stack.push",
"stack",
"y+x",
"y",
"x",
"if(s.equals(\"-\")==true)\n\t\t\t {\n\t\t\t\tx=stack.pop();\n\t\t\t\ty=stack.pop();\n\t\t\t\tstack.push(y-x);\n\t\t\t }\n\t\t\t//*\n\t\t\telse if(s.equals(\"*\")==true)\n\t\t\t {\t\t\t\t\n\t\t\t\tx=stack.pop();\n\t\t\t\ty=stack.pop();\n\t\t\t\tstack.push(y*x);\n\t\t\t }",
"s.equals(\"-\")==true",
"s.equals(\"-\")",
"s.equals",
"s",
"\"-\"",
"true",
"{\n\t\t\t\tx=stack.pop();\n\t\t\t\ty=stack.pop();\n\t\t\t\tstack.push(y-x);\n\t\t\t }",
"x=stack.pop()",
"x",
"stack.pop()",
"stack.pop",
"stack",
"y=stack.pop()",
"y",
"stack.pop()",
"stack.pop",
"stack",
"stack.push(y-x)",
"stack.push",
"stack",
"y-x",
"y",
"x",
"if(s.equals(\"*\")==true)\n\t\t\t {\t\t\t\t\n\t\t\t\tx=stack.pop();\n\t\t\t\ty=stack.pop();\n\t\t\t\tstack.push(y*x);\n\t\t\t }",
"s.equals(\"*\")==true",
"s.equals(\"*\")",
"s.equals",
"s",
"\"*\"",
"true",
"{\t\t\t\t\n\t\t\t\tx=stack.pop();\n\t\t\t\ty=stack.pop();\n\t\t\t\tstack.push(y*x);\n\t\t\t }",
"x=stack.pop()",
"x",
"stack.pop()",
"stack.pop",
"stack",
"y=stack.pop()",
"y",
"stack.pop()",
"stack.pop",
"stack",
"stack.push(y*x)",
"stack.push",
"stack",
"y*x",
"y",
"x",
"System.out.println(stack.stack[0])",
"System.out.println",
"System.out",
"System",
"System.out",
"stack.stack[0]",
"stack.stack",
"stack",
"stack.stack",
"0",
"sc.close()",
"sc.close",
"sc",
"String args[]",
"args",
"static class Stack\n {\n\tint[] stack = new int[100];\n\tint head=0;\n\t\n\tvoid push(int n)\n\t{\n\t stack[head]=n;\n\t head++;\n\t}\n\t\n\tint pop()\n\t{\n\t head--;\n\t int i=stack[head];\n\t return i;\n\t}\n }",
"Stack",
"int[] stack = new int[100];",
"stack",
"new int[100]",
"100",
"int head=0;",
"head",
"0",
"void push(int n)\n\t{\n\t stack[head]=n;\n\t head++;\n\t}",
"push",
"{\n\t stack[head]=n;\n\t head++;\n\t}",
"stack[head]=n",
"stack[head]",
"stack",
"head",
"n",
"head++",
"head",
"int n",
"n",
"int pop()\n\t{\n\t head--;\n\t int i=stack[head];\n\t return i;\n\t}",
"pop",
"{\n\t head--;\n\t int i=stack[head];\n\t return i;\n\t}",
"head--",
"head",
"int i=stack[head];",
"i",
"stack[head]",
"stack",
"head",
"return i;",
"i"
] | import java.util.*;
class Main
{
//------------stack-------------
static class Stack
{
int[] stack = new int[100];
int head=0;
void push(int n)
{
stack[head]=n;
head++;
}
int pop()
{
head--;
int i=stack[head];
return i;
}
}
//-----------Main---------------
public static void main(String args[])
{
Scanner sc = new Scanner(System.in);
Main.Stack stack = new Main.Stack();
String s;
int x, y;
int i, j, k;
i=0;
while(sc.hasNext())
{
//Read number
if(sc.hasNextInt()==true)
{
stack.push(sc.nextInt());
}
//Read operand
else
{
s=sc.next();
//+
if(s.equals("+")==true)
{
x=stack.pop();
y=stack.pop();
stack.push(y+x);
}
//-
else if(s.equals("-")==true)
{
x=stack.pop();
y=stack.pop();
stack.push(y-x);
}
//*
else if(s.equals("*")==true)
{
x=stack.pop();
y=stack.pop();
stack.push(y*x);
}
//else if(s.equals(null)==true)break;
}
}
//print
System.out.println(stack.stack[0]);
sc.close();
}
} |
[
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,
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,
40,
13,
41,
13,
18,
13,
2,
13,
17,
41,
13,
18,
13,
13,
0,
18,
13,
13,
2,
13,
13,
14,
4,
18,
18,
13,
13,
17,
30,
40,
13,
41,
13,
18,
13,
2,
13,
17,
41,
13,
18,
13,
13,
0,
18,
13,
13,
2,
13,
13,
14,
4,
18,
18,
13,
13,
17,
30,
40,
13,
41,
13,
18,
13,
2,
13,
17,
41,
13,
18,
13,
13,
0,
18,
13,
13,
2,
13,
13,
30,
40,
13,
0,
18,
13,
13,
4,
18,
13,
18,
13,
13,
4,
18,
18,
13,
13,
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
],
[
164,
8
],
[
164,
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
],
[
11,
32
],
[
32,
33
],
[
32,
34
],
[
11,
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
],
[
57,
60
],
[
60,
61
],
[
60,
62
],
[
62,
63
],
[
62,
64
],
[
64,
65
],
[
64,
66
],
[
57,
67
],
[
67,
68
],
[
67,
69
],
[
69,
70
],
[
69,
71
],
[
57,
72
],
[
72,
73
],
[
73,
74
],
[
73,
75
],
[
72,
76
],
[
76,
77
],
[
76,
78
],
[
50,
79
],
[
79,
80
],
[
80,
81
],
[
81,
82
],
[
82,
83
],
[
82,
84
],
[
80,
85
],
[
79,
86
],
[
86,
87
],
[
87,
88
],
[
86,
89
],
[
89,
90
],
[
89,
91
],
[
91,
92
],
[
91,
93
],
[
93,
94
],
[
93,
95
],
[
86,
96
],
[
96,
97
],
[
96,
98
],
[
98,
99
],
[
98,
100
],
[
86,
101
],
[
101,
102
],
[
102,
103
],
[
102,
104
],
[
101,
105
],
[
105,
106
],
[
105,
107
],
[
79,
108
],
[
108,
109
],
[
109,
110
],
[
110,
111
],
[
111,
112
],
[
111,
113
],
[
109,
114
],
[
108,
115
],
[
115,
116
],
[
116,
117
],
[
115,
118
],
[
118,
119
],
[
118,
120
],
[
120,
121
],
[
120,
122
],
[
122,
123
],
[
122,
124
],
[
115,
125
],
[
125,
126
],
[
125,
127
],
[
127,
128
],
[
127,
129
],
[
115,
130
],
[
130,
131
],
[
131,
132
],
[
131,
133
],
[
130,
134
],
[
134,
135
],
[
134,
136
],
[
108,
137
],
[
137,
138
],
[
138,
139
],
[
137,
140
],
[
140,
141
],
[
141,
142
],
[
141,
143
],
[
140,
144
],
[
144,
145
],
[
145,
146
],
[
144,
147
],
[
147,
148
],
[
147,
149
],
[
11,
150
],
[
150,
151
],
[
151,
152
],
[
152,
153
],
[
152,
154
],
[
150,
155
],
[
155,
156
],
[
155,
157
],
[
11,
158
],
[
158,
159
],
[
159,
160
],
[
9,
161
],
[
161,
162
],
[
0,
163
],
[
163,
164
],
[
163,
165
]
] | [
"import java.io.*;\nimport java.util.*;\n\n\n\npublic class Main{\n public static void main(String[] args)throws IOException{\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n String str;\n\n str = br.readLine();//34 116 + 20 5 - 5 - 1 * +\n String[] strs = str.split(\"\\\\s\");\n int[] stack = new int[200];\n\n int l = 0;\n for(int i=0;i<strs.length;i++){\n if(strs[i].equals(\"+\")){\n l--;\n int x = stack[l+1];\n int y = stack[l];\n stack[l] = x + y;\n //System.out.println(stack[l]);\n }else if(strs[i].equals(\"-\")){\n l--;\n int x = stack[l+1];\n int y = stack[l];\n stack[l] = y - x;\n //System.out.println(stack[l]);\n }else if(strs[i].equals(\"*\")){\n l--;\n int x = stack[l+1];\n int y = stack[l];\n stack[l] = x * y;\n //System.out.println(stack[l]);\n }else{\n l++;\n stack[l] = Integer.parseInt(strs[i]);\n }\n }\n \n System.out.println(stack[l]);\n \n br.close();\n }\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 BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n String str;\n\n str = br.readLine();//34 116 + 20 5 - 5 - 1 * +\n String[] strs = str.split(\"\\\\s\");\n int[] stack = new int[200];\n\n int l = 0;\n for(int i=0;i<strs.length;i++){\n if(strs[i].equals(\"+\")){\n l--;\n int x = stack[l+1];\n int y = stack[l];\n stack[l] = x + y;\n //System.out.println(stack[l]);\n }else if(strs[i].equals(\"-\")){\n l--;\n int x = stack[l+1];\n int y = stack[l];\n stack[l] = y - x;\n //System.out.println(stack[l]);\n }else if(strs[i].equals(\"*\")){\n l--;\n int x = stack[l+1];\n int y = stack[l];\n stack[l] = x * y;\n //System.out.println(stack[l]);\n }else{\n l++;\n stack[l] = Integer.parseInt(strs[i]);\n }\n }\n \n System.out.println(stack[l]);\n \n br.close();\n }\n \n}",
"Main",
"public static void main(String[] args)throws IOException{\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n String str;\n\n str = br.readLine();//34 116 + 20 5 - 5 - 1 * +\n String[] strs = str.split(\"\\\\s\");\n int[] stack = new int[200];\n\n int l = 0;\n for(int i=0;i<strs.length;i++){\n if(strs[i].equals(\"+\")){\n l--;\n int x = stack[l+1];\n int y = stack[l];\n stack[l] = x + y;\n //System.out.println(stack[l]);\n }else if(strs[i].equals(\"-\")){\n l--;\n int x = stack[l+1];\n int y = stack[l];\n stack[l] = y - x;\n //System.out.println(stack[l]);\n }else if(strs[i].equals(\"*\")){\n l--;\n int x = stack[l+1];\n int y = stack[l];\n stack[l] = x * y;\n //System.out.println(stack[l]);\n }else{\n l++;\n stack[l] = Integer.parseInt(strs[i]);\n }\n }\n \n System.out.println(stack[l]);\n \n br.close();\n }",
"main",
"{\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n String str;\n\n str = br.readLine();//34 116 + 20 5 - 5 - 1 * +\n String[] strs = str.split(\"\\\\s\");\n int[] stack = new int[200];\n\n int l = 0;\n for(int i=0;i<strs.length;i++){\n if(strs[i].equals(\"+\")){\n l--;\n int x = stack[l+1];\n int y = stack[l];\n stack[l] = x + y;\n //System.out.println(stack[l]);\n }else if(strs[i].equals(\"-\")){\n l--;\n int x = stack[l+1];\n int y = stack[l];\n stack[l] = y - x;\n //System.out.println(stack[l]);\n }else if(strs[i].equals(\"*\")){\n l--;\n int x = stack[l+1];\n int y = stack[l];\n stack[l] = x * y;\n //System.out.println(stack[l]);\n }else{\n l++;\n stack[l] = Integer.parseInt(strs[i]);\n }\n }\n \n System.out.println(stack[l]);\n \n br.close();\n }",
"BufferedReader br = new BufferedReader(new InputStreamReader(System.in));",
"br",
"new BufferedReader(new InputStreamReader(System.in))",
"String str;",
"str",
"str = br.readLine()",
"str",
"br.readLine()",
"br.readLine",
"br",
"String[] strs = str.split(\"\\\\s\");",
"strs",
"str.split(\"\\\\s\")",
"str.split",
"str",
"\"\\\\s\"",
"int[] stack = new int[200];",
"stack",
"new int[200]",
"200",
"int l = 0;",
"l",
"0",
"for(int i=0;i<strs.length;i++){\n if(strs[i].equals(\"+\")){\n l--;\n int x = stack[l+1];\n int y = stack[l];\n stack[l] = x + y;\n //System.out.println(stack[l]);\n }else if(strs[i].equals(\"-\")){\n l--;\n int x = stack[l+1];\n int y = stack[l];\n stack[l] = y - x;\n //System.out.println(stack[l]);\n }else if(strs[i].equals(\"*\")){\n l--;\n int x = stack[l+1];\n int y = stack[l];\n stack[l] = x * y;\n //System.out.println(stack[l]);\n }else{\n l++;\n stack[l] = Integer.parseInt(strs[i]);\n }\n }",
"int i=0;",
"int i=0;",
"i",
"0",
"i<strs.length",
"i",
"strs.length",
"strs",
"strs.length",
"i++",
"i++",
"i",
"{\n if(strs[i].equals(\"+\")){\n l--;\n int x = stack[l+1];\n int y = stack[l];\n stack[l] = x + y;\n //System.out.println(stack[l]);\n }else if(strs[i].equals(\"-\")){\n l--;\n int x = stack[l+1];\n int y = stack[l];\n stack[l] = y - x;\n //System.out.println(stack[l]);\n }else if(strs[i].equals(\"*\")){\n l--;\n int x = stack[l+1];\n int y = stack[l];\n stack[l] = x * y;\n //System.out.println(stack[l]);\n }else{\n l++;\n stack[l] = Integer.parseInt(strs[i]);\n }\n }",
"{\n if(strs[i].equals(\"+\")){\n l--;\n int x = stack[l+1];\n int y = stack[l];\n stack[l] = x + y;\n //System.out.println(stack[l]);\n }else if(strs[i].equals(\"-\")){\n l--;\n int x = stack[l+1];\n int y = stack[l];\n stack[l] = y - x;\n //System.out.println(stack[l]);\n }else if(strs[i].equals(\"*\")){\n l--;\n int x = stack[l+1];\n int y = stack[l];\n stack[l] = x * y;\n //System.out.println(stack[l]);\n }else{\n l++;\n stack[l] = Integer.parseInt(strs[i]);\n }\n }",
"if(strs[i].equals(\"+\")){\n l--;\n int x = stack[l+1];\n int y = stack[l];\n stack[l] = x + y;\n //System.out.println(stack[l]);\n }else if(strs[i].equals(\"-\")){\n l--;\n int x = stack[l+1];\n int y = stack[l];\n stack[l] = y - x;\n //System.out.println(stack[l]);\n }else if(strs[i].equals(\"*\")){\n l--;\n int x = stack[l+1];\n int y = stack[l];\n stack[l] = x * y;\n //System.out.println(stack[l]);\n }else{\n l++;\n stack[l] = Integer.parseInt(strs[i]);\n }",
"strs[i].equals(\"+\")",
"strs[i].equals",
"strs[i]",
"strs",
"i",
"\"+\"",
"{\n l--;\n int x = stack[l+1];\n int y = stack[l];\n stack[l] = x + y;\n //System.out.println(stack[l]);\n }",
"l--",
"l",
"int x = stack[l+1];",
"x",
"stack[l+1]",
"stack",
"l+1",
"l",
"1",
"int y = stack[l];",
"y",
"stack[l]",
"stack",
"l",
"stack[l] = x + y",
"stack[l]",
"stack",
"l",
"x + y",
"x",
"y",
"if(strs[i].equals(\"-\")){\n l--;\n int x = stack[l+1];\n int y = stack[l];\n stack[l] = y - x;\n //System.out.println(stack[l]);\n }else if(strs[i].equals(\"*\")){\n l--;\n int x = stack[l+1];\n int y = stack[l];\n stack[l] = x * y;\n //System.out.println(stack[l]);\n }else{\n l++;\n stack[l] = Integer.parseInt(strs[i]);\n }",
"strs[i].equals(\"-\")",
"strs[i].equals",
"strs[i]",
"strs",
"i",
"\"-\"",
"{\n l--;\n int x = stack[l+1];\n int y = stack[l];\n stack[l] = y - x;\n //System.out.println(stack[l]);\n }",
"l--",
"l",
"int x = stack[l+1];",
"x",
"stack[l+1]",
"stack",
"l+1",
"l",
"1",
"int y = stack[l];",
"y",
"stack[l]",
"stack",
"l",
"stack[l] = y - x",
"stack[l]",
"stack",
"l",
"y - x",
"y",
"x",
"if(strs[i].equals(\"*\")){\n l--;\n int x = stack[l+1];\n int y = stack[l];\n stack[l] = x * y;\n //System.out.println(stack[l]);\n }else{\n l++;\n stack[l] = Integer.parseInt(strs[i]);\n }",
"strs[i].equals(\"*\")",
"strs[i].equals",
"strs[i]",
"strs",
"i",
"\"*\"",
"{\n l--;\n int x = stack[l+1];\n int y = stack[l];\n stack[l] = x * y;\n //System.out.println(stack[l]);\n }",
"l--",
"l",
"int x = stack[l+1];",
"x",
"stack[l+1]",
"stack",
"l+1",
"l",
"1",
"int y = stack[l];",
"y",
"stack[l]",
"stack",
"l",
"stack[l] = x * y",
"stack[l]",
"stack",
"l",
"x * y",
"x",
"y",
"{\n l++;\n stack[l] = Integer.parseInt(strs[i]);\n }",
"l++",
"l",
"stack[l] = Integer.parseInt(strs[i])",
"stack[l]",
"stack",
"l",
"Integer.parseInt(strs[i])",
"Integer.parseInt",
"Integer",
"strs[i]",
"strs",
"i",
"System.out.println(stack[l])",
"System.out.println",
"System.out",
"System",
"System.out",
"stack[l]",
"stack",
"l",
"br.close()",
"br.close",
"br",
"String[] args",
"args",
"public class Main{\n public static void main(String[] args)throws IOException{\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n String str;\n\n str = br.readLine();//34 116 + 20 5 - 5 - 1 * +\n String[] strs = str.split(\"\\\\s\");\n int[] stack = new int[200];\n\n int l = 0;\n for(int i=0;i<strs.length;i++){\n if(strs[i].equals(\"+\")){\n l--;\n int x = stack[l+1];\n int y = stack[l];\n stack[l] = x + y;\n //System.out.println(stack[l]);\n }else if(strs[i].equals(\"-\")){\n l--;\n int x = stack[l+1];\n int y = stack[l];\n stack[l] = y - x;\n //System.out.println(stack[l]);\n }else if(strs[i].equals(\"*\")){\n l--;\n int x = stack[l+1];\n int y = stack[l];\n stack[l] = x * y;\n //System.out.println(stack[l]);\n }else{\n l++;\n stack[l] = Integer.parseInt(strs[i]);\n }\n }\n \n System.out.println(stack[l]);\n \n br.close();\n }\n \n}",
"public class Main{\n public static void main(String[] args)throws IOException{\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n String str;\n\n str = br.readLine();//34 116 + 20 5 - 5 - 1 * +\n String[] strs = str.split(\"\\\\s\");\n int[] stack = new int[200];\n\n int l = 0;\n for(int i=0;i<strs.length;i++){\n if(strs[i].equals(\"+\")){\n l--;\n int x = stack[l+1];\n int y = stack[l];\n stack[l] = x + y;\n //System.out.println(stack[l]);\n }else if(strs[i].equals(\"-\")){\n l--;\n int x = stack[l+1];\n int y = stack[l];\n stack[l] = y - x;\n //System.out.println(stack[l]);\n }else if(strs[i].equals(\"*\")){\n l--;\n int x = stack[l+1];\n int y = stack[l];\n stack[l] = x * y;\n //System.out.println(stack[l]);\n }else{\n l++;\n stack[l] = Integer.parseInt(strs[i]);\n }\n }\n \n System.out.println(stack[l]);\n \n br.close();\n }\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));
String str;
str = br.readLine();//34 116 + 20 5 - 5 - 1 * +
String[] strs = str.split("\\s");
int[] stack = new int[200];
int l = 0;
for(int i=0;i<strs.length;i++){
if(strs[i].equals("+")){
l--;
int x = stack[l+1];
int y = stack[l];
stack[l] = x + y;
//System.out.println(stack[l]);
}else if(strs[i].equals("-")){
l--;
int x = stack[l+1];
int y = stack[l];
stack[l] = y - x;
//System.out.println(stack[l]);
}else if(strs[i].equals("*")){
l--;
int x = stack[l+1];
int y = stack[l];
stack[l] = x * y;
//System.out.println(stack[l]);
}else{
l++;
stack[l] = Integer.parseInt(strs[i]);
}
}
System.out.println(stack[l]);
br.close();
}
}
|
[
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,
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,
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
],
[
149,
14
],
[
149,
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
],
[
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
],
[
60,
62
],
[
62,
63
],
[
63,
64
],
[
62,
65
],
[
65,
66
],
[
66,
67
],
[
66,
68
],
[
68,
69
],
[
68,
70
],
[
65,
71
],
[
71,
72
],
[
72,
73
],
[
72,
74
],
[
74,
75
],
[
74,
76
],
[
71,
77
],
[
77,
78
],
[
77,
79
],
[
62,
80
],
[
53,
81
],
[
81,
82
],
[
81,
83
],
[
83,
84
],
[
84,
85
],
[
83,
86
],
[
86,
87
],
[
87,
88
],
[
87,
89
],
[
89,
90
],
[
89,
91
],
[
86,
92
],
[
92,
93
],
[
93,
94
],
[
93,
95
],
[
95,
96
],
[
95,
97
],
[
92,
98
],
[
98,
99
],
[
98,
100
],
[
83,
101
],
[
53,
102
],
[
102,
103
],
[
102,
104
],
[
104,
105
],
[
105,
106
],
[
104,
107
],
[
107,
108
],
[
108,
109
],
[
108,
110
],
[
110,
111
],
[
110,
112
],
[
107,
113
],
[
113,
114
],
[
114,
115
],
[
114,
116
],
[
116,
117
],
[
116,
118
],
[
113,
119
],
[
119,
120
],
[
119,
121
],
[
104,
122
],
[
53,
123
],
[
123,
124
],
[
124,
125
],
[
125,
126
],
[
126,
127
],
[
126,
128
],
[
125,
129
],
[
129,
130
],
[
130,
131
],
[
129,
132
],
[
132,
133
],
[
132,
134
],
[
124,
135
],
[
135,
136
],
[
124,
137
],
[
17,
138
],
[
138,
139
],
[
139,
140
],
[
140,
141
],
[
140,
142
],
[
138,
143
],
[
143,
144
],
[
143,
145
],
[
15,
146
],
[
146,
147
],
[
0,
148
],
[
148,
149
],
[
148,
150
]
] | [
"\nimport java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\nimport java.util.Arrays;\n\npublic class Main {\n\n\tpublic static void main(String[] args) throws NumberFormatException,\n\t\t\tIOException {\n\t\tBufferedReader reader = new BufferedReader(new InputStreamReader(\n\t\t\t\tSystem.in));\n\n\t\tString[] strs = reader.readLine().split(\" \");\n\t\tint[] nums = new int[strs.length];\n\t\tint top = 0;\n\t\tfor (int i = 0; i < strs.length; i++) {\n\t\t\tswitch (strs[i].charAt(0)) {\n\t\t\tcase '+':\n\t\t\t\ttop--;\n\t\t\t\tnums[top-1] = nums[top - 1] + nums[top];\n\t\t\t\tbreak;\n\t\t\tcase '-':\n\t\t\t\ttop--;\n\t\t\t\tnums[top-1] = nums[top - 1] - nums[top];\n\t\t\t\tbreak;\n\t\t\tcase '*':\n\t\t\t\ttop--;\n\t\t\t\tnums[top-1] = nums[top - 1] * nums[top];\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t\n\t\t\t\tnums[top] = Integer.parseInt(strs[i]);\n\t\t\t\ttop++;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t/*System.out.println(Arrays.toString(nums));*/\n\t\t}\n\t\tSystem.out.println(nums[0]);\n\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.Arrays;",
"Arrays",
"java.util",
"public class Main {\n\n\tpublic static void main(String[] args) throws NumberFormatException,\n\t\t\tIOException {\n\t\tBufferedReader reader = new BufferedReader(new InputStreamReader(\n\t\t\t\tSystem.in));\n\n\t\tString[] strs = reader.readLine().split(\" \");\n\t\tint[] nums = new int[strs.length];\n\t\tint top = 0;\n\t\tfor (int i = 0; i < strs.length; i++) {\n\t\t\tswitch (strs[i].charAt(0)) {\n\t\t\tcase '+':\n\t\t\t\ttop--;\n\t\t\t\tnums[top-1] = nums[top - 1] + nums[top];\n\t\t\t\tbreak;\n\t\t\tcase '-':\n\t\t\t\ttop--;\n\t\t\t\tnums[top-1] = nums[top - 1] - nums[top];\n\t\t\t\tbreak;\n\t\t\tcase '*':\n\t\t\t\ttop--;\n\t\t\t\tnums[top-1] = nums[top - 1] * nums[top];\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t\n\t\t\t\tnums[top] = Integer.parseInt(strs[i]);\n\t\t\t\ttop++;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t/*System.out.println(Arrays.toString(nums));*/\n\t\t}\n\t\tSystem.out.println(nums[0]);\n\n\t}\n}",
"Main",
"public static void main(String[] args) throws NumberFormatException,\n\t\t\tIOException {\n\t\tBufferedReader reader = new BufferedReader(new InputStreamReader(\n\t\t\t\tSystem.in));\n\n\t\tString[] strs = reader.readLine().split(\" \");\n\t\tint[] nums = new int[strs.length];\n\t\tint top = 0;\n\t\tfor (int i = 0; i < strs.length; i++) {\n\t\t\tswitch (strs[i].charAt(0)) {\n\t\t\tcase '+':\n\t\t\t\ttop--;\n\t\t\t\tnums[top-1] = nums[top - 1] + nums[top];\n\t\t\t\tbreak;\n\t\t\tcase '-':\n\t\t\t\ttop--;\n\t\t\t\tnums[top-1] = nums[top - 1] - nums[top];\n\t\t\t\tbreak;\n\t\t\tcase '*':\n\t\t\t\ttop--;\n\t\t\t\tnums[top-1] = nums[top - 1] * nums[top];\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t\n\t\t\t\tnums[top] = Integer.parseInt(strs[i]);\n\t\t\t\ttop++;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t/*System.out.println(Arrays.toString(nums));*/\n\t\t}\n\t\tSystem.out.println(nums[0]);\n\n\t}",
"main",
"{\n\t\tBufferedReader reader = new BufferedReader(new InputStreamReader(\n\t\t\t\tSystem.in));\n\n\t\tString[] strs = reader.readLine().split(\" \");\n\t\tint[] nums = new int[strs.length];\n\t\tint top = 0;\n\t\tfor (int i = 0; i < strs.length; i++) {\n\t\t\tswitch (strs[i].charAt(0)) {\n\t\t\tcase '+':\n\t\t\t\ttop--;\n\t\t\t\tnums[top-1] = nums[top - 1] + nums[top];\n\t\t\t\tbreak;\n\t\t\tcase '-':\n\t\t\t\ttop--;\n\t\t\t\tnums[top-1] = nums[top - 1] - nums[top];\n\t\t\t\tbreak;\n\t\t\tcase '*':\n\t\t\t\ttop--;\n\t\t\t\tnums[top-1] = nums[top - 1] * nums[top];\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t\n\t\t\t\tnums[top] = Integer.parseInt(strs[i]);\n\t\t\t\ttop++;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t/*System.out.println(Arrays.toString(nums));*/\n\t\t}\n\t\tSystem.out.println(nums[0]);\n\n\t}",
"BufferedReader reader = new BufferedReader(new InputStreamReader(\n\t\t\t\tSystem.in));",
"reader",
"new BufferedReader(new InputStreamReader(\n\t\t\t\tSystem.in))",
"String[] strs = reader.readLine().split(\" \");",
"strs",
"reader.readLine().split(\" \")",
"reader.readLine().split",
"reader.readLine()",
"reader.readLine",
"reader",
"\" \"",
"int[] nums = new int[strs.length];",
"nums",
"new int[strs.length]",
"strs.length",
"strs",
"strs.length",
"int top = 0;",
"top",
"0",
"for (int i = 0; i < strs.length; i++) {\n\t\t\tswitch (strs[i].charAt(0)) {\n\t\t\tcase '+':\n\t\t\t\ttop--;\n\t\t\t\tnums[top-1] = nums[top - 1] + nums[top];\n\t\t\t\tbreak;\n\t\t\tcase '-':\n\t\t\t\ttop--;\n\t\t\t\tnums[top-1] = nums[top - 1] - nums[top];\n\t\t\t\tbreak;\n\t\t\tcase '*':\n\t\t\t\ttop--;\n\t\t\t\tnums[top-1] = nums[top - 1] * nums[top];\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t\n\t\t\t\tnums[top] = Integer.parseInt(strs[i]);\n\t\t\t\ttop++;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t/*System.out.println(Arrays.toString(nums));*/\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < strs.length",
"i",
"strs.length",
"strs",
"strs.length",
"i++",
"i++",
"i",
"{\n\t\t\tswitch (strs[i].charAt(0)) {\n\t\t\tcase '+':\n\t\t\t\ttop--;\n\t\t\t\tnums[top-1] = nums[top - 1] + nums[top];\n\t\t\t\tbreak;\n\t\t\tcase '-':\n\t\t\t\ttop--;\n\t\t\t\tnums[top-1] = nums[top - 1] - nums[top];\n\t\t\t\tbreak;\n\t\t\tcase '*':\n\t\t\t\ttop--;\n\t\t\t\tnums[top-1] = nums[top - 1] * nums[top];\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t\n\t\t\t\tnums[top] = Integer.parseInt(strs[i]);\n\t\t\t\ttop++;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t/*System.out.println(Arrays.toString(nums));*/\n\t\t}",
"{\n\t\t\tswitch (strs[i].charAt(0)) {\n\t\t\tcase '+':\n\t\t\t\ttop--;\n\t\t\t\tnums[top-1] = nums[top - 1] + nums[top];\n\t\t\t\tbreak;\n\t\t\tcase '-':\n\t\t\t\ttop--;\n\t\t\t\tnums[top-1] = nums[top - 1] - nums[top];\n\t\t\t\tbreak;\n\t\t\tcase '*':\n\t\t\t\ttop--;\n\t\t\t\tnums[top-1] = nums[top - 1] * nums[top];\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t\n\t\t\t\tnums[top] = Integer.parseInt(strs[i]);\n\t\t\t\ttop++;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t/*System.out.println(Arrays.toString(nums));*/\n\t\t}",
"switch (strs[i].charAt(0)) {\n\t\t\tcase '+':\n\t\t\t\ttop--;\n\t\t\t\tnums[top-1] = nums[top - 1] + nums[top];\n\t\t\t\tbreak;\n\t\t\tcase '-':\n\t\t\t\ttop--;\n\t\t\t\tnums[top-1] = nums[top - 1] - nums[top];\n\t\t\t\tbreak;\n\t\t\tcase '*':\n\t\t\t\ttop--;\n\t\t\t\tnums[top-1] = nums[top - 1] * nums[top];\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t\n\t\t\t\tnums[top] = Integer.parseInt(strs[i]);\n\t\t\t\ttop++;\n\t\t\t\tbreak;\n\t\t\t}",
"strs[i].charAt(0)",
"strs[i].charAt",
"strs[i]",
"strs",
"i",
"0",
"case '+':",
"'+'",
"case '+':",
"top--",
"top",
"nums[top-1] = nums[top - 1] + nums[top]",
"nums[top-1]",
"nums",
"top-1",
"top",
"1",
"nums[top - 1] + nums[top]",
"nums[top - 1]",
"nums",
"top - 1",
"top",
"1",
"nums[top]",
"nums",
"top",
"break;",
"case '-':",
"'-'",
"case '-':",
"top--",
"top",
"nums[top-1] = nums[top - 1] - nums[top]",
"nums[top-1]",
"nums",
"top-1",
"top",
"1",
"nums[top - 1] - nums[top]",
"nums[top - 1]",
"nums",
"top - 1",
"top",
"1",
"nums[top]",
"nums",
"top",
"break;",
"case '*':",
"'*'",
"case '*':",
"top--",
"top",
"nums[top-1] = nums[top - 1] * nums[top]",
"nums[top-1]",
"nums",
"top-1",
"top",
"1",
"nums[top - 1] * nums[top]",
"nums[top - 1]",
"nums",
"top - 1",
"top",
"1",
"nums[top]",
"nums",
"top",
"break;",
"default:",
"default:",
"nums[top] = Integer.parseInt(strs[i])",
"nums[top]",
"nums",
"top",
"Integer.parseInt(strs[i])",
"Integer.parseInt",
"Integer",
"strs[i]",
"strs",
"i",
"top++",
"top",
"break;",
"System.out.println(nums[0])",
"System.out.println",
"System.out",
"System",
"System.out",
"nums[0]",
"nums",
"0",
"String[] args",
"args",
"public class Main {\n\n\tpublic static void main(String[] args) throws NumberFormatException,\n\t\t\tIOException {\n\t\tBufferedReader reader = new BufferedReader(new InputStreamReader(\n\t\t\t\tSystem.in));\n\n\t\tString[] strs = reader.readLine().split(\" \");\n\t\tint[] nums = new int[strs.length];\n\t\tint top = 0;\n\t\tfor (int i = 0; i < strs.length; i++) {\n\t\t\tswitch (strs[i].charAt(0)) {\n\t\t\tcase '+':\n\t\t\t\ttop--;\n\t\t\t\tnums[top-1] = nums[top - 1] + nums[top];\n\t\t\t\tbreak;\n\t\t\tcase '-':\n\t\t\t\ttop--;\n\t\t\t\tnums[top-1] = nums[top - 1] - nums[top];\n\t\t\t\tbreak;\n\t\t\tcase '*':\n\t\t\t\ttop--;\n\t\t\t\tnums[top-1] = nums[top - 1] * nums[top];\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t\n\t\t\t\tnums[top] = Integer.parseInt(strs[i]);\n\t\t\t\ttop++;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t/*System.out.println(Arrays.toString(nums));*/\n\t\t}\n\t\tSystem.out.println(nums[0]);\n\n\t}\n}",
"public class Main {\n\n\tpublic static void main(String[] args) throws NumberFormatException,\n\t\t\tIOException {\n\t\tBufferedReader reader = new BufferedReader(new InputStreamReader(\n\t\t\t\tSystem.in));\n\n\t\tString[] strs = reader.readLine().split(\" \");\n\t\tint[] nums = new int[strs.length];\n\t\tint top = 0;\n\t\tfor (int i = 0; i < strs.length; i++) {\n\t\t\tswitch (strs[i].charAt(0)) {\n\t\t\tcase '+':\n\t\t\t\ttop--;\n\t\t\t\tnums[top-1] = nums[top - 1] + nums[top];\n\t\t\t\tbreak;\n\t\t\tcase '-':\n\t\t\t\ttop--;\n\t\t\t\tnums[top-1] = nums[top - 1] - nums[top];\n\t\t\t\tbreak;\n\t\t\tcase '*':\n\t\t\t\ttop--;\n\t\t\t\tnums[top-1] = nums[top - 1] * nums[top];\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t\n\t\t\t\tnums[top] = Integer.parseInt(strs[i]);\n\t\t\t\ttop++;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t/*System.out.println(Arrays.toString(nums));*/\n\t\t}\n\t\tSystem.out.println(nums[0]);\n\n\t}\n}",
"Main"
] |
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
public class Main {
public static void main(String[] args) throws NumberFormatException,
IOException {
BufferedReader reader = new BufferedReader(new InputStreamReader(
System.in));
String[] strs = reader.readLine().split(" ");
int[] nums = new int[strs.length];
int top = 0;
for (int i = 0; i < strs.length; i++) {
switch (strs[i].charAt(0)) {
case '+':
top--;
nums[top-1] = nums[top - 1] + nums[top];
break;
case '-':
top--;
nums[top-1] = nums[top - 1] - nums[top];
break;
case '*':
top--;
nums[top-1] = nums[top - 1] * nums[top];
break;
default:
nums[top] = Integer.parseInt(strs[i]);
top++;
break;
}
/*System.out.println(Arrays.toString(nums));*/
}
System.out.println(nums[0]);
}
} |
[
7,
15,
13,
17,
6,
13,
41,
13,
20,
41,
13,
17,
41,
13,
20,
13,
41,
13,
12,
13,
30,
4,
13,
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,
14,
4,
18,
18,
13,
13,
17,
30,
41,
13,
4,
13,
41,
13,
4,
13,
0,
13,
2,
13,
13,
4,
13,
13,
14,
4,
18,
18,
13,
13,
17,
30,
41,
13,
4,
13,
41,
13,
4,
13,
0,
13,
2,
13,
13,
4,
13,
13,
14,
4,
18,
18,
13,
13,
17,
30,
41,
13,
4,
13,
41,
13,
4,
13,
0,
13,
2,
13,
13,
4,
13,
13,
30,
41,
13,
4,
18,
13,
18,
13,
13,
4,
13,
13,
4,
18,
18,
13,
13,
17,
18,
13,
17,
23,
13,
12,
13,
30,
0,
13,
17,
12,
13,
30,
29,
2,
13,
17,
12,
13,
30,
29,
2,
13,
2,
13,
17,
12,
13,
30,
14,
4,
13,
4,
18,
18,
13,
13,
17,
17,
40,
13,
0,
18,
13,
13,
13,
23,
13,
12,
13,
30,
14,
4,
13,
4,
18,
18,
13,
13,
17,
17,
40,
13,
29,
18,
13,
2,
13,
17,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
212,
5
],
[
212,
6
],
[
6,
7
],
[
6,
8
],
[
212,
9
],
[
9,
10
],
[
9,
11
],
[
212,
12
],
[
12,
13
],
[
12,
14
],
[
212,
16
],
[
16,
17
],
[
212,
18
],
[
18,
19
],
[
18,
20
],
[
20,
21
],
[
21,
22
],
[
20,
23
],
[
23,
24
],
[
24,
25
],
[
25,
26
],
[
23,
27
],
[
27,
28
],
[
28,
29
],
[
28,
30
],
[
30,
31
],
[
31,
32
],
[
32,
33
],
[
33,
34
],
[
30,
35
],
[
27,
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
],
[
53,
54
],
[
54,
55
],
[
54,
56
],
[
52,
57
],
[
51,
58
],
[
58,
59
],
[
59,
60
],
[
59,
61
],
[
61,
62
],
[
58,
63
],
[
63,
64
],
[
63,
65
],
[
65,
66
],
[
58,
67
],
[
67,
68
],
[
67,
69
],
[
69,
70
],
[
69,
71
],
[
58,
72
],
[
72,
73
],
[
72,
74
],
[
51,
75
],
[
75,
76
],
[
76,
77
],
[
77,
78
],
[
78,
79
],
[
78,
80
],
[
76,
81
],
[
75,
82
],
[
82,
83
],
[
83,
84
],
[
83,
85
],
[
85,
86
],
[
82,
87
],
[
87,
88
],
[
87,
89
],
[
89,
90
],
[
82,
91
],
[
91,
92
],
[
91,
93
],
[
93,
94
],
[
93,
95
],
[
82,
96
],
[
96,
97
],
[
96,
98
],
[
75,
99
],
[
99,
100
],
[
100,
101
],
[
101,
102
],
[
102,
103
],
[
102,
104
],
[
100,
105
],
[
99,
106
],
[
106,
107
],
[
107,
108
],
[
107,
109
],
[
109,
110
],
[
106,
111
],
[
111,
112
],
[
111,
113
],
[
113,
114
],
[
106,
115
],
[
115,
116
],
[
115,
117
],
[
117,
118
],
[
117,
119
],
[
106,
120
],
[
120,
121
],
[
120,
122
],
[
99,
123
],
[
123,
124
],
[
124,
125
],
[
124,
126
],
[
126,
127
],
[
127,
128
],
[
126,
129
],
[
129,
130
],
[
129,
131
],
[
123,
132
],
[
132,
133
],
[
132,
134
],
[
27,
135
],
[
135,
136
],
[
136,
137
],
[
137,
138
],
[
137,
139
],
[
135,
140
],
[
135,
141
],
[
141,
142
],
[
141,
143
],
[
18,
144
],
[
144,
145
],
[
212,
146
],
[
146,
147
],
[
146,
148
],
[
148,
149
],
[
149,
150
],
[
149,
151
],
[
212,
152
],
[
152,
153
],
[
152,
154
],
[
154,
155
],
[
155,
156
],
[
156,
157
],
[
156,
158
],
[
212,
159
],
[
159,
160
],
[
159,
161
],
[
161,
162
],
[
162,
163
],
[
163,
164
],
[
163,
165
],
[
165,
166
],
[
165,
167
],
[
212,
168
],
[
168,
169
],
[
168,
170
],
[
170,
171
],
[
171,
172
],
[
172,
173
],
[
171,
174
],
[
174,
175
],
[
175,
176
],
[
176,
177
],
[
176,
178
],
[
174,
179
],
[
174,
180
],
[
170,
181
],
[
181,
182
],
[
170,
183
],
[
183,
184
],
[
184,
185
],
[
184,
186
],
[
183,
187
],
[
168,
188
],
[
188,
189
],
[
212,
190
],
[
190,
191
],
[
190,
192
],
[
192,
193
],
[
193,
194
],
[
194,
195
],
[
193,
196
],
[
196,
197
],
[
197,
198
],
[
198,
199
],
[
198,
200
],
[
196,
201
],
[
196,
202
],
[
192,
203
],
[
203,
204
],
[
192,
205
],
[
205,
206
],
[
206,
207
],
[
206,
208
],
[
208,
209
],
[
208,
210
],
[
0,
211
],
[
211,
212
],
[
211,
213
]
] | [
"import java.util.*;\n\npublic class Main{\n\tprivate static final Scanner scan = new Scanner(System.in);\n\tprivate static final int MAX = 101;\n\tprivate static int[] st = new int[MAX];\n\tprivate static int top;\n\n\tpublic static void main(String[] args){\n\n\t\tinitialize();\n\t\twhile(scan.hasNext()){\n\t\t\tString[] cmd = scan.nextLine().split(\" \");\n\t\t\tfor(int i = 0; i < cmd.length; i++){\n\t\t\t\tif(cmd[i].equals(\"+\")){\n\t\t\t\t\tint n2 = pop();\n\t\t\t\t\tint n3 = pop();\n\t\t\t\t\tn2 = n3 + n2;\n\t\t\t\t\tpush(n2);\n\t\t\t\t}else if(cmd[i].equals(\"-\")){\n\t\t\t\t\tint n2 = pop();\n\t\t\t\t\tint n3 = pop();\n\t\t\t\t\tn2 = n3 - n2;\n\t\t\t\t\tpush(n2);\n\t\t\t\t}else if(cmd[i].equals(\"*\")){\n\t\t\t\t\tint n2 = pop();\n\t\t\t\t\tint n3 = pop();\n\t\t\t\t\tn2 = n3 * n2;\n\t\t\t\t\tpush(n2);\n\t\t\t\t}else{\n\t\t\t\t\tint n = Integer.parseInt(cmd[i]);\n\t\t\t\t\tpush(n);\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.printf(\"%d\\n\", st[1]);\n\t\t}\n\t}\n\n\tpublic static void initialize(){\n\t\ttop = 0;\n\t}\n\tprivate static boolean isEmpty(){\n\t\treturn top == 0;\n\t}\n\tprivate static boolean isFull(){\n\t\treturn top >= MAX - 1;\n\t}\n\tpublic static void push(int x){\n\t\tif(isFull())\n\t\t\tSystem.out.printf(\"%s\\n\", \"???????????????????????§???\");\n\t\ttop++;\n\t\tst[top] = x;\n\t}\n\tpublic static int pop(){\n\t\tif(isEmpty())\n\t\t\tSystem.out.printf(\"%s\\n\", \"??¢????????????????????§???\");\n\t\ttop--;\n\t\treturn st[top+1];\n\t}\n}",
"import java.util.*;",
"util.*",
"java",
"public class Main{\n\tprivate static final Scanner scan = new Scanner(System.in);\n\tprivate static final int MAX = 101;\n\tprivate static int[] st = new int[MAX];\n\tprivate static int top;\n\n\tpublic static void main(String[] args){\n\n\t\tinitialize();\n\t\twhile(scan.hasNext()){\n\t\t\tString[] cmd = scan.nextLine().split(\" \");\n\t\t\tfor(int i = 0; i < cmd.length; i++){\n\t\t\t\tif(cmd[i].equals(\"+\")){\n\t\t\t\t\tint n2 = pop();\n\t\t\t\t\tint n3 = pop();\n\t\t\t\t\tn2 = n3 + n2;\n\t\t\t\t\tpush(n2);\n\t\t\t\t}else if(cmd[i].equals(\"-\")){\n\t\t\t\t\tint n2 = pop();\n\t\t\t\t\tint n3 = pop();\n\t\t\t\t\tn2 = n3 - n2;\n\t\t\t\t\tpush(n2);\n\t\t\t\t}else if(cmd[i].equals(\"*\")){\n\t\t\t\t\tint n2 = pop();\n\t\t\t\t\tint n3 = pop();\n\t\t\t\t\tn2 = n3 * n2;\n\t\t\t\t\tpush(n2);\n\t\t\t\t}else{\n\t\t\t\t\tint n = Integer.parseInt(cmd[i]);\n\t\t\t\t\tpush(n);\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.printf(\"%d\\n\", st[1]);\n\t\t}\n\t}\n\n\tpublic static void initialize(){\n\t\ttop = 0;\n\t}\n\tprivate static boolean isEmpty(){\n\t\treturn top == 0;\n\t}\n\tprivate static boolean isFull(){\n\t\treturn top >= MAX - 1;\n\t}\n\tpublic static void push(int x){\n\t\tif(isFull())\n\t\t\tSystem.out.printf(\"%s\\n\", \"???????????????????????§???\");\n\t\ttop++;\n\t\tst[top] = x;\n\t}\n\tpublic static int pop(){\n\t\tif(isEmpty())\n\t\t\tSystem.out.printf(\"%s\\n\", \"??¢????????????????????§???\");\n\t\ttop--;\n\t\treturn st[top+1];\n\t}\n}",
"Main",
"private static final Scanner scan = new Scanner(System.in);",
"scan",
"new Scanner(System.in)",
"private static final int MAX = 101;",
"MAX",
"101",
"private static int[] st = new int[MAX];",
"st",
"new int[MAX]",
"MAX",
"private static int top;",
"top",
"public static void main(String[] args){\n\n\t\tinitialize();\n\t\twhile(scan.hasNext()){\n\t\t\tString[] cmd = scan.nextLine().split(\" \");\n\t\t\tfor(int i = 0; i < cmd.length; i++){\n\t\t\t\tif(cmd[i].equals(\"+\")){\n\t\t\t\t\tint n2 = pop();\n\t\t\t\t\tint n3 = pop();\n\t\t\t\t\tn2 = n3 + n2;\n\t\t\t\t\tpush(n2);\n\t\t\t\t}else if(cmd[i].equals(\"-\")){\n\t\t\t\t\tint n2 = pop();\n\t\t\t\t\tint n3 = pop();\n\t\t\t\t\tn2 = n3 - n2;\n\t\t\t\t\tpush(n2);\n\t\t\t\t}else if(cmd[i].equals(\"*\")){\n\t\t\t\t\tint n2 = pop();\n\t\t\t\t\tint n3 = pop();\n\t\t\t\t\tn2 = n3 * n2;\n\t\t\t\t\tpush(n2);\n\t\t\t\t}else{\n\t\t\t\t\tint n = Integer.parseInt(cmd[i]);\n\t\t\t\t\tpush(n);\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.printf(\"%d\\n\", st[1]);\n\t\t}\n\t}",
"main",
"{\n\n\t\tinitialize();\n\t\twhile(scan.hasNext()){\n\t\t\tString[] cmd = scan.nextLine().split(\" \");\n\t\t\tfor(int i = 0; i < cmd.length; i++){\n\t\t\t\tif(cmd[i].equals(\"+\")){\n\t\t\t\t\tint n2 = pop();\n\t\t\t\t\tint n3 = pop();\n\t\t\t\t\tn2 = n3 + n2;\n\t\t\t\t\tpush(n2);\n\t\t\t\t}else if(cmd[i].equals(\"-\")){\n\t\t\t\t\tint n2 = pop();\n\t\t\t\t\tint n3 = pop();\n\t\t\t\t\tn2 = n3 - n2;\n\t\t\t\t\tpush(n2);\n\t\t\t\t}else if(cmd[i].equals(\"*\")){\n\t\t\t\t\tint n2 = pop();\n\t\t\t\t\tint n3 = pop();\n\t\t\t\t\tn2 = n3 * n2;\n\t\t\t\t\tpush(n2);\n\t\t\t\t}else{\n\t\t\t\t\tint n = Integer.parseInt(cmd[i]);\n\t\t\t\t\tpush(n);\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.printf(\"%d\\n\", st[1]);\n\t\t}\n\t}",
"initialize()",
"initialize",
"while(scan.hasNext()){\n\t\t\tString[] cmd = scan.nextLine().split(\" \");\n\t\t\tfor(int i = 0; i < cmd.length; i++){\n\t\t\t\tif(cmd[i].equals(\"+\")){\n\t\t\t\t\tint n2 = pop();\n\t\t\t\t\tint n3 = pop();\n\t\t\t\t\tn2 = n3 + n2;\n\t\t\t\t\tpush(n2);\n\t\t\t\t}else if(cmd[i].equals(\"-\")){\n\t\t\t\t\tint n2 = pop();\n\t\t\t\t\tint n3 = pop();\n\t\t\t\t\tn2 = n3 - n2;\n\t\t\t\t\tpush(n2);\n\t\t\t\t}else if(cmd[i].equals(\"*\")){\n\t\t\t\t\tint n2 = pop();\n\t\t\t\t\tint n3 = pop();\n\t\t\t\t\tn2 = n3 * n2;\n\t\t\t\t\tpush(n2);\n\t\t\t\t}else{\n\t\t\t\t\tint n = Integer.parseInt(cmd[i]);\n\t\t\t\t\tpush(n);\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.printf(\"%d\\n\", st[1]);\n\t\t}",
"scan.hasNext()",
"scan.hasNext",
"scan",
"{\n\t\t\tString[] cmd = scan.nextLine().split(\" \");\n\t\t\tfor(int i = 0; i < cmd.length; i++){\n\t\t\t\tif(cmd[i].equals(\"+\")){\n\t\t\t\t\tint n2 = pop();\n\t\t\t\t\tint n3 = pop();\n\t\t\t\t\tn2 = n3 + n2;\n\t\t\t\t\tpush(n2);\n\t\t\t\t}else if(cmd[i].equals(\"-\")){\n\t\t\t\t\tint n2 = pop();\n\t\t\t\t\tint n3 = pop();\n\t\t\t\t\tn2 = n3 - n2;\n\t\t\t\t\tpush(n2);\n\t\t\t\t}else if(cmd[i].equals(\"*\")){\n\t\t\t\t\tint n2 = pop();\n\t\t\t\t\tint n3 = pop();\n\t\t\t\t\tn2 = n3 * n2;\n\t\t\t\t\tpush(n2);\n\t\t\t\t}else{\n\t\t\t\t\tint n = Integer.parseInt(cmd[i]);\n\t\t\t\t\tpush(n);\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.printf(\"%d\\n\", st[1]);\n\t\t}",
"String[] cmd = scan.nextLine().split(\" \");",
"cmd",
"scan.nextLine().split(\" \")",
"scan.nextLine().split",
"scan.nextLine()",
"scan.nextLine",
"scan",
"\" \"",
"for(int i = 0; i < cmd.length; i++){\n\t\t\t\tif(cmd[i].equals(\"+\")){\n\t\t\t\t\tint n2 = pop();\n\t\t\t\t\tint n3 = pop();\n\t\t\t\t\tn2 = n3 + n2;\n\t\t\t\t\tpush(n2);\n\t\t\t\t}else if(cmd[i].equals(\"-\")){\n\t\t\t\t\tint n2 = pop();\n\t\t\t\t\tint n3 = pop();\n\t\t\t\t\tn2 = n3 - n2;\n\t\t\t\t\tpush(n2);\n\t\t\t\t}else if(cmd[i].equals(\"*\")){\n\t\t\t\t\tint n2 = pop();\n\t\t\t\t\tint n3 = pop();\n\t\t\t\t\tn2 = n3 * n2;\n\t\t\t\t\tpush(n2);\n\t\t\t\t}else{\n\t\t\t\t\tint n = Integer.parseInt(cmd[i]);\n\t\t\t\t\tpush(n);\n\t\t\t\t}\n\t\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < cmd.length",
"i",
"cmd.length",
"cmd",
"cmd.length",
"i++",
"i++",
"i",
"{\n\t\t\t\tif(cmd[i].equals(\"+\")){\n\t\t\t\t\tint n2 = pop();\n\t\t\t\t\tint n3 = pop();\n\t\t\t\t\tn2 = n3 + n2;\n\t\t\t\t\tpush(n2);\n\t\t\t\t}else if(cmd[i].equals(\"-\")){\n\t\t\t\t\tint n2 = pop();\n\t\t\t\t\tint n3 = pop();\n\t\t\t\t\tn2 = n3 - n2;\n\t\t\t\t\tpush(n2);\n\t\t\t\t}else if(cmd[i].equals(\"*\")){\n\t\t\t\t\tint n2 = pop();\n\t\t\t\t\tint n3 = pop();\n\t\t\t\t\tn2 = n3 * n2;\n\t\t\t\t\tpush(n2);\n\t\t\t\t}else{\n\t\t\t\t\tint n = Integer.parseInt(cmd[i]);\n\t\t\t\t\tpush(n);\n\t\t\t\t}\n\t\t\t}",
"{\n\t\t\t\tif(cmd[i].equals(\"+\")){\n\t\t\t\t\tint n2 = pop();\n\t\t\t\t\tint n3 = pop();\n\t\t\t\t\tn2 = n3 + n2;\n\t\t\t\t\tpush(n2);\n\t\t\t\t}else if(cmd[i].equals(\"-\")){\n\t\t\t\t\tint n2 = pop();\n\t\t\t\t\tint n3 = pop();\n\t\t\t\t\tn2 = n3 - n2;\n\t\t\t\t\tpush(n2);\n\t\t\t\t}else if(cmd[i].equals(\"*\")){\n\t\t\t\t\tint n2 = pop();\n\t\t\t\t\tint n3 = pop();\n\t\t\t\t\tn2 = n3 * n2;\n\t\t\t\t\tpush(n2);\n\t\t\t\t}else{\n\t\t\t\t\tint n = Integer.parseInt(cmd[i]);\n\t\t\t\t\tpush(n);\n\t\t\t\t}\n\t\t\t}",
"if(cmd[i].equals(\"+\")){\n\t\t\t\t\tint n2 = pop();\n\t\t\t\t\tint n3 = pop();\n\t\t\t\t\tn2 = n3 + n2;\n\t\t\t\t\tpush(n2);\n\t\t\t\t}else if(cmd[i].equals(\"-\")){\n\t\t\t\t\tint n2 = pop();\n\t\t\t\t\tint n3 = pop();\n\t\t\t\t\tn2 = n3 - n2;\n\t\t\t\t\tpush(n2);\n\t\t\t\t}else if(cmd[i].equals(\"*\")){\n\t\t\t\t\tint n2 = pop();\n\t\t\t\t\tint n3 = pop();\n\t\t\t\t\tn2 = n3 * n2;\n\t\t\t\t\tpush(n2);\n\t\t\t\t}else{\n\t\t\t\t\tint n = Integer.parseInt(cmd[i]);\n\t\t\t\t\tpush(n);\n\t\t\t\t}",
"cmd[i].equals(\"+\")",
"cmd[i].equals",
"cmd[i]",
"cmd",
"i",
"\"+\"",
"{\n\t\t\t\t\tint n2 = pop();\n\t\t\t\t\tint n3 = pop();\n\t\t\t\t\tn2 = n3 + n2;\n\t\t\t\t\tpush(n2);\n\t\t\t\t}",
"int n2 = pop();",
"n2",
"pop()",
"pop",
"int n3 = pop();",
"n3",
"pop()",
"pop",
"n2 = n3 + n2",
"n2",
"n3 + n2",
"n3",
"n2",
"push(n2)",
"push",
"n2",
"if(cmd[i].equals(\"-\")){\n\t\t\t\t\tint n2 = pop();\n\t\t\t\t\tint n3 = pop();\n\t\t\t\t\tn2 = n3 - n2;\n\t\t\t\t\tpush(n2);\n\t\t\t\t}else if(cmd[i].equals(\"*\")){\n\t\t\t\t\tint n2 = pop();\n\t\t\t\t\tint n3 = pop();\n\t\t\t\t\tn2 = n3 * n2;\n\t\t\t\t\tpush(n2);\n\t\t\t\t}else{\n\t\t\t\t\tint n = Integer.parseInt(cmd[i]);\n\t\t\t\t\tpush(n);\n\t\t\t\t}",
"cmd[i].equals(\"-\")",
"cmd[i].equals",
"cmd[i]",
"cmd",
"i",
"\"-\"",
"{\n\t\t\t\t\tint n2 = pop();\n\t\t\t\t\tint n3 = pop();\n\t\t\t\t\tn2 = n3 - n2;\n\t\t\t\t\tpush(n2);\n\t\t\t\t}",
"int n2 = pop();",
"n2",
"pop()",
"pop",
"int n3 = pop();",
"n3",
"pop()",
"pop",
"n2 = n3 - n2",
"n2",
"n3 - n2",
"n3",
"n2",
"push(n2)",
"push",
"n2",
"if(cmd[i].equals(\"*\")){\n\t\t\t\t\tint n2 = pop();\n\t\t\t\t\tint n3 = pop();\n\t\t\t\t\tn2 = n3 * n2;\n\t\t\t\t\tpush(n2);\n\t\t\t\t}else{\n\t\t\t\t\tint n = Integer.parseInt(cmd[i]);\n\t\t\t\t\tpush(n);\n\t\t\t\t}",
"cmd[i].equals(\"*\")",
"cmd[i].equals",
"cmd[i]",
"cmd",
"i",
"\"*\"",
"{\n\t\t\t\t\tint n2 = pop();\n\t\t\t\t\tint n3 = pop();\n\t\t\t\t\tn2 = n3 * n2;\n\t\t\t\t\tpush(n2);\n\t\t\t\t}",
"int n2 = pop();",
"n2",
"pop()",
"pop",
"int n3 = pop();",
"n3",
"pop()",
"pop",
"n2 = n3 * n2",
"n2",
"n3 * n2",
"n3",
"n2",
"push(n2)",
"push",
"n2",
"{\n\t\t\t\t\tint n = Integer.parseInt(cmd[i]);\n\t\t\t\t\tpush(n);\n\t\t\t\t}",
"int n = Integer.parseInt(cmd[i]);",
"n",
"Integer.parseInt(cmd[i])",
"Integer.parseInt",
"Integer",
"cmd[i]",
"cmd",
"i",
"push(n)",
"push",
"n",
"System.out.printf(\"%d\\n\", st[1])",
"System.out.printf",
"System.out",
"System",
"System.out",
"\"%d\\n\"",
"st[1]",
"st",
"1",
"String[] args",
"args",
"public static void initialize(){\n\t\ttop = 0;\n\t}",
"initialize",
"{\n\t\ttop = 0;\n\t}",
"top = 0",
"top",
"0",
"private static boolean isEmpty(){\n\t\treturn top == 0;\n\t}",
"isEmpty",
"{\n\t\treturn top == 0;\n\t}",
"return top == 0;",
"top == 0",
"top",
"0",
"private static boolean isFull(){\n\t\treturn top >= MAX - 1;\n\t}",
"isFull",
"{\n\t\treturn top >= MAX - 1;\n\t}",
"return top >= MAX - 1;",
"top >= MAX - 1",
"top",
"MAX - 1",
"MAX",
"1",
"public static void push(int x){\n\t\tif(isFull())\n\t\t\tSystem.out.printf(\"%s\\n\", \"???????????????????????§???\");\n\t\ttop++;\n\t\tst[top] = x;\n\t}",
"push",
"{\n\t\tif(isFull())\n\t\t\tSystem.out.printf(\"%s\\n\", \"???????????????????????§???\");\n\t\ttop++;\n\t\tst[top] = x;\n\t}",
"if(isFull())\n\t\t\tSystem.out.printf(\"%s\\n\", \"???????????????????????§???\");",
"isFull()",
"isFull",
"System.out.printf(\"%s\\n\", \"???????????????????????§???\")",
"System.out.printf",
"System.out",
"System",
"System.out",
"\"%s\\n\"",
"\"???????????????????????§???\"",
"top++",
"top",
"st[top] = x",
"st[top]",
"st",
"top",
"x",
"int x",
"x",
"public static int pop(){\n\t\tif(isEmpty())\n\t\t\tSystem.out.printf(\"%s\\n\", \"??¢????????????????????§???\");\n\t\ttop--;\n\t\treturn st[top+1];\n\t}",
"pop",
"{\n\t\tif(isEmpty())\n\t\t\tSystem.out.printf(\"%s\\n\", \"??¢????????????????????§???\");\n\t\ttop--;\n\t\treturn st[top+1];\n\t}",
"if(isEmpty())\n\t\t\tSystem.out.printf(\"%s\\n\", \"??¢????????????????????§???\");",
"isEmpty()",
"isEmpty",
"System.out.printf(\"%s\\n\", \"??¢????????????????????§???\")",
"System.out.printf",
"System.out",
"System",
"System.out",
"\"%s\\n\"",
"\"??¢????????????????????§???\"",
"top--",
"top",
"return st[top+1];",
"st[top+1]",
"st",
"top+1",
"top",
"1",
"public class Main{\n\tprivate static final Scanner scan = new Scanner(System.in);\n\tprivate static final int MAX = 101;\n\tprivate static int[] st = new int[MAX];\n\tprivate static int top;\n\n\tpublic static void main(String[] args){\n\n\t\tinitialize();\n\t\twhile(scan.hasNext()){\n\t\t\tString[] cmd = scan.nextLine().split(\" \");\n\t\t\tfor(int i = 0; i < cmd.length; i++){\n\t\t\t\tif(cmd[i].equals(\"+\")){\n\t\t\t\t\tint n2 = pop();\n\t\t\t\t\tint n3 = pop();\n\t\t\t\t\tn2 = n3 + n2;\n\t\t\t\t\tpush(n2);\n\t\t\t\t}else if(cmd[i].equals(\"-\")){\n\t\t\t\t\tint n2 = pop();\n\t\t\t\t\tint n3 = pop();\n\t\t\t\t\tn2 = n3 - n2;\n\t\t\t\t\tpush(n2);\n\t\t\t\t}else if(cmd[i].equals(\"*\")){\n\t\t\t\t\tint n2 = pop();\n\t\t\t\t\tint n3 = pop();\n\t\t\t\t\tn2 = n3 * n2;\n\t\t\t\t\tpush(n2);\n\t\t\t\t}else{\n\t\t\t\t\tint n = Integer.parseInt(cmd[i]);\n\t\t\t\t\tpush(n);\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.printf(\"%d\\n\", st[1]);\n\t\t}\n\t}\n\n\tpublic static void initialize(){\n\t\ttop = 0;\n\t}\n\tprivate static boolean isEmpty(){\n\t\treturn top == 0;\n\t}\n\tprivate static boolean isFull(){\n\t\treturn top >= MAX - 1;\n\t}\n\tpublic static void push(int x){\n\t\tif(isFull())\n\t\t\tSystem.out.printf(\"%s\\n\", \"???????????????????????§???\");\n\t\ttop++;\n\t\tst[top] = x;\n\t}\n\tpublic static int pop(){\n\t\tif(isEmpty())\n\t\t\tSystem.out.printf(\"%s\\n\", \"??¢????????????????????§???\");\n\t\ttop--;\n\t\treturn st[top+1];\n\t}\n}",
"public class Main{\n\tprivate static final Scanner scan = new Scanner(System.in);\n\tprivate static final int MAX = 101;\n\tprivate static int[] st = new int[MAX];\n\tprivate static int top;\n\n\tpublic static void main(String[] args){\n\n\t\tinitialize();\n\t\twhile(scan.hasNext()){\n\t\t\tString[] cmd = scan.nextLine().split(\" \");\n\t\t\tfor(int i = 0; i < cmd.length; i++){\n\t\t\t\tif(cmd[i].equals(\"+\")){\n\t\t\t\t\tint n2 = pop();\n\t\t\t\t\tint n3 = pop();\n\t\t\t\t\tn2 = n3 + n2;\n\t\t\t\t\tpush(n2);\n\t\t\t\t}else if(cmd[i].equals(\"-\")){\n\t\t\t\t\tint n2 = pop();\n\t\t\t\t\tint n3 = pop();\n\t\t\t\t\tn2 = n3 - n2;\n\t\t\t\t\tpush(n2);\n\t\t\t\t}else if(cmd[i].equals(\"*\")){\n\t\t\t\t\tint n2 = pop();\n\t\t\t\t\tint n3 = pop();\n\t\t\t\t\tn2 = n3 * n2;\n\t\t\t\t\tpush(n2);\n\t\t\t\t}else{\n\t\t\t\t\tint n = Integer.parseInt(cmd[i]);\n\t\t\t\t\tpush(n);\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.printf(\"%d\\n\", st[1]);\n\t\t}\n\t}\n\n\tpublic static void initialize(){\n\t\ttop = 0;\n\t}\n\tprivate static boolean isEmpty(){\n\t\treturn top == 0;\n\t}\n\tprivate static boolean isFull(){\n\t\treturn top >= MAX - 1;\n\t}\n\tpublic static void push(int x){\n\t\tif(isFull())\n\t\t\tSystem.out.printf(\"%s\\n\", \"???????????????????????§???\");\n\t\ttop++;\n\t\tst[top] = x;\n\t}\n\tpublic static int pop(){\n\t\tif(isEmpty())\n\t\t\tSystem.out.printf(\"%s\\n\", \"??¢????????????????????§???\");\n\t\ttop--;\n\t\treturn st[top+1];\n\t}\n}",
"Main"
] | import java.util.*;
public class Main{
private static final Scanner scan = new Scanner(System.in);
private static final int MAX = 101;
private static int[] st = new int[MAX];
private static int top;
public static void main(String[] args){
initialize();
while(scan.hasNext()){
String[] cmd = scan.nextLine().split(" ");
for(int i = 0; i < cmd.length; i++){
if(cmd[i].equals("+")){
int n2 = pop();
int n3 = pop();
n2 = n3 + n2;
push(n2);
}else if(cmd[i].equals("-")){
int n2 = pop();
int n3 = pop();
n2 = n3 - n2;
push(n2);
}else if(cmd[i].equals("*")){
int n2 = pop();
int n3 = pop();
n2 = n3 * n2;
push(n2);
}else{
int n = Integer.parseInt(cmd[i]);
push(n);
}
}
System.out.printf("%d\n", st[1]);
}
}
public static void initialize(){
top = 0;
}
private static boolean isEmpty(){
return top == 0;
}
private static boolean isFull(){
return top >= MAX - 1;
}
public static void push(int x){
if(isFull())
System.out.printf("%s\n", "???????????????????????§???");
top++;
st[top] = x;
}
public static int pop(){
if(isEmpty())
System.out.printf("%s\n", "??¢????????????????????§???");
top--;
return st[top+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,
41,
13,
41,
13,
35,
13,
34,
17,
1,
0,
13,
4,
18,
13,
0,
13,
4,
18,
13,
4,
18,
13,
2,
2,
4,
18,
13,
13,
4,
18,
13,
13,
17,
3,
34,
17,
1,
0,
13,
4,
18,
13,
0,
13,
4,
18,
13,
4,
18,
13,
2,
2,
4,
18,
13,
13,
4,
18,
13,
13,
17,
3,
34,
17,
1,
0,
13,
4,
18,
13,
0,
13,
4,
18,
13,
4,
18,
13,
2,
2,
4,
18,
13,
13,
4,
18,
13,
13,
17,
3,
34,
17,
1,
0,
13,
4,
18,
13,
0,
13,
4,
18,
13,
4,
18,
13,
2,
2,
4,
18,
13,
13,
4,
18,
13,
13,
17,
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
],
[
161,
5
],
[
161,
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
],
[
19,
27
],
[
27,
28
],
[
19,
29
],
[
29,
30
],
[
29,
31
],
[
31,
32
],
[
31,
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
],
[
48,
49
],
[
49,
50
],
[
50,
51
],
[
49,
52
],
[
48,
53
],
[
53,
54
],
[
54,
55
],
[
53,
56
],
[
47,
57
],
[
33,
58
],
[
29,
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
],
[
76,
77
],
[
77,
78
],
[
78,
79
],
[
77,
80
],
[
76,
81
],
[
81,
82
],
[
82,
83
],
[
81,
84
],
[
75,
85
],
[
61,
86
],
[
29,
87
],
[
87,
88
],
[
87,
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
],
[
104,
105
],
[
105,
106
],
[
106,
107
],
[
105,
108
],
[
104,
109
],
[
109,
110
],
[
110,
111
],
[
109,
112
],
[
103,
113
],
[
89,
114
],
[
29,
115
],
[
115,
116
],
[
115,
117
],
[
117,
118
],
[
118,
119
],
[
118,
120
],
[
120,
121
],
[
121,
122
],
[
117,
123
],
[
123,
124
],
[
123,
125
],
[
125,
126
],
[
126,
127
],
[
117,
128
],
[
128,
129
],
[
129,
130
],
[
128,
131
],
[
131,
132
],
[
132,
133
],
[
133,
134
],
[
134,
135
],
[
133,
136
],
[
132,
137
],
[
137,
138
],
[
138,
139
],
[
137,
140
],
[
131,
141
],
[
117,
142
],
[
29,
143
],
[
143,
144
],
[
144,
145
],
[
145,
146
],
[
146,
147
],
[
145,
148
],
[
144,
149
],
[
8,
150
],
[
150,
151
],
[
151,
152
],
[
152,
153
],
[
152,
154
],
[
150,
155
],
[
155,
156
],
[
156,
157
],
[
6,
158
],
[
158,
159
],
[
0,
160
],
[
160,
161
],
[
160,
162
]
] | [
"import java.util.*;\npublic class Main{\n public static void main(String[] args) {\n Scanner sc =new Scanner(System.in);\n Stack<String> st=new Stack<String>();\n while(sc.hasNext()){\n \n String input=sc.next();\n //if(input.equals(\"-1\")) break;\n String a,b;\n switch (input) {\n case \"+\":\n a=st.pop();\n b=st.pop();\n st.push((Integer.parseInt(b)+Integer.parseInt(a))+\"\");\n break;\n case \"-\":\n a=st.pop();\n b=st.pop();\n st.push((Integer.parseInt(b)-Integer.parseInt(a))+\"\");\n break;\n case \"*\":\n a=st.pop();\n b=st.pop();\n st.push((Integer.parseInt(b)*Integer.parseInt(a))+\"\");\n break;\n case \"/\":\n a=st.pop();\n b=st.pop();\n st.push((Integer.parseInt(b)/Integer.parseInt(a))+\"\");\n break;\n default:\n st.push(input);\n break;\n }\n }\n System.out.println(st.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 Stack<String> st=new Stack<String>();\n while(sc.hasNext()){\n \n String input=sc.next();\n //if(input.equals(\"-1\")) break;\n String a,b;\n switch (input) {\n case \"+\":\n a=st.pop();\n b=st.pop();\n st.push((Integer.parseInt(b)+Integer.parseInt(a))+\"\");\n break;\n case \"-\":\n a=st.pop();\n b=st.pop();\n st.push((Integer.parseInt(b)-Integer.parseInt(a))+\"\");\n break;\n case \"*\":\n a=st.pop();\n b=st.pop();\n st.push((Integer.parseInt(b)*Integer.parseInt(a))+\"\");\n break;\n case \"/\":\n a=st.pop();\n b=st.pop();\n st.push((Integer.parseInt(b)/Integer.parseInt(a))+\"\");\n break;\n default:\n st.push(input);\n break;\n }\n }\n System.out.println(st.pop());\n }\n}",
"Main",
"public static void main(String[] args) {\n Scanner sc =new Scanner(System.in);\n Stack<String> st=new Stack<String>();\n while(sc.hasNext()){\n \n String input=sc.next();\n //if(input.equals(\"-1\")) break;\n String a,b;\n switch (input) {\n case \"+\":\n a=st.pop();\n b=st.pop();\n st.push((Integer.parseInt(b)+Integer.parseInt(a))+\"\");\n break;\n case \"-\":\n a=st.pop();\n b=st.pop();\n st.push((Integer.parseInt(b)-Integer.parseInt(a))+\"\");\n break;\n case \"*\":\n a=st.pop();\n b=st.pop();\n st.push((Integer.parseInt(b)*Integer.parseInt(a))+\"\");\n break;\n case \"/\":\n a=st.pop();\n b=st.pop();\n st.push((Integer.parseInt(b)/Integer.parseInt(a))+\"\");\n break;\n default:\n st.push(input);\n break;\n }\n }\n System.out.println(st.pop());\n }",
"main",
"{\n Scanner sc =new Scanner(System.in);\n Stack<String> st=new Stack<String>();\n while(sc.hasNext()){\n \n String input=sc.next();\n //if(input.equals(\"-1\")) break;\n String a,b;\n switch (input) {\n case \"+\":\n a=st.pop();\n b=st.pop();\n st.push((Integer.parseInt(b)+Integer.parseInt(a))+\"\");\n break;\n case \"-\":\n a=st.pop();\n b=st.pop();\n st.push((Integer.parseInt(b)-Integer.parseInt(a))+\"\");\n break;\n case \"*\":\n a=st.pop();\n b=st.pop();\n st.push((Integer.parseInt(b)*Integer.parseInt(a))+\"\");\n break;\n case \"/\":\n a=st.pop();\n b=st.pop();\n st.push((Integer.parseInt(b)/Integer.parseInt(a))+\"\");\n break;\n default:\n st.push(input);\n break;\n }\n }\n System.out.println(st.pop());\n }",
"Scanner sc =new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"Stack<String> st=new Stack<String>();",
"st",
"new Stack<String>()",
"while(sc.hasNext()){\n \n String input=sc.next();\n //if(input.equals(\"-1\")) break;\n String a,b;\n switch (input) {\n case \"+\":\n a=st.pop();\n b=st.pop();\n st.push((Integer.parseInt(b)+Integer.parseInt(a))+\"\");\n break;\n case \"-\":\n a=st.pop();\n b=st.pop();\n st.push((Integer.parseInt(b)-Integer.parseInt(a))+\"\");\n break;\n case \"*\":\n a=st.pop();\n b=st.pop();\n st.push((Integer.parseInt(b)*Integer.parseInt(a))+\"\");\n break;\n case \"/\":\n a=st.pop();\n b=st.pop();\n st.push((Integer.parseInt(b)/Integer.parseInt(a))+\"\");\n break;\n default:\n st.push(input);\n break;\n }\n }",
"sc.hasNext()",
"sc.hasNext",
"sc",
"{\n \n String input=sc.next();\n //if(input.equals(\"-1\")) break;\n String a,b;\n switch (input) {\n case \"+\":\n a=st.pop();\n b=st.pop();\n st.push((Integer.parseInt(b)+Integer.parseInt(a))+\"\");\n break;\n case \"-\":\n a=st.pop();\n b=st.pop();\n st.push((Integer.parseInt(b)-Integer.parseInt(a))+\"\");\n break;\n case \"*\":\n a=st.pop();\n b=st.pop();\n st.push((Integer.parseInt(b)*Integer.parseInt(a))+\"\");\n break;\n case \"/\":\n a=st.pop();\n b=st.pop();\n st.push((Integer.parseInt(b)/Integer.parseInt(a))+\"\");\n break;\n default:\n st.push(input);\n break;\n }\n }",
"String input=sc.next();",
"input",
"sc.next()",
"sc.next",
"sc",
"String a",
"a",
"b;",
"b",
"switch (input) {\n case \"+\":\n a=st.pop();\n b=st.pop();\n st.push((Integer.parseInt(b)+Integer.parseInt(a))+\"\");\n break;\n case \"-\":\n a=st.pop();\n b=st.pop();\n st.push((Integer.parseInt(b)-Integer.parseInt(a))+\"\");\n break;\n case \"*\":\n a=st.pop();\n b=st.pop();\n st.push((Integer.parseInt(b)*Integer.parseInt(a))+\"\");\n break;\n case \"/\":\n a=st.pop();\n b=st.pop();\n st.push((Integer.parseInt(b)/Integer.parseInt(a))+\"\");\n break;\n default:\n st.push(input);\n break;\n }",
"input",
"case \"+\":",
"\"+\"",
"case \"+\":",
"a=st.pop()",
"a",
"st.pop()",
"st.pop",
"st",
"b=st.pop()",
"b",
"st.pop()",
"st.pop",
"st",
"st.push((Integer.parseInt(b)+Integer.parseInt(a))+\"\")",
"st.push",
"st",
"(Integer.parseInt(b)+Integer.parseInt(a))+\"\"",
"(Integer.parseInt(b)+Integer.parseInt(a))",
"Integer.parseInt(b)",
"Integer.parseInt",
"Integer",
"b",
"Integer.parseInt(a)",
"Integer.parseInt",
"Integer",
"a",
"\"\"",
"break;",
"case \"-\":",
"\"-\"",
"case \"-\":",
"a=st.pop()",
"a",
"st.pop()",
"st.pop",
"st",
"b=st.pop()",
"b",
"st.pop()",
"st.pop",
"st",
"st.push((Integer.parseInt(b)-Integer.parseInt(a))+\"\")",
"st.push",
"st",
"(Integer.parseInt(b)-Integer.parseInt(a))+\"\"",
"(Integer.parseInt(b)-Integer.parseInt(a))",
"Integer.parseInt(b)",
"Integer.parseInt",
"Integer",
"b",
"Integer.parseInt(a)",
"Integer.parseInt",
"Integer",
"a",
"\"\"",
"break;",
"case \"*\":",
"\"*\"",
"case \"*\":",
"a=st.pop()",
"a",
"st.pop()",
"st.pop",
"st",
"b=st.pop()",
"b",
"st.pop()",
"st.pop",
"st",
"st.push((Integer.parseInt(b)*Integer.parseInt(a))+\"\")",
"st.push",
"st",
"(Integer.parseInt(b)*Integer.parseInt(a))+\"\"",
"(Integer.parseInt(b)*Integer.parseInt(a))",
"Integer.parseInt(b)",
"Integer.parseInt",
"Integer",
"b",
"Integer.parseInt(a)",
"Integer.parseInt",
"Integer",
"a",
"\"\"",
"break;",
"case \"/\":",
"\"/\"",
"case \"/\":",
"a=st.pop()",
"a",
"st.pop()",
"st.pop",
"st",
"b=st.pop()",
"b",
"st.pop()",
"st.pop",
"st",
"st.push((Integer.parseInt(b)/Integer.parseInt(a))+\"\")",
"st.push",
"st",
"(Integer.parseInt(b)/Integer.parseInt(a))+\"\"",
"(Integer.parseInt(b)/Integer.parseInt(a))",
"Integer.parseInt(b)",
"Integer.parseInt",
"Integer",
"b",
"Integer.parseInt(a)",
"Integer.parseInt",
"Integer",
"a",
"\"\"",
"break;",
"default:",
"default:",
"st.push(input)",
"st.push",
"st",
"input",
"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 void main(String[] args) {\n Scanner sc =new Scanner(System.in);\n Stack<String> st=new Stack<String>();\n while(sc.hasNext()){\n \n String input=sc.next();\n //if(input.equals(\"-1\")) break;\n String a,b;\n switch (input) {\n case \"+\":\n a=st.pop();\n b=st.pop();\n st.push((Integer.parseInt(b)+Integer.parseInt(a))+\"\");\n break;\n case \"-\":\n a=st.pop();\n b=st.pop();\n st.push((Integer.parseInt(b)-Integer.parseInt(a))+\"\");\n break;\n case \"*\":\n a=st.pop();\n b=st.pop();\n st.push((Integer.parseInt(b)*Integer.parseInt(a))+\"\");\n break;\n case \"/\":\n a=st.pop();\n b=st.pop();\n st.push((Integer.parseInt(b)/Integer.parseInt(a))+\"\");\n break;\n default:\n st.push(input);\n break;\n }\n }\n System.out.println(st.pop());\n }\n}",
"public class Main{\n public static void main(String[] args) {\n Scanner sc =new Scanner(System.in);\n Stack<String> st=new Stack<String>();\n while(sc.hasNext()){\n \n String input=sc.next();\n //if(input.equals(\"-1\")) break;\n String a,b;\n switch (input) {\n case \"+\":\n a=st.pop();\n b=st.pop();\n st.push((Integer.parseInt(b)+Integer.parseInt(a))+\"\");\n break;\n case \"-\":\n a=st.pop();\n b=st.pop();\n st.push((Integer.parseInt(b)-Integer.parseInt(a))+\"\");\n break;\n case \"*\":\n a=st.pop();\n b=st.pop();\n st.push((Integer.parseInt(b)*Integer.parseInt(a))+\"\");\n break;\n case \"/\":\n a=st.pop();\n b=st.pop();\n st.push((Integer.parseInt(b)/Integer.parseInt(a))+\"\");\n break;\n default:\n st.push(input);\n break;\n }\n }\n System.out.println(st.pop());\n }\n}",
"Main"
] | import java.util.*;
public class Main{
public static void main(String[] args) {
Scanner sc =new Scanner(System.in);
Stack<String> st=new Stack<String>();
while(sc.hasNext()){
String input=sc.next();
//if(input.equals("-1")) break;
String a,b;
switch (input) {
case "+":
a=st.pop();
b=st.pop();
st.push((Integer.parseInt(b)+Integer.parseInt(a))+"");
break;
case "-":
a=st.pop();
b=st.pop();
st.push((Integer.parseInt(b)-Integer.parseInt(a))+"");
break;
case "*":
a=st.pop();
b=st.pop();
st.push((Integer.parseInt(b)*Integer.parseInt(a))+"");
break;
case "/":
a=st.pop();
b=st.pop();
st.push((Integer.parseInt(b)/Integer.parseInt(a))+"");
break;
default:
st.push(input);
break;
}
}
System.out.println(st.pop());
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
41,
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,
14,
2,
4,
13,
18,
13,
13,
17,
30,
4,
18,
13,
4,
18,
13,
18,
13,
13,
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,
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,
4,
18,
18,
13,
13,
4,
18,
13,
17,
23,
13,
12,
13,
30,
4,
13,
0,
18,
36,
13,
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
],
[
229,
8
],
[
229,
9
],
[
9,
10
],
[
229,
11
],
[
11,
12
],
[
11,
13
],
[
13,
14
],
[
14,
15
],
[
14,
16
],
[
13,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
13,
22
],
[
22,
23
],
[
22,
24
],
[
24,
25
],
[
25,
26
],
[
24,
27
],
[
13,
28
],
[
28,
29
],
[
28,
30
],
[
13,
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
],
[
47,
48
],
[
48,
49
],
[
48,
50
],
[
50,
51
],
[
50,
52
],
[
47,
53
],
[
46,
54
],
[
54,
55
],
[
55,
56
],
[
56,
57
],
[
55,
58
],
[
58,
59
],
[
59,
60
],
[
58,
61
],
[
61,
62
],
[
61,
63
],
[
46,
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
],
[
149,
150
],
[
149,
151
],
[
147,
152
],
[
146,
153
],
[
153,
154
],
[
154,
155
],
[
155,
156
],
[
154,
157
],
[
157,
158
],
[
158,
159
],
[
159,
160
],
[
157,
161
],
[
154,
162
],
[
162,
163
],
[
163,
164
],
[
164,
165
],
[
163,
166
],
[
166,
167
],
[
167,
168
],
[
168,
169
],
[
166,
170
],
[
162,
171
],
[
171,
172
],
[
172,
173
],
[
171,
174
],
[
174,
175
],
[
175,
176
],
[
176,
177
],
[
174,
178
],
[
153,
179
],
[
179,
180
],
[
180,
181
],
[
179,
182
],
[
182,
183
],
[
183,
184
],
[
184,
185
],
[
182,
186
],
[
13,
187
],
[
187,
188
],
[
188,
189
],
[
189,
190
],
[
189,
191
],
[
187,
192
],
[
192,
193
],
[
193,
194
],
[
192,
195
],
[
11,
196
],
[
196,
197
],
[
229,
198
],
[
198,
199
],
[
198,
200
],
[
200,
201
],
[
201,
202
],
[
200,
203
],
[
203,
204
],
[
204,
205
],
[
204,
206
],
[
203,
207
],
[
198,
208
],
[
208,
209
],
[
229,
210
],
[
210,
211
],
[
210,
212
],
[
212,
213
],
[
213,
214
],
[
214,
215
],
[
214,
216
],
[
216,
217
],
[
217,
218
],
[
213,
219
],
[
219,
220
],
[
220,
221
],
[
221,
222
],
[
220,
223
],
[
219,
224
],
[
224,
225
],
[
210,
226
],
[
226,
227
],
[
0,
228
],
[
228,
229
],
[
228,
230
]
] | [
"import java.util.ArrayList;\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 line = sc.nextLine();\n\t\tString[] all = line.split(\" \");\n\n\t\tArrayList<Integer> allint = new ArrayList<Integer>();\n\n\t\tfor (int i = 0; i < all.length; i++) {\n\t\t\tif (judge(all[i]) == true) {\n\t\t\t\tallint.add(Integer.parseInt(all[i]));\n\t\t\t} else if (all[i].equals(\"+\")) {\n\t\t\t\tallint.set(allint.size() - 2, allint.get(allint.size() - 2)\n\t\t\t\t\t\t+ allint.get(allint.size() - 1));\n\t\t\t\tallint.remove(allint.size() - 1);\n\t\t\t} else if (all[i].equals(\"-\")) {\n\t\t\t\tallint.set(allint.size() - 2, allint.get(allint.size() - 2)\n\t\t\t\t\t\t- allint.get(allint.size() - 1));\n\t\t\t\tallint.remove(allint.size() - 1);\n\t\t\t} else if (all[i].equals(\"*\")) {\n\t\t\t\tallint.set(allint.size() - 2, allint.get(allint.size() - 2)\n\t\t\t\t\t\t* allint.get(allint.size() - 1));\n\t\t\t\tallint.remove(allint.size() - 1);\n\t\t\t}\n\n\t\t}\n\n\t\tSystem.out.println(allint.get(0));\n\n\t}\n\n\tString n;\n\n\tpublic Main(String n) {\n\t\tsuper();\n\t\tthis.n = n;\n\t}\n\n\tpublic static boolean judge(String n) {\n\t\ttry {\n\t\t\tInteger.parseInt(n);\n\t\t\treturn true;\n\t\t} catch (NumberFormatException e) {\n\t\t\treturn false;\n\t\t}\n\n\t}\n}",
"import java.util.ArrayList;",
"ArrayList",
"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 line = sc.nextLine();\n\t\tString[] all = line.split(\" \");\n\n\t\tArrayList<Integer> allint = new ArrayList<Integer>();\n\n\t\tfor (int i = 0; i < all.length; i++) {\n\t\t\tif (judge(all[i]) == true) {\n\t\t\t\tallint.add(Integer.parseInt(all[i]));\n\t\t\t} else if (all[i].equals(\"+\")) {\n\t\t\t\tallint.set(allint.size() - 2, allint.get(allint.size() - 2)\n\t\t\t\t\t\t+ allint.get(allint.size() - 1));\n\t\t\t\tallint.remove(allint.size() - 1);\n\t\t\t} else if (all[i].equals(\"-\")) {\n\t\t\t\tallint.set(allint.size() - 2, allint.get(allint.size() - 2)\n\t\t\t\t\t\t- allint.get(allint.size() - 1));\n\t\t\t\tallint.remove(allint.size() - 1);\n\t\t\t} else if (all[i].equals(\"*\")) {\n\t\t\t\tallint.set(allint.size() - 2, allint.get(allint.size() - 2)\n\t\t\t\t\t\t* allint.get(allint.size() - 1));\n\t\t\t\tallint.remove(allint.size() - 1);\n\t\t\t}\n\n\t\t}\n\n\t\tSystem.out.println(allint.get(0));\n\n\t}\n\n\tString n;\n\n\tpublic Main(String n) {\n\t\tsuper();\n\t\tthis.n = n;\n\t}\n\n\tpublic static boolean judge(String n) {\n\t\ttry {\n\t\t\tInteger.parseInt(n);\n\t\t\treturn true;\n\t\t} catch (NumberFormatException e) {\n\t\t\treturn false;\n\t\t}\n\n\t}\n}",
"Main",
"String n;",
"n",
"public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tString line = sc.nextLine();\n\t\tString[] all = line.split(\" \");\n\n\t\tArrayList<Integer> allint = new ArrayList<Integer>();\n\n\t\tfor (int i = 0; i < all.length; i++) {\n\t\t\tif (judge(all[i]) == true) {\n\t\t\t\tallint.add(Integer.parseInt(all[i]));\n\t\t\t} else if (all[i].equals(\"+\")) {\n\t\t\t\tallint.set(allint.size() - 2, allint.get(allint.size() - 2)\n\t\t\t\t\t\t+ allint.get(allint.size() - 1));\n\t\t\t\tallint.remove(allint.size() - 1);\n\t\t\t} else if (all[i].equals(\"-\")) {\n\t\t\t\tallint.set(allint.size() - 2, allint.get(allint.size() - 2)\n\t\t\t\t\t\t- allint.get(allint.size() - 1));\n\t\t\t\tallint.remove(allint.size() - 1);\n\t\t\t} else if (all[i].equals(\"*\")) {\n\t\t\t\tallint.set(allint.size() - 2, allint.get(allint.size() - 2)\n\t\t\t\t\t\t* allint.get(allint.size() - 1));\n\t\t\t\tallint.remove(allint.size() - 1);\n\t\t\t}\n\n\t\t}\n\n\t\tSystem.out.println(allint.get(0));\n\n\t}",
"main",
"{\n\t\tScanner sc = new Scanner(System.in);\n\t\tString line = sc.nextLine();\n\t\tString[] all = line.split(\" \");\n\n\t\tArrayList<Integer> allint = new ArrayList<Integer>();\n\n\t\tfor (int i = 0; i < all.length; i++) {\n\t\t\tif (judge(all[i]) == true) {\n\t\t\t\tallint.add(Integer.parseInt(all[i]));\n\t\t\t} else if (all[i].equals(\"+\")) {\n\t\t\t\tallint.set(allint.size() - 2, allint.get(allint.size() - 2)\n\t\t\t\t\t\t+ allint.get(allint.size() - 1));\n\t\t\t\tallint.remove(allint.size() - 1);\n\t\t\t} else if (all[i].equals(\"-\")) {\n\t\t\t\tallint.set(allint.size() - 2, allint.get(allint.size() - 2)\n\t\t\t\t\t\t- allint.get(allint.size() - 1));\n\t\t\t\tallint.remove(allint.size() - 1);\n\t\t\t} else if (all[i].equals(\"*\")) {\n\t\t\t\tallint.set(allint.size() - 2, allint.get(allint.size() - 2)\n\t\t\t\t\t\t* allint.get(allint.size() - 1));\n\t\t\t\tallint.remove(allint.size() - 1);\n\t\t\t}\n\n\t\t}\n\n\t\tSystem.out.println(allint.get(0));\n\n\t}",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"String line = sc.nextLine();",
"line",
"sc.nextLine()",
"sc.nextLine",
"sc",
"String[] all = line.split(\" \");",
"all",
"line.split(\" \")",
"line.split",
"line",
"\" \"",
"ArrayList<Integer> allint = new ArrayList<Integer>();",
"allint",
"new ArrayList<Integer>()",
"for (int i = 0; i < all.length; i++) {\n\t\t\tif (judge(all[i]) == true) {\n\t\t\t\tallint.add(Integer.parseInt(all[i]));\n\t\t\t} else if (all[i].equals(\"+\")) {\n\t\t\t\tallint.set(allint.size() - 2, allint.get(allint.size() - 2)\n\t\t\t\t\t\t+ allint.get(allint.size() - 1));\n\t\t\t\tallint.remove(allint.size() - 1);\n\t\t\t} else if (all[i].equals(\"-\")) {\n\t\t\t\tallint.set(allint.size() - 2, allint.get(allint.size() - 2)\n\t\t\t\t\t\t- allint.get(allint.size() - 1));\n\t\t\t\tallint.remove(allint.size() - 1);\n\t\t\t} else if (all[i].equals(\"*\")) {\n\t\t\t\tallint.set(allint.size() - 2, allint.get(allint.size() - 2)\n\t\t\t\t\t\t* allint.get(allint.size() - 1));\n\t\t\t\tallint.remove(allint.size() - 1);\n\t\t\t}\n\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < all.length",
"i",
"all.length",
"all",
"all.length",
"i++",
"i++",
"i",
"{\n\t\t\tif (judge(all[i]) == true) {\n\t\t\t\tallint.add(Integer.parseInt(all[i]));\n\t\t\t} else if (all[i].equals(\"+\")) {\n\t\t\t\tallint.set(allint.size() - 2, allint.get(allint.size() - 2)\n\t\t\t\t\t\t+ allint.get(allint.size() - 1));\n\t\t\t\tallint.remove(allint.size() - 1);\n\t\t\t} else if (all[i].equals(\"-\")) {\n\t\t\t\tallint.set(allint.size() - 2, allint.get(allint.size() - 2)\n\t\t\t\t\t\t- allint.get(allint.size() - 1));\n\t\t\t\tallint.remove(allint.size() - 1);\n\t\t\t} else if (all[i].equals(\"*\")) {\n\t\t\t\tallint.set(allint.size() - 2, allint.get(allint.size() - 2)\n\t\t\t\t\t\t* allint.get(allint.size() - 1));\n\t\t\t\tallint.remove(allint.size() - 1);\n\t\t\t}\n\n\t\t}",
"{\n\t\t\tif (judge(all[i]) == true) {\n\t\t\t\tallint.add(Integer.parseInt(all[i]));\n\t\t\t} else if (all[i].equals(\"+\")) {\n\t\t\t\tallint.set(allint.size() - 2, allint.get(allint.size() - 2)\n\t\t\t\t\t\t+ allint.get(allint.size() - 1));\n\t\t\t\tallint.remove(allint.size() - 1);\n\t\t\t} else if (all[i].equals(\"-\")) {\n\t\t\t\tallint.set(allint.size() - 2, allint.get(allint.size() - 2)\n\t\t\t\t\t\t- allint.get(allint.size() - 1));\n\t\t\t\tallint.remove(allint.size() - 1);\n\t\t\t} else if (all[i].equals(\"*\")) {\n\t\t\t\tallint.set(allint.size() - 2, allint.get(allint.size() - 2)\n\t\t\t\t\t\t* allint.get(allint.size() - 1));\n\t\t\t\tallint.remove(allint.size() - 1);\n\t\t\t}\n\n\t\t}",
"if (judge(all[i]) == true) {\n\t\t\t\tallint.add(Integer.parseInt(all[i]));\n\t\t\t} else if (all[i].equals(\"+\")) {\n\t\t\t\tallint.set(allint.size() - 2, allint.get(allint.size() - 2)\n\t\t\t\t\t\t+ allint.get(allint.size() - 1));\n\t\t\t\tallint.remove(allint.size() - 1);\n\t\t\t} else if (all[i].equals(\"-\")) {\n\t\t\t\tallint.set(allint.size() - 2, allint.get(allint.size() - 2)\n\t\t\t\t\t\t- allint.get(allint.size() - 1));\n\t\t\t\tallint.remove(allint.size() - 1);\n\t\t\t} else if (all[i].equals(\"*\")) {\n\t\t\t\tallint.set(allint.size() - 2, allint.get(allint.size() - 2)\n\t\t\t\t\t\t* allint.get(allint.size() - 1));\n\t\t\t\tallint.remove(allint.size() - 1);\n\t\t\t}",
"judge(all[i]) == true",
"judge(all[i])",
"judge",
"all[i]",
"all",
"i",
"true",
"{\n\t\t\t\tallint.add(Integer.parseInt(all[i]));\n\t\t\t}",
"allint.add(Integer.parseInt(all[i]))",
"allint.add",
"allint",
"Integer.parseInt(all[i])",
"Integer.parseInt",
"Integer",
"all[i]",
"all",
"i",
"if (all[i].equals(\"+\")) {\n\t\t\t\tallint.set(allint.size() - 2, allint.get(allint.size() - 2)\n\t\t\t\t\t\t+ allint.get(allint.size() - 1));\n\t\t\t\tallint.remove(allint.size() - 1);\n\t\t\t} else if (all[i].equals(\"-\")) {\n\t\t\t\tallint.set(allint.size() - 2, allint.get(allint.size() - 2)\n\t\t\t\t\t\t- allint.get(allint.size() - 1));\n\t\t\t\tallint.remove(allint.size() - 1);\n\t\t\t} else if (all[i].equals(\"*\")) {\n\t\t\t\tallint.set(allint.size() - 2, allint.get(allint.size() - 2)\n\t\t\t\t\t\t* allint.get(allint.size() - 1));\n\t\t\t\tallint.remove(allint.size() - 1);\n\t\t\t}",
"all[i].equals(\"+\")",
"all[i].equals",
"all[i]",
"all",
"i",
"\"+\"",
"{\n\t\t\t\tallint.set(allint.size() - 2, allint.get(allint.size() - 2)\n\t\t\t\t\t\t+ allint.get(allint.size() - 1));\n\t\t\t\tallint.remove(allint.size() - 1);\n\t\t\t}",
"allint.set(allint.size() - 2, allint.get(allint.size() - 2)\n\t\t\t\t\t\t+ allint.get(allint.size() - 1))",
"allint.set",
"allint",
"allint.size() - 2",
"allint.size()",
"allint.size",
"allint",
"2",
"allint.get(allint.size() - 2)\n\t\t\t\t\t\t+ allint.get(allint.size() - 1)",
"allint.get(allint.size() - 2)",
"allint.get",
"allint",
"allint.size() - 2",
"allint.size()",
"allint.size",
"allint",
"2",
"allint.get(allint.size() - 1)",
"allint.get",
"allint",
"allint.size() - 1",
"allint.size()",
"allint.size",
"allint",
"1",
"allint.remove(allint.size() - 1)",
"allint.remove",
"allint",
"allint.size() - 1",
"allint.size()",
"allint.size",
"allint",
"1",
"if (all[i].equals(\"-\")) {\n\t\t\t\tallint.set(allint.size() - 2, allint.get(allint.size() - 2)\n\t\t\t\t\t\t- allint.get(allint.size() - 1));\n\t\t\t\tallint.remove(allint.size() - 1);\n\t\t\t} else if (all[i].equals(\"*\")) {\n\t\t\t\tallint.set(allint.size() - 2, allint.get(allint.size() - 2)\n\t\t\t\t\t\t* allint.get(allint.size() - 1));\n\t\t\t\tallint.remove(allint.size() - 1);\n\t\t\t}",
"all[i].equals(\"-\")",
"all[i].equals",
"all[i]",
"all",
"i",
"\"-\"",
"{\n\t\t\t\tallint.set(allint.size() - 2, allint.get(allint.size() - 2)\n\t\t\t\t\t\t- allint.get(allint.size() - 1));\n\t\t\t\tallint.remove(allint.size() - 1);\n\t\t\t}",
"allint.set(allint.size() - 2, allint.get(allint.size() - 2)\n\t\t\t\t\t\t- allint.get(allint.size() - 1))",
"allint.set",
"allint",
"allint.size() - 2",
"allint.size()",
"allint.size",
"allint",
"2",
"allint.get(allint.size() - 2)\n\t\t\t\t\t\t- allint.get(allint.size() - 1)",
"allint.get(allint.size() - 2)",
"allint.get",
"allint",
"allint.size() - 2",
"allint.size()",
"allint.size",
"allint",
"2",
"allint.get(allint.size() - 1)",
"allint.get",
"allint",
"allint.size() - 1",
"allint.size()",
"allint.size",
"allint",
"1",
"allint.remove(allint.size() - 1)",
"allint.remove",
"allint",
"allint.size() - 1",
"allint.size()",
"allint.size",
"allint",
"1",
"if (all[i].equals(\"*\")) {\n\t\t\t\tallint.set(allint.size() - 2, allint.get(allint.size() - 2)\n\t\t\t\t\t\t* allint.get(allint.size() - 1));\n\t\t\t\tallint.remove(allint.size() - 1);\n\t\t\t}",
"all[i].equals(\"*\")",
"all[i].equals",
"all[i]",
"all",
"i",
"\"*\"",
"{\n\t\t\t\tallint.set(allint.size() - 2, allint.get(allint.size() - 2)\n\t\t\t\t\t\t* allint.get(allint.size() - 1));\n\t\t\t\tallint.remove(allint.size() - 1);\n\t\t\t}",
"allint.set(allint.size() - 2, allint.get(allint.size() - 2)\n\t\t\t\t\t\t* allint.get(allint.size() - 1))",
"allint.set",
"allint",
"allint.size() - 2",
"allint.size()",
"allint.size",
"allint",
"2",
"allint.get(allint.size() - 2)\n\t\t\t\t\t\t* allint.get(allint.size() - 1)",
"allint.get(allint.size() - 2)",
"allint.get",
"allint",
"allint.size() - 2",
"allint.size()",
"allint.size",
"allint",
"2",
"allint.get(allint.size() - 1)",
"allint.get",
"allint",
"allint.size() - 1",
"allint.size()",
"allint.size",
"allint",
"1",
"allint.remove(allint.size() - 1)",
"allint.remove",
"allint",
"allint.size() - 1",
"allint.size()",
"allint.size",
"allint",
"1",
"System.out.println(allint.get(0))",
"System.out.println",
"System.out",
"System",
"System.out",
"allint.get(0)",
"allint.get",
"allint",
"0",
"String[] args",
"args",
"public Main(String n) {\n\t\tsuper();\n\t\tthis.n = n;\n\t}",
"Main",
"{\n\t\tsuper();\n\t\tthis.n = n;\n\t}",
"super()",
"super",
"this.n = n",
"this.n",
"this",
"this.n",
"n",
"String n",
"n",
"public static boolean judge(String n) {\n\t\ttry {\n\t\t\tInteger.parseInt(n);\n\t\t\treturn true;\n\t\t} catch (NumberFormatException e) {\n\t\t\treturn false;\n\t\t}\n\n\t}",
"judge",
"{\n\t\ttry {\n\t\t\tInteger.parseInt(n);\n\t\t\treturn true;\n\t\t} catch (NumberFormatException e) {\n\t\t\treturn false;\n\t\t}\n\n\t}",
"try {\n\t\t\tInteger.parseInt(n);\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(n);\n\t\t\treturn true;\n\t\t}",
"Integer.parseInt(n)",
"Integer.parseInt",
"Integer",
"n",
"return true;",
"true",
"String n",
"n",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tString line = sc.nextLine();\n\t\tString[] all = line.split(\" \");\n\n\t\tArrayList<Integer> allint = new ArrayList<Integer>();\n\n\t\tfor (int i = 0; i < all.length; i++) {\n\t\t\tif (judge(all[i]) == true) {\n\t\t\t\tallint.add(Integer.parseInt(all[i]));\n\t\t\t} else if (all[i].equals(\"+\")) {\n\t\t\t\tallint.set(allint.size() - 2, allint.get(allint.size() - 2)\n\t\t\t\t\t\t+ allint.get(allint.size() - 1));\n\t\t\t\tallint.remove(allint.size() - 1);\n\t\t\t} else if (all[i].equals(\"-\")) {\n\t\t\t\tallint.set(allint.size() - 2, allint.get(allint.size() - 2)\n\t\t\t\t\t\t- allint.get(allint.size() - 1));\n\t\t\t\tallint.remove(allint.size() - 1);\n\t\t\t} else if (all[i].equals(\"*\")) {\n\t\t\t\tallint.set(allint.size() - 2, allint.get(allint.size() - 2)\n\t\t\t\t\t\t* allint.get(allint.size() - 1));\n\t\t\t\tallint.remove(allint.size() - 1);\n\t\t\t}\n\n\t\t}\n\n\t\tSystem.out.println(allint.get(0));\n\n\t}\n\n\tString n;\n\n\tpublic Main(String n) {\n\t\tsuper();\n\t\tthis.n = n;\n\t}\n\n\tpublic static boolean judge(String n) {\n\t\ttry {\n\t\t\tInteger.parseInt(n);\n\t\t\treturn true;\n\t\t} catch (NumberFormatException e) {\n\t\t\treturn false;\n\t\t}\n\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 line = sc.nextLine();\n\t\tString[] all = line.split(\" \");\n\n\t\tArrayList<Integer> allint = new ArrayList<Integer>();\n\n\t\tfor (int i = 0; i < all.length; i++) {\n\t\t\tif (judge(all[i]) == true) {\n\t\t\t\tallint.add(Integer.parseInt(all[i]));\n\t\t\t} else if (all[i].equals(\"+\")) {\n\t\t\t\tallint.set(allint.size() - 2, allint.get(allint.size() - 2)\n\t\t\t\t\t\t+ allint.get(allint.size() - 1));\n\t\t\t\tallint.remove(allint.size() - 1);\n\t\t\t} else if (all[i].equals(\"-\")) {\n\t\t\t\tallint.set(allint.size() - 2, allint.get(allint.size() - 2)\n\t\t\t\t\t\t- allint.get(allint.size() - 1));\n\t\t\t\tallint.remove(allint.size() - 1);\n\t\t\t} else if (all[i].equals(\"*\")) {\n\t\t\t\tallint.set(allint.size() - 2, allint.get(allint.size() - 2)\n\t\t\t\t\t\t* allint.get(allint.size() - 1));\n\t\t\t\tallint.remove(allint.size() - 1);\n\t\t\t}\n\n\t\t}\n\n\t\tSystem.out.println(allint.get(0));\n\n\t}\n\n\tString n;\n\n\tpublic Main(String n) {\n\t\tsuper();\n\t\tthis.n = n;\n\t}\n\n\tpublic static boolean judge(String n) {\n\t\ttry {\n\t\t\tInteger.parseInt(n);\n\t\t\treturn true;\n\t\t} catch (NumberFormatException e) {\n\t\t\treturn false;\n\t\t}\n\n\t}\n}",
"Main"
] | import java.util.ArrayList;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String line = sc.nextLine();
String[] all = line.split(" ");
ArrayList<Integer> allint = new ArrayList<Integer>();
for (int i = 0; i < all.length; i++) {
if (judge(all[i]) == true) {
allint.add(Integer.parseInt(all[i]));
} else if (all[i].equals("+")) {
allint.set(allint.size() - 2, allint.get(allint.size() - 2)
+ allint.get(allint.size() - 1));
allint.remove(allint.size() - 1);
} else if (all[i].equals("-")) {
allint.set(allint.size() - 2, allint.get(allint.size() - 2)
- allint.get(allint.size() - 1));
allint.remove(allint.size() - 1);
} else if (all[i].equals("*")) {
allint.set(allint.size() - 2, allint.get(allint.size() - 2)
* allint.get(allint.size() - 1));
allint.remove(allint.size() - 1);
}
}
System.out.println(allint.get(0));
}
String n;
public Main(String n) {
super();
this.n = n;
}
public static boolean judge(String n) {
try {
Integer.parseInt(n);
return true;
} catch (NumberFormatException e) {
return false;
}
}
} |
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
20,
41,
13,
41,
13,
41,
13,
17,
41,
13,
41,
13,
0,
13,
4,
18,
4,
18,
13,
17,
17,
0,
13,
18,
13,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
14,
4,
18,
18,
13,
13,
17,
30,
4,
18,
13,
17,
14,
4,
18,
18,
13,
13,
17,
30,
4,
18,
13,
17,
14,
4,
18,
18,
13,
13,
17,
30,
4,
18,
13,
17,
30,
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,
20,
17,
41,
13,
12,
13,
30,
11,
1,
41,
13,
17,
2,
13,
17,
1,
40,
13,
30,
30,
0,
18,
13,
13,
17,
0,
13,
17,
12,
13,
30,
14,
2,
2,
13,
17,
2,
18,
13,
13,
17,
30,
0,
18,
13,
13,
13,
30,
40,
13,
0,
18,
13,
13,
13,
23,
13,
12,
13,
30,
41,
13,
18,
13,
13,
0,
18,
13,
13,
17,
14,
2,
13,
17,
30,
40,
13,
29,
13,
12,
13,
30,
41,
13,
41,
13,
41,
13,
0,
13,
4,
13,
0,
13,
4,
13,
35,
13,
34,
17,
1,
0,
13,
2,
13,
13,
3,
34,
17,
1,
0,
13,
2,
13,
13,
3,
34,
1,
0,
13,
2,
13,
13,
3,
4,
13,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
249,
8
],
[
249,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
12,
14
],
[
11,
15
],
[
15,
16
],
[
15,
17
],
[
11,
18
],
[
18,
19
],
[
11,
20
],
[
20,
21
],
[
11,
22
],
[
22,
23
],
[
22,
24
],
[
11,
25
],
[
25,
26
],
[
11,
27
],
[
27,
28
],
[
11,
29
],
[
29,
30
],
[
29,
31
],
[
31,
32
],
[
32,
33
],
[
33,
34
],
[
34,
35
],
[
31,
36
],
[
31,
37
],
[
11,
38
],
[
38,
39
],
[
38,
40
],
[
40,
41
],
[
40,
42
],
[
11,
43
],
[
43,
44
],
[
44,
45
],
[
45,
46
],
[
45,
47
],
[
43,
48
],
[
48,
49
],
[
48,
50
],
[
43,
51
],
[
51,
52
],
[
52,
53
],
[
43,
54
],
[
55,
55
],
[
55,
56
],
[
56,
57
],
[
57,
58
],
[
58,
59
],
[
59,
60
],
[
59,
61
],
[
57,
62
],
[
56,
63
],
[
63,
64
],
[
64,
65
],
[
65,
66
],
[
64,
67
],
[
56,
68
],
[
68,
69
],
[
69,
70
],
[
70,
71
],
[
71,
72
],
[
71,
73
],
[
69,
74
],
[
68,
75
],
[
75,
76
],
[
76,
77
],
[
77,
78
],
[
76,
79
],
[
68,
80
],
[
80,
81
],
[
81,
82
],
[
82,
83
],
[
83,
84
],
[
83,
85
],
[
81,
86
],
[
80,
87
],
[
87,
88
],
[
88,
89
],
[
89,
90
],
[
88,
91
],
[
80,
92
],
[
92,
93
],
[
93,
94
],
[
93,
95
],
[
95,
96
],
[
96,
97
],
[
95,
98
],
[
98,
99
],
[
98,
100
],
[
92,
101
],
[
101,
102
],
[
102,
103
],
[
101,
104
],
[
11,
105
],
[
105,
106
],
[
106,
107
],
[
107,
108
],
[
107,
109
],
[
105,
110
],
[
110,
111
],
[
111,
112
],
[
9,
113
],
[
113,
114
],
[
0,
115
],
[
115,
116
],
[
115,
117
],
[
117,
118
],
[
117,
119
],
[
115,
121
],
[
121,
122
],
[
115,
123
],
[
123,
124
],
[
123,
125
],
[
125,
126
],
[
126,
127
],
[
127,
128
],
[
128,
129
],
[
128,
130
],
[
126,
131
],
[
131,
132
],
[
131,
133
],
[
126,
134
],
[
134,
135
],
[
135,
136
],
[
126,
137
],
[
138,
138
],
[
138,
139
],
[
139,
140
],
[
140,
141
],
[
140,
142
],
[
139,
143
],
[
125,
144
],
[
144,
145
],
[
144,
146
],
[
115,
147
],
[
147,
148
],
[
147,
149
],
[
149,
150
],
[
150,
151
],
[
151,
152
],
[
152,
153
],
[
152,
154
],
[
151,
155
],
[
155,
156
],
[
156,
157
],
[
156,
158
],
[
155,
159
],
[
150,
160
],
[
160,
161
],
[
161,
162
],
[
162,
163
],
[
162,
164
],
[
161,
165
],
[
150,
166
],
[
166,
167
],
[
167,
168
],
[
166,
169
],
[
169,
170
],
[
170,
171
],
[
170,
172
],
[
169,
173
],
[
147,
174
],
[
174,
175
],
[
115,
176
],
[
176,
177
],
[
176,
178
],
[
178,
179
],
[
179,
180
],
[
179,
181
],
[
181,
182
],
[
181,
183
],
[
178,
184
],
[
184,
185
],
[
185,
186
],
[
185,
187
],
[
184,
188
],
[
178,
189
],
[
189,
190
],
[
190,
191
],
[
190,
192
],
[
189,
193
],
[
193,
194
],
[
194,
195
],
[
178,
196
],
[
196,
197
],
[
115,
198
],
[
198,
199
],
[
198,
200
],
[
200,
201
],
[
201,
202
],
[
200,
203
],
[
203,
204
],
[
200,
205
],
[
205,
206
],
[
200,
207
],
[
207,
208
],
[
207,
209
],
[
209,
210
],
[
200,
211
],
[
211,
212
],
[
211,
213
],
[
213,
214
],
[
200,
215
],
[
215,
216
],
[
215,
217
],
[
217,
218
],
[
217,
219
],
[
219,
220
],
[
220,
221
],
[
220,
222
],
[
222,
223
],
[
222,
224
],
[
219,
225
],
[
215,
226
],
[
226,
227
],
[
226,
228
],
[
228,
229
],
[
229,
230
],
[
229,
231
],
[
231,
232
],
[
231,
233
],
[
228,
234
],
[
215,
235
],
[
235,
236
],
[
236,
237
],
[
237,
238
],
[
237,
239
],
[
239,
240
],
[
239,
241
],
[
236,
242
],
[
200,
243
],
[
243,
244
],
[
243,
245
],
[
198,
246
],
[
246,
247
],
[
0,
248
],
[
248,
249
],
[
248,
250
]
] | [
"import java.util.*;\nimport java.io.*;\n\npublic class Main{\n\tpublic static void main(String args[]) throws IOException{\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\toperateStack ost = new operateStack();\n\t\tString[] str;\n\t\tint len, top = 0;\n\t\tlong op, cal;\n\t\t\n\t\tstr = br.readLine().split(\" \", 0);\n\t\tlen = str.length;\n\t\t\n\t\tfor(int i = 0; i < len; i++){\n\t\t\t\n\t\t\tif(str[i].equals(\"+\")){\n\t\t\t\tost.calc(1);\n\t\t\t}\n\t\t\telse if(str[i].equals(\"-\")){\n\t\t\t\tost.calc(2);\n\t\t\t}\n\t\t\telse if(str[i].equals(\"*\")){\n\t\t\t\tost.calc(3);\n\t\t\t}\n\t\t\telse{\n\t\t\t\top = Long.parseLong(str[i]);\n\t\t\t\tost.push(op);\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(ost.pop());\n\t}\n}\n\nclass operateStack{\n\tlong[] stack = new long[100];\n\tint top;\n\t\n\toperateStack(){\n\t\tfor(int i = 0; i < 100; i++){\n\t\t\tstack[i] = 0;\n\t\t}\n\t\ttop = 0;\n\t}\n\t\n\tvoid push(long op){\n\t\tif(top == 0 && stack[top] == 0){\n\t\t\tstack[top] = op;\n\t\t}\n\t\telse{\n\t\t\ttop ++;\n\t\t\tstack[top] = op;\n\t\t}\n\t}\n\t\n\tlong pop(){\n\t\tlong op = stack[top];\n\t\tstack[top] = 0;\n\t\t\n\t\tif(top > 0){\n\t\t\ttop --;\n\t\t}\n\t\treturn op;\n\t}\n\t\n\tvoid calc(int flag){\n\t\tlong op, op2;\n\t\tlong cal;\n\t\t\n\t\top = pop();\n\t\top2 = pop();\n\t\t\n\t\tswitch(flag){\n\t\tcase 1:\n\t\t\tcal = op2 + op;\n\t\t\tbreak;\n\t\tcase 2:\n\t\t\tcal = op2 - op;\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tcal = op2 * op;\n\t\t\tbreak;\n\t\t}\n\t\t\n\t\tpush(cal);\n\t}\n}",
"import java.util.*;",
"util.*",
"java",
"import java.io.*;",
"io.*",
"java",
"public class Main{\n\tpublic static void main(String args[]) throws IOException{\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\toperateStack ost = new operateStack();\n\t\tString[] str;\n\t\tint len, top = 0;\n\t\tlong op, cal;\n\t\t\n\t\tstr = br.readLine().split(\" \", 0);\n\t\tlen = str.length;\n\t\t\n\t\tfor(int i = 0; i < len; i++){\n\t\t\t\n\t\t\tif(str[i].equals(\"+\")){\n\t\t\t\tost.calc(1);\n\t\t\t}\n\t\t\telse if(str[i].equals(\"-\")){\n\t\t\t\tost.calc(2);\n\t\t\t}\n\t\t\telse if(str[i].equals(\"*\")){\n\t\t\t\tost.calc(3);\n\t\t\t}\n\t\t\telse{\n\t\t\t\top = Long.parseLong(str[i]);\n\t\t\t\tost.push(op);\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(ost.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\toperateStack ost = new operateStack();\n\t\tString[] str;\n\t\tint len, top = 0;\n\t\tlong op, cal;\n\t\t\n\t\tstr = br.readLine().split(\" \", 0);\n\t\tlen = str.length;\n\t\t\n\t\tfor(int i = 0; i < len; i++){\n\t\t\t\n\t\t\tif(str[i].equals(\"+\")){\n\t\t\t\tost.calc(1);\n\t\t\t}\n\t\t\telse if(str[i].equals(\"-\")){\n\t\t\t\tost.calc(2);\n\t\t\t}\n\t\t\telse if(str[i].equals(\"*\")){\n\t\t\t\tost.calc(3);\n\t\t\t}\n\t\t\telse{\n\t\t\t\top = Long.parseLong(str[i]);\n\t\t\t\tost.push(op);\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(ost.pop());\n\t}",
"main",
"{\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\toperateStack ost = new operateStack();\n\t\tString[] str;\n\t\tint len, top = 0;\n\t\tlong op, cal;\n\t\t\n\t\tstr = br.readLine().split(\" \", 0);\n\t\tlen = str.length;\n\t\t\n\t\tfor(int i = 0; i < len; i++){\n\t\t\t\n\t\t\tif(str[i].equals(\"+\")){\n\t\t\t\tost.calc(1);\n\t\t\t}\n\t\t\telse if(str[i].equals(\"-\")){\n\t\t\t\tost.calc(2);\n\t\t\t}\n\t\t\telse if(str[i].equals(\"*\")){\n\t\t\t\tost.calc(3);\n\t\t\t}\n\t\t\telse{\n\t\t\t\top = Long.parseLong(str[i]);\n\t\t\t\tost.push(op);\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(ost.pop());\n\t}",
"BufferedReader br = new BufferedReader(new InputStreamReader(System.in));",
"br",
"new BufferedReader(new InputStreamReader(System.in))",
"operateStack ost = new operateStack();",
"ost",
"new operateStack()",
"String[] str;",
"str",
"int len",
"len",
"top = 0;",
"top",
"0",
"long op",
"op",
"cal;",
"cal",
"str = br.readLine().split(\" \", 0)",
"str",
"br.readLine().split(\" \", 0)",
"br.readLine().split",
"br.readLine()",
"br.readLine",
"br",
"\" \"",
"0",
"len = str.length",
"len",
"str.length",
"str",
"str.length",
"for(int i = 0; i < len; i++){\n\t\t\t\n\t\t\tif(str[i].equals(\"+\")){\n\t\t\t\tost.calc(1);\n\t\t\t}\n\t\t\telse if(str[i].equals(\"-\")){\n\t\t\t\tost.calc(2);\n\t\t\t}\n\t\t\telse if(str[i].equals(\"*\")){\n\t\t\t\tost.calc(3);\n\t\t\t}\n\t\t\telse{\n\t\t\t\top = Long.parseLong(str[i]);\n\t\t\t\tost.push(op);\n\t\t\t}\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < len",
"i",
"len",
"i++",
"i++",
"i",
"{\n\t\t\t\n\t\t\tif(str[i].equals(\"+\")){\n\t\t\t\tost.calc(1);\n\t\t\t}\n\t\t\telse if(str[i].equals(\"-\")){\n\t\t\t\tost.calc(2);\n\t\t\t}\n\t\t\telse if(str[i].equals(\"*\")){\n\t\t\t\tost.calc(3);\n\t\t\t}\n\t\t\telse{\n\t\t\t\top = Long.parseLong(str[i]);\n\t\t\t\tost.push(op);\n\t\t\t}\n\t\t}",
"{\n\t\t\t\n\t\t\tif(str[i].equals(\"+\")){\n\t\t\t\tost.calc(1);\n\t\t\t}\n\t\t\telse if(str[i].equals(\"-\")){\n\t\t\t\tost.calc(2);\n\t\t\t}\n\t\t\telse if(str[i].equals(\"*\")){\n\t\t\t\tost.calc(3);\n\t\t\t}\n\t\t\telse{\n\t\t\t\top = Long.parseLong(str[i]);\n\t\t\t\tost.push(op);\n\t\t\t}\n\t\t}",
"if(str[i].equals(\"+\")){\n\t\t\t\tost.calc(1);\n\t\t\t}\n\t\t\telse if(str[i].equals(\"-\")){\n\t\t\t\tost.calc(2);\n\t\t\t}\n\t\t\telse if(str[i].equals(\"*\")){\n\t\t\t\tost.calc(3);\n\t\t\t}\n\t\t\telse{\n\t\t\t\top = Long.parseLong(str[i]);\n\t\t\t\tost.push(op);\n\t\t\t}",
"str[i].equals(\"+\")",
"str[i].equals",
"str[i]",
"str",
"i",
"\"+\"",
"{\n\t\t\t\tost.calc(1);\n\t\t\t}",
"ost.calc(1)",
"ost.calc",
"ost",
"1",
"if(str[i].equals(\"-\")){\n\t\t\t\tost.calc(2);\n\t\t\t}\n\t\t\telse if(str[i].equals(\"*\")){\n\t\t\t\tost.calc(3);\n\t\t\t}\n\t\t\telse{\n\t\t\t\top = Long.parseLong(str[i]);\n\t\t\t\tost.push(op);\n\t\t\t}",
"str[i].equals(\"-\")",
"str[i].equals",
"str[i]",
"str",
"i",
"\"-\"",
"{\n\t\t\t\tost.calc(2);\n\t\t\t}",
"ost.calc(2)",
"ost.calc",
"ost",
"2",
"if(str[i].equals(\"*\")){\n\t\t\t\tost.calc(3);\n\t\t\t}\n\t\t\telse{\n\t\t\t\top = Long.parseLong(str[i]);\n\t\t\t\tost.push(op);\n\t\t\t}",
"str[i].equals(\"*\")",
"str[i].equals",
"str[i]",
"str",
"i",
"\"*\"",
"{\n\t\t\t\tost.calc(3);\n\t\t\t}",
"ost.calc(3)",
"ost.calc",
"ost",
"3",
"{\n\t\t\t\top = Long.parseLong(str[i]);\n\t\t\t\tost.push(op);\n\t\t\t}",
"op = Long.parseLong(str[i])",
"op",
"Long.parseLong(str[i])",
"Long.parseLong",
"Long",
"str[i]",
"str",
"i",
"ost.push(op)",
"ost.push",
"ost",
"op",
"System.out.println(ost.pop())",
"System.out.println",
"System.out",
"System",
"System.out",
"ost.pop()",
"ost.pop",
"ost",
"String args[]",
"args",
"class operateStack{\n\tlong[] stack = new long[100];\n\tint top;\n\t\n\toperateStack(){\n\t\tfor(int i = 0; i < 100; i++){\n\t\t\tstack[i] = 0;\n\t\t}\n\t\ttop = 0;\n\t}\n\t\n\tvoid push(long op){\n\t\tif(top == 0 && stack[top] == 0){\n\t\t\tstack[top] = op;\n\t\t}\n\t\telse{\n\t\t\ttop ++;\n\t\t\tstack[top] = op;\n\t\t}\n\t}\n\t\n\tlong pop(){\n\t\tlong op = stack[top];\n\t\tstack[top] = 0;\n\t\t\n\t\tif(top > 0){\n\t\t\ttop --;\n\t\t}\n\t\treturn op;\n\t}\n\t\n\tvoid calc(int flag){\n\t\tlong op, op2;\n\t\tlong cal;\n\t\t\n\t\top = pop();\n\t\top2 = pop();\n\t\t\n\t\tswitch(flag){\n\t\tcase 1:\n\t\t\tcal = op2 + op;\n\t\t\tbreak;\n\t\tcase 2:\n\t\t\tcal = op2 - op;\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tcal = op2 * op;\n\t\t\tbreak;\n\t\t}\n\t\t\n\t\tpush(cal);\n\t}\n}",
"operateStack",
"long[] stack = new long[100];",
"stack",
"new long[100]",
"100",
"int top;",
"top",
"operateStack(){\n\t\tfor(int i = 0; i < 100; i++){\n\t\t\tstack[i] = 0;\n\t\t}\n\t\ttop = 0;\n\t}",
"operateStack",
"{\n\t\tfor(int i = 0; i < 100; i++){\n\t\t\tstack[i] = 0;\n\t\t}\n\t\ttop = 0;\n\t}",
"for(int i = 0; i < 100; i++){\n\t\t\tstack[i] = 0;\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < 100",
"i",
"100",
"i++",
"i++",
"i",
"{\n\t\t\tstack[i] = 0;\n\t\t}",
"{\n\t\t\tstack[i] = 0;\n\t\t}",
"stack[i] = 0",
"stack[i]",
"stack",
"i",
"0",
"top = 0",
"top",
"0",
"void push(long op){\n\t\tif(top == 0 && stack[top] == 0){\n\t\t\tstack[top] = op;\n\t\t}\n\t\telse{\n\t\t\ttop ++;\n\t\t\tstack[top] = op;\n\t\t}\n\t}",
"push",
"{\n\t\tif(top == 0 && stack[top] == 0){\n\t\t\tstack[top] = op;\n\t\t}\n\t\telse{\n\t\t\ttop ++;\n\t\t\tstack[top] = op;\n\t\t}\n\t}",
"if(top == 0 && stack[top] == 0){\n\t\t\tstack[top] = op;\n\t\t}\n\t\telse{\n\t\t\ttop ++;\n\t\t\tstack[top] = op;\n\t\t}",
"top == 0 && stack[top] == 0",
"top == 0",
"top",
"0",
"stack[top] == 0",
"stack[top]",
"stack",
"top",
"0",
"{\n\t\t\tstack[top] = op;\n\t\t}",
"stack[top] = op",
"stack[top]",
"stack",
"top",
"op",
"{\n\t\t\ttop ++;\n\t\t\tstack[top] = op;\n\t\t}",
"top ++",
"top",
"stack[top] = op",
"stack[top]",
"stack",
"top",
"op",
"long op",
"op",
"long pop(){\n\t\tlong op = stack[top];\n\t\tstack[top] = 0;\n\t\t\n\t\tif(top > 0){\n\t\t\ttop --;\n\t\t}\n\t\treturn op;\n\t}",
"pop",
"{\n\t\tlong op = stack[top];\n\t\tstack[top] = 0;\n\t\t\n\t\tif(top > 0){\n\t\t\ttop --;\n\t\t}\n\t\treturn op;\n\t}",
"long op = stack[top];",
"op",
"stack[top]",
"stack",
"top",
"stack[top] = 0",
"stack[top]",
"stack",
"top",
"0",
"if(top > 0){\n\t\t\ttop --;\n\t\t}",
"top > 0",
"top",
"0",
"{\n\t\t\ttop --;\n\t\t}",
"top --",
"top",
"return op;",
"op",
"void calc(int flag){\n\t\tlong op, op2;\n\t\tlong cal;\n\t\t\n\t\top = pop();\n\t\top2 = pop();\n\t\t\n\t\tswitch(flag){\n\t\tcase 1:\n\t\t\tcal = op2 + op;\n\t\t\tbreak;\n\t\tcase 2:\n\t\t\tcal = op2 - op;\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tcal = op2 * op;\n\t\t\tbreak;\n\t\t}\n\t\t\n\t\tpush(cal);\n\t}",
"calc",
"{\n\t\tlong op, op2;\n\t\tlong cal;\n\t\t\n\t\top = pop();\n\t\top2 = pop();\n\t\t\n\t\tswitch(flag){\n\t\tcase 1:\n\t\t\tcal = op2 + op;\n\t\t\tbreak;\n\t\tcase 2:\n\t\t\tcal = op2 - op;\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tcal = op2 * op;\n\t\t\tbreak;\n\t\t}\n\t\t\n\t\tpush(cal);\n\t}",
"long op",
"op",
"op2;",
"op2",
"long cal;",
"cal",
"op = pop()",
"op",
"pop()",
"pop",
"op2 = pop()",
"op2",
"pop()",
"pop",
"switch(flag){\n\t\tcase 1:\n\t\t\tcal = op2 + op;\n\t\t\tbreak;\n\t\tcase 2:\n\t\t\tcal = op2 - op;\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tcal = op2 * op;\n\t\t\tbreak;\n\t\t}",
"flag",
"case 1:",
"1",
"case 1:",
"cal = op2 + op",
"cal",
"op2 + op",
"op2",
"op",
"break;",
"case 2:",
"2",
"case 2:",
"cal = op2 - op",
"cal",
"op2 - op",
"op2",
"op",
"break;",
"default:",
"default:",
"cal = op2 * op",
"cal",
"op2 * op",
"op2",
"op",
"break;",
"push(cal)",
"push",
"cal",
"int flag",
"flag",
"public class Main{\n\tpublic static void main(String args[]) throws IOException{\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\toperateStack ost = new operateStack();\n\t\tString[] str;\n\t\tint len, top = 0;\n\t\tlong op, cal;\n\t\t\n\t\tstr = br.readLine().split(\" \", 0);\n\t\tlen = str.length;\n\t\t\n\t\tfor(int i = 0; i < len; i++){\n\t\t\t\n\t\t\tif(str[i].equals(\"+\")){\n\t\t\t\tost.calc(1);\n\t\t\t}\n\t\t\telse if(str[i].equals(\"-\")){\n\t\t\t\tost.calc(2);\n\t\t\t}\n\t\t\telse if(str[i].equals(\"*\")){\n\t\t\t\tost.calc(3);\n\t\t\t}\n\t\t\telse{\n\t\t\t\top = Long.parseLong(str[i]);\n\t\t\t\tost.push(op);\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(ost.pop());\n\t}\n}",
"public class Main{\n\tpublic static void main(String args[]) throws IOException{\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\toperateStack ost = new operateStack();\n\t\tString[] str;\n\t\tint len, top = 0;\n\t\tlong op, cal;\n\t\t\n\t\tstr = br.readLine().split(\" \", 0);\n\t\tlen = str.length;\n\t\t\n\t\tfor(int i = 0; i < len; i++){\n\t\t\t\n\t\t\tif(str[i].equals(\"+\")){\n\t\t\t\tost.calc(1);\n\t\t\t}\n\t\t\telse if(str[i].equals(\"-\")){\n\t\t\t\tost.calc(2);\n\t\t\t}\n\t\t\telse if(str[i].equals(\"*\")){\n\t\t\t\tost.calc(3);\n\t\t\t}\n\t\t\telse{\n\t\t\t\top = Long.parseLong(str[i]);\n\t\t\t\tost.push(op);\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(ost.pop());\n\t}\n}",
"Main"
] | import java.util.*;
import java.io.*;
public class Main{
public static void main(String args[]) throws IOException{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
operateStack ost = new operateStack();
String[] str;
int len, top = 0;
long op, cal;
str = br.readLine().split(" ", 0);
len = str.length;
for(int i = 0; i < len; i++){
if(str[i].equals("+")){
ost.calc(1);
}
else if(str[i].equals("-")){
ost.calc(2);
}
else if(str[i].equals("*")){
ost.calc(3);
}
else{
op = Long.parseLong(str[i]);
ost.push(op);
}
}
System.out.println(ost.pop());
}
}
class operateStack{
long[] stack = new long[100];
int top;
operateStack(){
for(int i = 0; i < 100; i++){
stack[i] = 0;
}
top = 0;
}
void push(long op){
if(top == 0 && stack[top] == 0){
stack[top] = op;
}
else{
top ++;
stack[top] = op;
}
}
long pop(){
long op = stack[top];
stack[top] = 0;
if(top > 0){
top --;
}
return op;
}
void calc(int flag){
long op, op2;
long cal;
op = pop();
op2 = pop();
switch(flag){
case 1:
cal = op2 + op;
break;
case 2:
cal = op2 - op;
break;
default:
cal = op2 * op;
break;
}
push(cal);
}
} |
[
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,
28,
13,
13,
30,
30,
41,
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,
0,
13,
2,
13,
13,
4,
18,
13,
4,
18,
13,
13,
3,
34,
17,
1,
0,
13,
4,
18,
13,
4,
18,
13,
0,
13,
4,
18,
13,
4,
18,
13,
0,
13,
2,
13,
13,
4,
18,
13,
4,
18,
13,
13,
3,
34,
17,
1,
0,
13,
4,
18,
13,
4,
18,
13,
0,
13,
4,
18,
13,
4,
18,
13,
0,
13,
2,
13,
13,
4,
18,
13,
4,
18,
13,
13,
3,
34,
1,
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
],
[
152,
8
],
[
152,
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
],
[
26,
28
],
[
26,
29
],
[
30,
30
],
[
30,
31
],
[
31,
32
],
[
30,
33
],
[
33,
34
],
[
30,
35
],
[
35,
36
],
[
30,
37
],
[
37,
38
],
[
37,
39
],
[
39,
40
],
[
39,
41
],
[
41,
42
],
[
42,
43
],
[
42,
44
],
[
44,
45
],
[
45,
46
],
[
44,
47
],
[
47,
48
],
[
48,
49
],
[
41,
50
],
[
50,
51
],
[
50,
52
],
[
52,
53
],
[
53,
54
],
[
52,
55
],
[
55,
56
],
[
56,
57
],
[
41,
58
],
[
58,
59
],
[
58,
60
],
[
60,
61
],
[
60,
62
],
[
41,
63
],
[
63,
64
],
[
64,
65
],
[
63,
66
],
[
66,
67
],
[
67,
68
],
[
66,
69
],
[
41,
70
],
[
37,
71
],
[
71,
72
],
[
71,
73
],
[
73,
74
],
[
74,
75
],
[
74,
76
],
[
76,
77
],
[
77,
78
],
[
76,
79
],
[
79,
80
],
[
80,
81
],
[
73,
82
],
[
82,
83
],
[
82,
84
],
[
84,
85
],
[
85,
86
],
[
84,
87
],
[
87,
88
],
[
88,
89
],
[
73,
90
],
[
90,
91
],
[
90,
92
],
[
92,
93
],
[
92,
94
],
[
73,
95
],
[
95,
96
],
[
96,
97
],
[
95,
98
],
[
98,
99
],
[
99,
100
],
[
98,
101
],
[
73,
102
],
[
37,
103
],
[
103,
104
],
[
103,
105
],
[
105,
106
],
[
106,
107
],
[
106,
108
],
[
108,
109
],
[
109,
110
],
[
108,
111
],
[
111,
112
],
[
112,
113
],
[
105,
114
],
[
114,
115
],
[
114,
116
],
[
116,
117
],
[
117,
118
],
[
116,
119
],
[
119,
120
],
[
120,
121
],
[
105,
122
],
[
122,
123
],
[
122,
124
],
[
124,
125
],
[
124,
126
],
[
105,
127
],
[
127,
128
],
[
128,
129
],
[
127,
130
],
[
130,
131
],
[
131,
132
],
[
130,
133
],
[
105,
134
],
[
37,
135
],
[
135,
136
],
[
136,
137
],
[
137,
138
],
[
138,
139
],
[
137,
140
],
[
11,
141
],
[
141,
142
],
[
142,
143
],
[
143,
144
],
[
143,
145
],
[
141,
146
],
[
146,
147
],
[
147,
148
],
[
9,
149
],
[
149,
150
],
[
0,
151
],
[
151,
152
],
[
151,
153
]
] | [
"import 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[] ss = sc.nextLine().split(\" \");\n Stack<String> st = new Stack<>();\n for (String s: ss) {\n int first, second, r;\n switch (s) {\n case \"+\":\n first = Integer.parseInt(st.pop());\n second = Integer.parseInt(st.pop());\n r = second + first;\n st.push(Integer.toString(r));\n break;\n case \"-\":\n first = Integer.parseInt(st.pop());\n second = Integer.parseInt(st.pop());\n r = second - first;\n st.push(Integer.toString(r));\n break;\n case \"*\":\n first = Integer.parseInt(st.pop());\n second = Integer.parseInt(st.pop());\n r = second * first;\n st.push(Integer.toString(r));\n break;\n default:\n st.push(s);\n }\n }\n assert(st.size() == 1);\n System.out.println(st.pop());\n }\n}\n\n",
"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[] ss = sc.nextLine().split(\" \");\n Stack<String> st = new Stack<>();\n for (String s: ss) {\n int first, second, r;\n switch (s) {\n case \"+\":\n first = Integer.parseInt(st.pop());\n second = Integer.parseInt(st.pop());\n r = second + first;\n st.push(Integer.toString(r));\n break;\n case \"-\":\n first = Integer.parseInt(st.pop());\n second = Integer.parseInt(st.pop());\n r = second - first;\n st.push(Integer.toString(r));\n break;\n case \"*\":\n first = Integer.parseInt(st.pop());\n second = Integer.parseInt(st.pop());\n r = second * first;\n st.push(Integer.toString(r));\n break;\n default:\n st.push(s);\n }\n }\n assert(st.size() == 1);\n System.out.println(st.pop());\n }\n}",
"Main",
"public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n String[] ss = sc.nextLine().split(\" \");\n Stack<String> st = new Stack<>();\n for (String s: ss) {\n int first, second, r;\n switch (s) {\n case \"+\":\n first = Integer.parseInt(st.pop());\n second = Integer.parseInt(st.pop());\n r = second + first;\n st.push(Integer.toString(r));\n break;\n case \"-\":\n first = Integer.parseInt(st.pop());\n second = Integer.parseInt(st.pop());\n r = second - first;\n st.push(Integer.toString(r));\n break;\n case \"*\":\n first = Integer.parseInt(st.pop());\n second = Integer.parseInt(st.pop());\n r = second * first;\n st.push(Integer.toString(r));\n break;\n default:\n st.push(s);\n }\n }\n assert(st.size() == 1);\n System.out.println(st.pop());\n }",
"main",
"{\n Scanner sc = new Scanner(System.in);\n String[] ss = sc.nextLine().split(\" \");\n Stack<String> st = new Stack<>();\n for (String s: ss) {\n int first, second, r;\n switch (s) {\n case \"+\":\n first = Integer.parseInt(st.pop());\n second = Integer.parseInt(st.pop());\n r = second + first;\n st.push(Integer.toString(r));\n break;\n case \"-\":\n first = Integer.parseInt(st.pop());\n second = Integer.parseInt(st.pop());\n r = second - first;\n st.push(Integer.toString(r));\n break;\n case \"*\":\n first = Integer.parseInt(st.pop());\n second = Integer.parseInt(st.pop());\n r = second * first;\n st.push(Integer.toString(r));\n break;\n default:\n st.push(s);\n }\n }\n assert(st.size() == 1);\n System.out.println(st.pop());\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"String[] ss = sc.nextLine().split(\" \");",
"ss",
"sc.nextLine().split(\" \")",
"sc.nextLine().split",
"sc.nextLine()",
"sc.nextLine",
"sc",
"\" \"",
"Stack<String> st = new Stack<>();",
"st",
"new Stack<>()",
"for (String s: ss) {\n int first, second, r;\n switch (s) {\n case \"+\":\n first = Integer.parseInt(st.pop());\n second = Integer.parseInt(st.pop());\n r = second + first;\n st.push(Integer.toString(r));\n break;\n case \"-\":\n first = Integer.parseInt(st.pop());\n second = Integer.parseInt(st.pop());\n r = second - first;\n st.push(Integer.toString(r));\n break;\n case \"*\":\n first = Integer.parseInt(st.pop());\n second = Integer.parseInt(st.pop());\n r = second * first;\n st.push(Integer.toString(r));\n break;\n default:\n st.push(s);\n }\n }",
"String s",
"ss",
"{\n int first, second, r;\n switch (s) {\n case \"+\":\n first = Integer.parseInt(st.pop());\n second = Integer.parseInt(st.pop());\n r = second + first;\n st.push(Integer.toString(r));\n break;\n case \"-\":\n first = Integer.parseInt(st.pop());\n second = Integer.parseInt(st.pop());\n r = second - first;\n st.push(Integer.toString(r));\n break;\n case \"*\":\n first = Integer.parseInt(st.pop());\n second = Integer.parseInt(st.pop());\n r = second * first;\n st.push(Integer.toString(r));\n break;\n default:\n st.push(s);\n }\n }",
"{\n int first, second, r;\n switch (s) {\n case \"+\":\n first = Integer.parseInt(st.pop());\n second = Integer.parseInt(st.pop());\n r = second + first;\n st.push(Integer.toString(r));\n break;\n case \"-\":\n first = Integer.parseInt(st.pop());\n second = Integer.parseInt(st.pop());\n r = second - first;\n st.push(Integer.toString(r));\n break;\n case \"*\":\n first = Integer.parseInt(st.pop());\n second = Integer.parseInt(st.pop());\n r = second * first;\n st.push(Integer.toString(r));\n break;\n default:\n st.push(s);\n }\n }",
"int first",
"first",
"second",
"second",
"r;",
"r",
"switch (s) {\n case \"+\":\n first = Integer.parseInt(st.pop());\n second = Integer.parseInt(st.pop());\n r = second + first;\n st.push(Integer.toString(r));\n break;\n case \"-\":\n first = Integer.parseInt(st.pop());\n second = Integer.parseInt(st.pop());\n r = second - first;\n st.push(Integer.toString(r));\n break;\n case \"*\":\n first = Integer.parseInt(st.pop());\n second = Integer.parseInt(st.pop());\n r = second * first;\n st.push(Integer.toString(r));\n break;\n default:\n st.push(s);\n }",
"s",
"case \"+\":",
"\"+\"",
"case \"+\":",
"first = Integer.parseInt(st.pop())",
"first",
"Integer.parseInt(st.pop())",
"Integer.parseInt",
"Integer",
"st.pop()",
"st.pop",
"st",
"second = Integer.parseInt(st.pop())",
"second",
"Integer.parseInt(st.pop())",
"Integer.parseInt",
"Integer",
"st.pop()",
"st.pop",
"st",
"r = second + first",
"r",
"second + first",
"second",
"first",
"st.push(Integer.toString(r))",
"st.push",
"st",
"Integer.toString(r)",
"Integer.toString",
"Integer",
"r",
"break;",
"case \"-\":",
"\"-\"",
"case \"-\":",
"first = Integer.parseInt(st.pop())",
"first",
"Integer.parseInt(st.pop())",
"Integer.parseInt",
"Integer",
"st.pop()",
"st.pop",
"st",
"second = Integer.parseInt(st.pop())",
"second",
"Integer.parseInt(st.pop())",
"Integer.parseInt",
"Integer",
"st.pop()",
"st.pop",
"st",
"r = second - first",
"r",
"second - first",
"second",
"first",
"st.push(Integer.toString(r))",
"st.push",
"st",
"Integer.toString(r)",
"Integer.toString",
"Integer",
"r",
"break;",
"case \"*\":",
"\"*\"",
"case \"*\":",
"first = Integer.parseInt(st.pop())",
"first",
"Integer.parseInt(st.pop())",
"Integer.parseInt",
"Integer",
"st.pop()",
"st.pop",
"st",
"second = Integer.parseInt(st.pop())",
"second",
"Integer.parseInt(st.pop())",
"Integer.parseInt",
"Integer",
"st.pop()",
"st.pop",
"st",
"r = second * first",
"r",
"second * first",
"second",
"first",
"st.push(Integer.toString(r))",
"st.push",
"st",
"Integer.toString(r)",
"Integer.toString",
"Integer",
"r",
"break;",
"default:",
"default:",
"st.push(s)",
"st.push",
"st",
"s",
"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 void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n String[] ss = sc.nextLine().split(\" \");\n Stack<String> st = new Stack<>();\n for (String s: ss) {\n int first, second, r;\n switch (s) {\n case \"+\":\n first = Integer.parseInt(st.pop());\n second = Integer.parseInt(st.pop());\n r = second + first;\n st.push(Integer.toString(r));\n break;\n case \"-\":\n first = Integer.parseInt(st.pop());\n second = Integer.parseInt(st.pop());\n r = second - first;\n st.push(Integer.toString(r));\n break;\n case \"*\":\n first = Integer.parseInt(st.pop());\n second = Integer.parseInt(st.pop());\n r = second * first;\n st.push(Integer.toString(r));\n break;\n default:\n st.push(s);\n }\n }\n assert(st.size() == 1);\n System.out.println(st.pop());\n }\n}",
"public class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n String[] ss = sc.nextLine().split(\" \");\n Stack<String> st = new Stack<>();\n for (String s: ss) {\n int first, second, r;\n switch (s) {\n case \"+\":\n first = Integer.parseInt(st.pop());\n second = Integer.parseInt(st.pop());\n r = second + first;\n st.push(Integer.toString(r));\n break;\n case \"-\":\n first = Integer.parseInt(st.pop());\n second = Integer.parseInt(st.pop());\n r = second - first;\n st.push(Integer.toString(r));\n break;\n case \"*\":\n first = Integer.parseInt(st.pop());\n second = Integer.parseInt(st.pop());\n r = second * first;\n st.push(Integer.toString(r));\n break;\n default:\n st.push(s);\n }\n }\n assert(st.size() == 1);\n System.out.println(st.pop());\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[] ss = sc.nextLine().split(" ");
Stack<String> st = new Stack<>();
for (String s: ss) {
int first, second, r;
switch (s) {
case "+":
first = Integer.parseInt(st.pop());
second = Integer.parseInt(st.pop());
r = second + first;
st.push(Integer.toString(r));
break;
case "-":
first = Integer.parseInt(st.pop());
second = Integer.parseInt(st.pop());
r = second - first;
st.push(Integer.toString(r));
break;
case "*":
first = Integer.parseInt(st.pop());
second = Integer.parseInt(st.pop());
r = second * first;
st.push(Integer.toString(r));
break;
default:
st.push(s);
}
}
assert(st.size() == 1);
System.out.println(st.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,
41,
13,
41,
13,
41,
13,
4,
18,
13,
41,
13,
20,
11,
1,
41,
13,
17,
2,
13,
4,
18,
13,
1,
40,
13,
30,
30,
35,
4,
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,
4,
18,
13,
13,
4,
18,
18,
13,
13,
4,
18,
13,
23,
13,
6,
13,
41,
13,
20,
12,
13,
30,
4,
13,
12,
13,
30,
38,
5,
13,
30,
4,
18,
13,
30,
41,
13,
4,
18,
4,
18,
4,
18,
13,
17,
29,
4,
18,
13,
18,
13,
17,
29,
17,
12,
13,
30,
41,
13,
20,
38,
5,
13,
30,
4,
18,
13,
30,
41,
13,
4,
18,
4,
18,
4,
18,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
4,
18,
13,
4,
18,
13,
18,
13,
13,
29,
13,
29,
17,
23,
13,
12,
13,
30,
38,
5,
13,
30,
4,
18,
13,
30,
41,
13,
4,
18,
4,
18,
4,
18,
13,
17,
41,
13,
4,
18,
13,
13,
29,
13,
29,
17
] | [
[
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
],
[
30,
31
],
[
30,
32
],
[
32,
33
],
[
33,
34
],
[
33,
35
],
[
32,
36
],
[
36,
37
],
[
32,
38
],
[
38,
39
],
[
32,
40
],
[
40,
41
],
[
40,
42
],
[
42,
43
],
[
43,
44
],
[
32,
45
],
[
45,
46
],
[
45,
47
],
[
32,
48
],
[
48,
49
],
[
49,
50
],
[
50,
51
],
[
50,
52
],
[
48,
53
],
[
53,
54
],
[
53,
55
],
[
55,
56
],
[
56,
57
],
[
48,
58
],
[
58,
59
],
[
59,
60
],
[
48,
61
],
[
62,
62
],
[
62,
63
],
[
63,
64
],
[
64,
65
],
[
65,
66
],
[
64,
67
],
[
63,
68
],
[
68,
69
],
[
68,
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
],
[
70,
87
],
[
63,
88
],
[
88,
89
],
[
88,
90
],
[
90,
91
],
[
91,
92
],
[
91,
93
],
[
93,
94
],
[
94,
95
],
[
90,
96
],
[
96,
97
],
[
96,
98
],
[
98,
99
],
[
99,
100
],
[
90,
101
],
[
101,
102
],
[
102,
103
],
[
101,
104
],
[
104,
105
],
[
104,
106
],
[
90,
107
],
[
63,
108
],
[
108,
109
],
[
108,
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
],
[
63,
128
],
[
128,
129
],
[
129,
130
],
[
130,
131
],
[
131,
132
],
[
130,
133
],
[
133,
134
],
[
134,
135
],
[
133,
136
],
[
136,
137
],
[
137,
138
],
[
136,
139
],
[
32,
140
],
[
140,
141
],
[
141,
142
],
[
142,
143
],
[
142,
144
],
[
140,
145
],
[
145,
146
],
[
146,
147
],
[
30,
148
],
[
148,
149
],
[
0,
150
],
[
150,
151
],
[
150,
152
],
[
152,
153
],
[
152,
154
],
[
150,
155
],
[
155,
156
],
[
155,
157
],
[
157,
158
],
[
158,
159
],
[
150,
160
],
[
160,
161
],
[
160,
162
],
[
162,
163
],
[
163,
164
],
[
164,
165
],
[
164,
166
],
[
166,
167
],
[
167,
168
],
[
168,
169
],
[
163,
170
],
[
170,
171
],
[
171,
172
],
[
171,
173
],
[
173,
174
],
[
174,
175
],
[
175,
176
],
[
176,
177
],
[
177,
178
],
[
178,
179
],
[
173,
180
],
[
170,
181
],
[
181,
182
],
[
182,
183
],
[
183,
184
],
[
182,
185
],
[
185,
186
],
[
185,
187
],
[
162,
188
],
[
188,
189
],
[
150,
190
],
[
190,
191
],
[
190,
192
],
[
192,
193
],
[
193,
194
],
[
193,
195
],
[
192,
196
],
[
196,
197
],
[
197,
198
],
[
197,
199
],
[
199,
200
],
[
200,
201
],
[
201,
202
],
[
196,
203
],
[
203,
204
],
[
204,
205
],
[
204,
206
],
[
206,
207
],
[
207,
208
],
[
208,
209
],
[
209,
210
],
[
210,
211
],
[
211,
212
],
[
206,
213
],
[
203,
214
],
[
214,
215
],
[
215,
216
],
[
216,
217
],
[
216,
218
],
[
214,
219
],
[
219,
220
],
[
219,
221
],
[
214,
222
],
[
222,
223
],
[
223,
224
],
[
214,
225
],
[
226,
226
],
[
226,
227
],
[
227,
228
],
[
228,
229
],
[
227,
230
],
[
230,
231
],
[
231,
232
],
[
230,
233
],
[
233,
234
],
[
233,
235
],
[
203,
236
],
[
236,
237
],
[
192,
238
],
[
238,
239
],
[
190,
240
],
[
240,
241
],
[
150,
242
],
[
242,
243
],
[
242,
244
],
[
244,
245
],
[
245,
246
],
[
246,
247
],
[
246,
248
],
[
248,
249
],
[
249,
250
],
[
250,
251
],
[
245,
252
],
[
252,
253
],
[
253,
254
],
[
253,
255
],
[
255,
256
],
[
256,
257
],
[
257,
258
],
[
258,
259
],
[
259,
260
],
[
260,
261
],
[
255,
262
],
[
252,
263
],
[
263,
264
],
[
263,
265
],
[
265,
266
],
[
266,
267
],
[
265,
268
],
[
252,
269
],
[
269,
270
],
[
244,
271
],
[
271,
272
]
] | [
"import java.util.Deque;\nimport java.util.LinkedList;\nimport java.util.List;\nimport java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\nimport java.util.ArrayList;\nimport java.util.Arrays;\nimport java.util.List;\n\n\nclass Main {\n\n\tpublic static void main(String[] args) {\n\n\t\tInput stdIn = new Input();\n\t\tint x, y;\n\n\t\tList<String> inputline = stdIn.getLineString();\n\t\tDeque<Integer> stack = new LinkedList<>();\n\n\t\tfor (int i = 0; i < inputline.size(); i++) {\n\t\t\tswitch (inputline.get(i)) {\n\t\t\tcase \"+\":\n\t\t\t\ty = stack.pop();\n\t\t\t\tx = stack.pop();\n\t\t\t\tstack.push(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.push(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.push(x * y);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tstack.push(Integer.parseInt(inputline.get(i)));\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(stack.peek());\n\t}\n}\nclass Input {\n\n\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\n\tInput() {\n\t\tsuper();\n\t}\n\n\tpublic Integer getValue() {\n\t\ttry {\n\t\t\tString[] s = br.readLine().trim().split(\" \");\n\t\t\treturn Integer.parseInt(s[0]);\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn null;\n\t}\n\n\tpublic List<Integer> getLine(int n) {\n\t\tList<Integer> values = new ArrayList<>();\n\t\ttry {\n\t\t\tString[] s = br.readLine().trim().split(\" \");\n\t\t\tfor(int i = 0; i < n; i++) {\n\t\t\t\tvalues.add(Integer.parseInt(s[i]));\n\t\t\t}\n\t\t\treturn values;\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn null;\n\t}\n\tpublic List<String> getLineString() {\n\t\ttry {\n\t\t\tString[] s = br.readLine().trim().split(\" \");\n\t\t\tList<String> values = Arrays.asList(s);\n\t\t\treturn values;\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn null;\n\t}\n}",
"import java.util.Deque;",
"Deque",
"java.util",
"import java.util.LinkedList;",
"LinkedList",
"java.util",
"import java.util.List;",
"List",
"java.util",
"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",
"import java.util.Arrays;",
"Arrays",
"java.util",
"import java.util.List;",
"List",
"java.util",
"class Main {\n\n\tpublic static void main(String[] args) {\n\n\t\tInput stdIn = new Input();\n\t\tint x, y;\n\n\t\tList<String> inputline = stdIn.getLineString();\n\t\tDeque<Integer> stack = new LinkedList<>();\n\n\t\tfor (int i = 0; i < inputline.size(); i++) {\n\t\t\tswitch (inputline.get(i)) {\n\t\t\tcase \"+\":\n\t\t\t\ty = stack.pop();\n\t\t\t\tx = stack.pop();\n\t\t\t\tstack.push(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.push(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.push(x * y);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tstack.push(Integer.parseInt(inputline.get(i)));\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(stack.peek());\n\t}\n}",
"Main",
"public static void main(String[] args) {\n\n\t\tInput stdIn = new Input();\n\t\tint x, y;\n\n\t\tList<String> inputline = stdIn.getLineString();\n\t\tDeque<Integer> stack = new LinkedList<>();\n\n\t\tfor (int i = 0; i < inputline.size(); i++) {\n\t\t\tswitch (inputline.get(i)) {\n\t\t\tcase \"+\":\n\t\t\t\ty = stack.pop();\n\t\t\t\tx = stack.pop();\n\t\t\t\tstack.push(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.push(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.push(x * y);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tstack.push(Integer.parseInt(inputline.get(i)));\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(stack.peek());\n\t}",
"main",
"{\n\n\t\tInput stdIn = new Input();\n\t\tint x, y;\n\n\t\tList<String> inputline = stdIn.getLineString();\n\t\tDeque<Integer> stack = new LinkedList<>();\n\n\t\tfor (int i = 0; i < inputline.size(); i++) {\n\t\t\tswitch (inputline.get(i)) {\n\t\t\tcase \"+\":\n\t\t\t\ty = stack.pop();\n\t\t\t\tx = stack.pop();\n\t\t\t\tstack.push(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.push(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.push(x * y);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tstack.push(Integer.parseInt(inputline.get(i)));\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(stack.peek());\n\t}",
"Input stdIn = new Input();",
"stdIn",
"new Input()",
"int x",
"x",
"y;",
"y",
"List<String> inputline = stdIn.getLineString();",
"inputline",
"stdIn.getLineString()",
"stdIn.getLineString",
"stdIn",
"Deque<Integer> stack = new LinkedList<>();",
"stack",
"new LinkedList<>()",
"for (int i = 0; i < inputline.size(); i++) {\n\t\t\tswitch (inputline.get(i)) {\n\t\t\tcase \"+\":\n\t\t\t\ty = stack.pop();\n\t\t\t\tx = stack.pop();\n\t\t\t\tstack.push(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.push(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.push(x * y);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tstack.push(Integer.parseInt(inputline.get(i)));\n\t\t\t}\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < inputline.size()",
"i",
"inputline.size()",
"inputline.size",
"inputline",
"i++",
"i++",
"i",
"{\n\t\t\tswitch (inputline.get(i)) {\n\t\t\tcase \"+\":\n\t\t\t\ty = stack.pop();\n\t\t\t\tx = stack.pop();\n\t\t\t\tstack.push(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.push(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.push(x * y);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tstack.push(Integer.parseInt(inputline.get(i)));\n\t\t\t}\n\t\t}",
"{\n\t\t\tswitch (inputline.get(i)) {\n\t\t\tcase \"+\":\n\t\t\t\ty = stack.pop();\n\t\t\t\tx = stack.pop();\n\t\t\t\tstack.push(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.push(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.push(x * y);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tstack.push(Integer.parseInt(inputline.get(i)));\n\t\t\t}\n\t\t}",
"switch (inputline.get(i)) {\n\t\t\tcase \"+\":\n\t\t\t\ty = stack.pop();\n\t\t\t\tx = stack.pop();\n\t\t\t\tstack.push(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.push(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.push(x * y);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tstack.push(Integer.parseInt(inputline.get(i)));\n\t\t\t}",
"inputline.get(i)",
"inputline.get",
"inputline",
"i",
"case \"+\":",
"\"+\"",
"case \"+\":",
"y = stack.pop()",
"y",
"stack.pop()",
"stack.pop",
"stack",
"x = stack.pop()",
"x",
"stack.pop()",
"stack.pop",
"stack",
"stack.push(x + y)",
"stack.push",
"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.push(x - y)",
"stack.push",
"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.push(x * y)",
"stack.push",
"stack",
"x * y",
"x",
"y",
"break;",
"default:",
"default:",
"stack.push(Integer.parseInt(inputline.get(i)))",
"stack.push",
"stack",
"Integer.parseInt(inputline.get(i))",
"Integer.parseInt",
"Integer",
"inputline.get(i)",
"inputline.get",
"inputline",
"i",
"System.out.println(stack.peek())",
"System.out.println",
"System.out",
"System",
"System.out",
"stack.peek()",
"stack.peek",
"stack",
"String[] args",
"args",
"class Input {\n\n\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\n\tInput() {\n\t\tsuper();\n\t}\n\n\tpublic Integer getValue() {\n\t\ttry {\n\t\t\tString[] s = br.readLine().trim().split(\" \");\n\t\t\treturn Integer.parseInt(s[0]);\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn null;\n\t}\n\n\tpublic List<Integer> getLine(int n) {\n\t\tList<Integer> values = new ArrayList<>();\n\t\ttry {\n\t\t\tString[] s = br.readLine().trim().split(\" \");\n\t\t\tfor(int i = 0; i < n; i++) {\n\t\t\t\tvalues.add(Integer.parseInt(s[i]));\n\t\t\t}\n\t\t\treturn values;\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn null;\n\t}\n\tpublic List<String> getLineString() {\n\t\ttry {\n\t\t\tString[] s = br.readLine().trim().split(\" \");\n\t\t\tList<String> values = Arrays.asList(s);\n\t\t\treturn values;\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn null;\n\t}\n}",
"Input",
"BufferedReader br = new BufferedReader(new InputStreamReader(System.in));",
"br",
"new BufferedReader(new InputStreamReader(System.in))",
"Input() {\n\t\tsuper();\n\t}",
"Input",
"{\n\t\tsuper();\n\t}",
"super()",
"super",
"public Integer getValue() {\n\t\ttry {\n\t\t\tString[] s = br.readLine().trim().split(\" \");\n\t\t\treturn Integer.parseInt(s[0]);\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn null;\n\t}",
"getValue",
"{\n\t\ttry {\n\t\t\tString[] s = br.readLine().trim().split(\" \");\n\t\t\treturn Integer.parseInt(s[0]);\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn null;\n\t}",
"try {\n\t\t\tString[] s = br.readLine().trim().split(\" \");\n\t\t\treturn Integer.parseInt(s[0]);\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}",
"catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}",
"IOException e",
"{\n\t\t\te.printStackTrace();\n\t\t}",
"e.printStackTrace()",
"e.printStackTrace",
"e",
"{\n\t\t\tString[] s = br.readLine().trim().split(\" \");\n\t\t\treturn Integer.parseInt(s[0]);\n\t\t}",
"String[] s = br.readLine().trim().split(\" \");",
"s",
"br.readLine().trim().split(\" \")",
"br.readLine().trim().split",
"br.readLine().trim()",
"br.readLine().trim",
"br.readLine()",
"br.readLine",
"br",
"\" \"",
"return Integer.parseInt(s[0]);",
"Integer.parseInt(s[0])",
"Integer.parseInt",
"Integer",
"s[0]",
"s",
"0",
"return null;",
"null",
"public List<Integer> getLine(int n) {\n\t\tList<Integer> values = new ArrayList<>();\n\t\ttry {\n\t\t\tString[] s = br.readLine().trim().split(\" \");\n\t\t\tfor(int i = 0; i < n; i++) {\n\t\t\t\tvalues.add(Integer.parseInt(s[i]));\n\t\t\t}\n\t\t\treturn values;\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn null;\n\t}",
"getLine",
"{\n\t\tList<Integer> values = new ArrayList<>();\n\t\ttry {\n\t\t\tString[] s = br.readLine().trim().split(\" \");\n\t\t\tfor(int i = 0; i < n; i++) {\n\t\t\t\tvalues.add(Integer.parseInt(s[i]));\n\t\t\t}\n\t\t\treturn values;\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn null;\n\t}",
"List<Integer> values = new ArrayList<>();",
"values",
"new ArrayList<>()",
"try {\n\t\t\tString[] s = br.readLine().trim().split(\" \");\n\t\t\tfor(int i = 0; i < n; i++) {\n\t\t\t\tvalues.add(Integer.parseInt(s[i]));\n\t\t\t}\n\t\t\treturn values;\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}",
"catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}",
"IOException e",
"{\n\t\t\te.printStackTrace();\n\t\t}",
"e.printStackTrace()",
"e.printStackTrace",
"e",
"{\n\t\t\tString[] s = br.readLine().trim().split(\" \");\n\t\t\tfor(int i = 0; i < n; i++) {\n\t\t\t\tvalues.add(Integer.parseInt(s[i]));\n\t\t\t}\n\t\t\treturn values;\n\t\t}",
"String[] s = br.readLine().trim().split(\" \");",
"s",
"br.readLine().trim().split(\" \")",
"br.readLine().trim().split",
"br.readLine().trim()",
"br.readLine().trim",
"br.readLine()",
"br.readLine",
"br",
"\" \"",
"for(int i = 0; i < n; i++) {\n\t\t\t\tvalues.add(Integer.parseInt(s[i]));\n\t\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n\t\t\t\tvalues.add(Integer.parseInt(s[i]));\n\t\t\t}",
"{\n\t\t\t\tvalues.add(Integer.parseInt(s[i]));\n\t\t\t}",
"values.add(Integer.parseInt(s[i]))",
"values.add",
"values",
"Integer.parseInt(s[i])",
"Integer.parseInt",
"Integer",
"s[i]",
"s",
"i",
"return values;",
"values",
"return null;",
"null",
"int n",
"n",
"public List<String> getLineString() {\n\t\ttry {\n\t\t\tString[] s = br.readLine().trim().split(\" \");\n\t\t\tList<String> values = Arrays.asList(s);\n\t\t\treturn values;\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn null;\n\t}",
"getLineString",
"{\n\t\ttry {\n\t\t\tString[] s = br.readLine().trim().split(\" \");\n\t\t\tList<String> values = Arrays.asList(s);\n\t\t\treturn values;\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn null;\n\t}",
"try {\n\t\t\tString[] s = br.readLine().trim().split(\" \");\n\t\t\tList<String> values = Arrays.asList(s);\n\t\t\treturn values;\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}",
"catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}",
"IOException e",
"{\n\t\t\te.printStackTrace();\n\t\t}",
"e.printStackTrace()",
"e.printStackTrace",
"e",
"{\n\t\t\tString[] s = br.readLine().trim().split(\" \");\n\t\t\tList<String> values = Arrays.asList(s);\n\t\t\treturn values;\n\t\t}",
"String[] s = br.readLine().trim().split(\" \");",
"s",
"br.readLine().trim().split(\" \")",
"br.readLine().trim().split",
"br.readLine().trim()",
"br.readLine().trim",
"br.readLine()",
"br.readLine",
"br",
"\" \"",
"List<String> values = Arrays.asList(s);",
"values",
"Arrays.asList(s)",
"Arrays.asList",
"Arrays",
"s",
"return values;",
"values",
"return null;",
"null"
] | import java.util.Deque;
import java.util.LinkedList;
import java.util.List;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
class Main {
public static void main(String[] args) {
Input stdIn = new Input();
int x, y;
List<String> inputline = stdIn.getLineString();
Deque<Integer> stack = new LinkedList<>();
for (int i = 0; i < inputline.size(); i++) {
switch (inputline.get(i)) {
case "+":
y = stack.pop();
x = stack.pop();
stack.push(x + y);
break;
case "-":
y = stack.pop();
x = stack.pop();
stack.push(x - y);
break;
case "*":
y = stack.pop();
x = stack.pop();
stack.push(x * y);
break;
default:
stack.push(Integer.parseInt(inputline.get(i)));
}
}
System.out.println(stack.peek());
}
}
class Input {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
Input() {
super();
}
public Integer getValue() {
try {
String[] s = br.readLine().trim().split(" ");
return Integer.parseInt(s[0]);
} catch (IOException e) {
e.printStackTrace();
}
return null;
}
public List<Integer> getLine(int n) {
List<Integer> values = new ArrayList<>();
try {
String[] s = br.readLine().trim().split(" ");
for(int i = 0; i < n; i++) {
values.add(Integer.parseInt(s[i]));
}
return values;
} catch (IOException e) {
e.printStackTrace();
}
return null;
}
public List<String> getLineString() {
try {
String[] s = br.readLine().trim().split(" ");
List<String> values = Arrays.asList(s);
return values;
} catch (IOException e) {
e.printStackTrace();
}
return null;
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
38,
5,
13,
30,
4,
18,
18,
13,
13,
2,
17,
13,
30,
41,
13,
20,
41,
13,
4,
18,
4,
18,
13,
17,
17,
41,
13,
20,
17,
11,
1,
41,
13,
17,
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,
18,
13,
13,
14,
4,
18,
18,
13,
13,
17,
30,
40,
13,
0,
18,
13,
2,
13,
17,
18,
13,
13,
14,
4,
18,
18,
13,
13,
17,
30,
40,
13,
0,
18,
13,
2,
13,
17,
18,
13,
13,
30,
0,
18,
13,
13,
4,
18,
13,
2,
17,
18,
13,
13,
40,
13,
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
],
[
10,
11
],
[
10,
12
],
[
12,
13
],
[
13,
14
],
[
14,
15
],
[
15,
16
],
[
15,
17
],
[
13,
18
],
[
18,
19
],
[
18,
20
],
[
9,
21
],
[
21,
22
],
[
22,
23
],
[
22,
24
],
[
21,
25
],
[
25,
26
],
[
25,
27
],
[
27,
28
],
[
28,
29
],
[
29,
30
],
[
30,
31
],
[
27,
32
],
[
27,
33
],
[
21,
34
],
[
34,
35
],
[
34,
36
],
[
21,
38
],
[
38,
39
],
[
39,
40
],
[
40,
41
],
[
40,
42
],
[
39,
43
],
[
43,
44
],
[
43,
45
],
[
38,
46
],
[
46,
47
],
[
46,
48
],
[
48,
49
],
[
48,
50
],
[
38,
51
],
[
51,
52
],
[
52,
53
],
[
38,
54
],
[
55,
55
],
[
55,
56
],
[
56,
57
],
[
57,
58
],
[
58,
59
],
[
59,
60
],
[
59,
61
],
[
57,
62
],
[
56,
63
],
[
63,
64
],
[
64,
65
],
[
63,
66
],
[
66,
67
],
[
67,
68
],
[
67,
69
],
[
69,
70
],
[
69,
71
],
[
66,
72
],
[
72,
73
],
[
72,
74
],
[
56,
75
],
[
75,
76
],
[
76,
77
],
[
77,
78
],
[
78,
79
],
[
78,
80
],
[
76,
81
],
[
75,
82
],
[
82,
83
],
[
83,
84
],
[
82,
85
],
[
85,
86
],
[
86,
87
],
[
86,
88
],
[
88,
89
],
[
88,
90
],
[
85,
91
],
[
91,
92
],
[
91,
93
],
[
75,
94
],
[
94,
95
],
[
95,
96
],
[
96,
97
],
[
97,
98
],
[
97,
99
],
[
95,
100
],
[
94,
101
],
[
101,
102
],
[
102,
103
],
[
101,
104
],
[
104,
105
],
[
105,
106
],
[
105,
107
],
[
107,
108
],
[
107,
109
],
[
104,
110
],
[
110,
111
],
[
110,
112
],
[
94,
113
],
[
113,
114
],
[
114,
115
],
[
115,
116
],
[
115,
117
],
[
114,
118
],
[
118,
119
],
[
119,
120
],
[
118,
121
],
[
121,
122
],
[
121,
123
],
[
123,
124
],
[
123,
125
],
[
113,
126
],
[
126,
127
],
[
21,
128
],
[
128,
129
],
[
129,
130
],
[
130,
131
],
[
130,
132
],
[
128,
133
],
[
133,
134
],
[
133,
135
],
[
6,
136
],
[
136,
137
]
] | [
"import java.io.*;\n\nclass Main{\n\tpublic static void main(String[] args){\n\t\ttry{\n\t\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\t\tString cmd[] = br.readLine().split(\" \", 0);\n\t\t\tint S[] = new int[100];\n\t\t\tfor(int i=0, p=0; i<cmd.length; i++){\n\t\t\t\tif(cmd[i].equals(\"+\")){\n\t\t\t\t\tp--;\n\t\t\t\t\tS[p-1] += S[p];\n\t\t\t\t} else if(cmd[i].equals(\"-\")){\n\t\t\t\t\tp--;\n\t\t\t\t\tS[p-1] -= S[p];\n\t\t\t\t} else if(cmd[i].equals(\"*\")){\n\t\t\t\t\tp--;\n\t\t\t\t\tS[p-1] *= S[p];\n\t\t\t\t} else{\n\t\t\t\t\tS[p] = Integer.parseInt(\"\"+cmd[i]);\n\t\t\t\t\tp++;\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(S[0]);\n\t\t} catch(IOException e){\n\t\t\tSystem.out.println(\"Exception :\" + e);\n\t\t}\n\t}\n}",
"import java.io.*;",
"io.*",
"java",
"class Main{\n\tpublic static void main(String[] args){\n\t\ttry{\n\t\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\t\tString cmd[] = br.readLine().split(\" \", 0);\n\t\t\tint S[] = new int[100];\n\t\t\tfor(int i=0, p=0; i<cmd.length; i++){\n\t\t\t\tif(cmd[i].equals(\"+\")){\n\t\t\t\t\tp--;\n\t\t\t\t\tS[p-1] += S[p];\n\t\t\t\t} else if(cmd[i].equals(\"-\")){\n\t\t\t\t\tp--;\n\t\t\t\t\tS[p-1] -= S[p];\n\t\t\t\t} else if(cmd[i].equals(\"*\")){\n\t\t\t\t\tp--;\n\t\t\t\t\tS[p-1] *= S[p];\n\t\t\t\t} else{\n\t\t\t\t\tS[p] = Integer.parseInt(\"\"+cmd[i]);\n\t\t\t\t\tp++;\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(S[0]);\n\t\t} catch(IOException e){\n\t\t\tSystem.out.println(\"Exception :\" + e);\n\t\t}\n\t}\n}",
"Main",
"public static void main(String[] args){\n\t\ttry{\n\t\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\t\tString cmd[] = br.readLine().split(\" \", 0);\n\t\t\tint S[] = new int[100];\n\t\t\tfor(int i=0, p=0; i<cmd.length; i++){\n\t\t\t\tif(cmd[i].equals(\"+\")){\n\t\t\t\t\tp--;\n\t\t\t\t\tS[p-1] += S[p];\n\t\t\t\t} else if(cmd[i].equals(\"-\")){\n\t\t\t\t\tp--;\n\t\t\t\t\tS[p-1] -= S[p];\n\t\t\t\t} else if(cmd[i].equals(\"*\")){\n\t\t\t\t\tp--;\n\t\t\t\t\tS[p-1] *= S[p];\n\t\t\t\t} else{\n\t\t\t\t\tS[p] = Integer.parseInt(\"\"+cmd[i]);\n\t\t\t\t\tp++;\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(S[0]);\n\t\t} catch(IOException e){\n\t\t\tSystem.out.println(\"Exception :\" + e);\n\t\t}\n\t}",
"main",
"{\n\t\ttry{\n\t\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\t\tString cmd[] = br.readLine().split(\" \", 0);\n\t\t\tint S[] = new int[100];\n\t\t\tfor(int i=0, p=0; i<cmd.length; i++){\n\t\t\t\tif(cmd[i].equals(\"+\")){\n\t\t\t\t\tp--;\n\t\t\t\t\tS[p-1] += S[p];\n\t\t\t\t} else if(cmd[i].equals(\"-\")){\n\t\t\t\t\tp--;\n\t\t\t\t\tS[p-1] -= S[p];\n\t\t\t\t} else if(cmd[i].equals(\"*\")){\n\t\t\t\t\tp--;\n\t\t\t\t\tS[p-1] *= S[p];\n\t\t\t\t} else{\n\t\t\t\t\tS[p] = Integer.parseInt(\"\"+cmd[i]);\n\t\t\t\t\tp++;\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(S[0]);\n\t\t} catch(IOException e){\n\t\t\tSystem.out.println(\"Exception :\" + e);\n\t\t}\n\t}",
"try{\n\t\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\t\tString cmd[] = br.readLine().split(\" \", 0);\n\t\t\tint S[] = new int[100];\n\t\t\tfor(int i=0, p=0; i<cmd.length; i++){\n\t\t\t\tif(cmd[i].equals(\"+\")){\n\t\t\t\t\tp--;\n\t\t\t\t\tS[p-1] += S[p];\n\t\t\t\t} else if(cmd[i].equals(\"-\")){\n\t\t\t\t\tp--;\n\t\t\t\t\tS[p-1] -= S[p];\n\t\t\t\t} else if(cmd[i].equals(\"*\")){\n\t\t\t\t\tp--;\n\t\t\t\t\tS[p-1] *= S[p];\n\t\t\t\t} else{\n\t\t\t\t\tS[p] = Integer.parseInt(\"\"+cmd[i]);\n\t\t\t\t\tp++;\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(S[0]);\n\t\t} catch(IOException e){\n\t\t\tSystem.out.println(\"Exception :\" + e);\n\t\t}",
"catch(IOException e){\n\t\t\tSystem.out.println(\"Exception :\" + e);\n\t\t}",
"IOException e",
"{\n\t\t\tSystem.out.println(\"Exception :\" + e);\n\t\t}",
"System.out.println(\"Exception :\" + e)",
"System.out.println",
"System.out",
"System",
"System.out",
"\"Exception :\" + e",
"\"Exception :\"",
"e",
"{\n\t\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\t\tString cmd[] = br.readLine().split(\" \", 0);\n\t\t\tint S[] = new int[100];\n\t\t\tfor(int i=0, p=0; i<cmd.length; i++){\n\t\t\t\tif(cmd[i].equals(\"+\")){\n\t\t\t\t\tp--;\n\t\t\t\t\tS[p-1] += S[p];\n\t\t\t\t} else if(cmd[i].equals(\"-\")){\n\t\t\t\t\tp--;\n\t\t\t\t\tS[p-1] -= S[p];\n\t\t\t\t} else if(cmd[i].equals(\"*\")){\n\t\t\t\t\tp--;\n\t\t\t\t\tS[p-1] *= S[p];\n\t\t\t\t} else{\n\t\t\t\t\tS[p] = Integer.parseInt(\"\"+cmd[i]);\n\t\t\t\t\tp++;\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(S[0]);\n\t\t}",
"BufferedReader br = new BufferedReader(new InputStreamReader(System.in));",
"br",
"new BufferedReader(new InputStreamReader(System.in))",
"String cmd[] = br.readLine().split(\" \", 0);",
"cmd",
"br.readLine().split(\" \", 0)",
"br.readLine().split",
"br.readLine()",
"br.readLine",
"br",
"\" \"",
"0",
"int S[] = new int[100];",
"S",
"new int[100]",
"100",
"for(int i=0, p=0; i<cmd.length; i++){\n\t\t\t\tif(cmd[i].equals(\"+\")){\n\t\t\t\t\tp--;\n\t\t\t\t\tS[p-1] += S[p];\n\t\t\t\t} else if(cmd[i].equals(\"-\")){\n\t\t\t\t\tp--;\n\t\t\t\t\tS[p-1] -= S[p];\n\t\t\t\t} else if(cmd[i].equals(\"*\")){\n\t\t\t\t\tp--;\n\t\t\t\t\tS[p-1] *= S[p];\n\t\t\t\t} else{\n\t\t\t\t\tS[p] = Integer.parseInt(\"\"+cmd[i]);\n\t\t\t\t\tp++;\n\t\t\t\t}\n\t\t\t}",
"int i=0, p=0;",
"int i=0",
"i",
"0",
"p=0;",
"p",
"0",
"i<cmd.length",
"i",
"cmd.length",
"cmd",
"cmd.length",
"i++",
"i++",
"i",
"{\n\t\t\t\tif(cmd[i].equals(\"+\")){\n\t\t\t\t\tp--;\n\t\t\t\t\tS[p-1] += S[p];\n\t\t\t\t} else if(cmd[i].equals(\"-\")){\n\t\t\t\t\tp--;\n\t\t\t\t\tS[p-1] -= S[p];\n\t\t\t\t} else if(cmd[i].equals(\"*\")){\n\t\t\t\t\tp--;\n\t\t\t\t\tS[p-1] *= S[p];\n\t\t\t\t} else{\n\t\t\t\t\tS[p] = Integer.parseInt(\"\"+cmd[i]);\n\t\t\t\t\tp++;\n\t\t\t\t}\n\t\t\t}",
"{\n\t\t\t\tif(cmd[i].equals(\"+\")){\n\t\t\t\t\tp--;\n\t\t\t\t\tS[p-1] += S[p];\n\t\t\t\t} else if(cmd[i].equals(\"-\")){\n\t\t\t\t\tp--;\n\t\t\t\t\tS[p-1] -= S[p];\n\t\t\t\t} else if(cmd[i].equals(\"*\")){\n\t\t\t\t\tp--;\n\t\t\t\t\tS[p-1] *= S[p];\n\t\t\t\t} else{\n\t\t\t\t\tS[p] = Integer.parseInt(\"\"+cmd[i]);\n\t\t\t\t\tp++;\n\t\t\t\t}\n\t\t\t}",
"if(cmd[i].equals(\"+\")){\n\t\t\t\t\tp--;\n\t\t\t\t\tS[p-1] += S[p];\n\t\t\t\t} else if(cmd[i].equals(\"-\")){\n\t\t\t\t\tp--;\n\t\t\t\t\tS[p-1] -= S[p];\n\t\t\t\t} else if(cmd[i].equals(\"*\")){\n\t\t\t\t\tp--;\n\t\t\t\t\tS[p-1] *= S[p];\n\t\t\t\t} else{\n\t\t\t\t\tS[p] = Integer.parseInt(\"\"+cmd[i]);\n\t\t\t\t\tp++;\n\t\t\t\t}",
"cmd[i].equals(\"+\")",
"cmd[i].equals",
"cmd[i]",
"cmd",
"i",
"\"+\"",
"{\n\t\t\t\t\tp--;\n\t\t\t\t\tS[p-1] += S[p];\n\t\t\t\t}",
"p--",
"p",
"S[p-1] += S[p]",
"S[p-1]",
"S",
"p-1",
"p",
"1",
"S[p]",
"S",
"p",
"if(cmd[i].equals(\"-\")){\n\t\t\t\t\tp--;\n\t\t\t\t\tS[p-1] -= S[p];\n\t\t\t\t} else if(cmd[i].equals(\"*\")){\n\t\t\t\t\tp--;\n\t\t\t\t\tS[p-1] *= S[p];\n\t\t\t\t} else{\n\t\t\t\t\tS[p] = Integer.parseInt(\"\"+cmd[i]);\n\t\t\t\t\tp++;\n\t\t\t\t}",
"cmd[i].equals(\"-\")",
"cmd[i].equals",
"cmd[i]",
"cmd",
"i",
"\"-\"",
"{\n\t\t\t\t\tp--;\n\t\t\t\t\tS[p-1] -= S[p];\n\t\t\t\t}",
"p--",
"p",
"S[p-1] -= S[p]",
"S[p-1]",
"S",
"p-1",
"p",
"1",
"S[p]",
"S",
"p",
"if(cmd[i].equals(\"*\")){\n\t\t\t\t\tp--;\n\t\t\t\t\tS[p-1] *= S[p];\n\t\t\t\t} else{\n\t\t\t\t\tS[p] = Integer.parseInt(\"\"+cmd[i]);\n\t\t\t\t\tp++;\n\t\t\t\t}",
"cmd[i].equals(\"*\")",
"cmd[i].equals",
"cmd[i]",
"cmd",
"i",
"\"*\"",
"{\n\t\t\t\t\tp--;\n\t\t\t\t\tS[p-1] *= S[p];\n\t\t\t\t}",
"p--",
"p",
"S[p-1] *= S[p]",
"S[p-1]",
"S",
"p-1",
"p",
"1",
"S[p]",
"S",
"p",
"{\n\t\t\t\t\tS[p] = Integer.parseInt(\"\"+cmd[i]);\n\t\t\t\t\tp++;\n\t\t\t\t}",
"S[p] = Integer.parseInt(\"\"+cmd[i])",
"S[p]",
"S",
"p",
"Integer.parseInt(\"\"+cmd[i])",
"Integer.parseInt",
"Integer",
"\"\"+cmd[i]",
"\"\"",
"cmd[i]",
"cmd",
"i",
"p++",
"p",
"System.out.println(S[0])",
"System.out.println",
"System.out",
"System",
"System.out",
"S[0]",
"S",
"0",
"String[] args",
"args"
] | import java.io.*;
class Main{
public static void main(String[] args){
try{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String cmd[] = br.readLine().split(" ", 0);
int S[] = new int[100];
for(int i=0, p=0; i<cmd.length; i++){
if(cmd[i].equals("+")){
p--;
S[p-1] += S[p];
} else if(cmd[i].equals("-")){
p--;
S[p-1] -= S[p];
} else if(cmd[i].equals("*")){
p--;
S[p-1] *= S[p];
} else{
S[p] = Integer.parseInt(""+cmd[i]);
p++;
}
}
System.out.println(S[0]);
} catch(IOException e){
System.out.println("Exception :" + e);
}
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
20,
17,
41,
13,
17,
42,
4,
18,
13,
30,
41,
13,
4,
18,
13,
14,
4,
18,
13,
17,
30,
41,
13,
18,
13,
40,
13,
41,
13,
18,
13,
40,
13,
0,
18,
13,
40,
13,
2,
13,
13,
14,
4,
18,
13,
17,
30,
41,
13,
18,
13,
40,
13,
41,
13,
18,
13,
40,
13,
0,
18,
13,
40,
13,
2,
13,
13,
14,
4,
18,
13,
17,
30,
41,
13,
18,
13,
40,
13,
41,
13,
18,
13,
40,
13,
0,
18,
13,
40,
13,
2,
13,
13,
30,
41,
13,
4,
18,
13,
13,
0,
18,
13,
40,
13,
13,
4,
18,
18,
13,
13,
18,
13,
17,
12,
13,
30,
4,
18,
20,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
137,
5
],
[
137,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
8,
16
],
[
16,
17
],
[
16,
18
],
[
8,
19
],
[
19,
20
],
[
20,
21
],
[
21,
22
],
[
19,
23
],
[
23,
24
],
[
24,
25
],
[
24,
26
],
[
26,
27
],
[
27,
28
],
[
23,
29
],
[
29,
30
],
[
30,
31
],
[
31,
32
],
[
30,
33
],
[
29,
34
],
[
34,
35
],
[
35,
36
],
[
35,
37
],
[
37,
38
],
[
37,
39
],
[
39,
40
],
[
34,
41
],
[
41,
42
],
[
41,
43
],
[
43,
44
],
[
43,
45
],
[
45,
46
],
[
34,
47
],
[
47,
48
],
[
48,
49
],
[
48,
50
],
[
50,
51
],
[
47,
52
],
[
52,
53
],
[
52,
54
],
[
29,
55
],
[
55,
56
],
[
56,
57
],
[
57,
58
],
[
56,
59
],
[
55,
60
],
[
60,
61
],
[
61,
62
],
[
61,
63
],
[
63,
64
],
[
63,
65
],
[
65,
66
],
[
60,
67
],
[
67,
68
],
[
67,
69
],
[
69,
70
],
[
69,
71
],
[
71,
72
],
[
60,
73
],
[
73,
74
],
[
74,
75
],
[
74,
76
],
[
76,
77
],
[
73,
78
],
[
78,
79
],
[
78,
80
],
[
55,
81
],
[
81,
82
],
[
82,
83
],
[
83,
84
],
[
82,
85
],
[
81,
86
],
[
86,
87
],
[
87,
88
],
[
87,
89
],
[
89,
90
],
[
89,
91
],
[
91,
92
],
[
86,
93
],
[
93,
94
],
[
93,
95
],
[
95,
96
],
[
95,
97
],
[
97,
98
],
[
86,
99
],
[
99,
100
],
[
100,
101
],
[
100,
102
],
[
102,
103
],
[
99,
104
],
[
104,
105
],
[
104,
106
],
[
81,
107
],
[
107,
108
],
[
108,
109
],
[
108,
110
],
[
110,
111
],
[
111,
112
],
[
110,
113
],
[
107,
114
],
[
114,
115
],
[
115,
116
],
[
115,
117
],
[
117,
118
],
[
114,
119
],
[
8,
120
],
[
120,
121
],
[
121,
122
],
[
122,
123
],
[
122,
124
],
[
120,
125
],
[
125,
126
],
[
125,
127
],
[
137,
128
],
[
128,
129
],
[
128,
130
],
[
130,
131
],
[
131,
132
],
[
132,
133
],
[
128,
134
],
[
134,
135
],
[
0,
136
],
[
136,
137
],
[
136,
138
]
] | [
"/*\n * http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ALDS1_3_A&lang=jp\n */\nimport java.util.*;\n\npublic class Main {\n\tvoid run() {\n\t\tScanner scan = new Scanner(System.in);\n\t\tint[] stack = new int[200];\n\t\tint sp = 0;\n\t\twhile (scan.hasNext()) {\n\t\t\tString tok = scan.next();\n\t\t\tif (tok.equals(\"+\")) {\n\t\t\t\tint b = stack[--sp];\n\t\t\t\tint a = stack[--sp];\n\t\t\t\tstack[sp++] = a + b;\n\t\t\t} else if (tok.equals(\"-\")) {\n\t\t\t\tint b = stack[--sp];\n\t\t\t\tint a = stack[--sp];\n\t\t\t\tstack[sp++] = a - b;\n\t\t\t} else if (tok.equals(\"*\")) {\n\t\t\t\tint b = stack[--sp];\n\t\t\t\tint a = stack[--sp];\n\t\t\t\tstack[sp++] = a * b;\n\t\t\t} else {\n\t\t\t\tint x = Integer.parseInt(tok);\n\t\t\t\tstack[sp++] = x;\n\t\t\t}\n\t\t\t//System.out.println(sp);\n\t\t}\n\t\tSystem.out.println(stack[0]);\n\t}\n\tpublic static void main(String[] args) {\n\t\tnew Main().run();\n\t}\n}\n",
"import java.util.*;",
"util.*",
"java",
"public class Main {\n\tvoid run() {\n\t\tScanner scan = new Scanner(System.in);\n\t\tint[] stack = new int[200];\n\t\tint sp = 0;\n\t\twhile (scan.hasNext()) {\n\t\t\tString tok = scan.next();\n\t\t\tif (tok.equals(\"+\")) {\n\t\t\t\tint b = stack[--sp];\n\t\t\t\tint a = stack[--sp];\n\t\t\t\tstack[sp++] = a + b;\n\t\t\t} else if (tok.equals(\"-\")) {\n\t\t\t\tint b = stack[--sp];\n\t\t\t\tint a = stack[--sp];\n\t\t\t\tstack[sp++] = a - b;\n\t\t\t} else if (tok.equals(\"*\")) {\n\t\t\t\tint b = stack[--sp];\n\t\t\t\tint a = stack[--sp];\n\t\t\t\tstack[sp++] = a * b;\n\t\t\t} else {\n\t\t\t\tint x = Integer.parseInt(tok);\n\t\t\t\tstack[sp++] = x;\n\t\t\t}\n\t\t\t//System.out.println(sp);\n\t\t}\n\t\tSystem.out.println(stack[0]);\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\tint[] stack = new int[200];\n\t\tint sp = 0;\n\t\twhile (scan.hasNext()) {\n\t\t\tString tok = scan.next();\n\t\t\tif (tok.equals(\"+\")) {\n\t\t\t\tint b = stack[--sp];\n\t\t\t\tint a = stack[--sp];\n\t\t\t\tstack[sp++] = a + b;\n\t\t\t} else if (tok.equals(\"-\")) {\n\t\t\t\tint b = stack[--sp];\n\t\t\t\tint a = stack[--sp];\n\t\t\t\tstack[sp++] = a - b;\n\t\t\t} else if (tok.equals(\"*\")) {\n\t\t\t\tint b = stack[--sp];\n\t\t\t\tint a = stack[--sp];\n\t\t\t\tstack[sp++] = a * b;\n\t\t\t} else {\n\t\t\t\tint x = Integer.parseInt(tok);\n\t\t\t\tstack[sp++] = x;\n\t\t\t}\n\t\t\t//System.out.println(sp);\n\t\t}\n\t\tSystem.out.println(stack[0]);\n\t}",
"run",
"{\n\t\tScanner scan = new Scanner(System.in);\n\t\tint[] stack = new int[200];\n\t\tint sp = 0;\n\t\twhile (scan.hasNext()) {\n\t\t\tString tok = scan.next();\n\t\t\tif (tok.equals(\"+\")) {\n\t\t\t\tint b = stack[--sp];\n\t\t\t\tint a = stack[--sp];\n\t\t\t\tstack[sp++] = a + b;\n\t\t\t} else if (tok.equals(\"-\")) {\n\t\t\t\tint b = stack[--sp];\n\t\t\t\tint a = stack[--sp];\n\t\t\t\tstack[sp++] = a - b;\n\t\t\t} else if (tok.equals(\"*\")) {\n\t\t\t\tint b = stack[--sp];\n\t\t\t\tint a = stack[--sp];\n\t\t\t\tstack[sp++] = a * b;\n\t\t\t} else {\n\t\t\t\tint x = Integer.parseInt(tok);\n\t\t\t\tstack[sp++] = x;\n\t\t\t}\n\t\t\t//System.out.println(sp);\n\t\t}\n\t\tSystem.out.println(stack[0]);\n\t}",
"Scanner scan = new Scanner(System.in);",
"scan",
"new Scanner(System.in)",
"int[] stack = new int[200];",
"stack",
"new int[200]",
"200",
"int sp = 0;",
"sp",
"0",
"while (scan.hasNext()) {\n\t\t\tString tok = scan.next();\n\t\t\tif (tok.equals(\"+\")) {\n\t\t\t\tint b = stack[--sp];\n\t\t\t\tint a = stack[--sp];\n\t\t\t\tstack[sp++] = a + b;\n\t\t\t} else if (tok.equals(\"-\")) {\n\t\t\t\tint b = stack[--sp];\n\t\t\t\tint a = stack[--sp];\n\t\t\t\tstack[sp++] = a - b;\n\t\t\t} else if (tok.equals(\"*\")) {\n\t\t\t\tint b = stack[--sp];\n\t\t\t\tint a = stack[--sp];\n\t\t\t\tstack[sp++] = a * b;\n\t\t\t} else {\n\t\t\t\tint x = Integer.parseInt(tok);\n\t\t\t\tstack[sp++] = x;\n\t\t\t}\n\t\t\t//System.out.println(sp);\n\t\t}",
"scan.hasNext()",
"scan.hasNext",
"scan",
"{\n\t\t\tString tok = scan.next();\n\t\t\tif (tok.equals(\"+\")) {\n\t\t\t\tint b = stack[--sp];\n\t\t\t\tint a = stack[--sp];\n\t\t\t\tstack[sp++] = a + b;\n\t\t\t} else if (tok.equals(\"-\")) {\n\t\t\t\tint b = stack[--sp];\n\t\t\t\tint a = stack[--sp];\n\t\t\t\tstack[sp++] = a - b;\n\t\t\t} else if (tok.equals(\"*\")) {\n\t\t\t\tint b = stack[--sp];\n\t\t\t\tint a = stack[--sp];\n\t\t\t\tstack[sp++] = a * b;\n\t\t\t} else {\n\t\t\t\tint x = Integer.parseInt(tok);\n\t\t\t\tstack[sp++] = x;\n\t\t\t}\n\t\t\t//System.out.println(sp);\n\t\t}",
"String tok = scan.next();",
"tok",
"scan.next()",
"scan.next",
"scan",
"if (tok.equals(\"+\")) {\n\t\t\t\tint b = stack[--sp];\n\t\t\t\tint a = stack[--sp];\n\t\t\t\tstack[sp++] = a + b;\n\t\t\t} else if (tok.equals(\"-\")) {\n\t\t\t\tint b = stack[--sp];\n\t\t\t\tint a = stack[--sp];\n\t\t\t\tstack[sp++] = a - b;\n\t\t\t} else if (tok.equals(\"*\")) {\n\t\t\t\tint b = stack[--sp];\n\t\t\t\tint a = stack[--sp];\n\t\t\t\tstack[sp++] = a * b;\n\t\t\t} else {\n\t\t\t\tint x = Integer.parseInt(tok);\n\t\t\t\tstack[sp++] = x;\n\t\t\t}",
"tok.equals(\"+\")",
"tok.equals",
"tok",
"\"+\"",
"{\n\t\t\t\tint b = stack[--sp];\n\t\t\t\tint a = stack[--sp];\n\t\t\t\tstack[sp++] = a + b;\n\t\t\t}",
"int b = stack[--sp];",
"b",
"stack[--sp]",
"stack",
"--sp",
"sp",
"int a = stack[--sp];",
"a",
"stack[--sp]",
"stack",
"--sp",
"sp",
"stack[sp++] = a + b",
"stack[sp++]",
"stack",
"sp++",
"sp",
"a + b",
"a",
"b",
"if (tok.equals(\"-\")) {\n\t\t\t\tint b = stack[--sp];\n\t\t\t\tint a = stack[--sp];\n\t\t\t\tstack[sp++] = a - b;\n\t\t\t} else if (tok.equals(\"*\")) {\n\t\t\t\tint b = stack[--sp];\n\t\t\t\tint a = stack[--sp];\n\t\t\t\tstack[sp++] = a * b;\n\t\t\t} else {\n\t\t\t\tint x = Integer.parseInt(tok);\n\t\t\t\tstack[sp++] = x;\n\t\t\t}",
"tok.equals(\"-\")",
"tok.equals",
"tok",
"\"-\"",
"{\n\t\t\t\tint b = stack[--sp];\n\t\t\t\tint a = stack[--sp];\n\t\t\t\tstack[sp++] = a - b;\n\t\t\t}",
"int b = stack[--sp];",
"b",
"stack[--sp]",
"stack",
"--sp",
"sp",
"int a = stack[--sp];",
"a",
"stack[--sp]",
"stack",
"--sp",
"sp",
"stack[sp++] = a - b",
"stack[sp++]",
"stack",
"sp++",
"sp",
"a - b",
"a",
"b",
"if (tok.equals(\"*\")) {\n\t\t\t\tint b = stack[--sp];\n\t\t\t\tint a = stack[--sp];\n\t\t\t\tstack[sp++] = a * b;\n\t\t\t} else {\n\t\t\t\tint x = Integer.parseInt(tok);\n\t\t\t\tstack[sp++] = x;\n\t\t\t}",
"tok.equals(\"*\")",
"tok.equals",
"tok",
"\"*\"",
"{\n\t\t\t\tint b = stack[--sp];\n\t\t\t\tint a = stack[--sp];\n\t\t\t\tstack[sp++] = a * b;\n\t\t\t}",
"int b = stack[--sp];",
"b",
"stack[--sp]",
"stack",
"--sp",
"sp",
"int a = stack[--sp];",
"a",
"stack[--sp]",
"stack",
"--sp",
"sp",
"stack[sp++] = a * b",
"stack[sp++]",
"stack",
"sp++",
"sp",
"a * b",
"a",
"b",
"{\n\t\t\t\tint x = Integer.parseInt(tok);\n\t\t\t\tstack[sp++] = x;\n\t\t\t}",
"int x = Integer.parseInt(tok);",
"x",
"Integer.parseInt(tok)",
"Integer.parseInt",
"Integer",
"tok",
"stack[sp++] = x",
"stack[sp++]",
"stack",
"sp++",
"sp",
"x",
"System.out.println(stack[0])",
"System.out.println",
"System.out",
"System",
"System.out",
"stack[0]",
"stack",
"0",
"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\tint[] stack = new int[200];\n\t\tint sp = 0;\n\t\twhile (scan.hasNext()) {\n\t\t\tString tok = scan.next();\n\t\t\tif (tok.equals(\"+\")) {\n\t\t\t\tint b = stack[--sp];\n\t\t\t\tint a = stack[--sp];\n\t\t\t\tstack[sp++] = a + b;\n\t\t\t} else if (tok.equals(\"-\")) {\n\t\t\t\tint b = stack[--sp];\n\t\t\t\tint a = stack[--sp];\n\t\t\t\tstack[sp++] = a - b;\n\t\t\t} else if (tok.equals(\"*\")) {\n\t\t\t\tint b = stack[--sp];\n\t\t\t\tint a = stack[--sp];\n\t\t\t\tstack[sp++] = a * b;\n\t\t\t} else {\n\t\t\t\tint x = Integer.parseInt(tok);\n\t\t\t\tstack[sp++] = x;\n\t\t\t}\n\t\t\t//System.out.println(sp);\n\t\t}\n\t\tSystem.out.println(stack[0]);\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\tint[] stack = new int[200];\n\t\tint sp = 0;\n\t\twhile (scan.hasNext()) {\n\t\t\tString tok = scan.next();\n\t\t\tif (tok.equals(\"+\")) {\n\t\t\t\tint b = stack[--sp];\n\t\t\t\tint a = stack[--sp];\n\t\t\t\tstack[sp++] = a + b;\n\t\t\t} else if (tok.equals(\"-\")) {\n\t\t\t\tint b = stack[--sp];\n\t\t\t\tint a = stack[--sp];\n\t\t\t\tstack[sp++] = a - b;\n\t\t\t} else if (tok.equals(\"*\")) {\n\t\t\t\tint b = stack[--sp];\n\t\t\t\tint a = stack[--sp];\n\t\t\t\tstack[sp++] = a * b;\n\t\t\t} else {\n\t\t\t\tint x = Integer.parseInt(tok);\n\t\t\t\tstack[sp++] = x;\n\t\t\t}\n\t\t\t//System.out.println(sp);\n\t\t}\n\t\tSystem.out.println(stack[0]);\n\t}\n\tpublic static void main(String[] args) {\n\t\tnew Main().run();\n\t}\n}",
"Main"
] | /*
* http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ALDS1_3_A&lang=jp
*/
import java.util.*;
public class Main {
void run() {
Scanner scan = new Scanner(System.in);
int[] stack = new int[200];
int sp = 0;
while (scan.hasNext()) {
String tok = scan.next();
if (tok.equals("+")) {
int b = stack[--sp];
int a = stack[--sp];
stack[sp++] = a + b;
} else if (tok.equals("-")) {
int b = stack[--sp];
int a = stack[--sp];
stack[sp++] = a - b;
} else if (tok.equals("*")) {
int b = stack[--sp];
int a = stack[--sp];
stack[sp++] = a * b;
} else {
int x = Integer.parseInt(tok);
stack[sp++] = x;
}
//System.out.println(sp);
}
System.out.println(stack[0]);
}
public static void main(String[] args) {
new Main().run();
}
}
|
[
7,
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,
4,
18,
13,
2,
4,
18,
13,
4,
18,
13,
14,
4,
18,
13,
17,
4,
18,
13,
2,
2,
40,
17,
4,
18,
13,
4,
18,
13,
14,
4,
18,
13,
17,
4,
18,
13,
2,
4,
18,
13,
4,
18,
13,
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,
2,
13,
17,
0,
13,
17,
23,
13,
12,
13,
30,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
14,
2,
13,
2,
18,
13,
13,
17,
4,
18,
18,
13,
13,
18,
13,
13,
4,
18,
18,
13,
13,
2,
18,
13,
13,
17,
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,
0,
18,
13,
40,
13,
13,
23,
13,
12,
13,
30,
14,
4,
13,
29,
17,
29,
18,
13,
40,
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
],
[
8,
14
],
[
14,
15
],
[
14,
16
],
[
8,
17
],
[
17,
18
],
[
18,
19
],
[
19,
20
],
[
17,
21
],
[
21,
22
],
[
22,
23
],
[
22,
24
],
[
24,
25
],
[
25,
26
],
[
21,
27
],
[
27,
28
],
[
28,
29
],
[
29,
30
],
[
28,
31
],
[
27,
32
],
[
32,
33
],
[
33,
34
],
[
32,
35
],
[
35,
36
],
[
36,
37
],
[
37,
38
],
[
35,
39
],
[
39,
40
],
[
40,
41
],
[
27,
42
],
[
42,
43
],
[
43,
44
],
[
44,
45
],
[
43,
46
],
[
42,
47
],
[
47,
48
],
[
48,
49
],
[
47,
50
],
[
50,
51
],
[
51,
52
],
[
52,
53
],
[
51,
54
],
[
54,
55
],
[
55,
56
],
[
50,
57
],
[
57,
58
],
[
58,
59
],
[
42,
60
],
[
60,
61
],
[
61,
62
],
[
62,
63
],
[
61,
64
],
[
60,
65
],
[
65,
66
],
[
66,
67
],
[
65,
68
],
[
68,
69
],
[
69,
70
],
[
70,
71
],
[
68,
72
],
[
72,
73
],
[
73,
74
],
[
60,
75
],
[
75,
76
],
[
76,
77
],
[
75,
78
],
[
78,
79
],
[
79,
80
],
[
78,
81
],
[
8,
82
],
[
82,
83
],
[
83,
84
],
[
84,
85
],
[
84,
86
],
[
82,
87
],
[
87,
88
],
[
88,
89
],
[
6,
90
],
[
90,
91
],
[
4,
92
],
[
92,
93
],
[
92,
94
],
[
94,
95
],
[
92,
96
],
[
96,
97
],
[
92,
98
],
[
98,
99
],
[
98,
100
],
[
100,
101
],
[
101,
102
],
[
101,
103
],
[
104,
105
],
[
104,
106
],
[
100,
107
],
[
107,
108
],
[
107,
109
],
[
98,
110
],
[
110,
111
],
[
92,
112
],
[
112,
113
],
[
112,
114
],
[
114,
115
],
[
115,
116
],
[
116,
117
],
[
117,
118
],
[
117,
119
],
[
115,
120
],
[
120,
121
],
[
120,
122
],
[
122,
123
],
[
122,
124
],
[
115,
125
],
[
125,
126
],
[
126,
127
],
[
115,
128
],
[
128,
129
],
[
129,
130
],
[
130,
131
],
[
130,
132
],
[
132,
133
],
[
133,
134
],
[
133,
135
],
[
132,
136
],
[
129,
137
],
[
137,
138
],
[
138,
139
],
[
139,
140
],
[
139,
141
],
[
137,
142
],
[
142,
143
],
[
142,
144
],
[
129,
145
],
[
145,
146
],
[
146,
147
],
[
147,
148
],
[
147,
149
],
[
145,
150
],
[
150,
151
],
[
151,
152
],
[
151,
153
],
[
150,
154
],
[
92,
155
],
[
155,
156
],
[
155,
157
],
[
157,
158
],
[
158,
159
],
[
159,
160
],
[
159,
161
],
[
92,
162
],
[
162,
163
],
[
162,
164
],
[
164,
165
],
[
165,
166
],
[
166,
167
],
[
166,
168
],
[
168,
169
],
[
169,
170
],
[
169,
171
],
[
168,
172
],
[
92,
173
],
[
173,
174
],
[
173,
175
],
[
175,
176
],
[
176,
177
],
[
177,
178
],
[
176,
179
],
[
175,
180
],
[
180,
181
],
[
181,
182
],
[
181,
183
],
[
183,
184
],
[
180,
185
],
[
173,
186
],
[
186,
187
],
[
92,
188
],
[
188,
189
],
[
188,
190
],
[
190,
191
],
[
191,
192
],
[
192,
193
],
[
191,
194
],
[
194,
195
],
[
190,
196
],
[
196,
197
],
[
197,
198
],
[
197,
199
],
[
199,
200
]
] | [
"import java.util.Scanner;\nclass Main\n{\n\tstatic class Stack\n\t{\n\t\tint A[], head;\n\t\tStack( int size )\n\t\t{\n\t\t\tA = new int[size+1];\n\t\t\thead = 0;\n\t\t}\n\t\tvoid show()\n\t\t{\n\t\t\tfor( int i = 1 ; i < A.length ; i++ )\n\t\t\t\tif( i==A.length-1 )System.out.println(A[i]);\n\t\t\t\telse System.out.print(A[i]+\" \");\n\t\t}\n\t\tboolean isEmpty(){return head==0;}\n\t\tboolean isFull( ){return head==A.length-1;}\n\t\tvoid push( int key )\n\t\t{\n\t\t\tif( isFull() )return;\n\t\t\tA[++head] = key;\n\t\t}\n\t\tint pop()\n\t\t{\n\t\t\tif( isEmpty() )return 0;\n\t\t\treturn A[head--];\n\t\t}\n\t}\n\tpublic static void main( String[] args )\n\t{\n\t\tScanner sc = new Scanner( System.in );\n\t\tString com;\n\t\tStack stack = new Stack(100);\n\t\twhile( sc.hasNext() )\n\t\t{\n\t\t\tcom = sc.next();\n\t\t\t\n\t\t\tif( com.equals(\"+\") )\n\t\t\t\tstack.push( stack.pop()+stack.pop() );\n\t\t\telse if( com.equals(\"-\") )\n\t\t\t\tstack.push( -1*stack.pop()+stack.pop() );\n\t\t\telse if( com.equals(\"*\") )\n\t\t\t\tstack.push( stack.pop()*stack.pop() );\n\t\t\telse\n\t\t\t\tstack.push(Integer.parseInt(com));\n\t\t}\n\t\tSystem.out.println( stack.pop() );\n\t}\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"class Main\n{\n\tstatic class Stack\n\t{\n\t\tint A[], head;\n\t\tStack( int size )\n\t\t{\n\t\t\tA = new int[size+1];\n\t\t\thead = 0;\n\t\t}\n\t\tvoid show()\n\t\t{\n\t\t\tfor( int i = 1 ; i < A.length ; i++ )\n\t\t\t\tif( i==A.length-1 )System.out.println(A[i]);\n\t\t\t\telse System.out.print(A[i]+\" \");\n\t\t}\n\t\tboolean isEmpty(){return head==0;}\n\t\tboolean isFull( ){return head==A.length-1;}\n\t\tvoid push( int key )\n\t\t{\n\t\t\tif( isFull() )return;\n\t\t\tA[++head] = key;\n\t\t}\n\t\tint pop()\n\t\t{\n\t\t\tif( isEmpty() )return 0;\n\t\t\treturn A[head--];\n\t\t}\n\t}\n\tpublic static void main( String[] args )\n\t{\n\t\tScanner sc = new Scanner( System.in );\n\t\tString com;\n\t\tStack stack = new Stack(100);\n\t\twhile( sc.hasNext() )\n\t\t{\n\t\t\tcom = sc.next();\n\t\t\t\n\t\t\tif( com.equals(\"+\") )\n\t\t\t\tstack.push( stack.pop()+stack.pop() );\n\t\t\telse if( com.equals(\"-\") )\n\t\t\t\tstack.push( -1*stack.pop()+stack.pop() );\n\t\t\telse if( com.equals(\"*\") )\n\t\t\t\tstack.push( stack.pop()*stack.pop() );\n\t\t\telse\n\t\t\t\tstack.push(Integer.parseInt(com));\n\t\t}\n\t\tSystem.out.println( stack.pop() );\n\t}\n}",
"Main",
"public static void main( String[] args )\n\t{\n\t\tScanner sc = new Scanner( System.in );\n\t\tString com;\n\t\tStack stack = new Stack(100);\n\t\twhile( sc.hasNext() )\n\t\t{\n\t\t\tcom = sc.next();\n\t\t\t\n\t\t\tif( com.equals(\"+\") )\n\t\t\t\tstack.push( stack.pop()+stack.pop() );\n\t\t\telse if( com.equals(\"-\") )\n\t\t\t\tstack.push( -1*stack.pop()+stack.pop() );\n\t\t\telse if( com.equals(\"*\") )\n\t\t\t\tstack.push( stack.pop()*stack.pop() );\n\t\t\telse\n\t\t\t\tstack.push(Integer.parseInt(com));\n\t\t}\n\t\tSystem.out.println( stack.pop() );\n\t}",
"main",
"{\n\t\tScanner sc = new Scanner( System.in );\n\t\tString com;\n\t\tStack stack = new Stack(100);\n\t\twhile( sc.hasNext() )\n\t\t{\n\t\t\tcom = sc.next();\n\t\t\t\n\t\t\tif( com.equals(\"+\") )\n\t\t\t\tstack.push( stack.pop()+stack.pop() );\n\t\t\telse if( com.equals(\"-\") )\n\t\t\t\tstack.push( -1*stack.pop()+stack.pop() );\n\t\t\telse if( com.equals(\"*\") )\n\t\t\t\tstack.push( stack.pop()*stack.pop() );\n\t\t\telse\n\t\t\t\tstack.push(Integer.parseInt(com));\n\t\t}\n\t\tSystem.out.println( stack.pop() );\n\t}",
"Scanner sc = new Scanner( System.in );",
"sc",
"new Scanner( System.in )",
"String com;",
"com",
"Stack stack = new Stack(100);",
"stack",
"new Stack(100)",
"while( sc.hasNext() )\n\t\t{\n\t\t\tcom = sc.next();\n\t\t\t\n\t\t\tif( com.equals(\"+\") )\n\t\t\t\tstack.push( stack.pop()+stack.pop() );\n\t\t\telse if( com.equals(\"-\") )\n\t\t\t\tstack.push( -1*stack.pop()+stack.pop() );\n\t\t\telse if( com.equals(\"*\") )\n\t\t\t\tstack.push( stack.pop()*stack.pop() );\n\t\t\telse\n\t\t\t\tstack.push(Integer.parseInt(com));\n\t\t}",
"sc.hasNext()",
"sc.hasNext",
"sc",
"{\n\t\t\tcom = sc.next();\n\t\t\t\n\t\t\tif( com.equals(\"+\") )\n\t\t\t\tstack.push( stack.pop()+stack.pop() );\n\t\t\telse if( com.equals(\"-\") )\n\t\t\t\tstack.push( -1*stack.pop()+stack.pop() );\n\t\t\telse if( com.equals(\"*\") )\n\t\t\t\tstack.push( stack.pop()*stack.pop() );\n\t\t\telse\n\t\t\t\tstack.push(Integer.parseInt(com));\n\t\t}",
"com = sc.next()",
"com",
"sc.next()",
"sc.next",
"sc",
"if( com.equals(\"+\") )\n\t\t\t\tstack.push( stack.pop()+stack.pop() );\n\t\t\telse if( com.equals(\"-\") )\n\t\t\t\tstack.push( -1*stack.pop()+stack.pop() );\n\t\t\telse if( com.equals(\"*\") )\n\t\t\t\tstack.push( stack.pop()*stack.pop() );\n\t\t\telse\n\t\t\t\tstack.push(Integer.parseInt(com));",
"com.equals(\"+\")",
"com.equals",
"com",
"\"+\"",
"stack.push( stack.pop()+stack.pop() )",
"stack.push",
"stack",
"stack.pop()+stack.pop()",
"stack.pop()",
"stack.pop",
"stack",
"stack.pop()",
"stack.pop",
"stack",
"if( com.equals(\"-\") )\n\t\t\t\tstack.push( -1*stack.pop()+stack.pop() );\n\t\t\telse if( com.equals(\"*\") )\n\t\t\t\tstack.push( stack.pop()*stack.pop() );\n\t\t\telse\n\t\t\t\tstack.push(Integer.parseInt(com));",
"com.equals(\"-\")",
"com.equals",
"com",
"\"-\"",
"stack.push( -1*stack.pop()+stack.pop() )",
"stack.push",
"stack",
"-1*stack.pop()+stack.pop()",
"-1*stack.pop()",
"-1",
"1",
"stack.pop()",
"stack.pop",
"stack",
"stack.pop()",
"stack.pop",
"stack",
"if( com.equals(\"*\") )\n\t\t\t\tstack.push( stack.pop()*stack.pop() );\n\t\t\telse\n\t\t\t\tstack.push(Integer.parseInt(com));",
"com.equals(\"*\")",
"com.equals",
"com",
"\"*\"",
"stack.push( stack.pop()*stack.pop() )",
"stack.push",
"stack",
"stack.pop()*stack.pop()",
"stack.pop()",
"stack.pop",
"stack",
"stack.pop()",
"stack.pop",
"stack",
"stack.push(Integer.parseInt(com))",
"stack.push",
"stack",
"Integer.parseInt(com)",
"Integer.parseInt",
"Integer",
"com",
"System.out.println( stack.pop() )",
"System.out.println",
"System.out",
"System",
"System.out",
"stack.pop()",
"stack.pop",
"stack",
"String[] args",
"args",
"static class Stack\n\t{\n\t\tint A[], head;\n\t\tStack( int size )\n\t\t{\n\t\t\tA = new int[size+1];\n\t\t\thead = 0;\n\t\t}\n\t\tvoid show()\n\t\t{\n\t\t\tfor( int i = 1 ; i < A.length ; i++ )\n\t\t\t\tif( i==A.length-1 )System.out.println(A[i]);\n\t\t\t\telse System.out.print(A[i]+\" \");\n\t\t}\n\t\tboolean isEmpty(){return head==0;}\n\t\tboolean isFull( ){return head==A.length-1;}\n\t\tvoid push( int key )\n\t\t{\n\t\t\tif( isFull() )return;\n\t\t\tA[++head] = key;\n\t\t}\n\t\tint pop()\n\t\t{\n\t\t\tif( isEmpty() )return 0;\n\t\t\treturn A[head--];\n\t\t}\n\t}",
"Stack",
"int A[]",
"A",
"head;",
"head",
"Stack( int size )\n\t\t{\n\t\t\tA = new int[size+1];\n\t\t\thead = 0;\n\t\t}",
"Stack",
"{\n\t\t\tA = new int[size+1];\n\t\t\thead = 0;\n\t\t}",
"A = new int[size+1]",
"A",
"new int[size+1]",
"size+1",
"size",
"1",
"head = 0",
"head",
"0",
"int size",
"size",
"void show()\n\t\t{\n\t\t\tfor( int i = 1 ; i < A.length ; i++ )\n\t\t\t\tif( i==A.length-1 )System.out.println(A[i]);\n\t\t\t\telse System.out.print(A[i]+\" \");\n\t\t}",
"show",
"{\n\t\t\tfor( int i = 1 ; i < A.length ; i++ )\n\t\t\t\tif( i==A.length-1 )System.out.println(A[i]);\n\t\t\t\telse System.out.print(A[i]+\" \");\n\t\t}",
"for( int i = 1 ; i < A.length ; i++ )\n\t\t\t\tif( i==A.length-1 )System.out.println(A[i]);\n\t\t\t\telse System.out.print(A[i]+\" \");",
"int i = 1 ;",
"int i = 1 ;",
"i",
"1",
"i < A.length",
"i",
"A.length",
"A",
"A.length",
"i++",
"i++",
"i",
"if( i==A.length-1 )System.out.println(A[i]);\n\t\t\t\telse System.out.print(A[i]+\" \");",
"if( i==A.length-1 )System.out.println(A[i]);\n\t\t\t\telse System.out.print(A[i]+\" \");",
"i==A.length-1",
"i",
"A.length-1",
"A.length",
"A",
"A.length",
"1",
"System.out.println(A[i])",
"System.out.println",
"System.out",
"System",
"System.out",
"A[i]",
"A",
"i",
"System.out.print(A[i]+\" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"A[i]+\" \"",
"A[i]",
"A",
"i",
"\" \"",
"boolean isEmpty(){return head==0;}",
"isEmpty",
"{return head==0;}",
"return head==0;",
"head==0",
"head",
"0",
"boolean isFull( ){return head==A.length-1;}",
"isFull",
"{return head==A.length-1;}",
"return head==A.length-1;",
"head==A.length-1",
"head",
"A.length-1",
"A.length",
"A",
"A.length",
"1",
"void push( int key )\n\t\t{\n\t\t\tif( isFull() )return;\n\t\t\tA[++head] = key;\n\t\t}",
"push",
"{\n\t\t\tif( isFull() )return;\n\t\t\tA[++head] = key;\n\t\t}",
"if( isFull() )return;",
"isFull()",
"isFull",
"return;",
"A[++head] = key",
"A[++head]",
"A",
"++head",
"head",
"key",
"int key",
"key",
"int pop()\n\t\t{\n\t\t\tif( isEmpty() )return 0;\n\t\t\treturn A[head--];\n\t\t}",
"pop",
"{\n\t\t\tif( isEmpty() )return 0;\n\t\t\treturn A[head--];\n\t\t}",
"if( isEmpty() )return 0;",
"isEmpty()",
"isEmpty",
"return 0;",
"0",
"return A[head--];",
"A[head--]",
"A",
"head--",
"head"
] | import java.util.Scanner;
class Main
{
static class Stack
{
int A[], head;
Stack( int size )
{
A = new int[size+1];
head = 0;
}
void show()
{
for( int i = 1 ; i < A.length ; i++ )
if( i==A.length-1 )System.out.println(A[i]);
else System.out.print(A[i]+" ");
}
boolean isEmpty(){return head==0;}
boolean isFull( ){return head==A.length-1;}
void push( int key )
{
if( isFull() )return;
A[++head] = key;
}
int pop()
{
if( isEmpty() )return 0;
return A[head--];
}
}
public static void main( String[] args )
{
Scanner sc = new Scanner( System.in );
String com;
Stack stack = new Stack(100);
while( sc.hasNext() )
{
com = sc.next();
if( com.equals("+") )
stack.push( stack.pop()+stack.pop() );
else if( com.equals("-") )
stack.push( -1*stack.pop()+stack.pop() );
else if( com.equals("*") )
stack.push( stack.pop()*stack.pop() );
else
stack.push(Integer.parseInt(com));
}
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,
14,
4,
18,
13,
17,
30,
41,
13,
4,
18,
13,
4,
18,
13,
41,
13,
4,
18,
13,
4,
18,
13,
41,
13,
2,
13,
13,
4,
18,
13,
2,
13,
17,
14,
4,
18,
13,
17,
30,
41,
13,
4,
18,
13,
4,
18,
13,
41,
13,
4,
18,
13,
4,
18,
13,
41,
13,
2,
13,
13,
4,
18,
13,
2,
13,
17,
14,
4,
18,
13,
17,
30,
41,
13,
4,
18,
13,
4,
18,
13,
41,
13,
4,
18,
13,
4,
18,
13,
41,
13,
2,
13,
13,
4,
18,
13,
2,
13,
17,
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
],
[
143,
8
],
[
143,
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
],
[
34,
35
],
[
34,
36
],
[
36,
37
],
[
37,
38
],
[
36,
39
],
[
39,
40
],
[
40,
41
],
[
33,
42
],
[
42,
43
],
[
42,
44
],
[
44,
45
],
[
45,
46
],
[
44,
47
],
[
47,
48
],
[
48,
49
],
[
33,
50
],
[
50,
51
],
[
50,
52
],
[
52,
53
],
[
52,
54
],
[
33,
55
],
[
55,
56
],
[
56,
57
],
[
55,
58
],
[
58,
59
],
[
58,
60
],
[
28,
61
],
[
61,
62
],
[
62,
63
],
[
63,
64
],
[
62,
65
],
[
61,
66
],
[
66,
67
],
[
67,
68
],
[
67,
69
],
[
69,
70
],
[
70,
71
],
[
69,
72
],
[
72,
73
],
[
73,
74
],
[
66,
75
],
[
75,
76
],
[
75,
77
],
[
77,
78
],
[
78,
79
],
[
77,
80
],
[
80,
81
],
[
81,
82
],
[
66,
83
],
[
83,
84
],
[
83,
85
],
[
85,
86
],
[
85,
87
],
[
66,
88
],
[
88,
89
],
[
89,
90
],
[
88,
91
],
[
91,
92
],
[
91,
93
],
[
61,
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
],
[
116,
118
],
[
118,
119
],
[
118,
120
],
[
99,
121
],
[
121,
122
],
[
122,
123
],
[
121,
124
],
[
124,
125
],
[
124,
126
],
[
94,
127
],
[
127,
128
],
[
128,
129
],
[
129,
130
],
[
128,
131
],
[
11,
132
],
[
132,
133
],
[
133,
134
],
[
134,
135
],
[
134,
136
],
[
132,
137
],
[
137,
138
],
[
138,
139
],
[
9,
140
],
[
140,
141
],
[
0,
142
],
[
142,
143
],
[
142,
144
]
] | [
"\nimport java.util.Stack;\nimport java.util.Scanner;\npublic class Main {\n\tpublic static void main(String[] args) {\n\t\t\n\t\tScanner in = new Scanner(System.in);\n\t\tStack<String> expr = new Stack<>();\n\t\twhile (in.hasNext()) {\n\t\t\tString next = in.next();\n\t\t\tif (next.equals(\"+\")) {\n\t\t\t\tint a = Integer.parseInt(expr.pop());\n\t\t\t\tint b = Integer.parseInt(expr.pop());\n\t\t\t\tint result = a + b;\n\t\t\t\texpr.push((result + \"\"));\n\t\t\t} else if(next.equals(\"-\")) {\n\t\t\t\tint a = Integer.parseInt(expr.pop());\n\t\t\t\tint b = Integer.parseInt(expr.pop());\n\t\t\t\tint result = b - a;\n\t\t\t\texpr.push((result + \"\"));\n\t\t\t} else if (next.equals(\"*\")) {\n\t\t\t\tint a = Integer.parseInt(expr.pop());\n\t\t\t\tint b = Integer.parseInt(expr.pop());\n\t\t\t\tint result = a * b;\n\t\t\t\texpr.push((result + \"\"));\n\t\t\t} else {\n\t\t\t\texpr.push(next);\n\t\t\t}\n\t\t\t\n\t\t}\n\t\tSystem.out.println(expr.peek());\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\t\n\t\tScanner in = new Scanner(System.in);\n\t\tStack<String> expr = new Stack<>();\n\t\twhile (in.hasNext()) {\n\t\t\tString next = in.next();\n\t\t\tif (next.equals(\"+\")) {\n\t\t\t\tint a = Integer.parseInt(expr.pop());\n\t\t\t\tint b = Integer.parseInt(expr.pop());\n\t\t\t\tint result = a + b;\n\t\t\t\texpr.push((result + \"\"));\n\t\t\t} else if(next.equals(\"-\")) {\n\t\t\t\tint a = Integer.parseInt(expr.pop());\n\t\t\t\tint b = Integer.parseInt(expr.pop());\n\t\t\t\tint result = b - a;\n\t\t\t\texpr.push((result + \"\"));\n\t\t\t} else if (next.equals(\"*\")) {\n\t\t\t\tint a = Integer.parseInt(expr.pop());\n\t\t\t\tint b = Integer.parseInt(expr.pop());\n\t\t\t\tint result = a * b;\n\t\t\t\texpr.push((result + \"\"));\n\t\t\t} else {\n\t\t\t\texpr.push(next);\n\t\t\t}\n\t\t\t\n\t\t}\n\t\tSystem.out.println(expr.peek());\n\t}\n}",
"Main",
"public static void main(String[] args) {\n\t\t\n\t\tScanner in = new Scanner(System.in);\n\t\tStack<String> expr = new Stack<>();\n\t\twhile (in.hasNext()) {\n\t\t\tString next = in.next();\n\t\t\tif (next.equals(\"+\")) {\n\t\t\t\tint a = Integer.parseInt(expr.pop());\n\t\t\t\tint b = Integer.parseInt(expr.pop());\n\t\t\t\tint result = a + b;\n\t\t\t\texpr.push((result + \"\"));\n\t\t\t} else if(next.equals(\"-\")) {\n\t\t\t\tint a = Integer.parseInt(expr.pop());\n\t\t\t\tint b = Integer.parseInt(expr.pop());\n\t\t\t\tint result = b - a;\n\t\t\t\texpr.push((result + \"\"));\n\t\t\t} else if (next.equals(\"*\")) {\n\t\t\t\tint a = Integer.parseInt(expr.pop());\n\t\t\t\tint b = Integer.parseInt(expr.pop());\n\t\t\t\tint result = a * b;\n\t\t\t\texpr.push((result + \"\"));\n\t\t\t} else {\n\t\t\t\texpr.push(next);\n\t\t\t}\n\t\t\t\n\t\t}\n\t\tSystem.out.println(expr.peek());\n\t}",
"main",
"{\n\t\t\n\t\tScanner in = new Scanner(System.in);\n\t\tStack<String> expr = new Stack<>();\n\t\twhile (in.hasNext()) {\n\t\t\tString next = in.next();\n\t\t\tif (next.equals(\"+\")) {\n\t\t\t\tint a = Integer.parseInt(expr.pop());\n\t\t\t\tint b = Integer.parseInt(expr.pop());\n\t\t\t\tint result = a + b;\n\t\t\t\texpr.push((result + \"\"));\n\t\t\t} else if(next.equals(\"-\")) {\n\t\t\t\tint a = Integer.parseInt(expr.pop());\n\t\t\t\tint b = Integer.parseInt(expr.pop());\n\t\t\t\tint result = b - a;\n\t\t\t\texpr.push((result + \"\"));\n\t\t\t} else if (next.equals(\"*\")) {\n\t\t\t\tint a = Integer.parseInt(expr.pop());\n\t\t\t\tint b = Integer.parseInt(expr.pop());\n\t\t\t\tint result = a * b;\n\t\t\t\texpr.push((result + \"\"));\n\t\t\t} else {\n\t\t\t\texpr.push(next);\n\t\t\t}\n\t\t\t\n\t\t}\n\t\tSystem.out.println(expr.peek());\n\t}",
"Scanner in = new Scanner(System.in);",
"in",
"new Scanner(System.in)",
"Stack<String> expr = new Stack<>();",
"expr",
"new Stack<>()",
"while (in.hasNext()) {\n\t\t\tString next = in.next();\n\t\t\tif (next.equals(\"+\")) {\n\t\t\t\tint a = Integer.parseInt(expr.pop());\n\t\t\t\tint b = Integer.parseInt(expr.pop());\n\t\t\t\tint result = a + b;\n\t\t\t\texpr.push((result + \"\"));\n\t\t\t} else if(next.equals(\"-\")) {\n\t\t\t\tint a = Integer.parseInt(expr.pop());\n\t\t\t\tint b = Integer.parseInt(expr.pop());\n\t\t\t\tint result = b - a;\n\t\t\t\texpr.push((result + \"\"));\n\t\t\t} else if (next.equals(\"*\")) {\n\t\t\t\tint a = Integer.parseInt(expr.pop());\n\t\t\t\tint b = Integer.parseInt(expr.pop());\n\t\t\t\tint result = a * b;\n\t\t\t\texpr.push((result + \"\"));\n\t\t\t} else {\n\t\t\t\texpr.push(next);\n\t\t\t}\n\t\t\t\n\t\t}",
"in.hasNext()",
"in.hasNext",
"in",
"{\n\t\t\tString next = in.next();\n\t\t\tif (next.equals(\"+\")) {\n\t\t\t\tint a = Integer.parseInt(expr.pop());\n\t\t\t\tint b = Integer.parseInt(expr.pop());\n\t\t\t\tint result = a + b;\n\t\t\t\texpr.push((result + \"\"));\n\t\t\t} else if(next.equals(\"-\")) {\n\t\t\t\tint a = Integer.parseInt(expr.pop());\n\t\t\t\tint b = Integer.parseInt(expr.pop());\n\t\t\t\tint result = b - a;\n\t\t\t\texpr.push((result + \"\"));\n\t\t\t} else if (next.equals(\"*\")) {\n\t\t\t\tint a = Integer.parseInt(expr.pop());\n\t\t\t\tint b = Integer.parseInt(expr.pop());\n\t\t\t\tint result = a * b;\n\t\t\t\texpr.push((result + \"\"));\n\t\t\t} else {\n\t\t\t\texpr.push(next);\n\t\t\t}\n\t\t\t\n\t\t}",
"String next = in.next();",
"next",
"in.next()",
"in.next",
"in",
"if (next.equals(\"+\")) {\n\t\t\t\tint a = Integer.parseInt(expr.pop());\n\t\t\t\tint b = Integer.parseInt(expr.pop());\n\t\t\t\tint result = a + b;\n\t\t\t\texpr.push((result + \"\"));\n\t\t\t} else if(next.equals(\"-\")) {\n\t\t\t\tint a = Integer.parseInt(expr.pop());\n\t\t\t\tint b = Integer.parseInt(expr.pop());\n\t\t\t\tint result = b - a;\n\t\t\t\texpr.push((result + \"\"));\n\t\t\t} else if (next.equals(\"*\")) {\n\t\t\t\tint a = Integer.parseInt(expr.pop());\n\t\t\t\tint b = Integer.parseInt(expr.pop());\n\t\t\t\tint result = a * b;\n\t\t\t\texpr.push((result + \"\"));\n\t\t\t} else {\n\t\t\t\texpr.push(next);\n\t\t\t}",
"next.equals(\"+\")",
"next.equals",
"next",
"\"+\"",
"{\n\t\t\t\tint a = Integer.parseInt(expr.pop());\n\t\t\t\tint b = Integer.parseInt(expr.pop());\n\t\t\t\tint result = a + b;\n\t\t\t\texpr.push((result + \"\"));\n\t\t\t}",
"int a = Integer.parseInt(expr.pop());",
"a",
"Integer.parseInt(expr.pop())",
"Integer.parseInt",
"Integer",
"expr.pop()",
"expr.pop",
"expr",
"int b = Integer.parseInt(expr.pop());",
"b",
"Integer.parseInt(expr.pop())",
"Integer.parseInt",
"Integer",
"expr.pop()",
"expr.pop",
"expr",
"int result = a + b;",
"result",
"a + b",
"a",
"b",
"expr.push((result + \"\"))",
"expr.push",
"expr",
"(result + \"\")",
"result",
"\"\"",
"if(next.equals(\"-\")) {\n\t\t\t\tint a = Integer.parseInt(expr.pop());\n\t\t\t\tint b = Integer.parseInt(expr.pop());\n\t\t\t\tint result = b - a;\n\t\t\t\texpr.push((result + \"\"));\n\t\t\t} else if (next.equals(\"*\")) {\n\t\t\t\tint a = Integer.parseInt(expr.pop());\n\t\t\t\tint b = Integer.parseInt(expr.pop());\n\t\t\t\tint result = a * b;\n\t\t\t\texpr.push((result + \"\"));\n\t\t\t} else {\n\t\t\t\texpr.push(next);\n\t\t\t}",
"next.equals(\"-\")",
"next.equals",
"next",
"\"-\"",
"{\n\t\t\t\tint a = Integer.parseInt(expr.pop());\n\t\t\t\tint b = Integer.parseInt(expr.pop());\n\t\t\t\tint result = b - a;\n\t\t\t\texpr.push((result + \"\"));\n\t\t\t}",
"int a = Integer.parseInt(expr.pop());",
"a",
"Integer.parseInt(expr.pop())",
"Integer.parseInt",
"Integer",
"expr.pop()",
"expr.pop",
"expr",
"int b = Integer.parseInt(expr.pop());",
"b",
"Integer.parseInt(expr.pop())",
"Integer.parseInt",
"Integer",
"expr.pop()",
"expr.pop",
"expr",
"int result = b - a;",
"result",
"b - a",
"b",
"a",
"expr.push((result + \"\"))",
"expr.push",
"expr",
"(result + \"\")",
"result",
"\"\"",
"if (next.equals(\"*\")) {\n\t\t\t\tint a = Integer.parseInt(expr.pop());\n\t\t\t\tint b = Integer.parseInt(expr.pop());\n\t\t\t\tint result = a * b;\n\t\t\t\texpr.push((result + \"\"));\n\t\t\t} else {\n\t\t\t\texpr.push(next);\n\t\t\t}",
"next.equals(\"*\")",
"next.equals",
"next",
"\"*\"",
"{\n\t\t\t\tint a = Integer.parseInt(expr.pop());\n\t\t\t\tint b = Integer.parseInt(expr.pop());\n\t\t\t\tint result = a * b;\n\t\t\t\texpr.push((result + \"\"));\n\t\t\t}",
"int a = Integer.parseInt(expr.pop());",
"a",
"Integer.parseInt(expr.pop())",
"Integer.parseInt",
"Integer",
"expr.pop()",
"expr.pop",
"expr",
"int b = Integer.parseInt(expr.pop());",
"b",
"Integer.parseInt(expr.pop())",
"Integer.parseInt",
"Integer",
"expr.pop()",
"expr.pop",
"expr",
"int result = a * b;",
"result",
"a * b",
"a",
"b",
"expr.push((result + \"\"))",
"expr.push",
"expr",
"(result + \"\")",
"result",
"\"\"",
"{\n\t\t\t\texpr.push(next);\n\t\t\t}",
"expr.push(next)",
"expr.push",
"expr",
"next",
"System.out.println(expr.peek())",
"System.out.println",
"System.out",
"System",
"System.out",
"expr.peek()",
"expr.peek",
"expr",
"String[] args",
"args",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\t\n\t\tScanner in = new Scanner(System.in);\n\t\tStack<String> expr = new Stack<>();\n\t\twhile (in.hasNext()) {\n\t\t\tString next = in.next();\n\t\t\tif (next.equals(\"+\")) {\n\t\t\t\tint a = Integer.parseInt(expr.pop());\n\t\t\t\tint b = Integer.parseInt(expr.pop());\n\t\t\t\tint result = a + b;\n\t\t\t\texpr.push((result + \"\"));\n\t\t\t} else if(next.equals(\"-\")) {\n\t\t\t\tint a = Integer.parseInt(expr.pop());\n\t\t\t\tint b = Integer.parseInt(expr.pop());\n\t\t\t\tint result = b - a;\n\t\t\t\texpr.push((result + \"\"));\n\t\t\t} else if (next.equals(\"*\")) {\n\t\t\t\tint a = Integer.parseInt(expr.pop());\n\t\t\t\tint b = Integer.parseInt(expr.pop());\n\t\t\t\tint result = a * b;\n\t\t\t\texpr.push((result + \"\"));\n\t\t\t} else {\n\t\t\t\texpr.push(next);\n\t\t\t}\n\t\t\t\n\t\t}\n\t\tSystem.out.println(expr.peek());\n\t}\n}",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\t\n\t\tScanner in = new Scanner(System.in);\n\t\tStack<String> expr = new Stack<>();\n\t\twhile (in.hasNext()) {\n\t\t\tString next = in.next();\n\t\t\tif (next.equals(\"+\")) {\n\t\t\t\tint a = Integer.parseInt(expr.pop());\n\t\t\t\tint b = Integer.parseInt(expr.pop());\n\t\t\t\tint result = a + b;\n\t\t\t\texpr.push((result + \"\"));\n\t\t\t} else if(next.equals(\"-\")) {\n\t\t\t\tint a = Integer.parseInt(expr.pop());\n\t\t\t\tint b = Integer.parseInt(expr.pop());\n\t\t\t\tint result = b - a;\n\t\t\t\texpr.push((result + \"\"));\n\t\t\t} else if (next.equals(\"*\")) {\n\t\t\t\tint a = Integer.parseInt(expr.pop());\n\t\t\t\tint b = Integer.parseInt(expr.pop());\n\t\t\t\tint result = a * b;\n\t\t\t\texpr.push((result + \"\"));\n\t\t\t} else {\n\t\t\t\texpr.push(next);\n\t\t\t}\n\t\t\t\n\t\t}\n\t\tSystem.out.println(expr.peek());\n\t}\n}",
"Main"
] |
import java.util.Stack;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
Stack<String> expr = new Stack<>();
while (in.hasNext()) {
String next = in.next();
if (next.equals("+")) {
int a = Integer.parseInt(expr.pop());
int b = Integer.parseInt(expr.pop());
int result = a + b;
expr.push((result + ""));
} else if(next.equals("-")) {
int a = Integer.parseInt(expr.pop());
int b = Integer.parseInt(expr.pop());
int result = b - a;
expr.push((result + ""));
} else if (next.equals("*")) {
int a = Integer.parseInt(expr.pop());
int b = Integer.parseInt(expr.pop());
int result = a * b;
expr.push((result + ""));
} else {
expr.push(next);
}
}
System.out.println(expr.peek());
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
41,
13,
12,
13,
30,
0,
13,
20,
41,
13,
20,
41,
13,
42,
4,
18,
13,
30,
0,
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,
14,
2,
2,
17,
4,
18,
13,
17,
2,
4,
18,
13,
17,
17,
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
],
[
137,
8
],
[
137,
9
],
[
9,
10
],
[
137,
11
],
[
11,
12
],
[
11,
13
],
[
13,
14
],
[
14,
15
],
[
14,
16
],
[
13,
17
],
[
17,
18
],
[
17,
19
],
[
13,
20
],
[
20,
21
],
[
13,
22
],
[
22,
23
],
[
23,
24
],
[
24,
25
],
[
22,
26
],
[
26,
27
],
[
27,
28
],
[
27,
29
],
[
29,
30
],
[
30,
31
],
[
26,
32
],
[
32,
33
],
[
33,
34
],
[
34,
35
],
[
35,
36
],
[
34,
37
],
[
33,
38
],
[
32,
39
],
[
39,
40
],
[
40,
41
],
[
40,
42
],
[
42,
43
],
[
43,
44
],
[
39,
45
],
[
45,
46
],
[
45,
47
],
[
47,
48
],
[
48,
49
],
[
39,
50
],
[
50,
51
],
[
51,
52
],
[
50,
53
],
[
53,
54
],
[
53,
55
],
[
26,
56
],
[
56,
57
],
[
57,
58
],
[
58,
59
],
[
59,
60
],
[
58,
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
],
[
26,
80
],
[
80,
81
],
[
81,
82
],
[
82,
83
],
[
83,
84
],
[
82,
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
],
[
106,
108
],
[
108,
109
],
[
109,
110
],
[
108,
111
],
[
105,
112
],
[
112,
113
],
[
113,
114
],
[
114,
115
],
[
113,
116
],
[
112,
117
],
[
104,
118
],
[
118,
119
],
[
119,
120
],
[
120,
121
],
[
119,
122
],
[
122,
123
],
[
123,
124
],
[
122,
125
],
[
13,
126
],
[
126,
127
],
[
127,
128
],
[
128,
129
],
[
128,
130
],
[
126,
131
],
[
131,
132
],
[
132,
133
],
[
11,
134
],
[
134,
135
],
[
0,
136
],
[
136,
137
],
[
136,
138
]
] | [
"import java.util.LinkedList;\nimport java.util.Scanner;\n\npublic class Main {\n\tprivate static Scanner sc;\n\tpublic static void main(String[] args){\n\t\tsc=new Scanner(System.in);\n\t\tLinkedList<Integer> S = new LinkedList<Integer>();\n\t\tString x;\n\t\twhile(sc.hasNext()){\n\t\t\tx=sc.next();\n\t\t\tif(x.charAt(0)=='+'){\n\t\t\t\tint a=(int) S.pop();\n\t\t\t\tint b=(int) S.pop();\n\t\t\t\tS.push(a+b);\n\t\t\t}\n\t\t\tif(x.charAt(0)=='-'){\n\t\t\t\tint a=(int) S.pop();\n\t\t\t\tint b=(int) S.pop();\n\t\t\t\tS.push(b-a);\n\t\t\t}\n\t\t\tif(x.charAt(0)=='*'){\n\t\t\t\tint a=(int) S.pop();\n\t\t\t\tint b=(int) S.pop();\n\t\t\t\tS.push(a*b);\n\t\t\t}else if('0'<=x.charAt(0) && x.charAt(0)<='9'){\n\t\t\t\tS.push(Integer.parseInt(x));\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(S.pop());\n\t}\n\n}",
"import java.util.LinkedList;",
"LinkedList",
"java.util",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\tprivate static Scanner sc;\n\tpublic static void main(String[] args){\n\t\tsc=new Scanner(System.in);\n\t\tLinkedList<Integer> S = new LinkedList<Integer>();\n\t\tString x;\n\t\twhile(sc.hasNext()){\n\t\t\tx=sc.next();\n\t\t\tif(x.charAt(0)=='+'){\n\t\t\t\tint a=(int) S.pop();\n\t\t\t\tint b=(int) S.pop();\n\t\t\t\tS.push(a+b);\n\t\t\t}\n\t\t\tif(x.charAt(0)=='-'){\n\t\t\t\tint a=(int) S.pop();\n\t\t\t\tint b=(int) S.pop();\n\t\t\t\tS.push(b-a);\n\t\t\t}\n\t\t\tif(x.charAt(0)=='*'){\n\t\t\t\tint a=(int) S.pop();\n\t\t\t\tint b=(int) S.pop();\n\t\t\t\tS.push(a*b);\n\t\t\t}else if('0'<=x.charAt(0) && x.charAt(0)<='9'){\n\t\t\t\tS.push(Integer.parseInt(x));\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(S.pop());\n\t}\n\n}",
"Main",
"private static Scanner sc;",
"sc",
"public static void main(String[] args){\n\t\tsc=new Scanner(System.in);\n\t\tLinkedList<Integer> S = new LinkedList<Integer>();\n\t\tString x;\n\t\twhile(sc.hasNext()){\n\t\t\tx=sc.next();\n\t\t\tif(x.charAt(0)=='+'){\n\t\t\t\tint a=(int) S.pop();\n\t\t\t\tint b=(int) S.pop();\n\t\t\t\tS.push(a+b);\n\t\t\t}\n\t\t\tif(x.charAt(0)=='-'){\n\t\t\t\tint a=(int) S.pop();\n\t\t\t\tint b=(int) S.pop();\n\t\t\t\tS.push(b-a);\n\t\t\t}\n\t\t\tif(x.charAt(0)=='*'){\n\t\t\t\tint a=(int) S.pop();\n\t\t\t\tint b=(int) S.pop();\n\t\t\t\tS.push(a*b);\n\t\t\t}else if('0'<=x.charAt(0) && x.charAt(0)<='9'){\n\t\t\t\tS.push(Integer.parseInt(x));\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(S.pop());\n\t}",
"main",
"{\n\t\tsc=new Scanner(System.in);\n\t\tLinkedList<Integer> S = new LinkedList<Integer>();\n\t\tString x;\n\t\twhile(sc.hasNext()){\n\t\t\tx=sc.next();\n\t\t\tif(x.charAt(0)=='+'){\n\t\t\t\tint a=(int) S.pop();\n\t\t\t\tint b=(int) S.pop();\n\t\t\t\tS.push(a+b);\n\t\t\t}\n\t\t\tif(x.charAt(0)=='-'){\n\t\t\t\tint a=(int) S.pop();\n\t\t\t\tint b=(int) S.pop();\n\t\t\t\tS.push(b-a);\n\t\t\t}\n\t\t\tif(x.charAt(0)=='*'){\n\t\t\t\tint a=(int) S.pop();\n\t\t\t\tint b=(int) S.pop();\n\t\t\t\tS.push(a*b);\n\t\t\t}else if('0'<=x.charAt(0) && x.charAt(0)<='9'){\n\t\t\t\tS.push(Integer.parseInt(x));\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(S.pop());\n\t}",
"sc=new Scanner(System.in)",
"sc",
"new Scanner(System.in)",
"LinkedList<Integer> S = new LinkedList<Integer>();",
"S",
"new LinkedList<Integer>()",
"String x;",
"x",
"while(sc.hasNext()){\n\t\t\tx=sc.next();\n\t\t\tif(x.charAt(0)=='+'){\n\t\t\t\tint a=(int) S.pop();\n\t\t\t\tint b=(int) S.pop();\n\t\t\t\tS.push(a+b);\n\t\t\t}\n\t\t\tif(x.charAt(0)=='-'){\n\t\t\t\tint a=(int) S.pop();\n\t\t\t\tint b=(int) S.pop();\n\t\t\t\tS.push(b-a);\n\t\t\t}\n\t\t\tif(x.charAt(0)=='*'){\n\t\t\t\tint a=(int) S.pop();\n\t\t\t\tint b=(int) S.pop();\n\t\t\t\tS.push(a*b);\n\t\t\t}else if('0'<=x.charAt(0) && x.charAt(0)<='9'){\n\t\t\t\tS.push(Integer.parseInt(x));\n\t\t\t}\n\t\t}",
"sc.hasNext()",
"sc.hasNext",
"sc",
"{\n\t\t\tx=sc.next();\n\t\t\tif(x.charAt(0)=='+'){\n\t\t\t\tint a=(int) S.pop();\n\t\t\t\tint b=(int) S.pop();\n\t\t\t\tS.push(a+b);\n\t\t\t}\n\t\t\tif(x.charAt(0)=='-'){\n\t\t\t\tint a=(int) S.pop();\n\t\t\t\tint b=(int) S.pop();\n\t\t\t\tS.push(b-a);\n\t\t\t}\n\t\t\tif(x.charAt(0)=='*'){\n\t\t\t\tint a=(int) S.pop();\n\t\t\t\tint b=(int) S.pop();\n\t\t\t\tS.push(a*b);\n\t\t\t}else if('0'<=x.charAt(0) && x.charAt(0)<='9'){\n\t\t\t\tS.push(Integer.parseInt(x));\n\t\t\t}\n\t\t}",
"x=sc.next()",
"x",
"sc.next()",
"sc.next",
"sc",
"if(x.charAt(0)=='+'){\n\t\t\t\tint a=(int) S.pop();\n\t\t\t\tint b=(int) S.pop();\n\t\t\t\tS.push(a+b);\n\t\t\t}",
"x.charAt(0)=='+'",
"x.charAt(0)",
"x.charAt",
"x",
"0",
"'+'",
"{\n\t\t\t\tint a=(int) S.pop();\n\t\t\t\tint b=(int) S.pop();\n\t\t\t\tS.push(a+b);\n\t\t\t}",
"int a=(int) S.pop();",
"a",
"(int) S.pop()",
"S.pop",
"S",
"int b=(int) S.pop();",
"b",
"(int) S.pop()",
"S.pop",
"S",
"S.push(a+b)",
"S.push",
"S",
"a+b",
"a",
"b",
"if(x.charAt(0)=='-'){\n\t\t\t\tint a=(int) S.pop();\n\t\t\t\tint b=(int) S.pop();\n\t\t\t\tS.push(b-a);\n\t\t\t}",
"x.charAt(0)=='-'",
"x.charAt(0)",
"x.charAt",
"x",
"0",
"'-'",
"{\n\t\t\t\tint a=(int) S.pop();\n\t\t\t\tint b=(int) S.pop();\n\t\t\t\tS.push(b-a);\n\t\t\t}",
"int a=(int) S.pop();",
"a",
"(int) S.pop()",
"S.pop",
"S",
"int b=(int) S.pop();",
"b",
"(int) S.pop()",
"S.pop",
"S",
"S.push(b-a)",
"S.push",
"S",
"b-a",
"b",
"a",
"if(x.charAt(0)=='*'){\n\t\t\t\tint a=(int) S.pop();\n\t\t\t\tint b=(int) S.pop();\n\t\t\t\tS.push(a*b);\n\t\t\t}else if('0'<=x.charAt(0) && x.charAt(0)<='9'){\n\t\t\t\tS.push(Integer.parseInt(x));\n\t\t\t}",
"x.charAt(0)=='*'",
"x.charAt(0)",
"x.charAt",
"x",
"0",
"'*'",
"{\n\t\t\t\tint a=(int) S.pop();\n\t\t\t\tint b=(int) S.pop();\n\t\t\t\tS.push(a*b);\n\t\t\t}",
"int a=(int) S.pop();",
"a",
"(int) S.pop()",
"S.pop",
"S",
"int b=(int) S.pop();",
"b",
"(int) S.pop()",
"S.pop",
"S",
"S.push(a*b)",
"S.push",
"S",
"a*b",
"a",
"b",
"if('0'<=x.charAt(0) && x.charAt(0)<='9'){\n\t\t\t\tS.push(Integer.parseInt(x));\n\t\t\t}",
"'0'<=x.charAt(0) && x.charAt(0)<='9'",
"'0'<=x.charAt(0)",
"'0'",
"x.charAt(0)",
"x.charAt",
"x",
"0",
"x.charAt(0)<='9'",
"x.charAt(0)",
"x.charAt",
"x",
"0",
"'9'",
"{\n\t\t\t\tS.push(Integer.parseInt(x));\n\t\t\t}",
"S.push(Integer.parseInt(x))",
"S.push",
"S",
"Integer.parseInt(x)",
"Integer.parseInt",
"Integer",
"x",
"System.out.println(S.pop())",
"System.out.println",
"System.out",
"System",
"System.out",
"S.pop()",
"S.pop",
"S",
"String[] args",
"args",
"public class Main {\n\tprivate static Scanner sc;\n\tpublic static void main(String[] args){\n\t\tsc=new Scanner(System.in);\n\t\tLinkedList<Integer> S = new LinkedList<Integer>();\n\t\tString x;\n\t\twhile(sc.hasNext()){\n\t\t\tx=sc.next();\n\t\t\tif(x.charAt(0)=='+'){\n\t\t\t\tint a=(int) S.pop();\n\t\t\t\tint b=(int) S.pop();\n\t\t\t\tS.push(a+b);\n\t\t\t}\n\t\t\tif(x.charAt(0)=='-'){\n\t\t\t\tint a=(int) S.pop();\n\t\t\t\tint b=(int) S.pop();\n\t\t\t\tS.push(b-a);\n\t\t\t}\n\t\t\tif(x.charAt(0)=='*'){\n\t\t\t\tint a=(int) S.pop();\n\t\t\t\tint b=(int) S.pop();\n\t\t\t\tS.push(a*b);\n\t\t\t}else if('0'<=x.charAt(0) && x.charAt(0)<='9'){\n\t\t\t\tS.push(Integer.parseInt(x));\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(S.pop());\n\t}\n\n}",
"public class Main {\n\tprivate static Scanner sc;\n\tpublic static void main(String[] args){\n\t\tsc=new Scanner(System.in);\n\t\tLinkedList<Integer> S = new LinkedList<Integer>();\n\t\tString x;\n\t\twhile(sc.hasNext()){\n\t\t\tx=sc.next();\n\t\t\tif(x.charAt(0)=='+'){\n\t\t\t\tint a=(int) S.pop();\n\t\t\t\tint b=(int) S.pop();\n\t\t\t\tS.push(a+b);\n\t\t\t}\n\t\t\tif(x.charAt(0)=='-'){\n\t\t\t\tint a=(int) S.pop();\n\t\t\t\tint b=(int) S.pop();\n\t\t\t\tS.push(b-a);\n\t\t\t}\n\t\t\tif(x.charAt(0)=='*'){\n\t\t\t\tint a=(int) S.pop();\n\t\t\t\tint b=(int) S.pop();\n\t\t\t\tS.push(a*b);\n\t\t\t}else if('0'<=x.charAt(0) && x.charAt(0)<='9'){\n\t\t\t\tS.push(Integer.parseInt(x));\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(S.pop());\n\t}\n\n}",
"Main"
] | import java.util.LinkedList;
import java.util.Scanner;
public class Main {
private static Scanner sc;
public static void main(String[] args){
sc=new Scanner(System.in);
LinkedList<Integer> S = new LinkedList<Integer>();
String x;
while(sc.hasNext()){
x=sc.next();
if(x.charAt(0)=='+'){
int a=(int) S.pop();
int b=(int) S.pop();
S.push(a+b);
}
if(x.charAt(0)=='-'){
int a=(int) S.pop();
int b=(int) S.pop();
S.push(b-a);
}
if(x.charAt(0)=='*'){
int a=(int) S.pop();
int b=(int) S.pop();
S.push(a*b);
}else if('0'<=x.charAt(0) && x.charAt(0)<='9'){
S.push(Integer.parseInt(x));
}
}
System.out.println(S.pop());
}
} |
[
7,
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,
38,
5,
13,
30,
4,
18,
18,
13,
13,
13,
30,
11,
1,
41,
13,
17,
2,
13,
18,
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,
40,
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,
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,
17,
12,
13,
30,
0,
18,
36,
13,
20,
13,
23,
13,
12,
13,
30,
0,
18,
36,
13,
17,
29,
36,
12,
13,
30,
29,
2,
18,
36,
13,
17,
12,
13,
30,
29,
2,
18,
36,
13,
2,
18,
18,
36,
13,
13,
17,
12,
13,
30,
14,
4,
18,
36,
30,
37,
20,
40,
18,
36,
13,
0,
18,
13,
18,
36,
13,
13,
29,
36,
23,
13,
12,
13,
30,
14,
4,
18,
36,
30,
37,
20,
41,
13,
18,
13,
13,
40,
13,
29,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
227,
5
],
[
227,
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
],
[
8,
26
],
[
26,
27
],
[
27,
28
],
[
27,
29
],
[
29,
30
],
[
30,
31
],
[
31,
32
],
[
32,
33
],
[
32,
34
],
[
30,
35
],
[
26,
36
],
[
36,
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
],
[
53,
55
],
[
52,
56
],
[
56,
57
],
[
56,
58
],
[
58,
59
],
[
59,
60
],
[
59,
61
],
[
61,
62
],
[
62,
63
],
[
63,
64
],
[
61,
65
],
[
65,
66
],
[
66,
67
],
[
58,
68
],
[
68,
69
],
[
69,
70
],
[
68,
71
],
[
58,
72
],
[
52,
73
],
[
73,
74
],
[
73,
75
],
[
75,
76
],
[
76,
77
],
[
76,
78
],
[
78,
79
],
[
79,
80
],
[
80,
81
],
[
81,
82
],
[
78,
83
],
[
83,
84
],
[
84,
85
],
[
75,
86
],
[
86,
87
],
[
87,
88
],
[
86,
89
],
[
75,
90
],
[
52,
91
],
[
91,
92
],
[
91,
93
],
[
93,
94
],
[
94,
95
],
[
94,
96
],
[
96,
97
],
[
97,
98
],
[
98,
99
],
[
96,
100
],
[
100,
101
],
[
101,
102
],
[
93,
103
],
[
103,
104
],
[
104,
105
],
[
103,
106
],
[
93,
107
],
[
52,
108
],
[
108,
109
],
[
109,
110
],
[
110,
111
],
[
111,
112
],
[
110,
113
],
[
113,
114
],
[
114,
115
],
[
113,
116
],
[
116,
117
],
[
116,
118
],
[
109,
119
],
[
36,
120
],
[
120,
121
],
[
121,
122
],
[
122,
123
],
[
122,
124
],
[
120,
125
],
[
125,
126
],
[
126,
127
],
[
6,
128
],
[
128,
129
],
[
227,
130
],
[
130,
131
],
[
130,
132
],
[
132,
133
],
[
130,
134
],
[
134,
135
],
[
134,
136
],
[
130,
137
],
[
137,
138
],
[
137,
139
],
[
139,
140
],
[
140,
141
],
[
141,
142
],
[
141,
143
],
[
140,
144
],
[
137,
146
],
[
146,
147
],
[
130,
148
],
[
148,
149
],
[
148,
150
],
[
150,
151
],
[
151,
152
],
[
152,
153
],
[
152,
154
],
[
151,
155
],
[
150,
156
],
[
156,
157
],
[
130,
158
],
[
158,
159
],
[
158,
160
],
[
160,
161
],
[
161,
162
],
[
162,
163
],
[
163,
164
],
[
163,
165
],
[
162,
166
],
[
130,
167
],
[
167,
168
],
[
167,
169
],
[
169,
170
],
[
170,
171
],
[
171,
172
],
[
172,
173
],
[
172,
174
],
[
171,
175
],
[
175,
176
],
[
176,
177
],
[
177,
178
],
[
177,
179
],
[
176,
180
],
[
175,
181
],
[
130,
182
],
[
182,
183
],
[
182,
184
],
[
184,
185
],
[
185,
186
],
[
186,
187
],
[
187,
188
],
[
185,
189
],
[
189,
190
],
[
190,
191
],
[
184,
192
],
[
192,
193
],
[
193,
194
],
[
193,
195
],
[
184,
196
],
[
196,
197
],
[
197,
198
],
[
197,
199
],
[
199,
200
],
[
199,
201
],
[
196,
202
],
[
184,
203
],
[
203,
204
],
[
182,
205
],
[
205,
206
],
[
130,
207
],
[
207,
208
],
[
207,
209
],
[
209,
210
],
[
210,
211
],
[
211,
212
],
[
212,
213
],
[
210,
214
],
[
214,
215
],
[
215,
216
],
[
209,
217
],
[
217,
218
],
[
217,
219
],
[
219,
220
],
[
219,
221
],
[
209,
222
],
[
222,
223
],
[
209,
224
],
[
224,
225
],
[
0,
226
],
[
226,
227
],
[
226,
228
]
] | [
"import java.util.Scanner;\n\npublic class Main {\n\n\tpublic static void main(String[] args) {\n\t\t// TODO ?????????????????????????????????????????????\n\n//\t\tStackArray sa = new StackArray(1);\n//\t\ttry {\n//\t\t\tsa.push(1);\n//\t\t} catch (Exception e) {\n//\t\t\tSystem.out.println(\"catch\");\n//\t\t} finally {\n//\t\t\tSystem.out.println(\"final\");\n//\t\t}\n//\t\tSystem.out.println(\"owari\");\n\n\t\tScanner sc = new Scanner(System.in);\n\t\tString[] data = sc.nextLine().split(\" \");\n\n\t\tStackArray sa = new StackArray(data.length);\n\n\t\tint ans = 0;\n\t\ttry\n\t\t{\n\t\t\tfor (int i = 0; i < data.length; i++)\n\t\t\t{\n\t\t\t\tswitch (data[i])\n\t\t\t\t{\n\t\t\t\tcase \"+\":\n\t\t\t\t\tans = sa.pop() + sa.pop();\n\t\t\t\t\tsa.push(ans);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"-\":\n\t\t\t\t\tans = - sa.pop() + sa.pop();\n\t\t\t\t\tsa.push(ans);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"*\":\n\t\t\t\t\tans = sa.pop() * sa.pop();\n\t\t\t\t\tsa.push(ans);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tsa.push( Integer.parseInt(data[i]) );\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(sa.pop());\n\t\t}\n\t\tcatch (Exception e)\n\t\t{\n\t\t\tSystem.out.println(e);\n\t\t}\n\n\t}\n\n\tstatic class StackArray {\n\t\tint[] S;\n\n\t\tint top = 0;\n\n\t\tStackArray(int length) {\n\t\t\tthis.S = new int[length];\n\t\t}\n\n\t\tStackArray initialize() {\n\t\t\tthis.top = 0;\n\t\t\treturn this;\n\t\t}\n\n\t\tboolean isEmpty() {\n\t\t\treturn this.top == 0;\n\t\t}\n\n\t\tboolean isFull() {\n\t\t\treturn this.top >= this.S.length - 1;\n\t\t}\n\n\t\tStackArray push(int x) throws Exception {\n\t\t\tif (this.isFull()) {\n\t\t\t\tthrow new Exception();\n\t\t\t}\n\t\t\tthis.top++;\n\t\t\tS[this.top] = x;\n\t\t\treturn this;\n\t\t}\n\n\t\tint pop() throws Exception {\n\t\t\tif (this.isEmpty()) {\n\t\t\t\tthrow new Exception();\n\t\t\t}\n\t\t\tint x = S[top];\n\t\t\ttop--;\n\t\t\treturn x;\n\t\t}\n\n\t}\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\t// TODO ?????????????????????????????????????????????\n\n//\t\tStackArray sa = new StackArray(1);\n//\t\ttry {\n//\t\t\tsa.push(1);\n//\t\t} catch (Exception e) {\n//\t\t\tSystem.out.println(\"catch\");\n//\t\t} finally {\n//\t\t\tSystem.out.println(\"final\");\n//\t\t}\n//\t\tSystem.out.println(\"owari\");\n\n\t\tScanner sc = new Scanner(System.in);\n\t\tString[] data = sc.nextLine().split(\" \");\n\n\t\tStackArray sa = new StackArray(data.length);\n\n\t\tint ans = 0;\n\t\ttry\n\t\t{\n\t\t\tfor (int i = 0; i < data.length; i++)\n\t\t\t{\n\t\t\t\tswitch (data[i])\n\t\t\t\t{\n\t\t\t\tcase \"+\":\n\t\t\t\t\tans = sa.pop() + sa.pop();\n\t\t\t\t\tsa.push(ans);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"-\":\n\t\t\t\t\tans = - sa.pop() + sa.pop();\n\t\t\t\t\tsa.push(ans);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"*\":\n\t\t\t\t\tans = sa.pop() * sa.pop();\n\t\t\t\t\tsa.push(ans);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tsa.push( Integer.parseInt(data[i]) );\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(sa.pop());\n\t\t}\n\t\tcatch (Exception e)\n\t\t{\n\t\t\tSystem.out.println(e);\n\t\t}\n\n\t}\n\n\tstatic class StackArray {\n\t\tint[] S;\n\n\t\tint top = 0;\n\n\t\tStackArray(int length) {\n\t\t\tthis.S = new int[length];\n\t\t}\n\n\t\tStackArray initialize() {\n\t\t\tthis.top = 0;\n\t\t\treturn this;\n\t\t}\n\n\t\tboolean isEmpty() {\n\t\t\treturn this.top == 0;\n\t\t}\n\n\t\tboolean isFull() {\n\t\t\treturn this.top >= this.S.length - 1;\n\t\t}\n\n\t\tStackArray push(int x) throws Exception {\n\t\t\tif (this.isFull()) {\n\t\t\t\tthrow new Exception();\n\t\t\t}\n\t\t\tthis.top++;\n\t\t\tS[this.top] = x;\n\t\t\treturn this;\n\t\t}\n\n\t\tint pop() throws Exception {\n\t\t\tif (this.isEmpty()) {\n\t\t\t\tthrow new Exception();\n\t\t\t}\n\t\t\tint x = S[top];\n\t\t\ttop--;\n\t\t\treturn x;\n\t\t}\n\n\t}\n}",
"Main",
"public static void main(String[] args) {\n\t\t// TODO ?????????????????????????????????????????????\n\n//\t\tStackArray sa = new StackArray(1);\n//\t\ttry {\n//\t\t\tsa.push(1);\n//\t\t} catch (Exception e) {\n//\t\t\tSystem.out.println(\"catch\");\n//\t\t} finally {\n//\t\t\tSystem.out.println(\"final\");\n//\t\t}\n//\t\tSystem.out.println(\"owari\");\n\n\t\tScanner sc = new Scanner(System.in);\n\t\tString[] data = sc.nextLine().split(\" \");\n\n\t\tStackArray sa = new StackArray(data.length);\n\n\t\tint ans = 0;\n\t\ttry\n\t\t{\n\t\t\tfor (int i = 0; i < data.length; i++)\n\t\t\t{\n\t\t\t\tswitch (data[i])\n\t\t\t\t{\n\t\t\t\tcase \"+\":\n\t\t\t\t\tans = sa.pop() + sa.pop();\n\t\t\t\t\tsa.push(ans);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"-\":\n\t\t\t\t\tans = - sa.pop() + sa.pop();\n\t\t\t\t\tsa.push(ans);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"*\":\n\t\t\t\t\tans = sa.pop() * sa.pop();\n\t\t\t\t\tsa.push(ans);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tsa.push( Integer.parseInt(data[i]) );\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(sa.pop());\n\t\t}\n\t\tcatch (Exception e)\n\t\t{\n\t\t\tSystem.out.println(e);\n\t\t}\n\n\t}",
"main",
"{\n\t\t// TODO ?????????????????????????????????????????????\n\n//\t\tStackArray sa = new StackArray(1);\n//\t\ttry {\n//\t\t\tsa.push(1);\n//\t\t} catch (Exception e) {\n//\t\t\tSystem.out.println(\"catch\");\n//\t\t} finally {\n//\t\t\tSystem.out.println(\"final\");\n//\t\t}\n//\t\tSystem.out.println(\"owari\");\n\n\t\tScanner sc = new Scanner(System.in);\n\t\tString[] data = sc.nextLine().split(\" \");\n\n\t\tStackArray sa = new StackArray(data.length);\n\n\t\tint ans = 0;\n\t\ttry\n\t\t{\n\t\t\tfor (int i = 0; i < data.length; i++)\n\t\t\t{\n\t\t\t\tswitch (data[i])\n\t\t\t\t{\n\t\t\t\tcase \"+\":\n\t\t\t\t\tans = sa.pop() + sa.pop();\n\t\t\t\t\tsa.push(ans);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"-\":\n\t\t\t\t\tans = - sa.pop() + sa.pop();\n\t\t\t\t\tsa.push(ans);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"*\":\n\t\t\t\t\tans = sa.pop() * sa.pop();\n\t\t\t\t\tsa.push(ans);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tsa.push( Integer.parseInt(data[i]) );\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(sa.pop());\n\t\t}\n\t\tcatch (Exception e)\n\t\t{\n\t\t\tSystem.out.println(e);\n\t\t}\n\n\t}",
"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",
"\" \"",
"StackArray sa = new StackArray(data.length);",
"sa",
"new StackArray(data.length)",
"int ans = 0;",
"ans",
"0",
"try\n\t\t{\n\t\t\tfor (int i = 0; i < data.length; i++)\n\t\t\t{\n\t\t\t\tswitch (data[i])\n\t\t\t\t{\n\t\t\t\tcase \"+\":\n\t\t\t\t\tans = sa.pop() + sa.pop();\n\t\t\t\t\tsa.push(ans);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"-\":\n\t\t\t\t\tans = - sa.pop() + sa.pop();\n\t\t\t\t\tsa.push(ans);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"*\":\n\t\t\t\t\tans = sa.pop() * sa.pop();\n\t\t\t\t\tsa.push(ans);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tsa.push( Integer.parseInt(data[i]) );\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(sa.pop());\n\t\t}\n\t\tcatch (Exception e)\n\t\t{\n\t\t\tSystem.out.println(e);\n\t\t}",
"catch (Exception e)\n\t\t{\n\t\t\tSystem.out.println(e);\n\t\t}",
"Exception e",
"{\n\t\t\tSystem.out.println(e);\n\t\t}",
"System.out.println(e)",
"System.out.println",
"System.out",
"System",
"System.out",
"e",
"{\n\t\t\tfor (int i = 0; i < data.length; i++)\n\t\t\t{\n\t\t\t\tswitch (data[i])\n\t\t\t\t{\n\t\t\t\tcase \"+\":\n\t\t\t\t\tans = sa.pop() + sa.pop();\n\t\t\t\t\tsa.push(ans);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"-\":\n\t\t\t\t\tans = - sa.pop() + sa.pop();\n\t\t\t\t\tsa.push(ans);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"*\":\n\t\t\t\t\tans = sa.pop() * sa.pop();\n\t\t\t\t\tsa.push(ans);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tsa.push( Integer.parseInt(data[i]) );\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(sa.pop());\n\t\t}",
"for (int i = 0; i < data.length; i++)\n\t\t\t{\n\t\t\t\tswitch (data[i])\n\t\t\t\t{\n\t\t\t\tcase \"+\":\n\t\t\t\t\tans = sa.pop() + sa.pop();\n\t\t\t\t\tsa.push(ans);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"-\":\n\t\t\t\t\tans = - sa.pop() + sa.pop();\n\t\t\t\t\tsa.push(ans);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"*\":\n\t\t\t\t\tans = sa.pop() * sa.pop();\n\t\t\t\t\tsa.push(ans);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tsa.push( Integer.parseInt(data[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 < data.length",
"i",
"data.length",
"data",
"data.length",
"i++",
"i++",
"i",
"{\n\t\t\t\tswitch (data[i])\n\t\t\t\t{\n\t\t\t\tcase \"+\":\n\t\t\t\t\tans = sa.pop() + sa.pop();\n\t\t\t\t\tsa.push(ans);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"-\":\n\t\t\t\t\tans = - sa.pop() + sa.pop();\n\t\t\t\t\tsa.push(ans);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"*\":\n\t\t\t\t\tans = sa.pop() * sa.pop();\n\t\t\t\t\tsa.push(ans);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tsa.push( Integer.parseInt(data[i]) );\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}",
"{\n\t\t\t\tswitch (data[i])\n\t\t\t\t{\n\t\t\t\tcase \"+\":\n\t\t\t\t\tans = sa.pop() + sa.pop();\n\t\t\t\t\tsa.push(ans);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"-\":\n\t\t\t\t\tans = - sa.pop() + sa.pop();\n\t\t\t\t\tsa.push(ans);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"*\":\n\t\t\t\t\tans = sa.pop() * sa.pop();\n\t\t\t\t\tsa.push(ans);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tsa.push( Integer.parseInt(data[i]) );\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}",
"switch (data[i])\n\t\t\t\t{\n\t\t\t\tcase \"+\":\n\t\t\t\t\tans = sa.pop() + sa.pop();\n\t\t\t\t\tsa.push(ans);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"-\":\n\t\t\t\t\tans = - sa.pop() + sa.pop();\n\t\t\t\t\tsa.push(ans);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"*\":\n\t\t\t\t\tans = sa.pop() * sa.pop();\n\t\t\t\t\tsa.push(ans);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tsa.push( Integer.parseInt(data[i]) );\n\t\t\t\t\tbreak;\n\t\t\t\t}",
"data[i]",
"data",
"i",
"case \"+\":",
"\"+\"",
"case \"+\":",
"ans = sa.pop() + sa.pop()",
"ans",
"sa.pop() + sa.pop()",
"sa.pop()",
"sa.pop",
"sa",
"sa.pop()",
"sa.pop",
"sa",
"sa.push(ans)",
"sa.push",
"sa",
"ans",
"break;",
"case \"-\":",
"\"-\"",
"case \"-\":",
"ans = - sa.pop() + sa.pop()",
"ans",
"- sa.pop() + sa.pop()",
"- sa.pop()",
"sa.pop()",
"sa.pop",
"sa",
"sa.pop()",
"sa.pop",
"sa",
"sa.push(ans)",
"sa.push",
"sa",
"ans",
"break;",
"case \"*\":",
"\"*\"",
"case \"*\":",
"ans = sa.pop() * sa.pop()",
"ans",
"sa.pop() * sa.pop()",
"sa.pop()",
"sa.pop",
"sa",
"sa.pop()",
"sa.pop",
"sa",
"sa.push(ans)",
"sa.push",
"sa",
"ans",
"break;",
"default:",
"default:",
"sa.push( Integer.parseInt(data[i]) )",
"sa.push",
"sa",
"Integer.parseInt(data[i])",
"Integer.parseInt",
"Integer",
"data[i]",
"data",
"i",
"break;",
"System.out.println(sa.pop())",
"System.out.println",
"System.out",
"System",
"System.out",
"sa.pop()",
"sa.pop",
"sa",
"String[] args",
"args",
"static class StackArray {\n\t\tint[] S;\n\n\t\tint top = 0;\n\n\t\tStackArray(int length) {\n\t\t\tthis.S = new int[length];\n\t\t}\n\n\t\tStackArray initialize() {\n\t\t\tthis.top = 0;\n\t\t\treturn this;\n\t\t}\n\n\t\tboolean isEmpty() {\n\t\t\treturn this.top == 0;\n\t\t}\n\n\t\tboolean isFull() {\n\t\t\treturn this.top >= this.S.length - 1;\n\t\t}\n\n\t\tStackArray push(int x) throws Exception {\n\t\t\tif (this.isFull()) {\n\t\t\t\tthrow new Exception();\n\t\t\t}\n\t\t\tthis.top++;\n\t\t\tS[this.top] = x;\n\t\t\treturn this;\n\t\t}\n\n\t\tint pop() throws Exception {\n\t\t\tif (this.isEmpty()) {\n\t\t\t\tthrow new Exception();\n\t\t\t}\n\t\t\tint x = S[top];\n\t\t\ttop--;\n\t\t\treturn x;\n\t\t}\n\n\t}",
"StackArray",
"int[] S;",
"S",
"int top = 0;",
"top",
"0",
"StackArray(int length) {\n\t\t\tthis.S = new int[length];\n\t\t}",
"StackArray",
"{\n\t\t\tthis.S = new int[length];\n\t\t}",
"this.S = new int[length]",
"this.S",
"this",
"this.S",
"new int[length]",
"length",
"int length",
"length",
"StackArray initialize() {\n\t\t\tthis.top = 0;\n\t\t\treturn this;\n\t\t}",
"initialize",
"{\n\t\t\tthis.top = 0;\n\t\t\treturn this;\n\t\t}",
"this.top = 0",
"this.top",
"this",
"this.top",
"0",
"return this;",
"this",
"boolean isEmpty() {\n\t\t\treturn this.top == 0;\n\t\t}",
"isEmpty",
"{\n\t\t\treturn this.top == 0;\n\t\t}",
"return this.top == 0;",
"this.top == 0",
"this.top",
"this",
"this.top",
"0",
"boolean isFull() {\n\t\t\treturn this.top >= this.S.length - 1;\n\t\t}",
"isFull",
"{\n\t\t\treturn this.top >= this.S.length - 1;\n\t\t}",
"return this.top >= this.S.length - 1;",
"this.top >= this.S.length - 1",
"this.top",
"this",
"this.top",
"this.S.length - 1",
"this.S.length",
"this.S",
"this",
"this.S",
"this.S.length",
"1",
"StackArray push(int x) throws Exception {\n\t\t\tif (this.isFull()) {\n\t\t\t\tthrow new Exception();\n\t\t\t}\n\t\t\tthis.top++;\n\t\t\tS[this.top] = x;\n\t\t\treturn this;\n\t\t}",
"push",
"{\n\t\t\tif (this.isFull()) {\n\t\t\t\tthrow new Exception();\n\t\t\t}\n\t\t\tthis.top++;\n\t\t\tS[this.top] = x;\n\t\t\treturn this;\n\t\t}",
"if (this.isFull()) {\n\t\t\t\tthrow new Exception();\n\t\t\t}",
"this.isFull()",
"this.isFull",
"this",
"{\n\t\t\t\tthrow new Exception();\n\t\t\t}",
"throw new Exception();",
"new Exception()",
"this.top++",
"this.top",
"this",
"this.top",
"S[this.top] = x",
"S[this.top]",
"S",
"this.top",
"this",
"this.top",
"x",
"return this;",
"this",
"int x",
"x",
"int pop() throws Exception {\n\t\t\tif (this.isEmpty()) {\n\t\t\t\tthrow new Exception();\n\t\t\t}\n\t\t\tint x = S[top];\n\t\t\ttop--;\n\t\t\treturn x;\n\t\t}",
"pop",
"{\n\t\t\tif (this.isEmpty()) {\n\t\t\t\tthrow new Exception();\n\t\t\t}\n\t\t\tint x = S[top];\n\t\t\ttop--;\n\t\t\treturn x;\n\t\t}",
"if (this.isEmpty()) {\n\t\t\t\tthrow new Exception();\n\t\t\t}",
"this.isEmpty()",
"this.isEmpty",
"this",
"{\n\t\t\t\tthrow new Exception();\n\t\t\t}",
"throw new Exception();",
"new Exception()",
"int x = S[top];",
"x",
"S[top]",
"S",
"top",
"top--",
"top",
"return x;",
"x",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\t// TODO ?????????????????????????????????????????????\n\n//\t\tStackArray sa = new StackArray(1);\n//\t\ttry {\n//\t\t\tsa.push(1);\n//\t\t} catch (Exception e) {\n//\t\t\tSystem.out.println(\"catch\");\n//\t\t} finally {\n//\t\t\tSystem.out.println(\"final\");\n//\t\t}\n//\t\tSystem.out.println(\"owari\");\n\n\t\tScanner sc = new Scanner(System.in);\n\t\tString[] data = sc.nextLine().split(\" \");\n\n\t\tStackArray sa = new StackArray(data.length);\n\n\t\tint ans = 0;\n\t\ttry\n\t\t{\n\t\t\tfor (int i = 0; i < data.length; i++)\n\t\t\t{\n\t\t\t\tswitch (data[i])\n\t\t\t\t{\n\t\t\t\tcase \"+\":\n\t\t\t\t\tans = sa.pop() + sa.pop();\n\t\t\t\t\tsa.push(ans);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"-\":\n\t\t\t\t\tans = - sa.pop() + sa.pop();\n\t\t\t\t\tsa.push(ans);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"*\":\n\t\t\t\t\tans = sa.pop() * sa.pop();\n\t\t\t\t\tsa.push(ans);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tsa.push( Integer.parseInt(data[i]) );\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(sa.pop());\n\t\t}\n\t\tcatch (Exception e)\n\t\t{\n\t\t\tSystem.out.println(e);\n\t\t}\n\n\t}\n\n\tstatic class StackArray {\n\t\tint[] S;\n\n\t\tint top = 0;\n\n\t\tStackArray(int length) {\n\t\t\tthis.S = new int[length];\n\t\t}\n\n\t\tStackArray initialize() {\n\t\t\tthis.top = 0;\n\t\t\treturn this;\n\t\t}\n\n\t\tboolean isEmpty() {\n\t\t\treturn this.top == 0;\n\t\t}\n\n\t\tboolean isFull() {\n\t\t\treturn this.top >= this.S.length - 1;\n\t\t}\n\n\t\tStackArray push(int x) throws Exception {\n\t\t\tif (this.isFull()) {\n\t\t\t\tthrow new Exception();\n\t\t\t}\n\t\t\tthis.top++;\n\t\t\tS[this.top] = x;\n\t\t\treturn this;\n\t\t}\n\n\t\tint pop() throws Exception {\n\t\t\tif (this.isEmpty()) {\n\t\t\t\tthrow new Exception();\n\t\t\t}\n\t\t\tint x = S[top];\n\t\t\ttop--;\n\t\t\treturn x;\n\t\t}\n\n\t}\n}",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\t// TODO ?????????????????????????????????????????????\n\n//\t\tStackArray sa = new StackArray(1);\n//\t\ttry {\n//\t\t\tsa.push(1);\n//\t\t} catch (Exception e) {\n//\t\t\tSystem.out.println(\"catch\");\n//\t\t} finally {\n//\t\t\tSystem.out.println(\"final\");\n//\t\t}\n//\t\tSystem.out.println(\"owari\");\n\n\t\tScanner sc = new Scanner(System.in);\n\t\tString[] data = sc.nextLine().split(\" \");\n\n\t\tStackArray sa = new StackArray(data.length);\n\n\t\tint ans = 0;\n\t\ttry\n\t\t{\n\t\t\tfor (int i = 0; i < data.length; i++)\n\t\t\t{\n\t\t\t\tswitch (data[i])\n\t\t\t\t{\n\t\t\t\tcase \"+\":\n\t\t\t\t\tans = sa.pop() + sa.pop();\n\t\t\t\t\tsa.push(ans);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"-\":\n\t\t\t\t\tans = - sa.pop() + sa.pop();\n\t\t\t\t\tsa.push(ans);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"*\":\n\t\t\t\t\tans = sa.pop() * sa.pop();\n\t\t\t\t\tsa.push(ans);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tsa.push( Integer.parseInt(data[i]) );\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(sa.pop());\n\t\t}\n\t\tcatch (Exception e)\n\t\t{\n\t\t\tSystem.out.println(e);\n\t\t}\n\n\t}\n\n\tstatic class StackArray {\n\t\tint[] S;\n\n\t\tint top = 0;\n\n\t\tStackArray(int length) {\n\t\t\tthis.S = new int[length];\n\t\t}\n\n\t\tStackArray initialize() {\n\t\t\tthis.top = 0;\n\t\t\treturn this;\n\t\t}\n\n\t\tboolean isEmpty() {\n\t\t\treturn this.top == 0;\n\t\t}\n\n\t\tboolean isFull() {\n\t\t\treturn this.top >= this.S.length - 1;\n\t\t}\n\n\t\tStackArray push(int x) throws Exception {\n\t\t\tif (this.isFull()) {\n\t\t\t\tthrow new Exception();\n\t\t\t}\n\t\t\tthis.top++;\n\t\t\tS[this.top] = x;\n\t\t\treturn this;\n\t\t}\n\n\t\tint pop() throws Exception {\n\t\t\tif (this.isEmpty()) {\n\t\t\t\tthrow new Exception();\n\t\t\t}\n\t\t\tint x = S[top];\n\t\t\ttop--;\n\t\t\treturn x;\n\t\t}\n\n\t}\n}",
"Main"
] | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
// TODO ?????????????????????????????????????????????
// StackArray sa = new StackArray(1);
// try {
// sa.push(1);
// } catch (Exception e) {
// System.out.println("catch");
// } finally {
// System.out.println("final");
// }
// System.out.println("owari");
Scanner sc = new Scanner(System.in);
String[] data = sc.nextLine().split(" ");
StackArray sa = new StackArray(data.length);
int ans = 0;
try
{
for (int i = 0; i < data.length; i++)
{
switch (data[i])
{
case "+":
ans = sa.pop() + sa.pop();
sa.push(ans);
break;
case "-":
ans = - sa.pop() + sa.pop();
sa.push(ans);
break;
case "*":
ans = sa.pop() * sa.pop();
sa.push(ans);
break;
default:
sa.push( Integer.parseInt(data[i]) );
break;
}
}
System.out.println(sa.pop());
}
catch (Exception e)
{
System.out.println(e);
}
}
static class StackArray {
int[] S;
int top = 0;
StackArray(int length) {
this.S = new int[length];
}
StackArray initialize() {
this.top = 0;
return this;
}
boolean isEmpty() {
return this.top == 0;
}
boolean isFull() {
return this.top >= this.S.length - 1;
}
StackArray push(int x) throws Exception {
if (this.isFull()) {
throw new Exception();
}
this.top++;
S[this.top] = x;
return this;
}
int pop() throws Exception {
if (this.isEmpty()) {
throw new Exception();
}
int x = S[top];
top--;
return x;
}
}
} |
[
7,
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,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
17,
41,
13,
20,
41,
13,
4,
18,
13,
17,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
30,
41,
13,
4,
18,
13,
18,
13,
13,
14,
4,
18,
13,
30,
4,
18,
13,
18,
13,
13,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
17,
35,
18,
13,
13,
34,
17,
1,
0,
13,
4,
18,
13,
2,
4,
18,
13,
13,
4,
18,
13,
13,
3,
34,
17,
1,
0,
13,
4,
18,
13,
2,
4,
18,
13,
13,
4,
18,
13,
13,
3,
34,
17,
1,
0,
13,
4,
18,
13,
2,
4,
18,
13,
13,
4,
18,
13,
13,
3,
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
],
[
13,
14
],
[
13,
15
],
[
0,
16
],
[
16,
17
],
[
16,
18
],
[
0,
19
],
[
19,
20
],
[
19,
21
],
[
0,
22
],
[
174,
23
],
[
174,
24
],
[
24,
25
],
[
24,
26
],
[
26,
27
],
[
27,
28
],
[
27,
29
],
[
26,
30
],
[
30,
31
],
[
30,
32
],
[
26,
33
],
[
33,
34
],
[
33,
35
],
[
35,
36
],
[
36,
37
],
[
26,
38
],
[
38,
39
],
[
38,
40
],
[
40,
41
],
[
41,
42
],
[
40,
43
],
[
26,
44
],
[
44,
45
],
[
44,
46
],
[
26,
47
],
[
47,
48
],
[
47,
49
],
[
49,
50
],
[
50,
51
],
[
49,
52
],
[
26,
53
],
[
53,
54
],
[
54,
55
],
[
55,
56
],
[
55,
57
],
[
53,
58
],
[
58,
59
],
[
58,
60
],
[
60,
61
],
[
60,
62
],
[
53,
63
],
[
63,
64
],
[
64,
65
],
[
53,
66
],
[
67,
67
],
[
67,
68
],
[
68,
69
],
[
68,
70
],
[
70,
71
],
[
71,
72
],
[
70,
73
],
[
73,
74
],
[
73,
75
],
[
67,
76
],
[
76,
77
],
[
77,
78
],
[
78,
79
],
[
76,
80
],
[
80,
81
],
[
81,
82
],
[
82,
83
],
[
81,
84
],
[
84,
85
],
[
84,
86
],
[
76,
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
],
[
98,
100
],
[
87,
101
],
[
101,
102
],
[
102,
103
],
[
102,
104
],
[
101,
105
],
[
105,
106
],
[
105,
107
],
[
107,
108
],
[
108,
109
],
[
108,
110
],
[
110,
111
],
[
111,
112
],
[
110,
113
],
[
113,
114
],
[
114,
115
],
[
115,
116
],
[
114,
117
],
[
113,
118
],
[
118,
119
],
[
119,
120
],
[
118,
121
],
[
107,
122
],
[
101,
123
],
[
123,
124
],
[
123,
125
],
[
125,
126
],
[
126,
127
],
[
126,
128
],
[
128,
129
],
[
129,
130
],
[
128,
131
],
[
131,
132
],
[
132,
133
],
[
133,
134
],
[
132,
135
],
[
131,
136
],
[
136,
137
],
[
137,
138
],
[
136,
139
],
[
125,
140
],
[
101,
141
],
[
141,
142
],
[
141,
143
],
[
143,
144
],
[
144,
145
],
[
144,
146
],
[
146,
147
],
[
147,
148
],
[
146,
149
],
[
149,
150
],
[
150,
151
],
[
151,
152
],
[
150,
153
],
[
149,
154
],
[
154,
155
],
[
155,
156
],
[
154,
157
],
[
143,
158
],
[
87,
159
],
[
159,
160
],
[
160,
161
],
[
159,
162
],
[
26,
163
],
[
163,
164
],
[
164,
165
],
[
165,
166
],
[
165,
167
],
[
163,
168
],
[
168,
169
],
[
169,
170
],
[
24,
171
],
[
171,
172
],
[
0,
173
],
[
173,
174
],
[
173,
175
]
] | [
"import java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\nimport java.util.ArrayDeque;\nimport java.util.Deque;\nimport java.util.regex.Matcher;\nimport java.util.regex.Pattern;\n\npublic class Main {\n\tpublic static void main(String[] args) throws IOException {\n\n\t\t//Scanner scan = new Scanner(System.in);\n\n\t\tInputStreamReader isr = new InputStreamReader(System.in);\n\t\tBufferedReader br = new BufferedReader(isr);\n\n\t\tString inputData = br.readLine();\n\t\tString data[] = inputData.split(\" \");\n\t\tDeque<String> deque = new ArrayDeque<>();\n\n\t\tPattern p = Pattern.compile(\"^[0-9]*$\");\n\t\tfor (int i = 0; i < data.length ; i++) {\n\t\t\tMatcher m = p.matcher(data[i]);\n\t\t\tif(m.find()) {\n\t\t\t\tdeque.push(data[i]);\n\t\t\t}else {\n\t\t\t\tString b = deque.pop();\n\t\t\t\tString a = deque.pop();\n\t\t\t\tString r = \"\";\n\t\t\t\tswitch(data[i]){\n\t\t\t\tcase \"+\":\n\t\t\t\t\tr = String.valueOf(Integer.parseInt(a) + Integer.parseInt(b));\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"-\":\n\t\t\t\t\tr = String.valueOf(Integer.parseInt(a) - Integer.parseInt(b));\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"*\":\n\t\t\t\t\tr = String.valueOf(Integer.parseInt(a) * Integer.parseInt(b));\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tdeque.push(r);\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(deque.pop());\n\t}\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.ArrayDeque;",
"ArrayDeque",
"java.util",
"import java.util.Deque;",
"Deque",
"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\n\t\t//Scanner scan = new Scanner(System.in);\n\n\t\tInputStreamReader isr = new InputStreamReader(System.in);\n\t\tBufferedReader br = new BufferedReader(isr);\n\n\t\tString inputData = br.readLine();\n\t\tString data[] = inputData.split(\" \");\n\t\tDeque<String> deque = new ArrayDeque<>();\n\n\t\tPattern p = Pattern.compile(\"^[0-9]*$\");\n\t\tfor (int i = 0; i < data.length ; i++) {\n\t\t\tMatcher m = p.matcher(data[i]);\n\t\t\tif(m.find()) {\n\t\t\t\tdeque.push(data[i]);\n\t\t\t}else {\n\t\t\t\tString b = deque.pop();\n\t\t\t\tString a = deque.pop();\n\t\t\t\tString r = \"\";\n\t\t\t\tswitch(data[i]){\n\t\t\t\tcase \"+\":\n\t\t\t\t\tr = String.valueOf(Integer.parseInt(a) + Integer.parseInt(b));\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"-\":\n\t\t\t\t\tr = String.valueOf(Integer.parseInt(a) - Integer.parseInt(b));\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"*\":\n\t\t\t\t\tr = String.valueOf(Integer.parseInt(a) * Integer.parseInt(b));\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tdeque.push(r);\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(deque.pop());\n\t}\n\n}",
"Main",
"public static void main(String[] args) throws IOException {\n\n\t\t//Scanner scan = new Scanner(System.in);\n\n\t\tInputStreamReader isr = new InputStreamReader(System.in);\n\t\tBufferedReader br = new BufferedReader(isr);\n\n\t\tString inputData = br.readLine();\n\t\tString data[] = inputData.split(\" \");\n\t\tDeque<String> deque = new ArrayDeque<>();\n\n\t\tPattern p = Pattern.compile(\"^[0-9]*$\");\n\t\tfor (int i = 0; i < data.length ; i++) {\n\t\t\tMatcher m = p.matcher(data[i]);\n\t\t\tif(m.find()) {\n\t\t\t\tdeque.push(data[i]);\n\t\t\t}else {\n\t\t\t\tString b = deque.pop();\n\t\t\t\tString a = deque.pop();\n\t\t\t\tString r = \"\";\n\t\t\t\tswitch(data[i]){\n\t\t\t\tcase \"+\":\n\t\t\t\t\tr = String.valueOf(Integer.parseInt(a) + Integer.parseInt(b));\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"-\":\n\t\t\t\t\tr = String.valueOf(Integer.parseInt(a) - Integer.parseInt(b));\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"*\":\n\t\t\t\t\tr = String.valueOf(Integer.parseInt(a) * Integer.parseInt(b));\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tdeque.push(r);\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(deque.pop());\n\t}",
"main",
"{\n\n\t\t//Scanner scan = new Scanner(System.in);\n\n\t\tInputStreamReader isr = new InputStreamReader(System.in);\n\t\tBufferedReader br = new BufferedReader(isr);\n\n\t\tString inputData = br.readLine();\n\t\tString data[] = inputData.split(\" \");\n\t\tDeque<String> deque = new ArrayDeque<>();\n\n\t\tPattern p = Pattern.compile(\"^[0-9]*$\");\n\t\tfor (int i = 0; i < data.length ; i++) {\n\t\t\tMatcher m = p.matcher(data[i]);\n\t\t\tif(m.find()) {\n\t\t\t\tdeque.push(data[i]);\n\t\t\t}else {\n\t\t\t\tString b = deque.pop();\n\t\t\t\tString a = deque.pop();\n\t\t\t\tString r = \"\";\n\t\t\t\tswitch(data[i]){\n\t\t\t\tcase \"+\":\n\t\t\t\t\tr = String.valueOf(Integer.parseInt(a) + Integer.parseInt(b));\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"-\":\n\t\t\t\t\tr = String.valueOf(Integer.parseInt(a) - Integer.parseInt(b));\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"*\":\n\t\t\t\t\tr = String.valueOf(Integer.parseInt(a) * Integer.parseInt(b));\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tdeque.push(r);\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(deque.pop());\n\t}",
"InputStreamReader isr = new InputStreamReader(System.in);",
"isr",
"new InputStreamReader(System.in)",
"BufferedReader br = new BufferedReader(isr);",
"br",
"new BufferedReader(isr)",
"String inputData = br.readLine();",
"inputData",
"br.readLine()",
"br.readLine",
"br",
"String data[] = inputData.split(\" \");",
"data",
"inputData.split(\" \")",
"inputData.split",
"inputData",
"\" \"",
"Deque<String> deque = new ArrayDeque<>();",
"deque",
"new ArrayDeque<>()",
"Pattern p = Pattern.compile(\"^[0-9]*$\");",
"p",
"Pattern.compile(\"^[0-9]*$\")",
"Pattern.compile",
"Pattern",
"\"^[0-9]*$\"",
"for (int i = 0; i < data.length ; i++) {\n\t\t\tMatcher m = p.matcher(data[i]);\n\t\t\tif(m.find()) {\n\t\t\t\tdeque.push(data[i]);\n\t\t\t}else {\n\t\t\t\tString b = deque.pop();\n\t\t\t\tString a = deque.pop();\n\t\t\t\tString r = \"\";\n\t\t\t\tswitch(data[i]){\n\t\t\t\tcase \"+\":\n\t\t\t\t\tr = String.valueOf(Integer.parseInt(a) + Integer.parseInt(b));\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"-\":\n\t\t\t\t\tr = String.valueOf(Integer.parseInt(a) - Integer.parseInt(b));\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"*\":\n\t\t\t\t\tr = String.valueOf(Integer.parseInt(a) * Integer.parseInt(b));\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tdeque.push(r);\n\t\t\t}\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < data.length",
"i",
"data.length",
"data",
"data.length",
"i++",
"i++",
"i",
"{\n\t\t\tMatcher m = p.matcher(data[i]);\n\t\t\tif(m.find()) {\n\t\t\t\tdeque.push(data[i]);\n\t\t\t}else {\n\t\t\t\tString b = deque.pop();\n\t\t\t\tString a = deque.pop();\n\t\t\t\tString r = \"\";\n\t\t\t\tswitch(data[i]){\n\t\t\t\tcase \"+\":\n\t\t\t\t\tr = String.valueOf(Integer.parseInt(a) + Integer.parseInt(b));\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"-\":\n\t\t\t\t\tr = String.valueOf(Integer.parseInt(a) - Integer.parseInt(b));\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"*\":\n\t\t\t\t\tr = String.valueOf(Integer.parseInt(a) * Integer.parseInt(b));\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tdeque.push(r);\n\t\t\t}\n\t\t}",
"{\n\t\t\tMatcher m = p.matcher(data[i]);\n\t\t\tif(m.find()) {\n\t\t\t\tdeque.push(data[i]);\n\t\t\t}else {\n\t\t\t\tString b = deque.pop();\n\t\t\t\tString a = deque.pop();\n\t\t\t\tString r = \"\";\n\t\t\t\tswitch(data[i]){\n\t\t\t\tcase \"+\":\n\t\t\t\t\tr = String.valueOf(Integer.parseInt(a) + Integer.parseInt(b));\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"-\":\n\t\t\t\t\tr = String.valueOf(Integer.parseInt(a) - Integer.parseInt(b));\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"*\":\n\t\t\t\t\tr = String.valueOf(Integer.parseInt(a) * Integer.parseInt(b));\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tdeque.push(r);\n\t\t\t}\n\t\t}",
"Matcher m = p.matcher(data[i]);",
"m",
"p.matcher(data[i])",
"p.matcher",
"p",
"data[i]",
"data",
"i",
"if(m.find()) {\n\t\t\t\tdeque.push(data[i]);\n\t\t\t}else {\n\t\t\t\tString b = deque.pop();\n\t\t\t\tString a = deque.pop();\n\t\t\t\tString r = \"\";\n\t\t\t\tswitch(data[i]){\n\t\t\t\tcase \"+\":\n\t\t\t\t\tr = String.valueOf(Integer.parseInt(a) + Integer.parseInt(b));\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"-\":\n\t\t\t\t\tr = String.valueOf(Integer.parseInt(a) - Integer.parseInt(b));\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"*\":\n\t\t\t\t\tr = String.valueOf(Integer.parseInt(a) * Integer.parseInt(b));\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tdeque.push(r);\n\t\t\t}",
"m.find()",
"m.find",
"m",
"{\n\t\t\t\tdeque.push(data[i]);\n\t\t\t}",
"deque.push(data[i])",
"deque.push",
"deque",
"data[i]",
"data",
"i",
"{\n\t\t\t\tString b = deque.pop();\n\t\t\t\tString a = deque.pop();\n\t\t\t\tString r = \"\";\n\t\t\t\tswitch(data[i]){\n\t\t\t\tcase \"+\":\n\t\t\t\t\tr = String.valueOf(Integer.parseInt(a) + Integer.parseInt(b));\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"-\":\n\t\t\t\t\tr = String.valueOf(Integer.parseInt(a) - Integer.parseInt(b));\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"*\":\n\t\t\t\t\tr = String.valueOf(Integer.parseInt(a) * Integer.parseInt(b));\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tdeque.push(r);\n\t\t\t}",
"String b = deque.pop();",
"b",
"deque.pop()",
"deque.pop",
"deque",
"String a = deque.pop();",
"a",
"deque.pop()",
"deque.pop",
"deque",
"String r = \"\";",
"r",
"\"\"",
"switch(data[i]){\n\t\t\t\tcase \"+\":\n\t\t\t\t\tr = String.valueOf(Integer.parseInt(a) + Integer.parseInt(b));\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"-\":\n\t\t\t\t\tr = String.valueOf(Integer.parseInt(a) - Integer.parseInt(b));\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"*\":\n\t\t\t\t\tr = String.valueOf(Integer.parseInt(a) * Integer.parseInt(b));\n\t\t\t\t\tbreak;\n\t\t\t\t}",
"data[i]",
"data",
"i",
"case \"+\":",
"\"+\"",
"case \"+\":",
"r = String.valueOf(Integer.parseInt(a) + Integer.parseInt(b))",
"r",
"String.valueOf(Integer.parseInt(a) + Integer.parseInt(b))",
"String.valueOf",
"String",
"Integer.parseInt(a) + Integer.parseInt(b)",
"Integer.parseInt(a)",
"Integer.parseInt",
"Integer",
"a",
"Integer.parseInt(b)",
"Integer.parseInt",
"Integer",
"b",
"break;",
"case \"-\":",
"\"-\"",
"case \"-\":",
"r = String.valueOf(Integer.parseInt(a) - Integer.parseInt(b))",
"r",
"String.valueOf(Integer.parseInt(a) - Integer.parseInt(b))",
"String.valueOf",
"String",
"Integer.parseInt(a) - Integer.parseInt(b)",
"Integer.parseInt(a)",
"Integer.parseInt",
"Integer",
"a",
"Integer.parseInt(b)",
"Integer.parseInt",
"Integer",
"b",
"break;",
"case \"*\":",
"\"*\"",
"case \"*\":",
"r = String.valueOf(Integer.parseInt(a) * Integer.parseInt(b))",
"r",
"String.valueOf(Integer.parseInt(a) * Integer.parseInt(b))",
"String.valueOf",
"String",
"Integer.parseInt(a) * Integer.parseInt(b)",
"Integer.parseInt(a)",
"Integer.parseInt",
"Integer",
"a",
"Integer.parseInt(b)",
"Integer.parseInt",
"Integer",
"b",
"break;",
"deque.push(r)",
"deque.push",
"deque",
"r",
"System.out.println(deque.pop())",
"System.out.println",
"System.out",
"System",
"System.out",
"deque.pop()",
"deque.pop",
"deque",
"String[] args",
"args",
"public class Main {\n\tpublic static void main(String[] args) throws IOException {\n\n\t\t//Scanner scan = new Scanner(System.in);\n\n\t\tInputStreamReader isr = new InputStreamReader(System.in);\n\t\tBufferedReader br = new BufferedReader(isr);\n\n\t\tString inputData = br.readLine();\n\t\tString data[] = inputData.split(\" \");\n\t\tDeque<String> deque = new ArrayDeque<>();\n\n\t\tPattern p = Pattern.compile(\"^[0-9]*$\");\n\t\tfor (int i = 0; i < data.length ; i++) {\n\t\t\tMatcher m = p.matcher(data[i]);\n\t\t\tif(m.find()) {\n\t\t\t\tdeque.push(data[i]);\n\t\t\t}else {\n\t\t\t\tString b = deque.pop();\n\t\t\t\tString a = deque.pop();\n\t\t\t\tString r = \"\";\n\t\t\t\tswitch(data[i]){\n\t\t\t\tcase \"+\":\n\t\t\t\t\tr = String.valueOf(Integer.parseInt(a) + Integer.parseInt(b));\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"-\":\n\t\t\t\t\tr = String.valueOf(Integer.parseInt(a) - Integer.parseInt(b));\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"*\":\n\t\t\t\t\tr = String.valueOf(Integer.parseInt(a) * Integer.parseInt(b));\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tdeque.push(r);\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(deque.pop());\n\t}\n\n}",
"public class Main {\n\tpublic static void main(String[] args) throws IOException {\n\n\t\t//Scanner scan = new Scanner(System.in);\n\n\t\tInputStreamReader isr = new InputStreamReader(System.in);\n\t\tBufferedReader br = new BufferedReader(isr);\n\n\t\tString inputData = br.readLine();\n\t\tString data[] = inputData.split(\" \");\n\t\tDeque<String> deque = new ArrayDeque<>();\n\n\t\tPattern p = Pattern.compile(\"^[0-9]*$\");\n\t\tfor (int i = 0; i < data.length ; i++) {\n\t\t\tMatcher m = p.matcher(data[i]);\n\t\t\tif(m.find()) {\n\t\t\t\tdeque.push(data[i]);\n\t\t\t}else {\n\t\t\t\tString b = deque.pop();\n\t\t\t\tString a = deque.pop();\n\t\t\t\tString r = \"\";\n\t\t\t\tswitch(data[i]){\n\t\t\t\tcase \"+\":\n\t\t\t\t\tr = String.valueOf(Integer.parseInt(a) + Integer.parseInt(b));\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"-\":\n\t\t\t\t\tr = String.valueOf(Integer.parseInt(a) - Integer.parseInt(b));\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"*\":\n\t\t\t\t\tr = String.valueOf(Integer.parseInt(a) * Integer.parseInt(b));\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tdeque.push(r);\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(deque.pop());\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;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class Main {
public static void main(String[] args) throws IOException {
//Scanner scan = new Scanner(System.in);
InputStreamReader isr = new InputStreamReader(System.in);
BufferedReader br = new BufferedReader(isr);
String inputData = br.readLine();
String data[] = inputData.split(" ");
Deque<String> deque = new ArrayDeque<>();
Pattern p = Pattern.compile("^[0-9]*$");
for (int i = 0; i < data.length ; i++) {
Matcher m = p.matcher(data[i]);
if(m.find()) {
deque.push(data[i]);
}else {
String b = deque.pop();
String a = deque.pop();
String r = "";
switch(data[i]){
case "+":
r = String.valueOf(Integer.parseInt(a) + Integer.parseInt(b));
break;
case "-":
r = String.valueOf(Integer.parseInt(a) - Integer.parseInt(b));
break;
case "*":
r = String.valueOf(Integer.parseInt(a) * Integer.parseInt(b));
break;
}
deque.push(r);
}
}
System.out.println(deque.pop());
}
}
|
[
7,
15,
13,
17,
6,
13,
41,
13,
20,
17,
41,
13,
12,
13,
30,
0,
13,
17,
12,
13,
30,
0,
18,
13,
40,
13,
13,
23,
13,
12,
13,
30,
29,
18,
13,
40,
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,
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,
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
],
[
6,
8
],
[
4,
10
],
[
10,
11
],
[
4,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
15,
17
],
[
4,
18
],
[
18,
19
],
[
18,
20
],
[
20,
21
],
[
21,
22
],
[
22,
23
],
[
22,
24
],
[
24,
25
],
[
21,
26
],
[
18,
27
],
[
27,
28
],
[
4,
29
],
[
29,
30
],
[
29,
31
],
[
31,
32
],
[
32,
33
],
[
33,
34
],
[
33,
35
],
[
35,
36
],
[
4,
37
],
[
37,
38
],
[
37,
39
],
[
39,
40
],
[
40,
41
],
[
40,
42
],
[
39,
43
],
[
43,
44
],
[
43,
45
],
[
39,
46
],
[
46,
47
],
[
47,
48
],
[
48,
49
],
[
46,
50
],
[
50,
51
],
[
51,
52
],
[
51,
53
],
[
53,
54
],
[
54,
55
],
[
50,
56
],
[
56,
57
],
[
57,
58
],
[
58,
59
],
[
57,
60
],
[
56,
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
],
[
56,
78
],
[
78,
79
],
[
79,
80
],
[
80,
81
],
[
79,
82
],
[
78,
83
],
[
83,
84
],
[
84,
85
],
[
84,
86
],
[
86,
87
],
[
87,
88
],
[
83,
89
],
[
89,
90
],
[
89,
91
],
[
91,
92
],
[
92,
93
],
[
83,
94
],
[
94,
95
],
[
95,
96
],
[
94,
97
],
[
97,
98
],
[
97,
99
],
[
78,
100
],
[
100,
101
],
[
101,
102
],
[
102,
103
],
[
101,
104
],
[
100,
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
],
[
100,
122
],
[
122,
123
],
[
123,
124
],
[
122,
125
],
[
125,
126
],
[
126,
127
],
[
125,
128
],
[
39,
129
],
[
129,
130
],
[
130,
131
],
[
131,
132
],
[
131,
133
],
[
129,
134
],
[
134,
135
],
[
135,
136
],
[
37,
137
],
[
137,
138
]
] | [
"\nimport java.util.Scanner;\n\nclass Main{\n int[] a = new int[200];\n int top;\n\n Main(){\n top = 0;\n }\n\n void push(int x){\n a[++top] = x;\n }\n\n int pop(){\n return a[top--];\n }\n\n public static void main(String[] args){\n Scanner stdIn = new Scanner(System.in);\n\n Main stack = new Main();\n\n\n while(stdIn.hasNext()){\n String input = stdIn.next();\n\n if(input.equals(\"+\")){\n int a = stack.pop();\n int b = stack.pop();\n stack.push(a + b);\n }\n else if(input.equals(\"*\")){\n int a = stack.pop();\n int b = stack.pop();\n stack.push(a * b);\n }\n else if(input.equals(\"-\")){\n int b = stack.pop();\n int a = stack.pop();\n stack.push(a-b);\n }\n else\n stack.push(Integer.parseInt(input));\n\n }\n\n\n System.out.println(stack.pop());\n }\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"class Main{\n int[] a = new int[200];\n int top;\n\n Main(){\n top = 0;\n }\n\n void push(int x){\n a[++top] = x;\n }\n\n int pop(){\n return a[top--];\n }\n\n public static void main(String[] args){\n Scanner stdIn = new Scanner(System.in);\n\n Main stack = new Main();\n\n\n while(stdIn.hasNext()){\n String input = stdIn.next();\n\n if(input.equals(\"+\")){\n int a = stack.pop();\n int b = stack.pop();\n stack.push(a + b);\n }\n else if(input.equals(\"*\")){\n int a = stack.pop();\n int b = stack.pop();\n stack.push(a * b);\n }\n else if(input.equals(\"-\")){\n int b = stack.pop();\n int a = stack.pop();\n stack.push(a-b);\n }\n else\n stack.push(Integer.parseInt(input));\n\n }\n\n\n System.out.println(stack.pop());\n }\n}",
"Main",
"int[] a = new int[200];",
"a",
"new int[200]",
"200",
"int top;",
"top",
"Main(){\n top = 0;\n }",
"Main",
"{\n top = 0;\n }",
"top = 0",
"top",
"0",
"void push(int x){\n a[++top] = x;\n }",
"push",
"{\n a[++top] = x;\n }",
"a[++top] = x",
"a[++top]",
"a",
"++top",
"top",
"x",
"int x",
"x",
"int pop(){\n return a[top--];\n }",
"pop",
"{\n return a[top--];\n }",
"return a[top--];",
"a[top--]",
"a",
"top--",
"top",
"public static void main(String[] args){\n Scanner stdIn = new Scanner(System.in);\n\n Main stack = new Main();\n\n\n while(stdIn.hasNext()){\n String input = stdIn.next();\n\n if(input.equals(\"+\")){\n int a = stack.pop();\n int b = stack.pop();\n stack.push(a + b);\n }\n else if(input.equals(\"*\")){\n int a = stack.pop();\n int b = stack.pop();\n stack.push(a * b);\n }\n else if(input.equals(\"-\")){\n int b = stack.pop();\n int a = stack.pop();\n stack.push(a-b);\n }\n else\n stack.push(Integer.parseInt(input));\n\n }\n\n\n System.out.println(stack.pop());\n }",
"main",
"{\n Scanner stdIn = new Scanner(System.in);\n\n Main stack = new Main();\n\n\n while(stdIn.hasNext()){\n String input = stdIn.next();\n\n if(input.equals(\"+\")){\n int a = stack.pop();\n int b = stack.pop();\n stack.push(a + b);\n }\n else if(input.equals(\"*\")){\n int a = stack.pop();\n int b = stack.pop();\n stack.push(a * b);\n }\n else if(input.equals(\"-\")){\n int b = stack.pop();\n int a = stack.pop();\n stack.push(a-b);\n }\n else\n stack.push(Integer.parseInt(input));\n\n }\n\n\n System.out.println(stack.pop());\n }",
"Scanner stdIn = new Scanner(System.in);",
"stdIn",
"new Scanner(System.in)",
"Main stack = new Main();",
"stack",
"new Main()",
"while(stdIn.hasNext()){\n String input = stdIn.next();\n\n if(input.equals(\"+\")){\n int a = stack.pop();\n int b = stack.pop();\n stack.push(a + b);\n }\n else if(input.equals(\"*\")){\n int a = stack.pop();\n int b = stack.pop();\n stack.push(a * b);\n }\n else if(input.equals(\"-\")){\n int b = stack.pop();\n int a = stack.pop();\n stack.push(a-b);\n }\n else\n stack.push(Integer.parseInt(input));\n\n }",
"stdIn.hasNext()",
"stdIn.hasNext",
"stdIn",
"{\n String input = stdIn.next();\n\n if(input.equals(\"+\")){\n int a = stack.pop();\n int b = stack.pop();\n stack.push(a + b);\n }\n else if(input.equals(\"*\")){\n int a = stack.pop();\n int b = stack.pop();\n stack.push(a * b);\n }\n else if(input.equals(\"-\")){\n int b = stack.pop();\n int a = stack.pop();\n stack.push(a-b);\n }\n else\n stack.push(Integer.parseInt(input));\n\n }",
"String input = stdIn.next();",
"input",
"stdIn.next()",
"stdIn.next",
"stdIn",
"if(input.equals(\"+\")){\n int a = stack.pop();\n int b = stack.pop();\n stack.push(a + b);\n }\n else if(input.equals(\"*\")){\n int a = stack.pop();\n int b = stack.pop();\n stack.push(a * b);\n }\n else if(input.equals(\"-\")){\n int b = stack.pop();\n int a = stack.pop();\n stack.push(a-b);\n }\n else\n stack.push(Integer.parseInt(input));",
"input.equals(\"+\")",
"input.equals",
"input",
"\"+\"",
"{\n int a = stack.pop();\n int b = stack.pop();\n stack.push(a + b);\n }",
"int a = stack.pop();",
"a",
"stack.pop()",
"stack.pop",
"stack",
"int b = stack.pop();",
"b",
"stack.pop()",
"stack.pop",
"stack",
"stack.push(a + b)",
"stack.push",
"stack",
"a + b",
"a",
"b",
"if(input.equals(\"*\")){\n int a = stack.pop();\n int b = stack.pop();\n stack.push(a * b);\n }\n else if(input.equals(\"-\")){\n int b = stack.pop();\n int a = stack.pop();\n stack.push(a-b);\n }\n else\n stack.push(Integer.parseInt(input));",
"input.equals(\"*\")",
"input.equals",
"input",
"\"*\"",
"{\n int a = stack.pop();\n int b = stack.pop();\n stack.push(a * b);\n }",
"int a = stack.pop();",
"a",
"stack.pop()",
"stack.pop",
"stack",
"int b = stack.pop();",
"b",
"stack.pop()",
"stack.pop",
"stack",
"stack.push(a * b)",
"stack.push",
"stack",
"a * b",
"a",
"b",
"if(input.equals(\"-\")){\n int b = stack.pop();\n int a = stack.pop();\n stack.push(a-b);\n }\n else\n stack.push(Integer.parseInt(input));",
"input.equals(\"-\")",
"input.equals",
"input",
"\"-\"",
"{\n int b = stack.pop();\n int a = stack.pop();\n stack.push(a-b);\n }",
"int b = stack.pop();",
"b",
"stack.pop()",
"stack.pop",
"stack",
"int a = stack.pop();",
"a",
"stack.pop()",
"stack.pop",
"stack",
"stack.push(a-b)",
"stack.push",
"stack",
"a-b",
"a",
"b",
"stack.push(Integer.parseInt(input))",
"stack.push",
"stack",
"Integer.parseInt(input)",
"Integer.parseInt",
"Integer",
"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{
int[] a = new int[200];
int top;
Main(){
top = 0;
}
void push(int x){
a[++top] = x;
}
int pop(){
return a[top--];
}
public static void main(String[] args){
Scanner stdIn = new Scanner(System.in);
Main stack = new Main();
while(stdIn.hasNext()){
String input = stdIn.next();
if(input.equals("+")){
int a = stack.pop();
int b = stack.pop();
stack.push(a + b);
}
else if(input.equals("*")){
int a = stack.pop();
int b = stack.pop();
stack.push(a * b);
}
else if(input.equals("-")){
int b = stack.pop();
int a = stack.pop();
stack.push(a-b);
}
else
stack.push(Integer.parseInt(input));
}
System.out.println(stack.pop());
}
} |
[
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,
41,
13,
41,
13,
28,
13,
13,
30,
30,
14,
4,
18,
13,
17,
30,
4,
18,
13,
4,
18,
13,
13,
30,
0,
13,
4,
18,
13,
0,
13,
4,
18,
13,
0,
13,
17,
35,
13,
34,
17,
1,
0,
13,
2,
13,
13,
3,
34,
17,
1,
0,
13,
2,
13,
13,
3,
34,
17,
1,
0,
13,
2,
13,
13,
3,
34,
17,
1,
0,
13,
2,
13,
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
],
[
119,
8
],
[
119,
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
],
[
11,
28
],
[
28,
29
],
[
11,
30
],
[
30,
31
],
[
11,
32
],
[
32,
33
],
[
32,
34
],
[
32,
35
],
[
36,
36
],
[
36,
37
],
[
37,
38
],
[
38,
39
],
[
39,
40
],
[
38,
41
],
[
37,
42
],
[
42,
43
],
[
43,
44
],
[
44,
45
],
[
43,
46
],
[
46,
47
],
[
47,
48
],
[
46,
49
],
[
37,
50
],
[
50,
51
],
[
51,
52
],
[
51,
53
],
[
53,
54
],
[
54,
55
],
[
50,
56
],
[
56,
57
],
[
56,
58
],
[
58,
59
],
[
59,
60
],
[
50,
61
],
[
61,
62
],
[
61,
63
],
[
50,
64
],
[
64,
65
],
[
64,
66
],
[
66,
67
],
[
66,
68
],
[
68,
69
],
[
69,
70
],
[
69,
71
],
[
71,
72
],
[
71,
73
],
[
68,
74
],
[
64,
75
],
[
75,
76
],
[
75,
77
],
[
77,
78
],
[
78,
79
],
[
78,
80
],
[
80,
81
],
[
80,
82
],
[
77,
83
],
[
64,
84
],
[
84,
85
],
[
84,
86
],
[
86,
87
],
[
87,
88
],
[
87,
89
],
[
89,
90
],
[
89,
91
],
[
86,
92
],
[
64,
93
],
[
93,
94
],
[
93,
95
],
[
95,
96
],
[
96,
97
],
[
96,
98
],
[
98,
99
],
[
98,
100
],
[
50,
101
],
[
101,
102
],
[
102,
103
],
[
101,
104
],
[
11,
105
],
[
105,
106
],
[
106,
107
],
[
107,
108
],
[
107,
109
],
[
105,
110
],
[
110,
111
],
[
111,
112
],
[
11,
113
],
[
113,
114
],
[
114,
115
],
[
9,
116
],
[
116,
117
],
[
0,
118
],
[
118,
119
],
[
118,
120
]
] | [
"import java.util.LinkedList;\nimport java.util.Scanner;\n\npublic class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner in = new Scanner(System.in);\n\t\tLinkedList<Integer> stack = new LinkedList<Integer>();\n\t\tString[] tokens = in.nextLine().split(\" \");\n\t\tint a, b, result;\n\t\tfor(String t : tokens){\n\t\t\tif(t.matches(\"[0-9]+\")) {\n\t\t\t\tstack.push(Integer.parseInt(t));\n\t\t\t}else{\n\t\t\t\ta = stack.pop();\n\t\t\t\tb = stack.pop();\n\t\t\t\tresult = 0;\n\t\t\t\tswitch(t){\n\t\t\t\t\tcase \"+\" : result = b + a;\n\t\t\t\t\t\t break;\n\t\t\t\t\tcase \"*\" : result = b * a;\n\t\t\t\t\t\t break;\n\t\t\t\t\tcase \"-\" : result = b - a;\n\t\t\t\t\t\t break;\n\t\t\t\t\tcase \"/\" : result = b / a;\n\t\t\t\t}\n\t\t\t\tstack.push(result);\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(stack.pop());\n\t\tin.close();\n\t}\n}",
"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\tScanner in = new Scanner(System.in);\n\t\tLinkedList<Integer> stack = new LinkedList<Integer>();\n\t\tString[] tokens = in.nextLine().split(\" \");\n\t\tint a, b, result;\n\t\tfor(String t : tokens){\n\t\t\tif(t.matches(\"[0-9]+\")) {\n\t\t\t\tstack.push(Integer.parseInt(t));\n\t\t\t}else{\n\t\t\t\ta = stack.pop();\n\t\t\t\tb = stack.pop();\n\t\t\t\tresult = 0;\n\t\t\t\tswitch(t){\n\t\t\t\t\tcase \"+\" : result = b + a;\n\t\t\t\t\t\t break;\n\t\t\t\t\tcase \"*\" : result = b * a;\n\t\t\t\t\t\t break;\n\t\t\t\t\tcase \"-\" : result = b - a;\n\t\t\t\t\t\t break;\n\t\t\t\t\tcase \"/\" : result = b / a;\n\t\t\t\t}\n\t\t\t\tstack.push(result);\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(stack.pop());\n\t\tin.close();\n\t}\n}",
"Main",
"public static void main(String[] args) {\n\t\tScanner in = new Scanner(System.in);\n\t\tLinkedList<Integer> stack = new LinkedList<Integer>();\n\t\tString[] tokens = in.nextLine().split(\" \");\n\t\tint a, b, result;\n\t\tfor(String t : tokens){\n\t\t\tif(t.matches(\"[0-9]+\")) {\n\t\t\t\tstack.push(Integer.parseInt(t));\n\t\t\t}else{\n\t\t\t\ta = stack.pop();\n\t\t\t\tb = stack.pop();\n\t\t\t\tresult = 0;\n\t\t\t\tswitch(t){\n\t\t\t\t\tcase \"+\" : result = b + a;\n\t\t\t\t\t\t break;\n\t\t\t\t\tcase \"*\" : result = b * a;\n\t\t\t\t\t\t break;\n\t\t\t\t\tcase \"-\" : result = b - a;\n\t\t\t\t\t\t break;\n\t\t\t\t\tcase \"/\" : result = b / a;\n\t\t\t\t}\n\t\t\t\tstack.push(result);\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(stack.pop());\n\t\tin.close();\n\t}",
"main",
"{\n\t\tScanner in = new Scanner(System.in);\n\t\tLinkedList<Integer> stack = new LinkedList<Integer>();\n\t\tString[] tokens = in.nextLine().split(\" \");\n\t\tint a, b, result;\n\t\tfor(String t : tokens){\n\t\t\tif(t.matches(\"[0-9]+\")) {\n\t\t\t\tstack.push(Integer.parseInt(t));\n\t\t\t}else{\n\t\t\t\ta = stack.pop();\n\t\t\t\tb = stack.pop();\n\t\t\t\tresult = 0;\n\t\t\t\tswitch(t){\n\t\t\t\t\tcase \"+\" : result = b + a;\n\t\t\t\t\t\t break;\n\t\t\t\t\tcase \"*\" : result = b * a;\n\t\t\t\t\t\t break;\n\t\t\t\t\tcase \"-\" : result = b - a;\n\t\t\t\t\t\t break;\n\t\t\t\t\tcase \"/\" : result = b / a;\n\t\t\t\t}\n\t\t\t\tstack.push(result);\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(stack.pop());\n\t\tin.close();\n\t}",
"Scanner in = new Scanner(System.in);",
"in",
"new Scanner(System.in)",
"LinkedList<Integer> stack = new LinkedList<Integer>();",
"stack",
"new LinkedList<Integer>()",
"String[] tokens = in.nextLine().split(\" \");",
"tokens",
"in.nextLine().split(\" \")",
"in.nextLine().split",
"in.nextLine()",
"in.nextLine",
"in",
"\" \"",
"int a",
"a",
"b",
"b",
"result;",
"result",
"for(String t : tokens){\n\t\t\tif(t.matches(\"[0-9]+\")) {\n\t\t\t\tstack.push(Integer.parseInt(t));\n\t\t\t}else{\n\t\t\t\ta = stack.pop();\n\t\t\t\tb = stack.pop();\n\t\t\t\tresult = 0;\n\t\t\t\tswitch(t){\n\t\t\t\t\tcase \"+\" : result = b + a;\n\t\t\t\t\t\t break;\n\t\t\t\t\tcase \"*\" : result = b * a;\n\t\t\t\t\t\t break;\n\t\t\t\t\tcase \"-\" : result = b - a;\n\t\t\t\t\t\t break;\n\t\t\t\t\tcase \"/\" : result = b / a;\n\t\t\t\t}\n\t\t\t\tstack.push(result);\n\t\t\t}\n\t\t}",
"String t",
"tokens",
"{\n\t\t\tif(t.matches(\"[0-9]+\")) {\n\t\t\t\tstack.push(Integer.parseInt(t));\n\t\t\t}else{\n\t\t\t\ta = stack.pop();\n\t\t\t\tb = stack.pop();\n\t\t\t\tresult = 0;\n\t\t\t\tswitch(t){\n\t\t\t\t\tcase \"+\" : result = b + a;\n\t\t\t\t\t\t break;\n\t\t\t\t\tcase \"*\" : result = b * a;\n\t\t\t\t\t\t break;\n\t\t\t\t\tcase \"-\" : result = b - a;\n\t\t\t\t\t\t break;\n\t\t\t\t\tcase \"/\" : result = b / a;\n\t\t\t\t}\n\t\t\t\tstack.push(result);\n\t\t\t}\n\t\t}",
"{\n\t\t\tif(t.matches(\"[0-9]+\")) {\n\t\t\t\tstack.push(Integer.parseInt(t));\n\t\t\t}else{\n\t\t\t\ta = stack.pop();\n\t\t\t\tb = stack.pop();\n\t\t\t\tresult = 0;\n\t\t\t\tswitch(t){\n\t\t\t\t\tcase \"+\" : result = b + a;\n\t\t\t\t\t\t break;\n\t\t\t\t\tcase \"*\" : result = b * a;\n\t\t\t\t\t\t break;\n\t\t\t\t\tcase \"-\" : result = b - a;\n\t\t\t\t\t\t break;\n\t\t\t\t\tcase \"/\" : result = b / a;\n\t\t\t\t}\n\t\t\t\tstack.push(result);\n\t\t\t}\n\t\t}",
"if(t.matches(\"[0-9]+\")) {\n\t\t\t\tstack.push(Integer.parseInt(t));\n\t\t\t}else{\n\t\t\t\ta = stack.pop();\n\t\t\t\tb = stack.pop();\n\t\t\t\tresult = 0;\n\t\t\t\tswitch(t){\n\t\t\t\t\tcase \"+\" : result = b + a;\n\t\t\t\t\t\t break;\n\t\t\t\t\tcase \"*\" : result = b * a;\n\t\t\t\t\t\t break;\n\t\t\t\t\tcase \"-\" : result = b - a;\n\t\t\t\t\t\t break;\n\t\t\t\t\tcase \"/\" : result = b / a;\n\t\t\t\t}\n\t\t\t\tstack.push(result);\n\t\t\t}",
"t.matches(\"[0-9]+\")",
"t.matches",
"t",
"\"[0-9]+\"",
"{\n\t\t\t\tstack.push(Integer.parseInt(t));\n\t\t\t}",
"stack.push(Integer.parseInt(t))",
"stack.push",
"stack",
"Integer.parseInt(t)",
"Integer.parseInt",
"Integer",
"t",
"{\n\t\t\t\ta = stack.pop();\n\t\t\t\tb = stack.pop();\n\t\t\t\tresult = 0;\n\t\t\t\tswitch(t){\n\t\t\t\t\tcase \"+\" : result = b + a;\n\t\t\t\t\t\t break;\n\t\t\t\t\tcase \"*\" : result = b * a;\n\t\t\t\t\t\t break;\n\t\t\t\t\tcase \"-\" : result = b - a;\n\t\t\t\t\t\t break;\n\t\t\t\t\tcase \"/\" : result = b / a;\n\t\t\t\t}\n\t\t\t\tstack.push(result);\n\t\t\t}",
"a = stack.pop()",
"a",
"stack.pop()",
"stack.pop",
"stack",
"b = stack.pop()",
"b",
"stack.pop()",
"stack.pop",
"stack",
"result = 0",
"result",
"0",
"switch(t){\n\t\t\t\t\tcase \"+\" : result = b + a;\n\t\t\t\t\t\t break;\n\t\t\t\t\tcase \"*\" : result = b * a;\n\t\t\t\t\t\t break;\n\t\t\t\t\tcase \"-\" : result = b - a;\n\t\t\t\t\t\t break;\n\t\t\t\t\tcase \"/\" : result = b / a;\n\t\t\t\t}",
"t",
"case \"+\" :",
"\"+\"",
"case \"+\" :",
"result = b + a",
"result",
"b + a",
"b",
"a",
"break;",
"case \"*\" :",
"\"*\"",
"case \"*\" :",
"result = b * a",
"result",
"b * a",
"b",
"a",
"break;",
"case \"-\" :",
"\"-\"",
"case \"-\" :",
"result = b - a",
"result",
"b - a",
"b",
"a",
"break;",
"case \"/\" :",
"\"/\"",
"case \"/\" :",
"result = b / a",
"result",
"b / a",
"b",
"a",
"stack.push(result)",
"stack.push",
"stack",
"result",
"System.out.println(stack.pop())",
"System.out.println",
"System.out",
"System",
"System.out",
"stack.pop()",
"stack.pop",
"stack",
"in.close()",
"in.close",
"in",
"String[] args",
"args",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner in = new Scanner(System.in);\n\t\tLinkedList<Integer> stack = new LinkedList<Integer>();\n\t\tString[] tokens = in.nextLine().split(\" \");\n\t\tint a, b, result;\n\t\tfor(String t : tokens){\n\t\t\tif(t.matches(\"[0-9]+\")) {\n\t\t\t\tstack.push(Integer.parseInt(t));\n\t\t\t}else{\n\t\t\t\ta = stack.pop();\n\t\t\t\tb = stack.pop();\n\t\t\t\tresult = 0;\n\t\t\t\tswitch(t){\n\t\t\t\t\tcase \"+\" : result = b + a;\n\t\t\t\t\t\t break;\n\t\t\t\t\tcase \"*\" : result = b * a;\n\t\t\t\t\t\t break;\n\t\t\t\t\tcase \"-\" : result = b - a;\n\t\t\t\t\t\t break;\n\t\t\t\t\tcase \"/\" : result = b / a;\n\t\t\t\t}\n\t\t\t\tstack.push(result);\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(stack.pop());\n\t\tin.close();\n\t}\n}",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner in = new Scanner(System.in);\n\t\tLinkedList<Integer> stack = new LinkedList<Integer>();\n\t\tString[] tokens = in.nextLine().split(\" \");\n\t\tint a, b, result;\n\t\tfor(String t : tokens){\n\t\t\tif(t.matches(\"[0-9]+\")) {\n\t\t\t\tstack.push(Integer.parseInt(t));\n\t\t\t}else{\n\t\t\t\ta = stack.pop();\n\t\t\t\tb = stack.pop();\n\t\t\t\tresult = 0;\n\t\t\t\tswitch(t){\n\t\t\t\t\tcase \"+\" : result = b + a;\n\t\t\t\t\t\t break;\n\t\t\t\t\tcase \"*\" : result = b * a;\n\t\t\t\t\t\t break;\n\t\t\t\t\tcase \"-\" : result = b - a;\n\t\t\t\t\t\t break;\n\t\t\t\t\tcase \"/\" : result = b / a;\n\t\t\t\t}\n\t\t\t\tstack.push(result);\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(stack.pop());\n\t\tin.close();\n\t}\n}",
"Main"
] | import java.util.LinkedList;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
LinkedList<Integer> stack = new LinkedList<Integer>();
String[] tokens = in.nextLine().split(" ");
int a, b, result;
for(String t : tokens){
if(t.matches("[0-9]+")) {
stack.push(Integer.parseInt(t));
}else{
a = stack.pop();
b = stack.pop();
result = 0;
switch(t){
case "+" : result = b + a;
break;
case "*" : result = b * a;
break;
case "-" : result = b - a;
break;
case "/" : result = b / a;
}
stack.push(result);
}
}
System.out.println(stack.pop());
in.close();
}
} |
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
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,
20,
42,
4,
18,
13,
30,
41,
13,
4,
18,
13,
14,
4,
13,
13,
30,
41,
13,
4,
18,
13,
13,
4,
18,
13,
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,
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,
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
],
[
200,
11
],
[
200,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
16,
17
],
[
16,
18
],
[
18,
19
],
[
19,
20
],
[
15,
21
],
[
21,
22
],
[
22,
23
],
[
23,
24
],
[
22,
25
],
[
21,
26
],
[
26,
27
],
[
12,
28
],
[
28,
29
],
[
200,
30
],
[
30,
31
],
[
30,
32
],
[
32,
33
],
[
33,
34
],
[
33,
35
],
[
32,
36
],
[
36,
37
],
[
36,
38
],
[
32,
39
],
[
39,
40
],
[
40,
41
],
[
41,
42
],
[
39,
43
],
[
43,
44
],
[
44,
45
],
[
44,
46
],
[
46,
47
],
[
47,
48
],
[
43,
49
],
[
49,
50
],
[
50,
51
],
[
50,
52
],
[
49,
53
],
[
53,
54
],
[
54,
55
],
[
54,
56
],
[
56,
57
],
[
57,
58
],
[
56,
59
],
[
53,
60
],
[
60,
61
],
[
61,
62
],
[
60,
63
],
[
49,
64
],
[
64,
65
],
[
65,
66
],
[
66,
67
],
[
65,
68
],
[
64,
69
],
[
69,
70
],
[
70,
71
],
[
70,
72
],
[
72,
73
],
[
73,
74
],
[
74,
75
],
[
73,
76
],
[
76,
77
],
[
77,
78
],
[
78,
79
],
[
76,
80
],
[
72,
81
],
[
81,
82
],
[
82,
83
],
[
81,
84
],
[
84,
85
],
[
85,
86
],
[
86,
87
],
[
84,
88
],
[
69,
89
],
[
89,
90
],
[
90,
91
],
[
89,
92
],
[
92,
93
],
[
93,
94
],
[
94,
95
],
[
92,
96
],
[
69,
97
],
[
97,
98
],
[
98,
99
],
[
97,
100
],
[
100,
101
],
[
101,
102
],
[
102,
103
],
[
100,
104
],
[
97,
105
],
[
64,
106
],
[
106,
107
],
[
107,
108
],
[
108,
109
],
[
107,
110
],
[
106,
111
],
[
111,
112
],
[
112,
113
],
[
112,
114
],
[
114,
115
],
[
115,
116
],
[
116,
117
],
[
115,
118
],
[
118,
119
],
[
119,
120
],
[
120,
121
],
[
118,
122
],
[
114,
123
],
[
123,
124
],
[
124,
125
],
[
123,
126
],
[
126,
127
],
[
127,
128
],
[
128,
129
],
[
126,
130
],
[
111,
131
],
[
131,
132
],
[
132,
133
],
[
131,
134
],
[
134,
135
],
[
135,
136
],
[
136,
137
],
[
134,
138
],
[
111,
139
],
[
139,
140
],
[
140,
141
],
[
139,
142
],
[
142,
143
],
[
143,
144
],
[
144,
145
],
[
142,
146
],
[
139,
147
],
[
106,
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
],
[
168,
171
],
[
171,
172
],
[
172,
173
],
[
173,
174
],
[
171,
175
],
[
148,
176
],
[
176,
177
],
[
177,
178
],
[
176,
179
],
[
179,
180
],
[
180,
181
],
[
181,
182
],
[
179,
183
],
[
176,
184
],
[
32,
185
],
[
185,
186
],
[
186,
187
],
[
187,
188
],
[
187,
189
],
[
185,
190
],
[
190,
191
],
[
191,
192
],
[
190,
193
],
[
32,
194
],
[
194,
195
],
[
195,
196
],
[
30,
197
],
[
197,
198
],
[
0,
199
],
[
199,
200
],
[
199,
201
]
] | [
"\nimport java.util.ArrayList;\nimport java.util.List;\nimport java.util.Scanner;\n\n\n\npublic class Main {\n\tpublic static boolean isNumber(String s) {\n\t\ttry {\n\t\t\tLong.parseLong(s);\n\t\t\treturn true;\n\t\t} catch (NumberFormatException e) {\n\t\t\treturn false;\n\t\t}\n\t}\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tList<Long> list = new ArrayList<>();\n\t\twhile (sc.hasNext()) {\n\t\t\tString s = sc.next();\n\t\t\tif(isNumber(s)) {\n\t\t\t\tlong a = Long.parseLong(s);\n\t\t\t\tlist.add(a);\n\t\t\t} else if(s.equals(\"+\")) {\n\t\t\t\tlong b = list.get(list.size() - 2) + list.get(list.size() - 1);\n\t\t\t\tlist.remove(list.size() - 1);\n\t\t\t\tlist.set(list.size() - 1, b);\n\t\t\t} else if(s.equals(\"-\")) {\n\t\t\t\tlong b = list.get(list.size() - 2) - list.get(list.size() - 1);\n\t\t\t\tlist.remove(list.size() - 1);\n\t\t\t\tlist.set(list.size() - 1, b);\n\t\t\t} else {\n\t\t\t\tlong b = list.get(list.size() - 2) * list.get(list.size() - 1);\n\t\t\t\tlist.remove(list.size() - 1);\n\t\t\t\tlist.set(list.size() - 1, b);\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(list.get(0));\n\t\tsc.close();\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\tpublic static boolean isNumber(String s) {\n\t\ttry {\n\t\t\tLong.parseLong(s);\n\t\t\treturn true;\n\t\t} catch (NumberFormatException e) {\n\t\t\treturn false;\n\t\t}\n\t}\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tList<Long> list = new ArrayList<>();\n\t\twhile (sc.hasNext()) {\n\t\t\tString s = sc.next();\n\t\t\tif(isNumber(s)) {\n\t\t\t\tlong a = Long.parseLong(s);\n\t\t\t\tlist.add(a);\n\t\t\t} else if(s.equals(\"+\")) {\n\t\t\t\tlong b = list.get(list.size() - 2) + list.get(list.size() - 1);\n\t\t\t\tlist.remove(list.size() - 1);\n\t\t\t\tlist.set(list.size() - 1, b);\n\t\t\t} else if(s.equals(\"-\")) {\n\t\t\t\tlong b = list.get(list.size() - 2) - list.get(list.size() - 1);\n\t\t\t\tlist.remove(list.size() - 1);\n\t\t\t\tlist.set(list.size() - 1, b);\n\t\t\t} else {\n\t\t\t\tlong b = list.get(list.size() - 2) * list.get(list.size() - 1);\n\t\t\t\tlist.remove(list.size() - 1);\n\t\t\t\tlist.set(list.size() - 1, b);\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(list.get(0));\n\t\tsc.close();\n\t}\n\n}",
"Main",
"public static boolean isNumber(String s) {\n\t\ttry {\n\t\t\tLong.parseLong(s);\n\t\t\treturn true;\n\t\t} catch (NumberFormatException e) {\n\t\t\treturn false;\n\t\t}\n\t}",
"isNumber",
"{\n\t\ttry {\n\t\t\tLong.parseLong(s);\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\tLong.parseLong(s);\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\tLong.parseLong(s);\n\t\t\treturn true;\n\t\t}",
"Long.parseLong(s)",
"Long.parseLong",
"Long",
"s",
"return true;",
"true",
"String s",
"s",
"public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tList<Long> list = new ArrayList<>();\n\t\twhile (sc.hasNext()) {\n\t\t\tString s = sc.next();\n\t\t\tif(isNumber(s)) {\n\t\t\t\tlong a = Long.parseLong(s);\n\t\t\t\tlist.add(a);\n\t\t\t} else if(s.equals(\"+\")) {\n\t\t\t\tlong b = list.get(list.size() - 2) + list.get(list.size() - 1);\n\t\t\t\tlist.remove(list.size() - 1);\n\t\t\t\tlist.set(list.size() - 1, b);\n\t\t\t} else if(s.equals(\"-\")) {\n\t\t\t\tlong b = list.get(list.size() - 2) - list.get(list.size() - 1);\n\t\t\t\tlist.remove(list.size() - 1);\n\t\t\t\tlist.set(list.size() - 1, b);\n\t\t\t} else {\n\t\t\t\tlong b = list.get(list.size() - 2) * list.get(list.size() - 1);\n\t\t\t\tlist.remove(list.size() - 1);\n\t\t\t\tlist.set(list.size() - 1, b);\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(list.get(0));\n\t\tsc.close();\n\t}",
"main",
"{\n\t\tScanner sc = new Scanner(System.in);\n\t\tList<Long> list = new ArrayList<>();\n\t\twhile (sc.hasNext()) {\n\t\t\tString s = sc.next();\n\t\t\tif(isNumber(s)) {\n\t\t\t\tlong a = Long.parseLong(s);\n\t\t\t\tlist.add(a);\n\t\t\t} else if(s.equals(\"+\")) {\n\t\t\t\tlong b = list.get(list.size() - 2) + list.get(list.size() - 1);\n\t\t\t\tlist.remove(list.size() - 1);\n\t\t\t\tlist.set(list.size() - 1, b);\n\t\t\t} else if(s.equals(\"-\")) {\n\t\t\t\tlong b = list.get(list.size() - 2) - list.get(list.size() - 1);\n\t\t\t\tlist.remove(list.size() - 1);\n\t\t\t\tlist.set(list.size() - 1, b);\n\t\t\t} else {\n\t\t\t\tlong b = list.get(list.size() - 2) * list.get(list.size() - 1);\n\t\t\t\tlist.remove(list.size() - 1);\n\t\t\t\tlist.set(list.size() - 1, b);\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(list.get(0));\n\t\tsc.close();\n\t}",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"List<Long> list = new ArrayList<>();",
"list",
"new ArrayList<>()",
"while (sc.hasNext()) {\n\t\t\tString s = sc.next();\n\t\t\tif(isNumber(s)) {\n\t\t\t\tlong a = Long.parseLong(s);\n\t\t\t\tlist.add(a);\n\t\t\t} else if(s.equals(\"+\")) {\n\t\t\t\tlong b = list.get(list.size() - 2) + list.get(list.size() - 1);\n\t\t\t\tlist.remove(list.size() - 1);\n\t\t\t\tlist.set(list.size() - 1, b);\n\t\t\t} else if(s.equals(\"-\")) {\n\t\t\t\tlong b = list.get(list.size() - 2) - list.get(list.size() - 1);\n\t\t\t\tlist.remove(list.size() - 1);\n\t\t\t\tlist.set(list.size() - 1, b);\n\t\t\t} else {\n\t\t\t\tlong b = list.get(list.size() - 2) * list.get(list.size() - 1);\n\t\t\t\tlist.remove(list.size() - 1);\n\t\t\t\tlist.set(list.size() - 1, b);\n\t\t\t}\n\t\t}",
"sc.hasNext()",
"sc.hasNext",
"sc",
"{\n\t\t\tString s = sc.next();\n\t\t\tif(isNumber(s)) {\n\t\t\t\tlong a = Long.parseLong(s);\n\t\t\t\tlist.add(a);\n\t\t\t} else if(s.equals(\"+\")) {\n\t\t\t\tlong b = list.get(list.size() - 2) + list.get(list.size() - 1);\n\t\t\t\tlist.remove(list.size() - 1);\n\t\t\t\tlist.set(list.size() - 1, b);\n\t\t\t} else if(s.equals(\"-\")) {\n\t\t\t\tlong b = list.get(list.size() - 2) - list.get(list.size() - 1);\n\t\t\t\tlist.remove(list.size() - 1);\n\t\t\t\tlist.set(list.size() - 1, b);\n\t\t\t} else {\n\t\t\t\tlong b = list.get(list.size() - 2) * list.get(list.size() - 1);\n\t\t\t\tlist.remove(list.size() - 1);\n\t\t\t\tlist.set(list.size() - 1, b);\n\t\t\t}\n\t\t}",
"String s = sc.next();",
"s",
"sc.next()",
"sc.next",
"sc",
"if(isNumber(s)) {\n\t\t\t\tlong a = Long.parseLong(s);\n\t\t\t\tlist.add(a);\n\t\t\t} else if(s.equals(\"+\")) {\n\t\t\t\tlong b = list.get(list.size() - 2) + list.get(list.size() - 1);\n\t\t\t\tlist.remove(list.size() - 1);\n\t\t\t\tlist.set(list.size() - 1, b);\n\t\t\t} else if(s.equals(\"-\")) {\n\t\t\t\tlong b = list.get(list.size() - 2) - list.get(list.size() - 1);\n\t\t\t\tlist.remove(list.size() - 1);\n\t\t\t\tlist.set(list.size() - 1, b);\n\t\t\t} else {\n\t\t\t\tlong b = list.get(list.size() - 2) * list.get(list.size() - 1);\n\t\t\t\tlist.remove(list.size() - 1);\n\t\t\t\tlist.set(list.size() - 1, b);\n\t\t\t}",
"isNumber(s)",
"isNumber",
"s",
"{\n\t\t\t\tlong a = Long.parseLong(s);\n\t\t\t\tlist.add(a);\n\t\t\t}",
"long a = Long.parseLong(s);",
"a",
"Long.parseLong(s)",
"Long.parseLong",
"Long",
"s",
"list.add(a)",
"list.add",
"list",
"a",
"if(s.equals(\"+\")) {\n\t\t\t\tlong b = list.get(list.size() - 2) + list.get(list.size() - 1);\n\t\t\t\tlist.remove(list.size() - 1);\n\t\t\t\tlist.set(list.size() - 1, b);\n\t\t\t} else if(s.equals(\"-\")) {\n\t\t\t\tlong b = list.get(list.size() - 2) - list.get(list.size() - 1);\n\t\t\t\tlist.remove(list.size() - 1);\n\t\t\t\tlist.set(list.size() - 1, b);\n\t\t\t} else {\n\t\t\t\tlong b = list.get(list.size() - 2) * list.get(list.size() - 1);\n\t\t\t\tlist.remove(list.size() - 1);\n\t\t\t\tlist.set(list.size() - 1, b);\n\t\t\t}",
"s.equals(\"+\")",
"s.equals",
"s",
"\"+\"",
"{\n\t\t\t\tlong b = list.get(list.size() - 2) + list.get(list.size() - 1);\n\t\t\t\tlist.remove(list.size() - 1);\n\t\t\t\tlist.set(list.size() - 1, b);\n\t\t\t}",
"long b = list.get(list.size() - 2) + list.get(list.size() - 1);",
"b",
"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",
"list.set(list.size() - 1, b)",
"list.set",
"list",
"list.size() - 1",
"list.size()",
"list.size",
"list",
"1",
"b",
"if(s.equals(\"-\")) {\n\t\t\t\tlong b = list.get(list.size() - 2) - list.get(list.size() - 1);\n\t\t\t\tlist.remove(list.size() - 1);\n\t\t\t\tlist.set(list.size() - 1, b);\n\t\t\t} else {\n\t\t\t\tlong b = list.get(list.size() - 2) * list.get(list.size() - 1);\n\t\t\t\tlist.remove(list.size() - 1);\n\t\t\t\tlist.set(list.size() - 1, b);\n\t\t\t}",
"s.equals(\"-\")",
"s.equals",
"s",
"\"-\"",
"{\n\t\t\t\tlong b = list.get(list.size() - 2) - list.get(list.size() - 1);\n\t\t\t\tlist.remove(list.size() - 1);\n\t\t\t\tlist.set(list.size() - 1, b);\n\t\t\t}",
"long b = list.get(list.size() - 2) - list.get(list.size() - 1);",
"b",
"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",
"list.set(list.size() - 1, b)",
"list.set",
"list",
"list.size() - 1",
"list.size()",
"list.size",
"list",
"1",
"b",
"{\n\t\t\t\tlong b = list.get(list.size() - 2) * list.get(list.size() - 1);\n\t\t\t\tlist.remove(list.size() - 1);\n\t\t\t\tlist.set(list.size() - 1, b);\n\t\t\t}",
"long b = list.get(list.size() - 2) * list.get(list.size() - 1);",
"b",
"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",
"list.set(list.size() - 1, b)",
"list.set",
"list",
"list.size() - 1",
"list.size()",
"list.size",
"list",
"1",
"b",
"System.out.println(list.get(0))",
"System.out.println",
"System.out",
"System",
"System.out",
"list.get(0)",
"list.get",
"list",
"0",
"sc.close()",
"sc.close",
"sc",
"String[] args",
"args",
"public class Main {\n\tpublic static boolean isNumber(String s) {\n\t\ttry {\n\t\t\tLong.parseLong(s);\n\t\t\treturn true;\n\t\t} catch (NumberFormatException e) {\n\t\t\treturn false;\n\t\t}\n\t}\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tList<Long> list = new ArrayList<>();\n\t\twhile (sc.hasNext()) {\n\t\t\tString s = sc.next();\n\t\t\tif(isNumber(s)) {\n\t\t\t\tlong a = Long.parseLong(s);\n\t\t\t\tlist.add(a);\n\t\t\t} else if(s.equals(\"+\")) {\n\t\t\t\tlong b = list.get(list.size() - 2) + list.get(list.size() - 1);\n\t\t\t\tlist.remove(list.size() - 1);\n\t\t\t\tlist.set(list.size() - 1, b);\n\t\t\t} else if(s.equals(\"-\")) {\n\t\t\t\tlong b = list.get(list.size() - 2) - list.get(list.size() - 1);\n\t\t\t\tlist.remove(list.size() - 1);\n\t\t\t\tlist.set(list.size() - 1, b);\n\t\t\t} else {\n\t\t\t\tlong b = list.get(list.size() - 2) * list.get(list.size() - 1);\n\t\t\t\tlist.remove(list.size() - 1);\n\t\t\t\tlist.set(list.size() - 1, b);\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(list.get(0));\n\t\tsc.close();\n\t}\n\n}",
"public class Main {\n\tpublic static boolean isNumber(String s) {\n\t\ttry {\n\t\t\tLong.parseLong(s);\n\t\t\treturn true;\n\t\t} catch (NumberFormatException e) {\n\t\t\treturn false;\n\t\t}\n\t}\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tList<Long> list = new ArrayList<>();\n\t\twhile (sc.hasNext()) {\n\t\t\tString s = sc.next();\n\t\t\tif(isNumber(s)) {\n\t\t\t\tlong a = Long.parseLong(s);\n\t\t\t\tlist.add(a);\n\t\t\t} else if(s.equals(\"+\")) {\n\t\t\t\tlong b = list.get(list.size() - 2) + list.get(list.size() - 1);\n\t\t\t\tlist.remove(list.size() - 1);\n\t\t\t\tlist.set(list.size() - 1, b);\n\t\t\t} else if(s.equals(\"-\")) {\n\t\t\t\tlong b = list.get(list.size() - 2) - list.get(list.size() - 1);\n\t\t\t\tlist.remove(list.size() - 1);\n\t\t\t\tlist.set(list.size() - 1, b);\n\t\t\t} else {\n\t\t\t\tlong b = list.get(list.size() - 2) * list.get(list.size() - 1);\n\t\t\t\tlist.remove(list.size() - 1);\n\t\t\t\tlist.set(list.size() - 1, b);\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(list.get(0));\n\t\tsc.close();\n\t}\n\n}",
"Main"
] |
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
public class Main {
public static boolean isNumber(String s) {
try {
Long.parseLong(s);
return true;
} catch (NumberFormatException e) {
return false;
}
}
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
List<Long> list = new ArrayList<>();
while (sc.hasNext()) {
String s = sc.next();
if(isNumber(s)) {
long a = Long.parseLong(s);
list.add(a);
} else if(s.equals("+")) {
long b = list.get(list.size() - 2) + list.get(list.size() - 1);
list.remove(list.size() - 1);
list.set(list.size() - 1, b);
} else if(s.equals("-")) {
long b = list.get(list.size() - 2) - list.get(list.size() - 1);
list.remove(list.size() - 1);
list.set(list.size() - 1, b);
} else {
long b = list.get(list.size() - 2) * list.get(list.size() - 1);
list.remove(list.size() - 1);
list.set(list.size() - 1, b);
}
}
System.out.println(list.get(0));
sc.close();
}
}
|
[
7,
15,
13,
17,
6,
13,
41,
13,
17,
41,
13,
20,
17,
12,
13,
30,
0,
13,
17,
12,
13,
30,
29,
2,
13,
17,
12,
13,
30,
29,
2,
13,
18,
13,
13,
12,
13,
30,
14,
40,
4,
13,
30,
40,
13,
0,
18,
13,
13,
13,
30,
4,
18,
18,
13,
13,
17,
23,
13,
12,
13,
30,
14,
4,
13,
30,
4,
18,
18,
13,
13,
17,
40,
13,
29,
18,
13,
2,
13,
17,
12,
13,
30,
41,
13,
20,
41,
13,
20,
14,
4,
18,
13,
30,
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,
41,
13,
18,
13,
13,
41,
13,
41,
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,
3,
4,
18,
18,
13,
13,
18,
18,
13,
13,
18,
13,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
216,
5
],
[
216,
6
],
[
6,
7
],
[
6,
8
],
[
216,
9
],
[
9,
10
],
[
9,
11
],
[
216,
13
],
[
13,
14
],
[
13,
15
],
[
15,
16
],
[
16,
17
],
[
16,
18
],
[
216,
19
],
[
19,
20
],
[
19,
21
],
[
21,
22
],
[
22,
23
],
[
23,
24
],
[
23,
25
],
[
216,
26
],
[
26,
27
],
[
26,
28
],
[
28,
29
],
[
29,
30
],
[
30,
31
],
[
30,
32
],
[
32,
33
],
[
32,
34
],
[
216,
35
],
[
35,
36
],
[
35,
37
],
[
37,
38
],
[
38,
39
],
[
39,
40
],
[
40,
41
],
[
38,
42
],
[
42,
43
],
[
43,
44
],
[
42,
45
],
[
45,
46
],
[
46,
47
],
[
46,
48
],
[
45,
49
],
[
38,
50
],
[
50,
51
],
[
51,
52
],
[
52,
53
],
[
53,
54
],
[
53,
55
],
[
51,
56
],
[
35,
57
],
[
57,
58
],
[
216,
59
],
[
59,
60
],
[
59,
61
],
[
61,
62
],
[
62,
63
],
[
63,
64
],
[
62,
65
],
[
65,
66
],
[
66,
67
],
[
67,
68
],
[
68,
69
],
[
68,
70
],
[
66,
71
],
[
61,
72
],
[
72,
73
],
[
61,
74
],
[
74,
75
],
[
75,
76
],
[
75,
77
],
[
77,
78
],
[
77,
79
],
[
216,
80
],
[
80,
81
],
[
80,
82
],
[
82,
83
],
[
83,
84
],
[
83,
85
],
[
82,
86
],
[
86,
87
],
[
86,
88
],
[
82,
89
],
[
89,
90
],
[
90,
91
],
[
91,
92
],
[
89,
93
],
[
93,
94
],
[
94,
95
],
[
94,
96
],
[
96,
97
],
[
97,
98
],
[
93,
99
],
[
99,
100
],
[
99,
101
],
[
101,
102
],
[
102,
103
],
[
101,
104
],
[
93,
105
],
[
105,
106
],
[
106,
107
],
[
107,
108
],
[
107,
109
],
[
105,
110
],
[
110,
111
],
[
110,
112
],
[
112,
113
],
[
112,
114
],
[
105,
115
],
[
115,
116
],
[
116,
117
],
[
105,
118
],
[
119,
119
],
[
119,
120
],
[
120,
121
],
[
120,
122
],
[
122,
123
],
[
122,
124
],
[
119,
125
],
[
125,
126
],
[
119,
127
],
[
127,
128
],
[
119,
129
],
[
129,
130
],
[
129,
131
],
[
131,
132
],
[
131,
133
],
[
133,
134
],
[
134,
135
],
[
134,
136
],
[
136,
137
],
[
137,
138
],
[
133,
139
],
[
139,
140
],
[
139,
141
],
[
141,
142
],
[
142,
143
],
[
133,
144
],
[
144,
145
],
[
145,
146
],
[
144,
147
],
[
147,
148
],
[
147,
149
],
[
133,
150
],
[
129,
151
],
[
151,
152
],
[
151,
153
],
[
153,
154
],
[
154,
155
],
[
154,
156
],
[
156,
157
],
[
157,
158
],
[
153,
159
],
[
159,
160
],
[
159,
161
],
[
161,
162
],
[
162,
163
],
[
153,
164
],
[
164,
165
],
[
165,
166
],
[
164,
167
],
[
167,
168
],
[
167,
169
],
[
153,
170
],
[
129,
171
],
[
171,
172
],
[
171,
173
],
[
173,
174
],
[
174,
175
],
[
174,
176
],
[
176,
177
],
[
177,
178
],
[
173,
179
],
[
179,
180
],
[
179,
181
],
[
181,
182
],
[
182,
183
],
[
173,
184
],
[
184,
185
],
[
185,
186
],
[
184,
187
],
[
187,
188
],
[
187,
189
],
[
173,
190
],
[
129,
191
],
[
191,
192
],
[
192,
193
],
[
193,
194
],
[
194,
195
],
[
193,
196
],
[
196,
197
],
[
197,
198
],
[
196,
199
],
[
192,
200
],
[
82,
201
],
[
201,
202
],
[
202,
203
],
[
203,
204
],
[
203,
205
],
[
201,
206
],
[
206,
207
],
[
207,
208
],
[
207,
209
],
[
206,
210
],
[
210,
211
],
[
210,
212
],
[
80,
213
],
[
213,
214
],
[
0,
215
],
[
215,
216
],
[
215,
217
]
] | [
"import java.util.Scanner;\n\npublic class Main {\n\t//フィールド\n\tint top = 0; //スタックポインタ\n\tint[] S = new int[101]; //スタック\n\n\t//初期化\n\tvoid initialize() {\n\t\ttop = 0;\n\t}\n\n\t//要素が存在しないかを判定\n\tboolean isEmpty() {\n\t\treturn top == 0;\n\t}\n\n\t//要素が満タンかどうか判定\n\tboolean isFull() {\n\t\treturn top >= S.length;\n\t}\n\n\t//要素の追加\n\tvoid push(int x) {\n\t\tif (!isFull()) { //配列に空きがある\n\t\t\ttop++;\n\t\t\tS[top] = x;\n\t\t} else { //配列に空きがない\n\t\t\tSystem.err.println(\"エラー(オーバーフロー)\");\n\t\t}\n\t}\n\n\t//要素の取り出し\n\tint pop() {\n\t\tif (isEmpty()) { //配列に要素がある\n\t\t\tSystem.err.println(\"エラー(アンダーフロー)\");\n\t\t}\n\t\ttop--;\n\t\treturn S[top + 1];\n\t}\n\n\tpublic static void main(String[] args) {\n\t\tMain main = new Main();\n\t\tScanner sc = new Scanner(System.in);\n\t\tif (sc.hasNextLine()) {\n\t\t\tString s = sc.nextLine();\n\t\t\tString[] ary = s.split(\"\\\\s\");\n\t\t\t//操作\n\t\t\tfor (int i = 0; i < ary.length; i++) {\n\t\t\t\tString str = ary[i];\n\t\t\t\tint a;\n\t\t\t\tint b;\n\t\t\t\tswitch (str) {\n\t\t\t\t//演算子だった場合\n\t\t\t\tcase \"+\":\n\t\t\t\t\ta = main.pop();\n\t\t\t\t\tb = main.pop();\n\t\t\t\t\tmain.push(a + b);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"-\":\n\t\t\t\t\ta = main.pop();\n\t\t\t\t\tb = main.pop();\n\t\t\t\t\tmain.push(b - a);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"*\":\n\t\t\t\t\ta = main.pop();\n\t\t\t\t\tb = main.pop();\n\t\t\t\t\tmain.push(a * b);\n\t\t\t\t\tbreak;\n\t\t\t\t//数字だった場合\n\t\t\t\tdefault:\n\t\t\t\t\tmain.push(Integer.parseInt(str));\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(main.S[main.top]);\n\t}\n\n}\n",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\t//フィールド\n\tint top = 0; //スタックポインタ\n\tint[] S = new int[101]; //スタック\n\n\t//初期化\n\tvoid initialize() {\n\t\ttop = 0;\n\t}\n\n\t//要素が存在しないかを判定\n\tboolean isEmpty() {\n\t\treturn top == 0;\n\t}\n\n\t//要素が満タンかどうか判定\n\tboolean isFull() {\n\t\treturn top >= S.length;\n\t}\n\n\t//要素の追加\n\tvoid push(int x) {\n\t\tif (!isFull()) { //配列に空きがある\n\t\t\ttop++;\n\t\t\tS[top] = x;\n\t\t} else { //配列に空きがない\n\t\t\tSystem.err.println(\"エラー(オーバーフロー)\");\n\t\t}\n\t}\n\n\t//要素の取り出し\n\tint pop() {\n\t\tif (isEmpty()) { //配列に要素がある\n\t\t\tSystem.err.println(\"エラー(アンダーフロー)\");\n\t\t}\n\t\ttop--;\n\t\treturn S[top + 1];\n\t}\n\n\tpublic static void main(String[] args) {\n\t\tMain main = new Main();\n\t\tScanner sc = new Scanner(System.in);\n\t\tif (sc.hasNextLine()) {\n\t\t\tString s = sc.nextLine();\n\t\t\tString[] ary = s.split(\"\\\\s\");\n\t\t\t//操作\n\t\t\tfor (int i = 0; i < ary.length; i++) {\n\t\t\t\tString str = ary[i];\n\t\t\t\tint a;\n\t\t\t\tint b;\n\t\t\t\tswitch (str) {\n\t\t\t\t//演算子だった場合\n\t\t\t\tcase \"+\":\n\t\t\t\t\ta = main.pop();\n\t\t\t\t\tb = main.pop();\n\t\t\t\t\tmain.push(a + b);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"-\":\n\t\t\t\t\ta = main.pop();\n\t\t\t\t\tb = main.pop();\n\t\t\t\t\tmain.push(b - a);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"*\":\n\t\t\t\t\ta = main.pop();\n\t\t\t\t\tb = main.pop();\n\t\t\t\t\tmain.push(a * b);\n\t\t\t\t\tbreak;\n\t\t\t\t//数字だった場合\n\t\t\t\tdefault:\n\t\t\t\t\tmain.push(Integer.parseInt(str));\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(main.S[main.top]);\n\t}\n\n}",
"Main",
"//フィールド\n\tint top = 0; //スタックポインタ",
"top",
"0",
"int[] S = new int[101]; //スタック",
"S",
"new int[101]",
"101",
"//初期化\n\tvoid initialize() {\n\t\ttop = 0;\n\t}",
"initialize",
"{\n\t\ttop = 0;\n\t}",
"top = 0",
"top",
"0",
"//要素が存在しないかを判定\n\tboolean isEmpty() {\n\t\treturn top == 0;\n\t}",
"isEmpty",
"{\n\t\treturn top == 0;\n\t}",
"return top == 0;",
"top == 0",
"top",
"0",
"//要素が満タンかどうか判定\n\tboolean isFull() {\n\t\treturn top >= S.length;\n\t}",
"isFull",
"{\n\t\treturn top >= S.length;\n\t}",
"return top >= S.length;",
"top >= S.length",
"top",
"S.length",
"S",
"S.length",
"//要素の追加\n\tvoid push(int x) {\n\t\tif (!isFull()) { //配列に空きがある\n\t\t\ttop++;\n\t\t\tS[top] = x;\n\t\t} else { //配列に空きがない\n\t\t\tSystem.err.println(\"エラー(オーバーフロー)\");\n\t\t}\n\t}",
"push",
"{\n\t\tif (!isFull()) { //配列に空きがある\n\t\t\ttop++;\n\t\t\tS[top] = x;\n\t\t} else { //配列に空きがない\n\t\t\tSystem.err.println(\"エラー(オーバーフロー)\");\n\t\t}\n\t}",
"if (!isFull()) { //配列に空きがある\n\t\t\ttop++;\n\t\t\tS[top] = x;\n\t\t} else { //配列に空きがない\n\t\t\tSystem.err.println(\"エラー(オーバーフロー)\");\n\t\t}",
"!isFull()",
"isFull()",
"isFull",
"{ //配列に空きがある\n\t\t\ttop++;\n\t\t\tS[top] = x;\n\t\t}",
"top++",
"top",
"S[top] = x",
"S[top]",
"S",
"top",
"x",
"{ //配列に空きがない\n\t\t\tSystem.err.println(\"エラー(オーバーフロー)\");\n\t\t}",
"System.err.println(\"エラー(オーバーフロー)\")",
"System.err.println",
"System.err",
"System",
"System.err",
"\"エラー(オーバーフロー)\"",
"int x",
"x",
"//要素の取り出し\n\tint pop() {\n\t\tif (isEmpty()) { //配列に要素がある\n\t\t\tSystem.err.println(\"エラー(アンダーフロー)\");\n\t\t}\n\t\ttop--;\n\t\treturn S[top + 1];\n\t}",
"pop",
"{\n\t\tif (isEmpty()) { //配列に要素がある\n\t\t\tSystem.err.println(\"エラー(アンダーフロー)\");\n\t\t}\n\t\ttop--;\n\t\treturn S[top + 1];\n\t}",
"if (isEmpty()) { //配列に要素がある\n\t\t\tSystem.err.println(\"エラー(アンダーフロー)\");\n\t\t}",
"isEmpty()",
"isEmpty",
"{ //配列に要素がある\n\t\t\tSystem.err.println(\"エラー(アンダーフロー)\");\n\t\t}",
"System.err.println(\"エラー(アンダーフロー)\")",
"System.err.println",
"System.err",
"System",
"System.err",
"\"エラー(アンダーフロー)\"",
"top--",
"top",
"return S[top + 1];",
"S[top + 1]",
"S",
"top + 1",
"top",
"1",
"public static void main(String[] args) {\n\t\tMain main = new Main();\n\t\tScanner sc = new Scanner(System.in);\n\t\tif (sc.hasNextLine()) {\n\t\t\tString s = sc.nextLine();\n\t\t\tString[] ary = s.split(\"\\\\s\");\n\t\t\t//操作\n\t\t\tfor (int i = 0; i < ary.length; i++) {\n\t\t\t\tString str = ary[i];\n\t\t\t\tint a;\n\t\t\t\tint b;\n\t\t\t\tswitch (str) {\n\t\t\t\t//演算子だった場合\n\t\t\t\tcase \"+\":\n\t\t\t\t\ta = main.pop();\n\t\t\t\t\tb = main.pop();\n\t\t\t\t\tmain.push(a + b);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"-\":\n\t\t\t\t\ta = main.pop();\n\t\t\t\t\tb = main.pop();\n\t\t\t\t\tmain.push(b - a);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"*\":\n\t\t\t\t\ta = main.pop();\n\t\t\t\t\tb = main.pop();\n\t\t\t\t\tmain.push(a * b);\n\t\t\t\t\tbreak;\n\t\t\t\t//数字だった場合\n\t\t\t\tdefault:\n\t\t\t\t\tmain.push(Integer.parseInt(str));\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(main.S[main.top]);\n\t}",
"main",
"{\n\t\tMain main = new Main();\n\t\tScanner sc = new Scanner(System.in);\n\t\tif (sc.hasNextLine()) {\n\t\t\tString s = sc.nextLine();\n\t\t\tString[] ary = s.split(\"\\\\s\");\n\t\t\t//操作\n\t\t\tfor (int i = 0; i < ary.length; i++) {\n\t\t\t\tString str = ary[i];\n\t\t\t\tint a;\n\t\t\t\tint b;\n\t\t\t\tswitch (str) {\n\t\t\t\t//演算子だった場合\n\t\t\t\tcase \"+\":\n\t\t\t\t\ta = main.pop();\n\t\t\t\t\tb = main.pop();\n\t\t\t\t\tmain.push(a + b);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"-\":\n\t\t\t\t\ta = main.pop();\n\t\t\t\t\tb = main.pop();\n\t\t\t\t\tmain.push(b - a);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"*\":\n\t\t\t\t\ta = main.pop();\n\t\t\t\t\tb = main.pop();\n\t\t\t\t\tmain.push(a * b);\n\t\t\t\t\tbreak;\n\t\t\t\t//数字だった場合\n\t\t\t\tdefault:\n\t\t\t\t\tmain.push(Integer.parseInt(str));\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(main.S[main.top]);\n\t}",
"Main main = new Main();",
"main",
"new Main()",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"if (sc.hasNextLine()) {\n\t\t\tString s = sc.nextLine();\n\t\t\tString[] ary = s.split(\"\\\\s\");\n\t\t\t//操作\n\t\t\tfor (int i = 0; i < ary.length; i++) {\n\t\t\t\tString str = ary[i];\n\t\t\t\tint a;\n\t\t\t\tint b;\n\t\t\t\tswitch (str) {\n\t\t\t\t//演算子だった場合\n\t\t\t\tcase \"+\":\n\t\t\t\t\ta = main.pop();\n\t\t\t\t\tb = main.pop();\n\t\t\t\t\tmain.push(a + b);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"-\":\n\t\t\t\t\ta = main.pop();\n\t\t\t\t\tb = main.pop();\n\t\t\t\t\tmain.push(b - a);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"*\":\n\t\t\t\t\ta = main.pop();\n\t\t\t\t\tb = main.pop();\n\t\t\t\t\tmain.push(a * b);\n\t\t\t\t\tbreak;\n\t\t\t\t//数字だった場合\n\t\t\t\tdefault:\n\t\t\t\t\tmain.push(Integer.parseInt(str));\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"sc.hasNextLine()",
"sc.hasNextLine",
"sc",
"{\n\t\t\tString s = sc.nextLine();\n\t\t\tString[] ary = s.split(\"\\\\s\");\n\t\t\t//操作\n\t\t\tfor (int i = 0; i < ary.length; i++) {\n\t\t\t\tString str = ary[i];\n\t\t\t\tint a;\n\t\t\t\tint b;\n\t\t\t\tswitch (str) {\n\t\t\t\t//演算子だった場合\n\t\t\t\tcase \"+\":\n\t\t\t\t\ta = main.pop();\n\t\t\t\t\tb = main.pop();\n\t\t\t\t\tmain.push(a + b);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"-\":\n\t\t\t\t\ta = main.pop();\n\t\t\t\t\tb = main.pop();\n\t\t\t\t\tmain.push(b - a);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"*\":\n\t\t\t\t\ta = main.pop();\n\t\t\t\t\tb = main.pop();\n\t\t\t\t\tmain.push(a * b);\n\t\t\t\t\tbreak;\n\t\t\t\t//数字だった場合\n\t\t\t\tdefault:\n\t\t\t\t\tmain.push(Integer.parseInt(str));\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"String s = sc.nextLine();",
"s",
"sc.nextLine()",
"sc.nextLine",
"sc",
"String[] ary = s.split(\"\\\\s\");",
"ary",
"s.split(\"\\\\s\")",
"s.split",
"s",
"\"\\\\s\"",
"for (int i = 0; i < ary.length; i++) {\n\t\t\t\tString str = ary[i];\n\t\t\t\tint a;\n\t\t\t\tint b;\n\t\t\t\tswitch (str) {\n\t\t\t\t//演算子だった場合\n\t\t\t\tcase \"+\":\n\t\t\t\t\ta = main.pop();\n\t\t\t\t\tb = main.pop();\n\t\t\t\t\tmain.push(a + b);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"-\":\n\t\t\t\t\ta = main.pop();\n\t\t\t\t\tb = main.pop();\n\t\t\t\t\tmain.push(b - a);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"*\":\n\t\t\t\t\ta = main.pop();\n\t\t\t\t\tb = main.pop();\n\t\t\t\t\tmain.push(a * b);\n\t\t\t\t\tbreak;\n\t\t\t\t//数字だった場合\n\t\t\t\tdefault:\n\t\t\t\t\tmain.push(Integer.parseInt(str));\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < ary.length",
"i",
"ary.length",
"ary",
"ary.length",
"i++",
"i++",
"i",
"{\n\t\t\t\tString str = ary[i];\n\t\t\t\tint a;\n\t\t\t\tint b;\n\t\t\t\tswitch (str) {\n\t\t\t\t//演算子だった場合\n\t\t\t\tcase \"+\":\n\t\t\t\t\ta = main.pop();\n\t\t\t\t\tb = main.pop();\n\t\t\t\t\tmain.push(a + b);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"-\":\n\t\t\t\t\ta = main.pop();\n\t\t\t\t\tb = main.pop();\n\t\t\t\t\tmain.push(b - a);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"*\":\n\t\t\t\t\ta = main.pop();\n\t\t\t\t\tb = main.pop();\n\t\t\t\t\tmain.push(a * b);\n\t\t\t\t\tbreak;\n\t\t\t\t//数字だった場合\n\t\t\t\tdefault:\n\t\t\t\t\tmain.push(Integer.parseInt(str));\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}",
"{\n\t\t\t\tString str = ary[i];\n\t\t\t\tint a;\n\t\t\t\tint b;\n\t\t\t\tswitch (str) {\n\t\t\t\t//演算子だった場合\n\t\t\t\tcase \"+\":\n\t\t\t\t\ta = main.pop();\n\t\t\t\t\tb = main.pop();\n\t\t\t\t\tmain.push(a + b);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"-\":\n\t\t\t\t\ta = main.pop();\n\t\t\t\t\tb = main.pop();\n\t\t\t\t\tmain.push(b - a);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"*\":\n\t\t\t\t\ta = main.pop();\n\t\t\t\t\tb = main.pop();\n\t\t\t\t\tmain.push(a * b);\n\t\t\t\t\tbreak;\n\t\t\t\t//数字だった場合\n\t\t\t\tdefault:\n\t\t\t\t\tmain.push(Integer.parseInt(str));\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}",
"String str = ary[i];",
"str",
"ary[i]",
"ary",
"i",
"int a;",
"a",
"int b;",
"b",
"switch (str) {\n\t\t\t\t//演算子だった場合\n\t\t\t\tcase \"+\":\n\t\t\t\t\ta = main.pop();\n\t\t\t\t\tb = main.pop();\n\t\t\t\t\tmain.push(a + b);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"-\":\n\t\t\t\t\ta = main.pop();\n\t\t\t\t\tb = main.pop();\n\t\t\t\t\tmain.push(b - a);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"*\":\n\t\t\t\t\ta = main.pop();\n\t\t\t\t\tb = main.pop();\n\t\t\t\t\tmain.push(a * b);\n\t\t\t\t\tbreak;\n\t\t\t\t//数字だった場合\n\t\t\t\tdefault:\n\t\t\t\t\tmain.push(Integer.parseInt(str));\n\t\t\t\t\tbreak;\n\t\t\t\t}",
"str",
"case \"+\":",
"\"+\"",
"case \"+\":",
"a = main.pop()",
"a",
"main.pop()",
"main.pop",
"main",
"b = main.pop()",
"b",
"main.pop()",
"main.pop",
"main",
"main.push(a + b)",
"main.push",
"main",
"a + b",
"a",
"b",
"break;",
"case \"-\":",
"\"-\"",
"case \"-\":",
"a = main.pop()",
"a",
"main.pop()",
"main.pop",
"main",
"b = main.pop()",
"b",
"main.pop()",
"main.pop",
"main",
"main.push(b - a)",
"main.push",
"main",
"b - a",
"b",
"a",
"break;",
"case \"*\":",
"\"*\"",
"case \"*\":",
"a = main.pop()",
"a",
"main.pop()",
"main.pop",
"main",
"b = main.pop()",
"b",
"main.pop()",
"main.pop",
"main",
"main.push(a * b)",
"main.push",
"main",
"a * b",
"a",
"b",
"break;",
"default:",
"default:",
"main.push(Integer.parseInt(str))",
"main.push",
"main",
"Integer.parseInt(str)",
"Integer.parseInt",
"Integer",
"str",
"break;",
"System.out.println(main.S[main.top])",
"System.out.println",
"System.out",
"System",
"System.out",
"main.S[main.top]",
"main.S",
"main",
"main.S",
"main.top",
"main",
"main.top",
"String[] args",
"args",
"public class Main {\n\t//フィールド\n\tint top = 0; //スタックポインタ\n\tint[] S = new int[101]; //スタック\n\n\t//初期化\n\tvoid initialize() {\n\t\ttop = 0;\n\t}\n\n\t//要素が存在しないかを判定\n\tboolean isEmpty() {\n\t\treturn top == 0;\n\t}\n\n\t//要素が満タンかどうか判定\n\tboolean isFull() {\n\t\treturn top >= S.length;\n\t}\n\n\t//要素の追加\n\tvoid push(int x) {\n\t\tif (!isFull()) { //配列に空きがある\n\t\t\ttop++;\n\t\t\tS[top] = x;\n\t\t} else { //配列に空きがない\n\t\t\tSystem.err.println(\"エラー(オーバーフロー)\");\n\t\t}\n\t}\n\n\t//要素の取り出し\n\tint pop() {\n\t\tif (isEmpty()) { //配列に要素がある\n\t\t\tSystem.err.println(\"エラー(アンダーフロー)\");\n\t\t}\n\t\ttop--;\n\t\treturn S[top + 1];\n\t}\n\n\tpublic static void main(String[] args) {\n\t\tMain main = new Main();\n\t\tScanner sc = new Scanner(System.in);\n\t\tif (sc.hasNextLine()) {\n\t\t\tString s = sc.nextLine();\n\t\t\tString[] ary = s.split(\"\\\\s\");\n\t\t\t//操作\n\t\t\tfor (int i = 0; i < ary.length; i++) {\n\t\t\t\tString str = ary[i];\n\t\t\t\tint a;\n\t\t\t\tint b;\n\t\t\t\tswitch (str) {\n\t\t\t\t//演算子だった場合\n\t\t\t\tcase \"+\":\n\t\t\t\t\ta = main.pop();\n\t\t\t\t\tb = main.pop();\n\t\t\t\t\tmain.push(a + b);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"-\":\n\t\t\t\t\ta = main.pop();\n\t\t\t\t\tb = main.pop();\n\t\t\t\t\tmain.push(b - a);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"*\":\n\t\t\t\t\ta = main.pop();\n\t\t\t\t\tb = main.pop();\n\t\t\t\t\tmain.push(a * b);\n\t\t\t\t\tbreak;\n\t\t\t\t//数字だった場合\n\t\t\t\tdefault:\n\t\t\t\t\tmain.push(Integer.parseInt(str));\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(main.S[main.top]);\n\t}\n\n}",
"public class Main {\n\t//フィールド\n\tint top = 0; //スタックポインタ\n\tint[] S = new int[101]; //スタック\n\n\t//初期化\n\tvoid initialize() {\n\t\ttop = 0;\n\t}\n\n\t//要素が存在しないかを判定\n\tboolean isEmpty() {\n\t\treturn top == 0;\n\t}\n\n\t//要素が満タンかどうか判定\n\tboolean isFull() {\n\t\treturn top >= S.length;\n\t}\n\n\t//要素の追加\n\tvoid push(int x) {\n\t\tif (!isFull()) { //配列に空きがある\n\t\t\ttop++;\n\t\t\tS[top] = x;\n\t\t} else { //配列に空きがない\n\t\t\tSystem.err.println(\"エラー(オーバーフロー)\");\n\t\t}\n\t}\n\n\t//要素の取り出し\n\tint pop() {\n\t\tif (isEmpty()) { //配列に要素がある\n\t\t\tSystem.err.println(\"エラー(アンダーフロー)\");\n\t\t}\n\t\ttop--;\n\t\treturn S[top + 1];\n\t}\n\n\tpublic static void main(String[] args) {\n\t\tMain main = new Main();\n\t\tScanner sc = new Scanner(System.in);\n\t\tif (sc.hasNextLine()) {\n\t\t\tString s = sc.nextLine();\n\t\t\tString[] ary = s.split(\"\\\\s\");\n\t\t\t//操作\n\t\t\tfor (int i = 0; i < ary.length; i++) {\n\t\t\t\tString str = ary[i];\n\t\t\t\tint a;\n\t\t\t\tint b;\n\t\t\t\tswitch (str) {\n\t\t\t\t//演算子だった場合\n\t\t\t\tcase \"+\":\n\t\t\t\t\ta = main.pop();\n\t\t\t\t\tb = main.pop();\n\t\t\t\t\tmain.push(a + b);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"-\":\n\t\t\t\t\ta = main.pop();\n\t\t\t\t\tb = main.pop();\n\t\t\t\t\tmain.push(b - a);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"*\":\n\t\t\t\t\ta = main.pop();\n\t\t\t\t\tb = main.pop();\n\t\t\t\t\tmain.push(a * b);\n\t\t\t\t\tbreak;\n\t\t\t\t//数字だった場合\n\t\t\t\tdefault:\n\t\t\t\t\tmain.push(Integer.parseInt(str));\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(main.S[main.top]);\n\t}\n\n}",
"Main"
] | import java.util.Scanner;
public class Main {
//フィールド
int top = 0; //スタックポインタ
int[] S = new int[101]; //スタック
//初期化
void initialize() {
top = 0;
}
//要素が存在しないかを判定
boolean isEmpty() {
return top == 0;
}
//要素が満タンかどうか判定
boolean isFull() {
return top >= S.length;
}
//要素の追加
void push(int x) {
if (!isFull()) { //配列に空きがある
top++;
S[top] = x;
} else { //配列に空きがない
System.err.println("エラー(オーバーフロー)");
}
}
//要素の取り出し
int pop() {
if (isEmpty()) { //配列に要素がある
System.err.println("エラー(アンダーフロー)");
}
top--;
return S[top + 1];
}
public static void main(String[] args) {
Main main = new Main();
Scanner sc = new Scanner(System.in);
if (sc.hasNextLine()) {
String s = sc.nextLine();
String[] ary = s.split("\\s");
//操作
for (int i = 0; i < ary.length; i++) {
String str = ary[i];
int a;
int b;
switch (str) {
//演算子だった場合
case "+":
a = main.pop();
b = main.pop();
main.push(a + b);
break;
case "-":
a = main.pop();
b = main.pop();
main.push(b - a);
break;
case "*":
a = main.pop();
b = main.pop();
main.push(a * b);
break;
//数字だった場合
default:
main.push(Integer.parseInt(str));
break;
}
}
}
System.out.println(main.S[main.top]);
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
17,
41,
13,
20,
41,
13,
17,
41,
13,
20,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
17,
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,
4,
18,
13,
40,
17,
9,
14,
4,
18,
13,
17,
30,
4,
18,
13,
40,
17,
9,
14,
4,
18,
13,
17,
30,
4,
18,
13,
40,
17,
9,
14,
4,
18,
13,
17,
30,
4,
18,
13,
40,
17,
9,
4,
18,
13,
4,
18,
13,
13,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
30,
14,
2,
4,
18,
13,
13,
17,
30,
4,
18,
13,
4,
18,
13,
13,
30,
41,
13,
4,
18,
13,
2,
4,
18,
13,
17,
4,
18,
13,
2,
4,
18,
13,
17,
41,
13,
4,
18,
13,
2,
4,
18,
13,
17,
4,
18,
13,
2,
4,
18,
13,
17,
14,
2,
4,
18,
13,
13,
40,
17,
30,
4,
18,
13,
2,
13,
13,
14,
2,
4,
18,
13,
13,
40,
17,
30,
4,
18,
13,
2,
13,
13,
14,
2,
4,
18,
13,
13,
40,
17,
30,
4,
18,
13,
2,
13,
13,
14,
2,
4,
18,
13,
13,
40,
17,
30,
4,
18,
13,
2,
13,
13,
4,
18,
18,
13,
13,
4,
18,
13,
17,
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
],
[
14,
21
],
[
21,
22
],
[
21,
23
],
[
14,
24
],
[
24,
25
],
[
24,
26
],
[
14,
27
],
[
27,
28
],
[
27,
29
],
[
14,
30
],
[
30,
31
],
[
30,
32
],
[
32,
33
],
[
33,
34
],
[
14,
35
],
[
35,
36
],
[
35,
37
],
[
37,
38
],
[
38,
39
],
[
37,
40
],
[
37,
41
],
[
14,
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
],
[
63,
64
],
[
64,
65
],
[
63,
66
],
[
62,
67
],
[
67,
68
],
[
68,
69
],
[
69,
70
],
[
68,
71
],
[
71,
72
],
[
67,
73
],
[
56,
74
],
[
74,
75
],
[
75,
76
],
[
76,
77
],
[
75,
78
],
[
74,
79
],
[
79,
80
],
[
80,
81
],
[
81,
82
],
[
80,
83
],
[
83,
84
],
[
79,
85
],
[
56,
86
],
[
86,
87
],
[
87,
88
],
[
88,
89
],
[
87,
90
],
[
86,
91
],
[
91,
92
],
[
92,
93
],
[
93,
94
],
[
92,
95
],
[
95,
96
],
[
91,
97
],
[
56,
98
],
[
98,
99
],
[
99,
100
],
[
100,
101
],
[
99,
102
],
[
98,
103
],
[
103,
104
],
[
104,
105
],
[
105,
106
],
[
104,
107
],
[
107,
108
],
[
103,
109
],
[
56,
110
],
[
110,
111
],
[
111,
112
],
[
110,
113
],
[
113,
114
],
[
114,
115
],
[
113,
116
],
[
14,
117
],
[
117,
118
],
[
118,
119
],
[
119,
120
],
[
119,
121
],
[
117,
122
],
[
122,
123
],
[
122,
124
],
[
124,
125
],
[
124,
126
],
[
117,
127
],
[
127,
128
],
[
128,
129
],
[
117,
130
],
[
131,
131
],
[
131,
132
],
[
132,
133
],
[
133,
134
],
[
134,
135
],
[
135,
136
],
[
134,
137
],
[
133,
138
],
[
132,
139
],
[
139,
140
],
[
140,
141
],
[
141,
142
],
[
140,
143
],
[
143,
144
],
[
144,
145
],
[
143,
146
],
[
132,
147
],
[
147,
148
],
[
148,
149
],
[
148,
150
],
[
150,
151
],
[
151,
152
],
[
150,
153
],
[
153,
154
],
[
154,
155
],
[
155,
156
],
[
153,
157
],
[
147,
158
],
[
158,
159
],
[
159,
160
],
[
158,
161
],
[
161,
162
],
[
162,
163
],
[
163,
164
],
[
161,
165
],
[
147,
166
],
[
166,
167
],
[
166,
168
],
[
168,
169
],
[
169,
170
],
[
168,
171
],
[
171,
172
],
[
172,
173
],
[
173,
174
],
[
171,
175
],
[
147,
176
],
[
176,
177
],
[
177,
178
],
[
176,
179
],
[
179,
180
],
[
180,
181
],
[
181,
182
],
[
179,
183
],
[
147,
184
],
[
184,
185
],
[
185,
186
],
[
186,
187
],
[
187,
188
],
[
186,
189
],
[
185,
190
],
[
190,
191
],
[
184,
192
],
[
192,
193
],
[
193,
194
],
[
194,
195
],
[
193,
196
],
[
196,
197
],
[
196,
198
],
[
184,
199
],
[
199,
200
],
[
200,
201
],
[
201,
202
],
[
202,
203
],
[
201,
204
],
[
200,
205
],
[
205,
206
],
[
199,
207
],
[
207,
208
],
[
208,
209
],
[
209,
210
],
[
208,
211
],
[
211,
212
],
[
211,
213
],
[
199,
214
],
[
214,
215
],
[
215,
216
],
[
216,
217
],
[
217,
218
],
[
216,
219
],
[
215,
220
],
[
220,
221
],
[
214,
222
],
[
222,
223
],
[
223,
224
],
[
224,
225
],
[
223,
226
],
[
226,
227
],
[
226,
228
],
[
214,
229
],
[
229,
230
],
[
230,
231
],
[
231,
232
],
[
232,
233
],
[
231,
234
],
[
230,
235
],
[
235,
236
],
[
229,
237
],
[
237,
238
],
[
238,
239
],
[
239,
240
],
[
238,
241
],
[
241,
242
],
[
241,
243
],
[
14,
244
],
[
244,
245
],
[
245,
246
],
[
246,
247
],
[
246,
248
],
[
244,
249
],
[
249,
250
],
[
250,
251
],
[
249,
252
],
[
12,
253
],
[
253,
254
]
] | [
"\nimport java.util.List;\nimport java.util.ArrayList;\n\nimport java.util.Scanner;\nclass Main{\n static public void main(String[] av){\n int sum=0;\n\n Scanner sc =new Scanner(System.in);\n // int n =sc.nextInt();\nint ch =1;\nList<Integer> intlist = new ArrayList<Integer>();\nList<Integer> stack = new ArrayList<Integer>();\nString ss= sc.nextLine();\n\nString[] f = ss.split(\" \", 0);\n/*\nfor(int k =0;k<f.length ;k++) {\n System.out.println(f[k]);\n}\n*/\n\nfor(int k =0;k<f.length ;k++) {\n String s= f[k];\n/*\n if (s==null){\n ch=0;\n break;\n }\n */\n if (s.contains(\"+\")){\n intlist.add(-1);\n \n continue;\n }\n if (s.contains(\"-\")){\n intlist.add(-2);\n \n continue;\n }\n if (s.contains(\"*\")){\n intlist.add(-3);\n \n \n continue;\n }\n if (s.contains(\"/\")){\n intlist.add(-4);\n \n continue;\n }\n intlist.add(Integer.valueOf(s));\n \n }\n\n for(int i=0;i<f.length;i++){\n if ( intlist.get(i)>=0){\n stack.add(intlist.get(i));\n }\n else{\n int v1= stack.get(stack.size()-1);\n stack.remove(stack.size()-1);\n int v2= stack.get(stack.size()-1);\n stack.remove(stack.size()-1);\n if (intlist.get(i)==(-1)){\n stack.add(v2+v1);\n }\n else if (intlist.get(i)==(-2)){\n stack.add(v2-v1);\n }\n else if (intlist.get(i)==(-3)){\n stack.add(v2*v1);\n }\n else if (intlist.get(i)==(-4)){\n stack.add(v2/v1);\n }\n }\n }\n System.out.println(stack.get(0));\n\n}\n\n}\n\n\n\n\n",
"import java.util.List;",
"List",
"java.util",
"import java.util.ArrayList;",
"ArrayList",
"java.util",
"import java.util.Scanner;",
"Scanner",
"java.util",
"class Main{\n static public void main(String[] av){\n int sum=0;\n\n Scanner sc =new Scanner(System.in);\n // int n =sc.nextInt();\nint ch =1;\nList<Integer> intlist = new ArrayList<Integer>();\nList<Integer> stack = new ArrayList<Integer>();\nString ss= sc.nextLine();\n\nString[] f = ss.split(\" \", 0);\n/*\nfor(int k =0;k<f.length ;k++) {\n System.out.println(f[k]);\n}\n*/\n\nfor(int k =0;k<f.length ;k++) {\n String s= f[k];\n/*\n if (s==null){\n ch=0;\n break;\n }\n */\n if (s.contains(\"+\")){\n intlist.add(-1);\n \n continue;\n }\n if (s.contains(\"-\")){\n intlist.add(-2);\n \n continue;\n }\n if (s.contains(\"*\")){\n intlist.add(-3);\n \n \n continue;\n }\n if (s.contains(\"/\")){\n intlist.add(-4);\n \n continue;\n }\n intlist.add(Integer.valueOf(s));\n \n }\n\n for(int i=0;i<f.length;i++){\n if ( intlist.get(i)>=0){\n stack.add(intlist.get(i));\n }\n else{\n int v1= stack.get(stack.size()-1);\n stack.remove(stack.size()-1);\n int v2= stack.get(stack.size()-1);\n stack.remove(stack.size()-1);\n if (intlist.get(i)==(-1)){\n stack.add(v2+v1);\n }\n else if (intlist.get(i)==(-2)){\n stack.add(v2-v1);\n }\n else if (intlist.get(i)==(-3)){\n stack.add(v2*v1);\n }\n else if (intlist.get(i)==(-4)){\n stack.add(v2/v1);\n }\n }\n }\n System.out.println(stack.get(0));\n\n}\n\n}",
"Main",
"static public void main(String[] av){\n int sum=0;\n\n Scanner sc =new Scanner(System.in);\n // int n =sc.nextInt();\nint ch =1;\nList<Integer> intlist = new ArrayList<Integer>();\nList<Integer> stack = new ArrayList<Integer>();\nString ss= sc.nextLine();\n\nString[] f = ss.split(\" \", 0);\n/*\nfor(int k =0;k<f.length ;k++) {\n System.out.println(f[k]);\n}\n*/\n\nfor(int k =0;k<f.length ;k++) {\n String s= f[k];\n/*\n if (s==null){\n ch=0;\n break;\n }\n */\n if (s.contains(\"+\")){\n intlist.add(-1);\n \n continue;\n }\n if (s.contains(\"-\")){\n intlist.add(-2);\n \n continue;\n }\n if (s.contains(\"*\")){\n intlist.add(-3);\n \n \n continue;\n }\n if (s.contains(\"/\")){\n intlist.add(-4);\n \n continue;\n }\n intlist.add(Integer.valueOf(s));\n \n }\n\n for(int i=0;i<f.length;i++){\n if ( intlist.get(i)>=0){\n stack.add(intlist.get(i));\n }\n else{\n int v1= stack.get(stack.size()-1);\n stack.remove(stack.size()-1);\n int v2= stack.get(stack.size()-1);\n stack.remove(stack.size()-1);\n if (intlist.get(i)==(-1)){\n stack.add(v2+v1);\n }\n else if (intlist.get(i)==(-2)){\n stack.add(v2-v1);\n }\n else if (intlist.get(i)==(-3)){\n stack.add(v2*v1);\n }\n else if (intlist.get(i)==(-4)){\n stack.add(v2/v1);\n }\n }\n }\n System.out.println(stack.get(0));\n\n}",
"main",
"{\n int sum=0;\n\n Scanner sc =new Scanner(System.in);\n // int n =sc.nextInt();\nint ch =1;\nList<Integer> intlist = new ArrayList<Integer>();\nList<Integer> stack = new ArrayList<Integer>();\nString ss= sc.nextLine();\n\nString[] f = ss.split(\" \", 0);\n/*\nfor(int k =0;k<f.length ;k++) {\n System.out.println(f[k]);\n}\n*/\n\nfor(int k =0;k<f.length ;k++) {\n String s= f[k];\n/*\n if (s==null){\n ch=0;\n break;\n }\n */\n if (s.contains(\"+\")){\n intlist.add(-1);\n \n continue;\n }\n if (s.contains(\"-\")){\n intlist.add(-2);\n \n continue;\n }\n if (s.contains(\"*\")){\n intlist.add(-3);\n \n \n continue;\n }\n if (s.contains(\"/\")){\n intlist.add(-4);\n \n continue;\n }\n intlist.add(Integer.valueOf(s));\n \n }\n\n for(int i=0;i<f.length;i++){\n if ( intlist.get(i)>=0){\n stack.add(intlist.get(i));\n }\n else{\n int v1= stack.get(stack.size()-1);\n stack.remove(stack.size()-1);\n int v2= stack.get(stack.size()-1);\n stack.remove(stack.size()-1);\n if (intlist.get(i)==(-1)){\n stack.add(v2+v1);\n }\n else if (intlist.get(i)==(-2)){\n stack.add(v2-v1);\n }\n else if (intlist.get(i)==(-3)){\n stack.add(v2*v1);\n }\n else if (intlist.get(i)==(-4)){\n stack.add(v2/v1);\n }\n }\n }\n System.out.println(stack.get(0));\n\n}",
"int sum=0;",
"sum",
"0",
"Scanner sc =new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int ch =1;",
"ch",
"1",
"List<Integer> intlist = new ArrayList<Integer>();",
"intlist",
"new ArrayList<Integer>()",
"List<Integer> stack = new ArrayList<Integer>();",
"stack",
"new ArrayList<Integer>()",
"String ss= sc.nextLine();",
"ss",
"sc.nextLine()",
"sc.nextLine",
"sc",
"String[] f = ss.split(\" \", 0);",
"f",
"ss.split(\" \", 0)",
"ss.split",
"ss",
"\" \"",
"0",
"for(int k =0;k<f.length ;k++) {\n String s= f[k];\n/*\n if (s==null){\n ch=0;\n break;\n }\n */\n if (s.contains(\"+\")){\n intlist.add(-1);\n \n continue;\n }\n if (s.contains(\"-\")){\n intlist.add(-2);\n \n continue;\n }\n if (s.contains(\"*\")){\n intlist.add(-3);\n \n \n continue;\n }\n if (s.contains(\"/\")){\n intlist.add(-4);\n \n continue;\n }\n intlist.add(Integer.valueOf(s));\n \n }",
"int k =0;",
"int k =0;",
"k",
"0",
"k<f.length",
"k",
"f.length",
"f",
"f.length",
"k++",
"k++",
"k",
"{\n String s= f[k];\n/*\n if (s==null){\n ch=0;\n break;\n }\n */\n if (s.contains(\"+\")){\n intlist.add(-1);\n \n continue;\n }\n if (s.contains(\"-\")){\n intlist.add(-2);\n \n continue;\n }\n if (s.contains(\"*\")){\n intlist.add(-3);\n \n \n continue;\n }\n if (s.contains(\"/\")){\n intlist.add(-4);\n \n continue;\n }\n intlist.add(Integer.valueOf(s));\n \n }",
"{\n String s= f[k];\n/*\n if (s==null){\n ch=0;\n break;\n }\n */\n if (s.contains(\"+\")){\n intlist.add(-1);\n \n continue;\n }\n if (s.contains(\"-\")){\n intlist.add(-2);\n \n continue;\n }\n if (s.contains(\"*\")){\n intlist.add(-3);\n \n \n continue;\n }\n if (s.contains(\"/\")){\n intlist.add(-4);\n \n continue;\n }\n intlist.add(Integer.valueOf(s));\n \n }",
"String s= f[k];",
"s",
"f[k]",
"f",
"k",
"if (s.contains(\"+\")){\n intlist.add(-1);\n \n continue;\n }",
"s.contains(\"+\")",
"s.contains",
"s",
"\"+\"",
"{\n intlist.add(-1);\n \n continue;\n }",
"intlist.add(-1)",
"intlist.add",
"intlist",
"-1",
"1",
"continue;",
"if (s.contains(\"-\")){\n intlist.add(-2);\n \n continue;\n }",
"s.contains(\"-\")",
"s.contains",
"s",
"\"-\"",
"{\n intlist.add(-2);\n \n continue;\n }",
"intlist.add(-2)",
"intlist.add",
"intlist",
"-2",
"2",
"continue;",
"if (s.contains(\"*\")){\n intlist.add(-3);\n \n \n continue;\n }",
"s.contains(\"*\")",
"s.contains",
"s",
"\"*\"",
"{\n intlist.add(-3);\n \n \n continue;\n }",
"intlist.add(-3)",
"intlist.add",
"intlist",
"-3",
"3",
"continue;",
"if (s.contains(\"/\")){\n intlist.add(-4);\n \n continue;\n }",
"s.contains(\"/\")",
"s.contains",
"s",
"\"/\"",
"{\n intlist.add(-4);\n \n continue;\n }",
"intlist.add(-4)",
"intlist.add",
"intlist",
"-4",
"4",
"continue;",
"intlist.add(Integer.valueOf(s))",
"intlist.add",
"intlist",
"Integer.valueOf(s)",
"Integer.valueOf",
"Integer",
"s",
"for(int i=0;i<f.length;i++){\n if ( intlist.get(i)>=0){\n stack.add(intlist.get(i));\n }\n else{\n int v1= stack.get(stack.size()-1);\n stack.remove(stack.size()-1);\n int v2= stack.get(stack.size()-1);\n stack.remove(stack.size()-1);\n if (intlist.get(i)==(-1)){\n stack.add(v2+v1);\n }\n else if (intlist.get(i)==(-2)){\n stack.add(v2-v1);\n }\n else if (intlist.get(i)==(-3)){\n stack.add(v2*v1);\n }\n else if (intlist.get(i)==(-4)){\n stack.add(v2/v1);\n }\n }\n }",
"int i=0;",
"int i=0;",
"i",
"0",
"i<f.length",
"i",
"f.length",
"f",
"f.length",
"i++",
"i++",
"i",
"{\n if ( intlist.get(i)>=0){\n stack.add(intlist.get(i));\n }\n else{\n int v1= stack.get(stack.size()-1);\n stack.remove(stack.size()-1);\n int v2= stack.get(stack.size()-1);\n stack.remove(stack.size()-1);\n if (intlist.get(i)==(-1)){\n stack.add(v2+v1);\n }\n else if (intlist.get(i)==(-2)){\n stack.add(v2-v1);\n }\n else if (intlist.get(i)==(-3)){\n stack.add(v2*v1);\n }\n else if (intlist.get(i)==(-4)){\n stack.add(v2/v1);\n }\n }\n }",
"{\n if ( intlist.get(i)>=0){\n stack.add(intlist.get(i));\n }\n else{\n int v1= stack.get(stack.size()-1);\n stack.remove(stack.size()-1);\n int v2= stack.get(stack.size()-1);\n stack.remove(stack.size()-1);\n if (intlist.get(i)==(-1)){\n stack.add(v2+v1);\n }\n else if (intlist.get(i)==(-2)){\n stack.add(v2-v1);\n }\n else if (intlist.get(i)==(-3)){\n stack.add(v2*v1);\n }\n else if (intlist.get(i)==(-4)){\n stack.add(v2/v1);\n }\n }\n }",
"if ( intlist.get(i)>=0){\n stack.add(intlist.get(i));\n }\n else{\n int v1= stack.get(stack.size()-1);\n stack.remove(stack.size()-1);\n int v2= stack.get(stack.size()-1);\n stack.remove(stack.size()-1);\n if (intlist.get(i)==(-1)){\n stack.add(v2+v1);\n }\n else if (intlist.get(i)==(-2)){\n stack.add(v2-v1);\n }\n else if (intlist.get(i)==(-3)){\n stack.add(v2*v1);\n }\n else if (intlist.get(i)==(-4)){\n stack.add(v2/v1);\n }\n }",
"intlist.get(i)>=0",
"intlist.get(i)",
"intlist.get",
"intlist",
"i",
"0",
"{\n stack.add(intlist.get(i));\n }",
"stack.add(intlist.get(i))",
"stack.add",
"stack",
"intlist.get(i)",
"intlist.get",
"intlist",
"i",
"{\n int v1= stack.get(stack.size()-1);\n stack.remove(stack.size()-1);\n int v2= stack.get(stack.size()-1);\n stack.remove(stack.size()-1);\n if (intlist.get(i)==(-1)){\n stack.add(v2+v1);\n }\n else if (intlist.get(i)==(-2)){\n stack.add(v2-v1);\n }\n else if (intlist.get(i)==(-3)){\n stack.add(v2*v1);\n }\n else if (intlist.get(i)==(-4)){\n stack.add(v2/v1);\n }\n }",
"int v1= stack.get(stack.size()-1);",
"v1",
"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",
"int v2= stack.get(stack.size()-1);",
"v2",
"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",
"if (intlist.get(i)==(-1)){\n stack.add(v2+v1);\n }\n else if (intlist.get(i)==(-2)){\n stack.add(v2-v1);\n }\n else if (intlist.get(i)==(-3)){\n stack.add(v2*v1);\n }\n else if (intlist.get(i)==(-4)){\n stack.add(v2/v1);\n }",
"intlist.get(i)==(-1)",
"intlist.get(i)",
"intlist.get",
"intlist",
"i",
"(-1)",
"1",
"{\n stack.add(v2+v1);\n }",
"stack.add(v2+v1)",
"stack.add",
"stack",
"v2+v1",
"v2",
"v1",
"if (intlist.get(i)==(-2)){\n stack.add(v2-v1);\n }\n else if (intlist.get(i)==(-3)){\n stack.add(v2*v1);\n }\n else if (intlist.get(i)==(-4)){\n stack.add(v2/v1);\n }",
"intlist.get(i)==(-2)",
"intlist.get(i)",
"intlist.get",
"intlist",
"i",
"(-2)",
"2",
"{\n stack.add(v2-v1);\n }",
"stack.add(v2-v1)",
"stack.add",
"stack",
"v2-v1",
"v2",
"v1",
"if (intlist.get(i)==(-3)){\n stack.add(v2*v1);\n }\n else if (intlist.get(i)==(-4)){\n stack.add(v2/v1);\n }",
"intlist.get(i)==(-3)",
"intlist.get(i)",
"intlist.get",
"intlist",
"i",
"(-3)",
"3",
"{\n stack.add(v2*v1);\n }",
"stack.add(v2*v1)",
"stack.add",
"stack",
"v2*v1",
"v2",
"v1",
"if (intlist.get(i)==(-4)){\n stack.add(v2/v1);\n }",
"intlist.get(i)==(-4)",
"intlist.get(i)",
"intlist.get",
"intlist",
"i",
"(-4)",
"4",
"{\n stack.add(v2/v1);\n }",
"stack.add(v2/v1)",
"stack.add",
"stack",
"v2/v1",
"v2",
"v1",
"System.out.println(stack.get(0))",
"System.out.println",
"System.out",
"System",
"System.out",
"stack.get(0)",
"stack.get",
"stack",
"0",
"String[] av",
"av"
] |
import java.util.List;
import java.util.ArrayList;
import java.util.Scanner;
class Main{
static public void main(String[] av){
int sum=0;
Scanner sc =new Scanner(System.in);
// int n =sc.nextInt();
int ch =1;
List<Integer> intlist = new ArrayList<Integer>();
List<Integer> stack = new ArrayList<Integer>();
String ss= sc.nextLine();
String[] f = ss.split(" ", 0);
/*
for(int k =0;k<f.length ;k++) {
System.out.println(f[k]);
}
*/
for(int k =0;k<f.length ;k++) {
String s= f[k];
/*
if (s==null){
ch=0;
break;
}
*/
if (s.contains("+")){
intlist.add(-1);
continue;
}
if (s.contains("-")){
intlist.add(-2);
continue;
}
if (s.contains("*")){
intlist.add(-3);
continue;
}
if (s.contains("/")){
intlist.add(-4);
continue;
}
intlist.add(Integer.valueOf(s));
}
for(int i=0;i<f.length;i++){
if ( intlist.get(i)>=0){
stack.add(intlist.get(i));
}
else{
int v1= stack.get(stack.size()-1);
stack.remove(stack.size()-1);
int v2= stack.get(stack.size()-1);
stack.remove(stack.size()-1);
if (intlist.get(i)==(-1)){
stack.add(v2+v1);
}
else if (intlist.get(i)==(-2)){
stack.add(v2-v1);
}
else if (intlist.get(i)==(-3)){
stack.add(v2*v1);
}
else if (intlist.get(i)==(-4)){
stack.add(v2/v1);
}
}
}
System.out.println(stack.get(0));
}
}
|
[
7,
15,
13,
17,
6,
13,
41,
13,
17,
41,
13,
20,
17,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
17,
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,
9,
14,
4,
18,
18,
13,
13,
17,
30,
41,
13,
4,
13,
41,
13,
4,
13,
4,
13,
2,
13,
13,
9,
14,
4,
18,
18,
13,
13,
17,
30,
41,
13,
4,
13,
41,
13,
4,
13,
4,
13,
2,
13,
13,
9,
4,
13,
4,
18,
13,
18,
13,
13,
4,
18,
18,
13,
13,
4,
13,
23,
13,
12,
13,
30,
40,
13,
29,
18,
13,
2,
13,
17,
12,
13,
30,
40,
13,
0,
18,
13,
13,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
153,
5
],
[
153,
6
],
[
6,
7
],
[
6,
8
],
[
153,
9
],
[
9,
10
],
[
9,
11
],
[
153,
13
],
[
13,
14
],
[
13,
15
],
[
15,
16
],
[
16,
17
],
[
16,
18
],
[
15,
19
],
[
19,
20
],
[
19,
21
],
[
21,
22
],
[
22,
23
],
[
15,
24
],
[
24,
25
],
[
24,
26
],
[
26,
27
],
[
27,
28
],
[
26,
29
],
[
26,
30
],
[
15,
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
],
[
47,
48
],
[
48,
49
],
[
49,
50
],
[
49,
51
],
[
47,
52
],
[
46,
53
],
[
53,
54
],
[
54,
55
],
[
54,
56
],
[
56,
57
],
[
53,
58
],
[
58,
59
],
[
58,
60
],
[
60,
61
],
[
53,
62
],
[
62,
63
],
[
62,
64
],
[
64,
65
],
[
64,
66
],
[
53,
67
],
[
45,
68
],
[
68,
69
],
[
69,
70
],
[
70,
71
],
[
71,
72
],
[
71,
73
],
[
69,
74
],
[
68,
75
],
[
75,
76
],
[
76,
77
],
[
76,
78
],
[
78,
79
],
[
75,
80
],
[
80,
81
],
[
80,
82
],
[
82,
83
],
[
75,
84
],
[
84,
85
],
[
84,
86
],
[
86,
87
],
[
86,
88
],
[
75,
89
],
[
45,
90
],
[
90,
91
],
[
91,
92
],
[
92,
93
],
[
93,
94
],
[
93,
95
],
[
91,
96
],
[
90,
97
],
[
97,
98
],
[
98,
99
],
[
98,
100
],
[
100,
101
],
[
97,
102
],
[
102,
103
],
[
102,
104
],
[
104,
105
],
[
97,
106
],
[
106,
107
],
[
106,
108
],
[
108,
109
],
[
108,
110
],
[
97,
111
],
[
45,
112
],
[
112,
113
],
[
112,
114
],
[
114,
115
],
[
115,
116
],
[
114,
117
],
[
117,
118
],
[
117,
119
],
[
15,
120
],
[
120,
121
],
[
121,
122
],
[
122,
123
],
[
122,
124
],
[
120,
125
],
[
125,
126
],
[
13,
127
],
[
127,
128
],
[
153,
129
],
[
129,
130
],
[
129,
131
],
[
131,
132
],
[
132,
133
],
[
131,
134
],
[
134,
135
],
[
135,
136
],
[
135,
137
],
[
137,
138
],
[
137,
139
],
[
153,
140
],
[
140,
141
],
[
140,
142
],
[
142,
143
],
[
143,
144
],
[
142,
145
],
[
145,
146
],
[
146,
147
],
[
146,
148
],
[
145,
149
],
[
140,
150
],
[
150,
151
],
[
0,
152
],
[
152,
153
],
[
152,
154
]
] | [
"import java.util.Scanner;\npublic class Main {\n static int top = 0;\n static int[] number = new int[200];\n\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n String s = sc.nextLine();\n String[] str = s.split(\" \",0);\n for(int i = 0; i<str.length; i++){\n if(str[i].equals(\"+\")) {\n int a = pop();\n int b = pop();\n push(b+a);\n continue;\n }\n if(str[i].equals(\"-\")) {\n int a = pop();\n int b = pop();\n push(b-a);\n continue;\n }\n if(str[i].equals(\"*\")) {\n int a = pop();\n int b = pop();\n push(b*a);\n continue;\n }\n push(Integer.parseInt(str[i]));\n }\n System.out.println(pop());\n }\n public static int pop() {\n top--;\n return number[top+1];\n }\n public static void push(int i) {\n top++;\n number[top] = i;\n }\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n static int top = 0;\n static int[] number = new int[200];\n\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n String s = sc.nextLine();\n String[] str = s.split(\" \",0);\n for(int i = 0; i<str.length; i++){\n if(str[i].equals(\"+\")) {\n int a = pop();\n int b = pop();\n push(b+a);\n continue;\n }\n if(str[i].equals(\"-\")) {\n int a = pop();\n int b = pop();\n push(b-a);\n continue;\n }\n if(str[i].equals(\"*\")) {\n int a = pop();\n int b = pop();\n push(b*a);\n continue;\n }\n push(Integer.parseInt(str[i]));\n }\n System.out.println(pop());\n }\n public static int pop() {\n top--;\n return number[top+1];\n }\n public static void push(int i) {\n top++;\n number[top] = i;\n }\n}",
"Main",
"static int top = 0;",
"top",
"0",
"static int[] number = new int[200];",
"number",
"new int[200]",
"200",
"public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n String s = sc.nextLine();\n String[] str = s.split(\" \",0);\n for(int i = 0; i<str.length; i++){\n if(str[i].equals(\"+\")) {\n int a = pop();\n int b = pop();\n push(b+a);\n continue;\n }\n if(str[i].equals(\"-\")) {\n int a = pop();\n int b = pop();\n push(b-a);\n continue;\n }\n if(str[i].equals(\"*\")) {\n int a = pop();\n int b = pop();\n push(b*a);\n continue;\n }\n push(Integer.parseInt(str[i]));\n }\n System.out.println(pop());\n }",
"main",
"{\n Scanner sc = new Scanner(System.in);\n String s = sc.nextLine();\n String[] str = s.split(\" \",0);\n for(int i = 0; i<str.length; i++){\n if(str[i].equals(\"+\")) {\n int a = pop();\n int b = pop();\n push(b+a);\n continue;\n }\n if(str[i].equals(\"-\")) {\n int a = pop();\n int b = pop();\n push(b-a);\n continue;\n }\n if(str[i].equals(\"*\")) {\n int a = pop();\n int b = pop();\n push(b*a);\n continue;\n }\n push(Integer.parseInt(str[i]));\n }\n System.out.println(pop());\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"String s = sc.nextLine();",
"s",
"sc.nextLine()",
"sc.nextLine",
"sc",
"String[] str = s.split(\" \",0);",
"str",
"s.split(\" \",0)",
"s.split",
"s",
"\" \"",
"0",
"for(int i = 0; i<str.length; i++){\n if(str[i].equals(\"+\")) {\n int a = pop();\n int b = pop();\n push(b+a);\n continue;\n }\n if(str[i].equals(\"-\")) {\n int a = pop();\n int b = pop();\n push(b-a);\n continue;\n }\n if(str[i].equals(\"*\")) {\n int a = pop();\n int b = pop();\n push(b*a);\n continue;\n }\n push(Integer.parseInt(str[i]));\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i<str.length",
"i",
"str.length",
"str",
"str.length",
"i++",
"i++",
"i",
"{\n if(str[i].equals(\"+\")) {\n int a = pop();\n int b = pop();\n push(b+a);\n continue;\n }\n if(str[i].equals(\"-\")) {\n int a = pop();\n int b = pop();\n push(b-a);\n continue;\n }\n if(str[i].equals(\"*\")) {\n int a = pop();\n int b = pop();\n push(b*a);\n continue;\n }\n push(Integer.parseInt(str[i]));\n }",
"{\n if(str[i].equals(\"+\")) {\n int a = pop();\n int b = pop();\n push(b+a);\n continue;\n }\n if(str[i].equals(\"-\")) {\n int a = pop();\n int b = pop();\n push(b-a);\n continue;\n }\n if(str[i].equals(\"*\")) {\n int a = pop();\n int b = pop();\n push(b*a);\n continue;\n }\n push(Integer.parseInt(str[i]));\n }",
"if(str[i].equals(\"+\")) {\n int a = pop();\n int b = pop();\n push(b+a);\n continue;\n }",
"str[i].equals(\"+\")",
"str[i].equals",
"str[i]",
"str",
"i",
"\"+\"",
"{\n int a = pop();\n int b = pop();\n push(b+a);\n continue;\n }",
"int a = pop();",
"a",
"pop()",
"pop",
"int b = pop();",
"b",
"pop()",
"pop",
"push(b+a)",
"push",
"b+a",
"b",
"a",
"continue;",
"if(str[i].equals(\"-\")) {\n int a = pop();\n int b = pop();\n push(b-a);\n continue;\n }",
"str[i].equals(\"-\")",
"str[i].equals",
"str[i]",
"str",
"i",
"\"-\"",
"{\n int a = pop();\n int b = pop();\n push(b-a);\n continue;\n }",
"int a = pop();",
"a",
"pop()",
"pop",
"int b = pop();",
"b",
"pop()",
"pop",
"push(b-a)",
"push",
"b-a",
"b",
"a",
"continue;",
"if(str[i].equals(\"*\")) {\n int a = pop();\n int b = pop();\n push(b*a);\n continue;\n }",
"str[i].equals(\"*\")",
"str[i].equals",
"str[i]",
"str",
"i",
"\"*\"",
"{\n int a = pop();\n int b = pop();\n push(b*a);\n continue;\n }",
"int a = pop();",
"a",
"pop()",
"pop",
"int b = pop();",
"b",
"pop()",
"pop",
"push(b*a)",
"push",
"b*a",
"b",
"a",
"continue;",
"push(Integer.parseInt(str[i]))",
"push",
"Integer.parseInt(str[i])",
"Integer.parseInt",
"Integer",
"str[i]",
"str",
"i",
"System.out.println(pop())",
"System.out.println",
"System.out",
"System",
"System.out",
"pop()",
"pop",
"String[] args",
"args",
"public static int pop() {\n top--;\n return number[top+1];\n }",
"pop",
"{\n top--;\n return number[top+1];\n }",
"top--",
"top",
"return number[top+1];",
"number[top+1]",
"number",
"top+1",
"top",
"1",
"public static void push(int i) {\n top++;\n number[top] = i;\n }",
"push",
"{\n top++;\n number[top] = i;\n }",
"top++",
"top",
"number[top] = i",
"number[top]",
"number",
"top",
"i",
"int i",
"i",
"public class Main {\n static int top = 0;\n static int[] number = new int[200];\n\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n String s = sc.nextLine();\n String[] str = s.split(\" \",0);\n for(int i = 0; i<str.length; i++){\n if(str[i].equals(\"+\")) {\n int a = pop();\n int b = pop();\n push(b+a);\n continue;\n }\n if(str[i].equals(\"-\")) {\n int a = pop();\n int b = pop();\n push(b-a);\n continue;\n }\n if(str[i].equals(\"*\")) {\n int a = pop();\n int b = pop();\n push(b*a);\n continue;\n }\n push(Integer.parseInt(str[i]));\n }\n System.out.println(pop());\n }\n public static int pop() {\n top--;\n return number[top+1];\n }\n public static void push(int i) {\n top++;\n number[top] = i;\n }\n}",
"public class Main {\n static int top = 0;\n static int[] number = new int[200];\n\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n String s = sc.nextLine();\n String[] str = s.split(\" \",0);\n for(int i = 0; i<str.length; i++){\n if(str[i].equals(\"+\")) {\n int a = pop();\n int b = pop();\n push(b+a);\n continue;\n }\n if(str[i].equals(\"-\")) {\n int a = pop();\n int b = pop();\n push(b-a);\n continue;\n }\n if(str[i].equals(\"*\")) {\n int a = pop();\n int b = pop();\n push(b*a);\n continue;\n }\n push(Integer.parseInt(str[i]));\n }\n System.out.println(pop());\n }\n public static int pop() {\n top--;\n return number[top+1];\n }\n public static void push(int i) {\n top++;\n number[top] = i;\n }\n}",
"Main"
] | import java.util.Scanner;
public class Main {
static int top = 0;
static int[] number = new int[200];
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String s = sc.nextLine();
String[] str = s.split(" ",0);
for(int i = 0; i<str.length; i++){
if(str[i].equals("+")) {
int a = pop();
int b = pop();
push(b+a);
continue;
}
if(str[i].equals("-")) {
int a = pop();
int b = pop();
push(b-a);
continue;
}
if(str[i].equals("*")) {
int a = pop();
int b = pop();
push(b*a);
continue;
}
push(Integer.parseInt(str[i]));
}
System.out.println(pop());
}
public static int pop() {
top--;
return number[top+1];
}
public static void push(int i) {
top++;
number[top] = i;
}
} |
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
17,
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,
41,
13,
4,
18,
13,
4,
18,
13,
41,
13,
4,
18,
13,
4,
18,
13,
14,
4,
18,
18,
13,
13,
17,
30,
4,
18,
13,
4,
18,
13,
2,
13,
13,
14,
4,
18,
18,
13,
13,
17,
30,
4,
18,
13,
4,
18,
13,
2,
13,
13,
14,
4,
18,
18,
13,
13,
17,
30,
4,
18,
13,
4,
18,
13,
2,
13,
13,
14,
4,
18,
18,
13,
13,
17,
30,
4,
18,
13,
4,
18,
13,
2,
13,
13,
30,
4,
18,
13,
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
],
[
156,
8
],
[
156,
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
],
[
48,
50
],
[
50,
51
],
[
51,
52
],
[
50,
53
],
[
53,
54
],
[
54,
55
],
[
47,
56
],
[
56,
57
],
[
56,
58
],
[
58,
59
],
[
59,
60
],
[
58,
61
],
[
61,
62
],
[
62,
63
],
[
47,
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
],
[
75,
78
],
[
78,
79
],
[
78,
80
],
[
64,
81
],
[
81,
82
],
[
82,
83
],
[
83,
84
],
[
84,
85
],
[
84,
86
],
[
82,
87
],
[
81,
88
],
[
88,
89
],
[
89,
90
],
[
90,
91
],
[
89,
92
],
[
92,
93
],
[
93,
94
],
[
92,
95
],
[
95,
96
],
[
95,
97
],
[
81,
98
],
[
98,
99
],
[
99,
100
],
[
100,
101
],
[
101,
102
],
[
101,
103
],
[
99,
104
],
[
98,
105
],
[
105,
106
],
[
106,
107
],
[
107,
108
],
[
106,
109
],
[
109,
110
],
[
110,
111
],
[
109,
112
],
[
112,
113
],
[
112,
114
],
[
98,
115
],
[
115,
116
],
[
116,
117
],
[
117,
118
],
[
118,
119
],
[
118,
120
],
[
116,
121
],
[
115,
122
],
[
122,
123
],
[
123,
124
],
[
124,
125
],
[
123,
126
],
[
126,
127
],
[
127,
128
],
[
126,
129
],
[
129,
130
],
[
129,
131
],
[
44,
132
],
[
132,
133
],
[
133,
134
],
[
134,
135
],
[
133,
136
],
[
136,
137
],
[
137,
138
],
[
136,
139
],
[
139,
140
],
[
140,
141
],
[
139,
142
],
[
142,
143
],
[
142,
144
],
[
11,
145
],
[
145,
146
],
[
146,
147
],
[
147,
148
],
[
147,
149
],
[
145,
150
],
[
150,
151
],
[
151,
152
],
[
9,
153
],
[
153,
154
],
[
0,
155
],
[
155,
156
],
[
155,
157
]
] | [
"import java.util.Scanner;\nimport java.util.Stack;\n\npublic class Main {\n\n\tpublic static void main(String[] args) {\n\t\t// TODO 自動生成されたメソッド・スタブ\n\t\tScanner scan = new Scanner(System.in);\n\t\tint sum = 0;\n\t\tString[] array = scan.nextLine().split(\" \");\n\t\tStack<String> stack = new Stack<>();\n\t\t\n\t\tfor(int i = 0; i < array.length; i++) {\n\t\t\ttry {\n\t\t\t\tstack.push(String.valueOf(Integer.parseInt(array[i])));\n\t\t\t\n\t\t\t\n\t\t\t}catch(NumberFormatException e){\n\t\t\t\tint x = Integer.parseInt(stack.pop());\n\t\t\t\tint y = Integer.parseInt(stack.pop());\n\t\t \n\t\t\t\tif(array[i].equals(\"+\")) {\n\t\t\t\t\tstack.push(String.valueOf(y+x));\n\t\t\t\t} else if(array[i].equals(\"-\")) {\n\t\t\t\t\tstack.push(String.valueOf(y-x));\n\t\t\t\t\t} else if(array[i].equals(\"*\")) {\n\t\t\t\t\t\tstack.push(String.valueOf(y*x));\n\t\t\t\t\t} else if(array[i].equals(\"/\")) {\n\t\t\t\t\t\tstack.push(String.valueOf(y/x));\n\t\t\t\t\t}\n\t\t } \n\t\t\t//System.out.println(stack);\n\t\t}\n\t\tSystem.out.println(stack.pop());\n\t}\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\t// TODO 自動生成されたメソッド・スタブ\n\t\tScanner scan = new Scanner(System.in);\n\t\tint sum = 0;\n\t\tString[] array = scan.nextLine().split(\" \");\n\t\tStack<String> stack = new Stack<>();\n\t\t\n\t\tfor(int i = 0; i < array.length; i++) {\n\t\t\ttry {\n\t\t\t\tstack.push(String.valueOf(Integer.parseInt(array[i])));\n\t\t\t\n\t\t\t\n\t\t\t}catch(NumberFormatException e){\n\t\t\t\tint x = Integer.parseInt(stack.pop());\n\t\t\t\tint y = Integer.parseInt(stack.pop());\n\t\t \n\t\t\t\tif(array[i].equals(\"+\")) {\n\t\t\t\t\tstack.push(String.valueOf(y+x));\n\t\t\t\t} else if(array[i].equals(\"-\")) {\n\t\t\t\t\tstack.push(String.valueOf(y-x));\n\t\t\t\t\t} else if(array[i].equals(\"*\")) {\n\t\t\t\t\t\tstack.push(String.valueOf(y*x));\n\t\t\t\t\t} else if(array[i].equals(\"/\")) {\n\t\t\t\t\t\tstack.push(String.valueOf(y/x));\n\t\t\t\t\t}\n\t\t } \n\t\t\t//System.out.println(stack);\n\t\t}\n\t\tSystem.out.println(stack.pop());\n\t}\n}",
"Main",
"public static void main(String[] args) {\n\t\t// TODO 自動生成されたメソッド・スタブ\n\t\tScanner scan = new Scanner(System.in);\n\t\tint sum = 0;\n\t\tString[] array = scan.nextLine().split(\" \");\n\t\tStack<String> stack = new Stack<>();\n\t\t\n\t\tfor(int i = 0; i < array.length; i++) {\n\t\t\ttry {\n\t\t\t\tstack.push(String.valueOf(Integer.parseInt(array[i])));\n\t\t\t\n\t\t\t\n\t\t\t}catch(NumberFormatException e){\n\t\t\t\tint x = Integer.parseInt(stack.pop());\n\t\t\t\tint y = Integer.parseInt(stack.pop());\n\t\t \n\t\t\t\tif(array[i].equals(\"+\")) {\n\t\t\t\t\tstack.push(String.valueOf(y+x));\n\t\t\t\t} else if(array[i].equals(\"-\")) {\n\t\t\t\t\tstack.push(String.valueOf(y-x));\n\t\t\t\t\t} else if(array[i].equals(\"*\")) {\n\t\t\t\t\t\tstack.push(String.valueOf(y*x));\n\t\t\t\t\t} else if(array[i].equals(\"/\")) {\n\t\t\t\t\t\tstack.push(String.valueOf(y/x));\n\t\t\t\t\t}\n\t\t } \n\t\t\t//System.out.println(stack);\n\t\t}\n\t\tSystem.out.println(stack.pop());\n\t}",
"main",
"{\n\t\t// TODO 自動生成されたメソッド・スタブ\n\t\tScanner scan = new Scanner(System.in);\n\t\tint sum = 0;\n\t\tString[] array = scan.nextLine().split(\" \");\n\t\tStack<String> stack = new Stack<>();\n\t\t\n\t\tfor(int i = 0; i < array.length; i++) {\n\t\t\ttry {\n\t\t\t\tstack.push(String.valueOf(Integer.parseInt(array[i])));\n\t\t\t\n\t\t\t\n\t\t\t}catch(NumberFormatException e){\n\t\t\t\tint x = Integer.parseInt(stack.pop());\n\t\t\t\tint y = Integer.parseInt(stack.pop());\n\t\t \n\t\t\t\tif(array[i].equals(\"+\")) {\n\t\t\t\t\tstack.push(String.valueOf(y+x));\n\t\t\t\t} else if(array[i].equals(\"-\")) {\n\t\t\t\t\tstack.push(String.valueOf(y-x));\n\t\t\t\t\t} else if(array[i].equals(\"*\")) {\n\t\t\t\t\t\tstack.push(String.valueOf(y*x));\n\t\t\t\t\t} else if(array[i].equals(\"/\")) {\n\t\t\t\t\t\tstack.push(String.valueOf(y/x));\n\t\t\t\t\t}\n\t\t } \n\t\t\t//System.out.println(stack);\n\t\t}\n\t\tSystem.out.println(stack.pop());\n\t}",
"Scanner scan = new Scanner(System.in);",
"scan",
"new Scanner(System.in)",
"int sum = 0;",
"sum",
"0",
"String[] array = scan.nextLine().split(\" \");",
"array",
"scan.nextLine().split(\" \")",
"scan.nextLine().split",
"scan.nextLine()",
"scan.nextLine",
"scan",
"\" \"",
"Stack<String> stack = new Stack<>();",
"stack",
"new Stack<>()",
"for(int i = 0; i < array.length; i++) {\n\t\t\ttry {\n\t\t\t\tstack.push(String.valueOf(Integer.parseInt(array[i])));\n\t\t\t\n\t\t\t\n\t\t\t}catch(NumberFormatException e){\n\t\t\t\tint x = Integer.parseInt(stack.pop());\n\t\t\t\tint y = Integer.parseInt(stack.pop());\n\t\t \n\t\t\t\tif(array[i].equals(\"+\")) {\n\t\t\t\t\tstack.push(String.valueOf(y+x));\n\t\t\t\t} else if(array[i].equals(\"-\")) {\n\t\t\t\t\tstack.push(String.valueOf(y-x));\n\t\t\t\t\t} else if(array[i].equals(\"*\")) {\n\t\t\t\t\t\tstack.push(String.valueOf(y*x));\n\t\t\t\t\t} else if(array[i].equals(\"/\")) {\n\t\t\t\t\t\tstack.push(String.valueOf(y/x));\n\t\t\t\t\t}\n\t\t } \n\t\t\t//System.out.println(stack);\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < array.length",
"i",
"array.length",
"array",
"array.length",
"i++",
"i++",
"i",
"{\n\t\t\ttry {\n\t\t\t\tstack.push(String.valueOf(Integer.parseInt(array[i])));\n\t\t\t\n\t\t\t\n\t\t\t}catch(NumberFormatException e){\n\t\t\t\tint x = Integer.parseInt(stack.pop());\n\t\t\t\tint y = Integer.parseInt(stack.pop());\n\t\t \n\t\t\t\tif(array[i].equals(\"+\")) {\n\t\t\t\t\tstack.push(String.valueOf(y+x));\n\t\t\t\t} else if(array[i].equals(\"-\")) {\n\t\t\t\t\tstack.push(String.valueOf(y-x));\n\t\t\t\t\t} else if(array[i].equals(\"*\")) {\n\t\t\t\t\t\tstack.push(String.valueOf(y*x));\n\t\t\t\t\t} else if(array[i].equals(\"/\")) {\n\t\t\t\t\t\tstack.push(String.valueOf(y/x));\n\t\t\t\t\t}\n\t\t } \n\t\t\t//System.out.println(stack);\n\t\t}",
"{\n\t\t\ttry {\n\t\t\t\tstack.push(String.valueOf(Integer.parseInt(array[i])));\n\t\t\t\n\t\t\t\n\t\t\t}catch(NumberFormatException e){\n\t\t\t\tint x = Integer.parseInt(stack.pop());\n\t\t\t\tint y = Integer.parseInt(stack.pop());\n\t\t \n\t\t\t\tif(array[i].equals(\"+\")) {\n\t\t\t\t\tstack.push(String.valueOf(y+x));\n\t\t\t\t} else if(array[i].equals(\"-\")) {\n\t\t\t\t\tstack.push(String.valueOf(y-x));\n\t\t\t\t\t} else if(array[i].equals(\"*\")) {\n\t\t\t\t\t\tstack.push(String.valueOf(y*x));\n\t\t\t\t\t} else if(array[i].equals(\"/\")) {\n\t\t\t\t\t\tstack.push(String.valueOf(y/x));\n\t\t\t\t\t}\n\t\t } \n\t\t\t//System.out.println(stack);\n\t\t}",
"try {\n\t\t\t\tstack.push(String.valueOf(Integer.parseInt(array[i])));\n\t\t\t\n\t\t\t\n\t\t\t}catch(NumberFormatException e){\n\t\t\t\tint x = Integer.parseInt(stack.pop());\n\t\t\t\tint y = Integer.parseInt(stack.pop());\n\t\t \n\t\t\t\tif(array[i].equals(\"+\")) {\n\t\t\t\t\tstack.push(String.valueOf(y+x));\n\t\t\t\t} else if(array[i].equals(\"-\")) {\n\t\t\t\t\tstack.push(String.valueOf(y-x));\n\t\t\t\t\t} else if(array[i].equals(\"*\")) {\n\t\t\t\t\t\tstack.push(String.valueOf(y*x));\n\t\t\t\t\t} else if(array[i].equals(\"/\")) {\n\t\t\t\t\t\tstack.push(String.valueOf(y/x));\n\t\t\t\t\t}\n\t\t }",
"catch(NumberFormatException e){\n\t\t\t\tint x = Integer.parseInt(stack.pop());\n\t\t\t\tint y = Integer.parseInt(stack.pop());\n\t\t \n\t\t\t\tif(array[i].equals(\"+\")) {\n\t\t\t\t\tstack.push(String.valueOf(y+x));\n\t\t\t\t} else if(array[i].equals(\"-\")) {\n\t\t\t\t\tstack.push(String.valueOf(y-x));\n\t\t\t\t\t} else if(array[i].equals(\"*\")) {\n\t\t\t\t\t\tstack.push(String.valueOf(y*x));\n\t\t\t\t\t} else if(array[i].equals(\"/\")) {\n\t\t\t\t\t\tstack.push(String.valueOf(y/x));\n\t\t\t\t\t}\n\t\t }",
"NumberFormatException e",
"{\n\t\t\t\tint x = Integer.parseInt(stack.pop());\n\t\t\t\tint y = Integer.parseInt(stack.pop());\n\t\t \n\t\t\t\tif(array[i].equals(\"+\")) {\n\t\t\t\t\tstack.push(String.valueOf(y+x));\n\t\t\t\t} else if(array[i].equals(\"-\")) {\n\t\t\t\t\tstack.push(String.valueOf(y-x));\n\t\t\t\t\t} else if(array[i].equals(\"*\")) {\n\t\t\t\t\t\tstack.push(String.valueOf(y*x));\n\t\t\t\t\t} else if(array[i].equals(\"/\")) {\n\t\t\t\t\t\tstack.push(String.valueOf(y/x));\n\t\t\t\t\t}\n\t\t }",
"int x = Integer.parseInt(stack.pop());",
"x",
"Integer.parseInt(stack.pop())",
"Integer.parseInt",
"Integer",
"stack.pop()",
"stack.pop",
"stack",
"int y = Integer.parseInt(stack.pop());",
"y",
"Integer.parseInt(stack.pop())",
"Integer.parseInt",
"Integer",
"stack.pop()",
"stack.pop",
"stack",
"if(array[i].equals(\"+\")) {\n\t\t\t\t\tstack.push(String.valueOf(y+x));\n\t\t\t\t} else if(array[i].equals(\"-\")) {\n\t\t\t\t\tstack.push(String.valueOf(y-x));\n\t\t\t\t\t} else if(array[i].equals(\"*\")) {\n\t\t\t\t\t\tstack.push(String.valueOf(y*x));\n\t\t\t\t\t} else if(array[i].equals(\"/\")) {\n\t\t\t\t\t\tstack.push(String.valueOf(y/x));\n\t\t\t\t\t}",
"array[i].equals(\"+\")",
"array[i].equals",
"array[i]",
"array",
"i",
"\"+\"",
"{\n\t\t\t\t\tstack.push(String.valueOf(y+x));\n\t\t\t\t}",
"stack.push(String.valueOf(y+x))",
"stack.push",
"stack",
"String.valueOf(y+x)",
"String.valueOf",
"String",
"y+x",
"y",
"x",
"if(array[i].equals(\"-\")) {\n\t\t\t\t\tstack.push(String.valueOf(y-x));\n\t\t\t\t\t} else if(array[i].equals(\"*\")) {\n\t\t\t\t\t\tstack.push(String.valueOf(y*x));\n\t\t\t\t\t} else if(array[i].equals(\"/\")) {\n\t\t\t\t\t\tstack.push(String.valueOf(y/x));\n\t\t\t\t\t}",
"array[i].equals(\"-\")",
"array[i].equals",
"array[i]",
"array",
"i",
"\"-\"",
"{\n\t\t\t\t\tstack.push(String.valueOf(y-x));\n\t\t\t\t\t}",
"stack.push(String.valueOf(y-x))",
"stack.push",
"stack",
"String.valueOf(y-x)",
"String.valueOf",
"String",
"y-x",
"y",
"x",
"if(array[i].equals(\"*\")) {\n\t\t\t\t\t\tstack.push(String.valueOf(y*x));\n\t\t\t\t\t} else if(array[i].equals(\"/\")) {\n\t\t\t\t\t\tstack.push(String.valueOf(y/x));\n\t\t\t\t\t}",
"array[i].equals(\"*\")",
"array[i].equals",
"array[i]",
"array",
"i",
"\"*\"",
"{\n\t\t\t\t\t\tstack.push(String.valueOf(y*x));\n\t\t\t\t\t}",
"stack.push(String.valueOf(y*x))",
"stack.push",
"stack",
"String.valueOf(y*x)",
"String.valueOf",
"String",
"y*x",
"y",
"x",
"if(array[i].equals(\"/\")) {\n\t\t\t\t\t\tstack.push(String.valueOf(y/x));\n\t\t\t\t\t}",
"array[i].equals(\"/\")",
"array[i].equals",
"array[i]",
"array",
"i",
"\"/\"",
"{\n\t\t\t\t\t\tstack.push(String.valueOf(y/x));\n\t\t\t\t\t}",
"stack.push(String.valueOf(y/x))",
"stack.push",
"stack",
"String.valueOf(y/x)",
"String.valueOf",
"String",
"y/x",
"y",
"x",
"{\n\t\t\t\tstack.push(String.valueOf(Integer.parseInt(array[i])));\n\t\t\t\n\t\t\t\n\t\t\t}",
"stack.push(String.valueOf(Integer.parseInt(array[i])))",
"stack.push",
"stack",
"String.valueOf(Integer.parseInt(array[i]))",
"String.valueOf",
"String",
"Integer.parseInt(array[i])",
"Integer.parseInt",
"Integer",
"array[i]",
"array",
"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\n\tpublic static void main(String[] args) {\n\t\t// TODO 自動生成されたメソッド・スタブ\n\t\tScanner scan = new Scanner(System.in);\n\t\tint sum = 0;\n\t\tString[] array = scan.nextLine().split(\" \");\n\t\tStack<String> stack = new Stack<>();\n\t\t\n\t\tfor(int i = 0; i < array.length; i++) {\n\t\t\ttry {\n\t\t\t\tstack.push(String.valueOf(Integer.parseInt(array[i])));\n\t\t\t\n\t\t\t\n\t\t\t}catch(NumberFormatException e){\n\t\t\t\tint x = Integer.parseInt(stack.pop());\n\t\t\t\tint y = Integer.parseInt(stack.pop());\n\t\t \n\t\t\t\tif(array[i].equals(\"+\")) {\n\t\t\t\t\tstack.push(String.valueOf(y+x));\n\t\t\t\t} else if(array[i].equals(\"-\")) {\n\t\t\t\t\tstack.push(String.valueOf(y-x));\n\t\t\t\t\t} else if(array[i].equals(\"*\")) {\n\t\t\t\t\t\tstack.push(String.valueOf(y*x));\n\t\t\t\t\t} else if(array[i].equals(\"/\")) {\n\t\t\t\t\t\tstack.push(String.valueOf(y/x));\n\t\t\t\t\t}\n\t\t } \n\t\t\t//System.out.println(stack);\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\t// TODO 自動生成されたメソッド・スタブ\n\t\tScanner scan = new Scanner(System.in);\n\t\tint sum = 0;\n\t\tString[] array = scan.nextLine().split(\" \");\n\t\tStack<String> stack = new Stack<>();\n\t\t\n\t\tfor(int i = 0; i < array.length; i++) {\n\t\t\ttry {\n\t\t\t\tstack.push(String.valueOf(Integer.parseInt(array[i])));\n\t\t\t\n\t\t\t\n\t\t\t}catch(NumberFormatException e){\n\t\t\t\tint x = Integer.parseInt(stack.pop());\n\t\t\t\tint y = Integer.parseInt(stack.pop());\n\t\t \n\t\t\t\tif(array[i].equals(\"+\")) {\n\t\t\t\t\tstack.push(String.valueOf(y+x));\n\t\t\t\t} else if(array[i].equals(\"-\")) {\n\t\t\t\t\tstack.push(String.valueOf(y-x));\n\t\t\t\t\t} else if(array[i].equals(\"*\")) {\n\t\t\t\t\t\tstack.push(String.valueOf(y*x));\n\t\t\t\t\t} else if(array[i].equals(\"/\")) {\n\t\t\t\t\t\tstack.push(String.valueOf(y/x));\n\t\t\t\t\t}\n\t\t } \n\t\t\t//System.out.println(stack);\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) {
// TODO 自動生成されたメソッド・スタブ
Scanner scan = new Scanner(System.in);
int sum = 0;
String[] array = scan.nextLine().split(" ");
Stack<String> stack = new Stack<>();
for(int i = 0; i < array.length; i++) {
try {
stack.push(String.valueOf(Integer.parseInt(array[i])));
}catch(NumberFormatException e){
int x = Integer.parseInt(stack.pop());
int y = Integer.parseInt(stack.pop());
if(array[i].equals("+")) {
stack.push(String.valueOf(y+x));
} else if(array[i].equals("-")) {
stack.push(String.valueOf(y-x));
} else if(array[i].equals("*")) {
stack.push(String.valueOf(y*x));
} else if(array[i].equals("/")) {
stack.push(String.valueOf(y/x));
}
}
//System.out.println(stack);
}
System.out.println(stack.pop());
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
20,
41,
13,
41,
13,
41,
13,
20,
42,
4,
18,
13,
30,
41,
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,
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,
18,
36,
13,
17,
0,
18,
36,
13,
20,
17,
12,
13,
30,
40,
18,
36,
13,
0,
18,
18,
36,
13,
13,
13,
23,
13,
12,
13,
30,
41,
13,
18,
18,
36,
13,
18,
36,
13,
0,
18,
18,
36,
13,
18,
36,
13,
17,
40,
18,
36,
13,
29,
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
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
8,
20
],
[
20,
21
],
[
8,
22
],
[
22,
23
],
[
8,
24
],
[
24,
25
],
[
24,
26
],
[
8,
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
],
[
8,
111
],
[
111,
112
],
[
112,
113
],
[
113,
114
],
[
113,
115
],
[
111,
116
],
[
116,
117
],
[
117,
118
],
[
6,
119
],
[
119,
120
],
[
0,
121
],
[
121,
122
],
[
121,
123
],
[
123,
124
],
[
121,
125
],
[
125,
126
],
[
121,
127
],
[
127,
128
],
[
127,
129
],
[
129,
130
],
[
130,
131
],
[
131,
132
],
[
131,
133
],
[
130,
134
],
[
129,
135
],
[
135,
136
],
[
136,
137
],
[
136,
138
],
[
135,
139
],
[
121,
141
],
[
141,
142
],
[
141,
143
],
[
143,
144
],
[
144,
145
],
[
145,
146
],
[
145,
147
],
[
143,
148
],
[
148,
149
],
[
149,
150
],
[
150,
151
],
[
150,
152
],
[
149,
153
],
[
148,
154
],
[
141,
155
],
[
155,
156
],
[
121,
157
],
[
157,
158
],
[
157,
159
],
[
159,
160
],
[
160,
161
],
[
160,
162
],
[
162,
163
],
[
163,
164
],
[
163,
165
],
[
162,
166
],
[
166,
167
],
[
166,
168
],
[
159,
169
],
[
169,
170
],
[
170,
171
],
[
171,
172
],
[
171,
173
],
[
170,
174
],
[
174,
175
],
[
174,
176
],
[
169,
177
],
[
159,
178
],
[
178,
179
],
[
179,
180
],
[
179,
181
],
[
159,
182
],
[
182,
183
],
[
0,
184
],
[
184,
185
],
[
184,
186
]
] | [
"import java.util.Scanner;\n\npublic class Main {\n public static void main(String[] args) {\n Scanner in = new Scanner(System.in);\n String line = in.nextLine();\n Scanner opt = new Scanner(line);\n int num1, num2;\n Stack num = new Stack();\n while (opt.hasNext()) {\n String c = opt.next();\n if (c.equals(\"+\")) {\n num1 = num.pop();\n num2 = num.pop();\n num.push(num1 + num2);\n } else if (c.equals(\"-\")) {\n num1 = num.pop();\n num2 = num.pop();\n num.push(num2 - num1);\n } else if (c.equals(\"*\")) {\n num1 = num.pop();\n num2 = num.pop();\n num.push(num1 * num2);\n } else {\n num.push(Integer.parseInt(c));\n }\n }\n System.out.println(num.pop());\n }\n}\n\nclass Stack {\n int top;\n int[] stack;\n\n public Stack() {\n this.top = 0;\n this.stack = new int[1000];\n }\n\n public void push(int num) {\n this.top++;\n this.stack[top] = num;\n }\n\n public int pop() {\n int num = this.stack[this.top];\n this.stack[this.top] = 0;\n this.top--;\n return num;\n }\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n public static void main(String[] args) {\n Scanner in = new Scanner(System.in);\n String line = in.nextLine();\n Scanner opt = new Scanner(line);\n int num1, num2;\n Stack num = new Stack();\n while (opt.hasNext()) {\n String c = opt.next();\n if (c.equals(\"+\")) {\n num1 = num.pop();\n num2 = num.pop();\n num.push(num1 + num2);\n } else if (c.equals(\"-\")) {\n num1 = num.pop();\n num2 = num.pop();\n num.push(num2 - num1);\n } else if (c.equals(\"*\")) {\n num1 = num.pop();\n num2 = num.pop();\n num.push(num1 * num2);\n } else {\n num.push(Integer.parseInt(c));\n }\n }\n System.out.println(num.pop());\n }\n}",
"Main",
"public static void main(String[] args) {\n Scanner in = new Scanner(System.in);\n String line = in.nextLine();\n Scanner opt = new Scanner(line);\n int num1, num2;\n Stack num = new Stack();\n while (opt.hasNext()) {\n String c = opt.next();\n if (c.equals(\"+\")) {\n num1 = num.pop();\n num2 = num.pop();\n num.push(num1 + num2);\n } else if (c.equals(\"-\")) {\n num1 = num.pop();\n num2 = num.pop();\n num.push(num2 - num1);\n } else if (c.equals(\"*\")) {\n num1 = num.pop();\n num2 = num.pop();\n num.push(num1 * num2);\n } else {\n num.push(Integer.parseInt(c));\n }\n }\n System.out.println(num.pop());\n }",
"main",
"{\n Scanner in = new Scanner(System.in);\n String line = in.nextLine();\n Scanner opt = new Scanner(line);\n int num1, num2;\n Stack num = new Stack();\n while (opt.hasNext()) {\n String c = opt.next();\n if (c.equals(\"+\")) {\n num1 = num.pop();\n num2 = num.pop();\n num.push(num1 + num2);\n } else if (c.equals(\"-\")) {\n num1 = num.pop();\n num2 = num.pop();\n num.push(num2 - num1);\n } else if (c.equals(\"*\")) {\n num1 = num.pop();\n num2 = num.pop();\n num.push(num1 * num2);\n } else {\n num.push(Integer.parseInt(c));\n }\n }\n System.out.println(num.pop());\n }",
"Scanner in = new Scanner(System.in);",
"in",
"new Scanner(System.in)",
"String line = in.nextLine();",
"line",
"in.nextLine()",
"in.nextLine",
"in",
"Scanner opt = new Scanner(line);",
"opt",
"new Scanner(line)",
"int num1",
"num1",
"num2;",
"num2",
"Stack num = new Stack();",
"num",
"new Stack()",
"while (opt.hasNext()) {\n String c = opt.next();\n if (c.equals(\"+\")) {\n num1 = num.pop();\n num2 = num.pop();\n num.push(num1 + num2);\n } else if (c.equals(\"-\")) {\n num1 = num.pop();\n num2 = num.pop();\n num.push(num2 - num1);\n } else if (c.equals(\"*\")) {\n num1 = num.pop();\n num2 = num.pop();\n num.push(num1 * num2);\n } else {\n num.push(Integer.parseInt(c));\n }\n }",
"opt.hasNext()",
"opt.hasNext",
"opt",
"{\n String c = opt.next();\n if (c.equals(\"+\")) {\n num1 = num.pop();\n num2 = num.pop();\n num.push(num1 + num2);\n } else if (c.equals(\"-\")) {\n num1 = num.pop();\n num2 = num.pop();\n num.push(num2 - num1);\n } else if (c.equals(\"*\")) {\n num1 = num.pop();\n num2 = num.pop();\n num.push(num1 * num2);\n } else {\n num.push(Integer.parseInt(c));\n }\n }",
"String c = opt.next();",
"c",
"opt.next()",
"opt.next",
"opt",
"if (c.equals(\"+\")) {\n num1 = num.pop();\n num2 = num.pop();\n num.push(num1 + num2);\n } else if (c.equals(\"-\")) {\n num1 = num.pop();\n num2 = num.pop();\n num.push(num2 - num1);\n } else if (c.equals(\"*\")) {\n num1 = num.pop();\n num2 = num.pop();\n num.push(num1 * num2);\n } else {\n num.push(Integer.parseInt(c));\n }",
"c.equals(\"+\")",
"c.equals",
"c",
"\"+\"",
"{\n num1 = num.pop();\n num2 = num.pop();\n num.push(num1 + num2);\n }",
"num1 = num.pop()",
"num1",
"num.pop()",
"num.pop",
"num",
"num2 = num.pop()",
"num2",
"num.pop()",
"num.pop",
"num",
"num.push(num1 + num2)",
"num.push",
"num",
"num1 + num2",
"num1",
"num2",
"if (c.equals(\"-\")) {\n num1 = num.pop();\n num2 = num.pop();\n num.push(num2 - num1);\n } else if (c.equals(\"*\")) {\n num1 = num.pop();\n num2 = num.pop();\n num.push(num1 * num2);\n } else {\n num.push(Integer.parseInt(c));\n }",
"c.equals(\"-\")",
"c.equals",
"c",
"\"-\"",
"{\n num1 = num.pop();\n num2 = num.pop();\n num.push(num2 - num1);\n }",
"num1 = num.pop()",
"num1",
"num.pop()",
"num.pop",
"num",
"num2 = num.pop()",
"num2",
"num.pop()",
"num.pop",
"num",
"num.push(num2 - num1)",
"num.push",
"num",
"num2 - num1",
"num2",
"num1",
"if (c.equals(\"*\")) {\n num1 = num.pop();\n num2 = num.pop();\n num.push(num1 * num2);\n } else {\n num.push(Integer.parseInt(c));\n }",
"c.equals(\"*\")",
"c.equals",
"c",
"\"*\"",
"{\n num1 = num.pop();\n num2 = num.pop();\n num.push(num1 * num2);\n }",
"num1 = num.pop()",
"num1",
"num.pop()",
"num.pop",
"num",
"num2 = num.pop()",
"num2",
"num.pop()",
"num.pop",
"num",
"num.push(num1 * num2)",
"num.push",
"num",
"num1 * num2",
"num1",
"num2",
"{\n num.push(Integer.parseInt(c));\n }",
"num.push(Integer.parseInt(c))",
"num.push",
"num",
"Integer.parseInt(c)",
"Integer.parseInt",
"Integer",
"c",
"System.out.println(num.pop())",
"System.out.println",
"System.out",
"System",
"System.out",
"num.pop()",
"num.pop",
"num",
"String[] args",
"args",
"class Stack {\n int top;\n int[] stack;\n\n public Stack() {\n this.top = 0;\n this.stack = new int[1000];\n }\n\n public void push(int num) {\n this.top++;\n this.stack[top] = num;\n }\n\n public int pop() {\n int num = this.stack[this.top];\n this.stack[this.top] = 0;\n this.top--;\n return num;\n }\n}",
"Stack",
"int top;",
"top",
"int[] stack;",
"stack",
"public Stack() {\n this.top = 0;\n this.stack = new int[1000];\n }",
"Stack",
"{\n this.top = 0;\n this.stack = new int[1000];\n }",
"this.top = 0",
"this.top",
"this",
"this.top",
"0",
"this.stack = new int[1000]",
"this.stack",
"this",
"this.stack",
"new int[1000]",
"1000",
"public void push(int num) {\n this.top++;\n this.stack[top] = num;\n }",
"push",
"{\n this.top++;\n this.stack[top] = num;\n }",
"this.top++",
"this.top",
"this",
"this.top",
"this.stack[top] = num",
"this.stack[top]",
"this.stack",
"this",
"this.stack",
"top",
"num",
"int num",
"num",
"public int pop() {\n int num = this.stack[this.top];\n this.stack[this.top] = 0;\n this.top--;\n return num;\n }",
"pop",
"{\n int num = this.stack[this.top];\n this.stack[this.top] = 0;\n this.top--;\n return num;\n }",
"int num = this.stack[this.top];",
"num",
"this.stack[this.top]",
"this.stack",
"this",
"this.stack",
"this.top",
"this",
"this.top",
"this.stack[this.top] = 0",
"this.stack[this.top]",
"this.stack",
"this",
"this.stack",
"this.top",
"this",
"this.top",
"0",
"this.top--",
"this.top",
"this",
"this.top",
"return num;",
"num",
"public class Main {\n public static void main(String[] args) {\n Scanner in = new Scanner(System.in);\n String line = in.nextLine();\n Scanner opt = new Scanner(line);\n int num1, num2;\n Stack num = new Stack();\n while (opt.hasNext()) {\n String c = opt.next();\n if (c.equals(\"+\")) {\n num1 = num.pop();\n num2 = num.pop();\n num.push(num1 + num2);\n } else if (c.equals(\"-\")) {\n num1 = num.pop();\n num2 = num.pop();\n num.push(num2 - num1);\n } else if (c.equals(\"*\")) {\n num1 = num.pop();\n num2 = num.pop();\n num.push(num1 * num2);\n } else {\n num.push(Integer.parseInt(c));\n }\n }\n System.out.println(num.pop());\n }\n}",
"public class Main {\n public static void main(String[] args) {\n Scanner in = new Scanner(System.in);\n String line = in.nextLine();\n Scanner opt = new Scanner(line);\n int num1, num2;\n Stack num = new Stack();\n while (opt.hasNext()) {\n String c = opt.next();\n if (c.equals(\"+\")) {\n num1 = num.pop();\n num2 = num.pop();\n num.push(num1 + num2);\n } else if (c.equals(\"-\")) {\n num1 = num.pop();\n num2 = num.pop();\n num.push(num2 - num1);\n } else if (c.equals(\"*\")) {\n num1 = num.pop();\n num2 = num.pop();\n num.push(num1 * num2);\n } else {\n num.push(Integer.parseInt(c));\n }\n }\n System.out.println(num.pop());\n }\n}",
"Main"
] | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
String line = in.nextLine();
Scanner opt = new Scanner(line);
int num1, num2;
Stack num = new Stack();
while (opt.hasNext()) {
String c = opt.next();
if (c.equals("+")) {
num1 = num.pop();
num2 = num.pop();
num.push(num1 + num2);
} else if (c.equals("-")) {
num1 = num.pop();
num2 = num.pop();
num.push(num2 - num1);
} else if (c.equals("*")) {
num1 = num.pop();
num2 = num.pop();
num.push(num1 * num2);
} else {
num.push(Integer.parseInt(c));
}
}
System.out.println(num.pop());
}
}
class Stack {
int top;
int[] stack;
public Stack() {
this.top = 0;
this.stack = new int[1000];
}
public void push(int num) {
this.top++;
this.stack[top] = num;
}
public int pop() {
int num = this.stack[this.top];
this.stack[this.top] = 0;
this.top--;
return num;
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
19,
18,
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,
17,
18,
13,
13,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
4,
18,
13,
2,
13,
13,
14,
4,
18,
17,
18,
13,
13,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
4,
18,
13,
2,
13,
13,
14,
4,
18,
17,
18,
13,
13,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
4,
18,
13,
2,
13,
13,
30,
4,
18,
13,
4,
18,
20,
4,
18,
18,
13,
13,
4,
18,
13,
23,
13,
6,
13,
41,
13,
41,
13,
12,
13,
30,
0,
13,
20,
17,
0,
13,
17,
12,
13,
30,
0,
18,
13,
13,
13,
40,
13,
23,
13,
12,
13,
30,
40,
13,
41,
13,
18,
13,
13,
0,
18,
13,
13,
17,
29,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
175,
5
],
[
175,
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
],
[
21,
22
],
[
22,
23
],
[
19,
24
],
[
8,
25
],
[
25,
26
],
[
26,
27
],
[
27,
28
],
[
27,
29
],
[
25,
30
],
[
30,
31
],
[
30,
32
],
[
32,
33
],
[
32,
34
],
[
25,
35
],
[
35,
36
],
[
36,
37
],
[
25,
38
],
[
39,
39
],
[
39,
40
],
[
40,
41
],
[
41,
42
],
[
42,
43
],
[
41,
44
],
[
44,
45
],
[
44,
46
],
[
40,
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
],
[
58,
61
],
[
61,
62
],
[
61,
63
],
[
40,
64
],
[
64,
65
],
[
65,
66
],
[
66,
67
],
[
65,
68
],
[
68,
69
],
[
68,
70
],
[
64,
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
],
[
64,
88
],
[
88,
89
],
[
89,
90
],
[
90,
91
],
[
89,
92
],
[
92,
93
],
[
92,
94
],
[
88,
95
],
[
95,
96
],
[
96,
97
],
[
96,
98
],
[
98,
99
],
[
99,
100
],
[
95,
101
],
[
101,
102
],
[
101,
103
],
[
103,
104
],
[
104,
105
],
[
95,
106
],
[
106,
107
],
[
107,
108
],
[
106,
109
],
[
109,
110
],
[
109,
111
],
[
88,
112
],
[
112,
113
],
[
113,
114
],
[
114,
115
],
[
113,
116
],
[
116,
117
],
[
117,
118
],
[
8,
119
],
[
119,
120
],
[
120,
121
],
[
121,
122
],
[
121,
123
],
[
119,
124
],
[
124,
125
],
[
125,
126
],
[
6,
127
],
[
127,
128
],
[
175,
129
],
[
129,
130
],
[
129,
131
],
[
131,
132
],
[
129,
133
],
[
133,
134
],
[
129,
135
],
[
135,
136
],
[
135,
137
],
[
137,
138
],
[
138,
139
],
[
138,
140
],
[
137,
142
],
[
142,
143
],
[
142,
144
],
[
129,
145
],
[
145,
146
],
[
145,
147
],
[
147,
148
],
[
148,
149
],
[
149,
150
],
[
149,
151
],
[
148,
152
],
[
147,
153
],
[
153,
154
],
[
145,
155
],
[
155,
156
],
[
129,
157
],
[
157,
158
],
[
157,
159
],
[
159,
160
],
[
160,
161
],
[
159,
162
],
[
162,
163
],
[
162,
164
],
[
164,
165
],
[
164,
166
],
[
159,
167
],
[
167,
168
],
[
168,
169
],
[
168,
170
],
[
167,
171
],
[
159,
172
],
[
172,
173
],
[
0,
174
],
[
174,
175
],
[
174,
176
]
] | [
"import java.util.Scanner;\n\n\npublic class Main{\n\n\tpublic static void main(String[] args) {\n\t\tScanner s = new Scanner(System.in);\n\t\tStackImpl e = new Main().new StackImpl();\n//\t\twhile(s.hasNext()) {\n\t\t\tString[] line = s.nextLine().split(\" \");\n\t\t\tfor(int i=0 ; i<line.length ; i++) {\n\t\t\tif(\"+\".equals(line[i])) {\n\t\t\t\tint b = e.pop();\n\t\t\t\tint a = e.pop();\n\t\t\t\te.push(a+b);\n\t\t\t} else if(\"-\".equals(line[i])) {\n\t\t\t\tint b = e.pop();\n\t\t\t\tint a = e.pop();\n\t\t\t\te.push(a-b);\n\t\t\t} else if(\"*\".equals(line[i])) {\n\t\t\t\tint b = e.pop();\n\t\t\t\tint a = e.pop();\n\t\t\t\te.push(a*b);\n\t\t\t}else {\n\t\t\t\te.push(new Integer(line[i]).intValue());\n\t\t\t}\n//\t\t\t}\n\t\t}\n\t\tSystem.out.println(e.pop());\n\t}\n\n\tpublic class StackImpl {\n\n\t\tint[] stack;\n\t\tint index;\n\n\t\tpublic StackImpl() {\n\t\t\tstack = new int[100];\n\t\t\tindex = 0;\n\t\t}\n\n\t\tpublic void push(int value) {\n\t\t\tstack[index] = value;\n\t\t\tindex++;\n\t\t}\n\n\t\tpublic int pop() {\n\t\t\tindex--;\n\t\t\tint returnV = stack[index];\n\t\t\tstack[index] = 0;\n\t\t\treturn returnV;\n\t\t}\n\t}\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main{\n\n\tpublic static void main(String[] args) {\n\t\tScanner s = new Scanner(System.in);\n\t\tStackImpl e = new Main().new StackImpl();\n//\t\twhile(s.hasNext()) {\n\t\t\tString[] line = s.nextLine().split(\" \");\n\t\t\tfor(int i=0 ; i<line.length ; i++) {\n\t\t\tif(\"+\".equals(line[i])) {\n\t\t\t\tint b = e.pop();\n\t\t\t\tint a = e.pop();\n\t\t\t\te.push(a+b);\n\t\t\t} else if(\"-\".equals(line[i])) {\n\t\t\t\tint b = e.pop();\n\t\t\t\tint a = e.pop();\n\t\t\t\te.push(a-b);\n\t\t\t} else if(\"*\".equals(line[i])) {\n\t\t\t\tint b = e.pop();\n\t\t\t\tint a = e.pop();\n\t\t\t\te.push(a*b);\n\t\t\t}else {\n\t\t\t\te.push(new Integer(line[i]).intValue());\n\t\t\t}\n//\t\t\t}\n\t\t}\n\t\tSystem.out.println(e.pop());\n\t}\n\n\tpublic class StackImpl {\n\n\t\tint[] stack;\n\t\tint index;\n\n\t\tpublic StackImpl() {\n\t\t\tstack = new int[100];\n\t\t\tindex = 0;\n\t\t}\n\n\t\tpublic void push(int value) {\n\t\t\tstack[index] = value;\n\t\t\tindex++;\n\t\t}\n\n\t\tpublic int pop() {\n\t\t\tindex--;\n\t\t\tint returnV = stack[index];\n\t\t\tstack[index] = 0;\n\t\t\treturn returnV;\n\t\t}\n\t}\n}",
"Main",
"public static void main(String[] args) {\n\t\tScanner s = new Scanner(System.in);\n\t\tStackImpl e = new Main().new StackImpl();\n//\t\twhile(s.hasNext()) {\n\t\t\tString[] line = s.nextLine().split(\" \");\n\t\t\tfor(int i=0 ; i<line.length ; i++) {\n\t\t\tif(\"+\".equals(line[i])) {\n\t\t\t\tint b = e.pop();\n\t\t\t\tint a = e.pop();\n\t\t\t\te.push(a+b);\n\t\t\t} else if(\"-\".equals(line[i])) {\n\t\t\t\tint b = e.pop();\n\t\t\t\tint a = e.pop();\n\t\t\t\te.push(a-b);\n\t\t\t} else if(\"*\".equals(line[i])) {\n\t\t\t\tint b = e.pop();\n\t\t\t\tint a = e.pop();\n\t\t\t\te.push(a*b);\n\t\t\t}else {\n\t\t\t\te.push(new Integer(line[i]).intValue());\n\t\t\t}\n//\t\t\t}\n\t\t}\n\t\tSystem.out.println(e.pop());\n\t}",
"main",
"{\n\t\tScanner s = new Scanner(System.in);\n\t\tStackImpl e = new Main().new StackImpl();\n//\t\twhile(s.hasNext()) {\n\t\t\tString[] line = s.nextLine().split(\" \");\n\t\t\tfor(int i=0 ; i<line.length ; i++) {\n\t\t\tif(\"+\".equals(line[i])) {\n\t\t\t\tint b = e.pop();\n\t\t\t\tint a = e.pop();\n\t\t\t\te.push(a+b);\n\t\t\t} else if(\"-\".equals(line[i])) {\n\t\t\t\tint b = e.pop();\n\t\t\t\tint a = e.pop();\n\t\t\t\te.push(a-b);\n\t\t\t} else if(\"*\".equals(line[i])) {\n\t\t\t\tint b = e.pop();\n\t\t\t\tint a = e.pop();\n\t\t\t\te.push(a*b);\n\t\t\t}else {\n\t\t\t\te.push(new Integer(line[i]).intValue());\n\t\t\t}\n//\t\t\t}\n\t\t}\n\t\tSystem.out.println(e.pop());\n\t}",
"Scanner s = new Scanner(System.in);",
"s",
"new Scanner(System.in)",
"StackImpl e = new Main().new StackImpl();",
"e",
"new Main().new StackImpl()",
"new Main()",
"new Main()",
"String[] line = s.nextLine().split(\" \");",
"line",
"s.nextLine().split(\" \")",
"s.nextLine().split",
"s.nextLine()",
"s.nextLine",
"s",
"\" \"",
"for(int i=0 ; i<line.length ; i++) {\n\t\t\tif(\"+\".equals(line[i])) {\n\t\t\t\tint b = e.pop();\n\t\t\t\tint a = e.pop();\n\t\t\t\te.push(a+b);\n\t\t\t} else if(\"-\".equals(line[i])) {\n\t\t\t\tint b = e.pop();\n\t\t\t\tint a = e.pop();\n\t\t\t\te.push(a-b);\n\t\t\t} else if(\"*\".equals(line[i])) {\n\t\t\t\tint b = e.pop();\n\t\t\t\tint a = e.pop();\n\t\t\t\te.push(a*b);\n\t\t\t}else {\n\t\t\t\te.push(new Integer(line[i]).intValue());\n\t\t\t}\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\tif(\"+\".equals(line[i])) {\n\t\t\t\tint b = e.pop();\n\t\t\t\tint a = e.pop();\n\t\t\t\te.push(a+b);\n\t\t\t} else if(\"-\".equals(line[i])) {\n\t\t\t\tint b = e.pop();\n\t\t\t\tint a = e.pop();\n\t\t\t\te.push(a-b);\n\t\t\t} else if(\"*\".equals(line[i])) {\n\t\t\t\tint b = e.pop();\n\t\t\t\tint a = e.pop();\n\t\t\t\te.push(a*b);\n\t\t\t}else {\n\t\t\t\te.push(new Integer(line[i]).intValue());\n\t\t\t}\n//\t\t\t}\n\t\t}",
"{\n\t\t\tif(\"+\".equals(line[i])) {\n\t\t\t\tint b = e.pop();\n\t\t\t\tint a = e.pop();\n\t\t\t\te.push(a+b);\n\t\t\t} else if(\"-\".equals(line[i])) {\n\t\t\t\tint b = e.pop();\n\t\t\t\tint a = e.pop();\n\t\t\t\te.push(a-b);\n\t\t\t} else if(\"*\".equals(line[i])) {\n\t\t\t\tint b = e.pop();\n\t\t\t\tint a = e.pop();\n\t\t\t\te.push(a*b);\n\t\t\t}else {\n\t\t\t\te.push(new Integer(line[i]).intValue());\n\t\t\t}\n//\t\t\t}\n\t\t}",
"if(\"+\".equals(line[i])) {\n\t\t\t\tint b = e.pop();\n\t\t\t\tint a = e.pop();\n\t\t\t\te.push(a+b);\n\t\t\t} else if(\"-\".equals(line[i])) {\n\t\t\t\tint b = e.pop();\n\t\t\t\tint a = e.pop();\n\t\t\t\te.push(a-b);\n\t\t\t} else if(\"*\".equals(line[i])) {\n\t\t\t\tint b = e.pop();\n\t\t\t\tint a = e.pop();\n\t\t\t\te.push(a*b);\n\t\t\t}else {\n\t\t\t\te.push(new Integer(line[i]).intValue());\n\t\t\t}",
"\"+\".equals(line[i])",
"\"+\".equals",
"\"+\"",
"line[i]",
"line",
"i",
"{\n\t\t\t\tint b = e.pop();\n\t\t\t\tint a = e.pop();\n\t\t\t\te.push(a+b);\n\t\t\t}",
"int b = e.pop();",
"b",
"e.pop()",
"e.pop",
"e",
"int a = e.pop();",
"a",
"e.pop()",
"e.pop",
"e",
"e.push(a+b)",
"e.push",
"e",
"a+b",
"a",
"b",
"if(\"-\".equals(line[i])) {\n\t\t\t\tint b = e.pop();\n\t\t\t\tint a = e.pop();\n\t\t\t\te.push(a-b);\n\t\t\t} else if(\"*\".equals(line[i])) {\n\t\t\t\tint b = e.pop();\n\t\t\t\tint a = e.pop();\n\t\t\t\te.push(a*b);\n\t\t\t}else {\n\t\t\t\te.push(new Integer(line[i]).intValue());\n\t\t\t}",
"\"-\".equals(line[i])",
"\"-\".equals",
"\"-\"",
"line[i]",
"line",
"i",
"{\n\t\t\t\tint b = e.pop();\n\t\t\t\tint a = e.pop();\n\t\t\t\te.push(a-b);\n\t\t\t}",
"int b = e.pop();",
"b",
"e.pop()",
"e.pop",
"e",
"int a = e.pop();",
"a",
"e.pop()",
"e.pop",
"e",
"e.push(a-b)",
"e.push",
"e",
"a-b",
"a",
"b",
"if(\"*\".equals(line[i])) {\n\t\t\t\tint b = e.pop();\n\t\t\t\tint a = e.pop();\n\t\t\t\te.push(a*b);\n\t\t\t}else {\n\t\t\t\te.push(new Integer(line[i]).intValue());\n\t\t\t}",
"\"*\".equals(line[i])",
"\"*\".equals",
"\"*\"",
"line[i]",
"line",
"i",
"{\n\t\t\t\tint b = e.pop();\n\t\t\t\tint a = e.pop();\n\t\t\t\te.push(a*b);\n\t\t\t}",
"int b = e.pop();",
"b",
"e.pop()",
"e.pop",
"e",
"int a = e.pop();",
"a",
"e.pop()",
"e.pop",
"e",
"e.push(a*b)",
"e.push",
"e",
"a*b",
"a",
"b",
"{\n\t\t\t\te.push(new Integer(line[i]).intValue());\n\t\t\t}",
"e.push(new Integer(line[i]).intValue())",
"e.push",
"e",
"new Integer(line[i]).intValue()",
"new Integer(line[i]).intValue",
"new Integer(line[i])",
"System.out.println(e.pop())",
"System.out.println",
"System.out",
"System",
"System.out",
"e.pop()",
"e.pop",
"e",
"String[] args",
"args",
"public class StackImpl {\n\n\t\tint[] stack;\n\t\tint index;\n\n\t\tpublic StackImpl() {\n\t\t\tstack = new int[100];\n\t\t\tindex = 0;\n\t\t}\n\n\t\tpublic void push(int value) {\n\t\t\tstack[index] = value;\n\t\t\tindex++;\n\t\t}\n\n\t\tpublic int pop() {\n\t\t\tindex--;\n\t\t\tint returnV = stack[index];\n\t\t\tstack[index] = 0;\n\t\t\treturn returnV;\n\t\t}\n\t}",
"StackImpl",
"int[] stack;",
"stack",
"int index;",
"index",
"public StackImpl() {\n\t\t\tstack = new int[100];\n\t\t\tindex = 0;\n\t\t}",
"StackImpl",
"{\n\t\t\tstack = new int[100];\n\t\t\tindex = 0;\n\t\t}",
"stack = new int[100]",
"stack",
"new int[100]",
"100",
"index = 0",
"index",
"0",
"public void push(int value) {\n\t\t\tstack[index] = value;\n\t\t\tindex++;\n\t\t}",
"push",
"{\n\t\t\tstack[index] = value;\n\t\t\tindex++;\n\t\t}",
"stack[index] = value",
"stack[index]",
"stack",
"index",
"value",
"index++",
"index",
"int value",
"value",
"public int pop() {\n\t\t\tindex--;\n\t\t\tint returnV = stack[index];\n\t\t\tstack[index] = 0;\n\t\t\treturn returnV;\n\t\t}",
"pop",
"{\n\t\t\tindex--;\n\t\t\tint returnV = stack[index];\n\t\t\tstack[index] = 0;\n\t\t\treturn returnV;\n\t\t}",
"index--",
"index",
"int returnV = stack[index];",
"returnV",
"stack[index]",
"stack",
"index",
"stack[index] = 0",
"stack[index]",
"stack",
"index",
"0",
"return returnV;",
"returnV",
"public class Main{\n\n\tpublic static void main(String[] args) {\n\t\tScanner s = new Scanner(System.in);\n\t\tStackImpl e = new Main().new StackImpl();\n//\t\twhile(s.hasNext()) {\n\t\t\tString[] line = s.nextLine().split(\" \");\n\t\t\tfor(int i=0 ; i<line.length ; i++) {\n\t\t\tif(\"+\".equals(line[i])) {\n\t\t\t\tint b = e.pop();\n\t\t\t\tint a = e.pop();\n\t\t\t\te.push(a+b);\n\t\t\t} else if(\"-\".equals(line[i])) {\n\t\t\t\tint b = e.pop();\n\t\t\t\tint a = e.pop();\n\t\t\t\te.push(a-b);\n\t\t\t} else if(\"*\".equals(line[i])) {\n\t\t\t\tint b = e.pop();\n\t\t\t\tint a = e.pop();\n\t\t\t\te.push(a*b);\n\t\t\t}else {\n\t\t\t\te.push(new Integer(line[i]).intValue());\n\t\t\t}\n//\t\t\t}\n\t\t}\n\t\tSystem.out.println(e.pop());\n\t}\n\n\tpublic class StackImpl {\n\n\t\tint[] stack;\n\t\tint index;\n\n\t\tpublic StackImpl() {\n\t\t\tstack = new int[100];\n\t\t\tindex = 0;\n\t\t}\n\n\t\tpublic void push(int value) {\n\t\t\tstack[index] = value;\n\t\t\tindex++;\n\t\t}\n\n\t\tpublic int pop() {\n\t\t\tindex--;\n\t\t\tint returnV = stack[index];\n\t\t\tstack[index] = 0;\n\t\t\treturn returnV;\n\t\t}\n\t}\n}",
"public class Main{\n\n\tpublic static void main(String[] args) {\n\t\tScanner s = new Scanner(System.in);\n\t\tStackImpl e = new Main().new StackImpl();\n//\t\twhile(s.hasNext()) {\n\t\t\tString[] line = s.nextLine().split(\" \");\n\t\t\tfor(int i=0 ; i<line.length ; i++) {\n\t\t\tif(\"+\".equals(line[i])) {\n\t\t\t\tint b = e.pop();\n\t\t\t\tint a = e.pop();\n\t\t\t\te.push(a+b);\n\t\t\t} else if(\"-\".equals(line[i])) {\n\t\t\t\tint b = e.pop();\n\t\t\t\tint a = e.pop();\n\t\t\t\te.push(a-b);\n\t\t\t} else if(\"*\".equals(line[i])) {\n\t\t\t\tint b = e.pop();\n\t\t\t\tint a = e.pop();\n\t\t\t\te.push(a*b);\n\t\t\t}else {\n\t\t\t\te.push(new Integer(line[i]).intValue());\n\t\t\t}\n//\t\t\t}\n\t\t}\n\t\tSystem.out.println(e.pop());\n\t}\n\n\tpublic class StackImpl {\n\n\t\tint[] stack;\n\t\tint index;\n\n\t\tpublic StackImpl() {\n\t\t\tstack = new int[100];\n\t\t\tindex = 0;\n\t\t}\n\n\t\tpublic void push(int value) {\n\t\t\tstack[index] = value;\n\t\t\tindex++;\n\t\t}\n\n\t\tpublic int pop() {\n\t\t\tindex--;\n\t\t\tint returnV = stack[index];\n\t\t\tstack[index] = 0;\n\t\t\treturn returnV;\n\t\t}\n\t}\n}",
"Main"
] | import java.util.Scanner;
public class Main{
public static void main(String[] args) {
Scanner s = new Scanner(System.in);
StackImpl e = new Main().new StackImpl();
// while(s.hasNext()) {
String[] line = s.nextLine().split(" ");
for(int i=0 ; i<line.length ; i++) {
if("+".equals(line[i])) {
int b = e.pop();
int a = e.pop();
e.push(a+b);
} else if("-".equals(line[i])) {
int b = e.pop();
int a = e.pop();
e.push(a-b);
} else if("*".equals(line[i])) {
int b = e.pop();
int a = e.pop();
e.push(a*b);
}else {
e.push(new Integer(line[i]).intValue());
}
// }
}
System.out.println(e.pop());
}
public class StackImpl {
int[] stack;
int index;
public StackImpl() {
stack = new int[100];
index = 0;
}
public void push(int value) {
stack[index] = value;
index++;
}
public int pop() {
index--;
int returnV = stack[index];
stack[index] = 0;
return returnV;
}
}
} |
[
7,
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
],
[
97,
5
],
[
97,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
8,
14
],
[
14,
15
],
[
14,
16
],
[
8,
17
],
[
17,
18
],
[
18,
19
],
[
19,
20
],
[
17,
21
],
[
21,
22
],
[
22,
23
],
[
22,
24
],
[
24,
25
],
[
25,
26
],
[
21,
27
],
[
27,
28
],
[
28,
29
],
[
29,
30
],
[
28,
31
],
[
27,
32
],
[
32,
33
],
[
33,
34
],
[
34,
35
],
[
33,
36
],
[
36,
37
],
[
37,
38
],
[
38,
39
],
[
36,
40
],
[
40,
41
],
[
41,
42
],
[
27,
43
],
[
43,
44
],
[
44,
45
],
[
45,
46
],
[
44,
47
],
[
43,
48
],
[
48,
49
],
[
49,
50
],
[
50,
51
],
[
49,
52
],
[
52,
53
],
[
53,
54
],
[
54,
55
],
[
55,
56
],
[
53,
57
],
[
57,
58
],
[
52,
59
],
[
59,
60
],
[
60,
61
],
[
43,
62
],
[
62,
63
],
[
63,
64
],
[
64,
65
],
[
63,
66
],
[
62,
67
],
[
67,
68
],
[
68,
69
],
[
69,
70
],
[
68,
71
],
[
71,
72
],
[
72,
73
],
[
73,
74
],
[
71,
75
],
[
75,
76
],
[
76,
77
],
[
62,
78
],
[
78,
79
],
[
79,
80
],
[
80,
81
],
[
79,
82
],
[
82,
83
],
[
83,
84
],
[
82,
85
],
[
8,
86
],
[
86,
87
],
[
87,
88
],
[
88,
89
],
[
88,
90
],
[
86,
91
],
[
91,
92
],
[
92,
93
],
[
6,
94
],
[
94,
95
],
[
0,
96
],
[
96,
97
],
[
96,
98
]
] | [
"import java.util.*;\n\npublic class Main {\n\n\tpublic static void main(String[] args) {\n\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tString symbol;\n\t\tArrayDeque<Integer> stack = new ArrayDeque<Integer>();\n\n\t\twhile (sc.hasNext()) {\n\t\t\tsymbol = sc.next();\n\t\t\t\n\t\t\tif(symbol.equals(\"+\")){\n\t\t\t\tstack.push(stack.pop() + stack.pop());\n\t\t\t} else if (symbol.equals(\"-\")){\n\t\t\t\tstack.push((stack.pop() * -1) + stack.pop());\n\t\t\t} else if (symbol.equals(\"*\")){\n\t\t\t\tstack.push(stack.pop() * stack.pop());\n\t\t\t} else {\n\t\t\t\tstack.push(Integer.parseInt(symbol));\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(stack.pop());\n\t}\n}",
"import java.util.*;",
"util.*",
"java",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tString symbol;\n\t\tArrayDeque<Integer> stack = new ArrayDeque<Integer>();\n\n\t\twhile (sc.hasNext()) {\n\t\t\tsymbol = sc.next();\n\t\t\t\n\t\t\tif(symbol.equals(\"+\")){\n\t\t\t\tstack.push(stack.pop() + stack.pop());\n\t\t\t} else if (symbol.equals(\"-\")){\n\t\t\t\tstack.push((stack.pop() * -1) + stack.pop());\n\t\t\t} else if (symbol.equals(\"*\")){\n\t\t\t\tstack.push(stack.pop() * stack.pop());\n\t\t\t} else {\n\t\t\t\tstack.push(Integer.parseInt(symbol));\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\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tString symbol;\n\t\tArrayDeque<Integer> stack = new ArrayDeque<Integer>();\n\n\t\twhile (sc.hasNext()) {\n\t\t\tsymbol = sc.next();\n\t\t\t\n\t\t\tif(symbol.equals(\"+\")){\n\t\t\t\tstack.push(stack.pop() + stack.pop());\n\t\t\t} else if (symbol.equals(\"-\")){\n\t\t\t\tstack.push((stack.pop() * -1) + stack.pop());\n\t\t\t} else if (symbol.equals(\"*\")){\n\t\t\t\tstack.push(stack.pop() * stack.pop());\n\t\t\t} else {\n\t\t\t\tstack.push(Integer.parseInt(symbol));\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(stack.pop());\n\t}",
"main",
"{\n\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tString symbol;\n\t\tArrayDeque<Integer> stack = new ArrayDeque<Integer>();\n\n\t\twhile (sc.hasNext()) {\n\t\t\tsymbol = sc.next();\n\t\t\t\n\t\t\tif(symbol.equals(\"+\")){\n\t\t\t\tstack.push(stack.pop() + stack.pop());\n\t\t\t} else if (symbol.equals(\"-\")){\n\t\t\t\tstack.push((stack.pop() * -1) + stack.pop());\n\t\t\t} else if (symbol.equals(\"*\")){\n\t\t\t\tstack.push(stack.pop() * stack.pop());\n\t\t\t} else {\n\t\t\t\tstack.push(Integer.parseInt(symbol));\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(stack.pop());\n\t}",
"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\t\t\tsymbol = sc.next();\n\t\t\t\n\t\t\tif(symbol.equals(\"+\")){\n\t\t\t\tstack.push(stack.pop() + stack.pop());\n\t\t\t} else if (symbol.equals(\"-\")){\n\t\t\t\tstack.push((stack.pop() * -1) + stack.pop());\n\t\t\t} else if (symbol.equals(\"*\")){\n\t\t\t\tstack.push(stack.pop() * stack.pop());\n\t\t\t} else {\n\t\t\t\tstack.push(Integer.parseInt(symbol));\n\t\t\t}\n\t\t}",
"sc.hasNext()",
"sc.hasNext",
"sc",
"{\n\t\t\tsymbol = sc.next();\n\t\t\t\n\t\t\tif(symbol.equals(\"+\")){\n\t\t\t\tstack.push(stack.pop() + stack.pop());\n\t\t\t} else if (symbol.equals(\"-\")){\n\t\t\t\tstack.push((stack.pop() * -1) + stack.pop());\n\t\t\t} else if (symbol.equals(\"*\")){\n\t\t\t\tstack.push(stack.pop() * stack.pop());\n\t\t\t} else {\n\t\t\t\tstack.push(Integer.parseInt(symbol));\n\t\t\t}\n\t\t}",
"symbol = sc.next()",
"symbol",
"sc.next()",
"sc.next",
"sc",
"if(symbol.equals(\"+\")){\n\t\t\t\tstack.push(stack.pop() + stack.pop());\n\t\t\t} else if (symbol.equals(\"-\")){\n\t\t\t\tstack.push((stack.pop() * -1) + stack.pop());\n\t\t\t} else if (symbol.equals(\"*\")){\n\t\t\t\tstack.push(stack.pop() * stack.pop());\n\t\t\t} else {\n\t\t\t\tstack.push(Integer.parseInt(symbol));\n\t\t\t}",
"symbol.equals(\"+\")",
"symbol.equals",
"symbol",
"\"+\"",
"{\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 (symbol.equals(\"-\")){\n\t\t\t\tstack.push((stack.pop() * -1) + stack.pop());\n\t\t\t} else if (symbol.equals(\"*\")){\n\t\t\t\tstack.push(stack.pop() * stack.pop());\n\t\t\t} else {\n\t\t\t\tstack.push(Integer.parseInt(symbol));\n\t\t\t}",
"symbol.equals(\"-\")",
"symbol.equals",
"symbol",
"\"-\"",
"{\n\t\t\t\tstack.push((stack.pop() * -1) + stack.pop());\n\t\t\t}",
"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\t\t\t\tstack.push(stack.pop() * stack.pop());\n\t\t\t} else {\n\t\t\t\tstack.push(Integer.parseInt(symbol));\n\t\t\t}",
"symbol.equals(\"*\")",
"symbol.equals",
"symbol",
"\"*\"",
"{\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(symbol));\n\t\t\t}",
"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\tpublic static void main(String[] args) {\n\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tString symbol;\n\t\tArrayDeque<Integer> stack = new ArrayDeque<Integer>();\n\n\t\twhile (sc.hasNext()) {\n\t\t\tsymbol = sc.next();\n\t\t\t\n\t\t\tif(symbol.equals(\"+\")){\n\t\t\t\tstack.push(stack.pop() + stack.pop());\n\t\t\t} else if (symbol.equals(\"-\")){\n\t\t\t\tstack.push((stack.pop() * -1) + stack.pop());\n\t\t\t} else if (symbol.equals(\"*\")){\n\t\t\t\tstack.push(stack.pop() * stack.pop());\n\t\t\t} else {\n\t\t\t\tstack.push(Integer.parseInt(symbol));\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\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tString symbol;\n\t\tArrayDeque<Integer> stack = new ArrayDeque<Integer>();\n\n\t\twhile (sc.hasNext()) {\n\t\t\tsymbol = sc.next();\n\t\t\t\n\t\t\tif(symbol.equals(\"+\")){\n\t\t\t\tstack.push(stack.pop() + stack.pop());\n\t\t\t} else if (symbol.equals(\"-\")){\n\t\t\t\tstack.push((stack.pop() * -1) + stack.pop());\n\t\t\t} else if (symbol.equals(\"*\")){\n\t\t\t\tstack.push(stack.pop() * stack.pop());\n\t\t\t} else {\n\t\t\t\tstack.push(Integer.parseInt(symbol));\n\t\t\t}\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) {
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,
6,
13,
12,
13,
30,
41,
13,
20,
38,
30,
4,
18,
13,
30,
42,
4,
18,
13,
30,
41,
13,
4,
18,
13,
41,
13,
20,
41,
13,
4,
18,
13,
17,
14,
2,
18,
13,
13,
17,
30,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
30,
14,
4,
18,
4,
18,
18,
13,
13,
17,
30,
4,
18,
13,
2,
4,
18,
13,
4,
18,
13,
14,
4,
18,
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,
4,
18,
18,
13,
13,
17,
30,
4,
18,
13,
2,
4,
18,
13,
4,
18,
13,
14,
4,
18,
4,
18,
18,
13,
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,
4,
18,
18,
13,
13,
4,
18,
18,
13,
13,
17,
4,
18,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
178,
8
],
[
178,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
12,
14
],
[
11,
15
],
[
15,
16
],
[
16,
17
],
[
17,
18
],
[
18,
19
],
[
15,
20
],
[
20,
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
],
[
25,
34
],
[
34,
35
],
[
34,
36
],
[
36,
37
],
[
37,
38
],
[
36,
39
],
[
25,
40
],
[
40,
41
],
[
41,
42
],
[
42,
43
],
[
42,
44
],
[
41,
45
],
[
40,
46
],
[
46,
47
],
[
47,
48
],
[
48,
49
],
[
49,
50
],
[
49,
51
],
[
47,
52
],
[
52,
53
],
[
52,
54
],
[
54,
55
],
[
54,
56
],
[
47,
57
],
[
57,
58
],
[
58,
59
],
[
47,
60
],
[
61,
61
],
[
61,
62
],
[
62,
63
],
[
63,
64
],
[
64,
65
],
[
65,
66
],
[
66,
67
],
[
67,
68
],
[
67,
69
],
[
63,
70
],
[
62,
71
],
[
71,
72
],
[
72,
73
],
[
73,
74
],
[
72,
75
],
[
75,
76
],
[
76,
77
],
[
77,
78
],
[
75,
79
],
[
79,
80
],
[
80,
81
],
[
62,
82
],
[
82,
83
],
[
83,
84
],
[
84,
85
],
[
85,
86
],
[
86,
87
],
[
87,
88
],
[
87,
89
],
[
83,
90
],
[
82,
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
],
[
82,
108
],
[
108,
109
],
[
109,
110
],
[
110,
111
],
[
111,
112
],
[
112,
113
],
[
113,
114
],
[
113,
115
],
[
109,
116
],
[
108,
117
],
[
117,
118
],
[
118,
119
],
[
119,
120
],
[
118,
121
],
[
121,
122
],
[
122,
123
],
[
123,
124
],
[
121,
125
],
[
125,
126
],
[
126,
127
],
[
108,
128
],
[
128,
129
],
[
129,
130
],
[
130,
131
],
[
131,
132
],
[
132,
133
],
[
133,
134
],
[
133,
135
],
[
129,
136
],
[
128,
137
],
[
137,
138
],
[
138,
139
],
[
138,
140
],
[
140,
141
],
[
141,
142
],
[
137,
143
],
[
143,
144
],
[
143,
145
],
[
145,
146
],
[
146,
147
],
[
137,
148
],
[
148,
149
],
[
149,
150
],
[
148,
151
],
[
151,
152
],
[
151,
153
],
[
128,
154
],
[
154,
155
],
[
155,
156
],
[
156,
157
],
[
155,
158
],
[
158,
159
],
[
159,
160
],
[
158,
161
],
[
161,
162
],
[
162,
163
],
[
163,
164
],
[
163,
165
],
[
46,
166
],
[
166,
167
],
[
167,
168
],
[
168,
169
],
[
168,
170
],
[
166,
171
],
[
166,
172
],
[
172,
173
],
[
173,
174
],
[
9,
175
],
[
175,
176
],
[
0,
177
],
[
177,
178
],
[
177,
179
]
] | [
"import java.util.*;\nimport java.util.ArrayDeque;\n\npublic class Main {\n public static void main(String[] args) {\n\n Scanner sc = new Scanner(System.in);\n\n\n try{\n\n while (sc.hasNext()) {\n\n String str = sc.nextLine();\n Deque<Integer> deq = new ArrayDeque<Integer>();\n\n String[] s_array = str.split(\" \");\n\n if (s_array.length > 2) {\n\n for (int i = 0; i < s_array.length; i++) {\n\n if (s_array[i].toString().equals(\"*\")) {\n\n deq.addFirst((deq.removeFirst() * deq.removeFirst()));\n\n } else if (s_array[i].toString().equals(\"/\")) {\n\n int x = deq.removeFirst(), y = deq.removeFirst();\n deq.addFirst(y/x);\n\n } else if (s_array[i].toString().equals(\"+\")) {\n\n deq.addFirst((deq.removeFirst() + deq.removeFirst()));\n\n } else if (s_array[i].toString().equals(\"-\")) {\n\n int x = deq.removeFirst(), y = deq.removeFirst();\n deq.addFirst(y-x);\n\n } else {\n\n deq.addFirst(Integer.valueOf(s_array[i].toString()));\n\n }\n }\n\n System.out.printf(\"%d\\r\\n\", deq.removeFirst());\n\n }\n\n }\n\n } finally {\n\n sc.close();\n\n }\n\n }\n}",
"import java.util.*;",
"util.*",
"java",
"import java.util.ArrayDeque;",
"ArrayDeque",
"java.util",
"public class Main {\n public static void main(String[] args) {\n\n Scanner sc = new Scanner(System.in);\n\n\n try{\n\n while (sc.hasNext()) {\n\n String str = sc.nextLine();\n Deque<Integer> deq = new ArrayDeque<Integer>();\n\n String[] s_array = str.split(\" \");\n\n if (s_array.length > 2) {\n\n for (int i = 0; i < s_array.length; i++) {\n\n if (s_array[i].toString().equals(\"*\")) {\n\n deq.addFirst((deq.removeFirst() * deq.removeFirst()));\n\n } else if (s_array[i].toString().equals(\"/\")) {\n\n int x = deq.removeFirst(), y = deq.removeFirst();\n deq.addFirst(y/x);\n\n } else if (s_array[i].toString().equals(\"+\")) {\n\n deq.addFirst((deq.removeFirst() + deq.removeFirst()));\n\n } else if (s_array[i].toString().equals(\"-\")) {\n\n int x = deq.removeFirst(), y = deq.removeFirst();\n deq.addFirst(y-x);\n\n } else {\n\n deq.addFirst(Integer.valueOf(s_array[i].toString()));\n\n }\n }\n\n System.out.printf(\"%d\\r\\n\", deq.removeFirst());\n\n }\n\n }\n\n } finally {\n\n sc.close();\n\n }\n\n }\n}",
"Main",
"public static void main(String[] args) {\n\n Scanner sc = new Scanner(System.in);\n\n\n try{\n\n while (sc.hasNext()) {\n\n String str = sc.nextLine();\n Deque<Integer> deq = new ArrayDeque<Integer>();\n\n String[] s_array = str.split(\" \");\n\n if (s_array.length > 2) {\n\n for (int i = 0; i < s_array.length; i++) {\n\n if (s_array[i].toString().equals(\"*\")) {\n\n deq.addFirst((deq.removeFirst() * deq.removeFirst()));\n\n } else if (s_array[i].toString().equals(\"/\")) {\n\n int x = deq.removeFirst(), y = deq.removeFirst();\n deq.addFirst(y/x);\n\n } else if (s_array[i].toString().equals(\"+\")) {\n\n deq.addFirst((deq.removeFirst() + deq.removeFirst()));\n\n } else if (s_array[i].toString().equals(\"-\")) {\n\n int x = deq.removeFirst(), y = deq.removeFirst();\n deq.addFirst(y-x);\n\n } else {\n\n deq.addFirst(Integer.valueOf(s_array[i].toString()));\n\n }\n }\n\n System.out.printf(\"%d\\r\\n\", deq.removeFirst());\n\n }\n\n }\n\n } finally {\n\n sc.close();\n\n }\n\n }",
"main",
"{\n\n Scanner sc = new Scanner(System.in);\n\n\n try{\n\n while (sc.hasNext()) {\n\n String str = sc.nextLine();\n Deque<Integer> deq = new ArrayDeque<Integer>();\n\n String[] s_array = str.split(\" \");\n\n if (s_array.length > 2) {\n\n for (int i = 0; i < s_array.length; i++) {\n\n if (s_array[i].toString().equals(\"*\")) {\n\n deq.addFirst((deq.removeFirst() * deq.removeFirst()));\n\n } else if (s_array[i].toString().equals(\"/\")) {\n\n int x = deq.removeFirst(), y = deq.removeFirst();\n deq.addFirst(y/x);\n\n } else if (s_array[i].toString().equals(\"+\")) {\n\n deq.addFirst((deq.removeFirst() + deq.removeFirst()));\n\n } else if (s_array[i].toString().equals(\"-\")) {\n\n int x = deq.removeFirst(), y = deq.removeFirst();\n deq.addFirst(y-x);\n\n } else {\n\n deq.addFirst(Integer.valueOf(s_array[i].toString()));\n\n }\n }\n\n System.out.printf(\"%d\\r\\n\", deq.removeFirst());\n\n }\n\n }\n\n } finally {\n\n sc.close();\n\n }\n\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"try{\n\n while (sc.hasNext()) {\n\n String str = sc.nextLine();\n Deque<Integer> deq = new ArrayDeque<Integer>();\n\n String[] s_array = str.split(\" \");\n\n if (s_array.length > 2) {\n\n for (int i = 0; i < s_array.length; i++) {\n\n if (s_array[i].toString().equals(\"*\")) {\n\n deq.addFirst((deq.removeFirst() * deq.removeFirst()));\n\n } else if (s_array[i].toString().equals(\"/\")) {\n\n int x = deq.removeFirst(), y = deq.removeFirst();\n deq.addFirst(y/x);\n\n } else if (s_array[i].toString().equals(\"+\")) {\n\n deq.addFirst((deq.removeFirst() + deq.removeFirst()));\n\n } else if (s_array[i].toString().equals(\"-\")) {\n\n int x = deq.removeFirst(), y = deq.removeFirst();\n deq.addFirst(y-x);\n\n } else {\n\n deq.addFirst(Integer.valueOf(s_array[i].toString()));\n\n }\n }\n\n System.out.printf(\"%d\\r\\n\", deq.removeFirst());\n\n }\n\n }\n\n } finally {\n\n sc.close();\n\n }",
"{\n\n sc.close();\n\n }",
"sc.close()",
"sc.close",
"sc",
"{\n\n while (sc.hasNext()) {\n\n String str = sc.nextLine();\n Deque<Integer> deq = new ArrayDeque<Integer>();\n\n String[] s_array = str.split(\" \");\n\n if (s_array.length > 2) {\n\n for (int i = 0; i < s_array.length; i++) {\n\n if (s_array[i].toString().equals(\"*\")) {\n\n deq.addFirst((deq.removeFirst() * deq.removeFirst()));\n\n } else if (s_array[i].toString().equals(\"/\")) {\n\n int x = deq.removeFirst(), y = deq.removeFirst();\n deq.addFirst(y/x);\n\n } else if (s_array[i].toString().equals(\"+\")) {\n\n deq.addFirst((deq.removeFirst() + deq.removeFirst()));\n\n } else if (s_array[i].toString().equals(\"-\")) {\n\n int x = deq.removeFirst(), y = deq.removeFirst();\n deq.addFirst(y-x);\n\n } else {\n\n deq.addFirst(Integer.valueOf(s_array[i].toString()));\n\n }\n }\n\n System.out.printf(\"%d\\r\\n\", deq.removeFirst());\n\n }\n\n }\n\n }",
"while (sc.hasNext()) {\n\n String str = sc.nextLine();\n Deque<Integer> deq = new ArrayDeque<Integer>();\n\n String[] s_array = str.split(\" \");\n\n if (s_array.length > 2) {\n\n for (int i = 0; i < s_array.length; i++) {\n\n if (s_array[i].toString().equals(\"*\")) {\n\n deq.addFirst((deq.removeFirst() * deq.removeFirst()));\n\n } else if (s_array[i].toString().equals(\"/\")) {\n\n int x = deq.removeFirst(), y = deq.removeFirst();\n deq.addFirst(y/x);\n\n } else if (s_array[i].toString().equals(\"+\")) {\n\n deq.addFirst((deq.removeFirst() + deq.removeFirst()));\n\n } else if (s_array[i].toString().equals(\"-\")) {\n\n int x = deq.removeFirst(), y = deq.removeFirst();\n deq.addFirst(y-x);\n\n } else {\n\n deq.addFirst(Integer.valueOf(s_array[i].toString()));\n\n }\n }\n\n System.out.printf(\"%d\\r\\n\", deq.removeFirst());\n\n }\n\n }",
"sc.hasNext()",
"sc.hasNext",
"sc",
"{\n\n String str = sc.nextLine();\n Deque<Integer> deq = new ArrayDeque<Integer>();\n\n String[] s_array = str.split(\" \");\n\n if (s_array.length > 2) {\n\n for (int i = 0; i < s_array.length; i++) {\n\n if (s_array[i].toString().equals(\"*\")) {\n\n deq.addFirst((deq.removeFirst() * deq.removeFirst()));\n\n } else if (s_array[i].toString().equals(\"/\")) {\n\n int x = deq.removeFirst(), y = deq.removeFirst();\n deq.addFirst(y/x);\n\n } else if (s_array[i].toString().equals(\"+\")) {\n\n deq.addFirst((deq.removeFirst() + deq.removeFirst()));\n\n } else if (s_array[i].toString().equals(\"-\")) {\n\n int x = deq.removeFirst(), y = deq.removeFirst();\n deq.addFirst(y-x);\n\n } else {\n\n deq.addFirst(Integer.valueOf(s_array[i].toString()));\n\n }\n }\n\n System.out.printf(\"%d\\r\\n\", deq.removeFirst());\n\n }\n\n }",
"String str = sc.nextLine();",
"str",
"sc.nextLine()",
"sc.nextLine",
"sc",
"Deque<Integer> deq = new ArrayDeque<Integer>();",
"deq",
"new ArrayDeque<Integer>()",
"String[] s_array = str.split(\" \");",
"s_array",
"str.split(\" \")",
"str.split",
"str",
"\" \"",
"if (s_array.length > 2) {\n\n for (int i = 0; i < s_array.length; i++) {\n\n if (s_array[i].toString().equals(\"*\")) {\n\n deq.addFirst((deq.removeFirst() * deq.removeFirst()));\n\n } else if (s_array[i].toString().equals(\"/\")) {\n\n int x = deq.removeFirst(), y = deq.removeFirst();\n deq.addFirst(y/x);\n\n } else if (s_array[i].toString().equals(\"+\")) {\n\n deq.addFirst((deq.removeFirst() + deq.removeFirst()));\n\n } else if (s_array[i].toString().equals(\"-\")) {\n\n int x = deq.removeFirst(), y = deq.removeFirst();\n deq.addFirst(y-x);\n\n } else {\n\n deq.addFirst(Integer.valueOf(s_array[i].toString()));\n\n }\n }\n\n System.out.printf(\"%d\\r\\n\", deq.removeFirst());\n\n }",
"s_array.length > 2",
"s_array.length",
"s_array",
"s_array.length",
"2",
"{\n\n for (int i = 0; i < s_array.length; i++) {\n\n if (s_array[i].toString().equals(\"*\")) {\n\n deq.addFirst((deq.removeFirst() * deq.removeFirst()));\n\n } else if (s_array[i].toString().equals(\"/\")) {\n\n int x = deq.removeFirst(), y = deq.removeFirst();\n deq.addFirst(y/x);\n\n } else if (s_array[i].toString().equals(\"+\")) {\n\n deq.addFirst((deq.removeFirst() + deq.removeFirst()));\n\n } else if (s_array[i].toString().equals(\"-\")) {\n\n int x = deq.removeFirst(), y = deq.removeFirst();\n deq.addFirst(y-x);\n\n } else {\n\n deq.addFirst(Integer.valueOf(s_array[i].toString()));\n\n }\n }\n\n System.out.printf(\"%d\\r\\n\", deq.removeFirst());\n\n }",
"for (int i = 0; i < s_array.length; i++) {\n\n if (s_array[i].toString().equals(\"*\")) {\n\n deq.addFirst((deq.removeFirst() * deq.removeFirst()));\n\n } else if (s_array[i].toString().equals(\"/\")) {\n\n int x = deq.removeFirst(), y = deq.removeFirst();\n deq.addFirst(y/x);\n\n } else if (s_array[i].toString().equals(\"+\")) {\n\n deq.addFirst((deq.removeFirst() + deq.removeFirst()));\n\n } else if (s_array[i].toString().equals(\"-\")) {\n\n int x = deq.removeFirst(), y = deq.removeFirst();\n deq.addFirst(y-x);\n\n } else {\n\n deq.addFirst(Integer.valueOf(s_array[i].toString()));\n\n }\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < s_array.length",
"i",
"s_array.length",
"s_array",
"s_array.length",
"i++",
"i++",
"i",
"{\n\n if (s_array[i].toString().equals(\"*\")) {\n\n deq.addFirst((deq.removeFirst() * deq.removeFirst()));\n\n } else if (s_array[i].toString().equals(\"/\")) {\n\n int x = deq.removeFirst(), y = deq.removeFirst();\n deq.addFirst(y/x);\n\n } else if (s_array[i].toString().equals(\"+\")) {\n\n deq.addFirst((deq.removeFirst() + deq.removeFirst()));\n\n } else if (s_array[i].toString().equals(\"-\")) {\n\n int x = deq.removeFirst(), y = deq.removeFirst();\n deq.addFirst(y-x);\n\n } else {\n\n deq.addFirst(Integer.valueOf(s_array[i].toString()));\n\n }\n }",
"{\n\n if (s_array[i].toString().equals(\"*\")) {\n\n deq.addFirst((deq.removeFirst() * deq.removeFirst()));\n\n } else if (s_array[i].toString().equals(\"/\")) {\n\n int x = deq.removeFirst(), y = deq.removeFirst();\n deq.addFirst(y/x);\n\n } else if (s_array[i].toString().equals(\"+\")) {\n\n deq.addFirst((deq.removeFirst() + deq.removeFirst()));\n\n } else if (s_array[i].toString().equals(\"-\")) {\n\n int x = deq.removeFirst(), y = deq.removeFirst();\n deq.addFirst(y-x);\n\n } else {\n\n deq.addFirst(Integer.valueOf(s_array[i].toString()));\n\n }\n }",
"if (s_array[i].toString().equals(\"*\")) {\n\n deq.addFirst((deq.removeFirst() * deq.removeFirst()));\n\n } else if (s_array[i].toString().equals(\"/\")) {\n\n int x = deq.removeFirst(), y = deq.removeFirst();\n deq.addFirst(y/x);\n\n } else if (s_array[i].toString().equals(\"+\")) {\n\n deq.addFirst((deq.removeFirst() + deq.removeFirst()));\n\n } else if (s_array[i].toString().equals(\"-\")) {\n\n int x = deq.removeFirst(), y = deq.removeFirst();\n deq.addFirst(y-x);\n\n } else {\n\n deq.addFirst(Integer.valueOf(s_array[i].toString()));\n\n }",
"s_array[i].toString().equals(\"*\")",
"s_array[i].toString().equals",
"s_array[i].toString()",
"s_array[i].toString",
"s_array[i]",
"s_array",
"i",
"\"*\"",
"{\n\n deq.addFirst((deq.removeFirst() * deq.removeFirst()));\n\n }",
"deq.addFirst((deq.removeFirst() * deq.removeFirst()))",
"deq.addFirst",
"deq",
"(deq.removeFirst() * deq.removeFirst())",
"deq.removeFirst()",
"deq.removeFirst",
"deq",
"deq.removeFirst()",
"deq.removeFirst",
"deq",
"if (s_array[i].toString().equals(\"/\")) {\n\n int x = deq.removeFirst(), y = deq.removeFirst();\n deq.addFirst(y/x);\n\n } else if (s_array[i].toString().equals(\"+\")) {\n\n deq.addFirst((deq.removeFirst() + deq.removeFirst()));\n\n } else if (s_array[i].toString().equals(\"-\")) {\n\n int x = deq.removeFirst(), y = deq.removeFirst();\n deq.addFirst(y-x);\n\n } else {\n\n deq.addFirst(Integer.valueOf(s_array[i].toString()));\n\n }",
"s_array[i].toString().equals(\"/\")",
"s_array[i].toString().equals",
"s_array[i].toString()",
"s_array[i].toString",
"s_array[i]",
"s_array",
"i",
"\"/\"",
"{\n\n int x = deq.removeFirst(), y = deq.removeFirst();\n deq.addFirst(y/x);\n\n }",
"int x = deq.removeFirst()",
"x",
"deq.removeFirst()",
"deq.removeFirst",
"deq",
"y = deq.removeFirst();",
"y",
"deq.removeFirst()",
"deq.removeFirst",
"deq",
"deq.addFirst(y/x)",
"deq.addFirst",
"deq",
"y/x",
"y",
"x",
"if (s_array[i].toString().equals(\"+\")) {\n\n deq.addFirst((deq.removeFirst() + deq.removeFirst()));\n\n } else if (s_array[i].toString().equals(\"-\")) {\n\n int x = deq.removeFirst(), y = deq.removeFirst();\n deq.addFirst(y-x);\n\n } else {\n\n deq.addFirst(Integer.valueOf(s_array[i].toString()));\n\n }",
"s_array[i].toString().equals(\"+\")",
"s_array[i].toString().equals",
"s_array[i].toString()",
"s_array[i].toString",
"s_array[i]",
"s_array",
"i",
"\"+\"",
"{\n\n deq.addFirst((deq.removeFirst() + deq.removeFirst()));\n\n }",
"deq.addFirst((deq.removeFirst() + deq.removeFirst()))",
"deq.addFirst",
"deq",
"(deq.removeFirst() + deq.removeFirst())",
"deq.removeFirst()",
"deq.removeFirst",
"deq",
"deq.removeFirst()",
"deq.removeFirst",
"deq",
"if (s_array[i].toString().equals(\"-\")) {\n\n int x = deq.removeFirst(), y = deq.removeFirst();\n deq.addFirst(y-x);\n\n } else {\n\n deq.addFirst(Integer.valueOf(s_array[i].toString()));\n\n }",
"s_array[i].toString().equals(\"-\")",
"s_array[i].toString().equals",
"s_array[i].toString()",
"s_array[i].toString",
"s_array[i]",
"s_array",
"i",
"\"-\"",
"{\n\n int x = deq.removeFirst(), y = deq.removeFirst();\n deq.addFirst(y-x);\n\n }",
"int x = deq.removeFirst()",
"x",
"deq.removeFirst()",
"deq.removeFirst",
"deq",
"y = deq.removeFirst();",
"y",
"deq.removeFirst()",
"deq.removeFirst",
"deq",
"deq.addFirst(y-x)",
"deq.addFirst",
"deq",
"y-x",
"y",
"x",
"{\n\n deq.addFirst(Integer.valueOf(s_array[i].toString()));\n\n }",
"deq.addFirst(Integer.valueOf(s_array[i].toString()))",
"deq.addFirst",
"deq",
"Integer.valueOf(s_array[i].toString())",
"Integer.valueOf",
"Integer",
"s_array[i].toString()",
"s_array[i].toString",
"s_array[i]",
"s_array",
"i",
"System.out.printf(\"%d\\r\\n\", deq.removeFirst())",
"System.out.printf",
"System.out",
"System",
"System.out",
"\"%d\\r\\n\"",
"deq.removeFirst()",
"deq.removeFirst",
"deq",
"String[] args",
"args",
"public class Main {\n public static void main(String[] args) {\n\n Scanner sc = new Scanner(System.in);\n\n\n try{\n\n while (sc.hasNext()) {\n\n String str = sc.nextLine();\n Deque<Integer> deq = new ArrayDeque<Integer>();\n\n String[] s_array = str.split(\" \");\n\n if (s_array.length > 2) {\n\n for (int i = 0; i < s_array.length; i++) {\n\n if (s_array[i].toString().equals(\"*\")) {\n\n deq.addFirst((deq.removeFirst() * deq.removeFirst()));\n\n } else if (s_array[i].toString().equals(\"/\")) {\n\n int x = deq.removeFirst(), y = deq.removeFirst();\n deq.addFirst(y/x);\n\n } else if (s_array[i].toString().equals(\"+\")) {\n\n deq.addFirst((deq.removeFirst() + deq.removeFirst()));\n\n } else if (s_array[i].toString().equals(\"-\")) {\n\n int x = deq.removeFirst(), y = deq.removeFirst();\n deq.addFirst(y-x);\n\n } else {\n\n deq.addFirst(Integer.valueOf(s_array[i].toString()));\n\n }\n }\n\n System.out.printf(\"%d\\r\\n\", deq.removeFirst());\n\n }\n\n }\n\n } finally {\n\n sc.close();\n\n }\n\n }\n}",
"public class Main {\n public static void main(String[] args) {\n\n Scanner sc = new Scanner(System.in);\n\n\n try{\n\n while (sc.hasNext()) {\n\n String str = sc.nextLine();\n Deque<Integer> deq = new ArrayDeque<Integer>();\n\n String[] s_array = str.split(\" \");\n\n if (s_array.length > 2) {\n\n for (int i = 0; i < s_array.length; i++) {\n\n if (s_array[i].toString().equals(\"*\")) {\n\n deq.addFirst((deq.removeFirst() * deq.removeFirst()));\n\n } else if (s_array[i].toString().equals(\"/\")) {\n\n int x = deq.removeFirst(), y = deq.removeFirst();\n deq.addFirst(y/x);\n\n } else if (s_array[i].toString().equals(\"+\")) {\n\n deq.addFirst((deq.removeFirst() + deq.removeFirst()));\n\n } else if (s_array[i].toString().equals(\"-\")) {\n\n int x = deq.removeFirst(), y = deq.removeFirst();\n deq.addFirst(y-x);\n\n } else {\n\n deq.addFirst(Integer.valueOf(s_array[i].toString()));\n\n }\n }\n\n System.out.printf(\"%d\\r\\n\", deq.removeFirst());\n\n }\n\n }\n\n } finally {\n\n sc.close();\n\n }\n\n }\n}",
"Main"
] | import java.util.*;
import java.util.ArrayDeque;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
try{
while (sc.hasNext()) {
String str = sc.nextLine();
Deque<Integer> deq = new ArrayDeque<Integer>();
String[] s_array = str.split(" ");
if (s_array.length > 2) {
for (int i = 0; i < s_array.length; i++) {
if (s_array[i].toString().equals("*")) {
deq.addFirst((deq.removeFirst() * deq.removeFirst()));
} else if (s_array[i].toString().equals("/")) {
int x = deq.removeFirst(), y = deq.removeFirst();
deq.addFirst(y/x);
} else if (s_array[i].toString().equals("+")) {
deq.addFirst((deq.removeFirst() + deq.removeFirst()));
} else if (s_array[i].toString().equals("-")) {
int x = deq.removeFirst(), y = deq.removeFirst();
deq.addFirst(y-x);
} else {
deq.addFirst(Integer.valueOf(s_array[i].toString()));
}
}
System.out.printf("%d\r\n", deq.removeFirst());
}
}
} finally {
sc.close();
}
}
}
|
[
7,
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,
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,
4,
13,
4,
18,
13,
18,
13,
13,
4,
18,
18,
13,
13,
4,
13,
23,
13,
12,
13,
30,
0,
18,
13,
40,
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
],
[
145,
5
],
[
145,
6
],
[
6,
7
],
[
6,
8
],
[
145,
9
],
[
9,
10
],
[
9,
11
],
[
145,
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
],
[
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
],
[
43,
44
],
[
44,
45
],
[
45,
46
],
[
45,
47
],
[
43,
48
],
[
42,
49
],
[
49,
50
],
[
50,
51
],
[
50,
52
],
[
52,
53
],
[
49,
54
],
[
54,
55
],
[
54,
56
],
[
56,
57
],
[
49,
58
],
[
58,
59
],
[
58,
60
],
[
60,
61
],
[
60,
62
],
[
42,
63
],
[
63,
64
],
[
64,
65
],
[
65,
66
],
[
66,
67
],
[
66,
68
],
[
64,
69
],
[
63,
70
],
[
70,
71
],
[
71,
72
],
[
71,
73
],
[
73,
74
],
[
70,
75
],
[
75,
76
],
[
75,
77
],
[
77,
78
],
[
70,
79
],
[
79,
80
],
[
79,
81
],
[
81,
82
],
[
81,
83
],
[
63,
84
],
[
84,
85
],
[
85,
86
],
[
86,
87
],
[
87,
88
],
[
87,
89
],
[
85,
90
],
[
84,
91
],
[
91,
92
],
[
92,
93
],
[
92,
94
],
[
94,
95
],
[
91,
96
],
[
96,
97
],
[
96,
98
],
[
98,
99
],
[
91,
100
],
[
100,
101
],
[
100,
102
],
[
102,
103
],
[
102,
104
],
[
84,
105
],
[
105,
106
],
[
105,
107
],
[
107,
108
],
[
108,
109
],
[
107,
110
],
[
110,
111
],
[
110,
112
],
[
15,
113
],
[
113,
114
],
[
114,
115
],
[
115,
116
],
[
115,
117
],
[
113,
118
],
[
118,
119
],
[
13,
120
],
[
120,
121
],
[
145,
122
],
[
122,
123
],
[
122,
124
],
[
124,
125
],
[
125,
126
],
[
126,
127
],
[
126,
128
],
[
128,
129
],
[
125,
130
],
[
122,
131
],
[
131,
132
],
[
145,
133
],
[
133,
134
],
[
133,
135
],
[
135,
136
],
[
136,
137
],
[
135,
138
],
[
138,
139
],
[
139,
140
],
[
139,
141
],
[
141,
142
],
[
141,
143
],
[
0,
144
],
[
144,
145
],
[
144,
146
]
] | [
"import java.util.Scanner;\n\npublic class Main {\n\tpublic static int top = 0;\n\tpublic static int[] stack = new int[200];\n\t\n\tpublic static void main(String[] args) {\n\t\tScanner stdIn = new Scanner(System.in);\n\t\tString[] k = (stdIn.nextLine()).split(\" \");\n\t\t\n\t\tfor (int i = 0; i < k.length;i++) {\n\t\t\tif (k[i].equals(\"+\")) {\n\t\t\t\tint b = pop();\n\t\t\t\tint a = pop();\n\t\t\t\tpush(a + b);\n\t\t\t}\n\t\t\telse if (k[i].equals(\"-\")) {\n\t\t\t\tint b = pop();\n\t\t\t\tint a = pop();\n\t\t\t\tpush(a - b);\n\t\t\t}\n\t\t\telse if (k[i].equals(\"*\")) {\n\t\t\t\tint b = pop();\n\t\t\t\tint a = pop();\n\t\t\t\tpush(a * b);\n\t\t\t}\n\t\t\telse\n\t\t\t\tpush(Integer.parseInt(k[i]));\n\t\t}\n\t\t\n\t\tSystem.out.println(pop());\n\t}\n\t\n\tpublic static void push(int x) {\n\t\tstack[++top] = x;\n\t}\n\t\n\tpublic static int pop() {\n\t\ttop--;\n\t\treturn stack[top+1];\n\t}\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\tpublic static int top = 0;\n\tpublic static int[] stack = new int[200];\n\t\n\tpublic static void main(String[] args) {\n\t\tScanner stdIn = new Scanner(System.in);\n\t\tString[] k = (stdIn.nextLine()).split(\" \");\n\t\t\n\t\tfor (int i = 0; i < k.length;i++) {\n\t\t\tif (k[i].equals(\"+\")) {\n\t\t\t\tint b = pop();\n\t\t\t\tint a = pop();\n\t\t\t\tpush(a + b);\n\t\t\t}\n\t\t\telse if (k[i].equals(\"-\")) {\n\t\t\t\tint b = pop();\n\t\t\t\tint a = pop();\n\t\t\t\tpush(a - b);\n\t\t\t}\n\t\t\telse if (k[i].equals(\"*\")) {\n\t\t\t\tint b = pop();\n\t\t\t\tint a = pop();\n\t\t\t\tpush(a * b);\n\t\t\t}\n\t\t\telse\n\t\t\t\tpush(Integer.parseInt(k[i]));\n\t\t}\n\t\t\n\t\tSystem.out.println(pop());\n\t}\n\t\n\tpublic static void push(int x) {\n\t\tstack[++top] = x;\n\t}\n\t\n\tpublic static int pop() {\n\t\ttop--;\n\t\treturn stack[top+1];\n\t}\n}",
"Main",
"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) {\n\t\tScanner stdIn = new Scanner(System.in);\n\t\tString[] k = (stdIn.nextLine()).split(\" \");\n\t\t\n\t\tfor (int i = 0; i < k.length;i++) {\n\t\t\tif (k[i].equals(\"+\")) {\n\t\t\t\tint b = pop();\n\t\t\t\tint a = pop();\n\t\t\t\tpush(a + b);\n\t\t\t}\n\t\t\telse if (k[i].equals(\"-\")) {\n\t\t\t\tint b = pop();\n\t\t\t\tint a = pop();\n\t\t\t\tpush(a - b);\n\t\t\t}\n\t\t\telse if (k[i].equals(\"*\")) {\n\t\t\t\tint b = pop();\n\t\t\t\tint a = pop();\n\t\t\t\tpush(a * b);\n\t\t\t}\n\t\t\telse\n\t\t\t\tpush(Integer.parseInt(k[i]));\n\t\t}\n\t\t\n\t\tSystem.out.println(pop());\n\t}",
"main",
"{\n\t\tScanner stdIn = new Scanner(System.in);\n\t\tString[] k = (stdIn.nextLine()).split(\" \");\n\t\t\n\t\tfor (int i = 0; i < k.length;i++) {\n\t\t\tif (k[i].equals(\"+\")) {\n\t\t\t\tint b = pop();\n\t\t\t\tint a = pop();\n\t\t\t\tpush(a + b);\n\t\t\t}\n\t\t\telse if (k[i].equals(\"-\")) {\n\t\t\t\tint b = pop();\n\t\t\t\tint a = pop();\n\t\t\t\tpush(a - b);\n\t\t\t}\n\t\t\telse if (k[i].equals(\"*\")) {\n\t\t\t\tint b = pop();\n\t\t\t\tint a = pop();\n\t\t\t\tpush(a * b);\n\t\t\t}\n\t\t\telse\n\t\t\t\tpush(Integer.parseInt(k[i]));\n\t\t}\n\t\t\n\t\tSystem.out.println(pop());\n\t}",
"Scanner stdIn = new Scanner(System.in);",
"stdIn",
"new Scanner(System.in)",
"String[] k = (stdIn.nextLine()).split(\" \");",
"k",
"(stdIn.nextLine()).split(\" \")",
"(stdIn.nextLine()).split",
"(stdIn.nextLine())",
"stdIn.nextLine",
"stdIn",
"\" \"",
"for (int i = 0; i < k.length;i++) {\n\t\t\tif (k[i].equals(\"+\")) {\n\t\t\t\tint b = pop();\n\t\t\t\tint a = pop();\n\t\t\t\tpush(a + b);\n\t\t\t}\n\t\t\telse if (k[i].equals(\"-\")) {\n\t\t\t\tint b = pop();\n\t\t\t\tint a = pop();\n\t\t\t\tpush(a - b);\n\t\t\t}\n\t\t\telse if (k[i].equals(\"*\")) {\n\t\t\t\tint b = pop();\n\t\t\t\tint a = pop();\n\t\t\t\tpush(a * b);\n\t\t\t}\n\t\t\telse\n\t\t\t\tpush(Integer.parseInt(k[i]));\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < k.length",
"i",
"k.length",
"k",
"k.length",
"i++",
"i++",
"i",
"{\n\t\t\tif (k[i].equals(\"+\")) {\n\t\t\t\tint b = pop();\n\t\t\t\tint a = pop();\n\t\t\t\tpush(a + b);\n\t\t\t}\n\t\t\telse if (k[i].equals(\"-\")) {\n\t\t\t\tint b = pop();\n\t\t\t\tint a = pop();\n\t\t\t\tpush(a - b);\n\t\t\t}\n\t\t\telse if (k[i].equals(\"*\")) {\n\t\t\t\tint b = pop();\n\t\t\t\tint a = pop();\n\t\t\t\tpush(a * b);\n\t\t\t}\n\t\t\telse\n\t\t\t\tpush(Integer.parseInt(k[i]));\n\t\t}",
"{\n\t\t\tif (k[i].equals(\"+\")) {\n\t\t\t\tint b = pop();\n\t\t\t\tint a = pop();\n\t\t\t\tpush(a + b);\n\t\t\t}\n\t\t\telse if (k[i].equals(\"-\")) {\n\t\t\t\tint b = pop();\n\t\t\t\tint a = pop();\n\t\t\t\tpush(a - b);\n\t\t\t}\n\t\t\telse if (k[i].equals(\"*\")) {\n\t\t\t\tint b = pop();\n\t\t\t\tint a = pop();\n\t\t\t\tpush(a * b);\n\t\t\t}\n\t\t\telse\n\t\t\t\tpush(Integer.parseInt(k[i]));\n\t\t}",
"if (k[i].equals(\"+\")) {\n\t\t\t\tint b = pop();\n\t\t\t\tint a = pop();\n\t\t\t\tpush(a + b);\n\t\t\t}\n\t\t\telse if (k[i].equals(\"-\")) {\n\t\t\t\tint b = pop();\n\t\t\t\tint a = pop();\n\t\t\t\tpush(a - b);\n\t\t\t}\n\t\t\telse if (k[i].equals(\"*\")) {\n\t\t\t\tint b = pop();\n\t\t\t\tint a = pop();\n\t\t\t\tpush(a * b);\n\t\t\t}\n\t\t\telse\n\t\t\t\tpush(Integer.parseInt(k[i]));",
"k[i].equals(\"+\")",
"k[i].equals",
"k[i]",
"k",
"i",
"\"+\"",
"{\n\t\t\t\tint b = pop();\n\t\t\t\tint a = pop();\n\t\t\t\tpush(a + b);\n\t\t\t}",
"int b = pop();",
"b",
"pop()",
"pop",
"int a = pop();",
"a",
"pop()",
"pop",
"push(a + b)",
"push",
"a + b",
"a",
"b",
"if (k[i].equals(\"-\")) {\n\t\t\t\tint b = pop();\n\t\t\t\tint a = pop();\n\t\t\t\tpush(a - b);\n\t\t\t}\n\t\t\telse if (k[i].equals(\"*\")) {\n\t\t\t\tint b = pop();\n\t\t\t\tint a = pop();\n\t\t\t\tpush(a * b);\n\t\t\t}\n\t\t\telse\n\t\t\t\tpush(Integer.parseInt(k[i]));",
"k[i].equals(\"-\")",
"k[i].equals",
"k[i]",
"k",
"i",
"\"-\"",
"{\n\t\t\t\tint b = pop();\n\t\t\t\tint a = pop();\n\t\t\t\tpush(a - b);\n\t\t\t}",
"int b = pop();",
"b",
"pop()",
"pop",
"int a = pop();",
"a",
"pop()",
"pop",
"push(a - b)",
"push",
"a - b",
"a",
"b",
"if (k[i].equals(\"*\")) {\n\t\t\t\tint b = pop();\n\t\t\t\tint a = pop();\n\t\t\t\tpush(a * b);\n\t\t\t}\n\t\t\telse\n\t\t\t\tpush(Integer.parseInt(k[i]));",
"k[i].equals(\"*\")",
"k[i].equals",
"k[i]",
"k",
"i",
"\"*\"",
"{\n\t\t\t\tint b = pop();\n\t\t\t\tint a = pop();\n\t\t\t\tpush(a * b);\n\t\t\t}",
"int b = pop();",
"b",
"pop()",
"pop",
"int a = pop();",
"a",
"pop()",
"pop",
"push(a * b)",
"push",
"a * b",
"a",
"b",
"push(Integer.parseInt(k[i]))",
"push",
"Integer.parseInt(k[i])",
"Integer.parseInt",
"Integer",
"k[i]",
"k",
"i",
"System.out.println(pop())",
"System.out.println",
"System.out",
"System",
"System.out",
"pop()",
"pop",
"String[] args",
"args",
"public static void push(int x) {\n\t\tstack[++top] = x;\n\t}",
"push",
"{\n\t\tstack[++top] = x;\n\t}",
"stack[++top] = x",
"stack[++top]",
"stack",
"++top",
"top",
"x",
"int x",
"x",
"public static int pop() {\n\t\ttop--;\n\t\treturn stack[top+1];\n\t}",
"pop",
"{\n\t\ttop--;\n\t\treturn stack[top+1];\n\t}",
"top--",
"top",
"return stack[top+1];",
"stack[top+1]",
"stack",
"top+1",
"top",
"1",
"public class Main {\n\tpublic static int top = 0;\n\tpublic static int[] stack = new int[200];\n\t\n\tpublic static void main(String[] args) {\n\t\tScanner stdIn = new Scanner(System.in);\n\t\tString[] k = (stdIn.nextLine()).split(\" \");\n\t\t\n\t\tfor (int i = 0; i < k.length;i++) {\n\t\t\tif (k[i].equals(\"+\")) {\n\t\t\t\tint b = pop();\n\t\t\t\tint a = pop();\n\t\t\t\tpush(a + b);\n\t\t\t}\n\t\t\telse if (k[i].equals(\"-\")) {\n\t\t\t\tint b = pop();\n\t\t\t\tint a = pop();\n\t\t\t\tpush(a - b);\n\t\t\t}\n\t\t\telse if (k[i].equals(\"*\")) {\n\t\t\t\tint b = pop();\n\t\t\t\tint a = pop();\n\t\t\t\tpush(a * b);\n\t\t\t}\n\t\t\telse\n\t\t\t\tpush(Integer.parseInt(k[i]));\n\t\t}\n\t\t\n\t\tSystem.out.println(pop());\n\t}\n\t\n\tpublic static void push(int x) {\n\t\tstack[++top] = x;\n\t}\n\t\n\tpublic static int pop() {\n\t\ttop--;\n\t\treturn stack[top+1];\n\t}\n}",
"public class Main {\n\tpublic static int top = 0;\n\tpublic static int[] stack = new int[200];\n\t\n\tpublic static void main(String[] args) {\n\t\tScanner stdIn = new Scanner(System.in);\n\t\tString[] k = (stdIn.nextLine()).split(\" \");\n\t\t\n\t\tfor (int i = 0; i < k.length;i++) {\n\t\t\tif (k[i].equals(\"+\")) {\n\t\t\t\tint b = pop();\n\t\t\t\tint a = pop();\n\t\t\t\tpush(a + b);\n\t\t\t}\n\t\t\telse if (k[i].equals(\"-\")) {\n\t\t\t\tint b = pop();\n\t\t\t\tint a = pop();\n\t\t\t\tpush(a - b);\n\t\t\t}\n\t\t\telse if (k[i].equals(\"*\")) {\n\t\t\t\tint b = pop();\n\t\t\t\tint a = pop();\n\t\t\t\tpush(a * b);\n\t\t\t}\n\t\t\telse\n\t\t\t\tpush(Integer.parseInt(k[i]));\n\t\t}\n\t\t\n\t\tSystem.out.println(pop());\n\t}\n\t\n\tpublic static void push(int x) {\n\t\tstack[++top] = x;\n\t}\n\t\n\tpublic static int pop() {\n\t\ttop--;\n\t\treturn stack[top+1];\n\t}\n}",
"Main"
] | import java.util.Scanner;
public class Main {
public static int top = 0;
public static int[] stack = new int[200];
public static void main(String[] args) {
Scanner stdIn = new Scanner(System.in);
String[] k = (stdIn.nextLine()).split(" ");
for (int i = 0; i < k.length;i++) {
if (k[i].equals("+")) {
int b = pop();
int a = pop();
push(a + b);
}
else if (k[i].equals("-")) {
int b = pop();
int a = pop();
push(a - b);
}
else if (k[i].equals("*")) {
int b = pop();
int a = pop();
push(a * b);
}
else
push(Integer.parseInt(k[i]));
}
System.out.println(pop());
}
public static void push(int x) {
stack[++top] = x;
}
public static int pop() {
top--;
return stack[top+1];
}
} |
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
20,
38,
5,
13,
30,
4,
18,
13,
5,
13,
30,
4,
18,
13,
30,
41,
13,
4,
18,
4,
18,
13,
17,
41,
13,
17,
42,
2,
13,
18,
13,
13,
30,
42,
2,
2,
2,
4,
18,
18,
13,
13,
17,
17,
2,
4,
18,
18,
13,
13,
17,
17,
2,
4,
18,
18,
13,
13,
17,
17,
30,
4,
18,
13,
18,
13,
13,
40,
13,
41,
13,
4,
18,
13,
4,
18,
13,
41,
13,
4,
18,
13,
4,
18,
13,
14,
4,
18,
18,
13,
13,
17,
30,
4,
18,
13,
4,
18,
13,
2,
13,
13,
14,
4,
18,
18,
13,
13,
17,
30,
4,
18,
13,
4,
18,
13,
2,
13,
13,
30,
4,
18,
13,
4,
18,
13,
2,
13,
13,
40,
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
],
[
165,
14
],
[
165,
15
],
[
15,
16
],
[
15,
17
],
[
17,
18
],
[
18,
19
],
[
18,
20
],
[
17,
21
],
[
21,
22
],
[
21,
23
],
[
17,
24
],
[
24,
25
],
[
25,
26
],
[
25,
27
],
[
27,
28
],
[
28,
29
],
[
29,
30
],
[
24,
31
],
[
31,
32
],
[
31,
33
],
[
33,
34
],
[
34,
35
],
[
35,
36
],
[
24,
37
],
[
37,
38
],
[
38,
39
],
[
38,
40
],
[
40,
41
],
[
41,
42
],
[
42,
43
],
[
43,
44
],
[
40,
45
],
[
37,
46
],
[
46,
47
],
[
46,
48
],
[
37,
49
],
[
49,
50
],
[
50,
51
],
[
50,
52
],
[
52,
53
],
[
52,
54
],
[
49,
55
],
[
55,
56
],
[
56,
57
],
[
58,
58
],
[
58,
59
],
[
59,
60
],
[
60,
61
],
[
61,
62
],
[
62,
63
],
[
62,
64
],
[
60,
65
],
[
59,
66
],
[
58,
67
],
[
67,
68
],
[
68,
69
],
[
69,
70
],
[
70,
71
],
[
70,
72
],
[
68,
73
],
[
67,
74
],
[
58,
75
],
[
75,
76
],
[
76,
77
],
[
77,
78
],
[
78,
79
],
[
78,
80
],
[
76,
81
],
[
75,
82
],
[
56,
83
],
[
83,
84
],
[
84,
85
],
[
85,
86
],
[
84,
87
],
[
87,
88
],
[
87,
89
],
[
83,
90
],
[
90,
91
],
[
55,
92
],
[
92,
93
],
[
92,
94
],
[
94,
95
],
[
95,
96
],
[
94,
97
],
[
97,
98
],
[
98,
99
],
[
55,
100
],
[
100,
101
],
[
100,
102
],
[
102,
103
],
[
103,
104
],
[
102,
105
],
[
105,
106
],
[
106,
107
],
[
55,
108
],
[
108,
109
],
[
109,
110
],
[
110,
111
],
[
111,
112
],
[
111,
113
],
[
109,
114
],
[
108,
115
],
[
115,
116
],
[
116,
117
],
[
117,
118
],
[
116,
119
],
[
119,
120
],
[
120,
121
],
[
119,
122
],
[
122,
123
],
[
122,
124
],
[
108,
125
],
[
125,
126
],
[
126,
127
],
[
127,
128
],
[
128,
129
],
[
128,
130
],
[
126,
131
],
[
125,
132
],
[
132,
133
],
[
133,
134
],
[
134,
135
],
[
133,
136
],
[
136,
137
],
[
137,
138
],
[
136,
139
],
[
139,
140
],
[
139,
141
],
[
125,
142
],
[
142,
143
],
[
143,
144
],
[
144,
145
],
[
143,
146
],
[
146,
147
],
[
147,
148
],
[
146,
149
],
[
149,
150
],
[
149,
151
],
[
55,
152
],
[
152,
153
],
[
37,
154
],
[
154,
155
],
[
155,
156
],
[
156,
157
],
[
156,
158
],
[
154,
159
],
[
159,
160
],
[
160,
161
],
[
15,
162
],
[
162,
163
],
[
0,
164
],
[
164,
165
],
[
164,
166
]
] | [
"import java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\nimport java.util.LinkedList;\n\npublic class Main {\n\tpublic static void main(String[] args) {\n\t\tBufferedReader in = new BufferedReader(new InputStreamReader(System.in));\n\t LinkedList<String> stack = new LinkedList<String>();\n\t\t\n\t\ttry {\n\t\t\tString[] param = in.readLine().split(\" \");\n\t\t\t\n\t\t\tint i = 0;\n\t\t\twhile (i < param.length) {\n\t\t\t\twhile ((param[i].equals(\"+\") == false)\n\t\t\t\t\t\t&& (param[i].equals(\"-\") == false) && (param[i].equals(\"*\") == false)) {\n\t\t\t\t\tstack.push(param[i]);\n\t\t\t\t\ti++;\n\t\t\t\t}\n\t\t\t\tint b = Integer.parseInt(stack.pop());\n\t\t\t\tint a = Integer.parseInt(stack.pop());\n\t\t\t\t\n\t\t\t\tif (param[i].equals(\"+\")) {\n\t\t\t\t\tstack.push(String.valueOf(a + b));\n\t\t\t\t} else if (param[i].equals(\"-\")) {\n\t\t\t\t\tstack.push(String.valueOf(a - b));\n\t\t\t\t} else {\n\t\t\t\t\tstack.push(String.valueOf(a * b));\n\t\t\t\t}\n\t\t\t\ti++;\n\t\t\t}\n\t\t\t\n\t\t\tSystem.out.println(stack.pop());\n\t\t} catch (NumberFormatException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\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.LinkedList;",
"LinkedList",
"java.util",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tBufferedReader in = new BufferedReader(new InputStreamReader(System.in));\n\t LinkedList<String> stack = new LinkedList<String>();\n\t\t\n\t\ttry {\n\t\t\tString[] param = in.readLine().split(\" \");\n\t\t\t\n\t\t\tint i = 0;\n\t\t\twhile (i < param.length) {\n\t\t\t\twhile ((param[i].equals(\"+\") == false)\n\t\t\t\t\t\t&& (param[i].equals(\"-\") == false) && (param[i].equals(\"*\") == false)) {\n\t\t\t\t\tstack.push(param[i]);\n\t\t\t\t\ti++;\n\t\t\t\t}\n\t\t\t\tint b = Integer.parseInt(stack.pop());\n\t\t\t\tint a = Integer.parseInt(stack.pop());\n\t\t\t\t\n\t\t\t\tif (param[i].equals(\"+\")) {\n\t\t\t\t\tstack.push(String.valueOf(a + b));\n\t\t\t\t} else if (param[i].equals(\"-\")) {\n\t\t\t\t\tstack.push(String.valueOf(a - b));\n\t\t\t\t} else {\n\t\t\t\t\tstack.push(String.valueOf(a * b));\n\t\t\t\t}\n\t\t\t\ti++;\n\t\t\t}\n\t\t\t\n\t\t\tSystem.out.println(stack.pop());\n\t\t} catch (NumberFormatException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t}\n}",
"Main",
"public static void main(String[] args) {\n\t\tBufferedReader in = new BufferedReader(new InputStreamReader(System.in));\n\t LinkedList<String> stack = new LinkedList<String>();\n\t\t\n\t\ttry {\n\t\t\tString[] param = in.readLine().split(\" \");\n\t\t\t\n\t\t\tint i = 0;\n\t\t\twhile (i < param.length) {\n\t\t\t\twhile ((param[i].equals(\"+\") == false)\n\t\t\t\t\t\t&& (param[i].equals(\"-\") == false) && (param[i].equals(\"*\") == false)) {\n\t\t\t\t\tstack.push(param[i]);\n\t\t\t\t\ti++;\n\t\t\t\t}\n\t\t\t\tint b = Integer.parseInt(stack.pop());\n\t\t\t\tint a = Integer.parseInt(stack.pop());\n\t\t\t\t\n\t\t\t\tif (param[i].equals(\"+\")) {\n\t\t\t\t\tstack.push(String.valueOf(a + b));\n\t\t\t\t} else if (param[i].equals(\"-\")) {\n\t\t\t\t\tstack.push(String.valueOf(a - b));\n\t\t\t\t} else {\n\t\t\t\t\tstack.push(String.valueOf(a * b));\n\t\t\t\t}\n\t\t\t\ti++;\n\t\t\t}\n\t\t\t\n\t\t\tSystem.out.println(stack.pop());\n\t\t} catch (NumberFormatException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t}",
"main",
"{\n\t\tBufferedReader in = new BufferedReader(new InputStreamReader(System.in));\n\t LinkedList<String> stack = new LinkedList<String>();\n\t\t\n\t\ttry {\n\t\t\tString[] param = in.readLine().split(\" \");\n\t\t\t\n\t\t\tint i = 0;\n\t\t\twhile (i < param.length) {\n\t\t\t\twhile ((param[i].equals(\"+\") == false)\n\t\t\t\t\t\t&& (param[i].equals(\"-\") == false) && (param[i].equals(\"*\") == false)) {\n\t\t\t\t\tstack.push(param[i]);\n\t\t\t\t\ti++;\n\t\t\t\t}\n\t\t\t\tint b = Integer.parseInt(stack.pop());\n\t\t\t\tint a = Integer.parseInt(stack.pop());\n\t\t\t\t\n\t\t\t\tif (param[i].equals(\"+\")) {\n\t\t\t\t\tstack.push(String.valueOf(a + b));\n\t\t\t\t} else if (param[i].equals(\"-\")) {\n\t\t\t\t\tstack.push(String.valueOf(a - b));\n\t\t\t\t} else {\n\t\t\t\t\tstack.push(String.valueOf(a * b));\n\t\t\t\t}\n\t\t\t\ti++;\n\t\t\t}\n\t\t\t\n\t\t\tSystem.out.println(stack.pop());\n\t\t} catch (NumberFormatException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t}",
"BufferedReader in = new BufferedReader(new InputStreamReader(System.in));",
"in",
"new BufferedReader(new InputStreamReader(System.in))",
"LinkedList<String> stack = new LinkedList<String>();",
"stack",
"new LinkedList<String>()",
"try {\n\t\t\tString[] param = in.readLine().split(\" \");\n\t\t\t\n\t\t\tint i = 0;\n\t\t\twhile (i < param.length) {\n\t\t\t\twhile ((param[i].equals(\"+\") == false)\n\t\t\t\t\t\t&& (param[i].equals(\"-\") == false) && (param[i].equals(\"*\") == false)) {\n\t\t\t\t\tstack.push(param[i]);\n\t\t\t\t\ti++;\n\t\t\t\t}\n\t\t\t\tint b = Integer.parseInt(stack.pop());\n\t\t\t\tint a = Integer.parseInt(stack.pop());\n\t\t\t\t\n\t\t\t\tif (param[i].equals(\"+\")) {\n\t\t\t\t\tstack.push(String.valueOf(a + b));\n\t\t\t\t} else if (param[i].equals(\"-\")) {\n\t\t\t\t\tstack.push(String.valueOf(a - b));\n\t\t\t\t} else {\n\t\t\t\t\tstack.push(String.valueOf(a * b));\n\t\t\t\t}\n\t\t\t\ti++;\n\t\t\t}\n\t\t\t\n\t\t\tSystem.out.println(stack.pop());\n\t\t} catch (NumberFormatException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}",
"catch (NumberFormatException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}",
"NumberFormatException e",
"{\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}",
"e.printStackTrace()",
"e.printStackTrace",
"e",
"catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}",
"IOException e",
"{\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}",
"e.printStackTrace()",
"e.printStackTrace",
"e",
"{\n\t\t\tString[] param = in.readLine().split(\" \");\n\t\t\t\n\t\t\tint i = 0;\n\t\t\twhile (i < param.length) {\n\t\t\t\twhile ((param[i].equals(\"+\") == false)\n\t\t\t\t\t\t&& (param[i].equals(\"-\") == false) && (param[i].equals(\"*\") == false)) {\n\t\t\t\t\tstack.push(param[i]);\n\t\t\t\t\ti++;\n\t\t\t\t}\n\t\t\t\tint b = Integer.parseInt(stack.pop());\n\t\t\t\tint a = Integer.parseInt(stack.pop());\n\t\t\t\t\n\t\t\t\tif (param[i].equals(\"+\")) {\n\t\t\t\t\tstack.push(String.valueOf(a + b));\n\t\t\t\t} else if (param[i].equals(\"-\")) {\n\t\t\t\t\tstack.push(String.valueOf(a - b));\n\t\t\t\t} else {\n\t\t\t\t\tstack.push(String.valueOf(a * b));\n\t\t\t\t}\n\t\t\t\ti++;\n\t\t\t}\n\t\t\t\n\t\t\tSystem.out.println(stack.pop());\n\t\t}",
"String[] param = in.readLine().split(\" \");",
"param",
"in.readLine().split(\" \")",
"in.readLine().split",
"in.readLine()",
"in.readLine",
"in",
"\" \"",
"int i = 0;",
"i",
"0",
"while (i < param.length) {\n\t\t\t\twhile ((param[i].equals(\"+\") == false)\n\t\t\t\t\t\t&& (param[i].equals(\"-\") == false) && (param[i].equals(\"*\") == false)) {\n\t\t\t\t\tstack.push(param[i]);\n\t\t\t\t\ti++;\n\t\t\t\t}\n\t\t\t\tint b = Integer.parseInt(stack.pop());\n\t\t\t\tint a = Integer.parseInt(stack.pop());\n\t\t\t\t\n\t\t\t\tif (param[i].equals(\"+\")) {\n\t\t\t\t\tstack.push(String.valueOf(a + b));\n\t\t\t\t} else if (param[i].equals(\"-\")) {\n\t\t\t\t\tstack.push(String.valueOf(a - b));\n\t\t\t\t} else {\n\t\t\t\t\tstack.push(String.valueOf(a * b));\n\t\t\t\t}\n\t\t\t\ti++;\n\t\t\t}",
"i < param.length",
"i",
"param.length",
"param",
"param.length",
"{\n\t\t\t\twhile ((param[i].equals(\"+\") == false)\n\t\t\t\t\t\t&& (param[i].equals(\"-\") == false) && (param[i].equals(\"*\") == false)) {\n\t\t\t\t\tstack.push(param[i]);\n\t\t\t\t\ti++;\n\t\t\t\t}\n\t\t\t\tint b = Integer.parseInt(stack.pop());\n\t\t\t\tint a = Integer.parseInt(stack.pop());\n\t\t\t\t\n\t\t\t\tif (param[i].equals(\"+\")) {\n\t\t\t\t\tstack.push(String.valueOf(a + b));\n\t\t\t\t} else if (param[i].equals(\"-\")) {\n\t\t\t\t\tstack.push(String.valueOf(a - b));\n\t\t\t\t} else {\n\t\t\t\t\tstack.push(String.valueOf(a * b));\n\t\t\t\t}\n\t\t\t\ti++;\n\t\t\t}",
"while ((param[i].equals(\"+\") == false)\n\t\t\t\t\t\t&& (param[i].equals(\"-\") == false) && (param[i].equals(\"*\") == false)) {\n\t\t\t\t\tstack.push(param[i]);\n\t\t\t\t\ti++;\n\t\t\t\t}",
"(param[i].equals(\"+\") == false)\n\t\t\t\t\t\t&& (param[i].equals(\"-\") == false) && (param[i].equals(\"*\") == false)",
"(param[i].equals(\"+\") == false)\n\t\t\t\t\t\t&& (param[i].equals(\"-\") == false) && (param[i].equals(\"*\") == false)",
"(param[i].equals(\"+\") == false)",
"param[i].equals(\"+\")",
"param[i].equals",
"param[i]",
"param",
"i",
"\"+\"",
"false",
"(param[i].equals(\"-\") == false)",
"param[i].equals(\"-\")",
"param[i].equals",
"param[i]",
"param",
"i",
"\"-\"",
"false",
"(param[i].equals(\"*\") == false)",
"param[i].equals(\"*\")",
"param[i].equals",
"param[i]",
"param",
"i",
"\"*\"",
"false",
"{\n\t\t\t\t\tstack.push(param[i]);\n\t\t\t\t\ti++;\n\t\t\t\t}",
"stack.push(param[i])",
"stack.push",
"stack",
"param[i]",
"param",
"i",
"i++",
"i",
"int b = Integer.parseInt(stack.pop());",
"b",
"Integer.parseInt(stack.pop())",
"Integer.parseInt",
"Integer",
"stack.pop()",
"stack.pop",
"stack",
"int a = Integer.parseInt(stack.pop());",
"a",
"Integer.parseInt(stack.pop())",
"Integer.parseInt",
"Integer",
"stack.pop()",
"stack.pop",
"stack",
"if (param[i].equals(\"+\")) {\n\t\t\t\t\tstack.push(String.valueOf(a + b));\n\t\t\t\t} else if (param[i].equals(\"-\")) {\n\t\t\t\t\tstack.push(String.valueOf(a - b));\n\t\t\t\t} else {\n\t\t\t\t\tstack.push(String.valueOf(a * b));\n\t\t\t\t}",
"param[i].equals(\"+\")",
"param[i].equals",
"param[i]",
"param",
"i",
"\"+\"",
"{\n\t\t\t\t\tstack.push(String.valueOf(a + b));\n\t\t\t\t}",
"stack.push(String.valueOf(a + b))",
"stack.push",
"stack",
"String.valueOf(a + b)",
"String.valueOf",
"String",
"a + b",
"a",
"b",
"if (param[i].equals(\"-\")) {\n\t\t\t\t\tstack.push(String.valueOf(a - b));\n\t\t\t\t} else {\n\t\t\t\t\tstack.push(String.valueOf(a * b));\n\t\t\t\t}",
"param[i].equals(\"-\")",
"param[i].equals",
"param[i]",
"param",
"i",
"\"-\"",
"{\n\t\t\t\t\tstack.push(String.valueOf(a - b));\n\t\t\t\t}",
"stack.push(String.valueOf(a - b))",
"stack.push",
"stack",
"String.valueOf(a - b)",
"String.valueOf",
"String",
"a - b",
"a",
"b",
"{\n\t\t\t\t\tstack.push(String.valueOf(a * b));\n\t\t\t\t}",
"stack.push(String.valueOf(a * b))",
"stack.push",
"stack",
"String.valueOf(a * b)",
"String.valueOf",
"String",
"a * b",
"a",
"b",
"i++",
"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\tBufferedReader in = new BufferedReader(new InputStreamReader(System.in));\n\t LinkedList<String> stack = new LinkedList<String>();\n\t\t\n\t\ttry {\n\t\t\tString[] param = in.readLine().split(\" \");\n\t\t\t\n\t\t\tint i = 0;\n\t\t\twhile (i < param.length) {\n\t\t\t\twhile ((param[i].equals(\"+\") == false)\n\t\t\t\t\t\t&& (param[i].equals(\"-\") == false) && (param[i].equals(\"*\") == false)) {\n\t\t\t\t\tstack.push(param[i]);\n\t\t\t\t\ti++;\n\t\t\t\t}\n\t\t\t\tint b = Integer.parseInt(stack.pop());\n\t\t\t\tint a = Integer.parseInt(stack.pop());\n\t\t\t\t\n\t\t\t\tif (param[i].equals(\"+\")) {\n\t\t\t\t\tstack.push(String.valueOf(a + b));\n\t\t\t\t} else if (param[i].equals(\"-\")) {\n\t\t\t\t\tstack.push(String.valueOf(a - b));\n\t\t\t\t} else {\n\t\t\t\t\tstack.push(String.valueOf(a * b));\n\t\t\t\t}\n\t\t\t\ti++;\n\t\t\t}\n\t\t\t\n\t\t\tSystem.out.println(stack.pop());\n\t\t} catch (NumberFormatException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t}\n}",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tBufferedReader in = new BufferedReader(new InputStreamReader(System.in));\n\t LinkedList<String> stack = new LinkedList<String>();\n\t\t\n\t\ttry {\n\t\t\tString[] param = in.readLine().split(\" \");\n\t\t\t\n\t\t\tint i = 0;\n\t\t\twhile (i < param.length) {\n\t\t\t\twhile ((param[i].equals(\"+\") == false)\n\t\t\t\t\t\t&& (param[i].equals(\"-\") == false) && (param[i].equals(\"*\") == false)) {\n\t\t\t\t\tstack.push(param[i]);\n\t\t\t\t\ti++;\n\t\t\t\t}\n\t\t\t\tint b = Integer.parseInt(stack.pop());\n\t\t\t\tint a = Integer.parseInt(stack.pop());\n\t\t\t\t\n\t\t\t\tif (param[i].equals(\"+\")) {\n\t\t\t\t\tstack.push(String.valueOf(a + b));\n\t\t\t\t} else if (param[i].equals(\"-\")) {\n\t\t\t\t\tstack.push(String.valueOf(a - b));\n\t\t\t\t} else {\n\t\t\t\t\tstack.push(String.valueOf(a * b));\n\t\t\t\t}\n\t\t\t\ti++;\n\t\t\t}\n\t\t\t\n\t\t\tSystem.out.println(stack.pop());\n\t\t} catch (NumberFormatException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t}\n}",
"Main"
] | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.LinkedList;
public class Main {
public static void main(String[] args) {
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
LinkedList<String> stack = new LinkedList<String>();
try {
String[] param = in.readLine().split(" ");
int i = 0;
while (i < param.length) {
while ((param[i].equals("+") == false)
&& (param[i].equals("-") == false) && (param[i].equals("*") == false)) {
stack.push(param[i]);
i++;
}
int b = Integer.parseInt(stack.pop());
int a = Integer.parseInt(stack.pop());
if (param[i].equals("+")) {
stack.push(String.valueOf(a + b));
} else if (param[i].equals("-")) {
stack.push(String.valueOf(a - b));
} else {
stack.push(String.valueOf(a * b));
}
i++;
}
System.out.println(stack.pop());
} catch (NumberFormatException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
4,
18,
13,
41,
13,
4,
18,
13,
17,
41,
13,
20,
41,
13,
41,
13,
28,
13,
13,
30,
30,
38,
5,
13,
30,
4,
18,
18,
13,
13,
17,
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,
1,
4,
18,
13,
4,
18,
13,
13,
38,
5,
13,
30,
30,
4,
18,
18,
13,
13,
4,
18,
13,
23,
13,
6,
13,
41,
13,
17,
41,
13,
12,
13,
30,
0,
18,
36,
13,
20,
13,
23,
13,
12,
13,
30,
14,
4,
18,
36,
30,
37,
20,
0,
18,
18,
36,
13,
40,
13,
13,
23,
13,
12,
13,
30,
14,
4,
18,
36,
30,
37,
20,
40,
18,
36,
13,
29,
18,
13,
2,
18,
36,
13,
17,
12,
13,
30,
29,
2,
18,
36,
13,
2,
18,
18,
36,
13,
13,
17,
12,
13,
30,
29,
2,
18,
36,
13,
17,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
220,
5
],
[
220,
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
],
[
18,
19
],
[
8,
20
],
[
20,
21
],
[
20,
22
],
[
22,
23
],
[
23,
24
],
[
22,
25
],
[
8,
26
],
[
26,
27
],
[
26,
28
],
[
8,
29
],
[
29,
30
],
[
8,
31
],
[
31,
32
],
[
8,
33
],
[
33,
34
],
[
33,
35
],
[
33,
36
],
[
37,
37
],
[
37,
38
],
[
38,
39
],
[
39,
40
],
[
39,
41
],
[
41,
42
],
[
42,
43
],
[
43,
44
],
[
44,
45
],
[
44,
46
],
[
42,
47
],
[
38,
48
],
[
48,
49
],
[
49,
50
],
[
49,
51
],
[
51,
52
],
[
51,
53
],
[
53,
54
],
[
54,
55
],
[
54,
56
],
[
56,
57
],
[
57,
58
],
[
53,
59
],
[
59,
60
],
[
59,
61
],
[
61,
62
],
[
62,
63
],
[
53,
64
],
[
64,
65
],
[
65,
66
],
[
64,
67
],
[
67,
68
],
[
67,
69
],
[
53,
70
],
[
49,
71
],
[
71,
72
],
[
71,
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
],
[
73,
90
],
[
49,
91
],
[
91,
92
],
[
91,
93
],
[
93,
94
],
[
94,
95
],
[
94,
96
],
[
96,
97
],
[
97,
98
],
[
93,
99
],
[
99,
100
],
[
99,
101
],
[
101,
102
],
[
102,
103
],
[
93,
104
],
[
104,
105
],
[
105,
106
],
[
104,
107
],
[
107,
108
],
[
107,
109
],
[
93,
110
],
[
49,
111
],
[
111,
112
],
[
112,
113
],
[
113,
114
],
[
114,
115
],
[
113,
116
],
[
116,
117
],
[
117,
118
],
[
116,
119
],
[
8,
120
],
[
120,
121
],
[
121,
122
],
[
121,
123
],
[
120,
124
],
[
124,
125
],
[
125,
126
],
[
126,
127
],
[
127,
128
],
[
127,
129
],
[
125,
130
],
[
130,
131
],
[
131,
132
],
[
6,
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
],
[
146,
147
],
[
146,
148
],
[
145,
149
],
[
142,
151
],
[
151,
152
],
[
135,
153
],
[
153,
154
],
[
153,
155
],
[
155,
156
],
[
156,
157
],
[
157,
158
],
[
158,
159
],
[
156,
160
],
[
160,
161
],
[
161,
162
],
[
155,
163
],
[
163,
164
],
[
164,
165
],
[
165,
166
],
[
165,
167
],
[
164,
168
],
[
168,
169
],
[
163,
170
],
[
153,
171
],
[
171,
172
],
[
135,
173
],
[
173,
174
],
[
173,
175
],
[
175,
176
],
[
176,
177
],
[
177,
178
],
[
178,
179
],
[
176,
180
],
[
180,
181
],
[
181,
182
],
[
175,
183
],
[
183,
184
],
[
184,
185
],
[
184,
186
],
[
175,
187
],
[
187,
188
],
[
188,
189
],
[
188,
190
],
[
190,
191
],
[
191,
192
],
[
191,
193
],
[
190,
194
],
[
135,
195
],
[
195,
196
],
[
195,
197
],
[
197,
198
],
[
198,
199
],
[
199,
200
],
[
200,
201
],
[
200,
202
],
[
199,
203
],
[
203,
204
],
[
204,
205
],
[
205,
206
],
[
205,
207
],
[
204,
208
],
[
203,
209
],
[
135,
210
],
[
210,
211
],
[
210,
212
],
[
212,
213
],
[
213,
214
],
[
214,
215
],
[
215,
216
],
[
215,
217
],
[
214,
218
],
[
0,
219
],
[
219,
220
],
[
219,
221
]
] | [
"import java.util.*;\n\npublic class Main {\n\tpublic static void main(String args[])\n\t{\n\t Scanner sc = new Scanner(System.in);\n\t String str = sc.nextLine();\n sc.close();\n\n String[] str_arr = str.split(\" \");\n\n\t Stack stack = new Stack(200);\n\n\t int a;\n\t int b;\n\t for (String s : str_arr) {\n try {\n switch (s) {\n case \"+\":\n b = stack.pop();\n a = stack.pop();\n stack.push(a + b);\n break;\n case \"-\":\n b = stack.pop();\n a = stack.pop();\n stack.push(a - b);\n break;\n case \"*\":\n b = stack.pop();\n a = stack.pop();\n stack.push(a * b);\n break;\n default:\n stack.push(Integer.parseInt(s));\n }\n } catch (Exception e) {\n System.out.println(\"error\");\n }\n\t }\n\n try {\n System.out.println(stack.pop());\n } catch (Exception e) {}\n\n\t}\n}\n\nclass Stack\n{\n public int top = 0;\n public int S[];\n\n public Stack(int n) {\n this.S = new int[n];\n }\n\n public void push(int x) throws Exception\n {\n if (this.isFull()) {\n throw new Exception();\n }\n this.S[++top] = x;\n }\n\n public int pop() throws Exception\n {\n if (this.isEmpty()) {\n throw new Exception();\n }\n this.top--;\n return S[this.top + 1];\n }\n\n private boolean isFull()\n {\n return this.top >= this.S.length - 1;\n }\n\n private boolean isEmpty()\n {\n return this.top == 0;\n }\n}",
"import java.util.*;",
"util.*",
"java",
"public class Main {\n\tpublic static void main(String args[])\n\t{\n\t Scanner sc = new Scanner(System.in);\n\t String str = sc.nextLine();\n sc.close();\n\n String[] str_arr = str.split(\" \");\n\n\t Stack stack = new Stack(200);\n\n\t int a;\n\t int b;\n\t for (String s : str_arr) {\n try {\n switch (s) {\n case \"+\":\n b = stack.pop();\n a = stack.pop();\n stack.push(a + b);\n break;\n case \"-\":\n b = stack.pop();\n a = stack.pop();\n stack.push(a - b);\n break;\n case \"*\":\n b = stack.pop();\n a = stack.pop();\n stack.push(a * b);\n break;\n default:\n stack.push(Integer.parseInt(s));\n }\n } catch (Exception e) {\n System.out.println(\"error\");\n }\n\t }\n\n try {\n System.out.println(stack.pop());\n } catch (Exception e) {}\n\n\t}\n}",
"Main",
"public static void main(String args[])\n\t{\n\t Scanner sc = new Scanner(System.in);\n\t String str = sc.nextLine();\n sc.close();\n\n String[] str_arr = str.split(\" \");\n\n\t Stack stack = new Stack(200);\n\n\t int a;\n\t int b;\n\t for (String s : str_arr) {\n try {\n switch (s) {\n case \"+\":\n b = stack.pop();\n a = stack.pop();\n stack.push(a + b);\n break;\n case \"-\":\n b = stack.pop();\n a = stack.pop();\n stack.push(a - b);\n break;\n case \"*\":\n b = stack.pop();\n a = stack.pop();\n stack.push(a * b);\n break;\n default:\n stack.push(Integer.parseInt(s));\n }\n } catch (Exception e) {\n System.out.println(\"error\");\n }\n\t }\n\n try {\n System.out.println(stack.pop());\n } catch (Exception e) {}\n\n\t}",
"main",
"{\n\t Scanner sc = new Scanner(System.in);\n\t String str = sc.nextLine();\n sc.close();\n\n String[] str_arr = str.split(\" \");\n\n\t Stack stack = new Stack(200);\n\n\t int a;\n\t int b;\n\t for (String s : str_arr) {\n try {\n switch (s) {\n case \"+\":\n b = stack.pop();\n a = stack.pop();\n stack.push(a + b);\n break;\n case \"-\":\n b = stack.pop();\n a = stack.pop();\n stack.push(a - b);\n break;\n case \"*\":\n b = stack.pop();\n a = stack.pop();\n stack.push(a * b);\n break;\n default:\n stack.push(Integer.parseInt(s));\n }\n } catch (Exception e) {\n System.out.println(\"error\");\n }\n\t }\n\n try {\n System.out.println(stack.pop());\n } catch (Exception e) {}\n\n\t}",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"String str = sc.nextLine();",
"str",
"sc.nextLine()",
"sc.nextLine",
"sc",
"sc.close()",
"sc.close",
"sc",
"String[] str_arr = str.split(\" \");",
"str_arr",
"str.split(\" \")",
"str.split",
"str",
"\" \"",
"Stack stack = new Stack(200);",
"stack",
"new Stack(200)",
"int a;",
"a",
"int b;",
"b",
"for (String s : str_arr) {\n try {\n switch (s) {\n case \"+\":\n b = stack.pop();\n a = stack.pop();\n stack.push(a + b);\n break;\n case \"-\":\n b = stack.pop();\n a = stack.pop();\n stack.push(a - b);\n break;\n case \"*\":\n b = stack.pop();\n a = stack.pop();\n stack.push(a * b);\n break;\n default:\n stack.push(Integer.parseInt(s));\n }\n } catch (Exception e) {\n System.out.println(\"error\");\n }\n\t }",
"String s",
"str_arr",
"{\n try {\n switch (s) {\n case \"+\":\n b = stack.pop();\n a = stack.pop();\n stack.push(a + b);\n break;\n case \"-\":\n b = stack.pop();\n a = stack.pop();\n stack.push(a - b);\n break;\n case \"*\":\n b = stack.pop();\n a = stack.pop();\n stack.push(a * b);\n break;\n default:\n stack.push(Integer.parseInt(s));\n }\n } catch (Exception e) {\n System.out.println(\"error\");\n }\n\t }",
"{\n try {\n switch (s) {\n case \"+\":\n b = stack.pop();\n a = stack.pop();\n stack.push(a + b);\n break;\n case \"-\":\n b = stack.pop();\n a = stack.pop();\n stack.push(a - b);\n break;\n case \"*\":\n b = stack.pop();\n a = stack.pop();\n stack.push(a * b);\n break;\n default:\n stack.push(Integer.parseInt(s));\n }\n } catch (Exception e) {\n System.out.println(\"error\");\n }\n\t }",
"try {\n switch (s) {\n case \"+\":\n b = stack.pop();\n a = stack.pop();\n stack.push(a + b);\n break;\n case \"-\":\n b = stack.pop();\n a = stack.pop();\n stack.push(a - b);\n break;\n case \"*\":\n b = stack.pop();\n a = stack.pop();\n stack.push(a * b);\n break;\n default:\n stack.push(Integer.parseInt(s));\n }\n } catch (Exception e) {\n System.out.println(\"error\");\n }",
"catch (Exception e) {\n System.out.println(\"error\");\n }",
"Exception e",
"{\n System.out.println(\"error\");\n }",
"System.out.println(\"error\")",
"System.out.println",
"System.out",
"System",
"System.out",
"\"error\"",
"{\n switch (s) {\n case \"+\":\n b = stack.pop();\n a = stack.pop();\n stack.push(a + b);\n break;\n case \"-\":\n b = stack.pop();\n a = stack.pop();\n stack.push(a - b);\n break;\n case \"*\":\n b = stack.pop();\n a = stack.pop();\n stack.push(a * b);\n break;\n default:\n stack.push(Integer.parseInt(s));\n }\n }",
"switch (s) {\n case \"+\":\n b = stack.pop();\n a = stack.pop();\n stack.push(a + b);\n break;\n case \"-\":\n b = stack.pop();\n a = stack.pop();\n stack.push(a - b);\n break;\n case \"*\":\n b = stack.pop();\n a = stack.pop();\n stack.push(a * b);\n break;\n default:\n stack.push(Integer.parseInt(s));\n }",
"s",
"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 \"-\":",
"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 \"*\":",
"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;",
"default:",
"default:",
"stack.push(Integer.parseInt(s))",
"stack.push",
"stack",
"Integer.parseInt(s)",
"Integer.parseInt",
"Integer",
"s",
"try {\n System.out.println(stack.pop());\n } catch (Exception e) {}",
"catch (Exception e) {}",
"Exception e",
"{}",
"{\n System.out.println(stack.pop());\n }",
"System.out.println(stack.pop())",
"System.out.println",
"System.out",
"System",
"System.out",
"stack.pop()",
"stack.pop",
"stack",
"String args[]",
"args",
"class Stack\n{\n public int top = 0;\n public int S[];\n\n public Stack(int n) {\n this.S = new int[n];\n }\n\n public void push(int x) throws Exception\n {\n if (this.isFull()) {\n throw new Exception();\n }\n this.S[++top] = x;\n }\n\n public int pop() throws Exception\n {\n if (this.isEmpty()) {\n throw new Exception();\n }\n this.top--;\n return S[this.top + 1];\n }\n\n private boolean isFull()\n {\n return this.top >= this.S.length - 1;\n }\n\n private boolean isEmpty()\n {\n return this.top == 0;\n }\n}",
"Stack",
"public int top = 0;",
"top",
"0",
"public int S[];",
"S",
"public Stack(int n) {\n this.S = new int[n];\n }",
"Stack",
"{\n this.S = new int[n];\n }",
"this.S = new int[n]",
"this.S",
"this",
"this.S",
"new int[n]",
"n",
"int n",
"n",
"public void push(int x) throws Exception\n {\n if (this.isFull()) {\n throw new Exception();\n }\n this.S[++top] = x;\n }",
"push",
"{\n if (this.isFull()) {\n throw new Exception();\n }\n this.S[++top] = x;\n }",
"if (this.isFull()) {\n throw new Exception();\n }",
"this.isFull()",
"this.isFull",
"this",
"{\n throw new Exception();\n }",
"throw new Exception();",
"new Exception()",
"this.S[++top] = x",
"this.S[++top]",
"this.S",
"this",
"this.S",
"++top",
"top",
"x",
"int x",
"x",
"public int pop() throws Exception\n {\n if (this.isEmpty()) {\n throw new Exception();\n }\n this.top--;\n return S[this.top + 1];\n }",
"pop",
"{\n if (this.isEmpty()) {\n throw new Exception();\n }\n this.top--;\n return S[this.top + 1];\n }",
"if (this.isEmpty()) {\n throw new Exception();\n }",
"this.isEmpty()",
"this.isEmpty",
"this",
"{\n throw new Exception();\n }",
"throw new Exception();",
"new Exception()",
"this.top--",
"this.top",
"this",
"this.top",
"return S[this.top + 1];",
"S[this.top + 1]",
"S",
"this.top + 1",
"this.top",
"this",
"this.top",
"1",
"private boolean isFull()\n {\n return this.top >= this.S.length - 1;\n }",
"isFull",
"{\n return this.top >= this.S.length - 1;\n }",
"return this.top >= this.S.length - 1;",
"this.top >= this.S.length - 1",
"this.top",
"this",
"this.top",
"this.S.length - 1",
"this.S.length",
"this.S",
"this",
"this.S",
"this.S.length",
"1",
"private boolean isEmpty()\n {\n return this.top == 0;\n }",
"isEmpty",
"{\n return this.top == 0;\n }",
"return this.top == 0;",
"this.top == 0",
"this.top",
"this",
"this.top",
"0",
"public class Main {\n\tpublic static void main(String args[])\n\t{\n\t Scanner sc = new Scanner(System.in);\n\t String str = sc.nextLine();\n sc.close();\n\n String[] str_arr = str.split(\" \");\n\n\t Stack stack = new Stack(200);\n\n\t int a;\n\t int b;\n\t for (String s : str_arr) {\n try {\n switch (s) {\n case \"+\":\n b = stack.pop();\n a = stack.pop();\n stack.push(a + b);\n break;\n case \"-\":\n b = stack.pop();\n a = stack.pop();\n stack.push(a - b);\n break;\n case \"*\":\n b = stack.pop();\n a = stack.pop();\n stack.push(a * b);\n break;\n default:\n stack.push(Integer.parseInt(s));\n }\n } catch (Exception e) {\n System.out.println(\"error\");\n }\n\t }\n\n try {\n System.out.println(stack.pop());\n } catch (Exception e) {}\n\n\t}\n}",
"public class Main {\n\tpublic static void main(String args[])\n\t{\n\t Scanner sc = new Scanner(System.in);\n\t String str = sc.nextLine();\n sc.close();\n\n String[] str_arr = str.split(\" \");\n\n\t Stack stack = new Stack(200);\n\n\t int a;\n\t int b;\n\t for (String s : str_arr) {\n try {\n switch (s) {\n case \"+\":\n b = stack.pop();\n a = stack.pop();\n stack.push(a + b);\n break;\n case \"-\":\n b = stack.pop();\n a = stack.pop();\n stack.push(a - b);\n break;\n case \"*\":\n b = stack.pop();\n a = stack.pop();\n stack.push(a * b);\n break;\n default:\n stack.push(Integer.parseInt(s));\n }\n } catch (Exception e) {\n System.out.println(\"error\");\n }\n\t }\n\n try {\n System.out.println(stack.pop());\n } catch (Exception e) {}\n\n\t}\n}",
"Main"
] | import java.util.*;
public class Main {
public static void main(String args[])
{
Scanner sc = new Scanner(System.in);
String str = sc.nextLine();
sc.close();
String[] str_arr = str.split(" ");
Stack stack = new Stack(200);
int a;
int b;
for (String s : str_arr) {
try {
switch (s) {
case "+":
b = stack.pop();
a = stack.pop();
stack.push(a + b);
break;
case "-":
b = stack.pop();
a = stack.pop();
stack.push(a - b);
break;
case "*":
b = stack.pop();
a = stack.pop();
stack.push(a * b);
break;
default:
stack.push(Integer.parseInt(s));
}
} catch (Exception e) {
System.out.println("error");
}
}
try {
System.out.println(stack.pop());
} catch (Exception e) {}
}
}
class Stack
{
public int top = 0;
public int S[];
public Stack(int n) {
this.S = new int[n];
}
public void push(int x) throws Exception
{
if (this.isFull()) {
throw new Exception();
}
this.S[++top] = x;
}
public int pop() throws Exception
{
if (this.isEmpty()) {
throw new Exception();
}
this.top--;
return S[this.top + 1];
}
private boolean isFull()
{
return this.top >= this.S.length - 1;
}
private boolean isEmpty()
{
return this.top == 0;
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
41,
13,
20,
0,
13,
4,
18,
13,
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,
2,
2,
40,
17,
4,
18,
13,
4,
18,
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
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
117,
8
],
[
117,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
11,
14
],
[
14,
15
],
[
14,
16
],
[
11,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
11,
22
],
[
22,
23
],
[
22,
24
],
[
11,
25
],
[
25,
26
],
[
25,
27
],
[
11,
28
],
[
28,
29
],
[
29,
30
],
[
30,
31
],
[
28,
32
],
[
32,
33
],
[
33,
34
],
[
33,
35
],
[
35,
36
],
[
36,
37
],
[
32,
38
],
[
38,
39
],
[
39,
40
],
[
40,
41
],
[
39,
42
],
[
38,
43
],
[
43,
44
],
[
44,
45
],
[
44,
46
],
[
46,
47
],
[
47,
48
],
[
48,
49
],
[
46,
50
],
[
50,
51
],
[
51,
52
],
[
43,
53
],
[
53,
54
],
[
54,
55
],
[
53,
56
],
[
38,
57
],
[
57,
58
],
[
58,
59
],
[
59,
60
],
[
58,
61
],
[
57,
62
],
[
62,
63
],
[
63,
64
],
[
63,
65
],
[
65,
66
],
[
66,
67
],
[
67,
68
],
[
66,
69
],
[
69,
70
],
[
70,
71
],
[
65,
72
],
[
72,
73
],
[
73,
74
],
[
62,
75
],
[
75,
76
],
[
76,
77
],
[
75,
78
],
[
57,
79
],
[
79,
80
],
[
80,
81
],
[
81,
82
],
[
80,
83
],
[
79,
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
],
[
79,
98
],
[
98,
99
],
[
99,
100
],
[
100,
101
],
[
99,
102
],
[
102,
103
],
[
103,
104
],
[
102,
105
],
[
11,
106
],
[
106,
107
],
[
107,
108
],
[
108,
109
],
[
108,
110
],
[
106,
111
],
[
111,
112
],
[
112,
113
],
[
9,
114
],
[
114,
115
],
[
0,
116
],
[
116,
117
],
[
116,
118
]
] | [
"import java.io.*;\nimport java.util.*;\n\npublic class Main {\n public static void main(String args[]) {\n String s;\n\n Scanner sc = new Scanner(System.in);\n s = sc.nextLine();\n\n Scanner scn = new Scanner(s);\n\n Stack<Integer> stack = new Stack<Integer>();\n\n while (scn.hasNext()) {\n String op = scn.next();\n if (op.equals(\"+\")) {\n int n = stack.pop() + stack.pop();\n stack.push(n);\n } else if (op.equals(\"-\")) {\n int n = -1 * stack.pop() + stack.pop();\n stack.push(n);\n } else if (op.equals(\"*\")) {\n int n = stack.pop() * stack.pop();\n stack.push(n);\n } else {\n stack.push(Integer.parseInt(op));\n }\n }\n\n System.out.println(stack.pop());\n }\n}",
"import java.io.*;",
"io.*",
"java",
"import java.util.*;",
"util.*",
"java",
"public class Main {\n public static void main(String args[]) {\n String s;\n\n Scanner sc = new Scanner(System.in);\n s = sc.nextLine();\n\n Scanner scn = new Scanner(s);\n\n Stack<Integer> stack = new Stack<Integer>();\n\n while (scn.hasNext()) {\n String op = scn.next();\n if (op.equals(\"+\")) {\n int n = stack.pop() + stack.pop();\n stack.push(n);\n } else if (op.equals(\"-\")) {\n int n = -1 * stack.pop() + stack.pop();\n stack.push(n);\n } else if (op.equals(\"*\")) {\n int n = stack.pop() * stack.pop();\n stack.push(n);\n } else {\n stack.push(Integer.parseInt(op));\n }\n }\n\n System.out.println(stack.pop());\n }\n}",
"Main",
"public static void main(String args[]) {\n String s;\n\n Scanner sc = new Scanner(System.in);\n s = sc.nextLine();\n\n Scanner scn = new Scanner(s);\n\n Stack<Integer> stack = new Stack<Integer>();\n\n while (scn.hasNext()) {\n String op = scn.next();\n if (op.equals(\"+\")) {\n int n = stack.pop() + stack.pop();\n stack.push(n);\n } else if (op.equals(\"-\")) {\n int n = -1 * stack.pop() + stack.pop();\n stack.push(n);\n } else if (op.equals(\"*\")) {\n int n = stack.pop() * stack.pop();\n stack.push(n);\n } else {\n stack.push(Integer.parseInt(op));\n }\n }\n\n System.out.println(stack.pop());\n }",
"main",
"{\n String s;\n\n Scanner sc = new Scanner(System.in);\n s = sc.nextLine();\n\n Scanner scn = new Scanner(s);\n\n Stack<Integer> stack = new Stack<Integer>();\n\n while (scn.hasNext()) {\n String op = scn.next();\n if (op.equals(\"+\")) {\n int n = stack.pop() + stack.pop();\n stack.push(n);\n } else if (op.equals(\"-\")) {\n int n = -1 * stack.pop() + stack.pop();\n stack.push(n);\n } else if (op.equals(\"*\")) {\n int n = stack.pop() * stack.pop();\n stack.push(n);\n } else {\n stack.push(Integer.parseInt(op));\n }\n }\n\n System.out.println(stack.pop());\n }",
"String s;",
"s",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"s = sc.nextLine()",
"s",
"sc.nextLine()",
"sc.nextLine",
"sc",
"Scanner scn = new Scanner(s);",
"scn",
"new Scanner(s)",
"Stack<Integer> stack = new Stack<Integer>();",
"stack",
"new Stack<Integer>()",
"while (scn.hasNext()) {\n String op = scn.next();\n if (op.equals(\"+\")) {\n int n = stack.pop() + stack.pop();\n stack.push(n);\n } else if (op.equals(\"-\")) {\n int n = -1 * stack.pop() + stack.pop();\n stack.push(n);\n } else if (op.equals(\"*\")) {\n int n = stack.pop() * stack.pop();\n stack.push(n);\n } else {\n stack.push(Integer.parseInt(op));\n }\n }",
"scn.hasNext()",
"scn.hasNext",
"scn",
"{\n String op = scn.next();\n if (op.equals(\"+\")) {\n int n = stack.pop() + stack.pop();\n stack.push(n);\n } else if (op.equals(\"-\")) {\n int n = -1 * stack.pop() + stack.pop();\n stack.push(n);\n } else if (op.equals(\"*\")) {\n int n = stack.pop() * stack.pop();\n stack.push(n);\n } else {\n stack.push(Integer.parseInt(op));\n }\n }",
"String op = scn.next();",
"op",
"scn.next()",
"scn.next",
"scn",
"if (op.equals(\"+\")) {\n int n = stack.pop() + stack.pop();\n stack.push(n);\n } else if (op.equals(\"-\")) {\n int n = -1 * stack.pop() + stack.pop();\n stack.push(n);\n } else if (op.equals(\"*\")) {\n int n = stack.pop() * stack.pop();\n stack.push(n);\n } else {\n stack.push(Integer.parseInt(op));\n }",
"op.equals(\"+\")",
"op.equals",
"op",
"\"+\"",
"{\n int n = stack.pop() + stack.pop();\n stack.push(n);\n }",
"int n = stack.pop() + stack.pop();",
"n",
"stack.pop() + stack.pop()",
"stack.pop()",
"stack.pop",
"stack",
"stack.pop()",
"stack.pop",
"stack",
"stack.push(n)",
"stack.push",
"stack",
"n",
"if (op.equals(\"-\")) {\n int n = -1 * stack.pop() + stack.pop();\n stack.push(n);\n } else if (op.equals(\"*\")) {\n int n = stack.pop() * stack.pop();\n stack.push(n);\n } else {\n stack.push(Integer.parseInt(op));\n }",
"op.equals(\"-\")",
"op.equals",
"op",
"\"-\"",
"{\n int n = -1 * stack.pop() + stack.pop();\n stack.push(n);\n }",
"int n = -1 * stack.pop() + stack.pop();",
"n",
"-1 * stack.pop() + stack.pop()",
"-1 * stack.pop()",
"-1",
"1",
"stack.pop()",
"stack.pop",
"stack",
"stack.pop()",
"stack.pop",
"stack",
"stack.push(n)",
"stack.push",
"stack",
"n",
"if (op.equals(\"*\")) {\n int n = stack.pop() * stack.pop();\n stack.push(n);\n } else {\n stack.push(Integer.parseInt(op));\n }",
"op.equals(\"*\")",
"op.equals",
"op",
"\"*\"",
"{\n int n = stack.pop() * stack.pop();\n stack.push(n);\n }",
"int n = stack.pop() * stack.pop();",
"n",
"stack.pop() * stack.pop()",
"stack.pop()",
"stack.pop",
"stack",
"stack.pop()",
"stack.pop",
"stack",
"stack.push(n)",
"stack.push",
"stack",
"n",
"{\n stack.push(Integer.parseInt(op));\n }",
"stack.push(Integer.parseInt(op))",
"stack.push",
"stack",
"Integer.parseInt(op)",
"Integer.parseInt",
"Integer",
"op",
"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 String s;\n\n Scanner sc = new Scanner(System.in);\n s = sc.nextLine();\n\n Scanner scn = new Scanner(s);\n\n Stack<Integer> stack = new Stack<Integer>();\n\n while (scn.hasNext()) {\n String op = scn.next();\n if (op.equals(\"+\")) {\n int n = stack.pop() + stack.pop();\n stack.push(n);\n } else if (op.equals(\"-\")) {\n int n = -1 * stack.pop() + stack.pop();\n stack.push(n);\n } else if (op.equals(\"*\")) {\n int n = stack.pop() * stack.pop();\n stack.push(n);\n } else {\n stack.push(Integer.parseInt(op));\n }\n }\n\n System.out.println(stack.pop());\n }\n}",
"public class Main {\n public static void main(String args[]) {\n String s;\n\n Scanner sc = new Scanner(System.in);\n s = sc.nextLine();\n\n Scanner scn = new Scanner(s);\n\n Stack<Integer> stack = new Stack<Integer>();\n\n while (scn.hasNext()) {\n String op = scn.next();\n if (op.equals(\"+\")) {\n int n = stack.pop() + stack.pop();\n stack.push(n);\n } else if (op.equals(\"-\")) {\n int n = -1 * stack.pop() + stack.pop();\n stack.push(n);\n } else if (op.equals(\"*\")) {\n int n = stack.pop() * stack.pop();\n stack.push(n);\n } else {\n stack.push(Integer.parseInt(op));\n }\n }\n\n System.out.println(stack.pop());\n }\n}",
"Main"
] | import java.io.*;
import java.util.*;
public class Main {
public static void main(String args[]) {
String s;
Scanner sc = new Scanner(System.in);
s = sc.nextLine();
Scanner scn = new Scanner(s);
Stack<Integer> stack = new Stack<Integer>();
while (scn.hasNext()) {
String op = scn.next();
if (op.equals("+")) {
int n = stack.pop() + stack.pop();
stack.push(n);
} else if (op.equals("-")) {
int n = -1 * stack.pop() + stack.pop();
stack.push(n);
} else if (op.equals("*")) {
int n = stack.pop() * stack.pop();
stack.push(n);
} else {
stack.push(Integer.parseInt(op));
}
}
System.out.println(stack.pop());
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
20,
41,
13,
42,
4,
18,
13,
30,
0,
13,
4,
18,
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,
30,
41,
13,
4,
18,
13,
13,
4,
18,
13,
4,
18,
13,
13,
4,
18,
18,
13,
13,
4,
18,
13,
23,
13,
6,
13,
41,
13,
17,
12,
13,
30,
29,
2,
13,
17,
12,
13,
30,
41,
13,
13,
0,
13,
20,
0,
18,
13,
13,
13,
0,
18,
13,
13,
13,
23,
13,
12,
13,
30,
41,
13,
18,
13,
13,
0,
13,
18,
13,
13,
29,
13,
6,
13,
41,
13,
41,
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
],
[
8,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
18,
19
],
[
19,
20
],
[
17,
21
],
[
21,
22
],
[
22,
23
],
[
22,
24
],
[
24,
25
],
[
25,
26
],
[
21,
27
],
[
27,
28
],
[
28,
29
],
[
29,
30
],
[
28,
31
],
[
27,
32
],
[
32,
33
],
[
33,
34
],
[
33,
35
],
[
35,
36
],
[
36,
37
],
[
35,
38
],
[
38,
39
],
[
39,
40
],
[
32,
41
],
[
41,
42
],
[
41,
43
],
[
43,
44
],
[
44,
45
],
[
43,
46
],
[
46,
47
],
[
47,
48
],
[
32,
49
],
[
49,
50
],
[
50,
51
],
[
49,
52
],
[
52,
53
],
[
53,
54
],
[
52,
55
],
[
55,
56
],
[
55,
57
],
[
27,
58
],
[
58,
59
],
[
59,
60
],
[
60,
61
],
[
59,
62
],
[
58,
63
],
[
63,
64
],
[
64,
65
],
[
64,
66
],
[
66,
67
],
[
67,
68
],
[
66,
69
],
[
69,
70
],
[
70,
71
],
[
63,
72
],
[
72,
73
],
[
72,
74
],
[
74,
75
],
[
75,
76
],
[
74,
77
],
[
77,
78
],
[
78,
79
],
[
63,
80
],
[
80,
81
],
[
81,
82
],
[
80,
83
],
[
83,
84
],
[
84,
85
],
[
83,
86
],
[
86,
87
],
[
86,
88
],
[
58,
89
],
[
89,
90
],
[
90,
91
],
[
91,
92
],
[
90,
93
],
[
89,
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
],
[
89,
120
],
[
120,
121
],
[
121,
122
],
[
121,
123
],
[
123,
124
],
[
124,
125
],
[
123,
126
],
[
120,
127
],
[
127,
128
],
[
128,
129
],
[
127,
130
],
[
130,
131
],
[
131,
132
],
[
130,
133
],
[
8,
134
],
[
134,
135
],
[
135,
136
],
[
136,
137
],
[
136,
138
],
[
134,
139
],
[
139,
140
],
[
140,
141
],
[
6,
142
],
[
142,
143
],
[
0,
144
],
[
144,
145
],
[
144,
146
],
[
146,
147
],
[
146,
148
],
[
144,
149
],
[
149,
150
],
[
149,
151
],
[
151,
152
],
[
152,
153
],
[
153,
154
],
[
153,
155
],
[
144,
156
],
[
156,
157
],
[
156,
158
],
[
158,
159
],
[
159,
160
],
[
159,
161
],
[
158,
162
],
[
162,
163
],
[
162,
164
],
[
158,
165
],
[
165,
166
],
[
166,
167
],
[
166,
168
],
[
165,
169
],
[
158,
170
],
[
170,
171
],
[
171,
172
],
[
171,
173
],
[
170,
174
],
[
156,
175
],
[
175,
176
],
[
144,
177
],
[
177,
178
],
[
177,
179
],
[
179,
180
],
[
180,
181
],
[
180,
182
],
[
182,
183
],
[
182,
184
],
[
179,
185
],
[
185,
186
],
[
185,
187
],
[
187,
188
],
[
187,
189
],
[
179,
190
],
[
190,
191
],
[
144,
192
],
[
192,
193
],
[
192,
194
],
[
194,
195
],
[
192,
196
],
[
196,
197
]
] | [
"import java.util.Scanner;\n\nclass Main {\n public static void main(String[] args) {\n Scanner in = new Scanner(System.in);\n Stack<String> stack = new Stack<String>();\n String s;\n \n while (in.hasNext()) {\n s = in.next();\n if (s.equals(\"+\")) {\n int x = Integer.parseInt(stack.pop());\n int y = Integer.parseInt(stack.pop());\n stack.push(Integer.toString(y + x));\n }\n else if (s.equals(\"-\")) {\n int x = Integer.parseInt(stack.pop());\n int y = Integer.parseInt(stack.pop());\n stack.push(Integer.toString(y - x));\n }\n else if (s.equals(\"*\")) {\n int x = Integer.parseInt(stack.pop());\n int y = Integer.parseInt(stack.pop());\n stack.push(Integer.toString(y * x));\n }\n else {\n int num = Integer.parseInt(s);\n stack.push(Integer.toString(num));\n }\n }\n System.out.println(stack.pop());\n }\n}\n\nclass Stack<Item> {\n private Node first = null;\n \n private class Node {\n Item item;\n Node next;\n }\n \n public boolean isEmpty() { return first == null; }\n \n public void push(Item item) {\n Node oldfirst = first;\n first = new Node();\n first.item = item;\n first.next = oldfirst;\n }\n \n public Item pop() {\n Item item = first.item;\n first = first.next;\n return item;\n }\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"class Main {\n public static void main(String[] args) {\n Scanner in = new Scanner(System.in);\n Stack<String> stack = new Stack<String>();\n String s;\n \n while (in.hasNext()) {\n s = in.next();\n if (s.equals(\"+\")) {\n int x = Integer.parseInt(stack.pop());\n int y = Integer.parseInt(stack.pop());\n stack.push(Integer.toString(y + x));\n }\n else if (s.equals(\"-\")) {\n int x = Integer.parseInt(stack.pop());\n int y = Integer.parseInt(stack.pop());\n stack.push(Integer.toString(y - x));\n }\n else if (s.equals(\"*\")) {\n int x = Integer.parseInt(stack.pop());\n int y = Integer.parseInt(stack.pop());\n stack.push(Integer.toString(y * x));\n }\n else {\n int num = Integer.parseInt(s);\n stack.push(Integer.toString(num));\n }\n }\n System.out.println(stack.pop());\n }\n}",
"Main",
"public static void main(String[] args) {\n Scanner in = new Scanner(System.in);\n Stack<String> stack = new Stack<String>();\n String s;\n \n while (in.hasNext()) {\n s = in.next();\n if (s.equals(\"+\")) {\n int x = Integer.parseInt(stack.pop());\n int y = Integer.parseInt(stack.pop());\n stack.push(Integer.toString(y + x));\n }\n else if (s.equals(\"-\")) {\n int x = Integer.parseInt(stack.pop());\n int y = Integer.parseInt(stack.pop());\n stack.push(Integer.toString(y - x));\n }\n else if (s.equals(\"*\")) {\n int x = Integer.parseInt(stack.pop());\n int y = Integer.parseInt(stack.pop());\n stack.push(Integer.toString(y * x));\n }\n else {\n int num = Integer.parseInt(s);\n stack.push(Integer.toString(num));\n }\n }\n System.out.println(stack.pop());\n }",
"main",
"{\n Scanner in = new Scanner(System.in);\n Stack<String> stack = new Stack<String>();\n String s;\n \n while (in.hasNext()) {\n s = in.next();\n if (s.equals(\"+\")) {\n int x = Integer.parseInt(stack.pop());\n int y = Integer.parseInt(stack.pop());\n stack.push(Integer.toString(y + x));\n }\n else if (s.equals(\"-\")) {\n int x = Integer.parseInt(stack.pop());\n int y = Integer.parseInt(stack.pop());\n stack.push(Integer.toString(y - x));\n }\n else if (s.equals(\"*\")) {\n int x = Integer.parseInt(stack.pop());\n int y = Integer.parseInt(stack.pop());\n stack.push(Integer.toString(y * x));\n }\n else {\n int num = Integer.parseInt(s);\n stack.push(Integer.toString(num));\n }\n }\n System.out.println(stack.pop());\n }",
"Scanner in = new Scanner(System.in);",
"in",
"new Scanner(System.in)",
"Stack<String> stack = new Stack<String>();",
"stack",
"new Stack<String>()",
"String s;",
"s",
"while (in.hasNext()) {\n s = in.next();\n if (s.equals(\"+\")) {\n int x = Integer.parseInt(stack.pop());\n int y = Integer.parseInt(stack.pop());\n stack.push(Integer.toString(y + x));\n }\n else if (s.equals(\"-\")) {\n int x = Integer.parseInt(stack.pop());\n int y = Integer.parseInt(stack.pop());\n stack.push(Integer.toString(y - x));\n }\n else if (s.equals(\"*\")) {\n int x = Integer.parseInt(stack.pop());\n int y = Integer.parseInt(stack.pop());\n stack.push(Integer.toString(y * x));\n }\n else {\n int num = Integer.parseInt(s);\n stack.push(Integer.toString(num));\n }\n }",
"in.hasNext()",
"in.hasNext",
"in",
"{\n s = in.next();\n if (s.equals(\"+\")) {\n int x = Integer.parseInt(stack.pop());\n int y = Integer.parseInt(stack.pop());\n stack.push(Integer.toString(y + x));\n }\n else if (s.equals(\"-\")) {\n int x = Integer.parseInt(stack.pop());\n int y = Integer.parseInt(stack.pop());\n stack.push(Integer.toString(y - x));\n }\n else if (s.equals(\"*\")) {\n int x = Integer.parseInt(stack.pop());\n int y = Integer.parseInt(stack.pop());\n stack.push(Integer.toString(y * x));\n }\n else {\n int num = Integer.parseInt(s);\n stack.push(Integer.toString(num));\n }\n }",
"s = in.next()",
"s",
"in.next()",
"in.next",
"in",
"if (s.equals(\"+\")) {\n int x = Integer.parseInt(stack.pop());\n int y = Integer.parseInt(stack.pop());\n stack.push(Integer.toString(y + x));\n }\n else if (s.equals(\"-\")) {\n int x = Integer.parseInt(stack.pop());\n int y = Integer.parseInt(stack.pop());\n stack.push(Integer.toString(y - x));\n }\n else if (s.equals(\"*\")) {\n int x = Integer.parseInt(stack.pop());\n int y = Integer.parseInt(stack.pop());\n stack.push(Integer.toString(y * x));\n }\n else {\n int num = Integer.parseInt(s);\n stack.push(Integer.toString(num));\n }",
"s.equals(\"+\")",
"s.equals",
"s",
"\"+\"",
"{\n int x = Integer.parseInt(stack.pop());\n int y = Integer.parseInt(stack.pop());\n stack.push(Integer.toString(y + x));\n }",
"int x = Integer.parseInt(stack.pop());",
"x",
"Integer.parseInt(stack.pop())",
"Integer.parseInt",
"Integer",
"stack.pop()",
"stack.pop",
"stack",
"int y = Integer.parseInt(stack.pop());",
"y",
"Integer.parseInt(stack.pop())",
"Integer.parseInt",
"Integer",
"stack.pop()",
"stack.pop",
"stack",
"stack.push(Integer.toString(y + x))",
"stack.push",
"stack",
"Integer.toString(y + x)",
"Integer.toString",
"Integer",
"y + x",
"y",
"x",
"if (s.equals(\"-\")) {\n int x = Integer.parseInt(stack.pop());\n int y = Integer.parseInt(stack.pop());\n stack.push(Integer.toString(y - x));\n }\n else if (s.equals(\"*\")) {\n int x = Integer.parseInt(stack.pop());\n int y = Integer.parseInt(stack.pop());\n stack.push(Integer.toString(y * x));\n }\n else {\n int num = Integer.parseInt(s);\n stack.push(Integer.toString(num));\n }",
"s.equals(\"-\")",
"s.equals",
"s",
"\"-\"",
"{\n int x = Integer.parseInt(stack.pop());\n int y = Integer.parseInt(stack.pop());\n stack.push(Integer.toString(y - x));\n }",
"int x = Integer.parseInt(stack.pop());",
"x",
"Integer.parseInt(stack.pop())",
"Integer.parseInt",
"Integer",
"stack.pop()",
"stack.pop",
"stack",
"int y = Integer.parseInt(stack.pop());",
"y",
"Integer.parseInt(stack.pop())",
"Integer.parseInt",
"Integer",
"stack.pop()",
"stack.pop",
"stack",
"stack.push(Integer.toString(y - x))",
"stack.push",
"stack",
"Integer.toString(y - x)",
"Integer.toString",
"Integer",
"y - x",
"y",
"x",
"if (s.equals(\"*\")) {\n int x = Integer.parseInt(stack.pop());\n int y = Integer.parseInt(stack.pop());\n stack.push(Integer.toString(y * x));\n }\n else {\n int num = Integer.parseInt(s);\n stack.push(Integer.toString(num));\n }",
"s.equals(\"*\")",
"s.equals",
"s",
"\"*\"",
"{\n int x = Integer.parseInt(stack.pop());\n int y = Integer.parseInt(stack.pop());\n stack.push(Integer.toString(y * x));\n }",
"int x = Integer.parseInt(stack.pop());",
"x",
"Integer.parseInt(stack.pop())",
"Integer.parseInt",
"Integer",
"stack.pop()",
"stack.pop",
"stack",
"int y = Integer.parseInt(stack.pop());",
"y",
"Integer.parseInt(stack.pop())",
"Integer.parseInt",
"Integer",
"stack.pop()",
"stack.pop",
"stack",
"stack.push(Integer.toString(y * x))",
"stack.push",
"stack",
"Integer.toString(y * x)",
"Integer.toString",
"Integer",
"y * x",
"y",
"x",
"{\n int num = Integer.parseInt(s);\n stack.push(Integer.toString(num));\n }",
"int num = Integer.parseInt(s);",
"num",
"Integer.parseInt(s)",
"Integer.parseInt",
"Integer",
"s",
"stack.push(Integer.toString(num))",
"stack.push",
"stack",
"Integer.toString(num)",
"Integer.toString",
"Integer",
"num",
"System.out.println(stack.pop())",
"System.out.println",
"System.out",
"System",
"System.out",
"stack.pop()",
"stack.pop",
"stack",
"String[] args",
"args",
"class Stack<Item> {\n private Node first = null;\n \n private class Node {\n Item item;\n Node next;\n }\n \n public boolean isEmpty() { return first == null; }\n \n public void push(Item item) {\n Node oldfirst = first;\n first = new Node();\n first.item = item;\n first.next = oldfirst;\n }\n \n public Item pop() {\n Item item = first.item;\n first = first.next;\n return item;\n }\n}",
"Stack",
"private Node first = null;",
"first",
"null",
"public boolean isEmpty() { return first == null; }",
"isEmpty",
"{ return first == null; }",
"return first == null;",
"first == null",
"first",
"null",
"public void push(Item item) {\n Node oldfirst = first;\n first = new Node();\n first.item = item;\n first.next = oldfirst;\n }",
"push",
"{\n Node oldfirst = first;\n first = new Node();\n first.item = item;\n first.next = oldfirst;\n }",
"Node oldfirst = first;",
"oldfirst",
"first",
"first = new Node()",
"first",
"new Node()",
"first.item = item",
"first.item",
"first",
"first.item",
"item",
"first.next = oldfirst",
"first.next",
"first",
"first.next",
"oldfirst",
"Item item",
"item",
"public Item pop() {\n Item item = first.item;\n first = first.next;\n return item;\n }",
"pop",
"{\n Item item = first.item;\n first = first.next;\n return item;\n }",
"Item item = first.item;",
"item",
"first.item",
"first",
"first.item",
"first = first.next",
"first",
"first.next",
"first",
"first.next",
"return item;",
"item",
"private class Node {\n Item item;\n Node next;\n }",
"Node",
"Item item;",
"item",
"Node next;",
"next"
] | import java.util.Scanner;
class Main {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
Stack<String> stack = new Stack<String>();
String s;
while (in.hasNext()) {
s = in.next();
if (s.equals("+")) {
int x = Integer.parseInt(stack.pop());
int y = Integer.parseInt(stack.pop());
stack.push(Integer.toString(y + x));
}
else if (s.equals("-")) {
int x = Integer.parseInt(stack.pop());
int y = Integer.parseInt(stack.pop());
stack.push(Integer.toString(y - x));
}
else if (s.equals("*")) {
int x = Integer.parseInt(stack.pop());
int y = Integer.parseInt(stack.pop());
stack.push(Integer.toString(y * x));
}
else {
int num = Integer.parseInt(s);
stack.push(Integer.toString(num));
}
}
System.out.println(stack.pop());
}
}
class Stack<Item> {
private Node first = null;
private class Node {
Item item;
Node next;
}
public boolean isEmpty() { return first == null; }
public void push(Item item) {
Node oldfirst = first;
first = new Node();
first.item = item;
first.next = oldfirst;
}
public Item pop() {
Item item = first.item;
first = first.next;
return item;
}
} |
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
4,
18,
13,
41,
13,
17,
14,
2,
2,
18,
13,
17,
17,
2,
4,
18,
13,
17,
0,
13,
17,
28,
13,
13,
30,
30,
14,
40,
4,
18,
13,
13,
30,
40,
13,
14,
2,
13,
17,
29,
17,
29,
17,
23,
13,
12,
13,
30,
14,
4,
13,
13,
29,
4,
18,
13,
13,
30,
29,
40,
17,
23,
13,
12,
13,
30,
14,
4,
18,
13,
17,
29,
2,
4,
13,
13,
4,
13,
13,
14,
4,
18,
13,
17,
29,
2,
4,
13,
13,
4,
13,
13,
14,
4,
18,
13,
17,
29,
2,
4,
13,
13,
4,
13,
13,
14,
4,
18,
13,
17,
29,
2,
4,
13,
13,
4,
13,
13,
29,
40,
17,
23,
13,
23,
13,
23,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
4,
18,
13,
17,
41,
13,
20,
28,
13,
13,
30,
30,
14,
4,
13,
13,
4,
18,
13,
13,
30,
41,
13,
13,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
4,
13,
13,
13,
13,
4,
18,
13,
13,
4,
18,
18,
13,
13,
4,
18,
13,
29,
17,
23,
13,
12,
13,
30,
4,
13,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
220,
8
],
[
220,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
11,
17
],
[
17,
18
],
[
17,
19
],
[
11,
20
],
[
20,
21
],
[
21,
22
],
[
22,
23
],
[
23,
24
],
[
23,
25
],
[
22,
26
],
[
21,
27
],
[
27,
28
],
[
28,
29
],
[
29,
30
],
[
27,
31
],
[
20,
32
],
[
32,
33
],
[
32,
34
],
[
11,
35
],
[
35,
36
],
[
35,
37
],
[
35,
38
],
[
39,
39
],
[
39,
40
],
[
40,
41
],
[
41,
42
],
[
42,
43
],
[
43,
44
],
[
42,
45
],
[
40,
46
],
[
46,
47
],
[
47,
48
],
[
39,
49
],
[
49,
50
],
[
50,
51
],
[
50,
52
],
[
49,
53
],
[
53,
54
],
[
11,
55
],
[
55,
56
],
[
9,
57
],
[
57,
58
],
[
220,
59
],
[
59,
60
],
[
59,
61
],
[
61,
62
],
[
62,
63
],
[
63,
64
],
[
63,
65
],
[
62,
66
],
[
66,
67
],
[
67,
68
],
[
68,
69
],
[
67,
70
],
[
62,
71
],
[
71,
72
],
[
72,
73
],
[
73,
74
],
[
59,
75
],
[
75,
76
],
[
220,
77
],
[
77,
78
],
[
77,
79
],
[
79,
80
],
[
80,
81
],
[
81,
82
],
[
82,
83
],
[
81,
84
],
[
80,
85
],
[
85,
86
],
[
86,
87
],
[
87,
88
],
[
87,
89
],
[
86,
90
],
[
90,
91
],
[
90,
92
],
[
79,
93
],
[
93,
94
],
[
94,
95
],
[
95,
96
],
[
94,
97
],
[
93,
98
],
[
98,
99
],
[
99,
100
],
[
100,
101
],
[
100,
102
],
[
99,
103
],
[
103,
104
],
[
103,
105
],
[
79,
106
],
[
106,
107
],
[
107,
108
],
[
108,
109
],
[
107,
110
],
[
106,
111
],
[
111,
112
],
[
112,
113
],
[
113,
114
],
[
113,
115
],
[
112,
116
],
[
116,
117
],
[
116,
118
],
[
79,
119
],
[
119,
120
],
[
120,
121
],
[
121,
122
],
[
120,
123
],
[
119,
124
],
[
124,
125
],
[
125,
126
],
[
126,
127
],
[
126,
128
],
[
125,
129
],
[
129,
130
],
[
129,
131
],
[
79,
132
],
[
132,
133
],
[
133,
134
],
[
77,
135
],
[
135,
136
],
[
77,
137
],
[
137,
138
],
[
77,
139
],
[
139,
140
],
[
220,
141
],
[
141,
142
],
[
141,
143
],
[
143,
144
],
[
144,
145
],
[
144,
146
],
[
143,
147
],
[
147,
148
],
[
147,
149
],
[
149,
150
],
[
150,
151
],
[
151,
152
],
[
152,
153
],
[
149,
154
],
[
143,
155
],
[
155,
156
],
[
155,
157
],
[
143,
158
],
[
158,
159
],
[
158,
160
],
[
158,
161
],
[
162,
162
],
[
162,
163
],
[
163,
164
],
[
164,
165
],
[
164,
166
],
[
163,
167
],
[
167,
168
],
[
168,
169
],
[
167,
170
],
[
163,
171
],
[
171,
172
],
[
172,
173
],
[
172,
174
],
[
171,
175
],
[
175,
176
],
[
175,
177
],
[
177,
178
],
[
178,
179
],
[
171,
180
],
[
180,
181
],
[
180,
182
],
[
182,
183
],
[
183,
184
],
[
171,
185
],
[
185,
186
],
[
185,
187
],
[
187,
188
],
[
188,
189
],
[
187,
190
],
[
190,
191
],
[
190,
192
],
[
190,
193
],
[
190,
194
],
[
171,
195
],
[
195,
196
],
[
196,
197
],
[
195,
198
],
[
143,
199
],
[
199,
200
],
[
200,
201
],
[
201,
202
],
[
201,
203
],
[
199,
204
],
[
204,
205
],
[
205,
206
],
[
143,
207
],
[
207,
208
],
[
141,
209
],
[
209,
210
],
[
220,
211
],
[
211,
212
],
[
211,
213
],
[
213,
214
],
[
214,
215
],
[
214,
216
],
[
211,
217
],
[
217,
218
],
[
0,
219
],
[
219,
220
],
[
219,
221
]
] | [
"import java.util.Scanner;\nimport java.util.Stack;\n\n/**\n * Created by ??\\??? on 2016/12/6.\n */\npublic class Main {\n static boolean isNum(String s){\n char[] array = s.toCharArray();\n int flag = 0;\n if(array[0]=='-'&&s.length()>1)\n flag = 1;\n for (char c : array) {\n if(!Character.isDigit(c)){\n flag--;\n }\n if(flag<0)\n return false;\n }\n return true;\n }\n static int si(String s){\n if(isNum(s))\n return Integer.parseInt(s);\n else {\n return -1000000010;\n }\n }\n static int count(String s,String a,String b){\n if(s.equals(\"+\"))\n return si(a)+si(b);\n if(s.equals(\"-\"))\n return si(b)-si(a);\n if(s.equals(\"*\"))\n return si(a)*si(b);\n if(s.equals(\"/\"))\n return si(b)/si(a);\n return -1000000020;\n }\n static int run(String[] args){\n Scanner scan = new Scanner(System.in);\n String[] lines = scan.nextLine().split(\" \");\n Stack<String> vs = new Stack<>();\n //Stack<String> os = new Stack<>();\n for (String s:lines) {\n if(isNum(s))\n vs.push(s);\n else{\n String o = s;\n String a = vs.pop();\n String b = vs.pop();\n String c = String.valueOf(count(o,a,b));\n //System.out.println(a+\" \"+b+\" \"+c);\n vs.push(c);\n }\n }\n System.out.println(vs.pop());\n return 0;\n }\n public static void main(String[] args){\n run(args);\n //System.out.println(Integer.parseInt(\"-1\"));\n }\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"import java.util.Stack;",
"Stack",
"java.util",
"public class Main {\n static boolean isNum(String s){\n char[] array = s.toCharArray();\n int flag = 0;\n if(array[0]=='-'&&s.length()>1)\n flag = 1;\n for (char c : array) {\n if(!Character.isDigit(c)){\n flag--;\n }\n if(flag<0)\n return false;\n }\n return true;\n }\n static int si(String s){\n if(isNum(s))\n return Integer.parseInt(s);\n else {\n return -1000000010;\n }\n }\n static int count(String s,String a,String b){\n if(s.equals(\"+\"))\n return si(a)+si(b);\n if(s.equals(\"-\"))\n return si(b)-si(a);\n if(s.equals(\"*\"))\n return si(a)*si(b);\n if(s.equals(\"/\"))\n return si(b)/si(a);\n return -1000000020;\n }\n static int run(String[] args){\n Scanner scan = new Scanner(System.in);\n String[] lines = scan.nextLine().split(\" \");\n Stack<String> vs = new Stack<>();\n //Stack<String> os = new Stack<>();\n for (String s:lines) {\n if(isNum(s))\n vs.push(s);\n else{\n String o = s;\n String a = vs.pop();\n String b = vs.pop();\n String c = String.valueOf(count(o,a,b));\n //System.out.println(a+\" \"+b+\" \"+c);\n vs.push(c);\n }\n }\n System.out.println(vs.pop());\n return 0;\n }\n public static void main(String[] args){\n run(args);\n //System.out.println(Integer.parseInt(\"-1\"));\n }\n}",
"Main",
"static boolean isNum(String s){\n char[] array = s.toCharArray();\n int flag = 0;\n if(array[0]=='-'&&s.length()>1)\n flag = 1;\n for (char c : array) {\n if(!Character.isDigit(c)){\n flag--;\n }\n if(flag<0)\n return false;\n }\n return true;\n }",
"isNum",
"{\n char[] array = s.toCharArray();\n int flag = 0;\n if(array[0]=='-'&&s.length()>1)\n flag = 1;\n for (char c : array) {\n if(!Character.isDigit(c)){\n flag--;\n }\n if(flag<0)\n return false;\n }\n return true;\n }",
"char[] array = s.toCharArray();",
"array",
"s.toCharArray()",
"s.toCharArray",
"s",
"int flag = 0;",
"flag",
"0",
"if(array[0]=='-'&&s.length()>1)\n flag = 1;",
"array[0]=='-'&&s.length()>1",
"array[0]=='-'",
"array[0]",
"array",
"0",
"'-'",
"s.length()>1",
"s.length()",
"s.length",
"s",
"1",
"flag = 1",
"flag",
"1",
"for (char c : array) {\n if(!Character.isDigit(c)){\n flag--;\n }\n if(flag<0)\n return false;\n }",
"char c",
"array",
"{\n if(!Character.isDigit(c)){\n flag--;\n }\n if(flag<0)\n return false;\n }",
"{\n if(!Character.isDigit(c)){\n flag--;\n }\n if(flag<0)\n return false;\n }",
"if(!Character.isDigit(c)){\n flag--;\n }",
"!Character.isDigit(c)",
"Character.isDigit(c)",
"Character.isDigit",
"Character",
"c",
"{\n flag--;\n }",
"flag--",
"flag",
"if(flag<0)\n return false;",
"flag<0",
"flag",
"0",
"return false;",
"false",
"return true;",
"true",
"String s",
"s",
"static int si(String s){\n if(isNum(s))\n return Integer.parseInt(s);\n else {\n return -1000000010;\n }\n }",
"si",
"{\n if(isNum(s))\n return Integer.parseInt(s);\n else {\n return -1000000010;\n }\n }",
"if(isNum(s))\n return Integer.parseInt(s);\n else {\n return -1000000010;\n }",
"isNum(s)",
"isNum",
"s",
"return Integer.parseInt(s);",
"Integer.parseInt(s)",
"Integer.parseInt",
"Integer",
"s",
"{\n return -1000000010;\n }",
"return -1000000010;",
"-1000000010",
"1000000010",
"String s",
"s",
"static int count(String s,String a,String b){\n if(s.equals(\"+\"))\n return si(a)+si(b);\n if(s.equals(\"-\"))\n return si(b)-si(a);\n if(s.equals(\"*\"))\n return si(a)*si(b);\n if(s.equals(\"/\"))\n return si(b)/si(a);\n return -1000000020;\n }",
"count",
"{\n if(s.equals(\"+\"))\n return si(a)+si(b);\n if(s.equals(\"-\"))\n return si(b)-si(a);\n if(s.equals(\"*\"))\n return si(a)*si(b);\n if(s.equals(\"/\"))\n return si(b)/si(a);\n return -1000000020;\n }",
"if(s.equals(\"+\"))\n return si(a)+si(b);",
"s.equals(\"+\")",
"s.equals",
"s",
"\"+\"",
"return si(a)+si(b);",
"si(a)+si(b)",
"si(a)",
"si",
"a",
"si(b)",
"si",
"b",
"if(s.equals(\"-\"))\n return si(b)-si(a);",
"s.equals(\"-\")",
"s.equals",
"s",
"\"-\"",
"return si(b)-si(a);",
"si(b)-si(a)",
"si(b)",
"si",
"b",
"si(a)",
"si",
"a",
"if(s.equals(\"*\"))\n return si(a)*si(b);",
"s.equals(\"*\")",
"s.equals",
"s",
"\"*\"",
"return si(a)*si(b);",
"si(a)*si(b)",
"si(a)",
"si",
"a",
"si(b)",
"si",
"b",
"if(s.equals(\"/\"))\n return si(b)/si(a);",
"s.equals(\"/\")",
"s.equals",
"s",
"\"/\"",
"return si(b)/si(a);",
"si(b)/si(a)",
"si(b)",
"si",
"b",
"si(a)",
"si",
"a",
"return -1000000020;",
"-1000000020",
"1000000020",
"String s",
"s",
"String a",
"a",
"String b",
"b",
"static int run(String[] args){\n Scanner scan = new Scanner(System.in);\n String[] lines = scan.nextLine().split(\" \");\n Stack<String> vs = new Stack<>();\n //Stack<String> os = new Stack<>();\n for (String s:lines) {\n if(isNum(s))\n vs.push(s);\n else{\n String o = s;\n String a = vs.pop();\n String b = vs.pop();\n String c = String.valueOf(count(o,a,b));\n //System.out.println(a+\" \"+b+\" \"+c);\n vs.push(c);\n }\n }\n System.out.println(vs.pop());\n return 0;\n }",
"run",
"{\n Scanner scan = new Scanner(System.in);\n String[] lines = scan.nextLine().split(\" \");\n Stack<String> vs = new Stack<>();\n //Stack<String> os = new Stack<>();\n for (String s:lines) {\n if(isNum(s))\n vs.push(s);\n else{\n String o = s;\n String a = vs.pop();\n String b = vs.pop();\n String c = String.valueOf(count(o,a,b));\n //System.out.println(a+\" \"+b+\" \"+c);\n vs.push(c);\n }\n }\n System.out.println(vs.pop());\n return 0;\n }",
"Scanner scan = new Scanner(System.in);",
"scan",
"new Scanner(System.in)",
"String[] lines = scan.nextLine().split(\" \");",
"lines",
"scan.nextLine().split(\" \")",
"scan.nextLine().split",
"scan.nextLine()",
"scan.nextLine",
"scan",
"\" \"",
"Stack<String> vs = new Stack<>();",
"vs",
"new Stack<>()",
"for (String s:lines) {\n if(isNum(s))\n vs.push(s);\n else{\n String o = s;\n String a = vs.pop();\n String b = vs.pop();\n String c = String.valueOf(count(o,a,b));\n //System.out.println(a+\" \"+b+\" \"+c);\n vs.push(c);\n }\n }",
"String s",
"lines",
"{\n if(isNum(s))\n vs.push(s);\n else{\n String o = s;\n String a = vs.pop();\n String b = vs.pop();\n String c = String.valueOf(count(o,a,b));\n //System.out.println(a+\" \"+b+\" \"+c);\n vs.push(c);\n }\n }",
"{\n if(isNum(s))\n vs.push(s);\n else{\n String o = s;\n String a = vs.pop();\n String b = vs.pop();\n String c = String.valueOf(count(o,a,b));\n //System.out.println(a+\" \"+b+\" \"+c);\n vs.push(c);\n }\n }",
"if(isNum(s))\n vs.push(s);\n else{\n String o = s;\n String a = vs.pop();\n String b = vs.pop();\n String c = String.valueOf(count(o,a,b));\n //System.out.println(a+\" \"+b+\" \"+c);\n vs.push(c);\n }",
"isNum(s)",
"isNum",
"s",
"vs.push(s)",
"vs.push",
"vs",
"s",
"{\n String o = s;\n String a = vs.pop();\n String b = vs.pop();\n String c = String.valueOf(count(o,a,b));\n //System.out.println(a+\" \"+b+\" \"+c);\n vs.push(c);\n }",
"String o = s;",
"o",
"s",
"String a = vs.pop();",
"a",
"vs.pop()",
"vs.pop",
"vs",
"String b = vs.pop();",
"b",
"vs.pop()",
"vs.pop",
"vs",
"String c = String.valueOf(count(o,a,b));",
"c",
"String.valueOf(count(o,a,b))",
"String.valueOf",
"String",
"count(o,a,b)",
"count",
"o",
"a",
"b",
"vs.push(c)",
"vs.push",
"vs",
"c",
"System.out.println(vs.pop())",
"System.out.println",
"System.out",
"System",
"System.out",
"vs.pop()",
"vs.pop",
"vs",
"return 0;",
"0",
"String[] args",
"args",
"public static void main(String[] args){\n run(args);\n //System.out.println(Integer.parseInt(\"-1\"));\n }",
"main",
"{\n run(args);\n //System.out.println(Integer.parseInt(\"-1\"));\n }",
"run(args)",
"run",
"args",
"String[] args",
"args",
"public class Main {\n static boolean isNum(String s){\n char[] array = s.toCharArray();\n int flag = 0;\n if(array[0]=='-'&&s.length()>1)\n flag = 1;\n for (char c : array) {\n if(!Character.isDigit(c)){\n flag--;\n }\n if(flag<0)\n return false;\n }\n return true;\n }\n static int si(String s){\n if(isNum(s))\n return Integer.parseInt(s);\n else {\n return -1000000010;\n }\n }\n static int count(String s,String a,String b){\n if(s.equals(\"+\"))\n return si(a)+si(b);\n if(s.equals(\"-\"))\n return si(b)-si(a);\n if(s.equals(\"*\"))\n return si(a)*si(b);\n if(s.equals(\"/\"))\n return si(b)/si(a);\n return -1000000020;\n }\n static int run(String[] args){\n Scanner scan = new Scanner(System.in);\n String[] lines = scan.nextLine().split(\" \");\n Stack<String> vs = new Stack<>();\n //Stack<String> os = new Stack<>();\n for (String s:lines) {\n if(isNum(s))\n vs.push(s);\n else{\n String o = s;\n String a = vs.pop();\n String b = vs.pop();\n String c = String.valueOf(count(o,a,b));\n //System.out.println(a+\" \"+b+\" \"+c);\n vs.push(c);\n }\n }\n System.out.println(vs.pop());\n return 0;\n }\n public static void main(String[] args){\n run(args);\n //System.out.println(Integer.parseInt(\"-1\"));\n }\n}",
"public class Main {\n static boolean isNum(String s){\n char[] array = s.toCharArray();\n int flag = 0;\n if(array[0]=='-'&&s.length()>1)\n flag = 1;\n for (char c : array) {\n if(!Character.isDigit(c)){\n flag--;\n }\n if(flag<0)\n return false;\n }\n return true;\n }\n static int si(String s){\n if(isNum(s))\n return Integer.parseInt(s);\n else {\n return -1000000010;\n }\n }\n static int count(String s,String a,String b){\n if(s.equals(\"+\"))\n return si(a)+si(b);\n if(s.equals(\"-\"))\n return si(b)-si(a);\n if(s.equals(\"*\"))\n return si(a)*si(b);\n if(s.equals(\"/\"))\n return si(b)/si(a);\n return -1000000020;\n }\n static int run(String[] args){\n Scanner scan = new Scanner(System.in);\n String[] lines = scan.nextLine().split(\" \");\n Stack<String> vs = new Stack<>();\n //Stack<String> os = new Stack<>();\n for (String s:lines) {\n if(isNum(s))\n vs.push(s);\n else{\n String o = s;\n String a = vs.pop();\n String b = vs.pop();\n String c = String.valueOf(count(o,a,b));\n //System.out.println(a+\" \"+b+\" \"+c);\n vs.push(c);\n }\n }\n System.out.println(vs.pop());\n return 0;\n }\n public static void main(String[] args){\n run(args);\n //System.out.println(Integer.parseInt(\"-1\"));\n }\n}",
"Main"
] | import java.util.Scanner;
import java.util.Stack;
/**
* Created by ??\??? on 2016/12/6.
*/
public class Main {
static boolean isNum(String s){
char[] array = s.toCharArray();
int flag = 0;
if(array[0]=='-'&&s.length()>1)
flag = 1;
for (char c : array) {
if(!Character.isDigit(c)){
flag--;
}
if(flag<0)
return false;
}
return true;
}
static int si(String s){
if(isNum(s))
return Integer.parseInt(s);
else {
return -1000000010;
}
}
static int count(String s,String a,String b){
if(s.equals("+"))
return si(a)+si(b);
if(s.equals("-"))
return si(b)-si(a);
if(s.equals("*"))
return si(a)*si(b);
if(s.equals("/"))
return si(b)/si(a);
return -1000000020;
}
static int run(String[] args){
Scanner scan = new Scanner(System.in);
String[] lines = scan.nextLine().split(" ");
Stack<String> vs = new Stack<>();
//Stack<String> os = new Stack<>();
for (String s:lines) {
if(isNum(s))
vs.push(s);
else{
String o = s;
String a = vs.pop();
String b = vs.pop();
String c = String.valueOf(count(o,a,b));
//System.out.println(a+" "+b+" "+c);
vs.push(c);
}
}
System.out.println(vs.pop());
return 0;
}
public static void main(String[] args){
run(args);
//System.out.println(Integer.parseInt("-1"));
}
} |
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
20,
4,
18,
13,
41,
13,
20,
28,
13,
13,
30,
30,
14,
4,
13,
13,
30,
4,
13,
13,
13,
30,
41,
13,
4,
13,
13,
41,
13,
4,
13,
13,
41,
13,
4,
13,
13,
13,
13,
4,
13,
13,
13,
4,
18,
18,
13,
13,
4,
13,
13,
23,
13,
12,
13,
30,
4,
18,
13,
13,
23,
13,
23,
13,
12,
13,
30,
41,
13,
2,
4,
18,
13,
17,
41,
13,
4,
18,
13,
13,
4,
18,
13,
13,
29,
13,
23,
13,
12,
13,
30,
41,
13,
17,
29,
4,
18,
13,
13,
23,
13,
12,
13,
30,
41,
13,
4,
18,
13,
13,
41,
13,
4,
18,
13,
13,
41,
13,
17,
35,
13,
34,
17,
1,
0,
13,
2,
13,
13,
3,
34,
17,
1,
0,
13,
2,
13,
13,
3,
34,
17,
1,
0,
13,
2,
13,
13,
3,
29,
4,
18,
13,
13,
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
],
[
10,
11
],
[
10,
12
],
[
0,
13
],
[
183,
14
],
[
183,
15
],
[
15,
16
],
[
15,
17
],
[
17,
18
],
[
18,
19
],
[
18,
20
],
[
17,
21
],
[
21,
22
],
[
21,
23
],
[
17,
24
],
[
24,
25
],
[
25,
26
],
[
17,
27
],
[
27,
28
],
[
27,
29
],
[
17,
30
],
[
30,
31
],
[
30,
32
],
[
30,
33
],
[
34,
34
],
[
34,
35
],
[
35,
36
],
[
36,
37
],
[
36,
38
],
[
35,
39
],
[
39,
40
],
[
40,
41
],
[
40,
42
],
[
40,
43
],
[
35,
44
],
[
44,
45
],
[
45,
46
],
[
45,
47
],
[
47,
48
],
[
47,
49
],
[
44,
50
],
[
50,
51
],
[
50,
52
],
[
52,
53
],
[
52,
54
],
[
44,
55
],
[
55,
56
],
[
55,
57
],
[
57,
58
],
[
57,
59
],
[
57,
60
],
[
57,
61
],
[
44,
62
],
[
62,
63
],
[
62,
64
],
[
62,
65
],
[
17,
66
],
[
66,
67
],
[
67,
68
],
[
68,
69
],
[
68,
70
],
[
66,
71
],
[
71,
72
],
[
71,
73
],
[
15,
74
],
[
74,
75
],
[
183,
76
],
[
76,
77
],
[
76,
78
],
[
78,
79
],
[
79,
80
],
[
80,
81
],
[
79,
82
],
[
76,
83
],
[
83,
84
],
[
76,
85
],
[
85,
86
],
[
183,
87
],
[
87,
88
],
[
87,
89
],
[
89,
90
],
[
90,
91
],
[
90,
92
],
[
92,
93
],
[
93,
94
],
[
94,
95
],
[
92,
96
],
[
89,
97
],
[
97,
98
],
[
97,
99
],
[
99,
100
],
[
100,
101
],
[
99,
102
],
[
89,
103
],
[
103,
104
],
[
104,
105
],
[
103,
106
],
[
89,
107
],
[
107,
108
],
[
87,
109
],
[
109,
110
],
[
183,
111
],
[
111,
112
],
[
111,
113
],
[
113,
114
],
[
114,
115
],
[
114,
116
],
[
113,
117
],
[
117,
118
],
[
118,
119
],
[
119,
120
],
[
118,
121
],
[
111,
122
],
[
122,
123
],
[
183,
124
],
[
124,
125
],
[
124,
126
],
[
126,
127
],
[
127,
128
],
[
127,
129
],
[
129,
130
],
[
130,
131
],
[
129,
132
],
[
126,
133
],
[
133,
134
],
[
133,
135
],
[
135,
136
],
[
136,
137
],
[
135,
138
],
[
126,
139
],
[
139,
140
],
[
139,
141
],
[
126,
142
],
[
142,
143
],
[
142,
144
],
[
144,
145
],
[
144,
146
],
[
146,
147
],
[
147,
148
],
[
147,
149
],
[
149,
150
],
[
149,
151
],
[
146,
152
],
[
142,
153
],
[
153,
154
],
[
153,
155
],
[
155,
156
],
[
156,
157
],
[
156,
158
],
[
158,
159
],
[
158,
160
],
[
155,
161
],
[
142,
162
],
[
162,
163
],
[
162,
164
],
[
164,
165
],
[
165,
166
],
[
165,
167
],
[
167,
168
],
[
167,
169
],
[
164,
170
],
[
126,
171
],
[
171,
172
],
[
172,
173
],
[
173,
174
],
[
172,
175
],
[
124,
176
],
[
176,
177
],
[
124,
178
],
[
178,
179
],
[
124,
180
],
[
180,
181
],
[
0,
182
],
[
182,
183
],
[
182,
184
]
] | [
"import java.util.ArrayList;\nimport java.util.Arrays;\nimport java.util.List;\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\tList<String> porand = new ArrayList<>(Arrays.asList(sc.nextLine().split(\" \")));\n\t\tsc.close();\n\t\tList<String> stack = new ArrayList<>();\n\t\tfor(String value: porand) {\n\t\t\t if(isNumber(value)) {\n\t\t\t\t push(stack, value);\n\t\t\t } else {\n\t\t\t\t String operand2 = pop(stack);\n\t\t\t\t String operand1 = pop(stack);\n\t\t\t\t String calcResult = calcResultGet(operand1, operand2, value);\n\t\t\t\t push(stack, calcResult);\n\t\t\t }\n\t\t}\n\t\tSystem.out.println(pop(stack));\n\t}\n\tpublic static void push(List<String> stack, String value) {\n\t\tstack.add(value);\n\t}\n\tpublic static String pop(List<String> stack) {\n\t\tint popIndex = stack.size() - 1;\n\t\tString value = stack.get(popIndex);\n\t\tstack.remove(popIndex);\n\t\treturn value;\n\t}\n\tpublic static boolean isNumber(String value) {\n\t\tString numOnlyRegex = \"[0-9]+\";\n\t\treturn value.matches(numOnlyRegex);\n\t}\n\tpublic static String calcResultGet(String operand1, String operand2, String enzanshi) {\n\t\tint operandNum1 = Integer.parseInt(operand1);\n\t\tint operandNum2 = Integer.parseInt(operand2);\n\t\tint calcResult = 0;\n\t\tswitch (enzanshi) {\n\t\tcase \"+\":\n\t\t\tcalcResult = operandNum1 + operandNum2;\n\t\t\tbreak;\n\n\t\tcase \"-\":\n\t\t\tcalcResult = operandNum1 - operandNum2;\n\t\t\tbreak;\n\n\t\tcase \"*\":\n\t\t\tcalcResult = operandNum1 * operandNum2;\n\t\t\tbreak;\n\t\t}\n\t\treturn String.valueOf(calcResult);\n\t}\n}",
"import java.util.ArrayList;",
"ArrayList",
"java.util",
"import java.util.Arrays;",
"Arrays",
"java.util",
"import java.util.List;",
"List",
"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\tList<String> porand = new ArrayList<>(Arrays.asList(sc.nextLine().split(\" \")));\n\t\tsc.close();\n\t\tList<String> stack = new ArrayList<>();\n\t\tfor(String value: porand) {\n\t\t\t if(isNumber(value)) {\n\t\t\t\t push(stack, value);\n\t\t\t } else {\n\t\t\t\t String operand2 = pop(stack);\n\t\t\t\t String operand1 = pop(stack);\n\t\t\t\t String calcResult = calcResultGet(operand1, operand2, value);\n\t\t\t\t push(stack, calcResult);\n\t\t\t }\n\t\t}\n\t\tSystem.out.println(pop(stack));\n\t}\n\tpublic static void push(List<String> stack, String value) {\n\t\tstack.add(value);\n\t}\n\tpublic static String pop(List<String> stack) {\n\t\tint popIndex = stack.size() - 1;\n\t\tString value = stack.get(popIndex);\n\t\tstack.remove(popIndex);\n\t\treturn value;\n\t}\n\tpublic static boolean isNumber(String value) {\n\t\tString numOnlyRegex = \"[0-9]+\";\n\t\treturn value.matches(numOnlyRegex);\n\t}\n\tpublic static String calcResultGet(String operand1, String operand2, String enzanshi) {\n\t\tint operandNum1 = Integer.parseInt(operand1);\n\t\tint operandNum2 = Integer.parseInt(operand2);\n\t\tint calcResult = 0;\n\t\tswitch (enzanshi) {\n\t\tcase \"+\":\n\t\t\tcalcResult = operandNum1 + operandNum2;\n\t\t\tbreak;\n\n\t\tcase \"-\":\n\t\t\tcalcResult = operandNum1 - operandNum2;\n\t\t\tbreak;\n\n\t\tcase \"*\":\n\t\t\tcalcResult = operandNum1 * operandNum2;\n\t\t\tbreak;\n\t\t}\n\t\treturn String.valueOf(calcResult);\n\t}\n}",
"Main",
"public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tList<String> porand = new ArrayList<>(Arrays.asList(sc.nextLine().split(\" \")));\n\t\tsc.close();\n\t\tList<String> stack = new ArrayList<>();\n\t\tfor(String value: porand) {\n\t\t\t if(isNumber(value)) {\n\t\t\t\t push(stack, value);\n\t\t\t } else {\n\t\t\t\t String operand2 = pop(stack);\n\t\t\t\t String operand1 = pop(stack);\n\t\t\t\t String calcResult = calcResultGet(operand1, operand2, value);\n\t\t\t\t push(stack, calcResult);\n\t\t\t }\n\t\t}\n\t\tSystem.out.println(pop(stack));\n\t}",
"main",
"{\n\t\tScanner sc = new Scanner(System.in);\n\t\tList<String> porand = new ArrayList<>(Arrays.asList(sc.nextLine().split(\" \")));\n\t\tsc.close();\n\t\tList<String> stack = new ArrayList<>();\n\t\tfor(String value: porand) {\n\t\t\t if(isNumber(value)) {\n\t\t\t\t push(stack, value);\n\t\t\t } else {\n\t\t\t\t String operand2 = pop(stack);\n\t\t\t\t String operand1 = pop(stack);\n\t\t\t\t String calcResult = calcResultGet(operand1, operand2, value);\n\t\t\t\t push(stack, calcResult);\n\t\t\t }\n\t\t}\n\t\tSystem.out.println(pop(stack));\n\t}",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"List<String> porand = new ArrayList<>(Arrays.asList(sc.nextLine().split(\" \")));",
"porand",
"new ArrayList<>(Arrays.asList(sc.nextLine().split(\" \")))",
"sc.close()",
"sc.close",
"sc",
"List<String> stack = new ArrayList<>();",
"stack",
"new ArrayList<>()",
"for(String value: porand) {\n\t\t\t if(isNumber(value)) {\n\t\t\t\t push(stack, value);\n\t\t\t } else {\n\t\t\t\t String operand2 = pop(stack);\n\t\t\t\t String operand1 = pop(stack);\n\t\t\t\t String calcResult = calcResultGet(operand1, operand2, value);\n\t\t\t\t push(stack, calcResult);\n\t\t\t }\n\t\t}",
"String value",
"porand",
"{\n\t\t\t if(isNumber(value)) {\n\t\t\t\t push(stack, value);\n\t\t\t } else {\n\t\t\t\t String operand2 = pop(stack);\n\t\t\t\t String operand1 = pop(stack);\n\t\t\t\t String calcResult = calcResultGet(operand1, operand2, value);\n\t\t\t\t push(stack, calcResult);\n\t\t\t }\n\t\t}",
"{\n\t\t\t if(isNumber(value)) {\n\t\t\t\t push(stack, value);\n\t\t\t } else {\n\t\t\t\t String operand2 = pop(stack);\n\t\t\t\t String operand1 = pop(stack);\n\t\t\t\t String calcResult = calcResultGet(operand1, operand2, value);\n\t\t\t\t push(stack, calcResult);\n\t\t\t }\n\t\t}",
"if(isNumber(value)) {\n\t\t\t\t push(stack, value);\n\t\t\t } else {\n\t\t\t\t String operand2 = pop(stack);\n\t\t\t\t String operand1 = pop(stack);\n\t\t\t\t String calcResult = calcResultGet(operand1, operand2, value);\n\t\t\t\t push(stack, calcResult);\n\t\t\t }",
"isNumber(value)",
"isNumber",
"value",
"{\n\t\t\t\t push(stack, value);\n\t\t\t }",
"push(stack, value)",
"push",
"stack",
"value",
"{\n\t\t\t\t String operand2 = pop(stack);\n\t\t\t\t String operand1 = pop(stack);\n\t\t\t\t String calcResult = calcResultGet(operand1, operand2, value);\n\t\t\t\t push(stack, calcResult);\n\t\t\t }",
"String operand2 = pop(stack);",
"operand2",
"pop(stack)",
"pop",
"stack",
"String operand1 = pop(stack);",
"operand1",
"pop(stack)",
"pop",
"stack",
"String calcResult = calcResultGet(operand1, operand2, value);",
"calcResult",
"calcResultGet(operand1, operand2, value)",
"calcResultGet",
"operand1",
"operand2",
"value",
"push(stack, calcResult)",
"push",
"stack",
"calcResult",
"System.out.println(pop(stack))",
"System.out.println",
"System.out",
"System",
"System.out",
"pop(stack)",
"pop",
"stack",
"String[] args",
"args",
"public static void push(List<String> stack, String value) {\n\t\tstack.add(value);\n\t}",
"push",
"{\n\t\tstack.add(value);\n\t}",
"stack.add(value)",
"stack.add",
"stack",
"value",
"List<String> stack",
"stack",
"String value",
"value",
"public static String pop(List<String> stack) {\n\t\tint popIndex = stack.size() - 1;\n\t\tString value = stack.get(popIndex);\n\t\tstack.remove(popIndex);\n\t\treturn value;\n\t}",
"pop",
"{\n\t\tint popIndex = stack.size() - 1;\n\t\tString value = stack.get(popIndex);\n\t\tstack.remove(popIndex);\n\t\treturn value;\n\t}",
"int popIndex = stack.size() - 1;",
"popIndex",
"stack.size() - 1",
"stack.size()",
"stack.size",
"stack",
"1",
"String value = stack.get(popIndex);",
"value",
"stack.get(popIndex)",
"stack.get",
"stack",
"popIndex",
"stack.remove(popIndex)",
"stack.remove",
"stack",
"popIndex",
"return value;",
"value",
"List<String> stack",
"stack",
"public static boolean isNumber(String value) {\n\t\tString numOnlyRegex = \"[0-9]+\";\n\t\treturn value.matches(numOnlyRegex);\n\t}",
"isNumber",
"{\n\t\tString numOnlyRegex = \"[0-9]+\";\n\t\treturn value.matches(numOnlyRegex);\n\t}",
"String numOnlyRegex = \"[0-9]+\";",
"numOnlyRegex",
"\"[0-9]+\"",
"return value.matches(numOnlyRegex);",
"value.matches(numOnlyRegex)",
"value.matches",
"value",
"numOnlyRegex",
"String value",
"value",
"public static String calcResultGet(String operand1, String operand2, String enzanshi) {\n\t\tint operandNum1 = Integer.parseInt(operand1);\n\t\tint operandNum2 = Integer.parseInt(operand2);\n\t\tint calcResult = 0;\n\t\tswitch (enzanshi) {\n\t\tcase \"+\":\n\t\t\tcalcResult = operandNum1 + operandNum2;\n\t\t\tbreak;\n\n\t\tcase \"-\":\n\t\t\tcalcResult = operandNum1 - operandNum2;\n\t\t\tbreak;\n\n\t\tcase \"*\":\n\t\t\tcalcResult = operandNum1 * operandNum2;\n\t\t\tbreak;\n\t\t}\n\t\treturn String.valueOf(calcResult);\n\t}",
"calcResultGet",
"{\n\t\tint operandNum1 = Integer.parseInt(operand1);\n\t\tint operandNum2 = Integer.parseInt(operand2);\n\t\tint calcResult = 0;\n\t\tswitch (enzanshi) {\n\t\tcase \"+\":\n\t\t\tcalcResult = operandNum1 + operandNum2;\n\t\t\tbreak;\n\n\t\tcase \"-\":\n\t\t\tcalcResult = operandNum1 - operandNum2;\n\t\t\tbreak;\n\n\t\tcase \"*\":\n\t\t\tcalcResult = operandNum1 * operandNum2;\n\t\t\tbreak;\n\t\t}\n\t\treturn String.valueOf(calcResult);\n\t}",
"int operandNum1 = Integer.parseInt(operand1);",
"operandNum1",
"Integer.parseInt(operand1)",
"Integer.parseInt",
"Integer",
"operand1",
"int operandNum2 = Integer.parseInt(operand2);",
"operandNum2",
"Integer.parseInt(operand2)",
"Integer.parseInt",
"Integer",
"operand2",
"int calcResult = 0;",
"calcResult",
"0",
"switch (enzanshi) {\n\t\tcase \"+\":\n\t\t\tcalcResult = operandNum1 + operandNum2;\n\t\t\tbreak;\n\n\t\tcase \"-\":\n\t\t\tcalcResult = operandNum1 - operandNum2;\n\t\t\tbreak;\n\n\t\tcase \"*\":\n\t\t\tcalcResult = operandNum1 * operandNum2;\n\t\t\tbreak;\n\t\t}",
"enzanshi",
"case \"+\":",
"\"+\"",
"case \"+\":",
"calcResult = operandNum1 + operandNum2",
"calcResult",
"operandNum1 + operandNum2",
"operandNum1",
"operandNum2",
"break;",
"case \"-\":",
"\"-\"",
"case \"-\":",
"calcResult = operandNum1 - operandNum2",
"calcResult",
"operandNum1 - operandNum2",
"operandNum1",
"operandNum2",
"break;",
"case \"*\":",
"\"*\"",
"case \"*\":",
"calcResult = operandNum1 * operandNum2",
"calcResult",
"operandNum1 * operandNum2",
"operandNum1",
"operandNum2",
"break;",
"return String.valueOf(calcResult);",
"String.valueOf(calcResult)",
"String.valueOf",
"String",
"calcResult",
"String operand1",
"operand1",
"String operand2",
"operand2",
"String enzanshi",
"enzanshi",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tList<String> porand = new ArrayList<>(Arrays.asList(sc.nextLine().split(\" \")));\n\t\tsc.close();\n\t\tList<String> stack = new ArrayList<>();\n\t\tfor(String value: porand) {\n\t\t\t if(isNumber(value)) {\n\t\t\t\t push(stack, value);\n\t\t\t } else {\n\t\t\t\t String operand2 = pop(stack);\n\t\t\t\t String operand1 = pop(stack);\n\t\t\t\t String calcResult = calcResultGet(operand1, operand2, value);\n\t\t\t\t push(stack, calcResult);\n\t\t\t }\n\t\t}\n\t\tSystem.out.println(pop(stack));\n\t}\n\tpublic static void push(List<String> stack, String value) {\n\t\tstack.add(value);\n\t}\n\tpublic static String pop(List<String> stack) {\n\t\tint popIndex = stack.size() - 1;\n\t\tString value = stack.get(popIndex);\n\t\tstack.remove(popIndex);\n\t\treturn value;\n\t}\n\tpublic static boolean isNumber(String value) {\n\t\tString numOnlyRegex = \"[0-9]+\";\n\t\treturn value.matches(numOnlyRegex);\n\t}\n\tpublic static String calcResultGet(String operand1, String operand2, String enzanshi) {\n\t\tint operandNum1 = Integer.parseInt(operand1);\n\t\tint operandNum2 = Integer.parseInt(operand2);\n\t\tint calcResult = 0;\n\t\tswitch (enzanshi) {\n\t\tcase \"+\":\n\t\t\tcalcResult = operandNum1 + operandNum2;\n\t\t\tbreak;\n\n\t\tcase \"-\":\n\t\t\tcalcResult = operandNum1 - operandNum2;\n\t\t\tbreak;\n\n\t\tcase \"*\":\n\t\t\tcalcResult = operandNum1 * operandNum2;\n\t\t\tbreak;\n\t\t}\n\t\treturn String.valueOf(calcResult);\n\t}\n}",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tList<String> porand = new ArrayList<>(Arrays.asList(sc.nextLine().split(\" \")));\n\t\tsc.close();\n\t\tList<String> stack = new ArrayList<>();\n\t\tfor(String value: porand) {\n\t\t\t if(isNumber(value)) {\n\t\t\t\t push(stack, value);\n\t\t\t } else {\n\t\t\t\t String operand2 = pop(stack);\n\t\t\t\t String operand1 = pop(stack);\n\t\t\t\t String calcResult = calcResultGet(operand1, operand2, value);\n\t\t\t\t push(stack, calcResult);\n\t\t\t }\n\t\t}\n\t\tSystem.out.println(pop(stack));\n\t}\n\tpublic static void push(List<String> stack, String value) {\n\t\tstack.add(value);\n\t}\n\tpublic static String pop(List<String> stack) {\n\t\tint popIndex = stack.size() - 1;\n\t\tString value = stack.get(popIndex);\n\t\tstack.remove(popIndex);\n\t\treturn value;\n\t}\n\tpublic static boolean isNumber(String value) {\n\t\tString numOnlyRegex = \"[0-9]+\";\n\t\treturn value.matches(numOnlyRegex);\n\t}\n\tpublic static String calcResultGet(String operand1, String operand2, String enzanshi) {\n\t\tint operandNum1 = Integer.parseInt(operand1);\n\t\tint operandNum2 = Integer.parseInt(operand2);\n\t\tint calcResult = 0;\n\t\tswitch (enzanshi) {\n\t\tcase \"+\":\n\t\t\tcalcResult = operandNum1 + operandNum2;\n\t\t\tbreak;\n\n\t\tcase \"-\":\n\t\t\tcalcResult = operandNum1 - operandNum2;\n\t\t\tbreak;\n\n\t\tcase \"*\":\n\t\t\tcalcResult = operandNum1 * operandNum2;\n\t\t\tbreak;\n\t\t}\n\t\treturn String.valueOf(calcResult);\n\t}\n}",
"Main"
] | import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
List<String> porand = new ArrayList<>(Arrays.asList(sc.nextLine().split(" ")));
sc.close();
List<String> stack = new ArrayList<>();
for(String value: porand) {
if(isNumber(value)) {
push(stack, value);
} else {
String operand2 = pop(stack);
String operand1 = pop(stack);
String calcResult = calcResultGet(operand1, operand2, value);
push(stack, calcResult);
}
}
System.out.println(pop(stack));
}
public static void push(List<String> stack, String value) {
stack.add(value);
}
public static String pop(List<String> stack) {
int popIndex = stack.size() - 1;
String value = stack.get(popIndex);
stack.remove(popIndex);
return value;
}
public static boolean isNumber(String value) {
String numOnlyRegex = "[0-9]+";
return value.matches(numOnlyRegex);
}
public static String calcResultGet(String operand1, String operand2, String enzanshi) {
int operandNum1 = Integer.parseInt(operand1);
int operandNum2 = Integer.parseInt(operand2);
int calcResult = 0;
switch (enzanshi) {
case "+":
calcResult = operandNum1 + operandNum2;
break;
case "-":
calcResult = operandNum1 - operandNum2;
break;
case "*":
calcResult = operandNum1 * operandNum2;
break;
}
return String.valueOf(calcResult);
}
} |
[
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,
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,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
14,
4,
18,
18,
13,
13,
17,
30,
4,
18,
13,
2,
13,
13,
14,
4,
18,
18,
13,
13,
17,
30,
4,
18,
13,
2,
13,
13,
14,
4,
18,
18,
13,
13,
17,
30,
4,
18,
13,
2,
13,
13,
30,
41,
13,
4,
18,
13,
18,
13,
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
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
10,
11
],
[
10,
12
],
[
0,
13
],
[
148,
14
],
[
148,
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
],
[
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
],
[
49,
49
],
[
49,
50
],
[
50,
51
],
[
51,
52
],
[
52,
53
],
[
52,
54
],
[
50,
55
],
[
49,
56
],
[
56,
57
],
[
57,
58
],
[
58,
59
],
[
58,
60
],
[
56,
61
],
[
49,
62
],
[
62,
63
],
[
63,
64
],
[
64,
65
],
[
64,
66
],
[
62,
67
],
[
47,
68
],
[
68,
69
],
[
69,
70
],
[
69,
71
],
[
71,
72
],
[
72,
73
],
[
68,
74
],
[
74,
75
],
[
74,
76
],
[
76,
77
],
[
77,
78
],
[
68,
79
],
[
79,
80
],
[
80,
81
],
[
81,
82
],
[
82,
83
],
[
82,
84
],
[
80,
85
],
[
79,
86
],
[
86,
87
],
[
87,
88
],
[
88,
89
],
[
87,
90
],
[
90,
91
],
[
90,
92
],
[
79,
93
],
[
93,
94
],
[
94,
95
],
[
95,
96
],
[
96,
97
],
[
96,
98
],
[
94,
99
],
[
93,
100
],
[
100,
101
],
[
101,
102
],
[
102,
103
],
[
101,
104
],
[
104,
105
],
[
104,
106
],
[
93,
107
],
[
107,
108
],
[
108,
109
],
[
109,
110
],
[
110,
111
],
[
110,
112
],
[
108,
113
],
[
107,
114
],
[
114,
115
],
[
115,
116
],
[
116,
117
],
[
115,
118
],
[
118,
119
],
[
118,
120
],
[
47,
121
],
[
121,
122
],
[
122,
123
],
[
122,
124
],
[
124,
125
],
[
125,
126
],
[
124,
127
],
[
127,
128
],
[
127,
129
],
[
121,
130
],
[
130,
131
],
[
131,
132
],
[
130,
133
],
[
17,
134
],
[
134,
135
],
[
134,
136
],
[
136,
137
],
[
137,
138
],
[
17,
139
],
[
139,
140
],
[
140,
141
],
[
141,
142
],
[
141,
143
],
[
139,
144
],
[
15,
145
],
[
145,
146
],
[
0,
147
],
[
147,
148
],
[
147,
149
]
] | [
"import java.io.BufferedReader;\nimport java.io.InputStreamReader;\nimport java.io.IOException;\nimport java.util.ArrayDeque;\n\npublic class Main{\n\n public static void main(String[] args) throws IOException{\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n ArrayDeque<Integer> stack = new ArrayDeque<Integer>();\n String[] t = br.readLine().split(\" \");\n for(int i = 0; i < t.length; i++){\n if( t[i].equals(\"+\") || t[i].equals(\"-\") || t[i].equals(\"*\") ){\n int ope1 = stack.pop();\n int ope2 = stack.pop();\n if(t[i].equals(\"+\") ){\n stack.push(ope1 + ope2);\n }else if(t[i].equals(\"-\") ){\n stack.push(ope2 - ope1);\n }else if(t[i].equals(\"*\") ){\n stack.push(ope1 * ope2);\n }\n }else{\n int ope = Integer.parseInt(t[i]);\n stack.push(ope);\n }\n }\n int ans = stack.pop();\n System.out.println(ans);\n }\n\n}",
"import java.io.BufferedReader;",
"BufferedReader",
"java.io",
"import java.io.InputStreamReader;",
"InputStreamReader",
"java.io",
"import java.io.IOException;",
"IOException",
"java.io",
"import java.util.ArrayDeque;",
"ArrayDeque",
"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 ArrayDeque<Integer> stack = new ArrayDeque<Integer>();\n String[] t = br.readLine().split(\" \");\n for(int i = 0; i < t.length; i++){\n if( t[i].equals(\"+\") || t[i].equals(\"-\") || t[i].equals(\"*\") ){\n int ope1 = stack.pop();\n int ope2 = stack.pop();\n if(t[i].equals(\"+\") ){\n stack.push(ope1 + ope2);\n }else if(t[i].equals(\"-\") ){\n stack.push(ope2 - ope1);\n }else if(t[i].equals(\"*\") ){\n stack.push(ope1 * ope2);\n }\n }else{\n int ope = Integer.parseInt(t[i]);\n stack.push(ope);\n }\n }\n int ans = stack.pop();\n System.out.println(ans);\n }\n\n}",
"Main",
"public static void main(String[] args) throws IOException{\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n ArrayDeque<Integer> stack = new ArrayDeque<Integer>();\n String[] t = br.readLine().split(\" \");\n for(int i = 0; i < t.length; i++){\n if( t[i].equals(\"+\") || t[i].equals(\"-\") || t[i].equals(\"*\") ){\n int ope1 = stack.pop();\n int ope2 = stack.pop();\n if(t[i].equals(\"+\") ){\n stack.push(ope1 + ope2);\n }else if(t[i].equals(\"-\") ){\n stack.push(ope2 - ope1);\n }else if(t[i].equals(\"*\") ){\n stack.push(ope1 * ope2);\n }\n }else{\n int ope = Integer.parseInt(t[i]);\n stack.push(ope);\n }\n }\n int ans = stack.pop();\n System.out.println(ans);\n }",
"main",
"{\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n ArrayDeque<Integer> stack = new ArrayDeque<Integer>();\n String[] t = br.readLine().split(\" \");\n for(int i = 0; i < t.length; i++){\n if( t[i].equals(\"+\") || t[i].equals(\"-\") || t[i].equals(\"*\") ){\n int ope1 = stack.pop();\n int ope2 = stack.pop();\n if(t[i].equals(\"+\") ){\n stack.push(ope1 + ope2);\n }else if(t[i].equals(\"-\") ){\n stack.push(ope2 - ope1);\n }else if(t[i].equals(\"*\") ){\n stack.push(ope1 * ope2);\n }\n }else{\n int ope = Integer.parseInt(t[i]);\n stack.push(ope);\n }\n }\n int ans = stack.pop();\n System.out.println(ans);\n }",
"BufferedReader br = new BufferedReader(new InputStreamReader(System.in));",
"br",
"new BufferedReader(new InputStreamReader(System.in))",
"ArrayDeque<Integer> stack = new ArrayDeque<Integer>();",
"stack",
"new ArrayDeque<Integer>()",
"String[] t = br.readLine().split(\" \");",
"t",
"br.readLine().split(\" \")",
"br.readLine().split",
"br.readLine()",
"br.readLine",
"br",
"\" \"",
"for(int i = 0; i < t.length; i++){\n if( t[i].equals(\"+\") || t[i].equals(\"-\") || t[i].equals(\"*\") ){\n int ope1 = stack.pop();\n int ope2 = stack.pop();\n if(t[i].equals(\"+\") ){\n stack.push(ope1 + ope2);\n }else if(t[i].equals(\"-\") ){\n stack.push(ope2 - ope1);\n }else if(t[i].equals(\"*\") ){\n stack.push(ope1 * ope2);\n }\n }else{\n int ope = Integer.parseInt(t[i]);\n stack.push(ope);\n }\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < t.length",
"i",
"t.length",
"t",
"t.length",
"i++",
"i++",
"i",
"{\n if( t[i].equals(\"+\") || t[i].equals(\"-\") || t[i].equals(\"*\") ){\n int ope1 = stack.pop();\n int ope2 = stack.pop();\n if(t[i].equals(\"+\") ){\n stack.push(ope1 + ope2);\n }else if(t[i].equals(\"-\") ){\n stack.push(ope2 - ope1);\n }else if(t[i].equals(\"*\") ){\n stack.push(ope1 * ope2);\n }\n }else{\n int ope = Integer.parseInt(t[i]);\n stack.push(ope);\n }\n }",
"{\n if( t[i].equals(\"+\") || t[i].equals(\"-\") || t[i].equals(\"*\") ){\n int ope1 = stack.pop();\n int ope2 = stack.pop();\n if(t[i].equals(\"+\") ){\n stack.push(ope1 + ope2);\n }else if(t[i].equals(\"-\") ){\n stack.push(ope2 - ope1);\n }else if(t[i].equals(\"*\") ){\n stack.push(ope1 * ope2);\n }\n }else{\n int ope = Integer.parseInt(t[i]);\n stack.push(ope);\n }\n }",
"if( t[i].equals(\"+\") || t[i].equals(\"-\") || t[i].equals(\"*\") ){\n int ope1 = stack.pop();\n int ope2 = stack.pop();\n if(t[i].equals(\"+\") ){\n stack.push(ope1 + ope2);\n }else if(t[i].equals(\"-\") ){\n stack.push(ope2 - ope1);\n }else if(t[i].equals(\"*\") ){\n stack.push(ope1 * ope2);\n }\n }else{\n int ope = Integer.parseInt(t[i]);\n stack.push(ope);\n }",
"t[i].equals(\"+\") || t[i].equals(\"-\") || t[i].equals(\"*\")",
"t[i].equals(\"+\") || t[i].equals(\"-\") || t[i].equals(\"*\")",
"t[i].equals(\"+\")",
"t[i].equals",
"t[i]",
"t",
"i",
"\"+\"",
"t[i].equals(\"-\")",
"t[i].equals",
"t[i]",
"t",
"i",
"\"-\"",
"t[i].equals(\"*\")",
"t[i].equals",
"t[i]",
"t",
"i",
"\"*\"",
"{\n int ope1 = stack.pop();\n int ope2 = stack.pop();\n if(t[i].equals(\"+\") ){\n stack.push(ope1 + ope2);\n }else if(t[i].equals(\"-\") ){\n stack.push(ope2 - ope1);\n }else if(t[i].equals(\"*\") ){\n stack.push(ope1 * ope2);\n }\n }",
"int ope1 = stack.pop();",
"ope1",
"stack.pop()",
"stack.pop",
"stack",
"int ope2 = stack.pop();",
"ope2",
"stack.pop()",
"stack.pop",
"stack",
"if(t[i].equals(\"+\") ){\n stack.push(ope1 + ope2);\n }else if(t[i].equals(\"-\") ){\n stack.push(ope2 - ope1);\n }else if(t[i].equals(\"*\") ){\n stack.push(ope1 * ope2);\n }",
"t[i].equals(\"+\")",
"t[i].equals",
"t[i]",
"t",
"i",
"\"+\"",
"{\n stack.push(ope1 + ope2);\n }",
"stack.push(ope1 + ope2)",
"stack.push",
"stack",
"ope1 + ope2",
"ope1",
"ope2",
"if(t[i].equals(\"-\") ){\n stack.push(ope2 - ope1);\n }else if(t[i].equals(\"*\") ){\n stack.push(ope1 * ope2);\n }",
"t[i].equals(\"-\")",
"t[i].equals",
"t[i]",
"t",
"i",
"\"-\"",
"{\n stack.push(ope2 - ope1);\n }",
"stack.push(ope2 - ope1)",
"stack.push",
"stack",
"ope2 - ope1",
"ope2",
"ope1",
"if(t[i].equals(\"*\") ){\n stack.push(ope1 * ope2);\n }",
"t[i].equals(\"*\")",
"t[i].equals",
"t[i]",
"t",
"i",
"\"*\"",
"{\n stack.push(ope1 * ope2);\n }",
"stack.push(ope1 * ope2)",
"stack.push",
"stack",
"ope1 * ope2",
"ope1",
"ope2",
"{\n int ope = Integer.parseInt(t[i]);\n stack.push(ope);\n }",
"int ope = Integer.parseInt(t[i]);",
"ope",
"Integer.parseInt(t[i])",
"Integer.parseInt",
"Integer",
"t[i]",
"t",
"i",
"stack.push(ope)",
"stack.push",
"stack",
"ope",
"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 public static void main(String[] args) throws IOException{\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n ArrayDeque<Integer> stack = new ArrayDeque<Integer>();\n String[] t = br.readLine().split(\" \");\n for(int i = 0; i < t.length; i++){\n if( t[i].equals(\"+\") || t[i].equals(\"-\") || t[i].equals(\"*\") ){\n int ope1 = stack.pop();\n int ope2 = stack.pop();\n if(t[i].equals(\"+\") ){\n stack.push(ope1 + ope2);\n }else if(t[i].equals(\"-\") ){\n stack.push(ope2 - ope1);\n }else if(t[i].equals(\"*\") ){\n stack.push(ope1 * ope2);\n }\n }else{\n int ope = Integer.parseInt(t[i]);\n stack.push(ope);\n }\n }\n int ans = stack.pop();\n System.out.println(ans);\n }\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 ArrayDeque<Integer> stack = new ArrayDeque<Integer>();\n String[] t = br.readLine().split(\" \");\n for(int i = 0; i < t.length; i++){\n if( t[i].equals(\"+\") || t[i].equals(\"-\") || t[i].equals(\"*\") ){\n int ope1 = stack.pop();\n int ope2 = stack.pop();\n if(t[i].equals(\"+\") ){\n stack.push(ope1 + ope2);\n }else if(t[i].equals(\"-\") ){\n stack.push(ope2 - ope1);\n }else if(t[i].equals(\"*\") ){\n stack.push(ope1 * ope2);\n }\n }else{\n int ope = Integer.parseInt(t[i]);\n stack.push(ope);\n }\n }\n int ans = stack.pop();\n System.out.println(ans);\n }\n\n}",
"Main"
] | import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;
import java.util.ArrayDeque;
public class Main{
public static void main(String[] args) throws IOException{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
ArrayDeque<Integer> stack = new ArrayDeque<Integer>();
String[] t = br.readLine().split(" ");
for(int i = 0; i < t.length; i++){
if( t[i].equals("+") || t[i].equals("-") || t[i].equals("*") ){
int ope1 = stack.pop();
int ope2 = stack.pop();
if(t[i].equals("+") ){
stack.push(ope1 + ope2);
}else if(t[i].equals("-") ){
stack.push(ope2 - ope1);
}else if(t[i].equals("*") ){
stack.push(ope1 * ope2);
}
}else{
int ope = Integer.parseInt(t[i]);
stack.push(ope);
}
}
int ans = stack.pop();
System.out.println(ans);
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
17,
41,
13,
41,
13,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
17,
17,
41,
13,
18,
13,
13,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
14,
4,
18,
18,
13,
13,
17,
30,
0,
13,
18,
13,
2,
13,
17,
0,
13,
18,
13,
2,
13,
17,
0,
18,
13,
2,
13,
17,
2,
13,
13,
0,
13,
2,
13,
17,
14,
4,
18,
18,
13,
13,
17,
30,
0,
13,
18,
13,
2,
13,
17,
0,
13,
18,
13,
2,
13,
17,
0,
18,
13,
2,
13,
17,
2,
13,
13,
0,
13,
2,
13,
17,
14,
4,
18,
18,
13,
13,
17,
30,
0,
13,
18,
13,
2,
13,
17,
0,
13,
18,
13,
2,
13,
17,
0,
18,
13,
2,
13,
17,
2,
13,
13,
0,
13,
2,
13,
17,
30,
0,
13,
4,
18,
13,
18,
13,
13,
0,
18,
13,
13,
13,
0,
13,
2,
13,
17,
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
],
[
8,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
8,
19
],
[
19,
20
],
[
19,
21
],
[
21,
22
],
[
22,
23
],
[
8,
24
],
[
24,
25
],
[
24,
26
],
[
26,
27
],
[
27,
28
],
[
26,
29
],
[
26,
30
],
[
8,
31
],
[
31,
32
],
[
31,
33
],
[
33,
34
],
[
33,
35
],
[
8,
36
],
[
36,
37
],
[
36,
38
],
[
8,
40
],
[
40,
41
],
[
41,
42
],
[
42,
43
],
[
42,
44
],
[
40,
45
],
[
45,
46
],
[
45,
47
],
[
40,
48
],
[
48,
49
],
[
49,
50
],
[
40,
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
],
[
63,
65
],
[
65,
66
],
[
65,
67
],
[
60,
68
],
[
68,
69
],
[
68,
70
],
[
70,
71
],
[
70,
72
],
[
72,
73
],
[
72,
74
],
[
60,
75
],
[
75,
76
],
[
76,
77
],
[
76,
78
],
[
78,
79
],
[
78,
80
],
[
75,
81
],
[
81,
82
],
[
81,
83
],
[
60,
84
],
[
84,
85
],
[
84,
86
],
[
86,
87
],
[
86,
88
],
[
53,
89
],
[
89,
90
],
[
90,
91
],
[
91,
92
],
[
92,
93
],
[
92,
94
],
[
90,
95
],
[
89,
96
],
[
96,
97
],
[
97,
98
],
[
97,
99
],
[
99,
100
],
[
99,
101
],
[
101,
102
],
[
101,
103
],
[
96,
104
],
[
104,
105
],
[
104,
106
],
[
106,
107
],
[
106,
108
],
[
108,
109
],
[
108,
110
],
[
96,
111
],
[
111,
112
],
[
112,
113
],
[
112,
114
],
[
114,
115
],
[
114,
116
],
[
111,
117
],
[
117,
118
],
[
117,
119
],
[
96,
120
],
[
120,
121
],
[
120,
122
],
[
122,
123
],
[
122,
124
],
[
89,
125
],
[
125,
126
],
[
126,
127
],
[
127,
128
],
[
128,
129
],
[
128,
130
],
[
126,
131
],
[
125,
132
],
[
132,
133
],
[
133,
134
],
[
133,
135
],
[
135,
136
],
[
135,
137
],
[
137,
138
],
[
137,
139
],
[
132,
140
],
[
140,
141
],
[
140,
142
],
[
142,
143
],
[
142,
144
],
[
144,
145
],
[
144,
146
],
[
132,
147
],
[
147,
148
],
[
148,
149
],
[
148,
150
],
[
150,
151
],
[
150,
152
],
[
147,
153
],
[
153,
154
],
[
153,
155
],
[
132,
156
],
[
156,
157
],
[
156,
158
],
[
158,
159
],
[
158,
160
],
[
125,
161
],
[
161,
162
],
[
162,
163
],
[
162,
164
],
[
164,
165
],
[
165,
166
],
[
164,
167
],
[
167,
168
],
[
167,
169
],
[
161,
170
],
[
170,
171
],
[
171,
172
],
[
171,
173
],
[
170,
174
],
[
161,
175
],
[
175,
176
],
[
175,
177
],
[
177,
178
],
[
177,
179
],
[
8,
180
],
[
180,
181
],
[
181,
182
],
[
182,
183
],
[
182,
184
],
[
180,
185
],
[
185,
186
],
[
185,
187
],
[
6,
188
],
[
188,
189
]
] | [
"import java.util.Scanner;\nclass Main{\n public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n int j = 0;\n int a, b;\n\n String input = sc.nextLine();\n //System.out.println(input);\n\n String[] s = input.split(\" \",0);\n int len = s.length;\n\n int[] stack = new int[len];\n\n for (int i = 0; i < len; i++) {\n if(s[i].equals(\"+\")){\n a = stack[j-2];\n b = stack[j-1];\n stack[j-2] = a+b;\n j = j-1;\n }\n else if(s[i].equals(\"-\")){\n a = stack[j-2];\n b = stack[j-1];\n stack[j-2] = a-b;\n j = j-1;\n }\n else if(s[i].equals(\"*\")){\n a = stack[j-2];\n b = stack[j-1];\n stack[j-2] = a*b;\n j = j-1;\n }\n else{\n a = Integer.parseInt(s[i]);\n stack[j] = a;\n j=j+1;\n }\n }\n System.out.println(stack[0]);\n }\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"class Main{\n public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n int j = 0;\n int a, b;\n\n String input = sc.nextLine();\n //System.out.println(input);\n\n String[] s = input.split(\" \",0);\n int len = s.length;\n\n int[] stack = new int[len];\n\n for (int i = 0; i < len; i++) {\n if(s[i].equals(\"+\")){\n a = stack[j-2];\n b = stack[j-1];\n stack[j-2] = a+b;\n j = j-1;\n }\n else if(s[i].equals(\"-\")){\n a = stack[j-2];\n b = stack[j-1];\n stack[j-2] = a-b;\n j = j-1;\n }\n else if(s[i].equals(\"*\")){\n a = stack[j-2];\n b = stack[j-1];\n stack[j-2] = a*b;\n j = j-1;\n }\n else{\n a = Integer.parseInt(s[i]);\n stack[j] = a;\n j=j+1;\n }\n }\n System.out.println(stack[0]);\n }\n}",
"Main",
"public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n int j = 0;\n int a, b;\n\n String input = sc.nextLine();\n //System.out.println(input);\n\n String[] s = input.split(\" \",0);\n int len = s.length;\n\n int[] stack = new int[len];\n\n for (int i = 0; i < len; i++) {\n if(s[i].equals(\"+\")){\n a = stack[j-2];\n b = stack[j-1];\n stack[j-2] = a+b;\n j = j-1;\n }\n else if(s[i].equals(\"-\")){\n a = stack[j-2];\n b = stack[j-1];\n stack[j-2] = a-b;\n j = j-1;\n }\n else if(s[i].equals(\"*\")){\n a = stack[j-2];\n b = stack[j-1];\n stack[j-2] = a*b;\n j = j-1;\n }\n else{\n a = Integer.parseInt(s[i]);\n stack[j] = a;\n j=j+1;\n }\n }\n System.out.println(stack[0]);\n }",
"main",
"{\n Scanner sc = new Scanner(System.in);\n int j = 0;\n int a, b;\n\n String input = sc.nextLine();\n //System.out.println(input);\n\n String[] s = input.split(\" \",0);\n int len = s.length;\n\n int[] stack = new int[len];\n\n for (int i = 0; i < len; i++) {\n if(s[i].equals(\"+\")){\n a = stack[j-2];\n b = stack[j-1];\n stack[j-2] = a+b;\n j = j-1;\n }\n else if(s[i].equals(\"-\")){\n a = stack[j-2];\n b = stack[j-1];\n stack[j-2] = a-b;\n j = j-1;\n }\n else if(s[i].equals(\"*\")){\n a = stack[j-2];\n b = stack[j-1];\n stack[j-2] = a*b;\n j = j-1;\n }\n else{\n a = Integer.parseInt(s[i]);\n stack[j] = a;\n j=j+1;\n }\n }\n System.out.println(stack[0]);\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int j = 0;",
"j",
"0",
"int a",
"a",
"b;",
"b",
"String input = sc.nextLine();",
"input",
"sc.nextLine()",
"sc.nextLine",
"sc",
"String[] s = input.split(\" \",0);",
"s",
"input.split(\" \",0)",
"input.split",
"input",
"\" \"",
"0",
"int len = s.length;",
"len",
"s.length",
"s",
"s.length",
"int[] stack = new int[len];",
"stack",
"new int[len]",
"len",
"for (int i = 0; i < len; i++) {\n if(s[i].equals(\"+\")){\n a = stack[j-2];\n b = stack[j-1];\n stack[j-2] = a+b;\n j = j-1;\n }\n else if(s[i].equals(\"-\")){\n a = stack[j-2];\n b = stack[j-1];\n stack[j-2] = a-b;\n j = j-1;\n }\n else if(s[i].equals(\"*\")){\n a = stack[j-2];\n b = stack[j-1];\n stack[j-2] = a*b;\n j = j-1;\n }\n else{\n a = Integer.parseInt(s[i]);\n stack[j] = a;\n j=j+1;\n }\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < len",
"i",
"len",
"i++",
"i++",
"i",
"{\n if(s[i].equals(\"+\")){\n a = stack[j-2];\n b = stack[j-1];\n stack[j-2] = a+b;\n j = j-1;\n }\n else if(s[i].equals(\"-\")){\n a = stack[j-2];\n b = stack[j-1];\n stack[j-2] = a-b;\n j = j-1;\n }\n else if(s[i].equals(\"*\")){\n a = stack[j-2];\n b = stack[j-1];\n stack[j-2] = a*b;\n j = j-1;\n }\n else{\n a = Integer.parseInt(s[i]);\n stack[j] = a;\n j=j+1;\n }\n }",
"{\n if(s[i].equals(\"+\")){\n a = stack[j-2];\n b = stack[j-1];\n stack[j-2] = a+b;\n j = j-1;\n }\n else if(s[i].equals(\"-\")){\n a = stack[j-2];\n b = stack[j-1];\n stack[j-2] = a-b;\n j = j-1;\n }\n else if(s[i].equals(\"*\")){\n a = stack[j-2];\n b = stack[j-1];\n stack[j-2] = a*b;\n j = j-1;\n }\n else{\n a = Integer.parseInt(s[i]);\n stack[j] = a;\n j=j+1;\n }\n }",
"if(s[i].equals(\"+\")){\n a = stack[j-2];\n b = stack[j-1];\n stack[j-2] = a+b;\n j = j-1;\n }\n else if(s[i].equals(\"-\")){\n a = stack[j-2];\n b = stack[j-1];\n stack[j-2] = a-b;\n j = j-1;\n }\n else if(s[i].equals(\"*\")){\n a = stack[j-2];\n b = stack[j-1];\n stack[j-2] = a*b;\n j = j-1;\n }\n else{\n a = Integer.parseInt(s[i]);\n stack[j] = a;\n j=j+1;\n }",
"s[i].equals(\"+\")",
"s[i].equals",
"s[i]",
"s",
"i",
"\"+\"",
"{\n a = stack[j-2];\n b = stack[j-1];\n stack[j-2] = a+b;\n j = j-1;\n }",
"a = stack[j-2]",
"a",
"stack[j-2]",
"stack",
"j-2",
"j",
"2",
"b = stack[j-1]",
"b",
"stack[j-1]",
"stack",
"j-1",
"j",
"1",
"stack[j-2] = a+b",
"stack[j-2]",
"stack",
"j-2",
"j",
"2",
"a+b",
"a",
"b",
"j = j-1",
"j",
"j-1",
"j",
"1",
"if(s[i].equals(\"-\")){\n a = stack[j-2];\n b = stack[j-1];\n stack[j-2] = a-b;\n j = j-1;\n }\n else if(s[i].equals(\"*\")){\n a = stack[j-2];\n b = stack[j-1];\n stack[j-2] = a*b;\n j = j-1;\n }\n else{\n a = Integer.parseInt(s[i]);\n stack[j] = a;\n j=j+1;\n }",
"s[i].equals(\"-\")",
"s[i].equals",
"s[i]",
"s",
"i",
"\"-\"",
"{\n a = stack[j-2];\n b = stack[j-1];\n stack[j-2] = a-b;\n j = j-1;\n }",
"a = stack[j-2]",
"a",
"stack[j-2]",
"stack",
"j-2",
"j",
"2",
"b = stack[j-1]",
"b",
"stack[j-1]",
"stack",
"j-1",
"j",
"1",
"stack[j-2] = a-b",
"stack[j-2]",
"stack",
"j-2",
"j",
"2",
"a-b",
"a",
"b",
"j = j-1",
"j",
"j-1",
"j",
"1",
"if(s[i].equals(\"*\")){\n a = stack[j-2];\n b = stack[j-1];\n stack[j-2] = a*b;\n j = j-1;\n }\n else{\n a = Integer.parseInt(s[i]);\n stack[j] = a;\n j=j+1;\n }",
"s[i].equals(\"*\")",
"s[i].equals",
"s[i]",
"s",
"i",
"\"*\"",
"{\n a = stack[j-2];\n b = stack[j-1];\n stack[j-2] = a*b;\n j = j-1;\n }",
"a = stack[j-2]",
"a",
"stack[j-2]",
"stack",
"j-2",
"j",
"2",
"b = stack[j-1]",
"b",
"stack[j-1]",
"stack",
"j-1",
"j",
"1",
"stack[j-2] = a*b",
"stack[j-2]",
"stack",
"j-2",
"j",
"2",
"a*b",
"a",
"b",
"j = j-1",
"j",
"j-1",
"j",
"1",
"{\n a = Integer.parseInt(s[i]);\n stack[j] = a;\n j=j+1;\n }",
"a = Integer.parseInt(s[i])",
"a",
"Integer.parseInt(s[i])",
"Integer.parseInt",
"Integer",
"s[i]",
"s",
"i",
"stack[j] = a",
"stack[j]",
"stack",
"j",
"a",
"j=j+1",
"j",
"j+1",
"j",
"1",
"System.out.println(stack[0])",
"System.out.println",
"System.out",
"System",
"System.out",
"stack[0]",
"stack",
"0",
"String[] args",
"args"
] | import java.util.Scanner;
class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int j = 0;
int a, b;
String input = sc.nextLine();
//System.out.println(input);
String[] s = input.split(" ",0);
int len = s.length;
int[] stack = new int[len];
for (int i = 0; i < len; i++) {
if(s[i].equals("+")){
a = stack[j-2];
b = stack[j-1];
stack[j-2] = a+b;
j = j-1;
}
else if(s[i].equals("-")){
a = stack[j-2];
b = stack[j-1];
stack[j-2] = a-b;
j = j-1;
}
else if(s[i].equals("*")){
a = stack[j-2];
b = stack[j-1];
stack[j-2] = a*b;
j = j-1;
}
else{
a = Integer.parseInt(s[i]);
stack[j] = a;
j=j+1;
}
}
System.out.println(stack[0]);
}
}
|
[
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,
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,
4,
18,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
122,
8
],
[
122,
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
],
[
29,
31
],
[
29,
32
],
[
33,
33
],
[
33,
34
],
[
34,
35
],
[
35,
36
],
[
36,
37
],
[
35,
38
],
[
34,
39
],
[
39,
40
],
[
40,
41
],
[
40,
42
],
[
42,
43
],
[
43,
44
],
[
39,
45
],
[
45,
46
],
[
45,
47
],
[
47,
48
],
[
48,
49
],
[
39,
50
],
[
50,
51
],
[
51,
52
],
[
50,
53
],
[
53,
54
],
[
53,
55
],
[
34,
56
],
[
56,
57
],
[
57,
58
],
[
58,
59
],
[
57,
60
],
[
56,
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
],
[
56,
78
],
[
78,
79
],
[
79,
80
],
[
80,
81
],
[
79,
82
],
[
78,
83
],
[
83,
84
],
[
84,
85
],
[
84,
86
],
[
86,
87
],
[
87,
88
],
[
83,
89
],
[
89,
90
],
[
89,
91
],
[
91,
92
],
[
92,
93
],
[
83,
94
],
[
94,
95
],
[
95,
96
],
[
94,
97
],
[
97,
98
],
[
97,
99
],
[
78,
100
],
[
100,
101
],
[
101,
102
],
[
102,
103
],
[
101,
104
],
[
104,
105
],
[
105,
106
],
[
104,
107
],
[
11,
108
],
[
108,
109
],
[
109,
110
],
[
110,
111
],
[
110,
112
],
[
108,
113
],
[
113,
114
],
[
114,
115
],
[
11,
116
],
[
116,
117
],
[
117,
118
],
[
9,
119
],
[
119,
120
],
[
0,
121
],
[
121,
122
],
[
121,
123
]
] | [
"\n\nimport java.util.ArrayDeque;\nimport java.util.Scanner;\n\npublic class Main {\n\n\tpublic static void main(String[] args) {\n\t\tArrayDeque<Integer> stack = new ArrayDeque<>(); //Stack???????????£????????§?????????\n\t\t\n\t\tScanner sc = new Scanner(System.in);\n String line = sc.nextLine();\n String[] lineArr = line.split(\" \");\n \n \n\t\tfor(String item: lineArr){\n\t\t\tif (item.equals(\"+\")) {\n\t\t\t\tint first = stack.pollFirst();\n\t\t\t\tint second = stack.pollFirst();\n\t\t\t\tstack.offerFirst(second + first);\n\t\t\t}else if (item.equals(\"-\")) {\n\t\t\t\tint first = stack.pollFirst();\n\t\t\t\tint second = stack.pollFirst();\n\t\t\t\tstack.offerFirst(second - first);\n\t\t\t}else if (item.equals(\"*\")) {\n\t\t\t\tint first = stack.pollFirst();\n\t\t\t\tint second = stack.pollFirst();\n\t\t\t\tstack.offerFirst(second * first);\n\t\t\t}else { // ??°???\n\t\t\t\tstack.offerFirst(Integer.parseInt(item));\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(stack.pollFirst());\n\t\tsc.close();\n\t}\n\n\t\n}",
"import java.util.ArrayDeque;",
"ArrayDeque",
"java.util",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\tArrayDeque<Integer> stack = new ArrayDeque<>(); //Stack???????????£????????§?????????\n\t\t\n\t\tScanner sc = new Scanner(System.in);\n String line = sc.nextLine();\n String[] lineArr = line.split(\" \");\n \n \n\t\tfor(String item: lineArr){\n\t\t\tif (item.equals(\"+\")) {\n\t\t\t\tint first = stack.pollFirst();\n\t\t\t\tint second = stack.pollFirst();\n\t\t\t\tstack.offerFirst(second + first);\n\t\t\t}else if (item.equals(\"-\")) {\n\t\t\t\tint first = stack.pollFirst();\n\t\t\t\tint second = stack.pollFirst();\n\t\t\t\tstack.offerFirst(second - first);\n\t\t\t}else if (item.equals(\"*\")) {\n\t\t\t\tint first = stack.pollFirst();\n\t\t\t\tint second = stack.pollFirst();\n\t\t\t\tstack.offerFirst(second * first);\n\t\t\t}else { // ??°???\n\t\t\t\tstack.offerFirst(Integer.parseInt(item));\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(stack.pollFirst());\n\t\tsc.close();\n\t}\n\n\t\n}",
"Main",
"public static void main(String[] args) {\n\t\tArrayDeque<Integer> stack = new ArrayDeque<>(); //Stack???????????£????????§?????????\n\t\t\n\t\tScanner sc = new Scanner(System.in);\n String line = sc.nextLine();\n String[] lineArr = line.split(\" \");\n \n \n\t\tfor(String item: lineArr){\n\t\t\tif (item.equals(\"+\")) {\n\t\t\t\tint first = stack.pollFirst();\n\t\t\t\tint second = stack.pollFirst();\n\t\t\t\tstack.offerFirst(second + first);\n\t\t\t}else if (item.equals(\"-\")) {\n\t\t\t\tint first = stack.pollFirst();\n\t\t\t\tint second = stack.pollFirst();\n\t\t\t\tstack.offerFirst(second - first);\n\t\t\t}else if (item.equals(\"*\")) {\n\t\t\t\tint first = stack.pollFirst();\n\t\t\t\tint second = stack.pollFirst();\n\t\t\t\tstack.offerFirst(second * first);\n\t\t\t}else { // ??°???\n\t\t\t\tstack.offerFirst(Integer.parseInt(item));\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(stack.pollFirst());\n\t\tsc.close();\n\t}",
"main",
"{\n\t\tArrayDeque<Integer> stack = new ArrayDeque<>(); //Stack???????????£????????§?????????\n\t\t\n\t\tScanner sc = new Scanner(System.in);\n String line = sc.nextLine();\n String[] lineArr = line.split(\" \");\n \n \n\t\tfor(String item: lineArr){\n\t\t\tif (item.equals(\"+\")) {\n\t\t\t\tint first = stack.pollFirst();\n\t\t\t\tint second = stack.pollFirst();\n\t\t\t\tstack.offerFirst(second + first);\n\t\t\t}else if (item.equals(\"-\")) {\n\t\t\t\tint first = stack.pollFirst();\n\t\t\t\tint second = stack.pollFirst();\n\t\t\t\tstack.offerFirst(second - first);\n\t\t\t}else if (item.equals(\"*\")) {\n\t\t\t\tint first = stack.pollFirst();\n\t\t\t\tint second = stack.pollFirst();\n\t\t\t\tstack.offerFirst(second * first);\n\t\t\t}else { // ??°???\n\t\t\t\tstack.offerFirst(Integer.parseInt(item));\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(stack.pollFirst());\n\t\tsc.close();\n\t}",
"ArrayDeque<Integer> stack = new ArrayDeque<>();",
"stack",
"new ArrayDeque<>()",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"String line = sc.nextLine();",
"line",
"sc.nextLine()",
"sc.nextLine",
"sc",
"String[] lineArr = line.split(\" \");",
"lineArr",
"line.split(\" \")",
"line.split",
"line",
"\" \"",
"for(String item: lineArr){\n\t\t\tif (item.equals(\"+\")) {\n\t\t\t\tint first = stack.pollFirst();\n\t\t\t\tint second = stack.pollFirst();\n\t\t\t\tstack.offerFirst(second + first);\n\t\t\t}else if (item.equals(\"-\")) {\n\t\t\t\tint first = stack.pollFirst();\n\t\t\t\tint second = stack.pollFirst();\n\t\t\t\tstack.offerFirst(second - first);\n\t\t\t}else if (item.equals(\"*\")) {\n\t\t\t\tint first = stack.pollFirst();\n\t\t\t\tint second = stack.pollFirst();\n\t\t\t\tstack.offerFirst(second * first);\n\t\t\t}else { // ??°???\n\t\t\t\tstack.offerFirst(Integer.parseInt(item));\n\t\t\t}\n\t\t}",
"String item",
"lineArr",
"{\n\t\t\tif (item.equals(\"+\")) {\n\t\t\t\tint first = stack.pollFirst();\n\t\t\t\tint second = stack.pollFirst();\n\t\t\t\tstack.offerFirst(second + first);\n\t\t\t}else if (item.equals(\"-\")) {\n\t\t\t\tint first = stack.pollFirst();\n\t\t\t\tint second = stack.pollFirst();\n\t\t\t\tstack.offerFirst(second - first);\n\t\t\t}else if (item.equals(\"*\")) {\n\t\t\t\tint first = stack.pollFirst();\n\t\t\t\tint second = stack.pollFirst();\n\t\t\t\tstack.offerFirst(second * first);\n\t\t\t}else { // ??°???\n\t\t\t\tstack.offerFirst(Integer.parseInt(item));\n\t\t\t}\n\t\t}",
"{\n\t\t\tif (item.equals(\"+\")) {\n\t\t\t\tint first = stack.pollFirst();\n\t\t\t\tint second = stack.pollFirst();\n\t\t\t\tstack.offerFirst(second + first);\n\t\t\t}else if (item.equals(\"-\")) {\n\t\t\t\tint first = stack.pollFirst();\n\t\t\t\tint second = stack.pollFirst();\n\t\t\t\tstack.offerFirst(second - first);\n\t\t\t}else if (item.equals(\"*\")) {\n\t\t\t\tint first = stack.pollFirst();\n\t\t\t\tint second = stack.pollFirst();\n\t\t\t\tstack.offerFirst(second * first);\n\t\t\t}else { // ??°???\n\t\t\t\tstack.offerFirst(Integer.parseInt(item));\n\t\t\t}\n\t\t}",
"if (item.equals(\"+\")) {\n\t\t\t\tint first = stack.pollFirst();\n\t\t\t\tint second = stack.pollFirst();\n\t\t\t\tstack.offerFirst(second + first);\n\t\t\t}else if (item.equals(\"-\")) {\n\t\t\t\tint first = stack.pollFirst();\n\t\t\t\tint second = stack.pollFirst();\n\t\t\t\tstack.offerFirst(second - first);\n\t\t\t}else if (item.equals(\"*\")) {\n\t\t\t\tint first = stack.pollFirst();\n\t\t\t\tint second = stack.pollFirst();\n\t\t\t\tstack.offerFirst(second * first);\n\t\t\t}else { // ??°???\n\t\t\t\tstack.offerFirst(Integer.parseInt(item));\n\t\t\t}",
"item.equals(\"+\")",
"item.equals",
"item",
"\"+\"",
"{\n\t\t\t\tint first = stack.pollFirst();\n\t\t\t\tint second = stack.pollFirst();\n\t\t\t\tstack.offerFirst(second + first);\n\t\t\t}",
"int first = stack.pollFirst();",
"first",
"stack.pollFirst()",
"stack.pollFirst",
"stack",
"int second = stack.pollFirst();",
"second",
"stack.pollFirst()",
"stack.pollFirst",
"stack",
"stack.offerFirst(second + first)",
"stack.offerFirst",
"stack",
"second + first",
"second",
"first",
"if (item.equals(\"-\")) {\n\t\t\t\tint first = stack.pollFirst();\n\t\t\t\tint second = stack.pollFirst();\n\t\t\t\tstack.offerFirst(second - first);\n\t\t\t}else if (item.equals(\"*\")) {\n\t\t\t\tint first = stack.pollFirst();\n\t\t\t\tint second = stack.pollFirst();\n\t\t\t\tstack.offerFirst(second * first);\n\t\t\t}else { // ??°???\n\t\t\t\tstack.offerFirst(Integer.parseInt(item));\n\t\t\t}",
"item.equals(\"-\")",
"item.equals",
"item",
"\"-\"",
"{\n\t\t\t\tint first = stack.pollFirst();\n\t\t\t\tint second = stack.pollFirst();\n\t\t\t\tstack.offerFirst(second - first);\n\t\t\t}",
"int first = stack.pollFirst();",
"first",
"stack.pollFirst()",
"stack.pollFirst",
"stack",
"int second = stack.pollFirst();",
"second",
"stack.pollFirst()",
"stack.pollFirst",
"stack",
"stack.offerFirst(second - first)",
"stack.offerFirst",
"stack",
"second - first",
"second",
"first",
"if (item.equals(\"*\")) {\n\t\t\t\tint first = stack.pollFirst();\n\t\t\t\tint second = stack.pollFirst();\n\t\t\t\tstack.offerFirst(second * first);\n\t\t\t}else { // ??°???\n\t\t\t\tstack.offerFirst(Integer.parseInt(item));\n\t\t\t}",
"item.equals(\"*\")",
"item.equals",
"item",
"\"*\"",
"{\n\t\t\t\tint first = stack.pollFirst();\n\t\t\t\tint second = stack.pollFirst();\n\t\t\t\tstack.offerFirst(second * first);\n\t\t\t}",
"int first = stack.pollFirst();",
"first",
"stack.pollFirst()",
"stack.pollFirst",
"stack",
"int second = stack.pollFirst();",
"second",
"stack.pollFirst()",
"stack.pollFirst",
"stack",
"stack.offerFirst(second * first)",
"stack.offerFirst",
"stack",
"second * first",
"second",
"first",
"{ // ??°???\n\t\t\t\tstack.offerFirst(Integer.parseInt(item));\n\t\t\t}",
"stack.offerFirst(Integer.parseInt(item))",
"stack.offerFirst",
"stack",
"Integer.parseInt(item)",
"Integer.parseInt",
"Integer",
"item",
"System.out.println(stack.pollFirst())",
"System.out.println",
"System.out",
"System",
"System.out",
"stack.pollFirst()",
"stack.pollFirst",
"stack",
"sc.close()",
"sc.close",
"sc",
"String[] args",
"args",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\tArrayDeque<Integer> stack = new ArrayDeque<>(); //Stack???????????£????????§?????????\n\t\t\n\t\tScanner sc = new Scanner(System.in);\n String line = sc.nextLine();\n String[] lineArr = line.split(\" \");\n \n \n\t\tfor(String item: lineArr){\n\t\t\tif (item.equals(\"+\")) {\n\t\t\t\tint first = stack.pollFirst();\n\t\t\t\tint second = stack.pollFirst();\n\t\t\t\tstack.offerFirst(second + first);\n\t\t\t}else if (item.equals(\"-\")) {\n\t\t\t\tint first = stack.pollFirst();\n\t\t\t\tint second = stack.pollFirst();\n\t\t\t\tstack.offerFirst(second - first);\n\t\t\t}else if (item.equals(\"*\")) {\n\t\t\t\tint first = stack.pollFirst();\n\t\t\t\tint second = stack.pollFirst();\n\t\t\t\tstack.offerFirst(second * first);\n\t\t\t}else { // ??°???\n\t\t\t\tstack.offerFirst(Integer.parseInt(item));\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(stack.pollFirst());\n\t\tsc.close();\n\t}\n\n\t\n}",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\tArrayDeque<Integer> stack = new ArrayDeque<>(); //Stack???????????£????????§?????????\n\t\t\n\t\tScanner sc = new Scanner(System.in);\n String line = sc.nextLine();\n String[] lineArr = line.split(\" \");\n \n \n\t\tfor(String item: lineArr){\n\t\t\tif (item.equals(\"+\")) {\n\t\t\t\tint first = stack.pollFirst();\n\t\t\t\tint second = stack.pollFirst();\n\t\t\t\tstack.offerFirst(second + first);\n\t\t\t}else if (item.equals(\"-\")) {\n\t\t\t\tint first = stack.pollFirst();\n\t\t\t\tint second = stack.pollFirst();\n\t\t\t\tstack.offerFirst(second - first);\n\t\t\t}else if (item.equals(\"*\")) {\n\t\t\t\tint first = stack.pollFirst();\n\t\t\t\tint second = stack.pollFirst();\n\t\t\t\tstack.offerFirst(second * first);\n\t\t\t}else { // ??°???\n\t\t\t\tstack.offerFirst(Integer.parseInt(item));\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(stack.pollFirst());\n\t\tsc.close();\n\t}\n\n\t\n}",
"Main"
] |
import java.util.ArrayDeque;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
ArrayDeque<Integer> stack = new ArrayDeque<>(); //Stack???????????£????????§?????????
Scanner sc = new Scanner(System.in);
String line = sc.nextLine();
String[] lineArr = line.split(" ");
for(String item: lineArr){
if (item.equals("+")) {
int first = stack.pollFirst();
int second = stack.pollFirst();
stack.offerFirst(second + first);
}else if (item.equals("-")) {
int first = stack.pollFirst();
int second = stack.pollFirst();
stack.offerFirst(second - first);
}else if (item.equals("*")) {
int first = stack.pollFirst();
int second = stack.pollFirst();
stack.offerFirst(second * first);
}else { // ??°???
stack.offerFirst(Integer.parseInt(item));
}
}
System.out.println(stack.pollFirst());
sc.close();
}
} |
[
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,
4,
18,
13,
13,
4,
18,
18,
13,
13,
4,
18,
13,
12,
13,
30,
20,
23,
13,
6,
13,
41,
13,
17,
41,
13,
12,
13,
30,
0,
13,
20,
13,
23,
13,
12,
13,
30,
0,
18,
13,
40,
13,
13,
23,
13,
12,
13,
30,
14,
4,
13,
13,
30,
41,
13,
4,
18,
13,
13,
4,
13,
13,
30,
41,
13,
4,
13,
41,
13,
4,
13,
14,
4,
18,
13,
17,
30,
4,
13,
2,
13,
13,
14,
4,
18,
13,
17,
30,
4,
13,
2,
13,
13,
30,
4,
13,
2,
13,
13,
23,
13,
12,
13,
30,
29,
18,
13,
40,
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
],
[
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
],
[
29,
30
],
[
28,
31
],
[
11,
32
],
[
32,
33
],
[
33,
34
],
[
34,
35
],
[
34,
36
],
[
32,
37
],
[
37,
38
],
[
38,
39
],
[
156,
40
],
[
40,
41
],
[
40,
42
],
[
42,
43
],
[
40,
44
],
[
44,
45
],
[
156,
46
],
[
46,
47
],
[
46,
48
],
[
48,
49
],
[
48,
50
],
[
46,
51
],
[
51,
52
],
[
46,
53
],
[
53,
54
],
[
53,
55
],
[
55,
56
],
[
56,
57
],
[
56,
58
],
[
53,
60
],
[
60,
61
],
[
46,
62
],
[
62,
63
],
[
62,
64
],
[
64,
65
],
[
65,
66
],
[
66,
67
],
[
66,
68
],
[
68,
69
],
[
65,
70
],
[
62,
71
],
[
71,
72
],
[
46,
73
],
[
73,
74
],
[
73,
75
],
[
75,
76
],
[
76,
77
],
[
77,
78
],
[
77,
79
],
[
76,
80
],
[
80,
81
],
[
81,
82
],
[
81,
83
],
[
83,
84
],
[
84,
85
],
[
83,
86
],
[
80,
87
],
[
87,
88
],
[
87,
89
],
[
76,
90
],
[
90,
91
],
[
91,
92
],
[
91,
93
],
[
93,
94
],
[
90,
95
],
[
95,
96
],
[
95,
97
],
[
97,
98
],
[
90,
99
],
[
99,
100
],
[
100,
101
],
[
101,
102
],
[
100,
103
],
[
99,
104
],
[
104,
105
],
[
105,
106
],
[
105,
107
],
[
107,
108
],
[
107,
109
],
[
99,
110
],
[
110,
111
],
[
111,
112
],
[
112,
113
],
[
111,
114
],
[
110,
115
],
[
115,
116
],
[
116,
117
],
[
116,
118
],
[
118,
119
],
[
118,
120
],
[
110,
121
],
[
121,
122
],
[
122,
123
],
[
122,
124
],
[
124,
125
],
[
124,
126
],
[
73,
127
],
[
127,
128
],
[
46,
129
],
[
129,
130
],
[
129,
131
],
[
131,
132
],
[
132,
133
],
[
133,
134
],
[
133,
135
],
[
135,
136
],
[
46,
137
],
[
137,
138
],
[
137,
139
],
[
139,
140
],
[
140,
141
],
[
141,
142
],
[
141,
143
],
[
143,
144
],
[
144,
145
],
[
140,
146
],
[
146,
147
],
[
147,
148
],
[
148,
149
],
[
147,
150
],
[
139,
151
],
[
151,
152
],
[
137,
153
],
[
153,
154
],
[
0,
155
],
[
155,
156
],
[
155,
157
]
] | [
"import java.util.Arrays;\nimport java.util.Scanner;\n\npublic class Main {\n public Main() {\n Scanner scan = new Scanner(System.in);\n\n Stack stack = new Stack(200);\n\n while(scan.hasNext()){\n String str = scan.next();\n stack.push(str);\n }\n System.out.println(stack.pop());\n }\n\n public static void main(String[] args) {\n new Main();\n }\n\n private class Stack{\n private int top = 0;\n private int stack[];\n\n public Stack(int size){\n stack = new int[size];\n }\n\n public void push(int n){\n stack[top++] = n;\n }\n\n public void push(String str){\n if(isInteger(str)){\n int n = Integer.parseInt(str);\n push(n);\n }else{\n int o1 = pop();\n int o2 = pop();\n\n if(str.equals(\"+\")){\n push(o2+o1);\n }\n else if(str.equals(\"-\")){\n push(o2-o1);\n }else{\n push(o2*o1);\n }\n }\n }\n\n public int pop(){\n return stack[--top];\n }\n\n public boolean isInteger(String str) {\n try {\n Integer.parseInt(str);\n } catch(NumberFormatException e) {\n return false;\n }\n return true;\n }\n\n }\n\n}",
"import java.util.Arrays;",
"Arrays",
"java.util",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n public Main() {\n Scanner scan = new Scanner(System.in);\n\n Stack stack = new Stack(200);\n\n while(scan.hasNext()){\n String str = scan.next();\n stack.push(str);\n }\n System.out.println(stack.pop());\n }\n\n public static void main(String[] args) {\n new Main();\n }\n\n private class Stack{\n private int top = 0;\n private int stack[];\n\n public Stack(int size){\n stack = new int[size];\n }\n\n public void push(int n){\n stack[top++] = n;\n }\n\n public void push(String str){\n if(isInteger(str)){\n int n = Integer.parseInt(str);\n push(n);\n }else{\n int o1 = pop();\n int o2 = pop();\n\n if(str.equals(\"+\")){\n push(o2+o1);\n }\n else if(str.equals(\"-\")){\n push(o2-o1);\n }else{\n push(o2*o1);\n }\n }\n }\n\n public int pop(){\n return stack[--top];\n }\n\n public boolean isInteger(String str) {\n try {\n Integer.parseInt(str);\n } catch(NumberFormatException e) {\n return false;\n }\n return true;\n }\n\n }\n\n}",
"Main",
"public Main() {\n Scanner scan = new Scanner(System.in);\n\n Stack stack = new Stack(200);\n\n while(scan.hasNext()){\n String str = scan.next();\n stack.push(str);\n }\n System.out.println(stack.pop());\n }",
"Main",
"{\n Scanner scan = new Scanner(System.in);\n\n Stack stack = new Stack(200);\n\n while(scan.hasNext()){\n String str = scan.next();\n stack.push(str);\n }\n System.out.println(stack.pop());\n }",
"Scanner scan = new Scanner(System.in);",
"scan",
"new Scanner(System.in)",
"Stack stack = new Stack(200);",
"stack",
"new Stack(200)",
"while(scan.hasNext()){\n String str = scan.next();\n stack.push(str);\n }",
"scan.hasNext()",
"scan.hasNext",
"scan",
"{\n String str = scan.next();\n stack.push(str);\n }",
"String str = scan.next();",
"str",
"scan.next()",
"scan.next",
"scan",
"stack.push(str)",
"stack.push",
"stack",
"str",
"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 new Main();\n }",
"main",
"{\n new Main();\n }",
"new Main()",
"String[] args",
"args",
"private class Stack{\n private int top = 0;\n private int stack[];\n\n public Stack(int size){\n stack = new int[size];\n }\n\n public void push(int n){\n stack[top++] = n;\n }\n\n public void push(String str){\n if(isInteger(str)){\n int n = Integer.parseInt(str);\n push(n);\n }else{\n int o1 = pop();\n int o2 = pop();\n\n if(str.equals(\"+\")){\n push(o2+o1);\n }\n else if(str.equals(\"-\")){\n push(o2-o1);\n }else{\n push(o2*o1);\n }\n }\n }\n\n public int pop(){\n return stack[--top];\n }\n\n public boolean isInteger(String str) {\n try {\n Integer.parseInt(str);\n } catch(NumberFormatException e) {\n return false;\n }\n return true;\n }\n\n }",
"Stack",
"private int top = 0;",
"top",
"0",
"private int stack[];",
"stack",
"public Stack(int size){\n stack = new int[size];\n }",
"Stack",
"{\n stack = new int[size];\n }",
"stack = new int[size]",
"stack",
"new int[size]",
"size",
"int size",
"size",
"public void push(int n){\n stack[top++] = n;\n }",
"push",
"{\n stack[top++] = n;\n }",
"stack[top++] = n",
"stack[top++]",
"stack",
"top++",
"top",
"n",
"int n",
"n",
"public void push(String str){\n if(isInteger(str)){\n int n = Integer.parseInt(str);\n push(n);\n }else{\n int o1 = pop();\n int o2 = pop();\n\n if(str.equals(\"+\")){\n push(o2+o1);\n }\n else if(str.equals(\"-\")){\n push(o2-o1);\n }else{\n push(o2*o1);\n }\n }\n }",
"push",
"{\n if(isInteger(str)){\n int n = Integer.parseInt(str);\n push(n);\n }else{\n int o1 = pop();\n int o2 = pop();\n\n if(str.equals(\"+\")){\n push(o2+o1);\n }\n else if(str.equals(\"-\")){\n push(o2-o1);\n }else{\n push(o2*o1);\n }\n }\n }",
"if(isInteger(str)){\n int n = Integer.parseInt(str);\n push(n);\n }else{\n int o1 = pop();\n int o2 = pop();\n\n if(str.equals(\"+\")){\n push(o2+o1);\n }\n else if(str.equals(\"-\")){\n push(o2-o1);\n }else{\n push(o2*o1);\n }\n }",
"isInteger(str)",
"isInteger",
"str",
"{\n int n = Integer.parseInt(str);\n push(n);\n }",
"int n = Integer.parseInt(str);",
"n",
"Integer.parseInt(str)",
"Integer.parseInt",
"Integer",
"str",
"push(n)",
"push",
"n",
"{\n int o1 = pop();\n int o2 = pop();\n\n if(str.equals(\"+\")){\n push(o2+o1);\n }\n else if(str.equals(\"-\")){\n push(o2-o1);\n }else{\n push(o2*o1);\n }\n }",
"int o1 = pop();",
"o1",
"pop()",
"pop",
"int o2 = pop();",
"o2",
"pop()",
"pop",
"if(str.equals(\"+\")){\n push(o2+o1);\n }\n else if(str.equals(\"-\")){\n push(o2-o1);\n }else{\n push(o2*o1);\n }",
"str.equals(\"+\")",
"str.equals",
"str",
"\"+\"",
"{\n push(o2+o1);\n }",
"push(o2+o1)",
"push",
"o2+o1",
"o2",
"o1",
"if(str.equals(\"-\")){\n push(o2-o1);\n }else{\n push(o2*o1);\n }",
"str.equals(\"-\")",
"str.equals",
"str",
"\"-\"",
"{\n push(o2-o1);\n }",
"push(o2-o1)",
"push",
"o2-o1",
"o2",
"o1",
"{\n push(o2*o1);\n }",
"push(o2*o1)",
"push",
"o2*o1",
"o2",
"o1",
"String str",
"str",
"public int pop(){\n return stack[--top];\n }",
"pop",
"{\n return stack[--top];\n }",
"return stack[--top];",
"stack[--top]",
"stack",
"--top",
"top",
"public boolean isInteger(String str) {\n try {\n Integer.parseInt(str);\n } catch(NumberFormatException e) {\n return false;\n }\n return true;\n }",
"isInteger",
"{\n try {\n Integer.parseInt(str);\n } catch(NumberFormatException e) {\n return false;\n }\n return true;\n }",
"try {\n Integer.parseInt(str);\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(str);\n }",
"Integer.parseInt(str)",
"Integer.parseInt",
"Integer",
"str",
"return true;",
"true",
"String str",
"str",
"public class Main {\n public Main() {\n Scanner scan = new Scanner(System.in);\n\n Stack stack = new Stack(200);\n\n while(scan.hasNext()){\n String str = scan.next();\n stack.push(str);\n }\n System.out.println(stack.pop());\n }\n\n public static void main(String[] args) {\n new Main();\n }\n\n private class Stack{\n private int top = 0;\n private int stack[];\n\n public Stack(int size){\n stack = new int[size];\n }\n\n public void push(int n){\n stack[top++] = n;\n }\n\n public void push(String str){\n if(isInteger(str)){\n int n = Integer.parseInt(str);\n push(n);\n }else{\n int o1 = pop();\n int o2 = pop();\n\n if(str.equals(\"+\")){\n push(o2+o1);\n }\n else if(str.equals(\"-\")){\n push(o2-o1);\n }else{\n push(o2*o1);\n }\n }\n }\n\n public int pop(){\n return stack[--top];\n }\n\n public boolean isInteger(String str) {\n try {\n Integer.parseInt(str);\n } catch(NumberFormatException e) {\n return false;\n }\n return true;\n }\n\n }\n\n}",
"public class Main {\n public Main() {\n Scanner scan = new Scanner(System.in);\n\n Stack stack = new Stack(200);\n\n while(scan.hasNext()){\n String str = scan.next();\n stack.push(str);\n }\n System.out.println(stack.pop());\n }\n\n public static void main(String[] args) {\n new Main();\n }\n\n private class Stack{\n private int top = 0;\n private int stack[];\n\n public Stack(int size){\n stack = new int[size];\n }\n\n public void push(int n){\n stack[top++] = n;\n }\n\n public void push(String str){\n if(isInteger(str)){\n int n = Integer.parseInt(str);\n push(n);\n }else{\n int o1 = pop();\n int o2 = pop();\n\n if(str.equals(\"+\")){\n push(o2+o1);\n }\n else if(str.equals(\"-\")){\n push(o2-o1);\n }else{\n push(o2*o1);\n }\n }\n }\n\n public int pop(){\n return stack[--top];\n }\n\n public boolean isInteger(String str) {\n try {\n Integer.parseInt(str);\n } catch(NumberFormatException e) {\n return false;\n }\n return true;\n }\n\n }\n\n}",
"Main"
] | import java.util.Arrays;
import java.util.Scanner;
public class Main {
public Main() {
Scanner scan = new Scanner(System.in);
Stack stack = new Stack(200);
while(scan.hasNext()){
String str = scan.next();
stack.push(str);
}
System.out.println(stack.pop());
}
public static void main(String[] args) {
new Main();
}
private class Stack{
private int top = 0;
private int stack[];
public Stack(int size){
stack = new int[size];
}
public void push(int n){
stack[top++] = n;
}
public void push(String str){
if(isInteger(str)){
int n = Integer.parseInt(str);
push(n);
}else{
int o1 = pop();
int o2 = pop();
if(str.equals("+")){
push(o2+o1);
}
else if(str.equals("-")){
push(o2-o1);
}else{
push(o2*o1);
}
}
}
public int pop(){
return stack[--top];
}
public boolean isInteger(String str) {
try {
Integer.parseInt(str);
} catch(NumberFormatException e) {
return false;
}
return true;
}
}
} |
[
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,
12,
13,
30,
41,
13,
20,
41,
13,
20,
42,
4,
18,
13,
30,
4,
18,
13,
4,
18,
13,
41,
13,
20,
42,
40,
4,
18,
13,
30,
41,
13,
4,
18,
13,
4,
18,
13,
14,
4,
18,
13,
30,
4,
18,
18,
13,
13,
13,
3,
41,
13,
4,
18,
13,
4,
18,
13,
41,
13,
4,
18,
13,
14,
4,
18,
17,
13,
30,
4,
18,
13,
2,
2,
13,
13,
17,
42,
40,
4,
18,
13,
30,
4,
18,
13,
4,
18,
13,
14,
4,
18,
17,
13,
30,
4,
18,
13,
2,
2,
13,
13,
17,
42,
40,
4,
18,
13,
30,
4,
18,
13,
4,
18,
13,
14,
4,
18,
17,
13,
30,
4,
18,
13,
2,
2,
13,
13,
17,
42,
40,
4,
18,
13,
30,
4,
18,
13,
4,
18,
13,
14,
4,
18,
17,
13,
30,
4,
18,
13,
2,
2,
13,
13,
17,
42,
40,
4,
18,
13,
30,
4,
18,
13,
4,
18,
13,
30,
4,
18,
13,
2,
13,
17,
4,
18,
13,
13,
4,
18,
13,
2,
13,
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
],
[
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
],
[
213,
26
],
[
213,
27
],
[
27,
28
],
[
27,
29
],
[
29,
30
],
[
30,
31
],
[
30,
32
],
[
29,
33
],
[
33,
34
],
[
33,
35
],
[
29,
36
],
[
36,
37
],
[
37,
38
],
[
38,
39
],
[
36,
40
],
[
40,
41
],
[
41,
42
],
[
42,
43
],
[
41,
44
],
[
44,
45
],
[
45,
46
],
[
29,
47
],
[
47,
48
],
[
47,
49
],
[
29,
50
],
[
50,
51
],
[
51,
52
],
[
52,
53
],
[
53,
54
],
[
50,
55
],
[
55,
56
],
[
56,
57
],
[
56,
58
],
[
58,
59
],
[
59,
60
],
[
58,
61
],
[
61,
62
],
[
62,
63
],
[
55,
64
],
[
64,
65
],
[
65,
66
],
[
66,
67
],
[
64,
68
],
[
68,
69
],
[
69,
70
],
[
70,
71
],
[
71,
72
],
[
71,
73
],
[
69,
74
],
[
68,
75
],
[
55,
76
],
[
76,
77
],
[
76,
78
],
[
78,
79
],
[
79,
80
],
[
78,
81
],
[
81,
82
],
[
82,
83
],
[
55,
84
],
[
84,
85
],
[
84,
86
],
[
86,
87
],
[
87,
88
],
[
55,
89
],
[
89,
90
],
[
90,
91
],
[
91,
92
],
[
90,
93
],
[
89,
94
],
[
94,
95
],
[
95,
96
],
[
96,
97
],
[
95,
98
],
[
98,
99
],
[
99,
100
],
[
99,
101
],
[
98,
102
],
[
94,
103
],
[
103,
104
],
[
104,
105
],
[
105,
106
],
[
106,
107
],
[
103,
108
],
[
108,
109
],
[
109,
110
],
[
110,
111
],
[
109,
112
],
[
112,
113
],
[
113,
114
],
[
89,
115
],
[
115,
116
],
[
116,
117
],
[
117,
118
],
[
116,
119
],
[
115,
120
],
[
120,
121
],
[
121,
122
],
[
122,
123
],
[
121,
124
],
[
124,
125
],
[
125,
126
],
[
125,
127
],
[
124,
128
],
[
120,
129
],
[
129,
130
],
[
130,
131
],
[
131,
132
],
[
132,
133
],
[
129,
134
],
[
134,
135
],
[
135,
136
],
[
136,
137
],
[
135,
138
],
[
138,
139
],
[
139,
140
],
[
115,
141
],
[
141,
142
],
[
142,
143
],
[
143,
144
],
[
142,
145
],
[
141,
146
],
[
146,
147
],
[
147,
148
],
[
148,
149
],
[
147,
150
],
[
150,
151
],
[
151,
152
],
[
151,
153
],
[
150,
154
],
[
146,
155
],
[
155,
156
],
[
156,
157
],
[
157,
158
],
[
158,
159
],
[
155,
160
],
[
160,
161
],
[
161,
162
],
[
162,
163
],
[
161,
164
],
[
164,
165
],
[
165,
166
],
[
141,
167
],
[
167,
168
],
[
168,
169
],
[
169,
170
],
[
168,
171
],
[
167,
172
],
[
172,
173
],
[
173,
174
],
[
174,
175
],
[
173,
176
],
[
176,
177
],
[
177,
178
],
[
177,
179
],
[
176,
180
],
[
172,
181
],
[
181,
182
],
[
182,
183
],
[
183,
184
],
[
184,
185
],
[
181,
186
],
[
186,
187
],
[
187,
188
],
[
188,
189
],
[
187,
190
],
[
190,
191
],
[
191,
192
],
[
167,
193
],
[
193,
194
],
[
194,
195
],
[
195,
196
],
[
194,
197
],
[
197,
198
],
[
197,
199
],
[
193,
200
],
[
200,
201
],
[
201,
202
],
[
200,
203
],
[
193,
204
],
[
204,
205
],
[
205,
206
],
[
204,
207
],
[
207,
208
],
[
207,
209
],
[
27,
210
],
[
210,
211
],
[
0,
212
],
[
212,
213
],
[
212,
214
]
] | [
"import java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\nimport java.util.Arrays;\nimport java.util.HashMap;\nimport java.util.LinkedList;\nimport java.util.Map;\nimport java.util.Scanner;\n\npublic class Main {\n\t\n\tpublic static void main(String args[]) {\n\t\tScanner sc = new Scanner(System.in);\n\t\t\n\t\tLinkedList<String> input = new LinkedList<String>();\n\t\twhile(sc.hasNext()){\n\t\t\tinput.addLast(sc.next());\n\t\t}\n\t\tLinkedList<String> rest = new LinkedList<String>();\n\t\t\n\t\twhile(!input.isEmpty()){\n\t\t\t//System.out.println(input + \" \" + rest);\n\t\t\tfinal int a = Integer.parseInt(input.poll());\n\t\t\tif(input.isEmpty()){\n\t\t\t\tSystem.out.println(a);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t\tfinal int b = Integer.parseInt(input.poll());\n\t\t\tfinal String ops = input.poll();\n\t\t\t\n\t\t\tif(\"+\".equals(ops)){\n\t\t\t\tinput.addFirst((a + b) + \"\");\n\t\t\t\twhile(!rest.isEmpty()){\n\t\t\t\t\tinput.addFirst(rest.poll());\n\t\t\t\t}\n\t\t\t}else if(\"-\".equals(ops)){\n\t\t\t\tinput.addFirst((a - b) + \"\");\n\t\t\t\twhile(!rest.isEmpty()){\n\t\t\t\t\tinput.addFirst(rest.poll());\n\t\t\t\t}\n\t\t\t}else if(\"*\".equals(ops)){\n\t\t\t\tinput.addFirst((a * b) + \"\");\n\t\t\t\twhile(!rest.isEmpty()){\n\t\t\t\t\tinput.addFirst(rest.poll());\n\t\t\t\t}\n\t\t\t}else if(\"/\".equals(ops)){\n\t\t\t\tinput.addFirst((a / b) + \"\");\n\t\t\t\twhile(!rest.isEmpty()){\n\t\t\t\t\tinput.addFirst(rest.poll());\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\trest.addFirst(a + \"\");\n\t\t\t\tinput.addFirst(ops);\n\t\t\t\tinput.addFirst(b + \"\");\n\t\t\t}\n\t\t}\n\t\t\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.Arrays;",
"Arrays",
"java.util",
"import java.util.HashMap;",
"HashMap",
"java.util",
"import java.util.LinkedList;",
"LinkedList",
"java.util",
"import java.util.Map;",
"Map",
"java.util",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\t\n\tpublic static void main(String args[]) {\n\t\tScanner sc = new Scanner(System.in);\n\t\t\n\t\tLinkedList<String> input = new LinkedList<String>();\n\t\twhile(sc.hasNext()){\n\t\t\tinput.addLast(sc.next());\n\t\t}\n\t\tLinkedList<String> rest = new LinkedList<String>();\n\t\t\n\t\twhile(!input.isEmpty()){\n\t\t\t//System.out.println(input + \" \" + rest);\n\t\t\tfinal int a = Integer.parseInt(input.poll());\n\t\t\tif(input.isEmpty()){\n\t\t\t\tSystem.out.println(a);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t\tfinal int b = Integer.parseInt(input.poll());\n\t\t\tfinal String ops = input.poll();\n\t\t\t\n\t\t\tif(\"+\".equals(ops)){\n\t\t\t\tinput.addFirst((a + b) + \"\");\n\t\t\t\twhile(!rest.isEmpty()){\n\t\t\t\t\tinput.addFirst(rest.poll());\n\t\t\t\t}\n\t\t\t}else if(\"-\".equals(ops)){\n\t\t\t\tinput.addFirst((a - b) + \"\");\n\t\t\t\twhile(!rest.isEmpty()){\n\t\t\t\t\tinput.addFirst(rest.poll());\n\t\t\t\t}\n\t\t\t}else if(\"*\".equals(ops)){\n\t\t\t\tinput.addFirst((a * b) + \"\");\n\t\t\t\twhile(!rest.isEmpty()){\n\t\t\t\t\tinput.addFirst(rest.poll());\n\t\t\t\t}\n\t\t\t}else if(\"/\".equals(ops)){\n\t\t\t\tinput.addFirst((a / b) + \"\");\n\t\t\t\twhile(!rest.isEmpty()){\n\t\t\t\t\tinput.addFirst(rest.poll());\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\trest.addFirst(a + \"\");\n\t\t\t\tinput.addFirst(ops);\n\t\t\t\tinput.addFirst(b + \"\");\n\t\t\t}\n\t\t}\n\t\t\n\t}\n}",
"Main",
"public static void main(String args[]) {\n\t\tScanner sc = new Scanner(System.in);\n\t\t\n\t\tLinkedList<String> input = new LinkedList<String>();\n\t\twhile(sc.hasNext()){\n\t\t\tinput.addLast(sc.next());\n\t\t}\n\t\tLinkedList<String> rest = new LinkedList<String>();\n\t\t\n\t\twhile(!input.isEmpty()){\n\t\t\t//System.out.println(input + \" \" + rest);\n\t\t\tfinal int a = Integer.parseInt(input.poll());\n\t\t\tif(input.isEmpty()){\n\t\t\t\tSystem.out.println(a);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t\tfinal int b = Integer.parseInt(input.poll());\n\t\t\tfinal String ops = input.poll();\n\t\t\t\n\t\t\tif(\"+\".equals(ops)){\n\t\t\t\tinput.addFirst((a + b) + \"\");\n\t\t\t\twhile(!rest.isEmpty()){\n\t\t\t\t\tinput.addFirst(rest.poll());\n\t\t\t\t}\n\t\t\t}else if(\"-\".equals(ops)){\n\t\t\t\tinput.addFirst((a - b) + \"\");\n\t\t\t\twhile(!rest.isEmpty()){\n\t\t\t\t\tinput.addFirst(rest.poll());\n\t\t\t\t}\n\t\t\t}else if(\"*\".equals(ops)){\n\t\t\t\tinput.addFirst((a * b) + \"\");\n\t\t\t\twhile(!rest.isEmpty()){\n\t\t\t\t\tinput.addFirst(rest.poll());\n\t\t\t\t}\n\t\t\t}else if(\"/\".equals(ops)){\n\t\t\t\tinput.addFirst((a / b) + \"\");\n\t\t\t\twhile(!rest.isEmpty()){\n\t\t\t\t\tinput.addFirst(rest.poll());\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\trest.addFirst(a + \"\");\n\t\t\t\tinput.addFirst(ops);\n\t\t\t\tinput.addFirst(b + \"\");\n\t\t\t}\n\t\t}\n\t\t\n\t}",
"main",
"{\n\t\tScanner sc = new Scanner(System.in);\n\t\t\n\t\tLinkedList<String> input = new LinkedList<String>();\n\t\twhile(sc.hasNext()){\n\t\t\tinput.addLast(sc.next());\n\t\t}\n\t\tLinkedList<String> rest = new LinkedList<String>();\n\t\t\n\t\twhile(!input.isEmpty()){\n\t\t\t//System.out.println(input + \" \" + rest);\n\t\t\tfinal int a = Integer.parseInt(input.poll());\n\t\t\tif(input.isEmpty()){\n\t\t\t\tSystem.out.println(a);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t\tfinal int b = Integer.parseInt(input.poll());\n\t\t\tfinal String ops = input.poll();\n\t\t\t\n\t\t\tif(\"+\".equals(ops)){\n\t\t\t\tinput.addFirst((a + b) + \"\");\n\t\t\t\twhile(!rest.isEmpty()){\n\t\t\t\t\tinput.addFirst(rest.poll());\n\t\t\t\t}\n\t\t\t}else if(\"-\".equals(ops)){\n\t\t\t\tinput.addFirst((a - b) + \"\");\n\t\t\t\twhile(!rest.isEmpty()){\n\t\t\t\t\tinput.addFirst(rest.poll());\n\t\t\t\t}\n\t\t\t}else if(\"*\".equals(ops)){\n\t\t\t\tinput.addFirst((a * b) + \"\");\n\t\t\t\twhile(!rest.isEmpty()){\n\t\t\t\t\tinput.addFirst(rest.poll());\n\t\t\t\t}\n\t\t\t}else if(\"/\".equals(ops)){\n\t\t\t\tinput.addFirst((a / b) + \"\");\n\t\t\t\twhile(!rest.isEmpty()){\n\t\t\t\t\tinput.addFirst(rest.poll());\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\trest.addFirst(a + \"\");\n\t\t\t\tinput.addFirst(ops);\n\t\t\t\tinput.addFirst(b + \"\");\n\t\t\t}\n\t\t}\n\t\t\n\t}",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"LinkedList<String> input = new LinkedList<String>();",
"input",
"new LinkedList<String>()",
"while(sc.hasNext()){\n\t\t\tinput.addLast(sc.next());\n\t\t}",
"sc.hasNext()",
"sc.hasNext",
"sc",
"{\n\t\t\tinput.addLast(sc.next());\n\t\t}",
"input.addLast(sc.next())",
"input.addLast",
"input",
"sc.next()",
"sc.next",
"sc",
"LinkedList<String> rest = new LinkedList<String>();",
"rest",
"new LinkedList<String>()",
"while(!input.isEmpty()){\n\t\t\t//System.out.println(input + \" \" + rest);\n\t\t\tfinal int a = Integer.parseInt(input.poll());\n\t\t\tif(input.isEmpty()){\n\t\t\t\tSystem.out.println(a);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t\tfinal int b = Integer.parseInt(input.poll());\n\t\t\tfinal String ops = input.poll();\n\t\t\t\n\t\t\tif(\"+\".equals(ops)){\n\t\t\t\tinput.addFirst((a + b) + \"\");\n\t\t\t\twhile(!rest.isEmpty()){\n\t\t\t\t\tinput.addFirst(rest.poll());\n\t\t\t\t}\n\t\t\t}else if(\"-\".equals(ops)){\n\t\t\t\tinput.addFirst((a - b) + \"\");\n\t\t\t\twhile(!rest.isEmpty()){\n\t\t\t\t\tinput.addFirst(rest.poll());\n\t\t\t\t}\n\t\t\t}else if(\"*\".equals(ops)){\n\t\t\t\tinput.addFirst((a * b) + \"\");\n\t\t\t\twhile(!rest.isEmpty()){\n\t\t\t\t\tinput.addFirst(rest.poll());\n\t\t\t\t}\n\t\t\t}else if(\"/\".equals(ops)){\n\t\t\t\tinput.addFirst((a / b) + \"\");\n\t\t\t\twhile(!rest.isEmpty()){\n\t\t\t\t\tinput.addFirst(rest.poll());\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\trest.addFirst(a + \"\");\n\t\t\t\tinput.addFirst(ops);\n\t\t\t\tinput.addFirst(b + \"\");\n\t\t\t}\n\t\t}",
"!input.isEmpty()",
"input.isEmpty()",
"input.isEmpty",
"input",
"{\n\t\t\t//System.out.println(input + \" \" + rest);\n\t\t\tfinal int a = Integer.parseInt(input.poll());\n\t\t\tif(input.isEmpty()){\n\t\t\t\tSystem.out.println(a);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t\tfinal int b = Integer.parseInt(input.poll());\n\t\t\tfinal String ops = input.poll();\n\t\t\t\n\t\t\tif(\"+\".equals(ops)){\n\t\t\t\tinput.addFirst((a + b) + \"\");\n\t\t\t\twhile(!rest.isEmpty()){\n\t\t\t\t\tinput.addFirst(rest.poll());\n\t\t\t\t}\n\t\t\t}else if(\"-\".equals(ops)){\n\t\t\t\tinput.addFirst((a - b) + \"\");\n\t\t\t\twhile(!rest.isEmpty()){\n\t\t\t\t\tinput.addFirst(rest.poll());\n\t\t\t\t}\n\t\t\t}else if(\"*\".equals(ops)){\n\t\t\t\tinput.addFirst((a * b) + \"\");\n\t\t\t\twhile(!rest.isEmpty()){\n\t\t\t\t\tinput.addFirst(rest.poll());\n\t\t\t\t}\n\t\t\t}else if(\"/\".equals(ops)){\n\t\t\t\tinput.addFirst((a / b) + \"\");\n\t\t\t\twhile(!rest.isEmpty()){\n\t\t\t\t\tinput.addFirst(rest.poll());\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\trest.addFirst(a + \"\");\n\t\t\t\tinput.addFirst(ops);\n\t\t\t\tinput.addFirst(b + \"\");\n\t\t\t}\n\t\t}",
"final int a = Integer.parseInt(input.poll());",
"a",
"Integer.parseInt(input.poll())",
"Integer.parseInt",
"Integer",
"input.poll()",
"input.poll",
"input",
"if(input.isEmpty()){\n\t\t\t\tSystem.out.println(a);\n\t\t\t\tbreak;\n\t\t\t}",
"input.isEmpty()",
"input.isEmpty",
"input",
"{\n\t\t\t\tSystem.out.println(a);\n\t\t\t\tbreak;\n\t\t\t}",
"System.out.println(a)",
"System.out.println",
"System.out",
"System",
"System.out",
"a",
"break;",
"final int b = Integer.parseInt(input.poll());",
"b",
"Integer.parseInt(input.poll())",
"Integer.parseInt",
"Integer",
"input.poll()",
"input.poll",
"input",
"final String ops = input.poll();",
"ops",
"input.poll()",
"input.poll",
"input",
"if(\"+\".equals(ops)){\n\t\t\t\tinput.addFirst((a + b) + \"\");\n\t\t\t\twhile(!rest.isEmpty()){\n\t\t\t\t\tinput.addFirst(rest.poll());\n\t\t\t\t}\n\t\t\t}else if(\"-\".equals(ops)){\n\t\t\t\tinput.addFirst((a - b) + \"\");\n\t\t\t\twhile(!rest.isEmpty()){\n\t\t\t\t\tinput.addFirst(rest.poll());\n\t\t\t\t}\n\t\t\t}else if(\"*\".equals(ops)){\n\t\t\t\tinput.addFirst((a * b) + \"\");\n\t\t\t\twhile(!rest.isEmpty()){\n\t\t\t\t\tinput.addFirst(rest.poll());\n\t\t\t\t}\n\t\t\t}else if(\"/\".equals(ops)){\n\t\t\t\tinput.addFirst((a / b) + \"\");\n\t\t\t\twhile(!rest.isEmpty()){\n\t\t\t\t\tinput.addFirst(rest.poll());\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\trest.addFirst(a + \"\");\n\t\t\t\tinput.addFirst(ops);\n\t\t\t\tinput.addFirst(b + \"\");\n\t\t\t}",
"\"+\".equals(ops)",
"\"+\".equals",
"\"+\"",
"ops",
"{\n\t\t\t\tinput.addFirst((a + b) + \"\");\n\t\t\t\twhile(!rest.isEmpty()){\n\t\t\t\t\tinput.addFirst(rest.poll());\n\t\t\t\t}\n\t\t\t}",
"input.addFirst((a + b) + \"\")",
"input.addFirst",
"input",
"(a + b) + \"\"",
"(a + b)",
"a",
"b",
"\"\"",
"while(!rest.isEmpty()){\n\t\t\t\t\tinput.addFirst(rest.poll());\n\t\t\t\t}",
"!rest.isEmpty()",
"rest.isEmpty()",
"rest.isEmpty",
"rest",
"{\n\t\t\t\t\tinput.addFirst(rest.poll());\n\t\t\t\t}",
"input.addFirst(rest.poll())",
"input.addFirst",
"input",
"rest.poll()",
"rest.poll",
"rest",
"if(\"-\".equals(ops)){\n\t\t\t\tinput.addFirst((a - b) + \"\");\n\t\t\t\twhile(!rest.isEmpty()){\n\t\t\t\t\tinput.addFirst(rest.poll());\n\t\t\t\t}\n\t\t\t}else if(\"*\".equals(ops)){\n\t\t\t\tinput.addFirst((a * b) + \"\");\n\t\t\t\twhile(!rest.isEmpty()){\n\t\t\t\t\tinput.addFirst(rest.poll());\n\t\t\t\t}\n\t\t\t}else if(\"/\".equals(ops)){\n\t\t\t\tinput.addFirst((a / b) + \"\");\n\t\t\t\twhile(!rest.isEmpty()){\n\t\t\t\t\tinput.addFirst(rest.poll());\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\trest.addFirst(a + \"\");\n\t\t\t\tinput.addFirst(ops);\n\t\t\t\tinput.addFirst(b + \"\");\n\t\t\t}",
"\"-\".equals(ops)",
"\"-\".equals",
"\"-\"",
"ops",
"{\n\t\t\t\tinput.addFirst((a - b) + \"\");\n\t\t\t\twhile(!rest.isEmpty()){\n\t\t\t\t\tinput.addFirst(rest.poll());\n\t\t\t\t}\n\t\t\t}",
"input.addFirst((a - b) + \"\")",
"input.addFirst",
"input",
"(a - b) + \"\"",
"(a - b)",
"a",
"b",
"\"\"",
"while(!rest.isEmpty()){\n\t\t\t\t\tinput.addFirst(rest.poll());\n\t\t\t\t}",
"!rest.isEmpty()",
"rest.isEmpty()",
"rest.isEmpty",
"rest",
"{\n\t\t\t\t\tinput.addFirst(rest.poll());\n\t\t\t\t}",
"input.addFirst(rest.poll())",
"input.addFirst",
"input",
"rest.poll()",
"rest.poll",
"rest",
"if(\"*\".equals(ops)){\n\t\t\t\tinput.addFirst((a * b) + \"\");\n\t\t\t\twhile(!rest.isEmpty()){\n\t\t\t\t\tinput.addFirst(rest.poll());\n\t\t\t\t}\n\t\t\t}else if(\"/\".equals(ops)){\n\t\t\t\tinput.addFirst((a / b) + \"\");\n\t\t\t\twhile(!rest.isEmpty()){\n\t\t\t\t\tinput.addFirst(rest.poll());\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\trest.addFirst(a + \"\");\n\t\t\t\tinput.addFirst(ops);\n\t\t\t\tinput.addFirst(b + \"\");\n\t\t\t}",
"\"*\".equals(ops)",
"\"*\".equals",
"\"*\"",
"ops",
"{\n\t\t\t\tinput.addFirst((a * b) + \"\");\n\t\t\t\twhile(!rest.isEmpty()){\n\t\t\t\t\tinput.addFirst(rest.poll());\n\t\t\t\t}\n\t\t\t}",
"input.addFirst((a * b) + \"\")",
"input.addFirst",
"input",
"(a * b) + \"\"",
"(a * b)",
"a",
"b",
"\"\"",
"while(!rest.isEmpty()){\n\t\t\t\t\tinput.addFirst(rest.poll());\n\t\t\t\t}",
"!rest.isEmpty()",
"rest.isEmpty()",
"rest.isEmpty",
"rest",
"{\n\t\t\t\t\tinput.addFirst(rest.poll());\n\t\t\t\t}",
"input.addFirst(rest.poll())",
"input.addFirst",
"input",
"rest.poll()",
"rest.poll",
"rest",
"if(\"/\".equals(ops)){\n\t\t\t\tinput.addFirst((a / b) + \"\");\n\t\t\t\twhile(!rest.isEmpty()){\n\t\t\t\t\tinput.addFirst(rest.poll());\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\trest.addFirst(a + \"\");\n\t\t\t\tinput.addFirst(ops);\n\t\t\t\tinput.addFirst(b + \"\");\n\t\t\t}",
"\"/\".equals(ops)",
"\"/\".equals",
"\"/\"",
"ops",
"{\n\t\t\t\tinput.addFirst((a / b) + \"\");\n\t\t\t\twhile(!rest.isEmpty()){\n\t\t\t\t\tinput.addFirst(rest.poll());\n\t\t\t\t}\n\t\t\t}",
"input.addFirst((a / b) + \"\")",
"input.addFirst",
"input",
"(a / b) + \"\"",
"(a / b)",
"a",
"b",
"\"\"",
"while(!rest.isEmpty()){\n\t\t\t\t\tinput.addFirst(rest.poll());\n\t\t\t\t}",
"!rest.isEmpty()",
"rest.isEmpty()",
"rest.isEmpty",
"rest",
"{\n\t\t\t\t\tinput.addFirst(rest.poll());\n\t\t\t\t}",
"input.addFirst(rest.poll())",
"input.addFirst",
"input",
"rest.poll()",
"rest.poll",
"rest",
"{\n\t\t\t\trest.addFirst(a + \"\");\n\t\t\t\tinput.addFirst(ops);\n\t\t\t\tinput.addFirst(b + \"\");\n\t\t\t}",
"rest.addFirst(a + \"\")",
"rest.addFirst",
"rest",
"a + \"\"",
"a",
"\"\"",
"input.addFirst(ops)",
"input.addFirst",
"input",
"ops",
"input.addFirst(b + \"\")",
"input.addFirst",
"input",
"b + \"\"",
"b",
"\"\"",
"String args[]",
"args",
"public class Main {\n\t\n\tpublic static void main(String args[]) {\n\t\tScanner sc = new Scanner(System.in);\n\t\t\n\t\tLinkedList<String> input = new LinkedList<String>();\n\t\twhile(sc.hasNext()){\n\t\t\tinput.addLast(sc.next());\n\t\t}\n\t\tLinkedList<String> rest = new LinkedList<String>();\n\t\t\n\t\twhile(!input.isEmpty()){\n\t\t\t//System.out.println(input + \" \" + rest);\n\t\t\tfinal int a = Integer.parseInt(input.poll());\n\t\t\tif(input.isEmpty()){\n\t\t\t\tSystem.out.println(a);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t\tfinal int b = Integer.parseInt(input.poll());\n\t\t\tfinal String ops = input.poll();\n\t\t\t\n\t\t\tif(\"+\".equals(ops)){\n\t\t\t\tinput.addFirst((a + b) + \"\");\n\t\t\t\twhile(!rest.isEmpty()){\n\t\t\t\t\tinput.addFirst(rest.poll());\n\t\t\t\t}\n\t\t\t}else if(\"-\".equals(ops)){\n\t\t\t\tinput.addFirst((a - b) + \"\");\n\t\t\t\twhile(!rest.isEmpty()){\n\t\t\t\t\tinput.addFirst(rest.poll());\n\t\t\t\t}\n\t\t\t}else if(\"*\".equals(ops)){\n\t\t\t\tinput.addFirst((a * b) + \"\");\n\t\t\t\twhile(!rest.isEmpty()){\n\t\t\t\t\tinput.addFirst(rest.poll());\n\t\t\t\t}\n\t\t\t}else if(\"/\".equals(ops)){\n\t\t\t\tinput.addFirst((a / b) + \"\");\n\t\t\t\twhile(!rest.isEmpty()){\n\t\t\t\t\tinput.addFirst(rest.poll());\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\trest.addFirst(a + \"\");\n\t\t\t\tinput.addFirst(ops);\n\t\t\t\tinput.addFirst(b + \"\");\n\t\t\t}\n\t\t}\n\t\t\n\t}\n}",
"public class Main {\n\t\n\tpublic static void main(String args[]) {\n\t\tScanner sc = new Scanner(System.in);\n\t\t\n\t\tLinkedList<String> input = new LinkedList<String>();\n\t\twhile(sc.hasNext()){\n\t\t\tinput.addLast(sc.next());\n\t\t}\n\t\tLinkedList<String> rest = new LinkedList<String>();\n\t\t\n\t\twhile(!input.isEmpty()){\n\t\t\t//System.out.println(input + \" \" + rest);\n\t\t\tfinal int a = Integer.parseInt(input.poll());\n\t\t\tif(input.isEmpty()){\n\t\t\t\tSystem.out.println(a);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t\tfinal int b = Integer.parseInt(input.poll());\n\t\t\tfinal String ops = input.poll();\n\t\t\t\n\t\t\tif(\"+\".equals(ops)){\n\t\t\t\tinput.addFirst((a + b) + \"\");\n\t\t\t\twhile(!rest.isEmpty()){\n\t\t\t\t\tinput.addFirst(rest.poll());\n\t\t\t\t}\n\t\t\t}else if(\"-\".equals(ops)){\n\t\t\t\tinput.addFirst((a - b) + \"\");\n\t\t\t\twhile(!rest.isEmpty()){\n\t\t\t\t\tinput.addFirst(rest.poll());\n\t\t\t\t}\n\t\t\t}else if(\"*\".equals(ops)){\n\t\t\t\tinput.addFirst((a * b) + \"\");\n\t\t\t\twhile(!rest.isEmpty()){\n\t\t\t\t\tinput.addFirst(rest.poll());\n\t\t\t\t}\n\t\t\t}else if(\"/\".equals(ops)){\n\t\t\t\tinput.addFirst((a / b) + \"\");\n\t\t\t\twhile(!rest.isEmpty()){\n\t\t\t\t\tinput.addFirst(rest.poll());\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\trest.addFirst(a + \"\");\n\t\t\t\tinput.addFirst(ops);\n\t\t\t\tinput.addFirst(b + \"\");\n\t\t\t}\n\t\t}\n\t\t\n\t}\n}",
"Main"
] | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.Map;
import java.util.Scanner;
public class Main {
public static void main(String args[]) {
Scanner sc = new Scanner(System.in);
LinkedList<String> input = new LinkedList<String>();
while(sc.hasNext()){
input.addLast(sc.next());
}
LinkedList<String> rest = new LinkedList<String>();
while(!input.isEmpty()){
//System.out.println(input + " " + rest);
final int a = Integer.parseInt(input.poll());
if(input.isEmpty()){
System.out.println(a);
break;
}
final int b = Integer.parseInt(input.poll());
final String ops = input.poll();
if("+".equals(ops)){
input.addFirst((a + b) + "");
while(!rest.isEmpty()){
input.addFirst(rest.poll());
}
}else if("-".equals(ops)){
input.addFirst((a - b) + "");
while(!rest.isEmpty()){
input.addFirst(rest.poll());
}
}else if("*".equals(ops)){
input.addFirst((a * b) + "");
while(!rest.isEmpty()){
input.addFirst(rest.poll());
}
}else if("/".equals(ops)){
input.addFirst((a / b) + "");
while(!rest.isEmpty()){
input.addFirst(rest.poll());
}
}else{
rest.addFirst(a + "");
input.addFirst(ops);
input.addFirst(b + "");
}
}
}
} |
[
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,
13,
42,
2,
13,
17,
30,
41,
13,
20,
41,
13,
17,
41,
13,
4,
18,
13,
17,
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,
2,
13,
17,
40,
13,
41,
13,
4,
18,
13,
2,
13,
17,
40,
13,
4,
18,
13,
13,
2,
13,
13,
40,
13,
14,
4,
18,
18,
13,
13,
17,
30,
41,
13,
4,
18,
13,
2,
13,
17,
40,
13,
41,
13,
4,
18,
13,
2,
13,
17,
40,
13,
4,
18,
13,
13,
2,
13,
13,
40,
13,
14,
4,
18,
18,
13,
13,
17,
30,
41,
13,
4,
18,
13,
2,
13,
17,
40,
13,
41,
13,
4,
18,
13,
2,
13,
17,
40,
13,
4,
18,
13,
13,
2,
13,
13,
40,
13,
30,
4,
18,
13,
13,
4,
18,
13,
18,
13,
13,
40,
13,
4,
18,
18,
13,
13,
4,
18,
13,
2,
13,
17,
0,
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
],
[
205,
17
],
[
205,
18
],
[
18,
19
],
[
18,
20
],
[
20,
21
],
[
21,
22
],
[
21,
23
],
[
20,
24
],
[
24,
25
],
[
24,
26
],
[
26,
27
],
[
27,
28
],
[
20,
29
],
[
29,
30
],
[
30,
31
],
[
30,
32
],
[
29,
33
],
[
33,
34
],
[
34,
35
],
[
34,
36
],
[
33,
37
],
[
37,
38
],
[
37,
39
],
[
33,
40
],
[
40,
41
],
[
40,
42
],
[
42,
43
],
[
43,
44
],
[
42,
45
],
[
42,
46
],
[
33,
47
],
[
47,
48
],
[
48,
49
],
[
49,
50
],
[
49,
51
],
[
47,
52
],
[
52,
53
],
[
52,
54
],
[
54,
55
],
[
54,
56
],
[
47,
57
],
[
57,
58
],
[
58,
59
],
[
47,
60
],
[
61,
61
],
[
61,
62
],
[
62,
63
],
[
63,
64
],
[
64,
65
],
[
65,
66
],
[
65,
67
],
[
63,
68
],
[
62,
69
],
[
69,
70
],
[
70,
71
],
[
70,
72
],
[
72,
73
],
[
73,
74
],
[
72,
75
],
[
75,
76
],
[
75,
77
],
[
69,
78
],
[
78,
79
],
[
69,
80
],
[
80,
81
],
[
80,
82
],
[
82,
83
],
[
83,
84
],
[
82,
85
],
[
85,
86
],
[
85,
87
],
[
69,
88
],
[
88,
89
],
[
69,
90
],
[
90,
91
],
[
91,
92
],
[
90,
93
],
[
90,
94
],
[
94,
95
],
[
94,
96
],
[
69,
97
],
[
97,
98
],
[
62,
99
],
[
99,
100
],
[
100,
101
],
[
101,
102
],
[
102,
103
],
[
102,
104
],
[
100,
105
],
[
99,
106
],
[
106,
107
],
[
107,
108
],
[
107,
109
],
[
109,
110
],
[
110,
111
],
[
109,
112
],
[
112,
113
],
[
112,
114
],
[
106,
115
],
[
115,
116
],
[
106,
117
],
[
117,
118
],
[
117,
119
],
[
119,
120
],
[
120,
121
],
[
119,
122
],
[
122,
123
],
[
122,
124
],
[
106,
125
],
[
125,
126
],
[
106,
127
],
[
127,
128
],
[
128,
129
],
[
127,
130
],
[
127,
131
],
[
131,
132
],
[
131,
133
],
[
106,
134
],
[
134,
135
],
[
99,
136
],
[
136,
137
],
[
137,
138
],
[
138,
139
],
[
139,
140
],
[
139,
141
],
[
137,
142
],
[
136,
143
],
[
143,
144
],
[
144,
145
],
[
144,
146
],
[
146,
147
],
[
147,
148
],
[
146,
149
],
[
149,
150
],
[
149,
151
],
[
143,
152
],
[
152,
153
],
[
143,
154
],
[
154,
155
],
[
154,
156
],
[
156,
157
],
[
157,
158
],
[
156,
159
],
[
159,
160
],
[
159,
161
],
[
143,
162
],
[
162,
163
],
[
143,
164
],
[
164,
165
],
[
165,
166
],
[
164,
167
],
[
164,
168
],
[
168,
169
],
[
168,
170
],
[
143,
171
],
[
171,
172
],
[
136,
173
],
[
173,
174
],
[
174,
175
],
[
175,
176
],
[
174,
177
],
[
174,
178
],
[
178,
179
],
[
179,
180
],
[
178,
181
],
[
181,
182
],
[
181,
183
],
[
173,
184
],
[
184,
185
],
[
33,
186
],
[
186,
187
],
[
187,
188
],
[
188,
189
],
[
188,
190
],
[
186,
191
],
[
191,
192
],
[
192,
193
],
[
191,
194
],
[
194,
195
],
[
194,
196
],
[
33,
197
],
[
197,
198
],
[
197,
199
],
[
199,
200
],
[
200,
201
],
[
18,
202
],
[
202,
203
],
[
0,
204
],
[
204,
205
],
[
204,
206
]
] | [
"import java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\nimport java.util.ArrayList;\nimport java.util.List;\n\npublic class Main {\n\tpublic static void main(String[] args) throws IOException {\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tString str = br.readLine();\n\t\twhile (str!=null) {\n\t\t\tList<Integer> stack = new ArrayList<>();\n\t\t\tint top = 0;\n\t\t\tString[] data = str.split(\" \", 0);\n\t\t\tfor (int i = 0; i < data.length; i++) {\n\t\t\t\tif (data[i].equals(\"+\")) {\n\t\t\t\t\tint x = stack.get(top - 1);\n\t\t\t\t\ttop--;\n\t\t\t\t\tint y = stack.get(top - 1);\n\t\t\t\t\ttop--;\n\t\t\t\t\tstack.add(top, x + y);\n\t\t\t\t\ttop++;\n\t\t\t\t} else if (data[i].equals(\"-\")) {\n\t\t\t\t\tint x = stack.get(top - 1);\n\t\t\t\t\ttop--;\n\t\t\t\t\tint y = stack.get(top - 1);\n\t\t\t\t\ttop--;\n\t\t\t\t\tstack.add(top, y - x);\n\t\t\t\t\ttop++;\n\t\t\t\t} else if (data[i].equals(\"*\")) {\n\t\t\t\t\tint x = stack.get(top - 1);\n\t\t\t\t\ttop--;\n\t\t\t\t\tint y = stack.get(top - 1);\n\t\t\t\t\ttop--;\n\t\t\t\t\tstack.add(top, x * y);\n\t\t\t\t\ttop++;\n\t\t\t\t} else {\n\t\t\t\t\tstack.add(top, Integer.parseInt(data[i]));\n\t\t\t\t\ttop++;\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(stack.get(top - 1));\n\t\t\tstr = br.readLine();\n\t\t}\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",
"import java.util.List;",
"List",
"java.util",
"public class Main {\n\tpublic static void main(String[] args) throws IOException {\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tString str = br.readLine();\n\t\twhile (str!=null) {\n\t\t\tList<Integer> stack = new ArrayList<>();\n\t\t\tint top = 0;\n\t\t\tString[] data = str.split(\" \", 0);\n\t\t\tfor (int i = 0; i < data.length; i++) {\n\t\t\t\tif (data[i].equals(\"+\")) {\n\t\t\t\t\tint x = stack.get(top - 1);\n\t\t\t\t\ttop--;\n\t\t\t\t\tint y = stack.get(top - 1);\n\t\t\t\t\ttop--;\n\t\t\t\t\tstack.add(top, x + y);\n\t\t\t\t\ttop++;\n\t\t\t\t} else if (data[i].equals(\"-\")) {\n\t\t\t\t\tint x = stack.get(top - 1);\n\t\t\t\t\ttop--;\n\t\t\t\t\tint y = stack.get(top - 1);\n\t\t\t\t\ttop--;\n\t\t\t\t\tstack.add(top, y - x);\n\t\t\t\t\ttop++;\n\t\t\t\t} else if (data[i].equals(\"*\")) {\n\t\t\t\t\tint x = stack.get(top - 1);\n\t\t\t\t\ttop--;\n\t\t\t\t\tint y = stack.get(top - 1);\n\t\t\t\t\ttop--;\n\t\t\t\t\tstack.add(top, x * y);\n\t\t\t\t\ttop++;\n\t\t\t\t} else {\n\t\t\t\t\tstack.add(top, Integer.parseInt(data[i]));\n\t\t\t\t\ttop++;\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(stack.get(top - 1));\n\t\t\tstr = br.readLine();\n\t\t}\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 str = br.readLine();\n\t\twhile (str!=null) {\n\t\t\tList<Integer> stack = new ArrayList<>();\n\t\t\tint top = 0;\n\t\t\tString[] data = str.split(\" \", 0);\n\t\t\tfor (int i = 0; i < data.length; i++) {\n\t\t\t\tif (data[i].equals(\"+\")) {\n\t\t\t\t\tint x = stack.get(top - 1);\n\t\t\t\t\ttop--;\n\t\t\t\t\tint y = stack.get(top - 1);\n\t\t\t\t\ttop--;\n\t\t\t\t\tstack.add(top, x + y);\n\t\t\t\t\ttop++;\n\t\t\t\t} else if (data[i].equals(\"-\")) {\n\t\t\t\t\tint x = stack.get(top - 1);\n\t\t\t\t\ttop--;\n\t\t\t\t\tint y = stack.get(top - 1);\n\t\t\t\t\ttop--;\n\t\t\t\t\tstack.add(top, y - x);\n\t\t\t\t\ttop++;\n\t\t\t\t} else if (data[i].equals(\"*\")) {\n\t\t\t\t\tint x = stack.get(top - 1);\n\t\t\t\t\ttop--;\n\t\t\t\t\tint y = stack.get(top - 1);\n\t\t\t\t\ttop--;\n\t\t\t\t\tstack.add(top, x * y);\n\t\t\t\t\ttop++;\n\t\t\t\t} else {\n\t\t\t\t\tstack.add(top, Integer.parseInt(data[i]));\n\t\t\t\t\ttop++;\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(stack.get(top - 1));\n\t\t\tstr = br.readLine();\n\t\t}\n\t}",
"main",
"{\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tString str = br.readLine();\n\t\twhile (str!=null) {\n\t\t\tList<Integer> stack = new ArrayList<>();\n\t\t\tint top = 0;\n\t\t\tString[] data = str.split(\" \", 0);\n\t\t\tfor (int i = 0; i < data.length; i++) {\n\t\t\t\tif (data[i].equals(\"+\")) {\n\t\t\t\t\tint x = stack.get(top - 1);\n\t\t\t\t\ttop--;\n\t\t\t\t\tint y = stack.get(top - 1);\n\t\t\t\t\ttop--;\n\t\t\t\t\tstack.add(top, x + y);\n\t\t\t\t\ttop++;\n\t\t\t\t} else if (data[i].equals(\"-\")) {\n\t\t\t\t\tint x = stack.get(top - 1);\n\t\t\t\t\ttop--;\n\t\t\t\t\tint y = stack.get(top - 1);\n\t\t\t\t\ttop--;\n\t\t\t\t\tstack.add(top, y - x);\n\t\t\t\t\ttop++;\n\t\t\t\t} else if (data[i].equals(\"*\")) {\n\t\t\t\t\tint x = stack.get(top - 1);\n\t\t\t\t\ttop--;\n\t\t\t\t\tint y = stack.get(top - 1);\n\t\t\t\t\ttop--;\n\t\t\t\t\tstack.add(top, x * y);\n\t\t\t\t\ttop++;\n\t\t\t\t} else {\n\t\t\t\t\tstack.add(top, Integer.parseInt(data[i]));\n\t\t\t\t\ttop++;\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(stack.get(top - 1));\n\t\t\tstr = br.readLine();\n\t\t}\n\t}",
"BufferedReader br = new BufferedReader(new InputStreamReader(System.in));",
"br",
"new BufferedReader(new InputStreamReader(System.in))",
"String str = br.readLine();",
"str",
"br.readLine()",
"br.readLine",
"br",
"while (str!=null) {\n\t\t\tList<Integer> stack = new ArrayList<>();\n\t\t\tint top = 0;\n\t\t\tString[] data = str.split(\" \", 0);\n\t\t\tfor (int i = 0; i < data.length; i++) {\n\t\t\t\tif (data[i].equals(\"+\")) {\n\t\t\t\t\tint x = stack.get(top - 1);\n\t\t\t\t\ttop--;\n\t\t\t\t\tint y = stack.get(top - 1);\n\t\t\t\t\ttop--;\n\t\t\t\t\tstack.add(top, x + y);\n\t\t\t\t\ttop++;\n\t\t\t\t} else if (data[i].equals(\"-\")) {\n\t\t\t\t\tint x = stack.get(top - 1);\n\t\t\t\t\ttop--;\n\t\t\t\t\tint y = stack.get(top - 1);\n\t\t\t\t\ttop--;\n\t\t\t\t\tstack.add(top, y - x);\n\t\t\t\t\ttop++;\n\t\t\t\t} else if (data[i].equals(\"*\")) {\n\t\t\t\t\tint x = stack.get(top - 1);\n\t\t\t\t\ttop--;\n\t\t\t\t\tint y = stack.get(top - 1);\n\t\t\t\t\ttop--;\n\t\t\t\t\tstack.add(top, x * y);\n\t\t\t\t\ttop++;\n\t\t\t\t} else {\n\t\t\t\t\tstack.add(top, Integer.parseInt(data[i]));\n\t\t\t\t\ttop++;\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(stack.get(top - 1));\n\t\t\tstr = br.readLine();\n\t\t}",
"str!=null",
"str",
"null",
"{\n\t\t\tList<Integer> stack = new ArrayList<>();\n\t\t\tint top = 0;\n\t\t\tString[] data = str.split(\" \", 0);\n\t\t\tfor (int i = 0; i < data.length; i++) {\n\t\t\t\tif (data[i].equals(\"+\")) {\n\t\t\t\t\tint x = stack.get(top - 1);\n\t\t\t\t\ttop--;\n\t\t\t\t\tint y = stack.get(top - 1);\n\t\t\t\t\ttop--;\n\t\t\t\t\tstack.add(top, x + y);\n\t\t\t\t\ttop++;\n\t\t\t\t} else if (data[i].equals(\"-\")) {\n\t\t\t\t\tint x = stack.get(top - 1);\n\t\t\t\t\ttop--;\n\t\t\t\t\tint y = stack.get(top - 1);\n\t\t\t\t\ttop--;\n\t\t\t\t\tstack.add(top, y - x);\n\t\t\t\t\ttop++;\n\t\t\t\t} else if (data[i].equals(\"*\")) {\n\t\t\t\t\tint x = stack.get(top - 1);\n\t\t\t\t\ttop--;\n\t\t\t\t\tint y = stack.get(top - 1);\n\t\t\t\t\ttop--;\n\t\t\t\t\tstack.add(top, x * y);\n\t\t\t\t\ttop++;\n\t\t\t\t} else {\n\t\t\t\t\tstack.add(top, Integer.parseInt(data[i]));\n\t\t\t\t\ttop++;\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(stack.get(top - 1));\n\t\t\tstr = br.readLine();\n\t\t}",
"List<Integer> stack = new ArrayList<>();",
"stack",
"new ArrayList<>()",
"int top = 0;",
"top",
"0",
"String[] data = str.split(\" \", 0);",
"data",
"str.split(\" \", 0)",
"str.split",
"str",
"\" \"",
"0",
"for (int i = 0; i < data.length; i++) {\n\t\t\t\tif (data[i].equals(\"+\")) {\n\t\t\t\t\tint x = stack.get(top - 1);\n\t\t\t\t\ttop--;\n\t\t\t\t\tint y = stack.get(top - 1);\n\t\t\t\t\ttop--;\n\t\t\t\t\tstack.add(top, x + y);\n\t\t\t\t\ttop++;\n\t\t\t\t} else if (data[i].equals(\"-\")) {\n\t\t\t\t\tint x = stack.get(top - 1);\n\t\t\t\t\ttop--;\n\t\t\t\t\tint y = stack.get(top - 1);\n\t\t\t\t\ttop--;\n\t\t\t\t\tstack.add(top, y - x);\n\t\t\t\t\ttop++;\n\t\t\t\t} else if (data[i].equals(\"*\")) {\n\t\t\t\t\tint x = stack.get(top - 1);\n\t\t\t\t\ttop--;\n\t\t\t\t\tint y = stack.get(top - 1);\n\t\t\t\t\ttop--;\n\t\t\t\t\tstack.add(top, x * y);\n\t\t\t\t\ttop++;\n\t\t\t\t} else {\n\t\t\t\t\tstack.add(top, Integer.parseInt(data[i]));\n\t\t\t\t\ttop++;\n\t\t\t\t}\n\t\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < data.length",
"i",
"data.length",
"data",
"data.length",
"i++",
"i++",
"i",
"{\n\t\t\t\tif (data[i].equals(\"+\")) {\n\t\t\t\t\tint x = stack.get(top - 1);\n\t\t\t\t\ttop--;\n\t\t\t\t\tint y = stack.get(top - 1);\n\t\t\t\t\ttop--;\n\t\t\t\t\tstack.add(top, x + y);\n\t\t\t\t\ttop++;\n\t\t\t\t} else if (data[i].equals(\"-\")) {\n\t\t\t\t\tint x = stack.get(top - 1);\n\t\t\t\t\ttop--;\n\t\t\t\t\tint y = stack.get(top - 1);\n\t\t\t\t\ttop--;\n\t\t\t\t\tstack.add(top, y - x);\n\t\t\t\t\ttop++;\n\t\t\t\t} else if (data[i].equals(\"*\")) {\n\t\t\t\t\tint x = stack.get(top - 1);\n\t\t\t\t\ttop--;\n\t\t\t\t\tint y = stack.get(top - 1);\n\t\t\t\t\ttop--;\n\t\t\t\t\tstack.add(top, x * y);\n\t\t\t\t\ttop++;\n\t\t\t\t} else {\n\t\t\t\t\tstack.add(top, Integer.parseInt(data[i]));\n\t\t\t\t\ttop++;\n\t\t\t\t}\n\t\t\t}",
"{\n\t\t\t\tif (data[i].equals(\"+\")) {\n\t\t\t\t\tint x = stack.get(top - 1);\n\t\t\t\t\ttop--;\n\t\t\t\t\tint y = stack.get(top - 1);\n\t\t\t\t\ttop--;\n\t\t\t\t\tstack.add(top, x + y);\n\t\t\t\t\ttop++;\n\t\t\t\t} else if (data[i].equals(\"-\")) {\n\t\t\t\t\tint x = stack.get(top - 1);\n\t\t\t\t\ttop--;\n\t\t\t\t\tint y = stack.get(top - 1);\n\t\t\t\t\ttop--;\n\t\t\t\t\tstack.add(top, y - x);\n\t\t\t\t\ttop++;\n\t\t\t\t} else if (data[i].equals(\"*\")) {\n\t\t\t\t\tint x = stack.get(top - 1);\n\t\t\t\t\ttop--;\n\t\t\t\t\tint y = stack.get(top - 1);\n\t\t\t\t\ttop--;\n\t\t\t\t\tstack.add(top, x * y);\n\t\t\t\t\ttop++;\n\t\t\t\t} else {\n\t\t\t\t\tstack.add(top, Integer.parseInt(data[i]));\n\t\t\t\t\ttop++;\n\t\t\t\t}\n\t\t\t}",
"if (data[i].equals(\"+\")) {\n\t\t\t\t\tint x = stack.get(top - 1);\n\t\t\t\t\ttop--;\n\t\t\t\t\tint y = stack.get(top - 1);\n\t\t\t\t\ttop--;\n\t\t\t\t\tstack.add(top, x + y);\n\t\t\t\t\ttop++;\n\t\t\t\t} else if (data[i].equals(\"-\")) {\n\t\t\t\t\tint x = stack.get(top - 1);\n\t\t\t\t\ttop--;\n\t\t\t\t\tint y = stack.get(top - 1);\n\t\t\t\t\ttop--;\n\t\t\t\t\tstack.add(top, y - x);\n\t\t\t\t\ttop++;\n\t\t\t\t} else if (data[i].equals(\"*\")) {\n\t\t\t\t\tint x = stack.get(top - 1);\n\t\t\t\t\ttop--;\n\t\t\t\t\tint y = stack.get(top - 1);\n\t\t\t\t\ttop--;\n\t\t\t\t\tstack.add(top, x * y);\n\t\t\t\t\ttop++;\n\t\t\t\t} else {\n\t\t\t\t\tstack.add(top, Integer.parseInt(data[i]));\n\t\t\t\t\ttop++;\n\t\t\t\t}",
"data[i].equals(\"+\")",
"data[i].equals",
"data[i]",
"data",
"i",
"\"+\"",
"{\n\t\t\t\t\tint x = stack.get(top - 1);\n\t\t\t\t\ttop--;\n\t\t\t\t\tint y = stack.get(top - 1);\n\t\t\t\t\ttop--;\n\t\t\t\t\tstack.add(top, x + y);\n\t\t\t\t\ttop++;\n\t\t\t\t}",
"int x = stack.get(top - 1);",
"x",
"stack.get(top - 1)",
"stack.get",
"stack",
"top - 1",
"top",
"1",
"top--",
"top",
"int y = stack.get(top - 1);",
"y",
"stack.get(top - 1)",
"stack.get",
"stack",
"top - 1",
"top",
"1",
"top--",
"top",
"stack.add(top, x + y)",
"stack.add",
"stack",
"top",
"x + y",
"x",
"y",
"top++",
"top",
"if (data[i].equals(\"-\")) {\n\t\t\t\t\tint x = stack.get(top - 1);\n\t\t\t\t\ttop--;\n\t\t\t\t\tint y = stack.get(top - 1);\n\t\t\t\t\ttop--;\n\t\t\t\t\tstack.add(top, y - x);\n\t\t\t\t\ttop++;\n\t\t\t\t} else if (data[i].equals(\"*\")) {\n\t\t\t\t\tint x = stack.get(top - 1);\n\t\t\t\t\ttop--;\n\t\t\t\t\tint y = stack.get(top - 1);\n\t\t\t\t\ttop--;\n\t\t\t\t\tstack.add(top, x * y);\n\t\t\t\t\ttop++;\n\t\t\t\t} else {\n\t\t\t\t\tstack.add(top, Integer.parseInt(data[i]));\n\t\t\t\t\ttop++;\n\t\t\t\t}",
"data[i].equals(\"-\")",
"data[i].equals",
"data[i]",
"data",
"i",
"\"-\"",
"{\n\t\t\t\t\tint x = stack.get(top - 1);\n\t\t\t\t\ttop--;\n\t\t\t\t\tint y = stack.get(top - 1);\n\t\t\t\t\ttop--;\n\t\t\t\t\tstack.add(top, y - x);\n\t\t\t\t\ttop++;\n\t\t\t\t}",
"int x = stack.get(top - 1);",
"x",
"stack.get(top - 1)",
"stack.get",
"stack",
"top - 1",
"top",
"1",
"top--",
"top",
"int y = stack.get(top - 1);",
"y",
"stack.get(top - 1)",
"stack.get",
"stack",
"top - 1",
"top",
"1",
"top--",
"top",
"stack.add(top, y - x)",
"stack.add",
"stack",
"top",
"y - x",
"y",
"x",
"top++",
"top",
"if (data[i].equals(\"*\")) {\n\t\t\t\t\tint x = stack.get(top - 1);\n\t\t\t\t\ttop--;\n\t\t\t\t\tint y = stack.get(top - 1);\n\t\t\t\t\ttop--;\n\t\t\t\t\tstack.add(top, x * y);\n\t\t\t\t\ttop++;\n\t\t\t\t} else {\n\t\t\t\t\tstack.add(top, Integer.parseInt(data[i]));\n\t\t\t\t\ttop++;\n\t\t\t\t}",
"data[i].equals(\"*\")",
"data[i].equals",
"data[i]",
"data",
"i",
"\"*\"",
"{\n\t\t\t\t\tint x = stack.get(top - 1);\n\t\t\t\t\ttop--;\n\t\t\t\t\tint y = stack.get(top - 1);\n\t\t\t\t\ttop--;\n\t\t\t\t\tstack.add(top, x * y);\n\t\t\t\t\ttop++;\n\t\t\t\t}",
"int x = stack.get(top - 1);",
"x",
"stack.get(top - 1)",
"stack.get",
"stack",
"top - 1",
"top",
"1",
"top--",
"top",
"int y = stack.get(top - 1);",
"y",
"stack.get(top - 1)",
"stack.get",
"stack",
"top - 1",
"top",
"1",
"top--",
"top",
"stack.add(top, x * y)",
"stack.add",
"stack",
"top",
"x * y",
"x",
"y",
"top++",
"top",
"{\n\t\t\t\t\tstack.add(top, Integer.parseInt(data[i]));\n\t\t\t\t\ttop++;\n\t\t\t\t}",
"stack.add(top, Integer.parseInt(data[i]))",
"stack.add",
"stack",
"top",
"Integer.parseInt(data[i])",
"Integer.parseInt",
"Integer",
"data[i]",
"data",
"i",
"top++",
"top",
"System.out.println(stack.get(top - 1))",
"System.out.println",
"System.out",
"System",
"System.out",
"stack.get(top - 1)",
"stack.get",
"stack",
"top - 1",
"top",
"1",
"str = br.readLine()",
"str",
"br.readLine()",
"br.readLine",
"br",
"String[] args",
"args",
"public class Main {\n\tpublic static void main(String[] args) throws IOException {\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tString str = br.readLine();\n\t\twhile (str!=null) {\n\t\t\tList<Integer> stack = new ArrayList<>();\n\t\t\tint top = 0;\n\t\t\tString[] data = str.split(\" \", 0);\n\t\t\tfor (int i = 0; i < data.length; i++) {\n\t\t\t\tif (data[i].equals(\"+\")) {\n\t\t\t\t\tint x = stack.get(top - 1);\n\t\t\t\t\ttop--;\n\t\t\t\t\tint y = stack.get(top - 1);\n\t\t\t\t\ttop--;\n\t\t\t\t\tstack.add(top, x + y);\n\t\t\t\t\ttop++;\n\t\t\t\t} else if (data[i].equals(\"-\")) {\n\t\t\t\t\tint x = stack.get(top - 1);\n\t\t\t\t\ttop--;\n\t\t\t\t\tint y = stack.get(top - 1);\n\t\t\t\t\ttop--;\n\t\t\t\t\tstack.add(top, y - x);\n\t\t\t\t\ttop++;\n\t\t\t\t} else if (data[i].equals(\"*\")) {\n\t\t\t\t\tint x = stack.get(top - 1);\n\t\t\t\t\ttop--;\n\t\t\t\t\tint y = stack.get(top - 1);\n\t\t\t\t\ttop--;\n\t\t\t\t\tstack.add(top, x * y);\n\t\t\t\t\ttop++;\n\t\t\t\t} else {\n\t\t\t\t\tstack.add(top, Integer.parseInt(data[i]));\n\t\t\t\t\ttop++;\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(stack.get(top - 1));\n\t\t\tstr = br.readLine();\n\t\t}\n\t}\n}",
"public class Main {\n\tpublic static void main(String[] args) throws IOException {\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tString str = br.readLine();\n\t\twhile (str!=null) {\n\t\t\tList<Integer> stack = new ArrayList<>();\n\t\t\tint top = 0;\n\t\t\tString[] data = str.split(\" \", 0);\n\t\t\tfor (int i = 0; i < data.length; i++) {\n\t\t\t\tif (data[i].equals(\"+\")) {\n\t\t\t\t\tint x = stack.get(top - 1);\n\t\t\t\t\ttop--;\n\t\t\t\t\tint y = stack.get(top - 1);\n\t\t\t\t\ttop--;\n\t\t\t\t\tstack.add(top, x + y);\n\t\t\t\t\ttop++;\n\t\t\t\t} else if (data[i].equals(\"-\")) {\n\t\t\t\t\tint x = stack.get(top - 1);\n\t\t\t\t\ttop--;\n\t\t\t\t\tint y = stack.get(top - 1);\n\t\t\t\t\ttop--;\n\t\t\t\t\tstack.add(top, y - x);\n\t\t\t\t\ttop++;\n\t\t\t\t} else if (data[i].equals(\"*\")) {\n\t\t\t\t\tint x = stack.get(top - 1);\n\t\t\t\t\ttop--;\n\t\t\t\t\tint y = stack.get(top - 1);\n\t\t\t\t\ttop--;\n\t\t\t\t\tstack.add(top, x * y);\n\t\t\t\t\ttop++;\n\t\t\t\t} else {\n\t\t\t\t\tstack.add(top, Integer.parseInt(data[i]));\n\t\t\t\t\ttop++;\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(stack.get(top - 1));\n\t\t\tstr = br.readLine();\n\t\t}\n\t}\n}",
"Main"
] | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String str = br.readLine();
while (str!=null) {
List<Integer> stack = new ArrayList<>();
int top = 0;
String[] data = str.split(" ", 0);
for (int i = 0; i < data.length; i++) {
if (data[i].equals("+")) {
int x = stack.get(top - 1);
top--;
int y = stack.get(top - 1);
top--;
stack.add(top, x + y);
top++;
} else if (data[i].equals("-")) {
int x = stack.get(top - 1);
top--;
int y = stack.get(top - 1);
top--;
stack.add(top, y - x);
top++;
} else if (data[i].equals("*")) {
int x = stack.get(top - 1);
top--;
int y = stack.get(top - 1);
top--;
stack.add(top, x * y);
top++;
} else {
stack.add(top, Integer.parseInt(data[i]));
top++;
}
}
System.out.println(stack.get(top - 1));
str = br.readLine();
}
}
} |
[
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,
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
],
[
167,
8
],
[
167,
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
],
[
26,
28
],
[
11,
29
],
[
29,
30
],
[
29,
31
],
[
11,
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
],
[
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
],
[
46,
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
],
[
79,
96
],
[
46,
97
],
[
97,
98
],
[
98,
99
],
[
99,
100
],
[
100,
101
],
[
100,
102
],
[
98,
103
],
[
97,
104
],
[
104,
105
],
[
105,
106
],
[
105,
107
],
[
107,
108
],
[
108,
109
],
[
104,
110
],
[
110,
111
],
[
110,
112
],
[
112,
113
],
[
113,
114
],
[
104,
115
],
[
115,
116
],
[
116,
117
],
[
115,
118
],
[
118,
119
],
[
118,
120
],
[
104,
121
],
[
46,
122
],
[
122,
123
],
[
123,
124
],
[
124,
125
],
[
125,
126
],
[
125,
127
],
[
123,
128
],
[
122,
129
],
[
129,
130
],
[
130,
131
],
[
130,
132
],
[
132,
133
],
[
133,
134
],
[
129,
135
],
[
135,
136
],
[
135,
137
],
[
137,
138
],
[
138,
139
],
[
129,
140
],
[
140,
141
],
[
141,
142
],
[
140,
143
],
[
143,
144
],
[
143,
145
],
[
129,
146
],
[
46,
147
],
[
147,
148
],
[
148,
149
],
[
147,
150
],
[
150,
151
],
[
151,
152
],
[
150,
153
],
[
153,
154
],
[
153,
155
],
[
11,
156
],
[
156,
157
],
[
157,
158
],
[
158,
159
],
[
158,
160
],
[
156,
161
],
[
161,
162
],
[
162,
163
],
[
9,
164
],
[
164,
165
],
[
0,
166
],
[
166,
167
],
[
166,
168
]
] | [
"import java.util.Scanner;\nimport java.util.Stack;\n\npublic class Main {\n\n public static void main(String args[]) {\n Scanner scan = new Scanner(System.in);\n String[] A = scan.nextLine().split(\" \");\n\t\n Stack<Integer> num = new Stack<Integer>();\n int a = 0;\n int b = 0;\n for (int i = 0; i < A.length; i++) {\n if (A[i].equals(\"+\")) {\n a = num.pop();\n b = num.pop();\n num.add(b + a);\n continue;\n }\n if (A[i].equals(\"-\")) {\n a = num.pop();\n b = num.pop();\n num.add(b - a);\n continue;\n }\n if (A[i].equals(\"*\")) {\n a = num.pop();\n b = num.pop();\n num.add(b * a);\n continue;\n }\n if (A[i].equals(\"/\")) {\n a = num.pop();\n b = num.pop();\n num.add(b / a);\n continue;\n }\n num.push(Integer.parseInt(A[i]));\n }\n System.out.println(num.pop());\n }\n}\n",
"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 Scanner scan = new Scanner(System.in);\n String[] A = scan.nextLine().split(\" \");\n\t\n Stack<Integer> num = new Stack<Integer>();\n int a = 0;\n int b = 0;\n for (int i = 0; i < A.length; i++) {\n if (A[i].equals(\"+\")) {\n a = num.pop();\n b = num.pop();\n num.add(b + a);\n continue;\n }\n if (A[i].equals(\"-\")) {\n a = num.pop();\n b = num.pop();\n num.add(b - a);\n continue;\n }\n if (A[i].equals(\"*\")) {\n a = num.pop();\n b = num.pop();\n num.add(b * a);\n continue;\n }\n if (A[i].equals(\"/\")) {\n a = num.pop();\n b = num.pop();\n num.add(b / a);\n continue;\n }\n num.push(Integer.parseInt(A[i]));\n }\n System.out.println(num.pop());\n }\n}",
"Main",
"public static void main(String args[]) {\n Scanner scan = new Scanner(System.in);\n String[] A = scan.nextLine().split(\" \");\n\t\n Stack<Integer> num = new Stack<Integer>();\n int a = 0;\n int b = 0;\n for (int i = 0; i < A.length; i++) {\n if (A[i].equals(\"+\")) {\n a = num.pop();\n b = num.pop();\n num.add(b + a);\n continue;\n }\n if (A[i].equals(\"-\")) {\n a = num.pop();\n b = num.pop();\n num.add(b - a);\n continue;\n }\n if (A[i].equals(\"*\")) {\n a = num.pop();\n b = num.pop();\n num.add(b * a);\n continue;\n }\n if (A[i].equals(\"/\")) {\n a = num.pop();\n b = num.pop();\n num.add(b / a);\n continue;\n }\n num.push(Integer.parseInt(A[i]));\n }\n System.out.println(num.pop());\n }",
"main",
"{\n Scanner scan = new Scanner(System.in);\n String[] A = scan.nextLine().split(\" \");\n\t\n Stack<Integer> num = new Stack<Integer>();\n int a = 0;\n int b = 0;\n for (int i = 0; i < A.length; i++) {\n if (A[i].equals(\"+\")) {\n a = num.pop();\n b = num.pop();\n num.add(b + a);\n continue;\n }\n if (A[i].equals(\"-\")) {\n a = num.pop();\n b = num.pop();\n num.add(b - a);\n continue;\n }\n if (A[i].equals(\"*\")) {\n a = num.pop();\n b = num.pop();\n num.add(b * a);\n continue;\n }\n if (A[i].equals(\"/\")) {\n a = num.pop();\n b = num.pop();\n num.add(b / a);\n continue;\n }\n num.push(Integer.parseInt(A[i]));\n }\n System.out.println(num.pop());\n }",
"Scanner scan = new Scanner(System.in);",
"scan",
"new Scanner(System.in)",
"String[] A = scan.nextLine().split(\" \");",
"A",
"scan.nextLine().split(\" \")",
"scan.nextLine().split",
"scan.nextLine()",
"scan.nextLine",
"scan",
"\" \"",
"Stack<Integer> num = new Stack<Integer>();",
"num",
"new Stack<Integer>()",
"int a = 0;",
"a",
"0",
"int b = 0;",
"b",
"0",
"for (int i = 0; i < A.length; i++) {\n if (A[i].equals(\"+\")) {\n a = num.pop();\n b = num.pop();\n num.add(b + a);\n continue;\n }\n if (A[i].equals(\"-\")) {\n a = num.pop();\n b = num.pop();\n num.add(b - a);\n continue;\n }\n if (A[i].equals(\"*\")) {\n a = num.pop();\n b = num.pop();\n num.add(b * a);\n continue;\n }\n if (A[i].equals(\"/\")) {\n a = num.pop();\n b = num.pop();\n num.add(b / a);\n continue;\n }\n num.push(Integer.parseInt(A[i]));\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < A.length",
"i",
"A.length",
"A",
"A.length",
"i++",
"i++",
"i",
"{\n if (A[i].equals(\"+\")) {\n a = num.pop();\n b = num.pop();\n num.add(b + a);\n continue;\n }\n if (A[i].equals(\"-\")) {\n a = num.pop();\n b = num.pop();\n num.add(b - a);\n continue;\n }\n if (A[i].equals(\"*\")) {\n a = num.pop();\n b = num.pop();\n num.add(b * a);\n continue;\n }\n if (A[i].equals(\"/\")) {\n a = num.pop();\n b = num.pop();\n num.add(b / a);\n continue;\n }\n num.push(Integer.parseInt(A[i]));\n }",
"{\n if (A[i].equals(\"+\")) {\n a = num.pop();\n b = num.pop();\n num.add(b + a);\n continue;\n }\n if (A[i].equals(\"-\")) {\n a = num.pop();\n b = num.pop();\n num.add(b - a);\n continue;\n }\n if (A[i].equals(\"*\")) {\n a = num.pop();\n b = num.pop();\n num.add(b * a);\n continue;\n }\n if (A[i].equals(\"/\")) {\n a = num.pop();\n b = num.pop();\n num.add(b / a);\n continue;\n }\n num.push(Integer.parseInt(A[i]));\n }",
"if (A[i].equals(\"+\")) {\n a = num.pop();\n b = num.pop();\n num.add(b + a);\n continue;\n }",
"A[i].equals(\"+\")",
"A[i].equals",
"A[i]",
"A",
"i",
"\"+\"",
"{\n a = num.pop();\n b = num.pop();\n num.add(b + a);\n continue;\n }",
"a = num.pop()",
"a",
"num.pop()",
"num.pop",
"num",
"b = num.pop()",
"b",
"num.pop()",
"num.pop",
"num",
"num.add(b + a)",
"num.add",
"num",
"b + a",
"b",
"a",
"continue;",
"if (A[i].equals(\"-\")) {\n a = num.pop();\n b = num.pop();\n num.add(b - a);\n continue;\n }",
"A[i].equals(\"-\")",
"A[i].equals",
"A[i]",
"A",
"i",
"\"-\"",
"{\n a = num.pop();\n b = num.pop();\n num.add(b - a);\n continue;\n }",
"a = num.pop()",
"a",
"num.pop()",
"num.pop",
"num",
"b = num.pop()",
"b",
"num.pop()",
"num.pop",
"num",
"num.add(b - a)",
"num.add",
"num",
"b - a",
"b",
"a",
"continue;",
"if (A[i].equals(\"*\")) {\n a = num.pop();\n b = num.pop();\n num.add(b * a);\n continue;\n }",
"A[i].equals(\"*\")",
"A[i].equals",
"A[i]",
"A",
"i",
"\"*\"",
"{\n a = num.pop();\n b = num.pop();\n num.add(b * a);\n continue;\n }",
"a = num.pop()",
"a",
"num.pop()",
"num.pop",
"num",
"b = num.pop()",
"b",
"num.pop()",
"num.pop",
"num",
"num.add(b * a)",
"num.add",
"num",
"b * a",
"b",
"a",
"continue;",
"if (A[i].equals(\"/\")) {\n a = num.pop();\n b = num.pop();\n num.add(b / a);\n continue;\n }",
"A[i].equals(\"/\")",
"A[i].equals",
"A[i]",
"A",
"i",
"\"/\"",
"{\n a = num.pop();\n b = num.pop();\n num.add(b / a);\n continue;\n }",
"a = num.pop()",
"a",
"num.pop()",
"num.pop",
"num",
"b = num.pop()",
"b",
"num.pop()",
"num.pop",
"num",
"num.add(b / a)",
"num.add",
"num",
"b / a",
"b",
"a",
"continue;",
"num.push(Integer.parseInt(A[i]))",
"num.push",
"num",
"Integer.parseInt(A[i])",
"Integer.parseInt",
"Integer",
"A[i]",
"A",
"i",
"System.out.println(num.pop())",
"System.out.println",
"System.out",
"System",
"System.out",
"num.pop()",
"num.pop",
"num",
"String args[]",
"args",
"public class Main {\n\n public static void main(String args[]) {\n Scanner scan = new Scanner(System.in);\n String[] A = scan.nextLine().split(\" \");\n\t\n Stack<Integer> num = new Stack<Integer>();\n int a = 0;\n int b = 0;\n for (int i = 0; i < A.length; i++) {\n if (A[i].equals(\"+\")) {\n a = num.pop();\n b = num.pop();\n num.add(b + a);\n continue;\n }\n if (A[i].equals(\"-\")) {\n a = num.pop();\n b = num.pop();\n num.add(b - a);\n continue;\n }\n if (A[i].equals(\"*\")) {\n a = num.pop();\n b = num.pop();\n num.add(b * a);\n continue;\n }\n if (A[i].equals(\"/\")) {\n a = num.pop();\n b = num.pop();\n num.add(b / a);\n continue;\n }\n num.push(Integer.parseInt(A[i]));\n }\n System.out.println(num.pop());\n }\n}",
"public class Main {\n\n public static void main(String args[]) {\n Scanner scan = new Scanner(System.in);\n String[] A = scan.nextLine().split(\" \");\n\t\n Stack<Integer> num = new Stack<Integer>();\n int a = 0;\n int b = 0;\n for (int i = 0; i < A.length; i++) {\n if (A[i].equals(\"+\")) {\n a = num.pop();\n b = num.pop();\n num.add(b + a);\n continue;\n }\n if (A[i].equals(\"-\")) {\n a = num.pop();\n b = num.pop();\n num.add(b - a);\n continue;\n }\n if (A[i].equals(\"*\")) {\n a = num.pop();\n b = num.pop();\n num.add(b * a);\n continue;\n }\n if (A[i].equals(\"/\")) {\n a = num.pop();\n b = num.pop();\n num.add(b / a);\n continue;\n }\n num.push(Integer.parseInt(A[i]));\n }\n System.out.println(num.pop());\n }\n}",
"Main"
] | import java.util.Scanner;
import java.util.Stack;
public class Main {
public static void main(String args[]) {
Scanner scan = new Scanner(System.in);
String[] A = scan.nextLine().split(" ");
Stack<Integer> num = new Stack<Integer>();
int a = 0;
int b = 0;
for (int i = 0; i < A.length; i++) {
if (A[i].equals("+")) {
a = num.pop();
b = num.pop();
num.add(b + a);
continue;
}
if (A[i].equals("-")) {
a = num.pop();
b = num.pop();
num.add(b - a);
continue;
}
if (A[i].equals("*")) {
a = num.pop();
b = num.pop();
num.add(b * a);
continue;
}
if (A[i].equals("/")) {
a = num.pop();
b = num.pop();
num.add(b / a);
continue;
}
num.push(Integer.parseInt(A[i]));
}
System.out.println(num.pop());
}
}
|
[
7,
15,
13,
17,
6,
13,
41,
13,
17,
41,
13,
17,
12,
13,
30,
41,
13,
20,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
17,
28,
13,
13,
30,
30,
14,
4,
18,
13,
17,
3,
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,
13,
4,
18,
18,
13,
13,
4,
18,
4,
18,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
133,
5
],
[
133,
6
],
[
6,
7
],
[
6,
8
],
[
133,
9
],
[
9,
10
],
[
9,
11
],
[
133,
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
],
[
14,
26
],
[
26,
27
],
[
26,
28
],
[
28,
29
],
[
29,
30
],
[
28,
31
],
[
14,
32
],
[
32,
33
],
[
32,
34
],
[
32,
35
],
[
36,
36
],
[
36,
37
],
[
37,
38
],
[
38,
39
],
[
39,
40
],
[
38,
41
],
[
37,
42
],
[
36,
43
],
[
43,
44
],
[
44,
45
],
[
45,
46
],
[
44,
47
],
[
43,
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
],
[
43,
65
],
[
65,
66
],
[
66,
67
],
[
67,
68
],
[
66,
69
],
[
65,
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
],
[
65,
87
],
[
87,
88
],
[
88,
89
],
[
89,
90
],
[
88,
91
],
[
87,
92
],
[
92,
93
],
[
93,
94
],
[
93,
95
],
[
95,
96
],
[
96,
97
],
[
92,
98
],
[
98,
99
],
[
98,
100
],
[
100,
101
],
[
101,
102
],
[
92,
103
],
[
103,
104
],
[
104,
105
],
[
103,
106
],
[
106,
107
],
[
106,
108
],
[
87,
109
],
[
109,
110
],
[
110,
111
],
[
111,
112
],
[
110,
113
],
[
113,
114
],
[
114,
115
],
[
113,
116
],
[
14,
117
],
[
117,
118
],
[
118,
119
],
[
14,
120
],
[
120,
121
],
[
121,
122
],
[
122,
123
],
[
122,
124
],
[
120,
125
],
[
125,
126
],
[
126,
127
],
[
127,
128
],
[
128,
129
],
[
12,
130
],
[
130,
131
],
[
0,
132
],
[
132,
133
],
[
132,
134
]
] | [
"import java.util.*;\n\npublic class Main{\n\tfinal static int MOD = 1000000007;\n\tfinal static int INF = 1000000000;\n\n\tpublic static void main(String[] args){\n\t\tDeque<Integer> S = new ArrayDeque<Integer>();\n\t\tScanner sc = new Scanner(System.in);\n\t\tString line = sc.nextLine();\n\t\tString[] str = line.split(\" \");\n\t\tfor(String s : str){\n\t\t\tif(s.equals(\"\"))\n\t\t\t\tbreak;\n\t\t\tif(s.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\tSystem.out.printf(\"%d + %d = %d\\n\", a, b, a+b);\n\t\t\t}else if(s.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\tSystem.out.printf(\"%d - %d = %d\\n\", a, b, a - b);\n\t\t\t}else if(s.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\tSystem.out.printf(\"%d * %d = %d\\n\", a, b, a * b);\n\t\t\t}else{\n\t\t\t\tS.push(Integer.parseInt(s));\n//\t\t\t\tSystem.out.printf(\"insert %d\\n\", Integer.parseInt(s));\n\t\t\t}\n//\t\t\tSystem.out.println(S);\n\t\t}\n\t\tsc.close();\n\t\tSystem.out.println(S.getFirst().intValue());\n\n\t}\n\n}",
"import java.util.*;",
"util.*",
"java",
"public class Main{\n\tfinal static int MOD = 1000000007;\n\tfinal static int INF = 1000000000;\n\n\tpublic static void main(String[] args){\n\t\tDeque<Integer> S = new ArrayDeque<Integer>();\n\t\tScanner sc = new Scanner(System.in);\n\t\tString line = sc.nextLine();\n\t\tString[] str = line.split(\" \");\n\t\tfor(String s : str){\n\t\t\tif(s.equals(\"\"))\n\t\t\t\tbreak;\n\t\t\tif(s.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\tSystem.out.printf(\"%d + %d = %d\\n\", a, b, a+b);\n\t\t\t}else if(s.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\tSystem.out.printf(\"%d - %d = %d\\n\", a, b, a - b);\n\t\t\t}else if(s.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\tSystem.out.printf(\"%d * %d = %d\\n\", a, b, a * b);\n\t\t\t}else{\n\t\t\t\tS.push(Integer.parseInt(s));\n//\t\t\t\tSystem.out.printf(\"insert %d\\n\", Integer.parseInt(s));\n\t\t\t}\n//\t\t\tSystem.out.println(S);\n\t\t}\n\t\tsc.close();\n\t\tSystem.out.println(S.getFirst().intValue());\n\n\t}\n\n}",
"Main",
"final static int MOD = 1000000007;",
"MOD",
"1000000007",
"final static int INF = 1000000000;",
"INF",
"1000000000",
"public static void main(String[] args){\n\t\tDeque<Integer> S = new ArrayDeque<Integer>();\n\t\tScanner sc = new Scanner(System.in);\n\t\tString line = sc.nextLine();\n\t\tString[] str = line.split(\" \");\n\t\tfor(String s : str){\n\t\t\tif(s.equals(\"\"))\n\t\t\t\tbreak;\n\t\t\tif(s.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\tSystem.out.printf(\"%d + %d = %d\\n\", a, b, a+b);\n\t\t\t}else if(s.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\tSystem.out.printf(\"%d - %d = %d\\n\", a, b, a - b);\n\t\t\t}else if(s.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\tSystem.out.printf(\"%d * %d = %d\\n\", a, b, a * b);\n\t\t\t}else{\n\t\t\t\tS.push(Integer.parseInt(s));\n//\t\t\t\tSystem.out.printf(\"insert %d\\n\", Integer.parseInt(s));\n\t\t\t}\n//\t\t\tSystem.out.println(S);\n\t\t}\n\t\tsc.close();\n\t\tSystem.out.println(S.getFirst().intValue());\n\n\t}",
"main",
"{\n\t\tDeque<Integer> S = new ArrayDeque<Integer>();\n\t\tScanner sc = new Scanner(System.in);\n\t\tString line = sc.nextLine();\n\t\tString[] str = line.split(\" \");\n\t\tfor(String s : str){\n\t\t\tif(s.equals(\"\"))\n\t\t\t\tbreak;\n\t\t\tif(s.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\tSystem.out.printf(\"%d + %d = %d\\n\", a, b, a+b);\n\t\t\t}else if(s.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\tSystem.out.printf(\"%d - %d = %d\\n\", a, b, a - b);\n\t\t\t}else if(s.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\tSystem.out.printf(\"%d * %d = %d\\n\", a, b, a * b);\n\t\t\t}else{\n\t\t\t\tS.push(Integer.parseInt(s));\n//\t\t\t\tSystem.out.printf(\"insert %d\\n\", Integer.parseInt(s));\n\t\t\t}\n//\t\t\tSystem.out.println(S);\n\t\t}\n\t\tsc.close();\n\t\tSystem.out.println(S.getFirst().intValue());\n\n\t}",
"Deque<Integer> S = new ArrayDeque<Integer>();",
"S",
"new ArrayDeque<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(String s : str){\n\t\t\tif(s.equals(\"\"))\n\t\t\t\tbreak;\n\t\t\tif(s.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\tSystem.out.printf(\"%d + %d = %d\\n\", a, b, a+b);\n\t\t\t}else if(s.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\tSystem.out.printf(\"%d - %d = %d\\n\", a, b, a - b);\n\t\t\t}else if(s.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\tSystem.out.printf(\"%d * %d = %d\\n\", a, b, a * b);\n\t\t\t}else{\n\t\t\t\tS.push(Integer.parseInt(s));\n//\t\t\t\tSystem.out.printf(\"insert %d\\n\", Integer.parseInt(s));\n\t\t\t}\n//\t\t\tSystem.out.println(S);\n\t\t}",
"String s",
"str",
"{\n\t\t\tif(s.equals(\"\"))\n\t\t\t\tbreak;\n\t\t\tif(s.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\tSystem.out.printf(\"%d + %d = %d\\n\", a, b, a+b);\n\t\t\t}else if(s.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\tSystem.out.printf(\"%d - %d = %d\\n\", a, b, a - b);\n\t\t\t}else if(s.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\tSystem.out.printf(\"%d * %d = %d\\n\", a, b, a * b);\n\t\t\t}else{\n\t\t\t\tS.push(Integer.parseInt(s));\n//\t\t\t\tSystem.out.printf(\"insert %d\\n\", Integer.parseInt(s));\n\t\t\t}\n//\t\t\tSystem.out.println(S);\n\t\t}",
"{\n\t\t\tif(s.equals(\"\"))\n\t\t\t\tbreak;\n\t\t\tif(s.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\tSystem.out.printf(\"%d + %d = %d\\n\", a, b, a+b);\n\t\t\t}else if(s.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\tSystem.out.printf(\"%d - %d = %d\\n\", a, b, a - b);\n\t\t\t}else if(s.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\tSystem.out.printf(\"%d * %d = %d\\n\", a, b, a * b);\n\t\t\t}else{\n\t\t\t\tS.push(Integer.parseInt(s));\n//\t\t\t\tSystem.out.printf(\"insert %d\\n\", Integer.parseInt(s));\n\t\t\t}\n//\t\t\tSystem.out.println(S);\n\t\t}",
"if(s.equals(\"\"))\n\t\t\t\tbreak;",
"s.equals(\"\")",
"s.equals",
"s",
"\"\"",
"break;",
"if(s.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\tSystem.out.printf(\"%d + %d = %d\\n\", a, b, a+b);\n\t\t\t}else if(s.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\tSystem.out.printf(\"%d - %d = %d\\n\", a, b, a - b);\n\t\t\t}else if(s.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\tSystem.out.printf(\"%d * %d = %d\\n\", a, b, a * b);\n\t\t\t}else{\n\t\t\t\tS.push(Integer.parseInt(s));\n//\t\t\t\tSystem.out.printf(\"insert %d\\n\", Integer.parseInt(s));\n\t\t\t}",
"s.equals(\"+\")",
"s.equals",
"s",
"\"+\"",
"{\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\tSystem.out.printf(\"%d + %d = %d\\n\", a, b, 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(s.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\tSystem.out.printf(\"%d - %d = %d\\n\", a, b, a - b);\n\t\t\t}else if(s.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\tSystem.out.printf(\"%d * %d = %d\\n\", a, b, a * b);\n\t\t\t}else{\n\t\t\t\tS.push(Integer.parseInt(s));\n//\t\t\t\tSystem.out.printf(\"insert %d\\n\", Integer.parseInt(s));\n\t\t\t}",
"s.equals(\"-\")",
"s.equals",
"s",
"\"-\"",
"{\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\tSystem.out.printf(\"%d - %d = %d\\n\", a, b, 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(s.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\tSystem.out.printf(\"%d * %d = %d\\n\", a, b, a * b);\n\t\t\t}else{\n\t\t\t\tS.push(Integer.parseInt(s));\n//\t\t\t\tSystem.out.printf(\"insert %d\\n\", Integer.parseInt(s));\n\t\t\t}",
"s.equals(\"*\")",
"s.equals",
"s",
"\"*\"",
"{\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\tSystem.out.printf(\"%d * %d = %d\\n\", a, b, 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(s));\n//\t\t\t\tSystem.out.printf(\"insert %d\\n\", Integer.parseInt(s));\n\t\t\t}",
"S.push(Integer.parseInt(s))",
"S.push",
"S",
"Integer.parseInt(s)",
"Integer.parseInt",
"Integer",
"s",
"sc.close()",
"sc.close",
"sc",
"System.out.println(S.getFirst().intValue())",
"System.out.println",
"System.out",
"System",
"System.out",
"S.getFirst().intValue()",
"S.getFirst().intValue",
"S.getFirst()",
"S.getFirst",
"S",
"String[] args",
"args",
"public class Main{\n\tfinal static int MOD = 1000000007;\n\tfinal static int INF = 1000000000;\n\n\tpublic static void main(String[] args){\n\t\tDeque<Integer> S = new ArrayDeque<Integer>();\n\t\tScanner sc = new Scanner(System.in);\n\t\tString line = sc.nextLine();\n\t\tString[] str = line.split(\" \");\n\t\tfor(String s : str){\n\t\t\tif(s.equals(\"\"))\n\t\t\t\tbreak;\n\t\t\tif(s.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\tSystem.out.printf(\"%d + %d = %d\\n\", a, b, a+b);\n\t\t\t}else if(s.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\tSystem.out.printf(\"%d - %d = %d\\n\", a, b, a - b);\n\t\t\t}else if(s.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\tSystem.out.printf(\"%d * %d = %d\\n\", a, b, a * b);\n\t\t\t}else{\n\t\t\t\tS.push(Integer.parseInt(s));\n//\t\t\t\tSystem.out.printf(\"insert %d\\n\", Integer.parseInt(s));\n\t\t\t}\n//\t\t\tSystem.out.println(S);\n\t\t}\n\t\tsc.close();\n\t\tSystem.out.println(S.getFirst().intValue());\n\n\t}\n\n}",
"public class Main{\n\tfinal static int MOD = 1000000007;\n\tfinal static int INF = 1000000000;\n\n\tpublic static void main(String[] args){\n\t\tDeque<Integer> S = new ArrayDeque<Integer>();\n\t\tScanner sc = new Scanner(System.in);\n\t\tString line = sc.nextLine();\n\t\tString[] str = line.split(\" \");\n\t\tfor(String s : str){\n\t\t\tif(s.equals(\"\"))\n\t\t\t\tbreak;\n\t\t\tif(s.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\tSystem.out.printf(\"%d + %d = %d\\n\", a, b, a+b);\n\t\t\t}else if(s.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\tSystem.out.printf(\"%d - %d = %d\\n\", a, b, a - b);\n\t\t\t}else if(s.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\tSystem.out.printf(\"%d * %d = %d\\n\", a, b, a * b);\n\t\t\t}else{\n\t\t\t\tS.push(Integer.parseInt(s));\n//\t\t\t\tSystem.out.printf(\"insert %d\\n\", Integer.parseInt(s));\n\t\t\t}\n//\t\t\tSystem.out.println(S);\n\t\t}\n\t\tsc.close();\n\t\tSystem.out.println(S.getFirst().intValue());\n\n\t}\n\n}",
"Main"
] | import java.util.*;
public class Main{
final static int MOD = 1000000007;
final static int INF = 1000000000;
public static void main(String[] args){
Deque<Integer> S = new ArrayDeque<Integer>();
Scanner sc = new Scanner(System.in);
String line = sc.nextLine();
String[] str = line.split(" ");
for(String s : str){
if(s.equals(""))
break;
if(s.equals("+")){
int b = S.pop();
int a = S.pop();
S.push(a + b);
// System.out.printf("%d + %d = %d\n", a, b, a+b);
}else if(s.equals("-")){
int b = S.pop();
int a = S.pop();
S.push(a - b);
// System.out.printf("%d - %d = %d\n", a, b, a - b);
}else if(s.equals("*")){
int b = S.pop();
int a = S.pop();
S.push(a * b);
// System.out.printf("%d * %d = %d\n", a, b, a * b);
}else{
S.push(Integer.parseInt(s));
// System.out.printf("insert %d\n", Integer.parseInt(s));
}
// System.out.println(S);
}
sc.close();
System.out.println(S.getFirst().intValue());
}
}
|
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.