import math
def solve():
n, m = map(int, input().split())
list_1 = list(map(int, input().split()))
list_2 = list(map(int, input().split()))
curr_max = 0
curr_min = float('inf')
for i in range(n):
curr_max = max(curr_max, max(list_2[i], list_1[i]))
curr_min = min(max(list_2[i], list_1[i]), curr_min)
print(curr_min)
solve()
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
9 ms |
2908 KB |
Output is correct |
2 |
Correct |
8 ms |
2908 KB |
Output is correct |
3 |
Correct |
8 ms |
2984 KB |
Output is correct |
4 |
Correct |
9 ms |
2908 KB |
Output is correct |
5 |
Correct |
8 ms |
2936 KB |
Output is correct |
6 |
Correct |
9 ms |
2908 KB |
Output is correct |
7 |
Correct |
8 ms |
2908 KB |
Output is correct |
8 |
Correct |
8 ms |
2952 KB |
Output is correct |
9 |
Correct |
9 ms |
2908 KB |
Output is correct |
10 |
Correct |
12 ms |
3820 KB |
Output is correct |
11 |
Correct |
232 ms |
54700 KB |
Output is correct |
12 |
Correct |
216 ms |
54656 KB |
Output is correct |
13 |
Correct |
197 ms |
43176 KB |
Output is correct |
14 |
Correct |
200 ms |
40428 KB |
Output is correct |
15 |
Correct |
10 ms |
2908 KB |
Output is correct |
16 |
Correct |
174 ms |
11728 KB |
Output is correct |
17 |
Correct |
211 ms |
55532 KB |
Output is correct |
18 |
Correct |
212 ms |
54708 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
10 ms |
2908 KB |
Output is correct |
2 |
Correct |
174 ms |
11728 KB |
Output is correct |
3 |
Correct |
211 ms |
55532 KB |
Output is correct |
4 |
Correct |
212 ms |
54708 KB |
Output is correct |
5 |
Incorrect |
9 ms |
2908 KB |
Output isn't correct |
6 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
9 ms |
2908 KB |
Output is correct |
2 |
Correct |
8 ms |
2908 KB |
Output is correct |
3 |
Correct |
8 ms |
2984 KB |
Output is correct |
4 |
Correct |
9 ms |
2908 KB |
Output is correct |
5 |
Correct |
8 ms |
2936 KB |
Output is correct |
6 |
Correct |
9 ms |
2908 KB |
Output is correct |
7 |
Correct |
8 ms |
2908 KB |
Output is correct |
8 |
Correct |
8 ms |
2952 KB |
Output is correct |
9 |
Correct |
9 ms |
2908 KB |
Output is correct |
10 |
Correct |
12 ms |
3820 KB |
Output is correct |
11 |
Correct |
232 ms |
54700 KB |
Output is correct |
12 |
Correct |
216 ms |
54656 KB |
Output is correct |
13 |
Correct |
197 ms |
43176 KB |
Output is correct |
14 |
Correct |
200 ms |
40428 KB |
Output is correct |
15 |
Incorrect |
9 ms |
2908 KB |
Output isn't correct |
16 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
9 ms |
2908 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
9 ms |
2908 KB |
Output is correct |
2 |
Correct |
8 ms |
2908 KB |
Output is correct |
3 |
Correct |
8 ms |
2984 KB |
Output is correct |
4 |
Correct |
9 ms |
2908 KB |
Output is correct |
5 |
Correct |
8 ms |
2936 KB |
Output is correct |
6 |
Correct |
9 ms |
2908 KB |
Output is correct |
7 |
Correct |
8 ms |
2908 KB |
Output is correct |
8 |
Correct |
8 ms |
2952 KB |
Output is correct |
9 |
Correct |
9 ms |
2908 KB |
Output is correct |
10 |
Correct |
12 ms |
3820 KB |
Output is correct |
11 |
Correct |
232 ms |
54700 KB |
Output is correct |
12 |
Correct |
216 ms |
54656 KB |
Output is correct |
13 |
Correct |
197 ms |
43176 KB |
Output is correct |
14 |
Correct |
200 ms |
40428 KB |
Output is correct |
15 |
Incorrect |
9 ms |
2908 KB |
Output isn't correct |
16 |
Halted |
0 ms |
0 KB |
- |