/***
* Sub2: Binary Search
*/
#include <bits/stdc++.h>
#define int long long
#define sz(v) (int)v.size()
using namespace std;
const int maxn = (int)3e5 + 5;
const int INF = (int)1e18 + 5;
int n, m;
int a[maxn], b[maxn];
void sub1() {
int mi = INF;
for (int i = 1; i <= n; i++) {
mi = min(mi, max(a[i], b[i]));
}
cout << mi << '\n';
}
void sub2() {
}
void solve() {
cin >> n >> m;
for (int i = 1; i <= n; i++) cin >> a[i];
for (int i = 1; i <= n; i++) cin >> b[i];
if (m == 1) sub1();
else sub2();
}
signed main() {
ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
solve();
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
2392 KB |
Output is correct |
2 |
Correct |
1 ms |
2396 KB |
Output is correct |
3 |
Correct |
1 ms |
2396 KB |
Output is correct |
4 |
Correct |
1 ms |
2648 KB |
Output is correct |
5 |
Correct |
1 ms |
2396 KB |
Output is correct |
6 |
Correct |
1 ms |
2396 KB |
Output is correct |
7 |
Correct |
1 ms |
2396 KB |
Output is correct |
8 |
Correct |
1 ms |
2396 KB |
Output is correct |
9 |
Correct |
1 ms |
2396 KB |
Output is correct |
10 |
Correct |
1 ms |
2396 KB |
Output is correct |
11 |
Correct |
47 ms |
8532 KB |
Output is correct |
12 |
Correct |
47 ms |
10832 KB |
Output is correct |
13 |
Correct |
36 ms |
8696 KB |
Output is correct |
14 |
Correct |
35 ms |
8832 KB |
Output is correct |
15 |
Correct |
1 ms |
2392 KB |
Output is correct |
16 |
Correct |
26 ms |
6280 KB |
Output is correct |
17 |
Correct |
48 ms |
11348 KB |
Output is correct |
18 |
Correct |
47 ms |
10836 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
2392 KB |
Output is correct |
2 |
Correct |
26 ms |
6280 KB |
Output is correct |
3 |
Correct |
48 ms |
11348 KB |
Output is correct |
4 |
Correct |
47 ms |
10836 KB |
Output is correct |
5 |
Incorrect |
1 ms |
2392 KB |
Output isn't correct |
6 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
2392 KB |
Output is correct |
2 |
Correct |
1 ms |
2396 KB |
Output is correct |
3 |
Correct |
1 ms |
2396 KB |
Output is correct |
4 |
Correct |
1 ms |
2648 KB |
Output is correct |
5 |
Correct |
1 ms |
2396 KB |
Output is correct |
6 |
Correct |
1 ms |
2396 KB |
Output is correct |
7 |
Correct |
1 ms |
2396 KB |
Output is correct |
8 |
Correct |
1 ms |
2396 KB |
Output is correct |
9 |
Correct |
1 ms |
2396 KB |
Output is correct |
10 |
Correct |
1 ms |
2396 KB |
Output is correct |
11 |
Correct |
47 ms |
8532 KB |
Output is correct |
12 |
Correct |
47 ms |
10832 KB |
Output is correct |
13 |
Correct |
36 ms |
8696 KB |
Output is correct |
14 |
Correct |
35 ms |
8832 KB |
Output is correct |
15 |
Incorrect |
1 ms |
2392 KB |
Output isn't correct |
16 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
2392 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
2392 KB |
Output is correct |
2 |
Correct |
1 ms |
2396 KB |
Output is correct |
3 |
Correct |
1 ms |
2396 KB |
Output is correct |
4 |
Correct |
1 ms |
2648 KB |
Output is correct |
5 |
Correct |
1 ms |
2396 KB |
Output is correct |
6 |
Correct |
1 ms |
2396 KB |
Output is correct |
7 |
Correct |
1 ms |
2396 KB |
Output is correct |
8 |
Correct |
1 ms |
2396 KB |
Output is correct |
9 |
Correct |
1 ms |
2396 KB |
Output is correct |
10 |
Correct |
1 ms |
2396 KB |
Output is correct |
11 |
Correct |
47 ms |
8532 KB |
Output is correct |
12 |
Correct |
47 ms |
10832 KB |
Output is correct |
13 |
Correct |
36 ms |
8696 KB |
Output is correct |
14 |
Correct |
35 ms |
8832 KB |
Output is correct |
15 |
Incorrect |
1 ms |
2392 KB |
Output isn't correct |
16 |
Halted |
0 ms |
0 KB |
- |