#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int n, m;
vector<pair<ll, ll>> a;
int main(){
cin >> n >> m;
a.resize(n);
for(int i = 0; i < n; i++) cin >> a[i].first;
for(int i = 0; i < n; i++) cin >> a[i].second;
sort(a.begin(), a.end());
ll ans = 1e9 + 5;
for(auto x: a){
ans = min(ans, max(x.first, x.second));
}
cout << ans;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
1 ms |
344 KB |
Output is correct |
4 |
Correct |
0 ms |
348 KB |
Output is correct |
5 |
Correct |
1 ms |
348 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Correct |
0 ms |
348 KB |
Output is correct |
8 |
Correct |
0 ms |
348 KB |
Output is correct |
9 |
Correct |
0 ms |
348 KB |
Output is correct |
10 |
Correct |
2 ms |
348 KB |
Output is correct |
11 |
Correct |
155 ms |
4956 KB |
Output is correct |
12 |
Correct |
182 ms |
5204 KB |
Output is correct |
13 |
Correct |
112 ms |
4956 KB |
Output is correct |
14 |
Correct |
102 ms |
4952 KB |
Output is correct |
15 |
Correct |
1 ms |
348 KB |
Output is correct |
16 |
Correct |
54 ms |
4956 KB |
Output is correct |
17 |
Correct |
151 ms |
4956 KB |
Output is correct |
18 |
Correct |
160 ms |
4952 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
348 KB |
Output is correct |
2 |
Correct |
54 ms |
4956 KB |
Output is correct |
3 |
Correct |
151 ms |
4956 KB |
Output is correct |
4 |
Correct |
160 ms |
4952 KB |
Output is correct |
5 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
6 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
1 ms |
344 KB |
Output is correct |
4 |
Correct |
0 ms |
348 KB |
Output is correct |
5 |
Correct |
1 ms |
348 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Correct |
0 ms |
348 KB |
Output is correct |
8 |
Correct |
0 ms |
348 KB |
Output is correct |
9 |
Correct |
0 ms |
348 KB |
Output is correct |
10 |
Correct |
2 ms |
348 KB |
Output is correct |
11 |
Correct |
155 ms |
4956 KB |
Output is correct |
12 |
Correct |
182 ms |
5204 KB |
Output is correct |
13 |
Correct |
112 ms |
4956 KB |
Output is correct |
14 |
Correct |
102 ms |
4952 KB |
Output is correct |
15 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
16 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
1 ms |
344 KB |
Output is correct |
4 |
Correct |
0 ms |
348 KB |
Output is correct |
5 |
Correct |
1 ms |
348 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Correct |
0 ms |
348 KB |
Output is correct |
8 |
Correct |
0 ms |
348 KB |
Output is correct |
9 |
Correct |
0 ms |
348 KB |
Output is correct |
10 |
Correct |
2 ms |
348 KB |
Output is correct |
11 |
Correct |
155 ms |
4956 KB |
Output is correct |
12 |
Correct |
182 ms |
5204 KB |
Output is correct |
13 |
Correct |
112 ms |
4956 KB |
Output is correct |
14 |
Correct |
102 ms |
4952 KB |
Output is correct |
15 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
16 |
Halted |
0 ms |
0 KB |
- |