曼哈顿距离 = (x + y) - (1 + 1):
import java.util.*;
public class Main {
public static void main(String[] args) throws Exception{
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int[] v = new int[n];
for(int i = 0; i < n; ++i) v[i] = sc.nextInt();
for(int i = 0; i < n; ++i) v[i] += sc.nextInt();
Arrays.sort(v);
System.out.println(v[0] - 2);
}
}
京公网安备 11010502036488号