#include<bits/stdc++.h>
#define fi first
#define se second
#define ll long long
using namespace std ;
const ll N = 3e5 ;
ll n, m, l = 0, r = 1e18, a[N + 1], b[N + 1] ;
signed main()
{
ios_base::sync_with_stdio( 0 ) ;
cin.tie( 0 ) ;
cout.tie( 0 ) ;
cin >> n >> m ;
for(ll i = 1 ; i <= n ; i++)
cin >> a[i] ;
for(ll i = 1 ; i <= n ; i++)
cin >> b[i] ;
if(m == 1)
{
ll mn = 1e18 ;
for(int i = 1 ; i <= n ; i++)
mn = min(mn, max(a[i], b[i])) ;
cout << mn << '\n' ;
return 0 ;
}
// while(l + 1 < r)
// {
// ll mid = (l + r) >> 1 ;
// for(int i = 1 ; i <= n ; i++)
// if(a[i] > b[i])
// {
// }
// else
// {
// }
// if(flag)
// r = mid ;
// else
// l = mid ;
// }
// cout << l ;
return 0 ;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Correct |
0 ms |
212 KB |
Output is correct |
3 |
Correct |
0 ms |
212 KB |
Output is correct |
4 |
Correct |
0 ms |
212 KB |
Output is correct |
5 |
Correct |
0 ms |
212 KB |
Output is correct |
6 |
Correct |
0 ms |
212 KB |
Output is correct |
7 |
Correct |
0 ms |
212 KB |
Output is correct |
8 |
Correct |
0 ms |
212 KB |
Output is correct |
9 |
Correct |
0 ms |
212 KB |
Output is correct |
10 |
Correct |
1 ms |
340 KB |
Output is correct |
11 |
Correct |
51 ms |
5004 KB |
Output is correct |
12 |
Correct |
46 ms |
4992 KB |
Output is correct |
13 |
Correct |
35 ms |
4928 KB |
Output is correct |
14 |
Correct |
54 ms |
4920 KB |
Output is correct |
15 |
Correct |
0 ms |
212 KB |
Output is correct |
16 |
Correct |
24 ms |
4892 KB |
Output is correct |
17 |
Correct |
46 ms |
4924 KB |
Output is correct |
18 |
Correct |
44 ms |
4940 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
24 ms |
4892 KB |
Output is correct |
3 |
Correct |
46 ms |
4924 KB |
Output is correct |
4 |
Correct |
44 ms |
4940 KB |
Output is correct |
5 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
6 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Correct |
0 ms |
212 KB |
Output is correct |
3 |
Correct |
0 ms |
212 KB |
Output is correct |
4 |
Correct |
0 ms |
212 KB |
Output is correct |
5 |
Correct |
0 ms |
212 KB |
Output is correct |
6 |
Correct |
0 ms |
212 KB |
Output is correct |
7 |
Correct |
0 ms |
212 KB |
Output is correct |
8 |
Correct |
0 ms |
212 KB |
Output is correct |
9 |
Correct |
0 ms |
212 KB |
Output is correct |
10 |
Correct |
1 ms |
340 KB |
Output is correct |
11 |
Correct |
51 ms |
5004 KB |
Output is correct |
12 |
Correct |
46 ms |
4992 KB |
Output is correct |
13 |
Correct |
35 ms |
4928 KB |
Output is correct |
14 |
Correct |
54 ms |
4920 KB |
Output is correct |
15 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
16 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Correct |
0 ms |
212 KB |
Output is correct |
3 |
Correct |
0 ms |
212 KB |
Output is correct |
4 |
Correct |
0 ms |
212 KB |
Output is correct |
5 |
Correct |
0 ms |
212 KB |
Output is correct |
6 |
Correct |
0 ms |
212 KB |
Output is correct |
7 |
Correct |
0 ms |
212 KB |
Output is correct |
8 |
Correct |
0 ms |
212 KB |
Output is correct |
9 |
Correct |
0 ms |
212 KB |
Output is correct |
10 |
Correct |
1 ms |
340 KB |
Output is correct |
11 |
Correct |
51 ms |
5004 KB |
Output is correct |
12 |
Correct |
46 ms |
4992 KB |
Output is correct |
13 |
Correct |
35 ms |
4928 KB |
Output is correct |
14 |
Correct |
54 ms |
4920 KB |
Output is correct |
15 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
16 |
Halted |
0 ms |
0 KB |
- |