-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBOJ_15366.java
More file actions
32 lines (27 loc) · 914 Bytes
/
Copy pathBOJ_15366.java
File metadata and controls
32 lines (27 loc) · 914 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
// BOJ - 15366
// Problem Sheet - https://www.acmicpc.net/problem/15366
import java.util.*;
import java.io.*;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int N = Integer.parseInt(br.readLine());
int[] wands = Arrays.stream(br.readLine().split(" "))
.mapToInt(Integer::parseInt)
.sorted()
.toArray();
int[] boxes = Arrays.stream(br.readLine().split(" "))
.mapToInt(Integer::parseInt)
.sorted()
.toArray();
boolean result = true;
for (int i=0 ; i<N ; i++) {
if (wands[i] > boxes[i]) {
result = false;
break;
}
}
System.out.println(result ? "DA" : "NE");
br.close();
}
}