-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path5.cpp
More file actions
34 lines (23 loc) · 621 Bytes
/
5.cpp
File metadata and controls
34 lines (23 loc) · 621 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// O(n)
#include <iostream>
#include <algorithm>
#include <string>
using namespace std;
#define FILE_IO {freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout);}
#define FAST_IO ios_base::sync_with_stdio(0); cin.tie(NULL), cout.tie(NULL)
int main() {
FAST_IO;
// FILE_IO;
int nA, nB, k, m, maxA, minB, x;
cin >> nA >> nB >> k >> m;
for (int i = 0; i < nA; ++i) {
cin >> x;
if (i == k - 1) maxA = x;
}
for (int i = 0; i < nB; ++i) {
cin >> x;
if (i == nB - m) minB = x;
}
cout << (maxA < minB ? "YES" : "NO");
return 0;
}