git reimport
This commit is contained in:
47
archive/2018.11/2018.11.03 - unsorted/BUDDYNIM.java
Normal file
47
archive/2018.11/2018.11.03 - unsorted/BUDDYNIM.java
Normal file
@@ -0,0 +1,47 @@
|
||||
package chelper;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import io.InputReader;
|
||||
import io.OutputWriter;
|
||||
import misc.SimpleSavingChelperSolution;
|
||||
|
||||
|
||||
public class BUDDYNIM extends SimpleSavingChelperSolution {
|
||||
|
||||
public void solve(int testNumber, InputReader in, OutputWriter out) {
|
||||
wrapSolve(testNumber, in, out);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void solve(int testNumber) {
|
||||
int n = in.nextInt();
|
||||
int m = in.nextInt();
|
||||
|
||||
List<Integer> a = new ArrayList<>();
|
||||
for (int i = 0; i < n; i++) {
|
||||
int e = in.nextInt();
|
||||
if (e > 0) {
|
||||
a.add(e);
|
||||
}
|
||||
}
|
||||
Collections.sort(a);
|
||||
|
||||
List<Integer> b = new ArrayList<>();
|
||||
for (int i = 0; i < m; i++) {
|
||||
int e = in.nextInt();
|
||||
if (e > 0) {
|
||||
b.add(e);
|
||||
}
|
||||
}
|
||||
Collections.sort(b);
|
||||
|
||||
if (a.equals(b)) {
|
||||
out.println("Bob");
|
||||
} else {
|
||||
out.println("Alice");
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user