This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
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));
PrintWriter pw = new PrintWriter(System.out);
StringTokenizer st = new StringTokenizer(br.readLine());
int N = Integer.parseInt(st.nextToken());
long M = Long.parseLong(st.nextToken());
long [] a, b;
a = new long[N];
b = new long[N];
st = new StringTokenizer(br.readLine());
StringTokenizer st1 = new StringTokenizer(br.readLine());
long ans = Integer.MAX_VALUE;
for (int i=0;i<N;i++) {
a[i] = Long.parseLong(st.nextToken());
b[i] = Long.parseLong(st1.nextToken());
ans = Math.min(ans, Math.max(a[i], b[i]));
}
pw.println(ans);
pw.close();
br.close();
}
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |