node_ids
listlengths 4
1.4k
| edge_index
listlengths 1
2.22k
| text
listlengths 4
1.4k
| source
stringlengths 14
427k
|
---|---|---|---|
[
7,
0,
13,
4,
13,
4,
13,
0,
13,
2,
2,
39,
17,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
39,
4,
13,
17,
0,
13,
2,
2,
39,
4,
13,
17,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
39,
17,
0,
13,
17,
0,
13,
2,
2,
17,
17,
17,
28,
13,
4,
13,
17,
2,
13,
17,
14,
2,
18,
13,
2,
13,
17,
18,
13,
13,
0,
13,
4,
13,
40,
18,
13,
13,
18,
13,
13,
14,
2,
18,
13,
13,
18,
13,
2,
13,
17,
0,
13,
4,
13,
40,
18,
13,
13,
18,
13,
13,
14,
2,
2,
18,
13,
2,
13,
17,
18,
13,
13,
2,
18,
13,
2,
13,
17,
18,
13,
13,
0,
13,
4,
13,
18,
13,
13,
18,
13,
13,
0,
13,
13,
4,
13,
13,
10,
13,
13,
10,
17,
13,
10,
2,
13,
10,
2,
13,
10,
4,
13,
10,
2,
13,
10,
4,
13,
10,
4,
13,
10,
4,
13
] |
[
[
168,
2
],
[
159,
8
],
[
150,
28
],
[
147,
48
],
[
153,
51
],
[
59,
58
],
[
169,
63
],
[
160,
68
],
[
58,
70
],
[
160,
73
],
[
58,
74
],
[
156,
76
],
[
160,
81
],
[
58,
82
],
[
151,
84
],
[
58,
85
],
[
151,
89
],
[
58,
90
],
[
151,
92
],
[
58,
94
],
[
165,
97
],
[
160,
102
],
[
58,
103
],
[
151,
105
],
[
58,
106
],
[
160,
111
],
[
58,
113
],
[
160,
116
],
[
58,
117
],
[
151,
120
],
[
58,
122
],
[
151,
125
],
[
58,
126
],
[
162,
128
],
[
160,
132
],
[
58,
133
],
[
151,
135
],
[
58,
136
],
[
144,
138
],
[
154,
139
],
[
145,
142
],
[
163,
142
],
[
166,
142
],
[
157,
142
],
[
148,
142
],
[
154,
144
],
[
144,
145
],
[
147,
148
],
[
150,
151
],
[
153,
154
],
[
156,
157
],
[
159,
160
],
[
162,
163
],
[
165,
166
],
[
168,
169
]
] |
[
"N = int(input())\nT = [0]+list(map(int,input().split()))+[float('inf')]\nA = [float('inf')]+list(map(int,input().split()))+[0]\nans = 1\nMOD = 10**9+7\nfor i in range(1,N+1):\n if T[i-1] < T[i]:\n ans *= int(T[i] <= A[i])\n if A[i] > A[i+1]:\n ans *= int(T[i] >= A[i])\n if T[i-1] == T[i] and A[i+1] == A[i]:\n ans *= min(T[i],A[i])\n ans %= MOD\nprint(ans)",
"N = int(input())",
"N",
"int(input())",
"int",
"input()",
"input",
"T = [0]+list(map(int,input().split()))+[float('inf')]",
"T",
"[0]+list(map(int,input().split()))+[float('inf')]",
"[0]+list(map(int,input().split()))",
"[0]",
"0",
"list(map(int,input().split()))",
"list",
"map(int,input().split())",
"map",
"int",
"input().split()",
"().split",
"()",
"input",
"split",
"[float('inf')]",
"float('inf')",
"float",
"'inf'",
"A = [float('inf')]+list(map(int,input().split()))+[0]",
"A",
"[float('inf')]+list(map(int,input().split()))+[0]",
"[float('inf')]+list(map(int,input().split()))",
"[float('inf')]",
"float('inf')",
"float",
"'inf'",
"list(map(int,input().split()))",
"list",
"map(int,input().split())",
"map",
"int",
"input().split()",
"().split",
"()",
"input",
"split",
"[0]",
"0",
"ans = 1",
"ans",
"1",
"MOD = 10**9+7",
"MOD",
"10**9+7",
"10**9",
"10",
"9",
"7",
"for i in range(1,N+1):\n if T[i-1] < T[i]:\n ans *= int(T[i] <= A[i])\n if A[i] > A[i+1]:\n ans *= int(T[i] >= A[i])\n if T[i-1] == T[i] and A[i+1] == A[i]:\n ans *= min(T[i],A[i])\n ans %= MOD",
"i",
"range(1,N+1)",
"range",
"1",
"N+1",
"N",
"1",
"if T[i-1] < T[i]:\n ans *= int(T[i] <= A[i])\n ",
"T[i-1] < T[i]",
"T[i-1]",
"T",
"i-1",
"i",
"1",
"T[i]",
"T",
"i",
"ans *= int(T[i] <= A[i])",
"ans",
"int(T[i] <= A[i])",
"int",
"T[i] <= A[i]",
"T[i]",
"T",
"i",
"A[i]",
"A",
"i",
"if A[i] > A[i+1]:\n ans *= int(T[i] >= A[i])\n ",
"A[i] > A[i+1]",
"A[i]",
"A",
"i",
"A[i+1]",
"A",
"i+1",
"i",
"1",
"ans *= int(T[i] >= A[i])",
"ans",
"int(T[i] >= A[i])",
"int",
"T[i] >= A[i]",
"T[i]",
"T",
"i",
"A[i]",
"A",
"i",
"if T[i-1] == T[i] and A[i+1] == A[i]:\n ans *= min(T[i],A[i])\n ans %= MOD",
"T[i-1] == T[i] and A[i+1] == A[i]",
"T[i-1] == T[i]",
"T[i-1]",
"T",
"i-1",
"i",
"1",
"T[i]",
"T",
"i",
"A[i+1] == A[i]",
"A[i+1]",
"A",
"i+1",
"i",
"1",
"A[i]",
"A",
"i",
"ans *= min(T[i],A[i])",
"ans",
"min(T[i],A[i])",
"min",
"T[i]",
"T",
"i",
"A[i]",
"A",
"i",
"ans %= MOD",
"ans",
"MOD",
"print(ans)",
"print",
"ans",
"ans %= MOD",
"MOD",
"ans",
"ans = 1",
"1",
"ans",
"A = [float('inf')]+list(map(int,input().split()))+[0]",
"[float('inf')]+list(map(int,input().split()))+[0]",
"A",
"MOD = 10**9+7",
"10**9+7",
"MOD",
"ans *= int(T[i] <= A[i])",
"int(T[i] <= A[i])",
"ans",
"T = [0]+list(map(int,input().split()))+[float('inf')]",
"[0]+list(map(int,input().split()))+[float('inf')]",
"T",
"ans *= min(T[i],A[i])",
"min(T[i],A[i])",
"ans",
"ans *= int(T[i] >= A[i])",
"int(T[i] >= A[i])",
"ans",
"N = int(input())",
"int(input())",
"N"
] |
N = int(input())
T = [0]+list(map(int,input().split()))+[float('inf')]
A = [float('inf')]+list(map(int,input().split()))+[0]
ans = 1
MOD = 10**9+7
for i in range(1,N+1):
if T[i-1] < T[i]:
ans *= int(T[i] <= A[i])
if A[i] > A[i+1]:
ans *= int(T[i] >= A[i])
if T[i-1] == T[i] and A[i+1] == A[i]:
ans *= min(T[i],A[i])
ans %= MOD
print(ans)
|
[
7,
15,
13,
0,
13,
18,
18,
18,
13,
13,
13,
13,
0,
13,
18,
18,
18,
13,
13,
13,
13,
0,
13,
18,
18,
18,
13,
13,
13,
13,
0,
13,
12,
4,
13,
4,
13,
0,
13,
12,
4,
13,
13,
4,
18,
4,
13,
13,
0,
13,
12,
4,
18,
4,
18,
4,
13,
13,
13,
17,
0,
13,
12,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
41,
28,
13,
4,
13,
13,
4,
4,
13,
0,
13,
12,
13,
23,
41,
28,
13,
4,
13,
40,
13,
4,
13,
17,
4,
2,
13,
4,
13,
17,
0,
13,
12,
13,
41,
28,
13,
4,
13,
13,
4,
4,
13,
0,
13,
12,
13,
23,
0,
13,
12,
4,
13,
13,
4,
18,
4,
13,
13,
0,
13,
2,
2,
17,
17,
17,
12,
13,
0,
13,
4,
13,
0,
13,
4,
13,
0,
13,
4,
13,
14,
2,
13,
17,
14,
2,
18,
13,
17,
18,
13,
17,
4,
13,
17,
4,
13,
17,
4,
13,
0,
13,
2,
39,
39,
17,
17,
13,
0,
18,
13,
17,
39,
18,
13,
17,
18,
13,
17,
28,
13,
4,
13,
17,
13,
0,
13,
18,
13,
2,
13,
17,
13,
0,
13,
18,
13,
13,
14,
2,
13,
13,
0,
13,
13,
0,
13,
13,
0,
13,
17,
0,
13,
13,
0,
18,
13,
13,
39,
13,
13,
0,
18,
13,
17,
39,
18,
13,
17,
18,
13,
17,
28,
13,
4,
13,
2,
13,
17,
17,
17,
0,
13,
18,
13,
13,
13,
0,
13,
18,
13,
2,
13,
17,
0,
13,
18,
13,
13,
14,
2,
13,
13,
14,
40,
40,
13,
13,
13,
0,
13,
13,
0,
13,
13,
4,
13,
17,
4,
13,
0,
13,
4,
13,
13,
13,
0,
18,
13,
13,
39,
13,
13,
0,
13,
17,
28,
13,
4,
13,
13,
0,
13,
2,
2,
18,
18,
13,
13,
17,
18,
18,
13,
13,
17,
17,
0,
13,
13,
4,
13,
13,
14,
2,
13,
17,
4,
13,
10,
12,
13,
10,
12,
13,
10,
12,
13,
10,
12,
13,
10,
18,
13,
10,
12,
13,
10,
12,
13,
10,
18,
13,
10,
12,
13,
10,
2,
13,
10,
12,
13,
10,
12,
13,
10,
18,
13
] |
[
[
378,
4
],
[
354,
13
],
[
363,
22
],
[
348,
31
],
[
355,
36
],
[
372,
38
],
[
355,
46
],
[
357,
49
],
[
355,
56
],
[
351,
61
],
[
355,
71
],
[
76,
75
],
[
352,
81
],
[
342,
83
],
[
90,
89
],
[
355,
91
],
[
89,
93
],
[
89,
99
],
[
375,
104
],
[
110,
109
],
[
376,
115
],
[
366,
117
],
[
360,
122
],
[
379,
130
],
[
369,
133
],
[
143,
142
],
[
349,
144
],
[
147,
146
],
[
352,
148
],
[
151,
150
],
[
352,
152
],
[
142,
155
],
[
146,
160
],
[
150,
163
],
[
175,
174
],
[
142,
180
],
[
185,
182
],
[
174,
183
],
[
146,
187
],
[
146,
190
],
[
194,
193
],
[
142,
197
],
[
200,
199
],
[
174,
201
],
[
193,
203
],
[
200,
205
],
[
208,
207
],
[
146,
209
],
[
193,
210
],
[
205,
213
],
[
207,
214
],
[
217,
216
],
[
207,
217
],
[
220,
219
],
[
207,
220
],
[
223,
222
],
[
226,
225
],
[
205,
226
],
[
231,
228
],
[
174,
229
],
[
193,
230
],
[
238,
235
],
[
174,
236
],
[
150,
240
],
[
150,
243
],
[
247,
246
],
[
142,
250
],
[
256,
255
],
[
228,
256
],
[
300,
256
],
[
174,
257
],
[
246,
258
],
[
256,
259
],
[
262,
261
],
[
150,
263
],
[
246,
265
],
[
269,
268
],
[
150,
270
],
[
246,
271
],
[
268,
274
],
[
207,
274
],
[
261,
275
],
[
255,
279
],
[
222,
279
],
[
216,
279
],
[
283,
279
],
[
268,
280
],
[
207,
280
],
[
259,
281
],
[
225,
281
],
[
219,
281
],
[
294,
281
],
[
286,
281
],
[
284,
283
],
[
268,
284
],
[
207,
284
],
[
287,
286
],
[
268,
287
],
[
207,
287
],
[
295,
294
],
[
259,
297
],
[
225,
297
],
[
219,
297
],
[
294,
297
],
[
286,
297
],
[
268,
298
],
[
207,
298
],
[
303,
300
],
[
174,
301
],
[
246,
302
],
[
308,
307
],
[
311,
310
],
[
142,
313
],
[
316,
315
],
[
300,
319
],
[
228,
319
],
[
174,
320
],
[
310,
321
],
[
300,
324
],
[
228,
324
],
[
174,
325
],
[
310,
326
],
[
331,
330
],
[
370,
331
],
[
330,
334
],
[
315,
334
],
[
307,
334
],
[
346,
340
],
[
342,
343
],
[
348,
349
],
[
351,
352
],
[
354,
355
],
[
357,
358
],
[
360,
361
],
[
363,
364
],
[
366,
367
],
[
369,
370
],
[
372,
373
],
[
375,
376
],
[
378,
379
]
] |
[
"import sys\n\nread = sys.stdin.buffer.read\nreadline = sys.stdin.buffer.readline\nreadlines = sys.stdin.buffer.readlines\n\nin_n = lambda: int(readline())\nin_nn = lambda: map(int, readline().split())\nin_s = lambda: readline().rstrip().decode('utf-8')\nin_nl = lambda: list(map(int, readline().split()))\nin_nl2 = lambda H: [in_nl() for _ in range(H)]\nin_map = lambda: [s == ord('.') for s in readline() if s != ord('\\n')]\nin_map2 = lambda H: [in_map() for _ in range(H)]\nin_all = lambda: map(int, read().split())\n\nmod = 10**9 + 7\n\n\ndef main():\n\n N = in_n()\n A = in_nl()\n T = in_nl()\n\n if N == 1:\n if A[0] == T[0]:\n print(1)\n else:\n print(0)\n exit()\n\n yama = [(0, 0)] * N\n yama[0] = (A[0], A[0])\n\n for i in range(1, N):\n pre_min_h, pre_max_h = yama[i - 1]\n now_h = A[i]\n\n if pre_max_h < now_h:\n now_min_h = now_h\n now_max_h = now_h\n else:\n now_min_h = 1\n now_max_h = pre_max_h\n\n yama[i] = (now_min_h, now_max_h)\n\n yama[-1] = (T[-1], T[-1])\n\n for i in range(N - 2, -1, -1):\n\n now_min_h, now_max_h = yama[i]\n pre_h = T[i + 1]\n now_h = T[i]\n\n if now_h > pre_h:\n if now_min_h <= now_h <= now_max_h:\n now_min_h = now_h\n now_max_h = now_h\n else:\n print(0)\n exit()\n else:\n now_max_h = min(now_max_h, now_h)\n\n yama[i] = (now_min_h, now_max_h)\n\n ans = 1\n for i in range(N):\n ans *= (yama[i][1] - yama[i][0] + 1)\n ans %= mod\n print(ans)\n\n\nif __name__ == '__main__':\n main()",
"import sys",
"sys",
"read = sys.stdin.buffer.read",
"read",
"sys.stdin.buffer.read",
"sys.stdin.buffer",
"sys.stdin",
"sys",
"stdin",
"buffer",
"read",
"readline = sys.stdin.buffer.readline",
"readline",
"sys.stdin.buffer.readline",
"sys.stdin.buffer",
"sys.stdin",
"sys",
"stdin",
"buffer",
"readline",
"readlines = sys.stdin.buffer.readlines",
"readlines",
"sys.stdin.buffer.readlines",
"sys.stdin.buffer",
"sys.stdin",
"sys",
"stdin",
"buffer",
"readlines",
"in_n = lambda: int(readline())",
"in_n",
"lambda: int(readline())",
"int(readline())",
"int",
"readline()",
"readline",
"in_nn = lambda: map(int, readline().split())",
"in_nn",
"lambda: map(int, readline().split())",
"map(int, readline().split())",
"map",
"int",
"readline().split()",
"().split",
"()",
"readline",
"split",
"in_s = lambda: readline().rstrip().decode('utf-8')",
"in_s",
"lambda: readline().rstrip().decode('utf-8')",
"readline().rstrip().decode('utf-8')",
"().rstrip().decode",
"().rstrip()",
"().rstrip",
"()",
"readline",
"rstrip",
"decode",
"'utf-8'",
"in_nl = lambda: list(map(int, readline().split()))",
"in_nl",
"lambda: list(map(int, readline().split()))",
"list(map(int, readline().split()))",
"list",
"map(int, readline().split())",
"map",
"int",
"readline().split()",
"().split",
"()",
"readline",
"split",
"in_nl() for _ in range(H)",
"for _ in range(H)",
"_",
"range(H)",
"range",
"H",
"for _ in range(H)",
"in_nl()",
"in_nl",
"in_nl2 = lambda H: [in_nl() for _ in range(H)]",
"in_nl2",
"lambda H: [in_nl() for _ in range(H)]",
"[in_nl() for _ in range(H)]",
"H",
"s == ord('.') for s in readline() if s != ord('\\n')",
"for s in readline() if s != ord('\\n')",
"s",
"readline()",
"readline",
"s != ord('\\n')",
"s",
"ord('\\n')",
"ord",
"'\\n'",
"if s != ord('\\n')",
"s == ord('.')",
"s",
"ord('.')",
"ord",
"'.'",
"in_map = lambda: [s == ord('.') for s in readline() if s != ord('\\n')]",
"in_map",
"lambda: [s == ord('.') for s in readline() if s != ord('\\n')]",
"[s == ord('.') for s in readline() if s != ord('\\n')]",
"in_map() for _ in range(H)",
"for _ in range(H)",
"_",
"range(H)",
"range",
"H",
"for _ in range(H)",
"in_map()",
"in_map",
"in_map2 = lambda H: [in_map() for _ in range(H)]",
"in_map2",
"lambda H: [in_map() for _ in range(H)]",
"[in_map() for _ in range(H)]",
"H",
"in_all = lambda: map(int, read().split())",
"in_all",
"lambda: map(int, read().split())",
"map(int, read().split())",
"map",
"int",
"read().split()",
"().split",
"()",
"read",
"split",
"mod = 10**9 + 7",
"mod",
"10**9 + 7",
"10**9",
"10",
"9",
"7",
"def main():\n\n N = in_n()\n A = in_nl()\n T = in_nl()\n\n if N == 1:\n if A[0] == T[0]:\n print(1)\n else:\n print(0)\n exit()\n\n yama = [(0, 0)] * N\n yama[0] = (A[0], A[0])\n\n for i in range(1, N):\n pre_min_h, pre_max_h = yama[i - 1]\n now_h = A[i]\n\n if pre_max_h < now_h:\n now_min_h = now_h\n now_max_h = now_h\n else:\n now_min_h = 1\n now_max_h = pre_max_h\n\n yama[i] = (now_min_h, now_max_h)\n\n yama[-1] = (T[-1], T[-1])\n\n for i in range(N - 2, -1, -1):\n\n now_min_h, now_max_h = yama[i]\n pre_h = T[i + 1]\n now_h = T[i]\n\n if now_h > pre_h:\n if now_min_h <= now_h <= now_max_h:\n now_min_h = now_h\n now_max_h = now_h\n else:\n print(0)\n exit()\n else:\n now_max_h = min(now_max_h, now_h)\n\n yama[i] = (now_min_h, now_max_h)\n\n ans = 1\n for i in range(N):\n ans *= (yama[i][1] - yama[i][0] + 1)\n ans %= mod\n print(ans)",
"main",
"N = in_n()",
"N",
"in_n()",
"in_n",
"A = in_nl()",
"A",
"in_nl()",
"in_nl",
"T = in_nl()",
"T",
"in_nl()",
"in_nl",
"if N == 1:\n if A[0] == T[0]:\n print(1)\n else:\n print(0)\n exit()\n\n ",
"N == 1",
"N",
"1",
"if A[0] == T[0]:\n print(1)\n else:\n print(0)\n ",
"A[0] == T[0]",
"A[0]",
"A",
"0",
"T[0]",
"T",
"0",
"print(1)",
"print",
"1",
"print(0)",
"print",
"0",
"exit()",
"exit",
"yama = [(0, 0)] * N",
"yama",
"[(0, 0)] * N",
"[(0, 0)]",
"(0, 0)",
"0",
"0",
"N",
"yama[0] = (A[0], A[0])",
"yama[0]",
"yama",
"0",
"(A[0], A[0])",
"A[0]",
"A",
"0",
"A[0]",
"A",
"0",
"for i in range(1, N):\n pre_min_h, pre_max_h = yama[i - 1]\n now_h = A[i]\n\n if pre_max_h < now_h:\n now_min_h = now_h\n now_max_h = now_h\n else:\n now_min_h = 1\n now_max_h = pre_max_h\n\n yama[i] = (now_min_h, now_max_h)\n\n ",
"i",
"range(1, N)",
"range",
"1",
"N",
"pre_min_h, pre_max_h = yama[i - 1]",
"pre_min_h",
"yama[i - 1]",
"yama",
"i - 1",
"i",
"1",
"pre_max_h",
"now_h = A[i]",
"now_h",
"A[i]",
"A",
"i",
"if pre_max_h < now_h:\n now_min_h = now_h\n now_max_h = now_h\n else:\n now_min_h = 1\n now_max_h = pre_max_h\n\n ",
"pre_max_h < now_h",
"pre_max_h",
"now_h",
"now_min_h = now_h",
"now_min_h",
"now_h",
"now_max_h = now_h",
"now_max_h",
"now_h",
"now_min_h = 1",
"now_min_h",
"1",
"now_max_h = pre_max_h",
"now_max_h",
"pre_max_h",
"yama[i] = (now_min_h, now_max_h)",
"yama[i]",
"yama",
"i",
"(now_min_h, now_max_h)",
"now_min_h",
"now_max_h",
"yama[-1] = (T[-1], T[-1])",
"yama[-1]",
"yama",
"-1",
"(T[-1], T[-1])",
"T[-1]",
"T",
"-1",
"T[-1]",
"T",
"-1",
"for i in range(N - 2, -1, -1):\n\n now_min_h, now_max_h = yama[i]\n pre_h = T[i + 1]\n now_h = T[i]\n\n if now_h > pre_h:\n if now_min_h <= now_h <= now_max_h:\n now_min_h = now_h\n now_max_h = now_h\n else:\n print(0)\n exit()\n else:\n now_max_h = min(now_max_h, now_h)\n\n yama[i] = (now_min_h, now_max_h)\n\n ",
"i",
"range(N - 2, -1, -1)",
"range",
"N - 2",
"N",
"2",
"-1",
"-1",
"now_min_h, now_max_h = yama[i]",
"now_min_h",
"yama[i]",
"yama",
"i",
"now_max_h",
"pre_h = T[i + 1]",
"pre_h",
"T[i + 1]",
"T",
"i + 1",
"i",
"1",
"now_h = T[i]",
"now_h",
"T[i]",
"T",
"i",
"if now_h > pre_h:\n if now_min_h <= now_h <= now_max_h:\n now_min_h = now_h\n now_max_h = now_h\n else:\n print(0)\n exit()\n else:\n now_max_h = min(now_max_h, now_h)\n\n ",
"now_h > pre_h",
"now_h",
"pre_h",
"if now_min_h <= now_h <= now_max_h:\n now_min_h = now_h\n now_max_h = now_h\n else:\n print(0)\n exit()\n ",
"now_min_h <= now_h <= now_max_h",
"now_min_h <= now_h",
"now_min_h",
"now_h",
"now_max_h",
"now_min_h = now_h",
"now_min_h",
"now_h",
"now_max_h = now_h",
"now_max_h",
"now_h",
"print(0)",
"print",
"0",
"exit()",
"exit",
"now_max_h = min(now_max_h, now_h)",
"now_max_h",
"min(now_max_h, now_h)",
"min",
"now_max_h",
"now_h",
"yama[i] = (now_min_h, now_max_h)",
"yama[i]",
"yama",
"i",
"(now_min_h, now_max_h)",
"now_min_h",
"now_max_h",
"ans = 1",
"ans",
"1",
"for i in range(N):\n ans *= (yama[i][1] - yama[i][0] + 1)\n ans %= mod\n ",
"i",
"range(N)",
"range",
"N",
"ans *= (yama[i][1] - yama[i][0] + 1)",
"ans",
"yama[i][1] - yama[i][0] + 1",
"yama[i][1] - yama[i][0]",
"yama[i][1]",
"[i]",
"yama",
"i",
"1",
"yama[i][0]",
"[i]",
"yama",
"i",
"0",
"1",
"ans %= mod",
"ans",
"mod",
"print(ans)",
"print",
"ans",
"if __name__ == '__main__':\n main()",
"__name__ == '__main__'",
"__name__",
"'__main__'",
"main()",
"main",
"in_nl2 = lambda H: [in_nl() for _ in range(H)]",
"lambda H: [in_nl() for _ in range(H)]",
"in_nl2",
"def main():\n\n N = in_n()\n A = in_nl()\n T = in_nl()\n\n if N == 1:\n if A[0] == T[0]:\n print(1)\n else:\n print(0)\n exit()\n\n yama = [(0, 0)] * N\n yama[0] = (A[0], A[0])\n\n for i in range(1, N):\n pre_min_h, pre_max_h = yama[i - 1]\n now_h = A[i]\n\n if pre_max_h < now_h:\n now_min_h = now_h\n now_max_h = now_h\n else:\n now_min_h = 1\n now_max_h = pre_max_h\n\n yama[i] = (now_min_h, now_max_h)\n\n yama[-1] = (T[-1], T[-1])\n\n for i in range(N - 2, -1, -1):\n\n now_min_h, now_max_h = yama[i]\n pre_h = T[i + 1]\n now_h = T[i]\n\n if now_h > pre_h:\n if now_min_h <= now_h <= now_max_h:\n now_min_h = now_h\n now_max_h = now_h\n else:\n print(0)\n exit()\n else:\n now_max_h = min(now_max_h, now_h)\n\n yama[i] = (now_min_h, now_max_h)\n\n ans = 1\n for i in range(N):\n ans *= (yama[i][1] - yama[i][0] + 1)\n ans %= mod\n print(ans)",
"def main():\n\n N = in_n()\n A = in_nl()\n T = in_nl()\n\n if N == 1:\n if A[0] == T[0]:\n print(1)\n else:\n print(0)\n exit()\n\n yama = [(0, 0)] * N\n yama[0] = (A[0], A[0])\n\n for i in range(1, N):\n pre_min_h, pre_max_h = yama[i - 1]\n now_h = A[i]\n\n if pre_max_h < now_h:\n now_min_h = now_h\n now_max_h = now_h\n else:\n now_min_h = 1\n now_max_h = pre_max_h\n\n yama[i] = (now_min_h, now_max_h)\n\n yama[-1] = (T[-1], T[-1])\n\n for i in range(N - 2, -1, -1):\n\n now_min_h, now_max_h = yama[i]\n pre_h = T[i + 1]\n now_h = T[i]\n\n if now_h > pre_h:\n if now_min_h <= now_h <= now_max_h:\n now_min_h = now_h\n now_max_h = now_h\n else:\n print(0)\n exit()\n else:\n now_max_h = min(now_max_h, now_h)\n\n yama[i] = (now_min_h, now_max_h)\n\n ans = 1\n for i in range(N):\n ans *= (yama[i][1] - yama[i][0] + 1)\n ans %= mod\n print(ans)",
"main",
"in_n = lambda: int(readline())",
"lambda: int(readline())",
"in_n",
"in_nl = lambda: list(map(int, readline().split()))",
"lambda: list(map(int, readline().split()))",
"in_nl",
"readline = sys.stdin.buffer.readline",
"sys.stdin.buffer.readline",
"readline",
"in_s = lambda: readline().rstrip().decode('utf-8')",
"lambda: readline().rstrip().decode('utf-8')",
"in_s",
"in_all = lambda: map(int, read().split())",
"lambda: map(int, read().split())",
"in_all",
"readlines = sys.stdin.buffer.readlines",
"sys.stdin.buffer.readlines",
"readlines",
"in_map2 = lambda H: [in_map() for _ in range(H)]",
"lambda H: [in_map() for _ in range(H)]",
"in_map2",
"mod = 10**9 + 7",
"10**9 + 7",
"mod",
"in_nn = lambda: map(int, readline().split())",
"lambda: map(int, readline().split())",
"in_nn",
"in_map = lambda: [s == ord('.') for s in readline() if s != ord('\\n')]",
"lambda: [s == ord('.') for s in readline() if s != ord('\\n')]",
"in_map",
"read = sys.stdin.buffer.read",
"sys.stdin.buffer.read",
"read"
] |
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
in_n = lambda: int(readline())
in_nn = lambda: map(int, readline().split())
in_s = lambda: readline().rstrip().decode('utf-8')
in_nl = lambda: list(map(int, readline().split()))
in_nl2 = lambda H: [in_nl() for _ in range(H)]
in_map = lambda: [s == ord('.') for s in readline() if s != ord('\n')]
in_map2 = lambda H: [in_map() for _ in range(H)]
in_all = lambda: map(int, read().split())
mod = 10**9 + 7
def main():
N = in_n()
A = in_nl()
T = in_nl()
if N == 1:
if A[0] == T[0]:
print(1)
else:
print(0)
exit()
yama = [(0, 0)] * N
yama[0] = (A[0], A[0])
for i in range(1, N):
pre_min_h, pre_max_h = yama[i - 1]
now_h = A[i]
if pre_max_h < now_h:
now_min_h = now_h
now_max_h = now_h
else:
now_min_h = 1
now_max_h = pre_max_h
yama[i] = (now_min_h, now_max_h)
yama[-1] = (T[-1], T[-1])
for i in range(N - 2, -1, -1):
now_min_h, now_max_h = yama[i]
pre_h = T[i + 1]
now_h = T[i]
if now_h > pre_h:
if now_min_h <= now_h <= now_max_h:
now_min_h = now_h
now_max_h = now_h
else:
print(0)
exit()
else:
now_max_h = min(now_max_h, now_h)
yama[i] = (now_min_h, now_max_h)
ans = 1
for i in range(N):
ans *= (yama[i][1] - yama[i][0] + 1)
ans %= mod
print(ans)
if __name__ == '__main__':
main()
|
[
7,
0,
13,
4,
13,
4,
13,
0,
13,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
0,
13,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
0,
13,
2,
2,
39,
17,
13,
39,
18,
13,
17,
0,
13,
2,
2,
39,
18,
13,
17,
13,
39,
17,
0,
13,
17,
28,
13,
4,
13,
17,
2,
13,
17,
14,
2,
2,
18,
13,
13,
18,
13,
2,
13,
17,
2,
18,
13,
13,
18,
13,
2,
13,
17,
0,
13,
4,
13,
18,
13,
13,
18,
13,
13,
0,
13,
2,
2,
17,
17,
17,
14,
2,
40,
18,
13,
13,
18,
13,
2,
13,
17,
40,
18,
13,
13,
18,
13,
2,
13,
17,
14,
40,
18,
13,
13,
18,
13,
13,
4,
13,
17,
4,
13,
14,
2,
40,
18,
13,
13,
18,
13,
2,
13,
17,
2,
18,
13,
13,
18,
13,
13,
4,
13,
17,
4,
13,
14,
2,
40,
18,
13,
13,
18,
13,
2,
13,
17,
2,
18,
13,
13,
18,
13,
13,
4,
13,
17,
4,
13,
4,
13,
13,
10,
2,
13,
10,
2,
13,
10,
4,
13,
10,
17,
13,
10,
2,
13,
10,
4,
13,
10,
4,
13,
10,
4,
13
] |
[
[
199,
2
],
[
190,
8
],
[
205,
20
],
[
184,
32
],
[
191,
37
],
[
191,
40
],
[
187,
43
],
[
206,
48
],
[
206,
50
],
[
193,
54
],
[
58,
57
],
[
200,
62
],
[
185,
68
],
[
191,
68
],
[
57,
69
],
[
185,
71
],
[
191,
71
],
[
57,
73
],
[
188,
77
],
[
206,
77
],
[
57,
78
],
[
188,
80
],
[
206,
80
],
[
57,
82
],
[
202,
85
],
[
185,
89
],
[
191,
89
],
[
57,
90
],
[
188,
92
],
[
206,
92
],
[
57,
93
],
[
196,
95
],
[
185,
105
],
[
191,
105
],
[
57,
106
],
[
185,
108
],
[
191,
108
],
[
57,
110
],
[
188,
114
],
[
206,
114
],
[
57,
115
],
[
188,
117
],
[
206,
117
],
[
57,
119
],
[
185,
124
],
[
191,
124
],
[
57,
125
],
[
188,
127
],
[
206,
127
],
[
57,
128
],
[
185,
138
],
[
191,
138
],
[
57,
139
],
[
185,
141
],
[
191,
141
],
[
57,
143
],
[
185,
147
],
[
191,
147
],
[
57,
148
],
[
188,
150
],
[
206,
150
],
[
57,
151
],
[
188,
161
],
[
206,
161
],
[
57,
162
],
[
188,
164
],
[
206,
164
],
[
57,
166
],
[
188,
170
],
[
206,
170
],
[
57,
171
],
[
185,
173
],
[
191,
173
],
[
57,
174
],
[
197,
182
],
[
203,
182
],
[
194,
182
],
[
184,
185
],
[
187,
188
],
[
190,
191
],
[
193,
194
],
[
196,
197
],
[
199,
200
],
[
202,
203
],
[
205,
206
]
] |
[
"n = int(input())\nt = list(map(int, input().split()))\na = list(map(int, input().split()))\n\nt = [0]+t+[t[-1]]\na = [a[0]]+a+[0]\n\nans = 1\n\nfor i in range(1,n+1):\n if t[i]==t[i-1] and a[i]==a[i+1]:\n ans *= min(t[i],a[i])\n ans %= 10**9+7\n elif t[i]!=t[i-1] and a[i]!=a[i+1]:\n if t[i]!=a[i]:\n print(0)\n exit()\n elif t[i]!=t[i-1] and t[i]>a[i]:\n print(0)\n exit()\n elif a[i]!=a[i+1] and a[i]>t[i]:\n print(0)\n exit()\n\nprint(ans)",
"n = int(input())",
"n",
"int(input())",
"int",
"input()",
"input",
"t = list(map(int, input().split()))",
"t",
"list(map(int, input().split()))",
"list",
"map(int, input().split())",
"map",
"int",
"input().split()",
"().split",
"()",
"input",
"split",
"a = list(map(int, input().split()))",
"a",
"list(map(int, input().split()))",
"list",
"map(int, input().split())",
"map",
"int",
"input().split()",
"().split",
"()",
"input",
"split",
"t = [0]+t+[t[-1]]",
"t",
"[0]+t+[t[-1]]",
"[0]+t",
"[0]",
"0",
"t",
"[t[-1]]",
"t[-1]",
"t",
"-1",
"a = [a[0]]+a+[0]",
"a",
"[a[0]]+a+[0]",
"[a[0]]+a",
"[a[0]]",
"a[0]",
"a",
"0",
"a",
"[0]",
"0",
"ans = 1",
"ans",
"1",
"for i in range(1,n+1):\n if t[i]==t[i-1] and a[i]==a[i+1]:\n ans *= min(t[i],a[i])\n ans %= 10**9+7\n elif t[i]!=t[i-1] and a[i]!=a[i+1]:\n if t[i]!=a[i]:\n print(0)\n exit()\n elif t[i]!=t[i-1] and t[i]>a[i]:\n print(0)\n exit()\n elif a[i]!=a[i+1] and a[i]>t[i]:\n print(0)\n exit()",
"i",
"range(1,n+1)",
"range",
"1",
"n+1",
"n",
"1",
"if t[i]==t[i-1] and a[i]==a[i+1]:\n ans *= min(t[i],a[i])\n ans %= 10**9+7\n elif t[i]!=t[i-1] and a[i]!=a[i+1]:\n if t[i]!=a[i]:\n print(0)\n exit()\n elif t[i]!=t[i-1] and t[i]>a[i]:\n print(0)\n exit()\n elif a[i]!=a[i+1] and a[i]>t[i]:\n print(0)\n exit()",
"t[i]==t[i-1] and a[i]==a[i+1]",
"t[i]==t[i-1]",
"t[i]",
"t",
"i",
"t[i-1]",
"t",
"i-1",
"i",
"1",
"a[i]==a[i+1]",
"a[i]",
"a",
"i",
"a[i+1]",
"a",
"i+1",
"i",
"1",
"ans *= min(t[i],a[i])",
"ans",
"min(t[i],a[i])",
"min",
"t[i]",
"t",
"i",
"a[i]",
"a",
"i",
"ans %= 10**9+7",
"ans",
"10**9+7",
"10**9",
"10",
"9",
"7",
"elif t[i]!=t[i-1] and a[i]!=a[i+1]:\n if t[i]!=a[i]:\n print(0)\n exit()\n ",
"t[i]!=t[i-1] and a[i]!=a[i+1]",
"t[i]!=t[i-1]",
"t[i]",
"t",
"i",
"t[i-1]",
"t",
"i-1",
"i",
"1",
"a[i]!=a[i+1]",
"a[i]",
"a",
"i",
"a[i+1]",
"a",
"i+1",
"i",
"1",
"if t[i]!=a[i]:\n print(0)\n exit()\n ",
"t[i]!=a[i]",
"t[i]",
"t",
"i",
"a[i]",
"a",
"i",
"print(0)",
"print",
"0",
"exit()",
"exit",
"elif t[i]!=t[i-1] and t[i]>a[i]:\n print(0)\n exit()\n ",
"t[i]!=t[i-1] and t[i]>a[i]",
"t[i]!=t[i-1]",
"t[i]",
"t",
"i",
"t[i-1]",
"t",
"i-1",
"i",
"1",
"t[i]>a[i]",
"t[i]",
"t",
"i",
"a[i]",
"a",
"i",
"print(0)",
"print",
"0",
"exit()",
"exit",
"elif a[i]!=a[i+1] and a[i]>t[i]:\n print(0)\n exit()",
"a[i]!=a[i+1] and a[i]>t[i]",
"a[i]!=a[i+1]",
"a[i]",
"a",
"i",
"a[i+1]",
"a",
"i+1",
"i",
"1",
"a[i]>t[i]",
"a[i]",
"a",
"i",
"t[i]",
"t",
"i",
"print(0)",
"print",
"0",
"exit()",
"exit",
"print(ans)",
"print",
"ans",
"t = [0]+t+[t[-1]]",
"[0]+t+[t[-1]]",
"t",
"a = [a[0]]+a+[0]",
"[a[0]]+a+[0]",
"a",
"t = list(map(int, input().split()))",
"list(map(int, input().split()))",
"t",
"ans = 1",
"1",
"ans",
"ans %= 10**9+7",
"10**9+7",
"ans",
"n = int(input())",
"int(input())",
"n",
"ans *= min(t[i],a[i])",
"min(t[i],a[i])",
"ans",
"a = list(map(int, input().split()))",
"list(map(int, input().split()))",
"a"
] |
n = int(input())
t = list(map(int, input().split()))
a = list(map(int, input().split()))
t = [0]+t+[t[-1]]
a = [a[0]]+a+[0]
ans = 1
for i in range(1,n+1):
if t[i]==t[i-1] and a[i]==a[i+1]:
ans *= min(t[i],a[i])
ans %= 10**9+7
elif t[i]!=t[i-1] and a[i]!=a[i+1]:
if t[i]!=a[i]:
print(0)
exit()
elif t[i]!=t[i-1] and t[i]>a[i]:
print(0)
exit()
elif a[i]!=a[i+1] and a[i]>t[i]:
print(0)
exit()
print(ans)
|
[
7,
15,
0,
13,
2,
2,
17,
17,
17,
6,
13,
12,
13,
0,
18,
13,
13,
13,
0,
18,
13,
13,
13,
23,
13,
23,
13,
23,
13,
12,
13,
29,
4,
13,
4,
13,
18,
13,
13,
18,
13,
13,
4,
13,
18,
13,
13,
18,
13,
13,
23,
13,
23,
13,
12,
13,
29,
2,
18,
13,
13,
18,
13,
13,
23,
13,
12,
13,
29,
4,
18,
17,
13,
18,
13,
13,
18,
13,
13,
23,
13,
13,
12,
13,
0,
13,
39,
4,
13,
18,
13,
17,
2,
18,
13,
17,
17,
28,
13,
13,
4,
13,
13,
18,
13,
39,
17,
14,
2,
13,
13,
4,
18,
13,
13,
4,
13,
13,
2,
13,
17,
4,
18,
13,
13,
4,
13,
17,
2,
13,
17,
29,
13,
23,
13,
14,
2,
13,
17,
0,
13,
4,
13,
4,
13,
41,
28,
13,
4,
18,
4,
13,
13,
4,
4,
13,
13,
0,
13,
13,
41,
28,
13,
4,
18,
4,
13,
13,
4,
4,
13,
13,
0,
13,
13,
41,
28,
13,
13,
4,
13,
4,
13,
13,
18,
4,
13,
18,
13,
39,
17,
39,
17,
4,
2,
13,
13,
0,
13,
13,
38,
5,
4,
13,
17,
0,
13,
4,
13,
4,
13,
13,
13,
4,
13,
4,
13,
12,
2,
2,
13,
13,
13,
23,
23,
13,
10,
13,
13,
10,
13,
13,
10,
12,
13,
10,
4,
13,
10,
4,
13,
10,
13,
13,
10,
2,
13,
10,
6,
13
] |
[
[
245,
3
],
[
17,
14
],
[
24,
15
],
[
26,
16
],
[
26,
17
],
[
22,
19
],
[
24,
20
],
[
28,
21
],
[
28,
22
],
[
24,
24
],
[
26,
26
],
[
28,
28
],
[
51,
37
],
[
53,
40
],
[
51,
45
],
[
53,
48
],
[
51,
51
],
[
53,
53
],
[
65,
59
],
[
65,
62
],
[
65,
65
],
[
80,
74
],
[
80,
77
],
[
80,
80
],
[
86,
85
],
[
134,
90
],
[
134,
94
],
[
134,
102
],
[
134,
104
],
[
85,
113
],
[
85,
123
],
[
85,
132
],
[
134,
134
],
[
239,
140
],
[
148,
147
],
[
147,
156
],
[
227,
158
],
[
163,
162
],
[
162,
171
],
[
230,
173
],
[
234,
182
],
[
228,
183
],
[
234,
186
],
[
231,
188
],
[
242,
198
],
[
236,
206
],
[
243,
212
],
[
246,
222
],
[
237,
225
],
[
227,
228
],
[
230,
231
],
[
236,
237
],
[
239,
240
],
[
242,
243
],
[
245,
246
]
] |
[
"from functools import reduce\nMOD = 10**9 + 7\nclass MyRange(object):\n def __init__(self, l, r): \n self.l = l\n self.r = r\n\n def __and__(self, other):\n return MyRange(max(self.l, other.l), min(self.r, other.r))\n\n def __len__(self):\n return self.r - self.l\n\n def __str__(self):\n return \"[{}, {})\".format(self.l, self.r)\n\ndef hoge(arr):\n res = [MyRange(arr[0], arr[0]+1)]\n for pre, cur in zip(arr, arr[1:]):\n if pre < cur:\n res.append(MyRange(cur, cur+1))\n else:\n res.append(MyRange(1, cur+1))\n return res\n\nif __name__ == \"__main__\":\n N = int(input())\n T = [int(i) for i in input().split()]\n A = [int(i) for i in input().split()]\n B = [t & a for t, a in zip(hoge(T), hoge(A[::-1])[::-1])]\n # print(*B)\n try:\n C = list(map(len, B))\n print(reduce(lambda a, b: (a * b) % MOD, C))\n except ValueError:\n print(0)",
"from functools import reduce",
"MOD = 10**9 + 7",
"MOD",
"10**9 + 7",
"10**9",
"10",
"9",
"7",
"class MyRange(object):\n def __init__(self, l, r): \n self.l = l\n self.r = r\n\n def __and__(self, other):\n return MyRange(max(self.l, other.l), min(self.r, other.r))\n\n def __len__(self):\n return self.r - self.l\n\n def __str__(self):\n return \"[{}, {})\".format(self.l, self.r)",
"MyRange",
"def __init__(self, l, r): \n self.l = l\n self.r = r\n\n ",
"__init__",
"self.l = l",
"self.l",
"self",
"l",
"l",
"self.r = r",
"self.r",
"self",
"r",
"r",
"self",
"self",
"l",
"l",
"r",
"r",
"def __and__(self, other):\n return MyRange(max(self.l, other.l), min(self.r, other.r))\n\n ",
"__and__",
"return MyRange(max(self.l, other.l), min(self.r, other.r))",
"MyRange(max(self.l, other.l), min(self.r, other.r))",
"MyRange",
"max(self.l, other.l)",
"max",
"self.l",
"self",
"l",
"other.l",
"other",
"l",
"min(self.r, other.r)",
"min",
"self.r",
"self",
"r",
"other.r",
"other",
"r",
"self",
"self",
"other",
"other",
"def __len__(self):\n return self.r - self.l\n\n ",
"__len__",
"return self.r - self.l",
"self.r - self.l",
"self.r",
"self",
"r",
"self.l",
"self",
"l",
"self",
"self",
"def __str__(self):\n return \"[{}, {})\".format(self.l, self.r)",
"__str__",
"return \"[{}, {})\".format(self.l, self.r)",
"\"[{}, {})\".format(self.l, self.r)",
"\"[{}, {})\".format",
"\"[{}, {})\"",
"format",
"self.l",
"self",
"l",
"self.r",
"self",
"r",
"self",
"self",
"object",
"def hoge(arr):\n res = [MyRange(arr[0], arr[0]+1)]\n for pre, cur in zip(arr, arr[1:]):\n if pre < cur:\n res.append(MyRange(cur, cur+1))\n else:\n res.append(MyRange(1, cur+1))\n return res",
"hoge",
"res = [MyRange(arr[0], arr[0]+1)]",
"res",
"[MyRange(arr[0], arr[0]+1)]",
"MyRange(arr[0], arr[0]+1)",
"MyRange",
"arr[0]",
"arr",
"0",
"arr[0]+1",
"arr[0]",
"arr",
"0",
"1",
"for pre, cur in zip(arr, arr[1:]):\n if pre < cur:\n res.append(MyRange(cur, cur+1))\n else:\n res.append(MyRange(1, cur+1))\n ",
"pre",
"cur",
"zip(arr, arr[1:])",
"zip",
"arr",
"arr[1:]",
"arr",
"1:",
"1",
"if pre < cur:\n res.append(MyRange(cur, cur+1))\n else:\n res.append(MyRange(1, cur+1))\n ",
"pre < cur",
"pre",
"cur",
"res.append(MyRange(cur, cur+1))",
"res.append",
"res",
"append",
"MyRange(cur, cur+1)",
"MyRange",
"cur",
"cur+1",
"cur",
"1",
"res.append(MyRange(1, cur+1))",
"res.append",
"res",
"append",
"MyRange(1, cur+1)",
"MyRange",
"1",
"cur+1",
"cur",
"1",
"return res",
"res",
"arr",
"arr",
"if __name__ == \"__main__\":\n N = int(input())\n T = [int(i) for i in input().split()]\n A = [int(i) for i in input().split()]\n B = [t & a for t, a in zip(hoge(T), hoge(A[::-1])[::-1])]\n # print(*B)\n try:\n C = list(map(len, B))\n print(reduce(lambda a, b: (a * b) % MOD, C))\n except ValueError:\n print(0)",
"__name__ == \"__main__\"",
"__name__",
"\"__main__\"",
"N = int(input())",
"N",
"int(input())",
"int",
"input()",
"input",
"int(i) for i in input().split()",
"for i in input().split()",
"i",
"input().split()",
"().split",
"()",
"input",
"split",
"for i in input().split()",
"int(i)",
"int",
"i",
"T = [int(i) for i in input().split()]",
"T",
"[int(i) for i in input().split()]",
"int(i) for i in input().split()",
"for i in input().split()",
"i",
"input().split()",
"().split",
"()",
"input",
"split",
"for i in input().split()",
"int(i)",
"int",
"i",
"A = [int(i) for i in input().split()]",
"A",
"[int(i) for i in input().split()]",
"t & a for t, a in zip(hoge(T), hoge(A[::-1])[::-1])",
"for t, a in zip(hoge(T), hoge(A[::-1])[::-1])",
"t",
"a",
"zip(hoge(T), hoge(A[::-1])[::-1])",
"zip",
"hoge(T)",
"hoge",
"T",
"hoge(A[::-1])[::-1]",
"(A[::-1])",
"hoge",
"A[::-1]",
"A",
"::-1",
"-1",
"::-1",
"-1",
"for t, a in zip(hoge(T), hoge(A[::-1])[::-1])",
"t & a",
"t",
"a",
"B = [t & a for t, a in zip(hoge(T), hoge(A[::-1])[::-1])]",
"B",
"[t & a for t, a in zip(hoge(T), hoge(A[::-1])[::-1])]",
"try:\n C = list(map(len, B))\n print(reduce(lambda a, b: (a * b) % MOD, C))\n except ValueError:\n print(0)",
"except ValueError:\n print(0)",
"print(0)",
"print",
"0",
"C = list(map(len, B))",
"C",
"list(map(len, B))",
"list",
"map(len, B)",
"map",
"len",
"B",
"print(reduce(lambda a, b: (a * b) % MOD, C))",
"print",
"reduce(lambda a, b: (a * b) % MOD, C)",
"reduce",
"lambda a, b: (a * b) % MOD",
"(a * b) % MOD",
"a * b",
"a",
"b",
"MOD",
"a",
"b",
"C",
"T = [int(i) for i in input().split()]",
"[int(i) for i in input().split()]",
"T",
"A = [int(i) for i in input().split()]",
"[int(i) for i in input().split()]",
"A",
"def hoge(arr):\n res = [MyRange(arr[0], arr[0]+1)]\n for pre, cur in zip(arr, arr[1:]):\n if pre < cur:\n res.append(MyRange(cur, cur+1))\n else:\n res.append(MyRange(1, cur+1))\n return res",
"def hoge(arr):\n res = [MyRange(arr[0], arr[0]+1)]\n for pre, cur in zip(arr, arr[1:]):\n if pre < cur:\n res.append(MyRange(cur, cur+1))\n else:\n res.append(MyRange(1, cur+1))\n return res",
"hoge",
"C = list(map(len, B))",
"list(map(len, B))",
"C",
"N = int(input())",
"int(input())",
"N",
"B = [t & a for t, a in zip(hoge(T), hoge(A[::-1])[::-1])]",
"[t & a for t, a in zip(hoge(T), hoge(A[::-1])[::-1])]",
"B",
"MOD = 10**9 + 7",
"10**9 + 7",
"MOD",
"class MyRange(object):\n def __init__(self, l, r): \n self.l = l\n self.r = r\n\n def __and__(self, other):\n return MyRange(max(self.l, other.l), min(self.r, other.r))\n\n def __len__(self):\n return self.r - self.l\n\n def __str__(self):\n return \"[{}, {})\".format(self.l, self.r)",
"class MyRange(object):\n def __init__(self, l, r): \n self.l = l\n self.r = r\n\n def __and__(self, other):\n return MyRange(max(self.l, other.l), min(self.r, other.r))\n\n def __len__(self):\n return self.r - self.l\n\n def __str__(self):\n return \"[{}, {})\".format(self.l, self.r)",
"MyRange"
] |
from functools import reduce
MOD = 10**9 + 7
class MyRange(object):
def __init__(self, l, r):
self.l = l
self.r = r
def __and__(self, other):
return MyRange(max(self.l, other.l), min(self.r, other.r))
def __len__(self):
return self.r - self.l
def __str__(self):
return "[{}, {})".format(self.l, self.r)
def hoge(arr):
res = [MyRange(arr[0], arr[0]+1)]
for pre, cur in zip(arr, arr[1:]):
if pre < cur:
res.append(MyRange(cur, cur+1))
else:
res.append(MyRange(1, cur+1))
return res
if __name__ == "__main__":
N = int(input())
T = [int(i) for i in input().split()]
A = [int(i) for i in input().split()]
B = [t & a for t, a in zip(hoge(T), hoge(A[::-1])[::-1])]
# print(*B)
try:
C = list(map(len, B))
print(reduce(lambda a, b: (a * b) % MOD, C))
except ValueError:
print(0)
|
[
7,
12,
13,
0,
13,
39,
18,
13,
17,
0,
13,
39,
18,
13,
17,
28,
13,
4,
13,
17,
4,
13,
13,
14,
2,
18,
13,
2,
13,
17,
18,
13,
13,
4,
18,
13,
13,
18,
13,
13,
4,
18,
13,
13,
18,
13,
13,
4,
18,
13,
13,
17,
4,
18,
13,
13,
18,
13,
13,
29,
39,
13,
13,
23,
13,
0,
13,
4,
13,
4,
13,
0,
13,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
0,
13,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
0,
13,
4,
13,
13,
13,
4,
18,
13,
13,
0,
13,
4,
13,
13,
13,
4,
18,
13,
13,
4,
18,
13,
13,
0,
13,
39,
0,
13,
39,
28,
13,
4,
13,
13,
14,
2,
40,
18,
13,
13,
18,
13,
13,
40,
18,
13,
13,
18,
13,
13,
0,
13,
4,
13,
18,
13,
13,
18,
13,
13,
0,
13,
4,
13,
18,
13,
13,
18,
13,
13,
4,
18,
13,
13,
13,
4,
18,
13,
13,
13,
4,
13,
17,
4,
13,
17,
0,
13,
17,
28,
13,
4,
13,
13,
0,
13,
2,
2,
18,
13,
13,
18,
13,
13,
17,
0,
13,
2,
2,
17,
17,
17,
4,
13,
13,
10,
4,
13,
10,
4,
13,
10,
4,
13,
10,
4,
13,
10,
2,
13,
10,
39,
13,
10,
4,
13,
10,
12,
13,
10,
4,
13,
10,
4,
13,
10,
4,
13,
10,
2,
13,
10,
17,
13,
10,
4,
13,
10,
39,
13
] |
[
[
5,
4
],
[
64,
7
],
[
11,
10
],
[
64,
13
],
[
17,
16
],
[
64,
22
],
[
64,
26
],
[
16,
28
],
[
64,
31
],
[
16,
32
],
[
4,
35
],
[
64,
38
],
[
16,
39
],
[
10,
42
],
[
64,
45
],
[
16,
46
],
[
4,
49
],
[
10,
54
],
[
64,
57
],
[
16,
58
],
[
64,
64
],
[
218,
66
],
[
236,
72
],
[
239,
84
],
[
251,
96
],
[
234,
98
],
[
237,
99
],
[
251,
100
],
[
240,
103
],
[
242,
106
],
[
234,
108
],
[
240,
109
],
[
242,
110
],
[
243,
113
],
[
216,
117
],
[
227,
120
],
[
254,
123
],
[
127,
126
],
[
219,
129
],
[
243,
134
],
[
126,
135
],
[
252,
137
],
[
126,
138
],
[
231,
141
],
[
126,
142
],
[
216,
144
],
[
126,
145
],
[
212,
147
],
[
231,
151
],
[
126,
152
],
[
243,
154
],
[
126,
155
],
[
221,
157
],
[
252,
161
],
[
126,
162
],
[
216,
164
],
[
126,
165
],
[
228,
168
],
[
213,
170
],
[
255,
173
],
[
222,
175
],
[
248,
183
],
[
187,
186
],
[
219,
189
],
[
245,
191
],
[
255,
195
],
[
186,
196
],
[
228,
198
],
[
186,
199
],
[
224,
202
],
[
225,
210
],
[
246,
210
],
[
249,
210
],
[
212,
213
],
[
242,
216
],
[
218,
219
],
[
221,
222
],
[
224,
225
],
[
227,
228
],
[
251,
231
],
[
236,
237
],
[
239,
240
],
[
242,
243
],
[
245,
246
],
[
248,
249
],
[
251,
252
],
[
254,
255
]
] |
[
"def init(lst):\n l = [lst[0]]\n r = [lst[0]]\n for i in range(1, len(lst)):\n if lst[i - 1] < lst[i]:\n l.append(lst[i])\n r.append(lst[i])\n else:\n l.append(1)\n r.append(lst[i])\n return l, r\n\nn = int(input())\nt = list(map(int, input().split()))\na = list(map(int, input().split()))\n\nl1, r1 = init(t)\na.reverse()\nl2, r2 = init(a)\nl2.reverse()\nr2.reverse()\n\nl3 = []\nr3 = []\nfor i in range(n):\n if l2[i] <= r1[i] and l1[i] <= r2[i]:\n l = max(l1[i], l2[i])\n r = min(r1[i], r2[i])\n l3.append(l)\n r3.append(r)\n else:\n print(0)\n exit(0)\n\nans = 1\nfor i in range(n):\n ans *= r3[i] - l3[i] + 1\n ans %= 10 ** 9 + 7\nprint(ans)",
"def init(lst):\n l = [lst[0]]\n r = [lst[0]]\n for i in range(1, len(lst)):\n if lst[i - 1] < lst[i]:\n l.append(lst[i])\n r.append(lst[i])\n else:\n l.append(1)\n r.append(lst[i])\n return l, r",
"init",
"l = [lst[0]]",
"l",
"[lst[0]]",
"lst[0]",
"lst",
"0",
"r = [lst[0]]",
"r",
"[lst[0]]",
"lst[0]",
"lst",
"0",
"for i in range(1, len(lst)):\n if lst[i - 1] < lst[i]:\n l.append(lst[i])\n r.append(lst[i])\n else:\n l.append(1)\n r.append(lst[i])\n ",
"i",
"range(1, len(lst))",
"range",
"1",
"len(lst)",
"len",
"lst",
"if lst[i - 1] < lst[i]:\n l.append(lst[i])\n r.append(lst[i])\n else:\n l.append(1)\n r.append(lst[i])\n ",
"lst[i - 1] < lst[i]",
"lst[i - 1]",
"lst",
"i - 1",
"i",
"1",
"lst[i]",
"lst",
"i",
"l.append(lst[i])",
"l.append",
"l",
"append",
"lst[i]",
"lst",
"i",
"r.append(lst[i])",
"r.append",
"r",
"append",
"lst[i]",
"lst",
"i",
"l.append(1)",
"l.append",
"l",
"append",
"1",
"r.append(lst[i])",
"r.append",
"r",
"append",
"lst[i]",
"lst",
"i",
"return l, r",
"return l, r",
"l",
"r",
"lst",
"lst",
"n = int(input())",
"n",
"int(input())",
"int",
"input()",
"input",
"t = list(map(int, input().split()))",
"t",
"list(map(int, input().split()))",
"list",
"map(int, input().split())",
"map",
"int",
"input().split()",
"().split",
"()",
"input",
"split",
"a = list(map(int, input().split()))",
"a",
"list(map(int, input().split()))",
"list",
"map(int, input().split())",
"map",
"int",
"input().split()",
"().split",
"()",
"input",
"split",
"l1, r1 = init(t)",
"l1",
"init(t)",
"init",
"t",
"r1",
"a.reverse()",
"a.reverse",
"a",
"reverse",
"l2, r2 = init(a)",
"l2",
"init(a)",
"init",
"a",
"r2",
"l2.reverse()",
"l2.reverse",
"l2",
"reverse",
"r2.reverse()",
"r2.reverse",
"r2",
"reverse",
"l3 = []",
"l3",
"[]",
"r3 = []",
"r3",
"[]",
"for i in range(n):\n if l2[i] <= r1[i] and l1[i] <= r2[i]:\n l = max(l1[i], l2[i])\n r = min(r1[i], r2[i])\n l3.append(l)\n r3.append(r)\n else:\n print(0)\n exit(0)",
"i",
"range(n)",
"range",
"n",
"if l2[i] <= r1[i] and l1[i] <= r2[i]:\n l = max(l1[i], l2[i])\n r = min(r1[i], r2[i])\n l3.append(l)\n r3.append(r)\n else:\n print(0)\n exit(0)",
"l2[i] <= r1[i] and l1[i] <= r2[i]",
"l2[i] <= r1[i]",
"l2[i]",
"l2",
"i",
"r1[i]",
"r1",
"i",
"l1[i] <= r2[i]",
"l1[i]",
"l1",
"i",
"r2[i]",
"r2",
"i",
"l = max(l1[i], l2[i])",
"l",
"max(l1[i], l2[i])",
"max",
"l1[i]",
"l1",
"i",
"l2[i]",
"l2",
"i",
"r = min(r1[i], r2[i])",
"r",
"min(r1[i], r2[i])",
"min",
"r1[i]",
"r1",
"i",
"r2[i]",
"r2",
"i",
"l3.append(l)",
"l3.append",
"l3",
"append",
"l",
"r3.append(r)",
"r3.append",
"r3",
"append",
"r",
"print(0)",
"print",
"0",
"exit(0)",
"exit",
"0",
"ans = 1",
"ans",
"1",
"for i in range(n):\n ans *= r3[i] - l3[i] + 1\n ans %= 10 ** 9 + 7",
"i",
"range(n)",
"range",
"n",
"ans *= r3[i] - l3[i] + 1",
"ans",
"r3[i] - l3[i] + 1",
"r3[i] - l3[i]",
"r3[i]",
"r3",
"i",
"l3[i]",
"l3",
"i",
"1",
"ans %= 10 ** 9 + 7",
"ans",
"10 ** 9 + 7",
"10 ** 9",
"10",
"9",
"7",
"print(ans)",
"print",
"ans",
"l = max(l1[i], l2[i])",
"max(l1[i], l2[i])",
"l",
"r2 = init(a)",
"init(a)",
"r2",
"n = int(input())",
"int(input())",
"n",
"r = min(r1[i], r2[i])",
"min(r1[i], r2[i])",
"r",
"ans %= 10 ** 9 + 7",
"10 ** 9 + 7",
"ans",
"l3 = []",
"[]",
"l3",
"l1, r1 = init(t)",
"init(t)",
"l1",
"def init(lst):\n l = [lst[0]]\n r = [lst[0]]\n for i in range(1, len(lst)):\n if lst[i - 1] < lst[i]:\n l.append(lst[i])\n r.append(lst[i])\n else:\n l.append(1)\n r.append(lst[i])\n return l, r",
"def init(lst):\n l = [lst[0]]\n r = [lst[0]]\n for i in range(1, len(lst)):\n if lst[i - 1] < lst[i]:\n l.append(lst[i])\n r.append(lst[i])\n else:\n l.append(1)\n r.append(lst[i])\n return l, r",
"init",
"t = list(map(int, input().split()))",
"list(map(int, input().split()))",
"t",
"a = list(map(int, input().split()))",
"list(map(int, input().split()))",
"a",
"l2, r2 = init(a)",
"init(a)",
"l2",
"ans *= r3[i] - l3[i] + 1",
"r3[i] - l3[i] + 1",
"ans",
"ans = 1",
"1",
"ans",
"r1 = init(t)",
"init(t)",
"r1",
"r3 = []",
"[]",
"r3"
] |
def init(lst):
l = [lst[0]]
r = [lst[0]]
for i in range(1, len(lst)):
if lst[i - 1] < lst[i]:
l.append(lst[i])
r.append(lst[i])
else:
l.append(1)
r.append(lst[i])
return l, r
n = int(input())
t = list(map(int, input().split()))
a = list(map(int, input().split()))
l1, r1 = init(t)
a.reverse()
l2, r2 = init(a)
l2.reverse()
r2.reverse()
l3 = []
r3 = []
for i in range(n):
if l2[i] <= r1[i] and l1[i] <= r2[i]:
l = max(l1[i], l2[i])
r = min(r1[i], r2[i])
l3.append(l)
r3.append(r)
else:
print(0)
exit(0)
ans = 1
for i in range(n):
ans *= r3[i] - l3[i] + 1
ans %= 10 ** 9 + 7
print(ans)
|
[
7,
0,
13,
4,
13,
4,
13,
0,
13,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
0,
13,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
0,
13,
2,
2,
17,
17,
17,
28,
13,
13,
4,
13,
13,
13,
14,
2,
2,
2,
13,
13,
18,
13,
17,
18,
13,
17,
3,
4,
13,
17,
4,
13,
0,
13,
17,
28,
13,
4,
13,
17,
2,
13,
17,
14,
2,
2,
18,
13,
2,
13,
17,
18,
13,
13,
2,
18,
13,
13,
18,
13,
2,
13,
17,
0,
13,
2,
2,
13,
4,
13,
18,
13,
13,
18,
13,
13,
13,
4,
13,
13,
10,
2,
13,
10,
4,
13,
10,
2,
13,
10,
4,
13,
10,
17,
13,
10,
4,
13
] |
[
[
121,
2
],
[
127,
8
],
[
115,
20
],
[
112,
32
],
[
128,
43
],
[
116,
44
],
[
128,
52
],
[
116,
55
],
[
124,
64
],
[
68,
67
],
[
122,
72
],
[
128,
78
],
[
67,
80
],
[
128,
83
],
[
67,
84
],
[
116,
87
],
[
67,
88
],
[
116,
90
],
[
67,
92
],
[
118,
95
],
[
125,
98
],
[
119,
98
],
[
128,
102
],
[
67,
103
],
[
116,
105
],
[
67,
106
],
[
113,
107
],
[
119,
110
],
[
125,
110
],
[
112,
113
],
[
115,
116
],
[
118,
119
],
[
121,
122
],
[
124,
125
],
[
127,
128
]
] |
[
"n = int(input())\nt = list(map(int, input().split()))\na = list(map(int, input().split()))\nmod = 10 ** 9 + 7\n\nfor ti, ai in zip(t, a):\n if ti == ai == t[-1] == a[0]:\n break\nelse:\n print(0)\n exit()\n\nans = 1\nfor i in range(1, n - 1):\n if t[i - 1] == t[i] and a[i] == a[i + 1]:\n ans = ans * min(t[i], a[i]) % mod\nprint(ans)",
"n = int(input())",
"n",
"int(input())",
"int",
"input()",
"input",
"t = list(map(int, input().split()))",
"t",
"list(map(int, input().split()))",
"list",
"map(int, input().split())",
"map",
"int",
"input().split()",
"().split",
"()",
"input",
"split",
"a = list(map(int, input().split()))",
"a",
"list(map(int, input().split()))",
"list",
"map(int, input().split())",
"map",
"int",
"input().split()",
"().split",
"()",
"input",
"split",
"mod = 10 ** 9 + 7",
"mod",
"10 ** 9 + 7",
"10 ** 9",
"10",
"9",
"7",
"for ti, ai in zip(t, a):\n if ti == ai == t[-1] == a[0]:\n break\nelse:\n print(0)\n exit()",
"ti",
"ai",
"zip(t, a)",
"zip",
"t",
"a",
"if ti == ai == t[-1] == a[0]:\n break",
"ti == ai == t[-1] == a[0]",
"ti == ai == t[-1]",
"ti == ai",
"ti",
"ai",
"t[-1]",
"t",
"-1",
"a[0]",
"a",
"0",
"break",
"print(0)",
"print",
"0",
"exit()",
"exit",
"ans = 1",
"ans",
"1",
"for i in range(1, n - 1):\n if t[i - 1] == t[i] and a[i] == a[i + 1]:\n ans = ans * min(t[i], a[i]) % mod",
"i",
"range(1, n - 1)",
"range",
"1",
"n - 1",
"n",
"1",
"if t[i - 1] == t[i] and a[i] == a[i + 1]:\n ans = ans * min(t[i], a[i]) % mod",
"t[i - 1] == t[i] and a[i] == a[i + 1]",
"t[i - 1] == t[i]",
"t[i - 1]",
"t",
"i - 1",
"i",
"1",
"t[i]",
"t",
"i",
"a[i] == a[i + 1]",
"a[i]",
"a",
"i",
"a[i + 1]",
"a",
"i + 1",
"i",
"1",
"ans = ans * min(t[i], a[i]) % mod",
"ans",
"ans * min(t[i], a[i]) % mod",
"ans * min(t[i], a[i])",
"ans",
"min(t[i], a[i])",
"min",
"t[i]",
"t",
"i",
"a[i]",
"a",
"i",
"mod",
"print(ans)",
"print",
"ans",
"mod = 10 ** 9 + 7",
"10 ** 9 + 7",
"mod",
"a = list(map(int, input().split()))",
"list(map(int, input().split()))",
"a",
"ans = ans * min(t[i], a[i]) % mod",
"ans * min(t[i], a[i]) % mod",
"ans",
"n = int(input())",
"int(input())",
"n",
"ans = 1",
"1",
"ans",
"t = list(map(int, input().split()))",
"list(map(int, input().split()))",
"t"
] |
n = int(input())
t = list(map(int, input().split()))
a = list(map(int, input().split()))
mod = 10 ** 9 + 7
for ti, ai in zip(t, a):
if ti == ai == t[-1] == a[0]:
break
else:
print(0)
exit()
ans = 1
for i in range(1, n - 1):
if t[i - 1] == t[i] and a[i] == a[i + 1]:
ans = ans * min(t[i], a[i]) % mod
print(ans)
|
[
7,
0,
13,
17,
0,
13,
4,
13,
4,
13,
41,
28,
13,
4,
18,
4,
13,
13,
4,
4,
13,
13,
0,
13,
13,
41,
28,
13,
4,
18,
4,
13,
13,
4,
4,
13,
13,
0,
13,
13,
0,
13,
4,
13,
13,
0,
13,
4,
13,
13,
0,
13,
13,
14,
40,
13,
13,
4,
13,
17,
0,
13,
4,
18,
13,
13,
13,
0,
13,
2,
2,
13,
17,
4,
18,
4,
13,
4,
13,
13,
13,
13,
14,
2,
13,
13,
4,
13,
17,
0,
13,
17,
0,
13,
17,
28,
13,
4,
13,
17,
2,
13,
17,
14,
2,
18,
13,
13,
13,
0,
13,
18,
13,
13,
0,
13,
18,
13,
13,
0,
13,
13,
0,
13,
17,
28,
13,
4,
13,
2,
13,
17,
2,
13,
17,
17,
14,
2,
18,
13,
13,
13,
0,
13,
18,
13,
13,
0,
13,
18,
13,
13,
0,
13,
13,
14,
2,
2,
13,
13,
17,
28,
13,
4,
13,
2,
2,
13,
13,
17,
0,
13,
13,
0,
13,
13,
4,
13,
2,
13,
17,
10,
2,
13,
10,
13,
13,
10,
4,
13,
10,
13,
13,
10,
13,
13,
10,
18,
13,
10,
18,
13,
10,
17,
13,
10,
4,
13,
10,
17,
13,
10,
17,
13,
10,
4,
13,
10,
13,
13,
10,
18,
13,
10,
18,
13,
10,
13,
13,
10,
17,
13,
10,
13,
13,
10,
4,
13,
10,
13,
13
] |
[
[
209,
2
],
[
206,
5
],
[
13,
12
],
[
12,
21
],
[
191,
23
],
[
28,
27
],
[
27,
36
],
[
194,
38
],
[
236,
41
],
[
192,
44
],
[
188,
46
],
[
195,
49
],
[
227,
51
],
[
237,
52
],
[
237,
55
],
[
189,
56
],
[
215,
61
],
[
192,
64
],
[
228,
66
],
[
182,
68
],
[
207,
71
],
[
195,
79
],
[
228,
81
],
[
183,
84
],
[
216,
85
],
[
212,
90
],
[
230,
93
],
[
97,
96
],
[
216,
101
],
[
192,
106
],
[
96,
107
],
[
231,
108
],
[
198,
108
],
[
197,
110
],
[
192,
112
],
[
96,
113
],
[
224,
115
],
[
192,
117
],
[
96,
118
],
[
185,
120
],
[
210,
121
],
[
203,
123
],
[
127,
126
],
[
207,
130
],
[
183,
133
],
[
195,
139
],
[
126,
140
],
[
204,
141
],
[
198,
141
],
[
231,
141
],
[
222,
141
],
[
221,
143
],
[
195,
145
],
[
126,
146
],
[
200,
148
],
[
195,
150
],
[
126,
151
],
[
218,
153
],
[
210,
154
],
[
183,
158
],
[
216,
159
],
[
163,
162
],
[
183,
167
],
[
216,
168
],
[
233,
171
],
[
228,
172
],
[
239,
174
],
[
210,
175
],
[
240,
179
],
[
234,
179
],
[
219,
179
],
[
201,
179
],
[
186,
179
],
[
225,
179
],
[
213,
179
],
[
182,
183
],
[
210,
185
],
[
185,
186
],
[
188,
189
],
[
191,
192
],
[
194,
195
],
[
197,
198
],
[
200,
201
],
[
203,
204
],
[
206,
207
],
[
209,
210
],
[
212,
213
],
[
215,
216
],
[
210,
218
],
[
218,
219
],
[
221,
222
],
[
224,
225
],
[
237,
227
],
[
227,
228
],
[
230,
231
],
[
228,
233
],
[
233,
234
],
[
236,
237
],
[
210,
239
],
[
239,
240
]
] |
[
"MOD = 1000000007\nn = int(input())\ntli = [ int(it) for it in input().split() ]\nali = [ int(it) for it in input().split() ]\n#print (tli,ali)\n\nmav1 = max(tli)\nmav2 = max(ali)\nmav = mav1\n#print (mav1,mav2)\nif (mav1!=mav2):\n print (0)\nelse:\n mai1 = tli.index(mav)\n mai2 = n-1-list(reversed(ali)).index(mav)\n #print (mai1,mai2)\n if (mai2<mai1):\n print (0)\n else:\n s = 1\n tma = -1\n for i in range(0,mai1+1):\n if tli[i]>tma:\n tma = tli[i]\n #print (\"lt\",tma)\n else:\n s*=(tli[i])\n s%=MOD\n #print (\"l\")\n tma = -1\n for i in range(n-1,mai2-1,-1):\n if ali[i]>tma:\n tma = ali[i]\n #print (\"rt\",tma)\n else:\n s*=(ali[i])\n s%=MOD\n #print (\"r\")\n if (mai2-mai1>1):\n for i in range(mai2-mai1-1):\n s*=mav\n s%=MOD\n print ( s%(1000000007) )\n \n \n \n \n \n\n ",
"MOD = 1000000007",
"MOD",
"1000000007",
"n = int(input())",
"n",
"int(input())",
"int",
"input()",
"input",
"int(it) for it in input().split()",
"for it in input().split()",
"it",
"input().split()",
"().split",
"()",
"input",
"split",
"for it in input().split()",
"int(it)",
"int",
"it",
"tli = [ int(it) for it in input().split() ]",
"tli",
"[ int(it) for it in input().split() ]",
"int(it) for it in input().split()",
"for it in input().split()",
"it",
"input().split()",
"().split",
"()",
"input",
"split",
"for it in input().split()",
"int(it)",
"int",
"it",
"ali = [ int(it) for it in input().split() ]",
"ali",
"[ int(it) for it in input().split() ]",
"mav1 = max(tli)",
"mav1",
"max(tli)",
"max",
"tli",
"mav2 = max(ali)",
"mav2",
"max(ali)",
"max",
"ali",
"mav = mav1",
"mav",
"mav1",
"if (mav1!=mav2):\n print (0)\nelse:\n mai1 = tli.index(mav)\n mai2 = n-1-list(reversed(ali)).index(mav)\n #print (mai1,mai2)\n if (mai2<mai1):\n print (0)\n else:\n s = 1\n tma = -1\n for i in range(0,mai1+1):\n if tli[i]>tma:\n tma = tli[i]\n #print (\"lt\",tma)\n else:\n s*=(tli[i])\n s%=MOD\n #print (\"l\")\n tma = -1\n for i in range(n-1,mai2-1,-1):\n if ali[i]>tma:\n tma = ali[i]\n #print (\"rt\",tma)\n else:\n s*=(ali[i])\n s%=MOD\n #print (\"r\")\n if (mai2-mai1>1):\n for i in range(mai2-mai1-1):\n s*=mav\n s%=MOD\n print ( s%(1000000007) )\n \n \n \n \n \n\n ",
"mav1!=mav2",
"mav1",
"mav2",
"print (0)",
"print",
"0",
"mai1 = tli.index(mav)",
"mai1",
"tli.index(mav)",
"tli.index",
"tli",
"index",
"mav",
"mai2 = n-1-list(reversed(ali)).index(mav)",
"mai2",
"n-1-list(reversed(ali)).index(mav)",
"n-1",
"n",
"1",
"list(reversed(ali)).index(mav)",
"(reversed(ali)).index",
"(reversed(ali))",
"list",
"reversed(ali)",
"reversed",
"ali",
"index",
"mav",
"if (mai2<mai1):\n print (0)\n else:\n s = 1\n tma = -1\n for i in range(0,mai1+1):\n if tli[i]>tma:\n tma = tli[i]\n #print (\"lt\",tma)\n else:\n s*=(tli[i])\n s%=MOD\n #print (\"l\")\n tma = -1\n for i in range(n-1,mai2-1,-1):\n if ali[i]>tma:\n tma = ali[i]\n #print (\"rt\",tma)\n else:\n s*=(ali[i])\n s%=MOD\n #print (\"r\")\n if (mai2-mai1>1):\n for i in range(mai2-mai1-1):\n s*=mav\n s%=MOD\n print ( s%(1000000007) )\n \n \n \n \n \n\n ",
"mai2<mai1",
"mai2",
"mai1",
"print (0)",
"print",
"0",
"s = 1",
"s",
"1",
"tma = -1",
"tma",
"-1",
"for i in range(0,mai1+1):\n if tli[i]>tma:\n tma = tli[i]\n #print (\"lt\",tma)\n else:\n s*=(tli[i])\n s%=MOD\n #print (\"l\")\n ",
"i",
"range(0,mai1+1)",
"range",
"0",
"mai1+1",
"mai1",
"1",
"if tli[i]>tma:\n tma = tli[i]\n #print (\"lt\",tma)\n else:\n s*=(tli[i])\n s%=MOD\n #print (\"l\")\n ",
"tli[i]>tma",
"tli[i]",
"tli",
"i",
"tma",
"tma = tli[i]",
"tma",
"tli[i]",
"tli",
"i",
"s*=(tli[i])",
"s",
"tli[i]",
"tli",
"i",
"s%=MOD",
"s",
"MOD",
"tma = -1",
"tma",
"-1",
"for i in range(n-1,mai2-1,-1):\n if ali[i]>tma:\n tma = ali[i]\n #print (\"rt\",tma)\n else:\n s*=(ali[i])\n s%=MOD\n #print (\"r\")\n ",
"i",
"range(n-1,mai2-1,-1)",
"range",
"n-1",
"n",
"1",
"mai2-1",
"mai2",
"1",
"-1",
"if ali[i]>tma:\n tma = ali[i]\n #print (\"rt\",tma)\n else:\n s*=(ali[i])\n s%=MOD\n #print (\"r\")\n ",
"ali[i]>tma",
"ali[i]",
"ali",
"i",
"tma",
"tma = ali[i]",
"tma",
"ali[i]",
"ali",
"i",
"s*=(ali[i])",
"s",
"ali[i]",
"ali",
"i",
"s%=MOD",
"s",
"MOD",
"if (mai2-mai1>1):\n for i in range(mai2-mai1-1):\n s*=mav\n s%=MOD\n ",
"mai2-mai1>1",
"mai2-mai1",
"mai2",
"mai1",
"1",
"for i in range(mai2-mai1-1):\n s*=mav\n s%=MOD\n ",
"i",
"range(mai2-mai1-1)",
"range",
"mai2-mai1-1",
"mai2-mai1",
"mai2",
"mai1",
"1",
"s*=mav",
"s",
"mav",
"s%=MOD",
"s",
"MOD",
"print ( s%(1000000007) )",
"print",
"s%(1000000007)",
"s",
"1000000007",
"mai2 = n-1-list(reversed(ali)).index(mav)",
"n-1-list(reversed(ali)).index(mav)",
"mai2",
"s%=MOD",
"MOD",
"s",
"mav2 = max(ali)",
"max(ali)",
"mav2",
"tli = [ int(it) for it in input().split() ]",
"[ int(it) for it in input().split() ]",
"tli",
"ali = [ int(it) for it in input().split() ]",
"[ int(it) for it in input().split() ]",
"ali",
"tma = tli[i]",
"tli[i]",
"tma",
"s*=(ali[i])",
"ali[i]",
"s",
"tma = -1",
"-1",
"tma",
"n = int(input())",
"int(input())",
"n",
"MOD = 1000000007",
"1000000007",
"MOD",
"s = 1",
"1",
"s",
"mai1 = tli.index(mav)",
"tli.index(mav)",
"mai1",
"s%=MOD",
"MOD",
"s",
"tma = ali[i]",
"ali[i]",
"tma",
"s*=(tli[i])",
"tli[i]",
"s",
"mav = mav1",
"mav1",
"mav",
"tma = -1",
"-1",
"tma",
"s*=mav",
"mav",
"s",
"mav1 = max(tli)",
"max(tli)",
"mav1",
"s%=MOD",
"MOD",
"s"
] |
MOD = 1000000007
n = int(input())
tli = [ int(it) for it in input().split() ]
ali = [ int(it) for it in input().split() ]
#print (tli,ali)
mav1 = max(tli)
mav2 = max(ali)
mav = mav1
#print (mav1,mav2)
if (mav1!=mav2):
print (0)
else:
mai1 = tli.index(mav)
mai2 = n-1-list(reversed(ali)).index(mav)
#print (mai1,mai2)
if (mai2<mai1):
print (0)
else:
s = 1
tma = -1
for i in range(0,mai1+1):
if tli[i]>tma:
tma = tli[i]
#print ("lt",tma)
else:
s*=(tli[i])
s%=MOD
#print ("l")
tma = -1
for i in range(n-1,mai2-1,-1):
if ali[i]>tma:
tma = ali[i]
#print ("rt",tma)
else:
s*=(ali[i])
s%=MOD
#print ("r")
if (mai2-mai1>1):
for i in range(mai2-mai1-1):
s*=mav
s%=MOD
print ( s%(1000000007) )
|
[
7,
15,
13,
4,
18,
13,
13,
2,
17,
17,
0,
13,
18,
18,
13,
13,
13,
15,
15,
15,
15,
15,
15,
15,
15,
12,
13,
23,
13,
23,
13,
0,
13,
4,
13,
17,
0,
13,
2,
2,
17,
17,
17,
12,
13,
28,
13,
13,
23,
12,
13,
23,
13,
12,
13,
12,
13,
12,
13,
12,
13,
41,
28,
13,
4,
18,
4,
13,
13,
4,
2,
4,
13,
13,
17,
12,
13,
12,
13,
41,
28,
13,
4,
13,
13,
4,
4,
13,
12,
13,
23,
13,
41,
28,
13,
4,
13,
13,
4,
4,
13,
12,
13,
23,
13,
41,
28,
13,
4,
13,
13,
4,
4,
13,
12,
13,
23,
13,
41,
28,
13,
4,
13,
4,
4,
13,
4,
13,
13,
4,
18,
13,
13,
12,
13,
12,
13,
12,
13,
12,
13,
6,
13,
12,
13,
0,
18,
13,
13,
2,
13,
13,
23,
13,
23,
13,
12,
13,
29,
4,
13,
18,
13,
13,
23,
13,
0,
13,
13,
12,
13,
14,
4,
13,
13,
13,
29,
4,
13,
2,
18,
13,
13,
18,
13,
13,
29,
4,
13,
2,
18,
13,
13,
13,
23,
13,
23,
13,
0,
13,
13,
12,
13,
14,
4,
13,
13,
13,
29,
4,
13,
2,
18,
13,
13,
18,
13,
13,
29,
4,
13,
2,
18,
13,
13,
13,
23,
13,
23,
13,
12,
13,
14,
4,
13,
13,
13,
29,
4,
13,
2,
18,
13,
13,
18,
13,
13,
29,
4,
13,
2,
13,
18,
13,
13,
23,
13,
23,
13,
12,
13,
14,
4,
13,
13,
13,
29,
4,
13,
2,
18,
13,
13,
18,
13,
13,
29,
4,
13,
2,
18,
13,
13,
13,
23,
13,
23,
13,
0,
13,
13,
12,
13,
14,
4,
13,
13,
13,
29,
4,
13,
2,
18,
13,
13,
4,
13,
18,
13,
13,
2,
13,
17,
13,
29,
4,
13,
2,
18,
13,
13,
4,
13,
13,
2,
13,
17,
13,
23,
13,
23,
13,
12,
13,
14,
4,
13,
13,
13,
29,
4,
13,
2,
13,
4,
13,
18,
13,
13,
2,
13,
17,
13,
29,
4,
13,
2,
18,
13,
13,
4,
13,
18,
13,
13,
2,
13,
17,
13,
23,
13,
23,
13,
12,
13,
14,
4,
13,
13,
13,
29,
4,
13,
4,
13,
18,
13,
13,
18,
13,
13,
13,
29,
4,
13,
4,
13,
18,
13,
13,
13,
13,
23,
13,
23,
13,
12,
13,
14,
4,
13,
13,
13,
29,
4,
13,
4,
13,
18,
13,
13,
18,
13,
13,
13,
29,
4,
13,
4,
13,
13,
18,
13,
13,
13,
23,
13,
23,
13,
12,
13,
0,
13,
4,
13,
0,
13,
4,
13,
0,
13,
4,
13,
0,
13,
2,
39,
13,
13,
0,
13,
2,
39,
17,
13,
0,
13,
17,
28,
13,
13,
4,
13,
13,
14,
2,
13,
13,
0,
18,
13,
13,
13,
0,
13,
13,
0,
18,
13,
13,
13,
0,
13,
17,
28,
13,
18,
4,
13,
13,
39,
17,
0,
13,
18,
13,
13,
14,
2,
13,
13,
14,
40,
18,
13,
13,
17,
14,
40,
18,
13,
13,
13,
4,
13,
17,
29,
14,
2,
18,
13,
13,
13,
4,
13,
17,
29,
0,
18,
13,
13,
13,
0,
13,
13,
0,
18,
13,
13,
4,
13,
18,
13,
13,
13,
14,
40,
18,
13,
13,
17,
14,
2,
18,
13,
13,
18,
13,
13,
4,
13,
17,
29,
0,
13,
4,
13,
17,
28,
13,
39,
13,
13,
4,
13,
4,
13,
13,
13,
14,
2,
13,
17,
0,
13,
13,
4,
13,
13,
14,
2,
13,
17,
4,
13,
10,
12,
13,
10,
12,
13,
10,
12,
13,
10,
12,
13,
10,
6,
13,
10,
4,
13,
10,
18,
13,
10,
12,
13,
10,
12,
13,
10,
2,
13,
10,
12,
13,
10,
12,
13,
10,
12,
13,
10,
12,
13,
10,
12,
13,
10,
12,
13,
10,
12,
13,
10,
12,
13,
10,
12,
13,
10,
12,
13,
10,
12,
13
] |
[
[
624,
11
],
[
28,
28
],
[
30,
30
],
[
621,
32
],
[
633,
37
],
[
47,
46
],
[
52,
52
],
[
64,
63
],
[
625,
67
],
[
63,
73
],
[
82,
81
],
[
91,
91
],
[
95,
94
],
[
637,
100
],
[
104,
104
],
[
108,
107
],
[
667,
113
],
[
117,
117
],
[
121,
120
],
[
625,
122
],
[
120,
131
],
[
149,
146
],
[
153,
147
],
[
155,
148
],
[
155,
150
],
[
634,
151
],
[
153,
153
],
[
155,
155
],
[
165,
162
],
[
165,
165
],
[
168,
167
],
[
157,
168
],
[
197,
174
],
[
195,
181
],
[
197,
184
],
[
195,
191
],
[
197,
193
],
[
195,
195
],
[
197,
197
],
[
200,
199
],
[
170,
200
],
[
229,
206
],
[
227,
213
],
[
229,
216
],
[
227,
223
],
[
229,
225
],
[
227,
227
],
[
229,
229
],
[
258,
235
],
[
258,
242
],
[
256,
245
],
[
258,
251
],
[
256,
253
],
[
256,
256
],
[
258,
258
],
[
287,
264
],
[
285,
271
],
[
287,
274
],
[
285,
281
],
[
287,
283
],
[
285,
285
],
[
287,
287
],
[
290,
289
],
[
260,
290
],
[
331,
296
],
[
329,
303
],
[
331,
308
],
[
634,
311
],
[
634,
313
],
[
329,
319
],
[
331,
323
],
[
634,
325
],
[
634,
327
],
[
329,
329
],
[
331,
331
],
[
372,
337
],
[
370,
338
],
[
372,
343
],
[
370,
347
],
[
634,
350
],
[
634,
352
],
[
372,
358
],
[
370,
363
],
[
634,
366
],
[
634,
368
],
[
370,
370
],
[
372,
372
],
[
405,
378
],
[
403,
386
],
[
405,
389
],
[
634,
391
],
[
403,
398
],
[
405,
400
],
[
634,
401
],
[
403,
403
],
[
405,
405
],
[
438,
411
],
[
438,
419
],
[
436,
422
],
[
634,
424
],
[
438,
430
],
[
436,
432
],
[
634,
434
],
[
436,
436
],
[
438,
438
],
[
443,
442
],
[
658,
444
],
[
447,
446
],
[
637,
448
],
[
451,
450
],
[
637,
452
],
[
455,
454
],
[
442,
458
],
[
461,
460
],
[
442,
464
],
[
467,
466
],
[
446,
473
],
[
466,
476
],
[
484,
476
],
[
482,
479
],
[
460,
480
],
[
485,
484
],
[
490,
487
],
[
454,
488
],
[
493,
492
],
[
496,
495
],
[
442,
499
],
[
504,
503
],
[
450,
505
],
[
495,
506
],
[
492,
509
],
[
484,
509
],
[
466,
509
],
[
543,
509
],
[
503,
510
],
[
479,
513
],
[
538,
513
],
[
460,
514
],
[
495,
515
],
[
479,
519
],
[
538,
519
],
[
460,
520
],
[
495,
521
],
[
503,
522
],
[
487,
529
],
[
546,
529
],
[
454,
530
],
[
495,
531
],
[
503,
532
],
[
541,
538
],
[
460,
539
],
[
495,
540
],
[
503,
541
],
[
544,
543
],
[
503,
544
],
[
549,
546
],
[
454,
547
],
[
495,
548
],
[
487,
551
],
[
546,
551
],
[
454,
552
],
[
495,
553
],
[
503,
554
],
[
538,
557
],
[
479,
557
],
[
460,
558
],
[
495,
559
],
[
538,
563
],
[
479,
563
],
[
460,
564
],
[
495,
565
],
[
546,
566
],
[
487,
566
],
[
454,
567
],
[
495,
568
],
[
575,
574
],
[
454,
587
],
[
460,
588
],
[
595,
594
],
[
594,
598
],
[
574,
598
],
[
607,
604
],
[
621,
622
],
[
624,
625
],
[
633,
634
]
] |
[
"#\n# ⋀_⋀ \n# (・ω・) \n# ./ U ∽ U\\n# │* 合 *│\n# │* 格 *│ \n# │* 祈 *│ \n# │* 願 *│ \n# │* *│ \n#  ̄\n#\nimport sys\nsys.setrecursionlimit(10**6)\ninput=sys.stdin.readline\nfrom math import floor,sqrt,factorial,hypot,log #log2ないyp\nfrom heapq import heappop, heappush, heappushpop\nfrom collections import Counter,defaultdict,deque\nfrom itertools import accumulate,permutations,combinations,product,combinations_with_replacement\nfrom bisect import bisect_left,bisect_right\nfrom copy import deepcopy\nfrom fractions import gcd\nfrom random import randint\ndef ceil(a,b): return (a+b-1)//b\ninf=float('inf')\nmod = 10**9+7\ndef pprint(*A): \n for a in A: print(*a,sep='\\n')\ndef INT_(n): return int(n)-1\ndef MI(): return map(int,input().split())\ndef MF(): return map(float, input().split())\ndef MI_(): return map(INT_,input().split())\ndef LI(): return list(MI())\ndef LI_(): return [int(x) - 1 for x in input().split()]\ndef LF(): return list(MF())\ndef LIN(n:int): return [I() for _ in range(n)]\ndef LLIN(n: int): return [LI() for _ in range(n)]\ndef LLIN_(n: int): return [LI_() for _ in range(n)]\ndef LLI(): return [list(map(int, l.split() )) for l in input()]\ndef I(): return int(input())\ndef F(): return float(input())\ndef ST(): return input().replace('\\n', '')\n#mint\nclass ModInt:\n def __init__(self, x):\n self.x = x % mod\n \n def __str__(self):\n return str(self.x)\n \n __repr__ = __str__\n\n def __add__(self, other):\n if isinstance(other, ModInt):\n return ModInt(self.x + other.x)\n else:\n return ModInt(self.x + other)\n\n __radd__ = __add__\n \n def __sub__(self, other):\n if isinstance(other, ModInt):\n return ModInt(self.x - other.x)\n else:\n return ModInt(self.x - other)\n\n def __rsub__(self, other):\n if isinstance(other, ModInt):\n return ModInt(other.x - self.x)\n else:\n return ModInt(other - self.x)\n\n def __mul__(self, other):\n if isinstance(other, ModInt):\n return ModInt(self.x * other.x)\n else:\n return ModInt(self.x * other)\n\n __rmul__ = __mul__\n\n def __truediv__(self, other):\n if isinstance(other, ModInt):\n return ModInt(self.x * pow(other.x, mod-2,mod))\n else:\n return ModInt(self.x * pow(other, mod - 2, mod))\n \n def __rtruediv(self, other):\n if isinstance(other, self):\n return ModInt(other * pow(self.x, mod - 2, mod))\n else:\n return ModInt(other.x * pow(self.x, mod - 2, mod))\n \n\n def __pow__(self, other):\n if isinstance(other, ModInt):\n return ModInt(pow(self.x, other.x, mod))\n else:\n return ModInt(pow(self.x, other, mod))\n \n\n def __rpow__(self, other):\n if isinstance(other, ModInt):\n return ModInt(pow(other.x, self.x, mod))\n else:\n return ModInt(pow(other, self.x, mod))\n\ndef main():\n N = I()\n T = LI()\n A = LI()\n\n lim = [inf]*N\n confirm = [None]*N\n \n now = 0\n for i,a in enumerate(T):\n if now < a:\n confirm[i] = a\n now = a\n lim[i] = a\n \n now = 0\n for i in range(N)[::-1]:\n a = A[i]\n if now < a:\n if confirm[i] is not None:\n if confirm[i] != a:\n print(0)\n return\n if lim[i] < a:\n print(0)\n return\n confirm[i] = a\n now = a\n lim[i] = min(lim[i], a)\n if confirm[i] is not None:\n if confirm[i] > lim[i]:\n print(0)\n return \n \n ans = ModInt(1)\n for i,(l,c) in enumerate(zip(lim, confirm)):\n if c is None:\n ans *= l\n\n print(ans)\n\nif __name__ == '__main__':\n main()",
"import sys",
"sys",
"sys.setrecursionlimit(10**6)",
"sys.setrecursionlimit",
"sys",
"setrecursionlimit",
"10**6",
"10",
"6",
"input=sys.stdin.readline",
"input",
"sys.stdin.readline",
"sys.stdin",
"sys",
"stdin",
"readline",
"from math import floor,sqrt,factorial,hypot,log",
"from heapq import heappop, heappush, heappushpop",
"from collections import Counter,defaultdict,deque",
"from itertools import accumulate,permutations,combinations,product,combinations_with_replacement",
"from bisect import bisect_left,bisect_right",
"from copy import deepcopy",
"from fractions import gcd",
"from random import randint",
"def ceil(a,b): return (a+b-1)//b",
"ceil",
"a",
"a",
"b",
"b",
"inf=float('inf')",
"inf",
"float('inf')",
"float",
"'inf'",
"mod = 10**9+7",
"mod",
"10**9+7",
"10**9",
"10",
"9",
"7",
"def pprint(*A): \n for a in A: print(*a,sep='\\n')",
"pprint",
"for a in A: print(*a,sep='",
"a",
"A",
"*A",
"def INT_(n): return int(n)-1",
"INT_",
"n",
"n",
"def MI(): return map(int,input().split())",
"MI",
"def MF(): return map(float, input().split())",
"MF",
"def MI_(): return map(INT_,input().split())",
"MI_",
"def LI(): return list(MI())",
"LI",
"int(x) - 1 for x in input().split()",
"for x in input().split()",
"x",
"input().split()",
"().split",
"()",
"input",
"split",
"for x in input().split()",
"int(x) - 1",
"int(x)",
"int",
"x",
"1",
"def LI_(): return [int(x) - 1 for x in input().split()]",
"LI_",
"def LF(): return list(MF())",
"LF",
"I() for _ in range(n)",
"for _ in range(n)",
"_",
"range(n)",
"range",
"n",
"for _ in range(n)",
"I()",
"I",
"def LIN(n:int): return [I() for _ in range(n)]",
"LIN",
"n:int",
"n",
"LI() for _ in range(n)",
"for _ in range(n)",
"_",
"range(n)",
"range",
"n",
"for _ in range(n)",
"LI()",
"LI",
"def LLIN(n: int): return [LI() for _ in range(n)]",
"LLIN",
"n: int",
"n",
"LI_() for _ in range(n)",
"for _ in range(n)",
"_",
"range(n)",
"range",
"n",
"for _ in range(n)",
"LI_()",
"LI_",
"def LLIN_(n: int): return [LI_() for _ in range(n)]",
"LLIN_",
"n: int",
"n",
"list(map(int, l.split() )) for l in input()",
"for l in input()",
"l",
"input()",
"input",
"for l in input()",
"list(map(int, l.split() ))",
"list",
"map(int, l.split() )",
"map",
"int",
"l.split()",
"l.split",
"l",
"split",
"def LLI(): return [list(map(int, l.split() )) for l in input()]",
"LLI",
"def I(): return int(input())",
"I",
"def F(): return float(input())",
"F",
"def ST(): return input().replace('\\n', '')\n#mint",
"ST",
"class ModInt:\n def __init__(self, x):\n self.x = x % mod\n \n def __str__(self):\n return str(self.x)\n \n __repr__ = __str__\n\n def __add__(self, other):\n if isinstance(other, ModInt):\n return ModInt(self.x + other.x)\n else:\n return ModInt(self.x + other)\n\n __radd__ = __add__\n \n def __sub__(self, other):\n if isinstance(other, ModInt):\n return ModInt(self.x - other.x)\n else:\n return ModInt(self.x - other)\n\n def __rsub__(self, other):\n if isinstance(other, ModInt):\n return ModInt(other.x - self.x)\n else:\n return ModInt(other - self.x)\n\n def __mul__(self, other):\n if isinstance(other, ModInt):\n return ModInt(self.x * other.x)\n else:\n return ModInt(self.x * other)\n\n __rmul__ = __mul__\n\n def __truediv__(self, other):\n if isinstance(other, ModInt):\n return ModInt(self.x * pow(other.x, mod-2,mod))\n else:\n return ModInt(self.x * pow(other, mod - 2, mod))\n \n def __rtruediv(self, other):\n if isinstance(other, self):\n return ModInt(other * pow(self.x, mod - 2, mod))\n else:\n return ModInt(other.x * pow(self.x, mod - 2, mod))\n \n\n def __pow__(self, other):\n if isinstance(other, ModInt):\n return ModInt(pow(self.x, other.x, mod))\n else:\n return ModInt(pow(self.x, other, mod))\n \n\n def __rpow__(self, other):\n if isinstance(other, ModInt):\n return ModInt(pow(other.x, self.x, mod))\n else:\n return ModInt(pow(other, self.x, mod))",
"ModInt",
"def __init__(self, x):\n self.x = x % mod\n \n ",
"__init__",
"self.x = x % mod",
"self.x",
"self",
"x",
"x % mod",
"x",
"mod",
"self",
"self",
"x",
"x",
"def __str__(self):\n return str(self.x)\n \n ",
"__str__",
"return str(self.x)",
"str(self.x)",
"str",
"self.x",
"self",
"x",
"self",
"self",
"__repr__ = __str__",
"__repr__",
"__str__",
"def __add__(self, other):\n if isinstance(other, ModInt):\n return ModInt(self.x + other.x)\n else:\n return ModInt(self.x + other)\n\n ",
"__add__",
"if isinstance(other, ModInt):\n return ModInt(self.x + other.x)\n else:\n return ModInt(self.x + other)\n\n ",
"isinstance(other, ModInt)",
"isinstance",
"other",
"ModInt",
"return ModInt(self.x + other.x)",
"ModInt(self.x + other.x)",
"ModInt",
"self.x + other.x",
"self.x",
"self",
"x",
"other.x",
"other",
"x",
"return ModInt(self.x + other)",
"ModInt(self.x + other)",
"ModInt",
"self.x + other",
"self.x",
"self",
"x",
"other",
"self",
"self",
"other",
"other",
"__radd__ = __add__",
"__radd__",
"__add__",
"def __sub__(self, other):\n if isinstance(other, ModInt):\n return ModInt(self.x - other.x)\n else:\n return ModInt(self.x - other)\n\n ",
"__sub__",
"if isinstance(other, ModInt):\n return ModInt(self.x - other.x)\n else:\n return ModInt(self.x - other)\n\n ",
"isinstance(other, ModInt)",
"isinstance",
"other",
"ModInt",
"return ModInt(self.x - other.x)",
"ModInt(self.x - other.x)",
"ModInt",
"self.x - other.x",
"self.x",
"self",
"x",
"other.x",
"other",
"x",
"return ModInt(self.x - other)",
"ModInt(self.x - other)",
"ModInt",
"self.x - other",
"self.x",
"self",
"x",
"other",
"self",
"self",
"other",
"other",
"def __rsub__(self, other):\n if isinstance(other, ModInt):\n return ModInt(other.x - self.x)\n else:\n return ModInt(other - self.x)\n\n ",
"__rsub__",
"if isinstance(other, ModInt):\n return ModInt(other.x - self.x)\n else:\n return ModInt(other - self.x)\n\n ",
"isinstance(other, ModInt)",
"isinstance",
"other",
"ModInt",
"return ModInt(other.x - self.x)",
"ModInt(other.x - self.x)",
"ModInt",
"other.x - self.x",
"other.x",
"other",
"x",
"self.x",
"self",
"x",
"return ModInt(other - self.x)",
"ModInt(other - self.x)",
"ModInt",
"other - self.x",
"other",
"self.x",
"self",
"x",
"self",
"self",
"other",
"other",
"def __mul__(self, other):\n if isinstance(other, ModInt):\n return ModInt(self.x * other.x)\n else:\n return ModInt(self.x * other)\n\n ",
"__mul__",
"if isinstance(other, ModInt):\n return ModInt(self.x * other.x)\n else:\n return ModInt(self.x * other)\n\n ",
"isinstance(other, ModInt)",
"isinstance",
"other",
"ModInt",
"return ModInt(self.x * other.x)",
"ModInt(self.x * other.x)",
"ModInt",
"self.x * other.x",
"self.x",
"self",
"x",
"other.x",
"other",
"x",
"return ModInt(self.x * other)",
"ModInt(self.x * other)",
"ModInt",
"self.x * other",
"self.x",
"self",
"x",
"other",
"self",
"self",
"other",
"other",
"__rmul__ = __mul__",
"__rmul__",
"__mul__",
"def __truediv__(self, other):\n if isinstance(other, ModInt):\n return ModInt(self.x * pow(other.x, mod-2,mod))\n else:\n return ModInt(self.x * pow(other, mod - 2, mod))\n \n ",
"__truediv__",
"if isinstance(other, ModInt):\n return ModInt(self.x * pow(other.x, mod-2,mod))\n else:\n return ModInt(self.x * pow(other, mod - 2, mod))\n \n ",
"isinstance(other, ModInt)",
"isinstance",
"other",
"ModInt",
"return ModInt(self.x * pow(other.x, mod-2,mod))",
"ModInt(self.x * pow(other.x, mod-2,mod))",
"ModInt",
"self.x * pow(other.x, mod-2,mod)",
"self.x",
"self",
"x",
"pow(other.x, mod-2,mod)",
"pow",
"other.x",
"other",
"x",
"mod-2",
"mod",
"2",
"mod",
"return ModInt(self.x * pow(other, mod - 2, mod))",
"ModInt(self.x * pow(other, mod - 2, mod))",
"ModInt",
"self.x * pow(other, mod - 2, mod)",
"self.x",
"self",
"x",
"pow(other, mod - 2, mod)",
"pow",
"other",
"mod - 2",
"mod",
"2",
"mod",
"self",
"self",
"other",
"other",
"def __rtruediv(self, other):\n if isinstance(other, self):\n return ModInt(other * pow(self.x, mod - 2, mod))\n else:\n return ModInt(other.x * pow(self.x, mod - 2, mod))\n \n\n ",
"__rtruediv",
"if isinstance(other, self):\n return ModInt(other * pow(self.x, mod - 2, mod))\n else:\n return ModInt(other.x * pow(self.x, mod - 2, mod))\n \n\n ",
"isinstance(other, self)",
"isinstance",
"other",
"self",
"return ModInt(other * pow(self.x, mod - 2, mod))",
"ModInt(other * pow(self.x, mod - 2, mod))",
"ModInt",
"other * pow(self.x, mod - 2, mod)",
"other",
"pow(self.x, mod - 2, mod)",
"pow",
"self.x",
"self",
"x",
"mod - 2",
"mod",
"2",
"mod",
"return ModInt(other.x * pow(self.x, mod - 2, mod))",
"ModInt(other.x * pow(self.x, mod - 2, mod))",
"ModInt",
"other.x * pow(self.x, mod - 2, mod)",
"other.x",
"other",
"x",
"pow(self.x, mod - 2, mod)",
"pow",
"self.x",
"self",
"x",
"mod - 2",
"mod",
"2",
"mod",
"self",
"self",
"other",
"other",
"def __pow__(self, other):\n if isinstance(other, ModInt):\n return ModInt(pow(self.x, other.x, mod))\n else:\n return ModInt(pow(self.x, other, mod))\n \n\n ",
"__pow__",
"if isinstance(other, ModInt):\n return ModInt(pow(self.x, other.x, mod))\n else:\n return ModInt(pow(self.x, other, mod))\n \n\n ",
"isinstance(other, ModInt)",
"isinstance",
"other",
"ModInt",
"return ModInt(pow(self.x, other.x, mod))",
"ModInt(pow(self.x, other.x, mod))",
"ModInt",
"pow(self.x, other.x, mod)",
"pow",
"self.x",
"self",
"x",
"other.x",
"other",
"x",
"mod",
"return ModInt(pow(self.x, other, mod))",
"ModInt(pow(self.x, other, mod))",
"ModInt",
"pow(self.x, other, mod)",
"pow",
"self.x",
"self",
"x",
"other",
"mod",
"self",
"self",
"other",
"other",
"def __rpow__(self, other):\n if isinstance(other, ModInt):\n return ModInt(pow(other.x, self.x, mod))\n else:\n return ModInt(pow(other, self.x, mod))",
"__rpow__",
"if isinstance(other, ModInt):\n return ModInt(pow(other.x, self.x, mod))\n else:\n return ModInt(pow(other, self.x, mod))",
"isinstance(other, ModInt)",
"isinstance",
"other",
"ModInt",
"return ModInt(pow(other.x, self.x, mod))",
"ModInt(pow(other.x, self.x, mod))",
"ModInt",
"pow(other.x, self.x, mod)",
"pow",
"other.x",
"other",
"x",
"self.x",
"self",
"x",
"mod",
"return ModInt(pow(other, self.x, mod))",
"ModInt(pow(other, self.x, mod))",
"ModInt",
"pow(other, self.x, mod)",
"pow",
"other",
"self.x",
"self",
"x",
"mod",
"self",
"self",
"other",
"other",
"def main():\n N = I()\n T = LI()\n A = LI()\n\n lim = [inf]*N\n confirm = [None]*N\n \n now = 0\n for i,a in enumerate(T):\n if now < a:\n confirm[i] = a\n now = a\n lim[i] = a\n \n now = 0\n for i in range(N)[::-1]:\n a = A[i]\n if now < a:\n if confirm[i] is not None:\n if confirm[i] != a:\n print(0)\n return\n if lim[i] < a:\n print(0)\n return\n confirm[i] = a\n now = a\n lim[i] = min(lim[i], a)\n if confirm[i] is not None:\n if confirm[i] > lim[i]:\n print(0)\n return \n \n ans = ModInt(1)\n for i,(l,c) in enumerate(zip(lim, confirm)):\n if c is None:\n ans *= l\n\n print(ans)",
"main",
"N = I()",
"N",
"I()",
"I",
"T = LI()",
"T",
"LI()",
"LI",
"A = LI()",
"A",
"LI()",
"LI",
"lim = [inf]*N",
"lim",
"[inf]*N",
"[inf]",
"inf",
"N",
"confirm = [None]*N",
"confirm",
"[None]*N",
"[None]",
"None",
"N",
"now = 0",
"now",
"0",
"for i,a in enumerate(T):\n if now < a:\n confirm[i] = a\n now = a\n lim[i] = a\n \n ",
"i",
"a",
"enumerate(T)",
"enumerate",
"T",
"if now < a:\n confirm[i] = a\n now = a\n ",
"now < a",
"now",
"a",
"confirm[i] = a",
"confirm[i]",
"confirm",
"i",
"a",
"now = a",
"now",
"a",
"lim[i] = a",
"lim[i]",
"lim",
"i",
"a",
"now = 0",
"now",
"0",
"for i in range(N)[::-1]:\n a = A[i]\n if now < a:\n if confirm[i] is not None:\n if confirm[i] != a:\n print(0)\n return\n if lim[i] < a:\n print(0)\n return\n confirm[i] = a\n now = a\n lim[i] = min(lim[i], a)\n if confirm[i] is not None:\n if confirm[i] > lim[i]:\n print(0)\n return \n \n ",
"i",
"range(N)[::-1]",
"(N)",
"range",
"N",
"::-1",
"-1",
"a = A[i]",
"a",
"A[i]",
"A",
"i",
"if now < a:\n if confirm[i] is not None:\n if confirm[i] != a:\n print(0)\n return\n if lim[i] < a:\n print(0)\n return\n confirm[i] = a\n now = a\n ",
"now < a",
"now",
"a",
"if confirm[i] is not None:\n if confirm[i] != a:\n print(0)\n return\n ",
"confirm[i] is not None",
"confirm[i]",
"confirm",
"i",
"None",
"if confirm[i] != a:\n print(0)\n return\n ",
"confirm[i] != a",
"confirm[i]",
"confirm",
"i",
"a",
"print(0)",
"print",
"0",
"return",
"if lim[i] < a:\n print(0)\n return\n ",
"lim[i] < a",
"lim[i]",
"lim",
"i",
"a",
"print(0)",
"print",
"0",
"return",
"confirm[i] = a",
"confirm[i]",
"confirm",
"i",
"a",
"now = a",
"now",
"a",
"lim[i] = min(lim[i], a)",
"lim[i]",
"lim",
"i",
"min(lim[i], a)",
"min",
"lim[i]",
"lim",
"i",
"a",
"if confirm[i] is not None:\n if confirm[i] > lim[i]:\n print(0)\n return \n \n ",
"confirm[i] is not None",
"confirm[i]",
"confirm",
"i",
"None",
"if confirm[i] > lim[i]:\n print(0)\n return \n \n ",
"confirm[i] > lim[i]",
"confirm[i]",
"confirm",
"i",
"lim[i]",
"lim",
"i",
"print(0)",
"print",
"0",
"return",
"ans = ModInt(1)",
"ans",
"ModInt(1)",
"ModInt",
"1",
"for i,(l,c) in enumerate(zip(lim, confirm)):\n if c is None:\n ans *= l\n\n ",
"i",
"(l,c)",
"l",
"c",
"enumerate(zip(lim, confirm))",
"enumerate",
"zip(lim, confirm)",
"zip",
"lim",
"confirm",
"if c is None:\n ans *= l\n\n ",
"c is None",
"c",
"None",
"ans *= l",
"ans",
"l",
"print(ans)",
"print",
"ans",
"if __name__ == '__main__':\n main()",
"__name__ == '__main__'",
"__name__",
"'__main__'",
"main()",
"main",
"def main():\n N = I()\n T = LI()\n A = LI()\n\n lim = [inf]*N\n confirm = [None]*N\n \n now = 0\n for i,a in enumerate(T):\n if now < a:\n confirm[i] = a\n now = a\n lim[i] = a\n \n now = 0\n for i in range(N)[::-1]:\n a = A[i]\n if now < a:\n if confirm[i] is not None:\n if confirm[i] != a:\n print(0)\n return\n if lim[i] < a:\n print(0)\n return\n confirm[i] = a\n now = a\n lim[i] = min(lim[i], a)\n if confirm[i] is not None:\n if confirm[i] > lim[i]:\n print(0)\n return \n \n ans = ModInt(1)\n for i,(l,c) in enumerate(zip(lim, confirm)):\n if c is None:\n ans *= l\n\n print(ans)",
"def main():\n N = I()\n T = LI()\n A = LI()\n\n lim = [inf]*N\n confirm = [None]*N\n \n now = 0\n for i,a in enumerate(T):\n if now < a:\n confirm[i] = a\n now = a\n lim[i] = a\n \n now = 0\n for i in range(N)[::-1]:\n a = A[i]\n if now < a:\n if confirm[i] is not None:\n if confirm[i] != a:\n print(0)\n return\n if lim[i] < a:\n print(0)\n return\n confirm[i] = a\n now = a\n lim[i] = min(lim[i], a)\n if confirm[i] is not None:\n if confirm[i] > lim[i]:\n print(0)\n return \n \n ans = ModInt(1)\n for i,(l,c) in enumerate(zip(lim, confirm)):\n if c is None:\n ans *= l\n\n print(ans)",
"main",
"def F(): return float(input())",
"def F(): return float(input())",
"F",
"def ceil(a,b): return (a+b-1)//b",
"def ceil(a,b): return (a+b-1)//b",
"ceil",
"def LLI(): return [list(map(int, l.split() )) for l in input()]",
"def LLI(): return [list(map(int, l.split() )) for l in input()]",
"LLI",
"class ModInt:\n def __init__(self, x):\n self.x = x % mod\n \n def __str__(self):\n return str(self.x)\n \n __repr__ = __str__\n\n def __add__(self, other):\n if isinstance(other, ModInt):\n return ModInt(self.x + other.x)\n else:\n return ModInt(self.x + other)\n\n __radd__ = __add__\n \n def __sub__(self, other):\n if isinstance(other, ModInt):\n return ModInt(self.x - other.x)\n else:\n return ModInt(self.x - other)\n\n def __rsub__(self, other):\n if isinstance(other, ModInt):\n return ModInt(other.x - self.x)\n else:\n return ModInt(other - self.x)\n\n def __mul__(self, other):\n if isinstance(other, ModInt):\n return ModInt(self.x * other.x)\n else:\n return ModInt(self.x * other)\n\n __rmul__ = __mul__\n\n def __truediv__(self, other):\n if isinstance(other, ModInt):\n return ModInt(self.x * pow(other.x, mod-2,mod))\n else:\n return ModInt(self.x * pow(other, mod - 2, mod))\n \n def __rtruediv(self, other):\n if isinstance(other, self):\n return ModInt(other * pow(self.x, mod - 2, mod))\n else:\n return ModInt(other.x * pow(self.x, mod - 2, mod))\n \n\n def __pow__(self, other):\n if isinstance(other, ModInt):\n return ModInt(pow(self.x, other.x, mod))\n else:\n return ModInt(pow(self.x, other, mod))\n \n\n def __rpow__(self, other):\n if isinstance(other, ModInt):\n return ModInt(pow(other.x, self.x, mod))\n else:\n return ModInt(pow(other, self.x, mod))",
"class ModInt:\n def __init__(self, x):\n self.x = x % mod\n \n def __str__(self):\n return str(self.x)\n \n __repr__ = __str__\n\n def __add__(self, other):\n if isinstance(other, ModInt):\n return ModInt(self.x + other.x)\n else:\n return ModInt(self.x + other)\n\n __radd__ = __add__\n \n def __sub__(self, other):\n if isinstance(other, ModInt):\n return ModInt(self.x - other.x)\n else:\n return ModInt(self.x - other)\n\n def __rsub__(self, other):\n if isinstance(other, ModInt):\n return ModInt(other.x - self.x)\n else:\n return ModInt(other - self.x)\n\n def __mul__(self, other):\n if isinstance(other, ModInt):\n return ModInt(self.x * other.x)\n else:\n return ModInt(self.x * other)\n\n __rmul__ = __mul__\n\n def __truediv__(self, other):\n if isinstance(other, ModInt):\n return ModInt(self.x * pow(other.x, mod-2,mod))\n else:\n return ModInt(self.x * pow(other, mod - 2, mod))\n \n def __rtruediv(self, other):\n if isinstance(other, self):\n return ModInt(other * pow(self.x, mod - 2, mod))\n else:\n return ModInt(other.x * pow(self.x, mod - 2, mod))\n \n\n def __pow__(self, other):\n if isinstance(other, ModInt):\n return ModInt(pow(self.x, other.x, mod))\n else:\n return ModInt(pow(self.x, other, mod))\n \n\n def __rpow__(self, other):\n if isinstance(other, ModInt):\n return ModInt(pow(other.x, self.x, mod))\n else:\n return ModInt(pow(other, self.x, mod))",
"ModInt",
"inf=float('inf')",
"float('inf')",
"inf",
"input=sys.stdin.readline",
"sys.stdin.readline",
"input",
"def MF(): return map(float, input().split())",
"def MF(): return map(float, input().split())",
"MF",
"def MI_(): return map(INT_,input().split())",
"def MI_(): return map(INT_,input().split())",
"MI_",
"mod = 10**9+7",
"10**9+7",
"mod",
"def LI(): return list(MI())",
"def LI(): return list(MI())",
"LI",
"def LF(): return list(MF())",
"def LF(): return list(MF())",
"LF",
"def LLIN_(n: int): return [LI_() for _ in range(n)]",
"def LLIN_(n: int): return [LI_() for _ in range(n)]",
"LLIN_",
"def LIN(n:int): return [I() for _ in range(n)]",
"def LIN(n:int): return [I() for _ in range(n)]",
"LIN",
"def LLIN(n: int): return [LI() for _ in range(n)]",
"def LLIN(n: int): return [LI() for _ in range(n)]",
"LLIN",
"def pprint(*A): \n for a in A: print(*a,sep='\\n')",
"def pprint(*A): \n for a in A: print(*a,sep='\\n')",
"pprint",
"def INT_(n): return int(n)-1",
"def INT_(n): return int(n)-1",
"INT_",
"def I(): return int(input())",
"def I(): return int(input())",
"I",
"def MI(): return map(int,input().split())",
"def MI(): return map(int,input().split())",
"MI",
"def ST(): return input().replace('\\n', '')\n#mint",
"def ST(): return input().replace('\\n', '')\n#mint",
"ST",
"def LI_(): return [int(x) - 1 for x in input().split()]",
"def LI_(): return [int(x) - 1 for x in input().split()]",
"LI_"
] |
#
# ⋀_⋀
# (・ω・)
# ./ U ∽ U\
# │* 合 *│
# │* 格 *│
# │* 祈 *│
# │* 願 *│
# │* *│
#  ̄
#
import sys
sys.setrecursionlimit(10**6)
input=sys.stdin.readline
from math import floor,sqrt,factorial,hypot,log #log2ないyp
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict,deque
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
from copy import deepcopy
from fractions import gcd
from random import randint
def ceil(a,b): return (a+b-1)//b
inf=float('inf')
mod = 10**9+7
def pprint(*A):
for a in A: print(*a,sep='\n')
def INT_(n): return int(n)-1
def MI(): return map(int,input().split())
def MF(): return map(float, input().split())
def MI_(): return map(INT_,input().split())
def LI(): return list(MI())
def LI_(): return [int(x) - 1 for x in input().split()]
def LF(): return list(MF())
def LIN(n:int): return [I() for _ in range(n)]
def LLIN(n: int): return [LI() for _ in range(n)]
def LLIN_(n: int): return [LI_() for _ in range(n)]
def LLI(): return [list(map(int, l.split() )) for l in input()]
def I(): return int(input())
def F(): return float(input())
def ST(): return input().replace('\n', '')
#mint
class ModInt:
def __init__(self, x):
self.x = x % mod
def __str__(self):
return str(self.x)
__repr__ = __str__
def __add__(self, other):
if isinstance(other, ModInt):
return ModInt(self.x + other.x)
else:
return ModInt(self.x + other)
__radd__ = __add__
def __sub__(self, other):
if isinstance(other, ModInt):
return ModInt(self.x - other.x)
else:
return ModInt(self.x - other)
def __rsub__(self, other):
if isinstance(other, ModInt):
return ModInt(other.x - self.x)
else:
return ModInt(other - self.x)
def __mul__(self, other):
if isinstance(other, ModInt):
return ModInt(self.x * other.x)
else:
return ModInt(self.x * other)
__rmul__ = __mul__
def __truediv__(self, other):
if isinstance(other, ModInt):
return ModInt(self.x * pow(other.x, mod-2,mod))
else:
return ModInt(self.x * pow(other, mod - 2, mod))
def __rtruediv(self, other):
if isinstance(other, self):
return ModInt(other * pow(self.x, mod - 2, mod))
else:
return ModInt(other.x * pow(self.x, mod - 2, mod))
def __pow__(self, other):
if isinstance(other, ModInt):
return ModInt(pow(self.x, other.x, mod))
else:
return ModInt(pow(self.x, other, mod))
def __rpow__(self, other):
if isinstance(other, ModInt):
return ModInt(pow(other.x, self.x, mod))
else:
return ModInt(pow(other, self.x, mod))
def main():
N = I()
T = LI()
A = LI()
lim = [inf]*N
confirm = [None]*N
now = 0
for i,a in enumerate(T):
if now < a:
confirm[i] = a
now = a
lim[i] = a
now = 0
for i in range(N)[::-1]:
a = A[i]
if now < a:
if confirm[i] is not None:
if confirm[i] != a:
print(0)
return
if lim[i] < a:
print(0)
return
confirm[i] = a
now = a
lim[i] = min(lim[i], a)
if confirm[i] is not None:
if confirm[i] > lim[i]:
print(0)
return
ans = ModInt(1)
for i,(l,c) in enumerate(zip(lim, confirm)):
if c is None:
ans *= l
print(ans)
if __name__ == '__main__':
main()
|
[
7,
0,
13,
4,
13,
4,
13,
0,
13,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
17,
0,
13,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
17,
0,
13,
17,
28,
13,
4,
13,
13,
0,
13,
2,
4,
13,
18,
13,
13,
18,
13,
13,
17,
13,
17,
14,
40,
13,
17,
14,
2,
18,
13,
2,
13,
17,
18,
13,
13,
0,
13,
18,
13,
13,
0,
13,
18,
13,
17,
14,
40,
13,
2,
13,
17,
14,
2,
18,
13,
13,
18,
13,
2,
13,
17,
0,
13,
4,
13,
18,
13,
13,
13,
0,
13,
4,
13,
18,
13,
13,
13,
0,
13,
2,
2,
13,
4,
13,
2,
13,
13,
17,
2,
2,
17,
17,
17,
4,
13,
13,
10,
4,
13,
10,
2,
13,
10,
2,
13,
10,
18,
13,
10,
4,
13,
10,
4,
13,
10,
4,
13,
10,
18,
13,
10,
17,
13,
10,
4,
13,
10,
17,
13
] |
[
[
131,
2
],
[
158,
8
],
[
149,
21
],
[
161,
34
],
[
38,
37
],
[
132,
40
],
[
137,
42
],
[
159,
47
],
[
37,
48
],
[
150,
50
],
[
37,
51
],
[
155,
53
],
[
37,
57
],
[
159,
62
],
[
37,
64
],
[
159,
67
],
[
37,
68
],
[
140,
70
],
[
159,
72
],
[
37,
73
],
[
152,
75
],
[
159,
77
],
[
37,
81
],
[
132,
83
],
[
150,
88
],
[
37,
89
],
[
150,
91
],
[
37,
93
],
[
143,
96
],
[
150,
100
],
[
37,
101
],
[
153,
102
],
[
141,
102
],
[
156,
102
],
[
147,
102
],
[
144,
102
],
[
146,
104
],
[
150,
108
],
[
37,
109
],
[
153,
110
],
[
141,
110
],
[
156,
110
],
[
147,
110
],
[
144,
110
],
[
134,
112
],
[
162,
115
],
[
135,
115
],
[
138,
119
],
[
147,
120
],
[
144,
120
],
[
153,
120
],
[
141,
120
],
[
156,
120
],
[
135,
129
],
[
162,
129
],
[
131,
132
],
[
134,
135
],
[
137,
138
],
[
140,
141
],
[
143,
144
],
[
146,
147
],
[
149,
150
],
[
152,
153
],
[
155,
156
],
[
158,
159
],
[
161,
162
]
] |
[
"n = int(input())\nt = list(map(int, input().split(' ')))\na = list(map(int, input().split(' ')))\nresult = 1\nfor i in range(n):\n h_max, h_min = min(t[i], a[i])+1, 1\n if i != 0:\n if t[i-1] < t[i]:\n h_min = t[i]\n else:\n h_min = t[0]\n\n if i != n-1:\n if a[i] > a[i+1]:\n h_min = max(a[i], h_min)\n else:\n h_min = max(a[i], h_min)\n result = result * max(h_max - h_min, 0) % (10**9+7)\nprint(result)",
"n = int(input())",
"n",
"int(input())",
"int",
"input()",
"input",
"t = list(map(int, input().split(' ')))",
"t",
"list(map(int, input().split(' ')))",
"list",
"map(int, input().split(' '))",
"map",
"int",
"input().split(' ')",
"().split",
"()",
"input",
"split",
"' '",
"a = list(map(int, input().split(' ')))",
"a",
"list(map(int, input().split(' ')))",
"list",
"map(int, input().split(' '))",
"map",
"int",
"input().split(' ')",
"().split",
"()",
"input",
"split",
"' '",
"result = 1",
"result",
"1",
"for i in range(n):\n h_max, h_min = min(t[i], a[i])+1, 1\n if i != 0:\n if t[i-1] < t[i]:\n h_min = t[i]\n else:\n h_min = t[0]\n\n if i != n-1:\n if a[i] > a[i+1]:\n h_min = max(a[i], h_min)\n else:\n h_min = max(a[i], h_min)\n result = result * max(h_max - h_min, 0) % (10**9+7)",
"i",
"range(n)",
"range",
"n",
"h_max, h_min = min(t[i], a[i])+1, 1",
"h_max",
"min(t[i], a[i])+1",
"min(t[i], a[i])",
"min",
"t[i]",
"t",
"i",
"a[i]",
"a",
"i",
"1",
"h_min",
"1",
"if i != 0:\n if t[i-1] < t[i]:\n h_min = t[i]\n else:\n h_min = t[0]\n\n ",
"i != 0",
"i",
"0",
"if t[i-1] < t[i]:\n h_min = t[i]\n ",
"t[i-1] < t[i]",
"t[i-1]",
"t",
"i-1",
"i",
"1",
"t[i]",
"t",
"i",
"h_min = t[i]",
"h_min",
"t[i]",
"t",
"i",
"h_min = t[0]",
"h_min",
"t[0]",
"t",
"0",
"if i != n-1:\n if a[i] > a[i+1]:\n h_min = max(a[i], h_min)\n else:\n h_min = max(a[i], h_min)\n ",
"i != n-1",
"i",
"n-1",
"n",
"1",
"if a[i] > a[i+1]:\n h_min = max(a[i], h_min)\n ",
"a[i] > a[i+1]",
"a[i]",
"a",
"i",
"a[i+1]",
"a",
"i+1",
"i",
"1",
"h_min = max(a[i], h_min)",
"h_min",
"max(a[i], h_min)",
"max",
"a[i]",
"a",
"i",
"h_min",
"h_min = max(a[i], h_min)",
"h_min",
"max(a[i], h_min)",
"max",
"a[i]",
"a",
"i",
"h_min",
"result = result * max(h_max - h_min, 0) % (10**9+7)",
"result",
"result * max(h_max - h_min, 0) % (10**9+7)",
"result * max(h_max - h_min, 0)",
"result",
"max(h_max - h_min, 0)",
"max",
"h_max - h_min",
"h_max",
"h_min",
"0",
"10**9+7",
"10**9",
"10",
"9",
"7",
"print(result)",
"print",
"result",
"n = int(input())",
"int(input())",
"n",
"result = result * max(h_max - h_min, 0) % (10**9+7)",
"result * max(h_max - h_min, 0) % (10**9+7)",
"result",
"h_max, h_min = min(t[i], a[i])+1, 1",
"min(t[i], a[i])+1",
"h_max",
"h_min = t[i]",
"t[i]",
"h_min",
"h_min = max(a[i], h_min)",
"max(a[i], h_min)",
"h_min",
"h_min = max(a[i], h_min)",
"max(a[i], h_min)",
"h_min",
"a = list(map(int, input().split(' ')))",
"list(map(int, input().split(' ')))",
"a",
"h_min = t[0]",
"t[0]",
"h_min",
"h_min = min(t[i], a[i])+1, 1",
"1",
"h_min",
"t = list(map(int, input().split(' ')))",
"list(map(int, input().split(' ')))",
"t",
"result = 1",
"1",
"result"
] |
n = int(input())
t = list(map(int, input().split(' ')))
a = list(map(int, input().split(' ')))
result = 1
for i in range(n):
h_max, h_min = min(t[i], a[i])+1, 1
if i != 0:
if t[i-1] < t[i]:
h_min = t[i]
else:
h_min = t[0]
if i != n-1:
if a[i] > a[i+1]:
h_min = max(a[i], h_min)
else:
h_min = max(a[i], h_min)
result = result * max(h_max - h_min, 0) % (10**9+7)
print(result)
|
[
7,
15,
15,
13,
15,
13,
15,
13,
0,
13,
2,
2,
17,
17,
17,
0,
13,
4,
13,
0,
13,
4,
13,
13,
4,
18,
4,
13,
13,
17,
0,
13,
4,
13,
13,
4,
18,
4,
13,
13,
17,
0,
13,
17,
28,
13,
4,
13,
13,
0,
13,
17,
0,
13,
17,
13,
13,
14,
2,
2,
13,
17,
40,
18,
13,
13,
18,
13,
2,
13,
17,
0,
13,
18,
13,
13,
0,
13,
18,
13,
13,
14,
2,
2,
13,
2,
13,
17,
40,
18,
13,
13,
18,
13,
2,
13,
17,
0,
13,
18,
13,
13,
0,
13,
18,
13,
13,
14,
2,
2,
13,
13,
17,
14,
2,
2,
2,
13,
13,
17,
40,
13,
13,
0,
13,
17,
3,
14,
2,
2,
2,
13,
13,
40,
13,
17,
2,
2,
13,
13,
40,
13,
17,
0,
13,
17,
3,
0,
13,
4,
13,
13,
13,
0,
13,
13,
4,
13,
2,
13,
13,
10,
17,
13,
10,
17,
13,
10,
17,
13,
10,
18,
13,
10,
4,
13,
10,
17,
13,
10,
18,
13,
10,
17,
13,
10,
13,
13,
10,
4,
13,
10,
4,
13,
10,
18,
13,
10,
4,
13,
10,
17,
13,
10,
18,
13,
10,
17,
13,
10,
2,
13
] |
[
[
210,
9
],
[
198,
16
],
[
189,
20
],
[
192,
31
],
[
177,
42
],
[
46,
45
],
[
199,
48
],
[
207,
50
],
[
207,
53
],
[
207,
55
],
[
207,
56
],
[
45,
60
],
[
190,
64
],
[
45,
65
],
[
190,
67
],
[
45,
69
],
[
195,
72
],
[
190,
74
],
[
45,
75
],
[
204,
77
],
[
190,
79
],
[
45,
80
],
[
45,
84
],
[
199,
86
],
[
193,
90
],
[
45,
91
],
[
193,
93
],
[
45,
95
],
[
171,
98
],
[
193,
100
],
[
45,
101
],
[
180,
103
],
[
193,
105
],
[
45,
106
],
[
172,
110
],
[
163,
110
],
[
196,
111
],
[
169,
111
],
[
172,
117
],
[
163,
117
],
[
196,
118
],
[
169,
118
],
[
196,
121
],
[
169,
121
],
[
172,
122
],
[
163,
122
],
[
165,
124
],
[
172,
131
],
[
163,
131
],
[
205,
132
],
[
202,
132
],
[
205,
134
],
[
202,
134
],
[
196,
138
],
[
169,
138
],
[
181,
139
],
[
208,
139
],
[
181,
141
],
[
208,
141
],
[
183,
144
],
[
174,
148
],
[
181,
151
],
[
208,
151
],
[
205,
152
],
[
202,
152
],
[
186,
154
],
[
211,
155
],
[
187,
159
],
[
175,
159
],
[
184,
159
],
[
166,
159
],
[
178,
159
],
[
211,
160
],
[
207,
163
],
[
165,
166
],
[
207,
169
],
[
171,
172
],
[
174,
175
],
[
177,
178
],
[
180,
181
],
[
183,
184
],
[
211,
186
],
[
186,
187
],
[
189,
190
],
[
192,
193
],
[
195,
196
],
[
198,
199
],
[
207,
202
],
[
204,
205
],
[
207,
208
],
[
210,
211
]
] |
[
"from random import random\nimport math\nimport re\nimport fractions\n\nMOD = 10**9+7\n\nN = input()\nT = map(int, raw_input().split(\" \"))\nA = map(int, raw_input().split(\" \"))\n# N = 10**5\n# A = T = [999999999] * 10**5\n\nresult = 1\n\nfor i in xrange(N):\n et = bt = ea = ba = 0\n if i == 0 or T[i] != T[i-1]:\n et = T[i]\n else:\n bt = T[i]\n if i == N-1 or A[i] != A[i+1]:\n ea = A[i]\n else:\n ba = A[i]\n if ea + et > 0:\n if ea * et > 0 and et != ea:\n result = 0\n break\n if (ea > bt and bt != 0) or (et > ba and ba != 0):\n result = 0\n break\n else:\n result *= min(ba, bt)\n result %= MOD\nprint(result % MOD)",
"from random import random",
"import math",
"math",
"import re",
"re",
"import fractions",
"fractions",
"MOD = 10**9+7",
"MOD",
"10**9+7",
"10**9",
"10",
"9",
"7",
"N = input()",
"N",
"input()",
"input",
"T = map(int, raw_input().split(\" \"))",
"T",
"map(int, raw_input().split(\" \"))",
"map",
"int",
"raw_input().split(\" \")",
"().split",
"()",
"raw_input",
"split",
"\" \"",
"A = map(int, raw_input().split(\" \"))",
"A",
"map(int, raw_input().split(\" \"))",
"map",
"int",
"raw_input().split(\" \")",
"().split",
"()",
"raw_input",
"split",
"\" \"",
"result = 1",
"result",
"1",
"for i in xrange(N):\n et = bt = ea = ba = 0\n if i == 0 or T[i] != T[i-1]:\n et = T[i]\n else:\n bt = T[i]\n if i == N-1 or A[i] != A[i+1]:\n ea = A[i]\n else:\n ba = A[i]\n if ea + et > 0:\n if ea * et > 0 and et != ea:\n result = 0\n break\n if (ea > bt and bt != 0) or (et > ba and ba != 0):\n result = 0\n break\n else:\n result *= min(ba, bt)\n result %= MOD",
"i",
"xrange(N)",
"xrange",
"N",
"et = bt = ea = ba = 0",
"et",
"0",
"= bt = ea = ba = 0",
"bt",
"0",
"ea",
"ba",
"if i == 0 or T[i] != T[i-1]:\n et = T[i]\n else:\n bt = T[i]\n ",
"i == 0 or T[i] != T[i-1]",
"i == 0",
"i",
"0",
"T[i] != T[i-1]",
"T[i]",
"T",
"i",
"T[i-1]",
"T",
"i-1",
"i",
"1",
"et = T[i]",
"et",
"T[i]",
"T",
"i",
"bt = T[i]",
"bt",
"T[i]",
"T",
"i",
"if i == N-1 or A[i] != A[i+1]:\n ea = A[i]\n else:\n ba = A[i]\n ",
"i == N-1 or A[i] != A[i+1]",
"i == N-1",
"i",
"N-1",
"N",
"1",
"A[i] != A[i+1]",
"A[i]",
"A",
"i",
"A[i+1]",
"A",
"i+1",
"i",
"1",
"ea = A[i]",
"ea",
"A[i]",
"A",
"i",
"ba = A[i]",
"ba",
"A[i]",
"A",
"i",
"if ea + et > 0:\n if ea * et > 0 and et != ea:\n result = 0\n break\n if (ea > bt and bt != 0) or (et > ba and ba != 0):\n result = 0\n break\n else:\n result *= min(ba, bt)\n result %= MOD",
"ea + et > 0",
"ea + et",
"ea",
"et",
"0",
"if ea * et > 0 and et != ea:\n result = 0\n break\n ",
"ea * et > 0 and et != ea",
"ea * et > 0",
"ea * et",
"ea",
"et",
"0",
"et != ea",
"et",
"ea",
"result = 0",
"result",
"0",
"break",
"if (ea > bt and bt != 0) or (et > ba and ba != 0):\n result = 0\n break\n ",
"(ea > bt and bt != 0) or (et > ba and ba != 0)",
"ea > bt and bt != 0",
"ea > bt",
"ea",
"bt",
"bt != 0",
"bt",
"0",
"et > ba and ba != 0",
"et > ba",
"et",
"ba",
"ba != 0",
"ba",
"0",
"result = 0",
"result",
"0",
"break",
"result *= min(ba, bt)",
"result",
"min(ba, bt)",
"min",
"ba",
"bt",
"result %= MOD",
"result",
"MOD",
"print(result % MOD)",
"print",
"result % MOD",
"result",
"MOD",
"ea = ba = 0",
"0",
"ea",
"result = 0",
"0",
"result",
"et = bt = ea = ba = 0",
"0",
"et",
"ea = A[i]",
"A[i]",
"ea",
"result *= min(ba, bt)",
"min(ba, bt)",
"result",
"result = 1",
"1",
"result",
"ba = A[i]",
"A[i]",
"ba",
"result = 0",
"0",
"result",
"result %= MOD",
"MOD",
"result",
"T = map(int, raw_input().split(\" \"))",
"map(int, raw_input().split(\" \"))",
"T",
"A = map(int, raw_input().split(\" \"))",
"map(int, raw_input().split(\" \"))",
"A",
"et = T[i]",
"T[i]",
"et",
"N = input()",
"input()",
"N",
"bt = ea = ba = 0",
"0",
"bt",
"bt = T[i]",
"T[i]",
"bt",
"ba = 0",
"0",
"ba",
"MOD = 10**9+7",
"10**9+7",
"MOD"
] |
from random import random
import math
import re
import fractions
MOD = 10**9+7
N = input()
T = map(int, raw_input().split(" "))
A = map(int, raw_input().split(" "))
# N = 10**5
# A = T = [999999999] * 10**5
result = 1
for i in xrange(N):
et = bt = ea = ba = 0
if i == 0 or T[i] != T[i-1]:
et = T[i]
else:
bt = T[i]
if i == N-1 or A[i] != A[i+1]:
ea = A[i]
else:
ba = A[i]
if ea + et > 0:
if ea * et > 0 and et != ea:
result = 0
break
if (ea > bt and bt != 0) or (et > ba and ba != 0):
result = 0
break
else:
result *= min(ba, bt)
result %= MOD
print(result % MOD)
|
[
7,
15,
15,
15,
13,
13,
13,
13,
13,
4,
18,
13,
13,
2,
17,
17,
0,
13,
2,
2,
17,
17,
17,
0,
13,
4,
13,
17,
12,
13,
12,
13,
12,
13,
4,
13,
17,
4,
13,
0,
13,
4,
13,
0,
13,
4,
13,
0,
13,
4,
13,
14,
40,
18,
13,
17,
18,
13,
17,
0,
13,
2,
39,
17,
13,
0,
13,
2,
39,
13,
13,
0,
13,
17,
28,
13,
4,
13,
13,
14,
2,
18,
13,
13,
13,
0,
13,
18,
13,
13,
0,
18,
13,
13,
13,
0,
18,
13,
13,
13,
0,
13,
17,
28,
13,
18,
4,
13,
13,
39,
17,
14,
2,
18,
13,
13,
13,
0,
13,
18,
13,
13,
14,
2,
40,
18,
13,
13,
17,
40,
18,
13,
13,
13,
4,
13,
0,
18,
13,
13,
13,
14,
2,
13,
18,
13,
13,
0,
18,
13,
13,
4,
13,
18,
13,
13,
13,
0,
13,
17,
28,
13,
4,
13,
13,
14,
2,
18,
13,
13,
17,
0,
13,
18,
13,
13,
0,
13,
13,
4,
13,
13,
10,
4,
13,
10,
2,
13,
10,
4,
13,
10,
18,
13,
10,
17,
13,
10,
13,
13,
10,
4,
13,
10,
2,
13,
10,
12,
13,
10,
4,
13,
10,
18,
13,
10,
12,
13,
10,
17,
13,
10,
2,
13,
10,
18,
13,
10,
12,
13,
10,
17,
13
] |
[
[
204,
17
],
[
189,
24
],
[
201,
40
],
[
208,
42
],
[
210,
44
],
[
217,
46
],
[
183,
48
],
[
217,
50
],
[
211,
54
],
[
184,
57
],
[
222,
60
],
[
202,
64
],
[
186,
66
],
[
202,
70
],
[
231,
72
],
[
76,
75
],
[
202,
78
],
[
211,
82
],
[
75,
83
],
[
232,
84
],
[
193,
84
],
[
192,
86
],
[
211,
88
],
[
75,
89
],
[
94,
91
],
[
223,
92
],
[
75,
93
],
[
193,
94
],
[
232,
94
],
[
99,
96
],
[
187,
97
],
[
75,
98
],
[
232,
99
],
[
193,
99
],
[
195,
101
],
[
105,
104
],
[
202,
108
],
[
184,
114
],
[
104,
115
],
[
196,
116
],
[
193,
116
],
[
232,
116
],
[
226,
116
],
[
225,
118
],
[
184,
120
],
[
104,
121
],
[
91,
125
],
[
137,
125
],
[
223,
126
],
[
104,
127
],
[
91,
130
],
[
137,
130
],
[
223,
131
],
[
104,
132
],
[
226,
133
],
[
196,
133
],
[
193,
133
],
[
232,
133
],
[
229,
135
],
[
140,
137
],
[
223,
138
],
[
104,
139
],
[
226,
140
],
[
196,
140
],
[
193,
140
],
[
232,
140
],
[
196,
143
],
[
193,
143
],
[
232,
143
],
[
226,
143
],
[
91,
144
],
[
137,
144
],
[
223,
145
],
[
104,
146
],
[
151,
148
],
[
187,
149
],
[
104,
150
],
[
96,
153
],
[
148,
153
],
[
187,
154
],
[
104,
155
],
[
226,
156
],
[
196,
156
],
[
193,
156
],
[
232,
156
],
[
219,
158
],
[
162,
161
],
[
202,
164
],
[
137,
167
],
[
91,
167
],
[
223,
168
],
[
161,
169
],
[
213,
172
],
[
148,
173
],
[
96,
173
],
[
187,
174
],
[
161,
175
],
[
198,
177
],
[
205,
178
],
[
199,
181
],
[
214,
181
],
[
220,
181
],
[
183,
184
],
[
186,
187
],
[
189,
190
],
[
192,
193
],
[
195,
196
],
[
205,
198
],
[
198,
199
],
[
201,
202
],
[
204,
205
],
[
210,
211
],
[
148,
213
],
[
96,
213
],
[
213,
214
],
[
219,
220
],
[
222,
223
],
[
225,
226
],
[
231,
232
]
] |
[
"from collections import Counter,defaultdict,deque\nfrom heapq import heappop,heappush,heapify\nimport sys,bisect,math,itertools,fractions\nsys.setrecursionlimit(10**8)\nmod = 10**9+7\nINF = float('inf')\ndef inp(): return int(sys.stdin.readline())\ndef inpl(): return list(map(int, sys.stdin.readline().split()))\n\ndef err():\n print(0)\n quit()\n\nn = inp()\na = inpl()\nb = inpl()\nif a[-1] != b[0]: err()\nde = [-1] * n\nmx = [INF] * n\nnow = -1\nfor i in range(n):\n if a[i] > now:\n now = a[i]\n de[i] = now\n else:\n mx[i] = now\nnow = -1\nfor i in range(n)[::-1]:\n if b[i] > now:\n now = b[i]\n if de[i] != -1 and de[i] != now:\n err()\n de[i] = now\n else:\n if now < de[i]: err()\n mx[i] = min(mx[i], now)\nres = 1\nfor i in range(n):\n if de[i] == -1:\n res *= mx[i]\n res %= mod\nprint(res)",
"from collections import Counter,defaultdict,deque",
"from heapq import heappop,heappush,heapify",
"import sys,bisect,math,itertools,fractions",
"sys",
"bisect",
"math",
"itertools",
"fractions",
"sys.setrecursionlimit(10**8)",
"sys.setrecursionlimit",
"sys",
"setrecursionlimit",
"10**8",
"10",
"8",
"mod = 10**9+7",
"mod",
"10**9+7",
"10**9",
"10",
"9",
"7",
"INF = float('inf')",
"INF",
"float('inf')",
"float",
"'inf'",
"def inp(): return int(sys.stdin.readline())",
"inp",
"def inpl(): return list(map(int, sys.stdin.readline().split()))",
"inpl",
"def err():\n print(0)\n quit()",
"err",
"print(0)",
"print",
"0",
"quit()",
"quit",
"n = inp()",
"n",
"inp()",
"inp",
"a = inpl()",
"a",
"inpl()",
"inpl",
"b = inpl()",
"b",
"inpl()",
"inpl",
"if a[-1] != b[0]: err()",
"a[-1] != b[0]",
"a[-1]",
"a",
"-1",
"b[0]",
"b",
"0",
"de = [-1] * n",
"de",
"[-1] * n",
"[-1]",
"-1",
"n",
"mx = [INF] * n",
"mx",
"[INF] * n",
"[INF]",
"INF",
"n",
"now = -1",
"now",
"-1",
"for i in range(n):\n if a[i] > now:\n now = a[i]\n de[i] = now\n else:\n mx[i] = now",
"i",
"range(n)",
"range",
"n",
"if a[i] > now:\n now = a[i]\n de[i] = now\n else:\n mx[i] = now",
"a[i] > now",
"a[i]",
"a",
"i",
"now",
"now = a[i]",
"now",
"a[i]",
"a",
"i",
"de[i] = now",
"de[i]",
"de",
"i",
"now",
"mx[i] = now",
"mx[i]",
"mx",
"i",
"now",
"now = -1",
"now",
"-1",
"for i in range(n)[::-1]:\n if b[i] > now:\n now = b[i]\n if de[i] != -1 and de[i] != now:\n err()\n de[i] = now\n else:\n if now < de[i]: err()\n mx[i] = min(mx[i], now)",
"i",
"range(n)[::-1]",
"(n)",
"range",
"n",
"::-1",
"-1",
"if b[i] > now:\n now = b[i]\n if de[i] != -1 and de[i] != now:\n err()\n de[i] = now\n else:\n if now < de[i]: err()\n mx[i] = min(mx[i], now)",
"b[i] > now",
"b[i]",
"b",
"i",
"now",
"now = b[i]",
"now",
"b[i]",
"b",
"i",
"if de[i] != -1 and de[i] != now:\n err()\n ",
"de[i] != -1 and de[i] != now",
"de[i] != -1",
"de[i]",
"de",
"i",
"-1",
"de[i] != now",
"de[i]",
"de",
"i",
"now",
"err()",
"err",
"de[i] = now",
"de[i]",
"de",
"i",
"now",
"if now < de[i]: err()\n ",
"now < de[i]",
"now",
"de[i]",
"de",
"i",
"mx[i] = min(mx[i], now)",
"mx[i]",
"mx",
"i",
"min(mx[i], now)",
"min",
"mx[i]",
"mx",
"i",
"now",
"res = 1",
"res",
"1",
"for i in range(n):\n if de[i] == -1:\n res *= mx[i]\n res %= mod",
"i",
"range(n)",
"range",
"n",
"if de[i] == -1:\n res *= mx[i]\n res %= mod",
"de[i] == -1",
"de[i]",
"de",
"i",
"-1",
"res *= mx[i]",
"res",
"mx[i]",
"mx",
"i",
"res %= mod",
"res",
"mod",
"print(res)",
"print",
"res",
"b = inpl()",
"inpl()",
"b",
"mx = [INF] * n",
"[INF] * n",
"mx",
"INF = float('inf')",
"float('inf')",
"INF",
"now = a[i]",
"a[i]",
"now",
"now = -1",
"-1",
"now",
"res %= mod",
"mod",
"res",
"n = inp()",
"inp()",
"n",
"mod = 10**9+7",
"10**9+7",
"mod",
"def inp(): return int(sys.stdin.readline())",
"def inp(): return int(sys.stdin.readline())",
"inp",
"a = inpl()",
"inpl()",
"a",
"res *= mx[i]",
"mx[i]",
"res",
"def inpl(): return list(map(int, sys.stdin.readline().split()))",
"def inpl(): return list(map(int, sys.stdin.readline().split()))",
"inpl",
"res = 1",
"1",
"res",
"de = [-1] * n",
"[-1] * n",
"de",
"now = b[i]",
"b[i]",
"now",
"def err():\n print(0)\n quit()",
"def err():\n print(0)\n quit()",
"err",
"now = -1",
"-1",
"now"
] |
from collections import Counter,defaultdict,deque
from heapq import heappop,heappush,heapify
import sys,bisect,math,itertools,fractions
sys.setrecursionlimit(10**8)
mod = 10**9+7
INF = float('inf')
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))
def err():
print(0)
quit()
n = inp()
a = inpl()
b = inpl()
if a[-1] != b[0]: err()
de = [-1] * n
mx = [INF] * n
now = -1
for i in range(n):
if a[i] > now:
now = a[i]
de[i] = now
else:
mx[i] = now
now = -1
for i in range(n)[::-1]:
if b[i] > now:
now = b[i]
if de[i] != -1 and de[i] != now:
err()
de[i] = now
else:
if now < de[i]: err()
mx[i] = min(mx[i], now)
res = 1
for i in range(n):
if de[i] == -1:
res *= mx[i]
res %= mod
print(res)
|
[
7,
15,
15,
15,
15,
13,
13,
13,
13,
4,
18,
13,
13,
2,
17,
17,
0,
13,
18,
18,
13,
13,
13,
0,
13,
18,
13,
13,
12,
13,
12,
13,
12,
13,
12,
13,
12,
13,
12,
13,
12,
13,
41,
28,
13,
4,
13,
13,
4,
4,
13,
12,
13,
23,
13,
41,
28,
13,
4,
13,
13,
4,
4,
13,
12,
13,
23,
13,
41,
28,
13,
4,
13,
13,
4,
4,
13,
12,
13,
23,
13,
41,
28,
13,
4,
13,
13,
4,
4,
13,
12,
13,
23,
13,
41,
28,
13,
4,
13,
13,
4,
4,
13,
12,
13,
23,
13,
41,
28,
13,
4,
13,
13,
4,
4,
13,
12,
13,
23,
13,
41,
28,
13,
4,
13,
13,
4,
4,
13,
12,
13,
23,
13,
0,
13,
17,
0,
13,
17,
12,
13,
0,
13,
4,
13,
0,
13,
4,
13,
0,
13,
18,
4,
13,
39,
17,
0,
13,
2,
39,
17,
13,
0,
13,
2,
39,
17,
13,
0,
13,
17,
0,
13,
17,
28,
13,
4,
13,
13,
14,
2,
13,
18,
13,
13,
0,
18,
13,
13,
39,
17,
18,
13,
13,
0,
13,
18,
13,
13,
0,
18,
13,
13,
39,
13,
13,
28,
13,
4,
13,
13,
14,
2,
13,
18,
13,
13,
0,
18,
13,
13,
39,
17,
18,
13,
13,
0,
13,
18,
13,
13,
0,
18,
13,
13,
39,
13,
13,
0,
13,
18,
13,
39,
17,
0,
13,
17,
28,
13,
4,
13,
13,
0,
13,
17,
14,
2,
18,
18,
13,
13,
17,
17,
14,
2,
18,
18,
13,
13,
17,
18,
18,
13,
13,
17,
4,
13,
17,
29,
0,
13,
17,
14,
2,
18,
18,
13,
13,
17,
17,
14,
2,
18,
18,
13,
13,
17,
18,
18,
13,
13,
17,
4,
13,
17,
29,
0,
13,
17,
14,
13,
0,
13,
4,
13,
18,
18,
13,
13,
17,
18,
18,
13,
13,
17,
0,
13,
13,
4,
13,
13,
29,
14,
2,
13,
17,
4,
13,
10,
12,
13,
10,
17,
13,
10,
12,
13,
10,
12,
13,
10,
12,
13,
10,
12,
13,
10,
17,
13,
10,
12,
13,
10,
12,
13,
10,
12,
13,
10,
12,
13,
10,
18,
13,
10,
12,
13,
10,
12,
13,
10,
12,
13,
10,
18,
13,
10,
12,
13,
10,
12,
13,
10,
12,
13
] |
[
[
384,
17
],
[
372,
24
],
[
45,
44
],
[
376,
50
],
[
54,
54
],
[
58,
57
],
[
388,
63
],
[
67,
67
],
[
71,
70
],
[
391,
76
],
[
80,
80
],
[
84,
83
],
[
388,
89
],
[
93,
93
],
[
97,
96
],
[
349,
102
],
[
106,
106
],
[
110,
109
],
[
367,
115
],
[
119,
119
],
[
123,
122
],
[
355,
128
],
[
132,
132
],
[
342,
134
],
[
357,
137
],
[
143,
142
],
[
376,
144
],
[
147,
146
],
[
388,
148
],
[
151,
150
],
[
388,
153
],
[
158,
157
],
[
142,
161
],
[
164,
163
],
[
142,
167
],
[
170,
169
],
[
173,
172
],
[
176,
175
],
[
142,
178
],
[
172,
181
],
[
195,
181
],
[
146,
183
],
[
175,
184
],
[
189,
186
],
[
157,
187
],
[
175,
188
],
[
146,
192
],
[
175,
193
],
[
196,
195
],
[
146,
197
],
[
175,
198
],
[
203,
200
],
[
157,
201
],
[
175,
202
],
[
208,
207
],
[
142,
210
],
[
169,
213
],
[
227,
213
],
[
150,
215
],
[
207,
216
],
[
221,
218
],
[
163,
219
],
[
207,
220
],
[
150,
224
],
[
207,
225
],
[
228,
227
],
[
150,
229
],
[
207,
230
],
[
235,
232
],
[
163,
233
],
[
207,
234
],
[
240,
239
],
[
163,
241
],
[
246,
245
],
[
249,
248
],
[
142,
251
],
[
254,
253
],
[
232,
258
],
[
218,
258
],
[
239,
259
],
[
163,
259
],
[
248,
260
],
[
232,
266
],
[
218,
266
],
[
239,
267
],
[
163,
267
],
[
248,
268
],
[
200,
271
],
[
186,
271
],
[
157,
272
],
[
248,
273
],
[
281,
280
],
[
200,
285
],
[
186,
285
],
[
157,
286
],
[
248,
287
],
[
232,
293
],
[
218,
293
],
[
239,
294
],
[
163,
294
],
[
248,
295
],
[
200,
298
],
[
186,
298
],
[
157,
299
],
[
248,
300
],
[
308,
307
],
[
313,
312
],
[
232,
316
],
[
218,
316
],
[
239,
317
],
[
163,
317
],
[
248,
318
],
[
200,
321
],
[
186,
321
],
[
157,
322
],
[
248,
323
],
[
327,
326
],
[
343,
327
],
[
326,
330
],
[
312,
330
],
[
245,
330
],
[
346,
337
],
[
342,
343
],
[
357,
358
],
[
372,
373
],
[
384,
385
]
] |
[
"#!/usr/bin/env python3\nfrom collections import defaultdict,deque\nfrom heapq import heappush, heappop\nfrom bisect import bisect_left, bisect_right\nimport sys, random, itertools, math\nsys.setrecursionlimit(10**5)\ninput = sys.stdin.readline\nsqrt = math.sqrt\ndef LI(): return list(map(int, input().split()))\ndef LF(): return list(map(float, input().split()))\ndef LI_(): return list(map(lambda x: int(x)-1, input().split()))\ndef II(): return int(input())\ndef IF(): return float(input())\ndef LS(): return list(map(list, input().split()))\ndef S(): return list(input().rstrip())\ndef IR(n): return [II() for _ in range(n)]\ndef LIR(n): return [LI() for _ in range(n)]\ndef FR(n): return [IF() for _ in range(n)]\ndef LFR(n): return [LI() for _ in range(n)]\ndef LIR_(n): return [LI_() for _ in range(n)]\ndef SR(n): return [S() for _ in range(n)]\ndef LSR(n): return [LS() for _ in range(n)]\nmod = 1000000007\ninf = 1e10\n\n#solve\ndef solve():\n n = II()\n t = LI()\n a = LI()[::-1]\n dt = [None] * n\n da = [None] * n\n ba = 0\n bt = 0\n for i in range(n):\n if bt < t[i]:\n dt[i] = (1, t[i])\n bt = t[i]\n else:\n dt[i] = (bt, bt)\n for i in range(n):\n if ba < a[i]:\n da[i] = (1, a[i])\n ba = a[i]\n else:\n da[i] = (ba, ba)\n da = da[::-1]\n ans = 1\n for i in range(n):\n f = True\n if da[i][0] == 1:\n if da[i][1] > dt[i][1]:\n print(0)\n return\n f &= 0\n if dt[i][0] == 1:\n if da[i][1] < dt[i][1]:\n print(0)\n return\n f &= 0\n if f:\n ans *= min(da[i][1], dt[i][1])\n ans %= mod\n print(ans)\n return\n\n\n#main\nif __name__ == '__main__':\n solve()",
"from collections import defaultdict,deque",
"from heapq import heappush, heappop",
"from bisect import bisect_left, bisect_right",
"import sys, random, itertools, math",
"sys",
"random",
"itertools",
"math",
"sys.setrecursionlimit(10**5)",
"sys.setrecursionlimit",
"sys",
"setrecursionlimit",
"10**5",
"10",
"5",
"input = sys.stdin.readline",
"input",
"sys.stdin.readline",
"sys.stdin",
"sys",
"stdin",
"readline",
"sqrt = math.sqrt",
"sqrt",
"math.sqrt",
"math",
"sqrt",
"def LI(): return list(map(int, input().split()))",
"LI",
"def LF(): return list(map(float, input().split()))",
"LF",
"def LI_(): return list(map(lambda x: int(x)-1, input().split()))",
"LI_",
"def II(): return int(input())",
"II",
"def IF(): return float(input())",
"IF",
"def LS(): return list(map(list, input().split()))",
"LS",
"def S(): return list(input().rstrip())",
"S",
"II() for _ in range(n)",
"for _ in range(n)",
"_",
"range(n)",
"range",
"n",
"for _ in range(n)",
"II()",
"II",
"def IR(n): return [II() for _ in range(n)]",
"IR",
"n",
"n",
"LI() for _ in range(n)",
"for _ in range(n)",
"_",
"range(n)",
"range",
"n",
"for _ in range(n)",
"LI()",
"LI",
"def LIR(n): return [LI() for _ in range(n)]",
"LIR",
"n",
"n",
"IF() for _ in range(n)",
"for _ in range(n)",
"_",
"range(n)",
"range",
"n",
"for _ in range(n)",
"IF()",
"IF",
"def FR(n): return [IF() for _ in range(n)]",
"FR",
"n",
"n",
"LI() for _ in range(n)",
"for _ in range(n)",
"_",
"range(n)",
"range",
"n",
"for _ in range(n)",
"LI()",
"LI",
"def LFR(n): return [LI() for _ in range(n)]",
"LFR",
"n",
"n",
"LI_() for _ in range(n)",
"for _ in range(n)",
"_",
"range(n)",
"range",
"n",
"for _ in range(n)",
"LI_()",
"LI_",
"def LIR_(n): return [LI_() for _ in range(n)]",
"LIR_",
"n",
"n",
"S() for _ in range(n)",
"for _ in range(n)",
"_",
"range(n)",
"range",
"n",
"for _ in range(n)",
"S()",
"S",
"def SR(n): return [S() for _ in range(n)]",
"SR",
"n",
"n",
"LS() for _ in range(n)",
"for _ in range(n)",
"_",
"range(n)",
"range",
"n",
"for _ in range(n)",
"LS()",
"LS",
"def LSR(n): return [LS() for _ in range(n)]",
"LSR",
"n",
"n",
"mod = 1000000007",
"mod",
"1000000007",
"inf = 1e10",
"inf",
"1e10",
"def solve():\n n = II()\n t = LI()\n a = LI()[::-1]\n dt = [None] * n\n da = [None] * n\n ba = 0\n bt = 0\n for i in range(n):\n if bt < t[i]:\n dt[i] = (1, t[i])\n bt = t[i]\n else:\n dt[i] = (bt, bt)\n for i in range(n):\n if ba < a[i]:\n da[i] = (1, a[i])\n ba = a[i]\n else:\n da[i] = (ba, ba)\n da = da[::-1]\n ans = 1\n for i in range(n):\n f = True\n if da[i][0] == 1:\n if da[i][1] > dt[i][1]:\n print(0)\n return\n f &= 0\n if dt[i][0] == 1:\n if da[i][1] < dt[i][1]:\n print(0)\n return\n f &= 0\n if f:\n ans *= min(da[i][1], dt[i][1])\n ans %= mod\n print(ans)\n return\n\n\n#main",
"solve",
"n = II()",
"n",
"II()",
"II",
"t = LI()",
"t",
"LI()",
"LI",
"a = LI()[::-1]",
"a",
"LI()[::-1]",
"()",
"LI",
"::-1",
"-1",
"dt = [None] * n",
"dt",
"[None] * n",
"[None]",
"None",
"n",
"da = [None] * n",
"da",
"[None] * n",
"[None]",
"None",
"n",
"ba = 0",
"ba",
"0",
"bt = 0",
"bt",
"0",
"for i in range(n):\n if bt < t[i]:\n dt[i] = (1, t[i])\n bt = t[i]\n else:\n dt[i] = (bt, bt)\n ",
"i",
"range(n)",
"range",
"n",
"if bt < t[i]:\n dt[i] = (1, t[i])\n bt = t[i]\n else:\n dt[i] = (bt, bt)\n ",
"bt < t[i]",
"bt",
"t[i]",
"t",
"i",
"dt[i] = (1, t[i])",
"dt[i]",
"dt",
"i",
"(1, t[i])",
"1",
"t[i]",
"t",
"i",
"bt = t[i]",
"bt",
"t[i]",
"t",
"i",
"dt[i] = (bt, bt)",
"dt[i]",
"dt",
"i",
"(bt, bt)",
"bt",
"bt",
"for i in range(n):\n if ba < a[i]:\n da[i] = (1, a[i])\n ba = a[i]\n else:\n da[i] = (ba, ba)\n ",
"i",
"range(n)",
"range",
"n",
"if ba < a[i]:\n da[i] = (1, a[i])\n ba = a[i]\n else:\n da[i] = (ba, ba)\n ",
"ba < a[i]",
"ba",
"a[i]",
"a",
"i",
"da[i] = (1, a[i])",
"da[i]",
"da",
"i",
"(1, a[i])",
"1",
"a[i]",
"a",
"i",
"ba = a[i]",
"ba",
"a[i]",
"a",
"i",
"da[i] = (ba, ba)",
"da[i]",
"da",
"i",
"(ba, ba)",
"ba",
"ba",
"da = da[::-1]",
"da",
"da[::-1]",
"da",
"::-1",
"-1",
"ans = 1",
"ans",
"1",
"for i in range(n):\n f = True\n if da[i][0] == 1:\n if da[i][1] > dt[i][1]:\n print(0)\n return\n f &= 0\n if dt[i][0] == 1:\n if da[i][1] < dt[i][1]:\n print(0)\n return\n f &= 0\n if f:\n ans *= min(da[i][1], dt[i][1])\n ans %= mod\n ",
"i",
"range(n)",
"range",
"n",
"f = True",
"f",
"True",
"if da[i][0] == 1:\n if da[i][1] > dt[i][1]:\n print(0)\n return\n f &= 0\n ",
"da[i][0] == 1",
"da[i][0]",
"[i]",
"da",
"i",
"0",
"1",
"if da[i][1] > dt[i][1]:\n print(0)\n return\n ",
"da[i][1] > dt[i][1]",
"da[i][1]",
"[i]",
"da",
"i",
"1",
"dt[i][1]",
"[i]",
"dt",
"i",
"1",
"print(0)",
"print",
"0",
"return",
"f &= 0",
"f",
"0",
"if dt[i][0] == 1:\n if da[i][1] < dt[i][1]:\n print(0)\n return\n f &= 0\n ",
"dt[i][0] == 1",
"dt[i][0]",
"[i]",
"dt",
"i",
"0",
"1",
"if da[i][1] < dt[i][1]:\n print(0)\n return\n ",
"da[i][1] < dt[i][1]",
"da[i][1]",
"[i]",
"da",
"i",
"1",
"dt[i][1]",
"[i]",
"dt",
"i",
"1",
"print(0)",
"print",
"0",
"return",
"f &= 0",
"f",
"0",
"if f:\n ans *= min(da[i][1], dt[i][1])\n ans %= mod\n ",
"f",
"ans *= min(da[i][1], dt[i][1])",
"ans",
"min(da[i][1], dt[i][1])",
"min",
"da[i][1]",
"[i]",
"da",
"i",
"1",
"dt[i][1]",
"[i]",
"dt",
"i",
"1",
"ans %= mod",
"ans",
"mod",
"print(ans)",
"print",
"ans",
"return",
"if __name__ == '__main__':\n solve()",
"__name__ == '__main__'",
"__name__",
"'__main__'",
"solve()",
"solve",
"def LIR_(n): return [LI_() for _ in range(n)]",
"def LIR_(n): return [LI_() for _ in range(n)]",
"LIR_",
"mod = 1000000007",
"1000000007",
"mod",
"def solve():\n n = II()\n t = LI()\n a = LI()[::-1]\n dt = [None] * n\n da = [None] * n\n ba = 0\n bt = 0\n for i in range(n):\n if bt < t[i]:\n dt[i] = (1, t[i])\n bt = t[i]\n else:\n dt[i] = (bt, bt)\n for i in range(n):\n if ba < a[i]:\n da[i] = (1, a[i])\n ba = a[i]\n else:\n da[i] = (ba, ba)\n da = da[::-1]\n ans = 1\n for i in range(n):\n f = True\n if da[i][0] == 1:\n if da[i][1] > dt[i][1]:\n print(0)\n return\n f &= 0\n if dt[i][0] == 1:\n if da[i][1] < dt[i][1]:\n print(0)\n return\n f &= 0\n if f:\n ans *= min(da[i][1], dt[i][1])\n ans %= mod\n print(ans)\n return\n\n\n#main",
"def solve():\n n = II()\n t = LI()\n a = LI()[::-1]\n dt = [None] * n\n da = [None] * n\n ba = 0\n bt = 0\n for i in range(n):\n if bt < t[i]:\n dt[i] = (1, t[i])\n bt = t[i]\n else:\n dt[i] = (bt, bt)\n for i in range(n):\n if ba < a[i]:\n da[i] = (1, a[i])\n ba = a[i]\n else:\n da[i] = (ba, ba)\n da = da[::-1]\n ans = 1\n for i in range(n):\n f = True\n if da[i][0] == 1:\n if da[i][1] > dt[i][1]:\n print(0)\n return\n f &= 0\n if dt[i][0] == 1:\n if da[i][1] < dt[i][1]:\n print(0)\n return\n f &= 0\n if f:\n ans *= min(da[i][1], dt[i][1])\n ans %= mod\n print(ans)\n return\n\n\n#main",
"solve",
"def LI_(): return list(map(lambda x: int(x)-1, input().split()))",
"def LI_(): return list(map(lambda x: int(x)-1, input().split()))",
"LI_",
"def LFR(n): return [LI() for _ in range(n)]",
"def LFR(n): return [LI() for _ in range(n)]",
"LFR",
"def LS(): return list(map(list, input().split()))",
"def LS(): return list(map(list, input().split()))",
"LS",
"inf = 1e10",
"1e10",
"inf",
"def FR(n): return [IF() for _ in range(n)]",
"def FR(n): return [IF() for _ in range(n)]",
"FR",
"def LSR(n): return [LS() for _ in range(n)]",
"def LSR(n): return [LS() for _ in range(n)]",
"LSR",
"def S(): return list(input().rstrip())",
"def S(): return list(input().rstrip())",
"S",
"def LIR(n): return [LI() for _ in range(n)]",
"def LIR(n): return [LI() for _ in range(n)]",
"LIR",
"sqrt = math.sqrt",
"math.sqrt",
"sqrt",
"def II(): return int(input())",
"def II(): return int(input())",
"II",
"def IR(n): return [II() for _ in range(n)]",
"def IR(n): return [II() for _ in range(n)]",
"IR",
"def SR(n): return [S() for _ in range(n)]",
"def SR(n): return [S() for _ in range(n)]",
"SR",
"input = sys.stdin.readline",
"sys.stdin.readline",
"input",
"def LI(): return list(map(int, input().split()))",
"def LI(): return list(map(int, input().split()))",
"LI",
"def IF(): return float(input())",
"def IF(): return float(input())",
"IF",
"def LF(): return list(map(float, input().split()))",
"def LF(): return list(map(float, input().split()))",
"LF"
] |
#!/usr/bin/env python3
from collections import defaultdict,deque
from heapq import heappush, heappop
from bisect import bisect_left, bisect_right
import sys, random, itertools, math
sys.setrecursionlimit(10**5)
input = sys.stdin.readline
sqrt = math.sqrt
def LI(): return list(map(int, input().split()))
def LF(): return list(map(float, input().split()))
def LI_(): return list(map(lambda x: int(x)-1, input().split()))
def II(): return int(input())
def IF(): return float(input())
def LS(): return list(map(list, input().split()))
def S(): return list(input().rstrip())
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = 1e10
#solve
def solve():
n = II()
t = LI()
a = LI()[::-1]
dt = [None] * n
da = [None] * n
ba = 0
bt = 0
for i in range(n):
if bt < t[i]:
dt[i] = (1, t[i])
bt = t[i]
else:
dt[i] = (bt, bt)
for i in range(n):
if ba < a[i]:
da[i] = (1, a[i])
ba = a[i]
else:
da[i] = (ba, ba)
da = da[::-1]
ans = 1
for i in range(n):
f = True
if da[i][0] == 1:
if da[i][1] > dt[i][1]:
print(0)
return
f &= 0
if dt[i][0] == 1:
if da[i][1] < dt[i][1]:
print(0)
return
f &= 0
if f:
ans *= min(da[i][1], dt[i][1])
ans %= mod
print(ans)
return
#main
if __name__ == '__main__':
solve()
|
[
7,
0,
13,
4,
13,
13,
4,
18,
4,
13,
13,
13,
13,
0,
13,
4,
13,
4,
18,
13,
13,
13,
4,
18,
13,
13,
13,
4,
18,
13,
13,
13,
4,
13,
4,
13,
13,
10,
4,
13,
10,
4,
13,
10,
4,
13,
10,
4,
13
] |
[
[
44,
2
],
[
44,
11
],
[
44,
12
],
[
47,
14
],
[
48,
19
],
[
42,
21
],
[
48,
24
],
[
39,
26
],
[
48,
29
],
[
45,
31
],
[
48,
36
],
[
44,
39
],
[
44,
42
],
[
44,
45
],
[
47,
48
]
] |
[
"a, b, c = map(int, input().split())\ncolor = set()\ncolor.add(a)\ncolor.add(b)\ncolor.add(c)\n\nprint(len(color))",
"a, b, c = map(int, input().split())",
"a",
"map(int, input().split())",
"map",
"int",
"input().split()",
"().split",
"()",
"input",
"split",
"b",
"c",
"color = set()",
"color",
"set()",
"set",
"color.add(a)",
"color.add",
"color",
"add",
"a",
"color.add(b)",
"color.add",
"color",
"add",
"b",
"color.add(c)",
"color.add",
"color",
"add",
"c",
"print(len(color))",
"print",
"len(color)",
"len",
"color",
"b, c = map(int, input().split())",
"map(int, input().split())",
"b",
"a, b, c = map(int, input().split())",
"map(int, input().split())",
"a",
"c = map(int, input().split())",
"map(int, input().split())",
"c",
"color = set()",
"set()",
"color"
] |
a, b, c = map(int, input().split())
color = set()
color.add(a)
color.add(b)
color.add(c)
print(len(color))
|
[
7,
0,
13,
4,
18,
4,
18,
4,
13,
13,
13,
17,
0,
13,
39,
28,
13,
4,
13,
4,
13,
13,
4,
18,
13,
13,
4,
13,
18,
13,
13,
0,
13,
4,
13,
13,
4,
13,
4,
13,
13,
10,
4,
13,
10,
39,
13,
10,
4,
13
] |
[
[
42,
2
],
[
45,
13
],
[
17,
16
],
[
43,
21
],
[
46,
24
],
[
43,
29
],
[
16,
30
],
[
48,
32
],
[
46,
35
],
[
49,
40
],
[
42,
43
],
[
45,
46
],
[
48,
49
]
] |
[
"a = input().strip().split(\" \")\nlst = []\nfor i in range(len(a)):\n lst.append(int(a[i]))\nb = set(lst)\nprint(len(b))",
"a = input().strip().split(\" \")",
"a",
"input().strip().split(\" \")",
"().strip().split",
"().strip()",
"().strip",
"()",
"input",
"strip",
"split",
"\" \"",
"lst = []",
"lst",
"[]",
"for i in range(len(a)):\n lst.append(int(a[i]))",
"i",
"range(len(a))",
"range",
"len(a)",
"len",
"a",
"lst.append(int(a[i]))",
"lst.append",
"lst",
"append",
"int(a[i])",
"int",
"a[i]",
"a",
"i",
"b = set(lst)",
"b",
"set(lst)",
"set",
"lst",
"print(len(b))",
"print",
"len(b)",
"len",
"b",
"a = input().strip().split(\" \")",
"input().strip().split(\" \")",
"a",
"lst = []",
"[]",
"lst",
"b = set(lst)",
"set(lst)",
"b"
] |
a = input().strip().split(" ")
lst = []
for i in range(len(a)):
lst.append(int(a[i]))
b = set(lst)
print(len(b))
|
[
7,
0,
13,
2,
39,
17,
17,
28,
13,
4,
13,
13,
4,
18,
4,
13,
13,
0,
18,
13,
2,
13,
17,
17,
0,
13,
17,
28,
13,
13,
14,
40,
13,
17,
0,
13,
17,
4,
13,
13,
10,
17,
13,
10,
17,
13,
10,
2,
13
] |
[
[
47,
2
],
[
9,
8
],
[
23,
18
],
[
48,
19
],
[
8,
21
],
[
44,
25
],
[
29,
28
],
[
48,
28
],
[
28,
32
],
[
41,
35
],
[
42,
39
],
[
45,
39
],
[
41,
42
],
[
44,
45
],
[
47,
48
]
] |
[
"num = [0] * 100\nfor i in map(int, input().split()):\n num[i-1] += 1\n\ncount = 0\nfor i in num:\n if i >= 1:\n count += 1\n\nprint(count)",
"num = [0] * 100",
"num",
"[0] * 100",
"[0]",
"0",
"100",
"for i in map(int, input().split()):\n num[i-1] += 1",
"i",
"map(int, input().split())",
"map",
"int",
"input().split()",
"().split",
"()",
"input",
"split",
"num[i-1] += 1",
"num[i-1]",
"num",
"i-1",
"i",
"1",
"1",
"count = 0",
"count",
"0",
"for i in num:\n if i >= 1:\n count += 1",
"i",
"num",
"if i >= 1:\n count += 1",
"i >= 1",
"i",
"1",
"count += 1",
"count",
"1",
"print(count)",
"print",
"count",
"count += 1",
"1",
"count",
"count = 0",
"0",
"count",
"num = [0] * 100",
"[0] * 100",
"num"
] |
num = [0] * 100
for i in map(int, input().split()):
num[i-1] += 1
count = 0
for i in num:
if i >= 1:
count += 1
print(count)
|
[
7,
15,
13,
4,
18,
13,
13,
2,
17,
17,
0,
13,
2,
17,
17,
0,
13,
2,
2,
17,
17,
17,
0,
13,
12,
4,
18,
4,
18,
18,
13,
13,
13,
13,
0,
13,
12,
4,
13,
8,
13,
39,
4,
13,
17,
4,
13,
17,
23,
0,
13,
12,
4,
13,
8,
13,
39,
4,
13,
17,
4,
13,
17,
23,
0,
13,
12,
2,
4,
13,
13,
17,
23,
12,
13,
4,
13,
4,
13,
4,
13,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
14,
2,
13,
17,
4,
13,
10,
12,
13,
10,
2,
13,
10,
12,
13,
10,
12,
13,
10,
12,
13,
10,
12,
13,
10,
2,
13
] |
[
[
116,
11
],
[
101,
16
],
[
107,
23
],
[
110,
35
],
[
104,
50
],
[
98,
65
],
[
108,
89
],
[
114,
96
],
[
98,
99
],
[
101,
102
],
[
104,
105
],
[
107,
108
],
[
110,
111
],
[
116,
117
]
] |
[
"# -*- coding: utf-8 -*-\nimport sys\nsys.setrecursionlimit(10**9)\nINF=10**18\nMOD=10**9+7\ninput=lambda: sys.stdin.readline().rstrip()\nYesNo=lambda b: bool([print('Yes')] if b else print('No'))\nYESNO=lambda b: bool([print('YES')] if b else print('NO'))\nint1=lambda x:int(x)-1\n\ndef main():\n print(len(set(list(map(int,input().split())))))\n\nif __name__ == '__main__':\n main()",
"import sys",
"sys",
"sys.setrecursionlimit(10**9)",
"sys.setrecursionlimit",
"sys",
"setrecursionlimit",
"10**9",
"10",
"9",
"INF=10**18",
"INF",
"10**18",
"10",
"18",
"MOD=10**9+7",
"MOD",
"10**9+7",
"10**9",
"10",
"9",
"7",
"input=lambda: sys.stdin.readline().rstrip()",
"input",
"lambda: sys.stdin.readline().rstrip()",
"sys.stdin.readline().rstrip()",
"sys.stdin.readline().rstrip",
"sys.stdin.readline()",
"sys.stdin.readline",
"sys.stdin",
"sys",
"stdin",
"readline",
"rstrip",
"YesNo=lambda b: bool([print('Yes')] if b else print('No'))",
"YesNo",
"lambda b: bool([print('Yes')] if b else print('No'))",
"bool([print('Yes')] if b else print('No'))",
"bool",
"[print('Yes')] if b else print('No')",
"b",
"[print('Yes')]",
"print('Yes')",
"print",
"'Yes'",
"print('No')",
"print",
"'No'",
"b",
"YESNO=lambda b: bool([print('YES')] if b else print('NO'))",
"YESNO",
"lambda b: bool([print('YES')] if b else print('NO'))",
"bool([print('YES')] if b else print('NO'))",
"bool",
"[print('YES')] if b else print('NO')",
"b",
"[print('YES')]",
"print('YES')",
"print",
"'YES'",
"print('NO')",
"print",
"'NO'",
"b",
"int1=lambda x:int(x)-1",
"int1",
"lambda x:int(x)-1",
"int(x)-1",
"int(x)",
"int",
"x",
"1",
"x",
"def main():\n print(len(set(list(map(int,input().split())))))",
"main",
"print(len(set(list(map(int,input().split())))))",
"print",
"len(set(list(map(int,input().split()))))",
"len",
"set(list(map(int,input().split())))",
"set",
"list(map(int,input().split()))",
"list",
"map(int,input().split())",
"map",
"int",
"input().split()",
"().split",
"()",
"input",
"split",
"if __name__ == '__main__':\n main()",
"__name__ == '__main__'",
"__name__",
"'__main__'",
"main()",
"main",
"int1=lambda x:int(x)-1",
"lambda x:int(x)-1",
"int1",
"MOD=10**9+7",
"10**9+7",
"MOD",
"YESNO=lambda b: bool([print('YES')] if b else print('NO'))",
"lambda b: bool([print('YES')] if b else print('NO'))",
"YESNO",
"input=lambda: sys.stdin.readline().rstrip()",
"lambda: sys.stdin.readline().rstrip()",
"input",
"YesNo=lambda b: bool([print('Yes')] if b else print('No'))",
"lambda b: bool([print('Yes')] if b else print('No'))",
"YesNo",
"def main():\n print(len(set(list(map(int,input().split())))))",
"def main():\n print(len(set(list(map(int,input().split())))))",
"main",
"INF=10**18",
"10**18",
"INF"
] |
# -*- coding: utf-8 -*-
import sys
sys.setrecursionlimit(10**9)
INF=10**18
MOD=10**9+7
input=lambda: sys.stdin.readline().rstrip()
YesNo=lambda b: bool([print('Yes')] if b else print('No'))
YESNO=lambda b: bool([print('YES')] if b else print('NO'))
int1=lambda x:int(x)-1
def main():
print(len(set(list(map(int,input().split())))))
if __name__ == '__main__':
main()
|
[
7,
15,
13,
15,
13,
15,
13,
0,
13,
4,
13,
13,
4,
18,
4,
13,
13,
13,
13,
14,
2,
2,
40,
13,
13,
40,
13,
13,
40,
13,
13,
4,
13,
17,
14,
2,
2,
13,
13,
2,
13,
13,
4,
13,
17,
4,
13,
17,
10,
4,
13,
10,
4,
13,
10,
4,
13
] |
[
[
55,
8
],
[
55,
17
],
[
55,
18
],
[
50,
23
],
[
56,
24
],
[
56,
26
],
[
53,
27
],
[
50,
29
],
[
53,
30
],
[
50,
37
],
[
56,
38
],
[
56,
40
],
[
53,
41
],
[
55,
50
],
[
55,
53
],
[
55,
56
]
] |
[
"import sys\nimport math\nimport itertools\na, b, c = map(int, input().split())\nif (a != b and b != c and a!=c):\n print(3)\nelif (a == b and b == c):\n print(1)\nelse:\n print(2)",
"import sys",
"sys",
"import math",
"math",
"import itertools",
"itertools",
"a, b, c = map(int, input().split())",
"a",
"map(int, input().split())",
"map",
"int",
"input().split()",
"().split",
"()",
"input",
"split",
"b",
"c",
"if (a != b and b != c and a!=c):\n print(3)\nelif (a == b and b == c):\n print(1)\nelse:\n print(2)",
"a != b and b != c and a!=c",
"a != b and b != c",
"a != b",
"a",
"b",
"b != c",
"b",
"c",
"a!=c",
"a",
"c",
"print(3)",
"print",
"3",
"elif (a == b and b == c):\n print(1)",
"a == b and b == c",
"a == b",
"a",
"b",
"b == c",
"b",
"c",
"print(1)",
"print",
"1",
"print(2)",
"print",
"2",
"a, b, c = map(int, input().split())",
"map(int, input().split())",
"a",
"c = map(int, input().split())",
"map(int, input().split())",
"c",
"b, c = map(int, input().split())",
"map(int, input().split())",
"b"
] |
import sys
import math
import itertools
a, b, c = map(int, input().split())
if (a != b and b != c and a!=c):
print(3)
elif (a == b and b == c):
print(1)
else:
print(2)
|
[
7,
15,
13,
0,
13,
4,
18,
4,
13,
13,
0,
13,
4,
18,
13,
13,
13,
4,
13,
4,
13,
13,
10,
4,
13,
10,
4,
13
] |
[
[
23,
4
],
[
26,
11
],
[
24,
16
],
[
27,
21
],
[
23,
24
],
[
26,
27
]
] |
[
"import collections\nA = input().split()\nc = collections.Counter(A)\nprint(len(c))",
"import collections",
"collections",
"A = input().split()",
"A",
"input().split()",
"().split",
"()",
"input",
"split",
"c = collections.Counter(A)",
"c",
"collections.Counter(A)",
"collections.Counter",
"collections",
"Counter",
"A",
"print(len(c))",
"print",
"len(c)",
"len",
"c",
"A = input().split()",
"input().split()",
"A",
"c = collections.Counter(A)",
"collections.Counter(A)",
"c"
] |
import collections
A = input().split()
c = collections.Counter(A)
print(len(c))
|
[
7,
0,
31,
13,
4,
13,
13,
4,
18,
4,
13,
13,
4,
13,
4,
13,
4,
13,
13
] |
[
[
4,
2
]
] |
[
"*k, = map(int, input().split())\nprint(len(set(k)))",
"*k, = map(int, input().split())",
"*k",
"k",
"map(int, input().split())",
"map",
"int",
"input().split()",
"().split",
"()",
"input",
"split",
"print(len(set(k)))",
"print",
"len(set(k))",
"len",
"set(k)",
"set",
"k"
] |
*k, = map(int, input().split())
print(len(set(k)))
|
[
7,
12,
13,
29,
4,
13,
4,
18,
4,
13,
13,
12,
13,
29,
4,
13,
4,
13,
13,
4,
18,
4,
18,
4,
13,
13,
13,
17,
12,
13,
29,
4,
13,
4,
13,
4,
13,
14,
2,
13,
17,
4,
13,
4,
13,
10,
12,
13,
10,
12,
13,
10,
12,
13
] |
[
[
50,
36
],
[
47,
44
]
] |
[
"\n\ndef read_int():\n return int(input().strip())\n\n\ndef read_ints():\n return list(map(int, input().strip().split(' ')))\n\n\ndef solve():\n return len(set(read_ints()))\n\n\nif __name__ == '__main__':\n print(solve())",
"def read_int():\n return int(input().strip())",
"read_int",
"return int(input().strip())",
"int(input().strip())",
"int",
"input().strip()",
"().strip",
"()",
"input",
"strip",
"def read_ints():\n return list(map(int, input().strip().split(' ')))",
"read_ints",
"return list(map(int, input().strip().split(' ')))",
"list(map(int, input().strip().split(' ')))",
"list",
"map(int, input().strip().split(' '))",
"map",
"int",
"input().strip().split(' ')",
"().strip().split",
"().strip()",
"().strip",
"()",
"input",
"strip",
"split",
"' '",
"def solve():\n return len(set(read_ints()))",
"solve",
"return len(set(read_ints()))",
"len(set(read_ints()))",
"len",
"set(read_ints())",
"set",
"read_ints()",
"read_ints",
"if __name__ == '__main__':\n print(solve())",
"__name__ == '__main__'",
"__name__",
"'__main__'",
"print(solve())",
"print",
"solve()",
"solve",
"def solve():\n return len(set(read_ints()))",
"def solve():\n return len(set(read_ints()))",
"solve",
"def read_ints():\n return list(map(int, input().strip().split(' ')))",
"def read_ints():\n return list(map(int, input().strip().split(' ')))",
"read_ints",
"def read_int():\n return int(input().strip())",
"def read_int():\n return int(input().strip())",
"read_int"
] |
def read_int():
return int(input().strip())
def read_ints():
return list(map(int, input().strip().split(' ')))
def solve():
return len(set(read_ints()))
if __name__ == '__main__':
print(solve())
|
[
7,
0,
13,
4,
13,
13,
4,
18,
4,
13,
13,
13,
13,
0,
13,
17,
14,
40,
13,
13,
14,
2,
40,
13,
13,
40,
13,
13,
4,
13,
13,
10,
17,
13,
10,
4,
13,
10,
4,
13,
10,
4,
13
] |
[
[
41,
2
],
[
41,
11
],
[
41,
12
],
[
32,
14
],
[
39,
18
],
[
36,
19
],
[
36,
23
],
[
42,
24
],
[
39,
26
],
[
42,
27
],
[
33,
30
],
[
32,
33
],
[
41,
36
],
[
41,
39
],
[
41,
42
]
] |
[
"a,b,c=map(int,input().split())\nans=1\nif b!=a:ans+=1\nif a!=c and b!=c:ans+=1\nprint(ans)",
"a,b,c=map(int,input().split())",
"a",
"map(int,input().split())",
"map",
"int",
"input().split()",
"().split",
"()",
"input",
"split",
"b",
"c",
"ans=1",
"ans",
"1",
"if b!=a:ans+=1",
"b!=a",
"b",
"a",
"if a!=c and b!=c:ans+=1",
"a!=c and b!=c",
"a!=c",
"a",
"c",
"b!=c",
"b",
"c",
"print(ans)",
"print",
"ans",
"ans=1",
"1",
"ans",
"a,b,c=map(int,input().split())",
"map(int,input().split())",
"a",
"b,c=map(int,input().split())",
"map(int,input().split())",
"b",
"c=map(int,input().split())",
"map(int,input().split())",
"c"
] |
a,b,c=map(int,input().split())
ans=1
if b!=a:ans+=1
if a!=c and b!=c:ans+=1
print(ans)
|
[
7,
0,
13,
4,
13,
13,
4,
18,
4,
13,
13,
13,
13,
0,
13,
17,
14,
2,
40,
13,
13,
40,
13,
13,
14,
40,
13,
13,
0,
13,
17,
14,
2,
13,
13,
0,
13,
17,
14,
2,
2,
13,
13,
2,
13,
13,
0,
13,
17,
14,
40,
13,
13,
0,
13,
17,
4,
13,
13,
10,
17,
13,
10,
17,
13,
10,
17,
13,
10,
4,
13,
10,
17,
13,
10,
4,
13,
10,
4,
13,
10,
17,
13
] |
[
[
78,
2
],
[
78,
11
],
[
78,
12
],
[
63,
14
],
[
79,
19
],
[
76,
20
],
[
79,
22
],
[
70,
23
],
[
76,
26
],
[
70,
27
],
[
66,
29
],
[
76,
33
],
[
70,
34
],
[
72,
36
],
[
79,
41
],
[
76,
42
],
[
79,
44
],
[
70,
45
],
[
81,
47
],
[
76,
51
],
[
70,
52
],
[
60,
54
],
[
61,
58
],
[
82,
58
],
[
73,
58
],
[
67,
58
],
[
64,
58
],
[
60,
61
],
[
63,
64
],
[
66,
67
],
[
78,
70
],
[
72,
73
],
[
78,
76
],
[
78,
79
],
[
81,
82
]
] |
[
"a,b,c = map(int,input().split())\ncount = 0\nif a!=b and a!=c: \n if b!=c: \n count = 3\n elif b==c: \n count = 2\nelse:\n if a==b or a==c:\n count+=1\n if b!=c:\n count+=1\nprint(count)",
"a,b,c = map(int,input().split())",
"a",
"map(int,input().split())",
"map",
"int",
"input().split()",
"().split",
"()",
"input",
"split",
"b",
"c",
"count = 0",
"count",
"0",
"if a!=b and a!=c: \n if b!=c: \n count = 3\n elif b==c: \n count = 2\nelse:\n if a==b or a==c:\n count+=1\n if b!=c:\n count+=1",
"a!=b and a!=c",
"a!=b",
"a",
"b",
"a!=c",
"a",
"c",
"if b!=c: \n count = 3\n elif b==c: \n count = 2",
"b!=c",
"b",
"c",
"count = 3",
"count",
"3",
"elif b==c: \n count = 2",
"b==c",
"b",
"c",
"count = 2",
"count",
"2",
"if a==b or a==c:\n count+=1\n ",
"a==b or a==c",
"a==b",
"a",
"b",
"a==c",
"a",
"c",
"count+=1",
"count",
"1",
"if b!=c:\n count+=1",
"b!=c",
"b",
"c",
"count+=1",
"count",
"1",
"print(count)",
"print",
"count",
"count+=1",
"1",
"count",
"count = 0",
"0",
"count",
"count = 3",
"3",
"count",
"c = map(int,input().split())",
"map(int,input().split())",
"c",
"count = 2",
"2",
"count",
"b,c = map(int,input().split())",
"map(int,input().split())",
"b",
"a,b,c = map(int,input().split())",
"map(int,input().split())",
"a",
"count+=1",
"1",
"count"
] |
a,b,c = map(int,input().split())
count = 0
if a!=b and a!=c:
if b!=c:
count = 3
elif b==c:
count = 2
else:
if a==b or a==c:
count+=1
if b!=c:
count+=1
print(count)
|
[
7,
0,
13,
4,
13,
13,
4,
18,
4,
13,
13,
13,
13,
0,
13,
17,
4,
13,
4,
13,
13,
10,
4,
13,
10,
17,
13,
10,
4,
13,
10,
4,
13
] |
[
[
31,
2
],
[
31,
11
],
[
31,
12
],
[
25,
14
],
[
26,
20
],
[
31,
23
],
[
25,
26
],
[
31,
29
],
[
31,
32
]
] |
[
"a,b,c=map(int,input().split())\ns={a,b,c}\nprint(len(s))",
"a,b,c=map(int,input().split())",
"a",
"map(int,input().split())",
"map",
"int",
"input().split()",
"().split",
"()",
"input",
"split",
"b",
"c",
"s={a,b,c}",
"s",
"{a,b,c}",
"print(len(s))",
"print",
"len(s)",
"len",
"s",
"c=map(int,input().split())",
"map(int,input().split())",
"c",
"s={a,b,c}",
"{a,b,c}",
"s",
"a,b,c=map(int,input().split())",
"map(int,input().split())",
"a",
"b,c=map(int,input().split())",
"map(int,input().split())",
"b"
] |
a,b,c=map(int,input().split())
s={a,b,c}
print(len(s))
|
[
7,
0,
13,
4,
13,
0,
13,
4,
18,
13,
13,
0,
13,
17,
14,
2,
18,
13,
17,
18,
13,
17,
0,
13,
17,
14,
2,
18,
13,
17,
18,
13,
17,
0,
13,
17,
14,
2,
18,
13,
17,
18,
13,
17,
0,
13,
17,
4,
13,
4,
13,
2,
13,
17,
10,
17,
13,
10,
4,
13,
10,
17,
13,
10,
17,
13,
10,
4,
13,
10,
17,
13
] |
[
[
58,
2
],
[
67,
6
],
[
59,
9
],
[
70,
12
],
[
68,
17
],
[
68,
20
],
[
55,
23
],
[
68,
28
],
[
68,
31
],
[
61,
34
],
[
68,
39
],
[
68,
42
],
[
64,
45
],
[
65,
52
],
[
62,
52
],
[
56,
52
],
[
71,
52
],
[
55,
56
],
[
58,
59
],
[
61,
62
],
[
64,
65
],
[
67,
68
],
[
70,
71
]
] |
[
"s = input()\nl = s.split()\n \n \ncount = 6\n \nif l[0] == l[1]:\n count -= 1\nif l[1] == l[2]:\n count -= 1\nif l[2] == l[0]:\n count -= 1\n \nprint(int(count/2))",
"s = input()",
"s",
"input()",
"input",
"l = s.split()",
"l",
"s.split()",
"s.split",
"s",
"split",
"count = 6",
"count",
"6",
"if l[0] == l[1]:\n count -= 1",
"l[0] == l[1]",
"l[0]",
"l",
"0",
"l[1]",
"l",
"1",
"count -= 1",
"count",
"1",
"if l[1] == l[2]:\n count -= 1",
"l[1] == l[2]",
"l[1]",
"l",
"1",
"l[2]",
"l",
"2",
"count -= 1",
"count",
"1",
"if l[2] == l[0]:\n count -= 1\n ",
"l[2] == l[0]",
"l[2]",
"l",
"2",
"l[0]",
"l",
"0",
"count -= 1",
"count",
"1",
"print(int(count/2))",
"print",
"int(count/2)",
"int",
"count/2",
"count",
"2",
"count -= 1",
"1",
"count",
"s = input()",
"input()",
"s",
"count -= 1",
"1",
"count",
"count -= 1",
"1",
"count",
"l = s.split()",
"s.split()",
"l",
"count = 6",
"6",
"count"
] |
s = input()
l = s.split()
count = 6
if l[0] == l[1]:
count -= 1
if l[1] == l[2]:
count -= 1
if l[2] == l[0]:
count -= 1
print(int(count/2))
|
[
7,
0,
13,
4,
13,
13,
4,
18,
4,
13,
13,
13,
13,
14,
2,
2,
13,
13,
2,
13,
13,
4,
13,
17,
14,
2,
2,
13,
13,
40,
13,
13,
4,
13,
17,
14,
2,
40,
13,
13,
2,
13,
13,
4,
13,
17,
14,
2,
2,
13,
13,
40,
13,
13,
4,
13,
17,
14,
2,
40,
13,
13,
2,
13,
13,
4,
13,
17,
10,
4,
13,
10,
4,
13,
10,
4,
13
] |
[
[
75,
2
],
[
75,
11
],
[
75,
12
],
[
76,
16
],
[
70,
17
],
[
70,
19
],
[
73,
20
],
[
76,
27
],
[
70,
28
],
[
70,
30
],
[
73,
31
],
[
76,
38
],
[
70,
39
],
[
70,
41
],
[
73,
42
],
[
76,
49
],
[
73,
50
],
[
70,
52
],
[
73,
53
],
[
76,
60
],
[
73,
61
],
[
70,
63
],
[
73,
64
],
[
75,
70
],
[
75,
73
],
[
75,
76
]
] |
[
"a, b, c = map(int, input().split())\n\nif (a==b and b==c):\n print(\"1\")\n\nelif (a==b and b!=c):\n print(\"2\")\n\nelif (a!=b and b==c ):\n print(\"2\")\n\nelif (a==c and b!=c):\n print(\"2\")\n\nelif (a!=c and b==c):\n print(\"2\")\n\nelse: print(\"3\")",
"a, b, c = map(int, input().split())",
"a",
"map(int, input().split())",
"map",
"int",
"input().split()",
"().split",
"()",
"input",
"split",
"b",
"c",
"if (a==b and b==c):\n print(\"1\")\n\nelif (a==b and b!=c):\n print(\"2\")\n\nelif (a!=b and b==c ):\n print(\"2\")\n\nelif (a==c and b!=c):\n print(\"2\")\n\nelif (a!=c and b==c):\n print(\"2\")\n\nelse: print(\"3\")",
"a==b and b==c",
"a==b",
"a",
"b",
"b==c",
"b",
"c",
"print(\"1\")",
"print",
"\"1\"",
"elif (a==b and b!=c):\n print(\"2\")",
"a==b and b!=c",
"a==b",
"a",
"b",
"b!=c",
"b",
"c",
"print(\"2\")",
"print",
"\"2\"",
"elif (a!=b and b==c ):\n print(\"2\")",
"a!=b and b==c",
"a!=b",
"a",
"b",
"b==c",
"b",
"c",
"print(\"2\")",
"print",
"\"2\"",
"elif (a==c and b!=c):\n print(\"2\")",
"a==c and b!=c",
"a==c",
"a",
"c",
"b!=c",
"b",
"c",
"print(\"2\")",
"print",
"\"2\"",
"elif (a!=c and b==c):\n print(\"2\")",
"a!=c and b==c",
"a!=c",
"a",
"c",
"b==c",
"b",
"c",
"print(\"2\")",
"print",
"\"2\"",
"b, c = map(int, input().split())",
"map(int, input().split())",
"b",
"c = map(int, input().split())",
"map(int, input().split())",
"c",
"a, b, c = map(int, input().split())",
"map(int, input().split())",
"a"
] |
a, b, c = map(int, input().split())
if (a==b and b==c):
print("1")
elif (a==b and b!=c):
print("2")
elif (a!=b and b==c ):
print("2")
elif (a==c and b!=c):
print("2")
elif (a!=c and b==c):
print("2")
else: print("3")
|
[
7,
41,
28,
13,
4,
18,
4,
13,
13,
4,
4,
13,
13,
0,
13,
13,
13,
13,
14,
2,
2,
13,
13,
13,
4,
13,
17,
14,
2,
2,
2,
13,
13,
2,
13,
13,
2,
13,
13,
4,
13,
17,
4,
13,
17,
10,
13,
13,
10,
13,
13,
10,
13,
13
] |
[
[
4,
3
],
[
3,
12
],
[
52,
14
],
[
52,
16
],
[
52,
17
],
[
47,
21
],
[
53,
22
],
[
50,
23
],
[
47,
31
],
[
53,
32
],
[
47,
34
],
[
50,
35
],
[
53,
37
],
[
50,
38
],
[
52,
47
],
[
52,
50
],
[
52,
53
]
] |
[
"a, b, c = [int(i) for i in input().split()]\nif a == b == c:\n\tprint(1)\nelif a == b or a == c or b == c:\n\tprint(2)\nelse:\n\tprint(3)",
"int(i) for i in input().split()",
"for i in input().split()",
"i",
"input().split()",
"().split",
"()",
"input",
"split",
"for i in input().split()",
"int(i)",
"int",
"i",
"a, b, c = [int(i) for i in input().split()]",
"a",
"[int(i) for i in input().split()]",
"b",
"c",
"if a == b == c:\n\tprint(1)\nelif a == b or a == c or b == c:\n\tprint(2)\nelse:\n\tprint(3)",
"a == b == c",
"a == b",
"a",
"b",
"c",
"print(1)",
"print",
"1",
"elif a == b or a == c or b == c:\n\tprint(2)",
"a == b or a == c or b == c",
"a == b or a == c",
"a == b",
"a",
"b",
"a == c",
"a",
"c",
"b == c",
"b",
"c",
"print(2)",
"print",
"2",
"print(3)",
"print",
"3",
"a, b, c = [int(i) for i in input().split()]",
"[int(i) for i in input().split()]",
"a",
"c = [int(i) for i in input().split()]",
"[int(i) for i in input().split()]",
"c",
"b, c = [int(i) for i in input().split()]",
"[int(i) for i in input().split()]",
"b"
] |
a, b, c = [int(i) for i in input().split()]
if a == b == c:
print(1)
elif a == b or a == c or b == c:
print(2)
else:
print(3)
|
[
7,
0,
13,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
0,
13,
17,
28,
13,
13,
4,
18,
13,
13,
13,
17,
0,
18,
13,
13,
17,
4,
13,
4,
13,
13,
10,
17,
13,
10,
4,
13
] |
[
[
39,
2
],
[
36,
14
],
[
18,
17
],
[
40,
17
],
[
37,
21
],
[
17,
23
],
[
29,
26
],
[
37,
27
],
[
17,
28
],
[
37,
34
],
[
36,
37
],
[
39,
40
]
] |
[
"paint = list(map(int,input().split()))\ncnt = {}\n\nfor c in paint:\n cnt.setdefault(c,0)\n cnt[c] += 1\n \nprint(len(cnt))",
"paint = list(map(int,input().split()))",
"paint",
"list(map(int,input().split()))",
"list",
"map(int,input().split())",
"map",
"int",
"input().split()",
"().split",
"()",
"input",
"split",
"cnt = {}",
"cnt",
"{}",
"for c in paint:\n cnt.setdefault(c,0)\n cnt[c] += 1\n ",
"c",
"paint",
"cnt.setdefault(c,0)",
"cnt.setdefault",
"cnt",
"setdefault",
"c",
"0",
"cnt[c] += 1",
"cnt[c]",
"cnt",
"c",
"1",
"print(len(cnt))",
"print",
"len(cnt)",
"len",
"cnt",
"cnt = {}",
"{}",
"cnt",
"paint = list(map(int,input().split()))",
"list(map(int,input().split()))",
"paint"
] |
paint = list(map(int,input().split()))
cnt = {}
for c in paint:
cnt.setdefault(c,0)
cnt[c] += 1
print(len(cnt))
|
[
7,
0,
13,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
4,
13,
4,
13,
4,
13,
13,
10,
4,
13
] |
[
[
21,
2
],
[
22,
19
],
[
21,
22
]
] |
[
"List=list(map(int,input().split()))\nprint(len(set(List)))",
"List=list(map(int,input().split()))",
"List",
"list(map(int,input().split()))",
"list",
"map(int,input().split())",
"map",
"int",
"input().split()",
"().split",
"()",
"input",
"split",
"print(len(set(List)))",
"print",
"len(set(List))",
"len",
"set(List)",
"set",
"List",
"List=list(map(int,input().split()))",
"list(map(int,input().split()))",
"List"
] |
List=list(map(int,input().split()))
print(len(set(List)))
|
[
7,
15,
13,
15,
13,
4,
18,
13,
13,
17,
15,
15,
13,
15,
13,
0,
13,
2,
2,
17,
17,
17,
0,
13,
4,
13,
13,
4,
18,
4,
13,
13,
13,
13,
0,
13,
4,
13,
39,
13,
13,
13,
4,
13,
4,
13,
13,
10,
4,
13,
10,
4,
13,
10,
4,
13,
10,
4,
13,
10,
2,
13
] |
[
[
60,
16
],
[
54,
23
],
[
54,
32
],
[
54,
33
],
[
57,
35
],
[
58,
46
],
[
54,
49
],
[
54,
52
],
[
54,
55
],
[
57,
58
],
[
60,
61
]
] |
[
"import sys\nimport itertools\nsys.setrecursionlimit(1000000000)\nfrom heapq import heapify,heappop,heappush,heappushpop\nimport math\nimport collections\nMOD = 10**9+7\n\na,b,c = map(int,input().split())\ns = set([a,b,c])\nprint(len(s))",
"import sys",
"sys",
"import itertools",
"itertools",
"sys.setrecursionlimit(1000000000)",
"sys.setrecursionlimit",
"sys",
"setrecursionlimit",
"1000000000",
"from heapq import heapify,heappop,heappush,heappushpop",
"import math",
"math",
"import collections",
"collections",
"MOD = 10**9+7",
"MOD",
"10**9+7",
"10**9",
"10",
"9",
"7",
"a,b,c = map(int,input().split())",
"a",
"map(int,input().split())",
"map",
"int",
"input().split()",
"().split",
"()",
"input",
"split",
"b",
"c",
"s = set([a,b,c])",
"s",
"set([a,b,c])",
"set",
"[a,b,c]",
"a",
"b",
"c",
"print(len(s))",
"print",
"len(s)",
"len",
"s",
"a,b,c = map(int,input().split())",
"map(int,input().split())",
"a",
"b,c = map(int,input().split())",
"map(int,input().split())",
"b",
"c = map(int,input().split())",
"map(int,input().split())",
"c",
"s = set([a,b,c])",
"set([a,b,c])",
"s",
"MOD = 10**9+7",
"10**9+7",
"MOD"
] |
import sys
import itertools
sys.setrecursionlimit(1000000000)
from heapq import heapify,heappop,heappush,heappushpop
import math
import collections
MOD = 10**9+7
a,b,c = map(int,input().split())
s = set([a,b,c])
print(len(s))
|
[
7,
0,
13,
4,
13,
4,
18,
4,
13,
13,
4,
13,
4,
13,
13,
10,
4,
13
] |
[
[
16,
2
],
[
17,
14
],
[
16,
17
]
] |
[
"A = set(input().split())\nprint(len(A))",
"A = set(input().split())",
"A",
"set(input().split())",
"set",
"input().split()",
"().split",
"()",
"input",
"split",
"print(len(A))",
"print",
"len(A)",
"len",
"A",
"A = set(input().split())",
"set(input().split())",
"A"
] |
A = set(input().split())
print(len(A))
|
[
7,
0,
13,
4,
13,
13,
4,
18,
4,
13,
13,
13,
13,
0,
13,
4,
13,
39,
13,
13,
13,
4,
13,
4,
13,
13,
10,
4,
13,
10,
4,
13,
10,
4,
13,
10,
4,
13
] |
[
[
36,
2
],
[
36,
11
],
[
36,
12
],
[
33,
14
],
[
34,
25
],
[
36,
28
],
[
36,
31
],
[
33,
34
],
[
36,
37
]
] |
[
"a, b, c = map(int, input().split())\nm = set([a, b, c])\nprint(len(m))",
"a, b, c = map(int, input().split())",
"a",
"map(int, input().split())",
"map",
"int",
"input().split()",
"().split",
"()",
"input",
"split",
"b",
"c",
"m = set([a, b, c])",
"m",
"set([a, b, c])",
"set",
"[a, b, c]",
"a",
"b",
"c",
"print(len(m))",
"print",
"len(m)",
"len",
"m",
"c = map(int, input().split())",
"map(int, input().split())",
"c",
"b, c = map(int, input().split())",
"map(int, input().split())",
"b",
"m = set([a, b, c])",
"set([a, b, c])",
"m",
"a, b, c = map(int, input().split())",
"map(int, input().split())",
"a"
] |
a, b, c = map(int, input().split())
m = set([a, b, c])
print(len(m))
|
[
7,
0,
13,
4,
13,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
14,
2,
2,
18,
13,
17,
18,
13,
17,
18,
13,
17,
14,
2,
2,
18,
13,
17,
18,
13,
17,
2,
18,
13,
17,
18,
13,
17,
10,
4,
13
] |
[
[
44,
2
],
[
45,
19
],
[
45,
22
],
[
45,
25
],
[
45,
31
],
[
45,
34
],
[
45,
38
],
[
45,
41
],
[
44,
45
]
] |
[
"a = sorted(list(map(int, input().split())))\nif a[0]==a[1]==a[2]:print(1)\nelif a[0]==a[1] or a[1]==a[2]:print(2)\nelse :print(3)",
"a = sorted(list(map(int, input().split())))",
"a",
"sorted(list(map(int, input().split())))",
"sorted",
"list(map(int, input().split()))",
"list",
"map(int, input().split())",
"map",
"int",
"input().split()",
"().split",
"()",
"input",
"split",
"if a[0]==a[1]==a[2]:print(1)\nelif a[0]==a[1] or a[1]==a[2]:print(2)\nelse :print(3)",
"a[0]==a[1]==a[2]",
"a[0]==a[1]",
"a[0]",
"a",
"0",
"a[1]",
"a",
"1",
"a[2]",
"a",
"2",
"elif a[0]==a[1] or a[1]==a[2]:print(2)",
"a[0]==a[1] or a[1]==a[2]",
"a[0]==a[1]",
"a[0]",
"a",
"0",
"a[1]",
"a",
"1",
"a[1]==a[2]",
"a[1]",
"a",
"1",
"a[2]",
"a",
"2",
"a = sorted(list(map(int, input().split())))",
"sorted(list(map(int, input().split())))",
"a"
] |
a = sorted(list(map(int, input().split())))
if a[0]==a[1]==a[2]:print(1)
elif a[0]==a[1] or a[1]==a[2]:print(2)
else :print(3)
|
[
7,
12,
13,
0,
13,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
0,
13,
4,
13,
13,
4,
13,
4,
13,
13,
14,
2,
13,
17,
4,
13,
10,
12,
13
] |
[
[
5,
4
],
[
17,
16
],
[
4,
19
],
[
16,
24
],
[
33,
30
]
] |
[
"def main():\n c = list(map(int, input().split()))\n\n c_set = set(c)\n print(len(c_set))\n\n\nif __name__ == \"__main__\":\n main()",
"def main():\n c = list(map(int, input().split()))\n\n c_set = set(c)\n print(len(c_set))",
"main",
"c = list(map(int, input().split()))",
"c",
"list(map(int, input().split()))",
"list",
"map(int, input().split())",
"map",
"int",
"input().split()",
"().split",
"()",
"input",
"split",
"c_set = set(c)",
"c_set",
"set(c)",
"set",
"c",
"print(len(c_set))",
"print",
"len(c_set)",
"len",
"c_set",
"if __name__ == \"__main__\":\n main()",
"__name__ == \"__main__\"",
"__name__",
"\"__main__\"",
"main()",
"main",
"def main():\n c = list(map(int, input().split()))\n\n c_set = set(c)\n print(len(c_set))",
"def main():\n c = list(map(int, input().split()))\n\n c_set = set(c)\n print(len(c_set))",
"main"
] |
def main():
c = list(map(int, input().split()))
c_set = set(c)
print(len(c_set))
if __name__ == "__main__":
main()
|
[
7,
15,
13,
0,
13,
18,
18,
13,
13,
13,
0,
13,
4,
13,
13,
4,
18,
4,
13,
13,
13,
13,
0,
13,
4,
13,
4,
13,
39,
13,
13,
13,
4,
13,
13,
10,
4,
13,
10,
18,
13,
10,
4,
13,
10,
4,
13,
10,
4,
13
] |
[
[
39,
4
],
[
48,
11
],
[
40,
18
],
[
48,
20
],
[
48,
21
],
[
36,
23
],
[
37,
34
],
[
36,
37
],
[
39,
40
],
[
48,
43
],
[
48,
46
],
[
48,
49
]
] |
[
"# Python3 (3.4.3)\nimport sys\ninput = sys.stdin.readline\n\n# -------------------------------------------------------------\n# function\n# -------------------------------------------------------------\n\n\n# -------------------------------------------------------------\n# main\n# -------------------------------------------------------------\nA,B,C = map(int,input().split())\nans = len(set([A,B,C]))\n\nprint(ans)",
"import sys",
"sys",
"input = sys.stdin.readline",
"input",
"sys.stdin.readline",
"sys.stdin",
"sys",
"stdin",
"readline",
"A,B,C = map(int,input().split())",
"A",
"map(int,input().split())",
"map",
"int",
"input().split()",
"().split",
"()",
"input",
"split",
"B",
"C",
"ans = len(set([A,B,C]))",
"ans",
"len(set([A,B,C]))",
"len",
"set([A,B,C])",
"set",
"[A,B,C]",
"A",
"B",
"C",
"print(ans)",
"print",
"ans",
"ans = len(set([A,B,C]))",
"len(set([A,B,C]))",
"ans",
"input = sys.stdin.readline",
"sys.stdin.readline",
"input",
"C = map(int,input().split())",
"map(int,input().split())",
"C",
"A,B,C = map(int,input().split())",
"map(int,input().split())",
"A",
"B,C = map(int,input().split())",
"map(int,input().split())",
"B"
] |
# Python3 (3.4.3)
import sys
input = sys.stdin.readline
# -------------------------------------------------------------
# function
# -------------------------------------------------------------
# -------------------------------------------------------------
# main
# -------------------------------------------------------------
A,B,C = map(int,input().split())
ans = len(set([A,B,C]))
print(ans)
|
[
7,
0,
13,
4,
13,
13,
4,
18,
4,
13,
13,
0,
13,
4,
13,
4,
13,
13,
4,
13,
4,
13,
13,
10,
4,
13,
10,
4,
13
] |
[
[
27,
2
],
[
24,
12
],
[
28,
17
],
[
25,
22
],
[
24,
25
],
[
27,
28
]
] |
[
"list_penki = map(int,input().split())\n\nset_list_penki = list(set(list_penki))\n\nprint(len(set_list_penki))",
"list_penki = map(int,input().split())",
"list_penki",
"map(int,input().split())",
"map",
"int",
"input().split()",
"().split",
"()",
"input",
"split",
"set_list_penki = list(set(list_penki))",
"set_list_penki",
"list(set(list_penki))",
"list",
"set(list_penki)",
"set",
"list_penki",
"print(len(set_list_penki))",
"print",
"len(set_list_penki)",
"len",
"set_list_penki",
"set_list_penki = list(set(list_penki))",
"list(set(list_penki))",
"set_list_penki",
"list_penki = map(int,input().split())",
"map(int,input().split())",
"list_penki"
] |
list_penki = map(int,input().split())
set_list_penki = list(set(list_penki))
print(len(set_list_penki))
|
[
7,
0,
13,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
0,
13,
4,
13,
4,
13,
13,
4,
13,
4,
13,
13,
10,
4,
13,
10,
4,
13
] |
[
[
26,
2
],
[
29,
14
],
[
27,
19
],
[
30,
24
],
[
26,
27
],
[
29,
30
]
] |
[
"a = list(map(int, input().split()))\nb = list(set(a))\nprint(len(b))",
"a = list(map(int, input().split()))",
"a",
"list(map(int, input().split()))",
"list",
"map(int, input().split())",
"map",
"int",
"input().split()",
"().split",
"()",
"input",
"split",
"b = list(set(a))",
"b",
"list(set(a))",
"list",
"set(a)",
"set",
"a",
"print(len(b))",
"print",
"len(b)",
"len",
"b",
"a = list(map(int, input().split()))",
"list(map(int, input().split()))",
"a",
"b = list(set(a))",
"list(set(a))",
"b"
] |
a = list(map(int, input().split()))
b = list(set(a))
print(len(b))
|
[
7,
0,
13,
4,
13,
13,
4,
18,
4,
13,
13,
13,
13,
4,
13,
4,
13,
4,
13,
39,
13,
13,
13,
10,
4,
13,
10,
4,
13,
10,
4,
13
] |
[
[
30,
2
],
[
30,
11
],
[
30,
12
],
[
30,
25
],
[
30,
28
],
[
30,
31
]
] |
[
"a, b, c = map(int, input().split())\n\nprint(len(set([a, b, c])))",
"a, b, c = map(int, input().split())",
"a",
"map(int, input().split())",
"map",
"int",
"input().split()",
"().split",
"()",
"input",
"split",
"b",
"c",
"print(len(set([a, b, c])))",
"print",
"len(set([a, b, c]))",
"len",
"set([a, b, c])",
"set",
"[a, b, c]",
"a",
"b",
"c",
"c = map(int, input().split())",
"map(int, input().split())",
"c",
"a, b, c = map(int, input().split())",
"map(int, input().split())",
"a",
"b, c = map(int, input().split())",
"map(int, input().split())",
"b"
] |
a, b, c = map(int, input().split())
print(len(set([a, b, c])))
|
[
7,
41,
28,
13,
4,
18,
4,
13,
13,
4,
4,
13,
13,
0,
13,
13,
13,
13,
14,
2,
13,
13,
14,
2,
13,
13,
4,
13,
17,
4,
13,
17,
14,
2,
13,
13,
4,
13,
17,
14,
2,
13,
13,
4,
13,
17,
4,
13,
17,
10,
13,
13,
10,
13,
13,
10,
13,
13
] |
[
[
4,
3
],
[
3,
12
],
[
56,
14
],
[
56,
16
],
[
56,
17
],
[
51,
20
],
[
57,
21
],
[
51,
24
],
[
54,
25
],
[
51,
34
],
[
54,
35
],
[
57,
41
],
[
54,
42
],
[
56,
51
],
[
56,
54
],
[
56,
57
]
] |
[
"a,b,c = (int(x) for x in input().split())\nif a == b:\n if a == c:\n print (1)\n else:\n print (2)\nelse:\n if a == c:\n print (2)\n else:\n if b == c:\n print (2)\n else:\n print (3)",
"int(x) for x in input().split()",
"for x in input().split()",
"x",
"input().split()",
"().split",
"()",
"input",
"split",
"for x in input().split()",
"int(x)",
"int",
"x",
"a,b,c = (int(x) for x in input().split())",
"a",
"(int(x) for x in input().split())",
"b",
"c",
"if a == b:\n if a == c:\n print (1)\n else:\n print (2)\nelse:\n if a == c:\n print (2)\n else:\n if b == c:\n print (2)\n else:\n print (3)",
"a == b",
"a",
"b",
"if a == c:\n print (1)\n else:\n print (2)",
"a == c",
"a",
"c",
"print (1)",
"print",
"1",
"print (2)",
"print",
"2",
"if a == c:\n print (2)\n else:\n if b == c:\n print (2)\n else:\n print (3)",
"a == c",
"a",
"c",
"print (2)",
"print",
"2",
"if b == c:\n print (2)\n else:\n print (3)",
"b == c",
"b",
"c",
"print (2)",
"print",
"2",
"print (3)",
"print",
"3",
"a,b,c = (int(x) for x in input().split())",
"(int(x) for x in input().split())",
"a",
"c = (int(x) for x in input().split())",
"(int(x) for x in input().split())",
"c",
"b,c = (int(x) for x in input().split())",
"(int(x) for x in input().split())",
"b"
] |
a,b,c = (int(x) for x in input().split())
if a == b:
if a == c:
print (1)
else:
print (2)
else:
if a == c:
print (2)
else:
if b == c:
print (2)
else:
print (3)
|
[
7,
12,
13,
4,
13,
4,
13,
4,
13,
4,
18,
4,
13,
13,
14,
2,
13,
17,
4,
13,
10,
12,
13
] |
[
[
22,
19
]
] |
[
"def solve():\n print(len(set(input().split())))\n\n\nif __name__ == \"__main__\":\n solve()",
"def solve():\n print(len(set(input().split())))",
"solve",
"print(len(set(input().split())))",
"print",
"len(set(input().split()))",
"len",
"set(input().split())",
"set",
"input().split()",
"().split",
"()",
"input",
"split",
"if __name__ == \"__main__\":\n solve()",
"__name__ == \"__main__\"",
"__name__",
"\"__main__\"",
"solve()",
"solve",
"def solve():\n print(len(set(input().split())))",
"def solve():\n print(len(set(input().split())))",
"solve"
] |
def solve():
print(len(set(input().split())))
if __name__ == "__main__":
solve()
|
[
7,
15,
13,
0,
13,
4,
13,
4,
18,
4,
13,
13,
0,
13,
4,
13,
4,
18,
13,
13,
13,
4,
13,
13,
10,
4,
13,
10,
4,
13
] |
[
[
28,
4
],
[
25,
13
],
[
29,
20
],
[
26,
23
],
[
25,
26
],
[
28,
29
]
] |
[
"import collections\n\na = list(input().split())\nans = len(collections.Counter(a))\nprint(ans)",
"import collections",
"collections",
"a = list(input().split())",
"a",
"list(input().split())",
"list",
"input().split()",
"().split",
"()",
"input",
"split",
"ans = len(collections.Counter(a))",
"ans",
"len(collections.Counter(a))",
"len",
"collections.Counter(a)",
"collections.Counter",
"collections",
"Counter",
"a",
"print(ans)",
"print",
"ans",
"ans = len(collections.Counter(a))",
"len(collections.Counter(a))",
"ans",
"a = list(input().split())",
"list(input().split())",
"a"
] |
import collections
a = list(input().split())
ans = len(collections.Counter(a))
print(ans)
|
[
7,
0,
13,
4,
13,
4,
18,
4,
13,
13,
0,
13,
17,
28,
13,
4,
13,
17,
4,
13,
13,
28,
13,
4,
13,
17,
13,
14,
2,
18,
13,
13,
18,
13,
13,
0,
18,
13,
13,
17,
14,
40,
18,
13,
13,
17,
0,
13,
2,
13,
17,
4,
13,
13,
10,
2,
13,
10,
17,
13,
10,
4,
13
] |
[
[
61,
2
],
[
58,
11
],
[
15,
14
],
[
62,
20
],
[
23,
22
],
[
14,
26
],
[
36,
29
],
[
62,
30
],
[
14,
31
],
[
62,
33
],
[
22,
34
],
[
39,
36
],
[
62,
37
],
[
14,
38
],
[
36,
42
],
[
62,
43
],
[
14,
44
],
[
55,
47
],
[
59,
49
],
[
56,
49
],
[
56,
53
],
[
59,
53
],
[
55,
56
],
[
58,
59
],
[
61,
62
]
] |
[
"data=list(input().split())\ns=1\nfor i in range(1,len(data)):\n for j in range(0,i):\n if data[i]==data[j]:\n data[i]=-1\n if data[i]!=-1:\n s=s+1 \nprint(s)\n",
"data=list(input().split())",
"data",
"list(input().split())",
"list",
"input().split()",
"().split",
"()",
"input",
"split",
"s=1",
"s",
"1",
"for i in range(1,len(data)):\n for j in range(0,i):\n if data[i]==data[j]:\n data[i]=-1\n if data[i]!=-1:\n s=s+1 ",
"i",
"range(1,len(data))",
"range",
"1",
"len(data)",
"len",
"data",
"for j in range(0,i):\n if data[i]==data[j]:\n data[i]=-1\n ",
"j",
"range(0,i)",
"range",
"0",
"i",
"if data[i]==data[j]:\n data[i]=-1\n ",
"data[i]==data[j]",
"data[i]",
"data",
"i",
"data[j]",
"data",
"j",
"data[i]=-1",
"data[i]",
"data",
"i",
"-1",
"if data[i]!=-1:\n s=s+1 ",
"data[i]!=-1",
"data[i]",
"data",
"i",
"-1",
"s=s+1",
"s",
"s+1",
"s",
"1",
"print(s)",
"print",
"s",
"s=s+1",
"s+1",
"s",
"s=1",
"1",
"s",
"data=list(input().split())",
"list(input().split())",
"data"
] |
data=list(input().split())
s=1
for i in range(1,len(data)):
for j in range(0,i):
if data[i]==data[j]:
data[i]=-1
if data[i]!=-1:
s=s+1
print(s)
|
[
7,
0,
13,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
4,
13,
4,
13,
4,
13,
13,
10,
4,
13
] |
[
[
21,
2
],
[
22,
19
],
[
21,
22
]
] |
[
"li = list(map(int, input().split()))\nprint(len(set(li)))",
"li = list(map(int, input().split()))",
"li",
"list(map(int, input().split()))",
"list",
"map(int, input().split())",
"map",
"int",
"input().split()",
"().split",
"()",
"input",
"split",
"print(len(set(li)))",
"print",
"len(set(li))",
"len",
"set(li)",
"set",
"li",
"li = list(map(int, input().split()))",
"list(map(int, input().split()))",
"li"
] |
li = list(map(int, input().split()))
print(len(set(li)))
|
[
7,
0,
13,
4,
13,
13,
4,
18,
4,
13,
13,
0,
13,
4,
13,
13,
4,
13,
4,
13,
13,
10,
4,
13,
10,
4,
13
] |
[
[
25,
2
],
[
22,
12
],
[
26,
15
],
[
23,
20
],
[
22,
23
],
[
25,
26
]
] |
[
"l = map(int, input().split())\ns = set(l)\nprint(len(s))",
"l = map(int, input().split())",
"l",
"map(int, input().split())",
"map",
"int",
"input().split()",
"().split",
"()",
"input",
"split",
"s = set(l)",
"s",
"set(l)",
"set",
"l",
"print(len(s))",
"print",
"len(s)",
"len",
"s",
"s = set(l)",
"set(l)",
"s",
"l = map(int, input().split())",
"map(int, input().split())",
"l"
] |
l = map(int, input().split())
s = set(l)
print(len(s))
|
[
7,
0,
13,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
4,
13,
4,
13,
13,
10,
4,
13
] |
[
[
19,
2
],
[
20,
17
],
[
19,
20
]
] |
[
"a = set(map(int,input().split()))\n\nprint(len(a))\n",
"a = set(map(int,input().split()))",
"a",
"set(map(int,input().split()))",
"set",
"map(int,input().split())",
"map",
"int",
"input().split()",
"().split",
"()",
"input",
"split",
"print(len(a))",
"print",
"len(a)",
"len",
"a",
"a = set(map(int,input().split()))",
"set(map(int,input().split()))",
"a"
] |
a = set(map(int,input().split()))
print(len(a))
|
[
7,
0,
13,
4,
13,
4,
18,
4,
13,
13,
4,
13,
4,
13,
13,
10,
4,
13
] |
[
[
16,
2
],
[
17,
14
],
[
16,
17
]
] |
[
"a=set(input().split())\nprint(len(a))",
"a=set(input().split())",
"a",
"set(input().split())",
"set",
"input().split()",
"().split",
"()",
"input",
"split",
"print(len(a))",
"print",
"len(a)",
"len",
"a",
"a=set(input().split())",
"set(input().split())",
"a"
] |
a=set(input().split())
print(len(a))
|
[
7,
0,
13,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
0,
13,
17,
28,
13,
4,
13,
4,
13,
13,
14,
2,
18,
13,
13,
18,
13,
39,
2,
13,
17,
9,
0,
13,
17,
4,
13,
13,
10,
17,
13,
10,
17,
13,
10,
4,
13
] |
[
[
48,
2
],
[
45,
14
],
[
18,
17
],
[
49,
22
],
[
49,
26
],
[
17,
27
],
[
49,
29
],
[
17,
32
],
[
42,
36
],
[
43,
40
],
[
46,
40
],
[
42,
43
],
[
45,
46
],
[
48,
49
]
] |
[
"list = list(map(int,input().split()))\n\ncounter = 0\n\nfor i in range(len(list)):\n if list[i] in list[i+1:]:\n continue\n else:\n counter += 1\n\nprint(counter)",
"list = list(map(int,input().split()))",
"list",
"list(map(int,input().split()))",
"list",
"map(int,input().split())",
"map",
"int",
"input().split()",
"().split",
"()",
"input",
"split",
"counter = 0",
"counter",
"0",
"for i in range(len(list)):\n if list[i] in list[i+1:]:\n continue\n else:\n counter += 1",
"i",
"range(len(list))",
"range",
"len(list)",
"len",
"list",
"if list[i] in list[i+1:]:\n continue\n else:\n counter += 1",
"list[i] in list[i+1:]",
"list[i]",
"list",
"i",
"list[i+1:]",
"list",
"i+1:",
"i+1",
"i",
"1",
"continue",
"counter += 1",
"counter",
"1",
"print(counter)",
"print",
"counter",
"counter += 1",
"1",
"counter",
"counter = 0",
"0",
"counter",
"list = list(map(int,input().split()))",
"list(map(int,input().split()))",
"list"
] |
list = list(map(int,input().split()))
counter = 0
for i in range(len(list)):
if list[i] in list[i+1:]:
continue
else:
counter += 1
print(counter)
|
[
7,
15,
13,
12,
13,
12,
13,
0,
13,
4,
13,
13,
4,
18,
4,
13,
13,
13,
13,
0,
13,
17,
4,
13,
4,
13,
13,
14,
2,
13,
17,
4,
13,
10,
12,
13,
10,
12,
13
] |
[
[
9,
8
],
[
35,
15
],
[
9,
17
],
[
9,
18
],
[
21,
20
],
[
20,
26
],
[
38,
32
]
] |
[
"import sys\ndef input(): return sys.stdin.readline().strip()\n\ndef main():\n a, b, c = map(int, input().split())\n ans = {a, b, c}\n print(len(ans))\n\n\n\n\n\n\nif __name__ == \"__main__\":\n main()",
"import sys",
"sys",
"def input(): return sys.stdin.readline().strip()",
"input",
"def main():\n a, b, c = map(int, input().split())\n ans = {a, b, c}\n print(len(ans))",
"main",
"a, b, c = map(int, input().split())",
"a",
"map(int, input().split())",
"map",
"int",
"input().split()",
"().split",
"()",
"input",
"split",
"b",
"c",
"ans = {a, b, c}",
"ans",
"{a, b, c}",
"print(len(ans))",
"print",
"len(ans)",
"len",
"ans",
"if __name__ == \"__main__\":\n main()",
"__name__ == \"__main__\"",
"__name__",
"\"__main__\"",
"main()",
"main",
"def input(): return sys.stdin.readline().strip()",
"def input(): return sys.stdin.readline().strip()",
"input",
"def main():\n a, b, c = map(int, input().split())\n ans = {a, b, c}\n print(len(ans))",
"def main():\n a, b, c = map(int, input().split())\n ans = {a, b, c}\n print(len(ans))",
"main"
] |
import sys
def input(): return sys.stdin.readline().strip()
def main():
a, b, c = map(int, input().split())
ans = {a, b, c}
print(len(ans))
if __name__ == "__main__":
main()
|
[
7,
0,
13,
4,
13,
13,
4,
18,
4,
13,
13,
13,
13,
0,
13,
4,
13,
4,
18,
13,
13,
13,
4,
18,
13,
13,
13,
4,
18,
13,
13,
13,
4,
13,
4,
13,
13,
10,
4,
13,
10,
4,
13,
10,
4,
13,
10,
4,
13
] |
[
[
47,
2
],
[
47,
11
],
[
47,
12
],
[
38,
14
],
[
39,
19
],
[
45,
21
],
[
39,
24
],
[
48,
26
],
[
39,
29
],
[
42,
31
],
[
39,
36
],
[
38,
39
],
[
47,
42
],
[
47,
45
],
[
47,
48
]
] |
[
"a, b, c = map(int, input().split())\nst = set()\nst.add(a)\nst.add(b)\nst.add(c)\nprint(len(st))",
"a, b, c = map(int, input().split())",
"a",
"map(int, input().split())",
"map",
"int",
"input().split()",
"().split",
"()",
"input",
"split",
"b",
"c",
"st = set()",
"st",
"set()",
"set",
"st.add(a)",
"st.add",
"st",
"add",
"a",
"st.add(b)",
"st.add",
"st",
"add",
"b",
"st.add(c)",
"st.add",
"st",
"add",
"c",
"print(len(st))",
"print",
"len(st)",
"len",
"st",
"st = set()",
"set()",
"st",
"c = map(int, input().split())",
"map(int, input().split())",
"c",
"a, b, c = map(int, input().split())",
"map(int, input().split())",
"a",
"b, c = map(int, input().split())",
"map(int, input().split())",
"b"
] |
a, b, c = map(int, input().split())
st = set()
st.add(a)
st.add(b)
st.add(c)
print(len(st))
|
[
7,
0,
13,
4,
13,
0,
13,
4,
13,
4,
18,
4,
13,
13,
28,
13,
13,
4,
18,
13,
13,
13,
4,
13,
4,
13,
13,
10,
4,
13,
10,
4,
13
] |
[
[
31,
2
],
[
28,
6
],
[
16,
15
],
[
29,
15
],
[
32,
19
],
[
15,
21
],
[
32,
26
],
[
28,
29
],
[
31,
32
]
] |
[
"s = set()\nl = list(input().split())\nfor e in l:\n s.add(e)\nprint(len(s))",
"s = set()",
"s",
"set()",
"set",
"l = list(input().split())",
"l",
"list(input().split())",
"list",
"input().split()",
"().split",
"()",
"input",
"split",
"for e in l:\n s.add(e)",
"e",
"l",
"s.add(e)",
"s.add",
"s",
"add",
"e",
"print(len(s))",
"print",
"len(s)",
"len",
"s",
"l = list(input().split())",
"list(input().split())",
"l",
"s = set()",
"set()",
"s"
] |
s = set()
l = list(input().split())
for e in l:
s.add(e)
print(len(s))
|
[
7,
0,
13,
4,
18,
4,
13,
13,
0,
13,
4,
13,
13,
4,
13,
4,
13,
13,
10,
4,
13,
10,
4,
13
] |
[
[
22,
2
],
[
19,
9
],
[
23,
12
],
[
20,
17
],
[
19,
20
],
[
22,
23
]
] |
[
"list = (input().split())\n\nA=set(list)\n\nprint(len(A))",
"list = (input().split())",
"list",
"input().split()",
"().split",
"()",
"input",
"split",
"A=set(list)",
"A",
"set(list)",
"set",
"list",
"print(len(A))",
"print",
"len(A)",
"len",
"A",
"A=set(list)",
"set(list)",
"A",
"list = (input().split())",
"input().split()",
"list"
] |
list = (input().split())
A=set(list)
print(len(A))
|
[
7,
0,
13,
4,
13,
13,
4,
18,
4,
13,
13,
13,
13,
0,
13,
4,
13,
39,
2,
13,
13,
2,
13,
13,
2,
13,
13,
4,
13,
18,
39,
17,
17,
17,
17,
13,
10,
4,
13,
10,
4,
13,
10,
4,
13,
10,
4,
13
] |
[
[
46,
2
],
[
46,
11
],
[
46,
12
],
[
43,
14
],
[
38,
19
],
[
41,
20
],
[
41,
22
],
[
47,
23
],
[
47,
25
],
[
38,
26
],
[
44,
35
],
[
46,
38
],
[
46,
41
],
[
43,
44
],
[
46,
47
]
] |
[
"a,b,c=map(int,input().split())\n \nl=sum([a==b,b==c,c==a])\nprint([3,2,0,1][l])",
"a,b,c=map(int,input().split())",
"a",
"map(int,input().split())",
"map",
"int",
"input().split()",
"().split",
"()",
"input",
"split",
"b",
"c",
"l=sum([a==b,b==c,c==a])",
"l",
"sum([a==b,b==c,c==a])",
"sum",
"[a==b,b==c,c==a]",
"a==b",
"a",
"b",
"b==c",
"b",
"c",
"c==a",
"c",
"a",
"print([3,2,0,1][l])",
"print",
"[3,2,0,1][l]",
"[3,2,0,1]",
"3",
"2",
"0",
"1",
"l",
"a,b,c=map(int,input().split())",
"map(int,input().split())",
"a",
"b,c=map(int,input().split())",
"map(int,input().split())",
"b",
"l=sum([a==b,b==c,c==a])",
"sum([a==b,b==c,c==a])",
"l",
"c=map(int,input().split())",
"map(int,input().split())",
"c"
] |
a,b,c=map(int,input().split())
l=sum([a==b,b==c,c==a])
print([3,2,0,1][l])
|
[
7,
0,
13,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
0,
13,
4,
13,
13,
4,
13,
4,
13,
13,
10,
4,
13,
10,
4,
13
] |
[
[
27,
2
],
[
24,
14
],
[
28,
17
],
[
25,
22
],
[
24,
25
],
[
27,
28
]
] |
[
"A = list(map(int,input().split()))\nB = set(A)\nprint(len(B))",
"A = list(map(int,input().split()))",
"A",
"list(map(int,input().split()))",
"list",
"map(int,input().split())",
"map",
"int",
"input().split()",
"().split",
"()",
"input",
"split",
"B = set(A)",
"B",
"set(A)",
"set",
"A",
"print(len(B))",
"print",
"len(B)",
"len",
"B",
"B = set(A)",
"set(A)",
"B",
"A = list(map(int,input().split()))",
"list(map(int,input().split()))",
"A"
] |
A = list(map(int,input().split()))
B = set(A)
print(len(B))
|
[
7,
0,
13,
4,
13,
13,
4,
18,
4,
13,
13,
13,
13,
4,
13,
4,
13,
17,
10,
4,
13,
10,
4,
13,
10,
4,
13
] |
[
[
25,
2
],
[
25,
11
],
[
25,
12
],
[
25,
20
],
[
25,
23
],
[
25,
26
]
] |
[
"a, b, c = map(int, input().split())\n\nprint(len({a, b, c}))",
"a, b, c = map(int, input().split())",
"a",
"map(int, input().split())",
"map",
"int",
"input().split()",
"().split",
"()",
"input",
"split",
"b",
"c",
"print(len({a, b, c}))",
"print",
"len({a, b, c})",
"len",
"{a, b, c}",
"c = map(int, input().split())",
"map(int, input().split())",
"c",
"b, c = map(int, input().split())",
"map(int, input().split())",
"b",
"a, b, c = map(int, input().split())",
"map(int, input().split())",
"a"
] |
a, b, c = map(int, input().split())
print(len({a, b, c}))
|
[
7,
15,
13,
0,
13,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
4,
13,
4,
13,
4,
13,
13,
10,
4,
13
] |
[
[
23,
4
],
[
24,
21
],
[
23,
24
]
] |
[
"import numpy as np\na = list(map(int, input().split()))\n\n\nprint(len(set(a)))",
"import numpy as np",
"numpy",
"a = list(map(int, input().split()))",
"a",
"list(map(int, input().split()))",
"list",
"map(int, input().split())",
"map",
"int",
"input().split()",
"().split",
"()",
"input",
"split",
"print(len(set(a)))",
"print",
"len(set(a))",
"len",
"set(a)",
"set",
"a",
"a = list(map(int, input().split()))",
"list(map(int, input().split()))",
"a"
] |
import numpy as np
a = list(map(int, input().split()))
print(len(set(a)))
|
[
7,
0,
13,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
0,
13,
4,
13,
13,
4,
13,
4,
13,
13,
10,
4,
13,
10,
4,
13
] |
[
[
27,
2
],
[
24,
14
],
[
28,
17
],
[
25,
22
],
[
28,
22
],
[
24,
25
],
[
27,
28
]
] |
[
"a = list(map(int, input().split()))\na = set(a)\nprint(len(a))",
"a = list(map(int, input().split()))",
"a",
"list(map(int, input().split()))",
"list",
"map(int, input().split())",
"map",
"int",
"input().split()",
"().split",
"()",
"input",
"split",
"a = set(a)",
"a",
"set(a)",
"set",
"a",
"print(len(a))",
"print",
"len(a)",
"len",
"a",
"a = set(a)",
"set(a)",
"a",
"a = list(map(int, input().split()))",
"list(map(int, input().split()))",
"a"
] |
a = list(map(int, input().split()))
a = set(a)
print(len(a))
|
[
7,
0,
13,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
4,
18,
13,
13,
14,
2,
2,
18,
13,
17,
18,
13,
17,
2,
18,
13,
17,
18,
13,
17,
14,
2,
2,
18,
13,
17,
18,
13,
17,
18,
13,
17,
4,
13,
17,
4,
13,
17,
4,
13,
17,
10,
4,
13
] |
[
[
55,
2
],
[
56,
15
],
[
56,
21
],
[
56,
24
],
[
56,
28
],
[
56,
31
],
[
56,
37
],
[
56,
40
],
[
56,
43
],
[
55,
56
]
] |
[
"x=list(map(int,input().split()))\nx.sort()\nif (x[0]==x[1])or(x[1]==x[2]):\n if x[0] == x[1] == x[2]:\n print(1)\n else:\n print(2)\nelse:\n print(3)",
"x=list(map(int,input().split()))",
"x",
"list(map(int,input().split()))",
"list",
"map(int,input().split())",
"map",
"int",
"input().split()",
"().split",
"()",
"input",
"split",
"x.sort()",
"x.sort",
"x",
"sort",
"if (x[0]==x[1])or(x[1]==x[2]):\n if x[0] == x[1] == x[2]:\n print(1)\n else:\n print(2)\nelse:\n print(3)",
"(x[0]==x[1])or(x[1]==x[2])",
"x[0]==x[1]",
"x[0]",
"x",
"0",
"x[1]",
"x",
"1",
"x[1]==x[2]",
"x[1]",
"x",
"1",
"x[2]",
"x",
"2",
"if x[0] == x[1] == x[2]:\n print(1)\n else:\n print(2)",
"x[0] == x[1] == x[2]",
"x[0] == x[1]",
"x[0]",
"x",
"0",
"x[1]",
"x",
"1",
"x[2]",
"x",
"2",
"print(1)",
"print",
"1",
"print(2)",
"print",
"2",
"print(3)",
"print",
"3",
"x=list(map(int,input().split()))",
"list(map(int,input().split()))",
"x"
] |
x=list(map(int,input().split()))
x.sort()
if (x[0]==x[1])or(x[1]==x[2]):
if x[0] == x[1] == x[2]:
print(1)
else:
print(2)
else:
print(3)
|
[
7,
41,
28,
13,
4,
18,
4,
13,
13,
4,
4,
13,
13,
0,
13,
13,
0,
13,
4,
13,
28,
13,
13,
4,
18,
13,
13,
13,
4,
13,
4,
13,
13,
10,
4,
13,
10,
13,
13
] |
[
[
4,
3
],
[
3,
12
],
[
37,
14
],
[
34,
17
],
[
22,
21
],
[
38,
21
],
[
35,
25
],
[
21,
27
],
[
35,
32
],
[
34,
35
],
[
37,
38
]
] |
[
"a = [int(i) for i in input().split()]\nans = set()\nfor i in a:\n ans.add(i)\nprint(len(ans))",
"int(i) for i in input().split()",
"for i in input().split()",
"i",
"input().split()",
"().split",
"()",
"input",
"split",
"for i in input().split()",
"int(i)",
"int",
"i",
"a = [int(i) for i in input().split()]",
"a",
"[int(i) for i in input().split()]",
"ans = set()",
"ans",
"set()",
"set",
"for i in a:\n ans.add(i)",
"i",
"a",
"ans.add(i)",
"ans.add",
"ans",
"add",
"i",
"print(len(ans))",
"print",
"len(ans)",
"len",
"ans",
"ans = set()",
"set()",
"ans",
"a = [int(i) for i in input().split()]",
"[int(i) for i in input().split()]",
"a"
] |
a = [int(i) for i in input().split()]
ans = set()
for i in a:
ans.add(i)
print(len(ans))
|
[
7,
0,
13,
4,
13,
0,
13,
4,
18,
13,
13,
0,
13,
4,
13,
13,
28,
13,
4,
13,
13,
0,
18,
13,
13,
4,
13,
18,
13,
13,
0,
13,
17,
28,
13,
4,
13,
13,
0,
13,
18,
13,
13,
14,
40,
2,
13,
13,
0,
18,
13,
13,
17,
0,
18,
13,
13,
2,
18,
13,
13,
17,
4,
13,
4,
13,
13,
10,
4,
13,
10,
17,
13,
10,
4,
13,
10,
18,
13,
10,
4,
13
] |
[
[
80,
2
],
[
68,
6
],
[
81,
9
],
[
74,
12
],
[
69,
15
],
[
18,
17
],
[
75,
20
],
[
25,
22
],
[
69,
23
],
[
17,
24
],
[
22,
27
],
[
69,
28
],
[
17,
29
],
[
71,
31
],
[
35,
34
],
[
75,
37
],
[
77,
39
],
[
22,
40
],
[
69,
41
],
[
34,
42
],
[
78,
46
],
[
72,
47
],
[
52,
49
],
[
72,
50
],
[
78,
51
],
[
57,
54
],
[
72,
55
],
[
78,
56
],
[
49,
58
],
[
54,
58
],
[
72,
59
],
[
78,
60
],
[
72,
66
],
[
68,
69
],
[
71,
72
],
[
74,
75
],
[
22,
77
],
[
77,
78
],
[
80,
81
]
] |
[
"# ペンキの種類を求めよ\n\nabc = input()\n\nls_abc = abc.split()\nlen_abc = len(ls_abc)\n\nfor i in range(len_abc):\n ls_abc[i] = int(ls_abc[i])\n\n# print(ls_abc)\n\ncounter = {}\n# この状態では,カウンターがからッぽ.0にするためには18.19行目\nfor i in range(len_abc):\n x = ls_abc[i]\n\n if not x in counter:\n counter[x] = 0\n\n counter[x] = counter[x] + 1\n\nprint(len(counter))",
"abc = input()",
"abc",
"input()",
"input",
"ls_abc = abc.split()",
"ls_abc",
"abc.split()",
"abc.split",
"abc",
"split",
"len_abc = len(ls_abc)",
"len_abc",
"len(ls_abc)",
"len",
"ls_abc",
"for i in range(len_abc):\n ls_abc[i] = int(ls_abc[i])\n\n# print(ls_abc)",
"i",
"range(len_abc)",
"range",
"len_abc",
"ls_abc[i] = int(ls_abc[i])",
"ls_abc[i]",
"ls_abc",
"i",
"int(ls_abc[i])",
"int",
"ls_abc[i]",
"ls_abc",
"i",
"counter = {}",
"counter",
"{}",
"for i in range(len_abc):\n x = ls_abc[i]\n\n if not x in counter:\n counter[x] = 0\n\n counter[x] = counter[x] + 1",
"i",
"range(len_abc)",
"range",
"len_abc",
"x = ls_abc[i]",
"x",
"ls_abc[i]",
"ls_abc",
"i",
"if not x in counter:\n counter[x] = 0\n\n ",
"not x in counter",
"x in counter",
"x",
"counter",
"counter[x] = 0",
"counter[x]",
"counter",
"x",
"0",
"counter[x] = counter[x] + 1",
"counter[x]",
"counter",
"x",
"counter[x] + 1",
"counter[x]",
"counter",
"x",
"1",
"print(len(counter))",
"print",
"len(counter)",
"len",
"counter",
"ls_abc = abc.split()",
"abc.split()",
"ls_abc",
"counter = {}",
"{}",
"counter",
"len_abc = len(ls_abc)",
"len(ls_abc)",
"len_abc",
"x = ls_abc[i]",
"ls_abc[i]",
"x",
"abc = input()",
"input()",
"abc"
] |
# ペンキの種類を求めよ
abc = input()
ls_abc = abc.split()
len_abc = len(ls_abc)
for i in range(len_abc):
ls_abc[i] = int(ls_abc[i])
# print(ls_abc)
counter = {}
# この状態では,カウンターがからッぽ.0にするためには18.19行目
for i in range(len_abc):
x = ls_abc[i]
if not x in counter:
counter[x] = 0
counter[x] = counter[x] + 1
print(len(counter))
|
[
7,
0,
13,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
4,
13,
4,
13,
13,
10,
4,
13
] |
[
[
19,
2
],
[
20,
17
],
[
19,
20
]
] |
[
"abc=set(map(int,input().split()))\n\nprint(len(abc))",
"abc=set(map(int,input().split()))",
"abc",
"set(map(int,input().split()))",
"set",
"map(int,input().split())",
"map",
"int",
"input().split()",
"().split",
"()",
"input",
"split",
"print(len(abc))",
"print",
"len(abc)",
"len",
"abc",
"abc=set(map(int,input().split()))",
"set(map(int,input().split()))",
"abc"
] |
abc=set(map(int,input().split()))
print(len(abc))
|
[
7,
0,
13,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
0,
13,
4,
13,
13,
14,
2,
18,
13,
17,
18,
13,
17,
14,
2,
18,
13,
17,
18,
13,
17,
0,
13,
17,
0,
13,
17,
14,
2,
18,
13,
17,
18,
13,
17,
0,
13,
17,
0,
13,
17,
4,
13,
13,
10,
4,
13,
10,
17,
13,
10,
4,
13,
10,
17,
13,
10,
17,
13,
10,
17,
13
] |
[
[
58,
2
],
[
64,
14
],
[
59,
17
],
[
65,
21
],
[
65,
24
],
[
65,
29
],
[
65,
32
],
[
67,
35
],
[
61,
38
],
[
65,
43
],
[
65,
46
],
[
73,
49
],
[
70,
52
],
[
71,
56
],
[
74,
56
],
[
62,
56
],
[
68,
56
],
[
58,
59
],
[
61,
62
],
[
64,
65
],
[
67,
68
],
[
70,
71
],
[
73,
74
]
] |
[
"s=list(map(int,input().split()))\na=sorted(s)\nif a[0]<a[1]:\n if a[1]<a[2]:\n c=3\n else:\n c=2\nelse:\n if a[1]<a[2]:\n c=2\n else:\n c=1\nprint(c)",
"s=list(map(int,input().split()))",
"s",
"list(map(int,input().split()))",
"list",
"map(int,input().split())",
"map",
"int",
"input().split()",
"().split",
"()",
"input",
"split",
"a=sorted(s)",
"a",
"sorted(s)",
"sorted",
"s",
"if a[0]<a[1]:\n if a[1]<a[2]:\n c=3\n else:\n c=2\nelse:\n if a[1]<a[2]:\n c=2\n else:\n c=1",
"a[0]<a[1]",
"a[0]",
"a",
"0",
"a[1]",
"a",
"1",
"if a[1]<a[2]:\n c=3\n else:\n c=2",
"a[1]<a[2]",
"a[1]",
"a",
"1",
"a[2]",
"a",
"2",
"c=3",
"c",
"3",
"c=2",
"c",
"2",
"if a[1]<a[2]:\n c=2\n else:\n c=1",
"a[1]<a[2]",
"a[1]",
"a",
"1",
"a[2]",
"a",
"2",
"c=2",
"c",
"2",
"c=1",
"c",
"1",
"print(c)",
"print",
"c",
"s=list(map(int,input().split()))",
"list(map(int,input().split()))",
"s",
"c=2",
"2",
"c",
"a=sorted(s)",
"sorted(s)",
"a",
"c=3",
"3",
"c",
"c=1",
"1",
"c",
"c=2",
"2",
"c"
] |
s=list(map(int,input().split()))
a=sorted(s)
if a[0]<a[1]:
if a[1]<a[2]:
c=3
else:
c=2
else:
if a[1]<a[2]:
c=2
else:
c=1
print(c)
|
[
7,
0,
13,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
14,
2,
4,
18,
13,
13,
18,
13,
17,
17,
4,
13,
17,
14,
2,
4,
18,
13,
13,
18,
13,
17,
17,
4,
13,
17,
14,
2,
4,
18,
13,
13,
18,
13,
17,
17,
14,
2,
4,
18,
13,
13,
18,
13,
17,
17,
4,
13,
17,
4,
13,
17,
10,
4,
13
] |
[
[
66,
2
],
[
67,
17
],
[
67,
20
],
[
67,
30
],
[
67,
33
],
[
67,
43
],
[
67,
46
],
[
67,
53
],
[
67,
56
],
[
66,
67
]
] |
[
"A = list(map(int, input().split()))\nif A.count(A[0]) == 3:\n print(\"1\")\nelif A.count(A[0]) == 2:\n print(\"2\")\nelif A.count(A[0]) == 1:\n if A.count(A[1]) == 1:\n print(\"3\")\n else:\n print(\"2\")",
"A = list(map(int, input().split()))",
"A",
"list(map(int, input().split()))",
"list",
"map(int, input().split())",
"map",
"int",
"input().split()",
"().split",
"()",
"input",
"split",
"if A.count(A[0]) == 3:\n print(\"1\")\nelif A.count(A[0]) == 2:\n print(\"2\")\nelif A.count(A[0]) == 1:\n if A.count(A[1]) == 1:\n print(\"3\")\n else:\n print(\"2\")",
"A.count(A[0]) == 3",
"A.count(A[0])",
"A.count",
"A",
"count",
"A[0]",
"A",
"0",
"3",
"print(\"1\")",
"print",
"\"1\"",
"elif A.count(A[0]) == 2:\n print(\"2\")",
"A.count(A[0]) == 2",
"A.count(A[0])",
"A.count",
"A",
"count",
"A[0]",
"A",
"0",
"2",
"print(\"2\")",
"print",
"\"2\"",
"elif A.count(A[0]) == 1:\n if A.count(A[1]) == 1:\n print(\"3\")\n else:\n print(\"2\")",
"A.count(A[0]) == 1",
"A.count(A[0])",
"A.count",
"A",
"count",
"A[0]",
"A",
"0",
"1",
"if A.count(A[1]) == 1:\n print(\"3\")\n else:\n print(\"2\")",
"A.count(A[1]) == 1",
"A.count(A[1])",
"A.count",
"A",
"count",
"A[1]",
"A",
"1",
"1",
"print(\"3\")",
"print",
"\"3\"",
"print(\"2\")",
"print",
"\"2\"",
"A = list(map(int, input().split()))",
"list(map(int, input().split()))",
"A"
] |
A = list(map(int, input().split()))
if A.count(A[0]) == 3:
print("1")
elif A.count(A[0]) == 2:
print("2")
elif A.count(A[0]) == 1:
if A.count(A[1]) == 1:
print("3")
else:
print("2")
|
[
7,
0,
13,
4,
18,
4,
13,
13,
0,
13,
4,
13,
13,
4,
13,
4,
13,
13,
10,
4,
13,
10,
4,
13
] |
[
[
19,
2
],
[
22,
9
],
[
20,
12
],
[
23,
17
],
[
20,
17
],
[
19,
20
],
[
22,
23
]
] |
[
"a = input().split()\na = set(a)\nprint(len(a))",
"a = input().split()",
"a",
"input().split()",
"().split",
"()",
"input",
"split",
"a = set(a)",
"a",
"set(a)",
"set",
"a",
"print(len(a))",
"print",
"len(a)",
"len",
"a",
"a = input().split()",
"input().split()",
"a",
"a = set(a)",
"set(a)",
"a"
] |
a = input().split()
a = set(a)
print(len(a))
|
[
7,
0,
13,
4,
13,
13,
4,
18,
4,
13,
13,
13,
13,
14,
2,
2,
2,
13,
13,
2,
13,
13,
2,
13,
13,
4,
13,
17,
14,
2,
2,
2,
13,
13,
2,
13,
13,
2,
13,
13,
4,
13,
17,
4,
13,
17,
10,
4,
13,
10,
4,
13,
10,
4,
13
] |
[
[
53,
2
],
[
53,
11
],
[
53,
12
],
[
48,
17
],
[
54,
18
],
[
54,
20
],
[
51,
21
],
[
48,
23
],
[
51,
24
],
[
48,
32
],
[
54,
33
],
[
54,
35
],
[
51,
36
],
[
48,
38
],
[
51,
39
],
[
53,
48
],
[
53,
51
],
[
53,
54
]
] |
[
"a,b,c=map(int,input().split())\nif a==b and b==c and a==c:\n print(\"1\")\nelif a==b or b==c or a==c:\n print(\"2\")\nelse:\n print(\"3\")",
"a,b,c=map(int,input().split())",
"a",
"map(int,input().split())",
"map",
"int",
"input().split()",
"().split",
"()",
"input",
"split",
"b",
"c",
"if a==b and b==c and a==c:\n print(\"1\")\nelif a==b or b==c or a==c:\n print(\"2\")\nelse:\n print(\"3\")",
"a==b and b==c and a==c",
"a==b and b==c",
"a==b",
"a",
"b",
"b==c",
"b",
"c",
"a==c",
"a",
"c",
"print(\"1\")",
"print",
"\"1\"",
"elif a==b or b==c or a==c:\n print(\"2\")",
"a==b or b==c or a==c",
"a==b or b==c",
"a==b",
"a",
"b",
"b==c",
"b",
"c",
"a==c",
"a",
"c",
"print(\"2\")",
"print",
"\"2\"",
"print(\"3\")",
"print",
"\"3\"",
"a,b,c=map(int,input().split())",
"map(int,input().split())",
"a",
"c=map(int,input().split())",
"map(int,input().split())",
"c",
"b,c=map(int,input().split())",
"map(int,input().split())",
"b"
] |
a,b,c=map(int,input().split())
if a==b and b==c and a==c:
print("1")
elif a==b or b==c or a==c:
print("2")
else:
print("3")
|
[
7,
12,
13,
0,
13,
4,
13,
13,
4,
18,
4,
13,
13,
13,
13,
41,
28,
13,
4,
13,
17,
4,
17,
0,
13,
13,
0,
13,
39,
4,
18,
13,
13,
13,
4,
18,
13,
13,
13,
4,
18,
13,
13,
13,
14,
2,
4,
18,
13,
13,
13,
17,
4,
13,
17,
14,
2,
2,
4,
18,
13,
13,
13,
17,
2,
4,
18,
13,
13,
13,
17,
4,
13,
17,
4,
13,
17,
14,
2,
13,
17,
4,
13,
10,
12,
13
] |
[
[
5,
4
],
[
5,
13
],
[
5,
14
],
[
18,
17
],
[
25,
24
],
[
28,
27
],
[
27,
31
],
[
24,
31
],
[
4,
33
],
[
27,
36
],
[
24,
36
],
[
13,
38
],
[
27,
41
],
[
24,
41
],
[
14,
43
],
[
27,
48
],
[
24,
48
],
[
4,
50
],
[
27,
60
],
[
24,
60
],
[
4,
62
],
[
27,
67
],
[
24,
67
],
[
13,
69
],
[
85,
82
]
] |
[
"#AtCoDeerくんとペンキ\ndef ABC_46_A():\n A,B,C = map(int, input().split())\n iroha = [0 for i in range(3)]\n iroha = []\n iroha.append(A)\n iroha.append(B)\n iroha.append(C)\n\n if iroha.count(A)==3:\n print(1)\n elif iroha.count(A)==2 or iroha.count(B)==2:\n print(2)\n else:\n print(3)\n\nif __name__ == '__main__':\n\n ABC_46_A()",
"def ABC_46_A():\n A,B,C = map(int, input().split())\n iroha = [0 for i in range(3)]\n iroha = []\n iroha.append(A)\n iroha.append(B)\n iroha.append(C)\n\n if iroha.count(A)==3:\n print(1)\n elif iroha.count(A)==2 or iroha.count(B)==2:\n print(2)\n else:\n print(3)",
"ABC_46_A",
"A,B,C = map(int, input().split())",
"A",
"map(int, input().split())",
"map",
"int",
"input().split()",
"().split",
"()",
"input",
"split",
"B",
"C",
"0 for i in range(3)",
"for i in range(3)",
"i",
"range(3)",
"range",
"3",
"for i in range(3)",
"0",
"iroha = [0 for i in range(3)]",
"iroha",
"[0 for i in range(3)]",
"iroha = []",
"iroha",
"[]",
"iroha.append(A)",
"iroha.append",
"iroha",
"append",
"A",
"iroha.append(B)",
"iroha.append",
"iroha",
"append",
"B",
"iroha.append(C)",
"iroha.append",
"iroha",
"append",
"C",
"if iroha.count(A)==3:\n print(1)\n elif iroha.count(A)==2 or iroha.count(B)==2:\n print(2)\n else:\n print(3)",
"iroha.count(A)==3",
"iroha.count(A)",
"iroha.count",
"iroha",
"count",
"A",
"3",
"print(1)",
"print",
"1",
"elif iroha.count(A)==2 or iroha.count(B)==2:\n print(2)\n ",
"iroha.count(A)==2 or iroha.count(B)==2",
"iroha.count(A)==2",
"iroha.count(A)",
"iroha.count",
"iroha",
"count",
"A",
"2",
"iroha.count(B)==2",
"iroha.count(B)",
"iroha.count",
"iroha",
"count",
"B",
"2",
"print(2)",
"print",
"2",
"print(3)",
"print",
"3",
"if __name__ == '__main__':\n\n ABC_46_A()",
"__name__ == '__main__'",
"__name__",
"'__main__'",
"ABC_46_A()",
"ABC_46_A",
"def ABC_46_A():\n A,B,C = map(int, input().split())\n iroha = [0 for i in range(3)]\n iroha = []\n iroha.append(A)\n iroha.append(B)\n iroha.append(C)\n\n if iroha.count(A)==3:\n print(1)\n elif iroha.count(A)==2 or iroha.count(B)==2:\n print(2)\n else:\n print(3)",
"def ABC_46_A():\n A,B,C = map(int, input().split())\n iroha = [0 for i in range(3)]\n iroha = []\n iroha.append(A)\n iroha.append(B)\n iroha.append(C)\n\n if iroha.count(A)==3:\n print(1)\n elif iroha.count(A)==2 or iroha.count(B)==2:\n print(2)\n else:\n print(3)",
"ABC_46_A"
] |
#AtCoDeerくんとペンキ
def ABC_46_A():
A,B,C = map(int, input().split())
iroha = [0 for i in range(3)]
iroha = []
iroha.append(A)
iroha.append(B)
iroha.append(C)
if iroha.count(A)==3:
print(1)
elif iroha.count(A)==2 or iroha.count(B)==2:
print(2)
else:
print(3)
if __name__ == '__main__':
ABC_46_A()
|
[
7,
0,
13,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
15,
0,
13,
4,
18,
4,
13,
13,
13,
4,
13,
4,
13,
13,
10,
4,
13,
10,
4,
13
] |
[
[
31,
2
],
[
28,
15
],
[
32,
20
],
[
29,
26
],
[
28,
29
],
[
31,
32
]
] |
[
"abc = list(map(int, input().split()))\nfrom collections import Counter\nabc2 = Counter(abc).most_common()\nprint(len(abc2))",
"abc = list(map(int, input().split()))",
"abc",
"list(map(int, input().split()))",
"list",
"map(int, input().split())",
"map",
"int",
"input().split()",
"().split",
"()",
"input",
"split",
"from collections import Counter",
"abc2 = Counter(abc).most_common()",
"abc2",
"Counter(abc).most_common()",
"(abc).most_common",
"(abc)",
"Counter",
"abc",
"most_common",
"print(len(abc2))",
"print",
"len(abc2)",
"len",
"abc2",
"abc2 = Counter(abc).most_common()",
"Counter(abc).most_common()",
"abc2",
"abc = list(map(int, input().split()))",
"list(map(int, input().split()))",
"abc"
] |
abc = list(map(int, input().split()))
from collections import Counter
abc2 = Counter(abc).most_common()
print(len(abc2))
|
[
7,
0,
13,
4,
18,
4,
13,
13,
4,
13,
4,
13,
4,
13,
13,
10,
4,
13
] |
[
[
16,
2
],
[
17,
14
],
[
16,
17
]
] |
[
"#ABC046\ns = input().split()\nprint(len(set(s)))",
"s = input().split()",
"s",
"input().split()",
"().split",
"()",
"input",
"split",
"print(len(set(s)))",
"print",
"len(set(s))",
"len",
"set(s)",
"set",
"s",
"s = input().split()",
"input().split()",
"s"
] |
#ABC046
s = input().split()
print(len(set(s)))
|
[
7,
0,
13,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
4,
13,
4,
13,
4,
13,
13,
10,
4,
13
] |
[
[
21,
2
],
[
22,
19
],
[
21,
22
]
] |
[
"A = list(map(int, input().split()))\nprint(len(set(A)))",
"A = list(map(int, input().split()))",
"A",
"list(map(int, input().split()))",
"list",
"map(int, input().split())",
"map",
"int",
"input().split()",
"().split",
"()",
"input",
"split",
"print(len(set(A)))",
"print",
"len(set(A))",
"len",
"set(A)",
"set",
"A",
"A = list(map(int, input().split()))",
"list(map(int, input().split()))",
"A"
] |
A = list(map(int, input().split()))
print(len(set(A)))
|
[
7,
14,
2,
13,
17,
0,
13,
4,
13,
13,
4,
18,
4,
13,
13,
13,
13,
0,
13,
17,
14,
2,
2,
13,
13,
2,
13,
13,
4,
13,
17,
4,
13,
14,
2,
2,
2,
13,
13,
2,
13,
13,
2,
13,
13,
4,
13,
17,
4,
13,
4,
13,
17,
10,
4,
13,
10,
4,
13,
10,
17,
13,
10,
4,
13
] |
[
[
63,
6
],
[
63,
15
],
[
63,
16
],
[
60,
18
],
[
64,
23
],
[
58,
24
],
[
58,
26
],
[
55,
27
],
[
64,
37
],
[
58,
38
],
[
58,
40
],
[
55,
41
],
[
55,
43
],
[
64,
44
],
[
63,
55
],
[
63,
58
],
[
60,
61
],
[
63,
64
]
] |
[
"if __name__ == \"__main__\":\n a, b, c = map(int,input().split())\n ans = 3\n if a == b and b == c:\n print(\"1\")\n exit()\n if a == b or b == c or c == a:\n print(\"2\")\n exit()\n print(\"3\")",
"if __name__ == \"__main__\":\n a, b, c = map(int,input().split())\n ans = 3\n if a == b and b == c:\n print(\"1\")\n exit()\n if a == b or b == c or c == a:\n print(\"2\")\n exit()\n print(\"3\")",
"__name__ == \"__main__\"",
"__name__",
"\"__main__\"",
"a, b, c = map(int,input().split())",
"a",
"map(int,input().split())",
"map",
"int",
"input().split()",
"().split",
"()",
"input",
"split",
"b",
"c",
"ans = 3",
"ans",
"3",
"if a == b and b == c:\n print(\"1\")\n exit()\n ",
"a == b and b == c",
"a == b",
"a",
"b",
"b == c",
"b",
"c",
"print(\"1\")",
"print",
"\"1\"",
"exit()",
"exit",
"if a == b or b == c or c == a:\n print(\"2\")\n exit()\n ",
"a == b or b == c or c == a",
"a == b or b == c",
"a == b",
"a",
"b",
"b == c",
"b",
"c",
"c == a",
"c",
"a",
"print(\"2\")",
"print",
"\"2\"",
"exit()",
"exit",
"print(\"3\")",
"print",
"\"3\"",
"c = map(int,input().split())",
"map(int,input().split())",
"c",
"b, c = map(int,input().split())",
"map(int,input().split())",
"b",
"ans = 3",
"3",
"ans",
"a, b, c = map(int,input().split())",
"map(int,input().split())",
"a"
] |
if __name__ == "__main__":
a, b, c = map(int,input().split())
ans = 3
if a == b and b == c:
print("1")
exit()
if a == b or b == c or c == a:
print("2")
exit()
print("3")
|
[
7,
0,
13,
4,
13,
4,
18,
4,
13,
13,
4,
13,
4,
13,
4,
13,
13,
10,
4,
13
] |
[
[
18,
2
],
[
19,
16
],
[
18,
19
]
] |
[
"s = list(input().split())\nprint(len(set(s)))",
"s = list(input().split())",
"s",
"list(input().split())",
"list",
"input().split()",
"().split",
"()",
"input",
"split",
"print(len(set(s)))",
"print",
"len(set(s))",
"len",
"set(s)",
"set",
"s",
"s = list(input().split())",
"list(input().split())",
"s"
] |
s = list(input().split())
print(len(set(s)))
|
[
7,
0,
13,
4,
13,
4,
18,
4,
13,
13,
4,
13,
4,
13,
4,
13,
13,
10,
4,
13
] |
[
[
18,
2
],
[
19,
16
],
[
18,
19
]
] |
[
"a = list(input().split())\nprint(len(set(a)))",
"a = list(input().split())",
"a",
"list(input().split())",
"list",
"input().split()",
"().split",
"()",
"input",
"split",
"print(len(set(a)))",
"print",
"len(set(a))",
"len",
"set(a)",
"set",
"a",
"a = list(input().split())",
"list(input().split())",
"a"
] |
a = list(input().split())
print(len(set(a)))
|
[
7,
0,
13,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
0,
13,
39,
0,
13,
17,
28,
13,
13,
14,
40,
2,
13,
13,
0,
13,
17,
4,
18,
13,
13,
13,
4,
13,
13,
10,
17,
13,
10,
17,
13,
10,
39,
13,
10,
4,
13
] |
[
[
48,
2
],
[
45,
14
],
[
39,
17
],
[
21,
20
],
[
49,
20
],
[
20,
25
],
[
46,
26
],
[
42,
28
],
[
46,
32
],
[
20,
34
],
[
43,
37
],
[
40,
37
],
[
39,
40
],
[
42,
43
],
[
45,
46
],
[
48,
49
]
] |
[
"l=list(map(int,input().split()))\ntmp = []\ncount=0\nfor i in l:\n if not i in tmp:\n count+=1\n tmp.append(i)\nprint(count)",
"l=list(map(int,input().split()))",
"l",
"list(map(int,input().split()))",
"list",
"map(int,input().split())",
"map",
"int",
"input().split()",
"().split",
"()",
"input",
"split",
"tmp = []",
"tmp",
"[]",
"count=0",
"count",
"0",
"for i in l:\n if not i in tmp:\n count+=1\n tmp.append(i)",
"i",
"l",
"if not i in tmp:\n count+=1\n tmp.append(i)",
"not i in tmp",
"i in tmp",
"i",
"tmp",
"count+=1",
"count",
"1",
"tmp.append(i)",
"tmp.append",
"tmp",
"append",
"i",
"print(count)",
"print",
"count",
"count=0",
"0",
"count",
"count+=1",
"1",
"count",
"tmp = []",
"[]",
"tmp",
"l=list(map(int,input().split()))",
"list(map(int,input().split()))",
"l"
] |
l=list(map(int,input().split()))
tmp = []
count=0
for i in l:
if not i in tmp:
count+=1
tmp.append(i)
print(count)
|
[
7,
0,
13,
4,
18,
4,
13,
13,
4,
18,
13,
13,
0,
13,
17,
42,
2,
4,
13,
13,
17,
0,
13,
4,
18,
13,
13,
4,
18,
13,
13,
17,
28,
13,
4,
13,
13,
4,
18,
13,
13,
17,
0,
13,
17,
4,
13,
13,
10,
17,
13,
10,
4,
13,
10,
4,
13,
10,
17,
13
] |
[
[
55,
2
],
[
56,
10
],
[
49,
13
],
[
56,
19
],
[
52,
22
],
[
56,
25
],
[
56,
29
],
[
34,
33
],
[
53,
36
],
[
56,
39
],
[
58,
43
],
[
59,
47
],
[
50,
47
],
[
49,
50
],
[
52,
53
],
[
55,
56
],
[
58,
59
]
] |
[
"a=input().split()\na.sort()\ncnt=0\nwhile len(a)>0:\n i=a.count(a.pop(0))\n for j in range(i):\n a.pop(0)\n cnt+=1\nprint(cnt)",
"a=input().split()",
"a",
"input().split()",
"().split",
"()",
"input",
"split",
"a.sort()",
"a.sort",
"a",
"sort",
"cnt=0",
"cnt",
"0",
"while len(a)>0:\n i=a.count(a.pop(0))\n for j in range(i):\n a.pop(0)\n cnt+=1",
"len(a)>0",
"len(a)",
"len",
"a",
"0",
"i=a.count(a.pop(0))",
"i",
"a.count(a.pop(0))",
"a.count",
"a",
"count",
"a.pop(0)",
"a.pop",
"a",
"pop",
"0",
"for j in range(i):\n a.pop(0)\n ",
"j",
"range(i)",
"range",
"i",
"a.pop(0)",
"a.pop",
"a",
"pop",
"0",
"cnt+=1",
"cnt",
"1",
"print(cnt)",
"print",
"cnt",
"cnt=0",
"0",
"cnt",
"i=a.count(a.pop(0))",
"a.count(a.pop(0))",
"i",
"a=input().split()",
"input().split()",
"a",
"cnt+=1",
"1",
"cnt"
] |
a=input().split()
a.sort()
cnt=0
while len(a)>0:
i=a.count(a.pop(0))
for j in range(i):
a.pop(0)
cnt+=1
print(cnt)
|
[
7,
0,
13,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
4,
13,
4,
13,
13,
10,
4,
13
] |
[
[
19,
2
],
[
20,
17
],
[
19,
20
]
] |
[
"s=set(map(int,input().split()))\nprint(len(s))",
"s=set(map(int,input().split()))",
"s",
"set(map(int,input().split()))",
"set",
"map(int,input().split())",
"map",
"int",
"input().split()",
"().split",
"()",
"input",
"split",
"print(len(s))",
"print",
"len(s)",
"len",
"s",
"s=set(map(int,input().split()))",
"set(map(int,input().split()))",
"s"
] |
s=set(map(int,input().split()))
print(len(s))
|
[
7,
15,
13,
0,
13,
4,
13,
13,
4,
18,
4,
13,
13,
4,
13,
4,
13,
4,
18,
13,
13,
13,
10,
4,
13
] |
[
[
23,
4
],
[
24,
21
],
[
23,
24
]
] |
[
"import collections\ncolor = map(int, input().split())\nprint(len(collections.Counter(color)))",
"import collections",
"collections",
"color = map(int, input().split())",
"color",
"map(int, input().split())",
"map",
"int",
"input().split()",
"().split",
"()",
"input",
"split",
"print(len(collections.Counter(color)))",
"print",
"len(collections.Counter(color))",
"len",
"collections.Counter(color)",
"collections.Counter",
"collections",
"Counter",
"color",
"color = map(int, input().split())",
"map(int, input().split())",
"color"
] |
import collections
color = map(int, input().split())
print(len(collections.Counter(color)))
|
[
7,
0,
13,
4,
13,
13,
4,
18,
4,
13,
13,
13,
13,
0,
13,
39,
13,
13,
13,
0,
13,
4,
13,
13,
4,
13,
4,
13,
13,
10,
4,
13,
10,
4,
13,
10,
4,
13,
10,
39,
13,
10,
4,
13
] |
[
[
36,
2
],
[
36,
11
],
[
36,
12
],
[
39,
14
],
[
42,
20
],
[
40,
23
],
[
43,
28
],
[
40,
28
],
[
36,
31
],
[
36,
34
],
[
36,
37
],
[
39,
40
],
[
42,
43
]
] |
[
"a,b,c = map(int,input().split())\n\nabc = [a,b,c]\n\nabc=set(abc)\n\nprint(len(abc))",
"a,b,c = map(int,input().split())",
"a",
"map(int,input().split())",
"map",
"int",
"input().split()",
"().split",
"()",
"input",
"split",
"b",
"c",
"abc = [a,b,c]",
"abc",
"[a,b,c]",
"a",
"b",
"c",
"abc=set(abc)",
"abc",
"set(abc)",
"set",
"abc",
"print(len(abc))",
"print",
"len(abc)",
"len",
"abc",
"c = map(int,input().split())",
"map(int,input().split())",
"c",
"a,b,c = map(int,input().split())",
"map(int,input().split())",
"a",
"b,c = map(int,input().split())",
"map(int,input().split())",
"b",
"abc = [a,b,c]",
"[a,b,c]",
"abc",
"abc=set(abc)",
"set(abc)",
"abc"
] |
a,b,c = map(int,input().split())
abc = [a,b,c]
abc=set(abc)
print(len(abc))
|
[
7,
0,
13,
4,
13,
13,
4,
18,
4,
13,
13,
13,
13,
14,
2,
2,
40,
13,
13,
40,
13,
13,
40,
13,
13,
4,
13,
17,
14,
2,
2,
2,
13,
13,
2,
13,
13,
2,
13,
13,
4,
13,
17,
4,
13,
17,
10,
4,
13,
10,
4,
13,
10,
4,
13
] |
[
[
53,
2
],
[
53,
11
],
[
53,
12
],
[
54,
17
],
[
48,
18
],
[
54,
20
],
[
51,
21
],
[
48,
23
],
[
51,
24
],
[
54,
32
],
[
48,
33
],
[
48,
35
],
[
51,
36
],
[
51,
38
],
[
54,
39
],
[
53,
48
],
[
53,
51
],
[
53,
54
]
] |
[
"a, b, c = map(int, input().split())\n\nif a != b and a != c and b != c:\n print('3')\nelif a == b and b == c and c == a:\n print('1')\nelse:\n print('2')",
"a, b, c = map(int, input().split())",
"a",
"map(int, input().split())",
"map",
"int",
"input().split()",
"().split",
"()",
"input",
"split",
"b",
"c",
"if a != b and a != c and b != c:\n print('3')\nelif a == b and b == c and c == a:\n print('1')\nelse:\n print('2')",
"a != b and a != c and b != c",
"a != b and a != c",
"a != b",
"a",
"b",
"a != c",
"a",
"c",
"b != c",
"b",
"c",
"print('3')",
"print",
"'3'",
"elif a == b and b == c and c == a:\n print('1')",
"a == b and b == c and c == a",
"a == b and b == c",
"a == b",
"a",
"b",
"b == c",
"b",
"c",
"c == a",
"c",
"a",
"print('1')",
"print",
"'1'",
"print('2')",
"print",
"'2'",
"b, c = map(int, input().split())",
"map(int, input().split())",
"b",
"c = map(int, input().split())",
"map(int, input().split())",
"c",
"a, b, c = map(int, input().split())",
"map(int, input().split())",
"a"
] |
a, b, c = map(int, input().split())
if a != b and a != c and b != c:
print('3')
elif a == b and b == c and c == a:
print('1')
else:
print('2')
|
[
7,
15,
13,
15,
13,
4,
18,
13,
13,
2,
17,
17,
0,
13,
18,
18,
13,
13,
13,
12,
13,
0,
13,
4,
13,
13,
4,
18,
4,
13,
13,
4,
13,
4,
13,
4,
13,
13,
14,
2,
13,
17,
4,
13,
10,
12,
13,
10,
18,
13
] |
[
[
48,
13
],
[
23,
22
],
[
49,
29
],
[
22,
37
],
[
46,
43
],
[
48,
49
]
] |
[
"import sys\nimport math\n \nsys.setrecursionlimit(10 ** 8)\ninput = sys.stdin.readline\n \ndef main():\n s = map(int,input().split())\n print(len(set(s)))\n \nif __name__ == '__main__':\n main()",
"import sys",
"sys",
"import math",
"math",
"sys.setrecursionlimit(10 ** 8)",
"sys.setrecursionlimit",
"sys",
"setrecursionlimit",
"10 ** 8",
"10",
"8",
"input = sys.stdin.readline",
"input",
"sys.stdin.readline",
"sys.stdin",
"sys",
"stdin",
"readline",
"def main():\n s = map(int,input().split())\n print(len(set(s)))\n ",
"main",
"s = map(int,input().split())",
"s",
"map(int,input().split())",
"map",
"int",
"input().split()",
"().split",
"()",
"input",
"split",
"print(len(set(s)))",
"print",
"len(set(s))",
"len",
"set(s)",
"set",
"s",
"if __name__ == '__main__':\n main()",
"__name__ == '__main__'",
"__name__",
"'__main__'",
"main()",
"main",
"def main():\n s = map(int,input().split())\n print(len(set(s)))\n ",
"def main():\n s = map(int,input().split())\n print(len(set(s)))\n ",
"main",
"input = sys.stdin.readline",
"sys.stdin.readline",
"input"
] |
import sys
import math
sys.setrecursionlimit(10 ** 8)
input = sys.stdin.readline
def main():
s = map(int,input().split())
print(len(set(s)))
if __name__ == '__main__':
main()
|
[
7,
15,
0,
13,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
4,
13,
4,
13,
4,
13,
13,
10,
4,
13
] |
[
[
22,
3
],
[
23,
20
],
[
22,
23
]
] |
[
"from collections import Counter\na = list(map(int,input().split()))\nprint(len(Counter(a)))",
"from collections import Counter",
"a = list(map(int,input().split()))",
"a",
"list(map(int,input().split()))",
"list",
"map(int,input().split())",
"map",
"int",
"input().split()",
"().split",
"()",
"input",
"split",
"print(len(Counter(a)))",
"print",
"len(Counter(a))",
"len",
"Counter(a)",
"Counter",
"a",
"a = list(map(int,input().split()))",
"list(map(int,input().split()))",
"a"
] |
from collections import Counter
a = list(map(int,input().split()))
print(len(Counter(a)))
|
[
7,
0,
13,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
0,
13,
18,
13,
17,
0,
13,
18,
13,
17,
14,
2,
4,
18,
13,
13,
13,
17,
4,
13,
17,
14,
2,
4,
18,
13,
13,
13,
17,
4,
13,
17,
14,
2,
4,
18,
13,
13,
13,
17,
4,
13,
17,
4,
13,
17,
10,
4,
13,
10,
18,
13,
10,
18,
13
] |
[
[
60,
2
],
[
66,
14
],
[
61,
16
],
[
63,
19
],
[
61,
21
],
[
61,
27
],
[
67,
29
],
[
61,
38
],
[
67,
40
],
[
61,
49
],
[
64,
51
],
[
60,
61
],
[
63,
64
],
[
66,
67
]
] |
[
"s=list(map(int,input().split()))\na=s[0]\nb=s[1]\nif s.count(a)==3:\n print(1)\nelif s.count(a)==2:\n print(2)\nelif s.count(b)==2:\n print(2) \nelse:\n print(3)",
"s=list(map(int,input().split()))",
"s",
"list(map(int,input().split()))",
"list",
"map(int,input().split())",
"map",
"int",
"input().split()",
"().split",
"()",
"input",
"split",
"a=s[0]",
"a",
"s[0]",
"s",
"0",
"b=s[1]",
"b",
"s[1]",
"s",
"1",
"if s.count(a)==3:\n print(1)\nelif s.count(a)==2:\n print(2)\nelif s.count(b)==2:\n print(2) \nelse:\n print(3)",
"s.count(a)==3",
"s.count(a)",
"s.count",
"s",
"count",
"a",
"3",
"print(1)",
"print",
"1",
"elif s.count(a)==2:\n print(2)",
"s.count(a)==2",
"s.count(a)",
"s.count",
"s",
"count",
"a",
"2",
"print(2)",
"print",
"2",
"elif s.count(b)==2:\n print(2) ",
"s.count(b)==2",
"s.count(b)",
"s.count",
"s",
"count",
"b",
"2",
"print(2)",
"print",
"2",
"print(3)",
"print",
"3",
"s=list(map(int,input().split()))",
"list(map(int,input().split()))",
"s",
"b=s[1]",
"s[1]",
"b",
"a=s[0]",
"s[0]",
"a"
] |
s=list(map(int,input().split()))
a=s[0]
b=s[1]
if s.count(a)==3:
print(1)
elif s.count(a)==2:
print(2)
elif s.count(b)==2:
print(2)
else:
print(3)
|
[
7,
12,
13,
0,
13,
4,
18,
4,
13,
13,
0,
13,
39,
28,
13,
13,
14,
40,
13,
13,
4,
18,
13,
13,
13,
4,
13,
4,
13,
13,
4,
13,
10,
12,
13
] |
[
[
5,
4
],
[
12,
11
],
[
15,
14
],
[
4,
14
],
[
14,
18
],
[
11,
19
],
[
11,
22
],
[
14,
24
],
[
11,
29
],
[
34,
31
]
] |
[
"def resolve():\n\ts = input().split()\n\tuni = []\n\tfor i in s:\n\t\tif i not in uni:\n\t\t\tuni.append(i)\n\tprint(len(uni))\nresolve()",
"def resolve():\n\ts = input().split()\n\tuni = []\n\tfor i in s:\n\t\tif i not in uni:\n\t\t\tuni.append(i)\n\tprint(len(uni))",
"resolve",
"s = input().split()",
"s",
"input().split()",
"().split",
"()",
"input",
"split",
"uni = []",
"uni",
"[]",
"for i in s:\n\t\tif i not in uni:\n\t\t\tuni.append(i)\n\t",
"i",
"s",
"if i not in uni:\n\t\t\tuni.append(i)\n\t",
"i not in uni",
"i",
"uni",
"uni.append(i)",
"uni.append",
"uni",
"append",
"i",
"print(len(uni))",
"print",
"len(uni)",
"len",
"uni",
"resolve()",
"resolve",
"def resolve():\n\ts = input().split()\n\tuni = []\n\tfor i in s:\n\t\tif i not in uni:\n\t\t\tuni.append(i)\n\tprint(len(uni))",
"def resolve():\n\ts = input().split()\n\tuni = []\n\tfor i in s:\n\t\tif i not in uni:\n\t\t\tuni.append(i)\n\tprint(len(uni))",
"resolve"
] |
def resolve():
s = input().split()
uni = []
for i in s:
if i not in uni:
uni.append(i)
print(len(uni))
resolve()
|
[
7,
0,
13,
4,
13,
13,
4,
18,
4,
13,
13,
13,
13,
14,
2,
2,
13,
13,
2,
13,
13,
4,
13,
17,
14,
2,
2,
13,
13,
40,
13,
13,
4,
13,
17,
14,
2,
40,
13,
13,
2,
13,
13,
4,
13,
17,
14,
2,
2,
13,
13,
40,
13,
13,
4,
13,
17,
14,
2,
40,
13,
13,
40,
13,
13,
4,
13,
17,
10,
4,
13,
10,
4,
13,
10,
4,
13
] |
[
[
75,
2
],
[
75,
11
],
[
75,
12
],
[
76,
16
],
[
73,
17
],
[
73,
19
],
[
70,
20
],
[
76,
27
],
[
73,
28
],
[
73,
30
],
[
70,
31
],
[
76,
38
],
[
73,
39
],
[
73,
41
],
[
70,
42
],
[
76,
49
],
[
70,
50
],
[
76,
52
],
[
73,
53
],
[
76,
60
],
[
73,
61
],
[
73,
63
],
[
70,
64
],
[
75,
70
],
[
75,
73
],
[
75,
76
]
] |
[
"a, b, c = map(int, input().split())\n\nif a == b and b == c:\n print(1)\nelif a == b and b != c:\n print(2)\nelif a != b and b == c:\n print(2)\nelif a == c and a != b:\n print(2)\nelif a != b and b != c:\n print(3)",
"a, b, c = map(int, input().split())",
"a",
"map(int, input().split())",
"map",
"int",
"input().split()",
"().split",
"()",
"input",
"split",
"b",
"c",
"if a == b and b == c:\n print(1)\nelif a == b and b != c:\n print(2)\nelif a != b and b == c:\n print(2)\nelif a == c and a != b:\n print(2)\nelif a != b and b != c:\n print(3)",
"a == b and b == c",
"a == b",
"a",
"b",
"b == c",
"b",
"c",
"print(1)",
"print",
"1",
"elif a == b and b != c:\n print(2)",
"a == b and b != c",
"a == b",
"a",
"b",
"b != c",
"b",
"c",
"print(2)",
"print",
"2",
"elif a != b and b == c:\n print(2)",
"a != b and b == c",
"a != b",
"a",
"b",
"b == c",
"b",
"c",
"print(2)",
"print",
"2",
"elif a == c and a != b:\n print(2)",
"a == c and a != b",
"a == c",
"a",
"c",
"a != b",
"a",
"b",
"print(2)",
"print",
"2",
"elif a != b and b != c:\n print(3)",
"a != b and b != c",
"a != b",
"a",
"b",
"b != c",
"b",
"c",
"print(3)",
"print",
"3",
"c = map(int, input().split())",
"map(int, input().split())",
"c",
"b, c = map(int, input().split())",
"map(int, input().split())",
"b",
"a, b, c = map(int, input().split())",
"map(int, input().split())",
"a"
] |
a, b, c = map(int, input().split())
if a == b and b == c:
print(1)
elif a == b and b != c:
print(2)
elif a != b and b == c:
print(2)
elif a == c and a != b:
print(2)
elif a != b and b != c:
print(3)
|
[
7,
12,
13,
0,
13,
4,
13,
4,
18,
4,
13,
13,
4,
13,
4,
13,
13,
14,
2,
13,
17,
4,
13,
10,
12,
13
] |
[
[
5,
4
],
[
4,
16
],
[
25,
22
]
] |
[
"def main():\n color = set(input().split())\n print(len(color))\n\nif __name__ == '__main__':\n main()",
"def main():\n color = set(input().split())\n print(len(color))",
"main",
"color = set(input().split())",
"color",
"set(input().split())",
"set",
"input().split()",
"().split",
"()",
"input",
"split",
"print(len(color))",
"print",
"len(color)",
"len",
"color",
"if __name__ == '__main__':\n main()",
"__name__ == '__main__'",
"__name__",
"'__main__'",
"main()",
"main",
"def main():\n color = set(input().split())\n print(len(color))",
"def main():\n color = set(input().split())\n print(len(color))",
"main"
] |
def main():
color = set(input().split())
print(len(color))
if __name__ == '__main__':
main()
|
[
7,
0,
13,
4,
13,
13,
4,
18,
4,
13,
13,
13,
13,
0,
13,
4,
13,
39,
4,
18,
13,
13,
13,
4,
18,
13,
13,
13,
4,
18,
13,
13,
13,
4,
13,
4,
13,
13,
10,
4,
13,
10,
4,
13,
10,
4,
13,
10,
4,
13
] |
[
[
48,
2
],
[
48,
11
],
[
48,
12
],
[
39,
14
],
[
40,
20
],
[
49,
22
],
[
40,
25
],
[
46,
27
],
[
40,
30
],
[
43,
32
],
[
40,
37
],
[
39,
40
],
[
48,
43
],
[
48,
46
],
[
48,
49
]
] |
[
"a,b,c = map(int,input().split())\ns = set([])\ns.add(a)\ns.add(b)\ns.add(c)\nprint(len(s))",
"a,b,c = map(int,input().split())",
"a",
"map(int,input().split())",
"map",
"int",
"input().split()",
"().split",
"()",
"input",
"split",
"b",
"c",
"s = set([])",
"s",
"set([])",
"set",
"[]",
"s.add(a)",
"s.add",
"s",
"add",
"a",
"s.add(b)",
"s.add",
"s",
"add",
"b",
"s.add(c)",
"s.add",
"s",
"add",
"c",
"print(len(s))",
"print",
"len(s)",
"len",
"s",
"s = set([])",
"set([])",
"s",
"c = map(int,input().split())",
"map(int,input().split())",
"c",
"b,c = map(int,input().split())",
"map(int,input().split())",
"b",
"a,b,c = map(int,input().split())",
"map(int,input().split())",
"a"
] |
a,b,c = map(int,input().split())
s = set([])
s.add(a)
s.add(b)
s.add(c)
print(len(s))
|
[
7,
0,
13,
4,
13,
0,
13,
4,
18,
13,
13,
17,
0,
13,
39,
28,
13,
4,
13,
17,
4,
18,
13,
13,
4,
18,
13,
13,
18,
13,
13,
14,
2,
2,
2,
18,
13,
17,
18,
13,
17,
18,
13,
17,
17,
4,
13,
17,
14,
2,
2,
18,
13,
17,
17,
2,
18,
13,
17,
17,
4,
13,
17,
4,
13,
17,
10,
39,
13,
10,
4,
13,
10,
4,
13
] |
[
[
70,
2
],
[
73,
6
],
[
71,
9
],
[
67,
13
],
[
17,
16
],
[
68,
22
],
[
74,
26
],
[
74,
29
],
[
16,
30
],
[
68,
36
],
[
68,
39
],
[
68,
42
],
[
68,
52
],
[
68,
57
],
[
67,
68
],
[
70,
71
],
[
73,
74
]
] |
[
"ns=input()\n\nnsl=ns.split(' ')\n\nnsc=[]\nfor i in range(3):\n nsc.append(nsl.count(nsl[i]))\n\nif nsc[0]==nsc[1]==nsc[2]==1:\n print('3')\nelif nsc[0]==2 or nsc[1]==2:\n print('2')\nelse:\n print('1')",
"ns=input()",
"ns",
"input()",
"input",
"nsl=ns.split(' ')",
"nsl",
"ns.split(' ')",
"ns.split",
"ns",
"split",
"' '",
"nsc=[]",
"nsc",
"[]",
"for i in range(3):\n nsc.append(nsl.count(nsl[i]))",
"i",
"range(3)",
"range",
"3",
"nsc.append(nsl.count(nsl[i]))",
"nsc.append",
"nsc",
"append",
"nsl.count(nsl[i])",
"nsl.count",
"nsl",
"count",
"nsl[i]",
"nsl",
"i",
"if nsc[0]==nsc[1]==nsc[2]==1:\n print('3')\nelif nsc[0]==2 or nsc[1]==2:\n print('2')\nelse:\n print('1')",
"nsc[0]==nsc[1]==nsc[2]==1",
"nsc[0]==nsc[1]==nsc[2]",
"nsc[0]==nsc[1]",
"nsc[0]",
"nsc",
"0",
"nsc[1]",
"nsc",
"1",
"nsc[2]",
"nsc",
"2",
"1",
"print('3')",
"print",
"'3'",
"elif nsc[0]==2 or nsc[1]==2:\n print('2')",
"nsc[0]==2 or nsc[1]==2",
"nsc[0]==2",
"nsc[0]",
"nsc",
"0",
"2",
"nsc[1]==2",
"nsc[1]",
"nsc",
"1",
"2",
"print('2')",
"print",
"'2'",
"print('1')",
"print",
"'1'",
"nsc=[]",
"[]",
"nsc",
"ns=input()",
"input()",
"ns",
"nsl=ns.split(' ')",
"ns.split(' ')",
"nsl"
] |
ns=input()
nsl=ns.split(' ')
nsc=[]
for i in range(3):
nsc.append(nsl.count(nsl[i]))
if nsc[0]==nsc[1]==nsc[2]==1:
print('3')
elif nsc[0]==2 or nsc[1]==2:
print('2')
else:
print('1')
|
[
7,
0,
13,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
0,
13,
4,
13,
13,
4,
13,
4,
13,
13,
10,
4,
13,
10,
4,
13
] |
[
[
27,
2
],
[
24,
14
],
[
28,
17
],
[
25,
22
],
[
24,
25
],
[
27,
28
]
] |
[
"col=list(map(int,input().split()))\ncol_uni=set(col)\nprint(len(col_uni))",
"col=list(map(int,input().split()))",
"col",
"list(map(int,input().split()))",
"list",
"map(int,input().split())",
"map",
"int",
"input().split()",
"().split",
"()",
"input",
"split",
"col_uni=set(col)",
"col_uni",
"set(col)",
"set",
"col",
"print(len(col_uni))",
"print",
"len(col_uni)",
"len",
"col_uni",
"col_uni=set(col)",
"set(col)",
"col_uni",
"col=list(map(int,input().split()))",
"list(map(int,input().split()))",
"col"
] |
col=list(map(int,input().split()))
col_uni=set(col)
print(len(col_uni))
|
[
7,
15,
13,
0,
13,
4,
13,
13,
4,
18,
4,
13,
13,
13,
13,
0,
13,
39,
13,
13,
13,
0,
13,
4,
18,
13,
13,
13,
4,
13,
4,
13,
13,
10,
4,
13,
10,
39,
13,
10,
4,
13,
10,
4,
13,
10,
4,
13
] |
[
[
46,
4
],
[
46,
13
],
[
46,
14
],
[
37,
16
],
[
40,
22
],
[
38,
27
],
[
41,
32
],
[
46,
35
],
[
37,
38
],
[
40,
41
],
[
46,
44
],
[
46,
47
]
] |
[
"import collections\na,b,c =map(int,input().split())\nls = [a,b,c]\ncounter = collections.Counter(ls)\nprint(len(counter))",
"import collections",
"collections",
"a,b,c =map(int,input().split())",
"a",
"map(int,input().split())",
"map",
"int",
"input().split()",
"().split",
"()",
"input",
"split",
"b",
"c",
"ls = [a,b,c]",
"ls",
"[a,b,c]",
"a",
"b",
"c",
"counter = collections.Counter(ls)",
"counter",
"collections.Counter(ls)",
"collections.Counter",
"collections",
"Counter",
"ls",
"print(len(counter))",
"print",
"len(counter)",
"len",
"counter",
"a,b,c =map(int,input().split())",
"map(int,input().split())",
"a",
"ls = [a,b,c]",
"[a,b,c]",
"ls",
"counter = collections.Counter(ls)",
"collections.Counter(ls)",
"counter",
"b,c =map(int,input().split())",
"map(int,input().split())",
"b",
"c =map(int,input().split())",
"map(int,input().split())",
"c"
] |
import collections
a,b,c =map(int,input().split())
ls = [a,b,c]
counter = collections.Counter(ls)
print(len(counter))
|
[
7,
0,
13,
4,
13,
13,
4,
18,
4,
13,
13,
4,
13,
4,
13,
4,
13,
13,
10,
4,
13
] |
[
[
19,
2
],
[
20,
17
],
[
19,
20
]
] |
[
"N = map(int,input().split())\nprint(len(set(N)))",
"N = map(int,input().split())",
"N",
"map(int,input().split())",
"map",
"int",
"input().split()",
"().split",
"()",
"input",
"split",
"print(len(set(N)))",
"print",
"len(set(N))",
"len",
"set(N)",
"set",
"N",
"N = map(int,input().split())",
"map(int,input().split())",
"N"
] |
N = map(int,input().split())
print(len(set(N)))
|
[
7,
41,
28,
13,
4,
18,
4,
13,
13,
4,
4,
13,
13,
0,
13,
4,
13,
4,
13,
13,
10,
13
] |
[
[
4,
3
],
[
3,
12
],
[
21,
19
]
] |
[
"Set = {int(x) for x in input().split()}\nprint(len(Set))",
"int(x) for x in input().split()",
"for x in input().split()",
"x",
"input().split()",
"().split",
"()",
"input",
"split",
"for x in input().split()",
"int(x)",
"int",
"x",
"Set = {int(x) for x in input().split()}",
"Set",
"print(len(Set))",
"print",
"len(Set)",
"len",
"Set",
"Set = {int(x) for x in input().split()}",
"Set"
] |
Set = {int(x) for x in input().split()}
print(len(Set))
|
[
7,
0,
13,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
4,
13,
4,
13,
13,
10,
4,
13
] |
[
[
19,
2
],
[
20,
17
],
[
19,
20
]
] |
[
"L = set(map(int, input().split()))\nprint(len(L))",
"L = set(map(int, input().split()))",
"L",
"set(map(int, input().split()))",
"set",
"map(int, input().split())",
"map",
"int",
"input().split()",
"().split",
"()",
"input",
"split",
"print(len(L))",
"print",
"len(L)",
"len",
"L",
"L = set(map(int, input().split()))",
"set(map(int, input().split()))",
"L"
] |
L = set(map(int, input().split()))
print(len(L))
|
[
7,
0,
13,
4,
13,
13,
4,
18,
4,
13,
13,
13,
13,
14,
2,
2,
13,
13,
13,
4,
13,
17,
14,
40,
40,
40,
13,
13,
13,
13,
4,
13,
17,
4,
13,
17,
10,
4,
13,
10,
4,
13,
10,
4,
13
] |
[
[
43,
2
],
[
43,
11
],
[
43,
12
],
[
44,
16
],
[
38,
17
],
[
41,
18
],
[
44,
26
],
[
38,
27
],
[
41,
28
],
[
44,
29
],
[
43,
38
],
[
43,
41
],
[
43,
44
]
] |
[
"\na,b,c=map(int,input().split())\n\nif a==b==c:\n print(1)\n\nelif a!=b!=c!=a:\n print(3)\n\nelse:\n print(2)",
"a,b,c=map(int,input().split())",
"a",
"map(int,input().split())",
"map",
"int",
"input().split()",
"().split",
"()",
"input",
"split",
"b",
"c",
"if a==b==c:\n print(1)\n\nelif a!=b!=c!=a:\n print(3)\n\nelse:\n print(2)",
"a==b==c",
"a==b",
"a",
"b",
"c",
"print(1)",
"print",
"1",
"elif a!=b!=c!=a:\n print(3)",
"a!=b!=c!=a",
"a!=b!=c",
"a!=b",
"a",
"b",
"c",
"a",
"print(3)",
"print",
"3",
"print(2)",
"print",
"2",
"b,c=map(int,input().split())",
"map(int,input().split())",
"b",
"c=map(int,input().split())",
"map(int,input().split())",
"c",
"a,b,c=map(int,input().split())",
"map(int,input().split())",
"a"
] |
a,b,c=map(int,input().split())
if a==b==c:
print(1)
elif a!=b!=c!=a:
print(3)
else:
print(2)
|
[
7,
0,
13,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
0,
13,
4,
13,
13,
4,
13,
4,
13,
13,
10,
4,
13,
10,
4,
13
] |
[
[
27,
2
],
[
24,
14
],
[
28,
17
],
[
25,
22
],
[
28,
22
],
[
24,
25
],
[
27,
28
]
] |
[
"x = list(map(int,input().split()))\nx = set(x)\nprint(len(x))",
"x = list(map(int,input().split()))",
"x",
"list(map(int,input().split()))",
"list",
"map(int,input().split())",
"map",
"int",
"input().split()",
"().split",
"()",
"input",
"split",
"x = set(x)",
"x",
"set(x)",
"set",
"x",
"print(len(x))",
"print",
"len(x)",
"len",
"x",
"x = set(x)",
"set(x)",
"x",
"x = list(map(int,input().split()))",
"list(map(int,input().split()))",
"x"
] |
x = list(map(int,input().split()))
x = set(x)
print(len(x))
|
[
7,
0,
13,
4,
13,
4,
18,
4,
13,
13,
0,
13,
4,
13,
13,
0,
13,
4,
13,
13,
4,
13,
13,
10,
4,
13,
10,
4,
13,
10,
4,
13
] |
[
[
30,
2
],
[
27,
11
],
[
31,
14
],
[
24,
16
],
[
28,
19
],
[
31,
19
],
[
25,
22
],
[
28,
22
],
[
31,
22
],
[
24,
25
],
[
27,
28
],
[
30,
31
]
] |
[
"a = list((input().split()))\na = set(a)\na = len(a)\n\nprint(a)",
"a = list((input().split()))",
"a",
"list((input().split()))",
"list",
"input().split()",
"().split",
"()",
"input",
"split",
"a = set(a)",
"a",
"set(a)",
"set",
"a",
"a = len(a)",
"a",
"len(a)",
"len",
"a",
"print(a)",
"print",
"a",
"a = len(a)",
"len(a)",
"a",
"a = set(a)",
"set(a)",
"a",
"a = list((input().split()))",
"list((input().split()))",
"a"
] |
a = list((input().split()))
a = set(a)
a = len(a)
print(a)
|
[
7,
12,
13,
0,
13,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
0,
13,
4,
13,
4,
13,
13,
4,
13,
13,
14,
2,
13,
17,
4,
13,
10,
12,
13
] |
[
[
5,
4
],
[
17,
16
],
[
4,
21
],
[
16,
24
],
[
33,
30
]
] |
[
"def main():\n paints = list(map(int, input().split()))\n ans = len(set(paints))\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()",
"def main():\n paints = list(map(int, input().split()))\n ans = len(set(paints))\n print(ans)",
"main",
"paints = list(map(int, input().split()))",
"paints",
"list(map(int, input().split()))",
"list",
"map(int, input().split())",
"map",
"int",
"input().split()",
"().split",
"()",
"input",
"split",
"ans = len(set(paints))",
"ans",
"len(set(paints))",
"len",
"set(paints)",
"set",
"paints",
"print(ans)",
"print",
"ans",
"if __name__ == \"__main__\":\n main()",
"__name__ == \"__main__\"",
"__name__",
"\"__main__\"",
"main()",
"main",
"def main():\n paints = list(map(int, input().split()))\n ans = len(set(paints))\n print(ans)",
"def main():\n paints = list(map(int, input().split()))\n ans = len(set(paints))\n print(ans)",
"main"
] |
def main():
paints = list(map(int, input().split()))
ans = len(set(paints))
print(ans)
if __name__ == "__main__":
main()
|
[
7,
17,
15,
13,
4,
18,
13,
13,
2,
17,
17,
0,
13,
12,
4,
18,
4,
18,
18,
13,
13,
13,
13,
0,
13,
4,
13,
17,
0,
13,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
4,
13,
4,
13,
13,
10,
4,
13,
10,
4,
13,
10,
12,
13
] |
[
[
52,
12
],
[
46,
24
],
[
49,
29
],
[
53,
38
],
[
50,
44
],
[
46,
47
],
[
49,
50
],
[
52,
53
]
] |
[
"\"\"\"\nN = list(map(int,input().split()))\nS = [str(input()) for _ in range(N)]\nS = [list(map(int,list(input()))) for _ in range(h)] \nprint(*S,sep=\"\")\n\"\"\"\n\nimport sys\nsys.setrecursionlimit(10**6)\ninput = lambda: sys.stdin.readline().rstrip()\ninf = float(\"inf\") # 無限\ns = set(map(int,input().split()))\nprint(len(s))",
"\"\"\"\nN = list(map(int,input().split()))\nS = [str(input()) for _ in range(N)]\nS = [list(map(int,list(input()))) for _ in range(h)] \nprint(*S,sep=\"\")\n\"\"\"",
"import sys",
"sys",
"sys.setrecursionlimit(10**6)",
"sys.setrecursionlimit",
"sys",
"setrecursionlimit",
"10**6",
"10",
"6",
"input = lambda: sys.stdin.readline().rstrip()",
"input",
"lambda: sys.stdin.readline().rstrip()",
"sys.stdin.readline().rstrip()",
"sys.stdin.readline().rstrip",
"sys.stdin.readline()",
"sys.stdin.readline",
"sys.stdin",
"sys",
"stdin",
"readline",
"rstrip",
"inf = float(\"inf\")",
"inf",
"float(\"inf\")",
"float",
"\"inf\"",
"s = set(map(int,input().split()))",
"s",
"set(map(int,input().split()))",
"set",
"map(int,input().split())",
"map",
"int",
"input().split()",
"().split",
"()",
"input",
"split",
"print(len(s))",
"print",
"len(s)",
"len",
"s",
"inf = float(\"inf\")",
"float(\"inf\")",
"inf",
"s = set(map(int,input().split()))",
"set(map(int,input().split()))",
"s",
"input = lambda: sys.stdin.readline().rstrip()",
"lambda: sys.stdin.readline().rstrip()",
"input"
] |
"""
N = list(map(int,input().split()))
S = [str(input()) for _ in range(N)]
S = [list(map(int,list(input()))) for _ in range(h)]
print(*S,sep="")
"""
import sys
sys.setrecursionlimit(10**6)
input = lambda: sys.stdin.readline().rstrip()
inf = float("inf") # 無限
s = set(map(int,input().split()))
print(len(s))
|
[
7,
0,
13,
4,
13,
13,
4,
18,
4,
13,
13,
13,
13,
14,
2,
2,
13,
13,
2,
13,
13,
4,
13,
17,
14,
2,
2,
2,
13,
13,
2,
13,
13,
2,
13,
13,
4,
13,
17,
4,
13,
17,
10,
4,
13,
10,
4,
13,
10,
4,
13
] |
[
[
49,
2
],
[
49,
11
],
[
49,
12
],
[
50,
16
],
[
47,
17
],
[
47,
19
],
[
44,
20
],
[
50,
28
],
[
47,
29
],
[
47,
31
],
[
44,
32
],
[
50,
34
],
[
44,
35
],
[
49,
44
],
[
49,
47
],
[
49,
50
]
] |
[
"a,b,c = map(int,input().split())\nif a==b and b==c:\n print(1)\nelif a==b or b==c or a==c:\n print(2)\nelse:\n print(3)",
"a,b,c = map(int,input().split())",
"a",
"map(int,input().split())",
"map",
"int",
"input().split()",
"().split",
"()",
"input",
"split",
"b",
"c",
"if a==b and b==c:\n print(1)\nelif a==b or b==c or a==c:\n print(2)\nelse:\n print(3)",
"a==b and b==c",
"a==b",
"a",
"b",
"b==c",
"b",
"c",
"print(1)",
"print",
"1",
"elif a==b or b==c or a==c:\n print(2)",
"a==b or b==c or a==c",
"a==b or b==c",
"a==b",
"a",
"b",
"b==c",
"b",
"c",
"a==c",
"a",
"c",
"print(2)",
"print",
"2",
"print(3)",
"print",
"3",
"c = map(int,input().split())",
"map(int,input().split())",
"c",
"b,c = map(int,input().split())",
"map(int,input().split())",
"b",
"a,b,c = map(int,input().split())",
"map(int,input().split())",
"a"
] |
a,b,c = map(int,input().split())
if a==b and b==c:
print(1)
elif a==b or b==c or a==c:
print(2)
else:
print(3)
|
[
7,
0,
13,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
4,
13,
4,
13,
4,
13,
13,
10,
4,
13
] |
[
[
21,
2
],
[
22,
19
],
[
21,
22
]
] |
[
"colors = list(map(int,input().split()))\nprint(len(set(colors)))",
"colors = list(map(int,input().split()))",
"colors",
"list(map(int,input().split()))",
"list",
"map(int,input().split())",
"map",
"int",
"input().split()",
"().split",
"()",
"input",
"split",
"print(len(set(colors)))",
"print",
"len(set(colors))",
"len",
"set(colors)",
"set",
"colors",
"colors = list(map(int,input().split()))",
"list(map(int,input().split()))",
"colors"
] |
colors = list(map(int,input().split()))
print(len(set(colors)))
|
[
7,
41,
28,
13,
4,
18,
4,
13,
13,
4,
4,
13,
13,
4,
13,
4,
13
] |
[
[
4,
3
],
[
3,
12
]
] |
[
"print(len({int(_) for _ in input().split()}))",
"int(_) for _ in input().split()",
"for _ in input().split()",
"_",
"input().split()",
"().split",
"()",
"input",
"split",
"for _ in input().split()",
"int(_)",
"int",
"_",
"print(len({int(_) for _ in input().split()}))",
"print",
"len({int(_) for _ in input().split()})",
"len"
] |
print(len({int(_) for _ in input().split()}))
|
[
7,
15,
0,
13,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
0,
13,
4,
13,
13,
4,
13,
4,
13,
13,
10,
4,
13,
10,
4,
13
] |
[
[
25,
3
],
[
28,
15
],
[
26,
18
],
[
29,
23
],
[
26,
23
],
[
25,
26
],
[
28,
29
]
] |
[
"from collections import Counter\ncount = list(map(int, input().split()))\ncount = Counter(count)\nprint(len(count))",
"from collections import Counter",
"count = list(map(int, input().split()))",
"count",
"list(map(int, input().split()))",
"list",
"map(int, input().split())",
"map",
"int",
"input().split()",
"().split",
"()",
"input",
"split",
"count = Counter(count)",
"count",
"Counter(count)",
"Counter",
"count",
"print(len(count))",
"print",
"len(count)",
"len",
"count",
"count = list(map(int, input().split()))",
"list(map(int, input().split()))",
"count",
"count = Counter(count)",
"Counter(count)",
"count"
] |
from collections import Counter
count = list(map(int, input().split()))
count = Counter(count)
print(len(count))
|
[
7,
0,
13,
4,
13,
4,
18,
4,
13,
13,
4,
13,
4,
13,
13,
10,
4,
13
] |
[
[
16,
2
],
[
17,
14
],
[
16,
17
]
] |
[
"st=set(input().split())\nprint(len(st))",
"st=set(input().split())",
"st",
"set(input().split())",
"set",
"input().split()",
"().split",
"()",
"input",
"split",
"print(len(st))",
"print",
"len(st)",
"len",
"st",
"st=set(input().split())",
"set(input().split())",
"st"
] |
st=set(input().split())
print(len(st))
|
[
7,
0,
13,
4,
13,
13,
4,
18,
4,
13,
13,
13,
13,
0,
13,
17,
14,
40,
13,
13,
0,
13,
17,
14,
40,
13,
13,
0,
13,
17,
14,
40,
13,
13,
0,
13,
17,
14,
2,
13,
17,
0,
13,
17,
4,
13,
13,
10,
17,
13,
10,
4,
13,
10,
17,
13,
10,
17,
13,
10,
17,
13,
10,
17,
13,
10,
4,
13,
10,
4,
13
] |
[
[
69,
2
],
[
69,
11
],
[
69,
12
],
[
54,
14
],
[
70,
18
],
[
67,
19
],
[
63,
21
],
[
70,
25
],
[
52,
26
],
[
60,
28
],
[
67,
32
],
[
52,
33
],
[
57,
35
],
[
58,
39
],
[
61,
39
],
[
64,
39
],
[
55,
39
],
[
48,
42
],
[
49,
46
],
[
58,
46
],
[
61,
46
],
[
64,
46
],
[
55,
46
],
[
48,
49
],
[
69,
52
],
[
54,
55
],
[
57,
58
],
[
60,
61
],
[
63,
64
],
[
69,
67
],
[
69,
70
]
] |
[
"a,b,c=map(int,input().split())\ni=0\nif a!=b:\n i+=1\nif a!=c:\n i+=1\nif b!=c:\n i+=1\nif i==0:\n i+=1\nprint(i)",
"a,b,c=map(int,input().split())",
"a",
"map(int,input().split())",
"map",
"int",
"input().split()",
"().split",
"()",
"input",
"split",
"b",
"c",
"i=0",
"i",
"0",
"if a!=b:\n i+=1",
"a!=b",
"a",
"b",
"i+=1",
"i",
"1",
"if a!=c:\n i+=1",
"a!=c",
"a",
"c",
"i+=1",
"i",
"1",
"if b!=c:\n i+=1",
"b!=c",
"b",
"c",
"i+=1",
"i",
"1",
"if i==0:\n i+=1",
"i==0",
"i",
"0",
"i+=1",
"i",
"1",
"print(i)",
"print",
"i",
"i+=1",
"1",
"i",
"c=map(int,input().split())",
"map(int,input().split())",
"c",
"i=0",
"0",
"i",
"i+=1",
"1",
"i",
"i+=1",
"1",
"i",
"i+=1",
"1",
"i",
"b,c=map(int,input().split())",
"map(int,input().split())",
"b",
"a,b,c=map(int,input().split())",
"map(int,input().split())",
"a"
] |
a,b,c=map(int,input().split())
i=0
if a!=b:
i+=1
if a!=c:
i+=1
if b!=c:
i+=1
if i==0:
i+=1
print(i)
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.