最少多少秒会走入一个陷阱

解救小易

http://www.nowcoder.com/questionTerminal/cd763d8541fc4243b8d3b967bb6d6b6a

曼哈顿距离 = (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);
    }
}
全部评论

相关推荐

评论
6
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务