-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathArrays.java
More file actions
42 lines (32 loc) · 1.17 KB
/
Arrays.java
File metadata and controls
42 lines (32 loc) · 1.17 KB
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
35
36
37
38
39
40
41
42
/**
* Created by MalhotR1 on 05/11/2018.
*/
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Arrays {
public static void main(String[] args) throws IOException {
try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {
String[] in = br.readLine().trim().split(" ");
int na = Integer.parseInt(in[0]);
int nb = Integer.parseInt(in[0]);
in = br.readLine().trim().split(" ");
int k = Integer.parseInt(in[0]);
int m = Integer.parseInt(in[1]);
in = br.readLine().split(" ");
long[] a = new long[in.length];
for (int i = 0; i < in.length; i++) {
a[i] = Long.parseLong(in[i]);
}
in = br.readLine().split(" ");
long[] b = new long[in.length];
for (int i = 0; i < in.length; i++) {
b[i] = Long.parseLong(in[i]);
}
long val = a[k-1];
long comp = b[b.length - m];
if (comp > val) System.out.println("YES");
else System.out.println("NO");
}
}
}