题解 | #二维数组操作#

二维数组操作

https://www.nowcoder.com/practice/2f8c17bec47e416897ce4b9aa560b7f4

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.temporal.ChronoUnit;
import java.util.*;
import java.util.stream.IntStream;
import java.util.stream.Stream;

import static java.util.Arrays.*;
import static java.util.stream.Stream.*;


public class Main {
    public static void main(String[] args) throws IOException {

        //testCompletePack();
        testTh();
    }

    private static void testTh() throws IOException {
        BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
        String str;
        while ((str = bf.readLine()) != null) {
            String[] split = str.split(" ");
            int row = Integer.parseInt(split[0]);
            int line = Integer.parseInt(split[1]);
            str = bf.readLine();
            String[] change = str.split(" ");
            str = bf.readLine();
            int parseIntRow = Integer.parseInt(str);
            str = bf.readLine();
            int parseIntLine = Integer.parseInt(str);
            str = bf.readLine();
            String[] query = str.split(" ");
            System.out.println(0);
            if (Integer.parseInt(change[0]) >= row || Integer.parseInt(change[2]) >= row ||
                    Integer.parseInt(change[1]) >= line || Integer.parseInt(change[3]) >= line) {
                System.out.println(-1);
            } else {
                System.out.println(0);
            }

            if (row + 1 > 9 || parseIntRow >= row) {
                System.out.println(-1);
            } else {
                System.out.println(0);
            }
            if (line + 1 > 9 || parseIntLine >= line) {
                System.out.println(-1);
            } else {
                System.out.println(0);
            }

            if (Integer.parseInt(query[0]) >= row || Integer.parseInt(query[1]) >= line) {
                System.out.println(-1);
            } else {
                System.out.println(0);
            }
        }

    }




}

全部评论

相关推荐

码农索隆:这种hr,建议全中国推广
点赞 评论 收藏
分享
后来123321:别着急,我学院本大二,投了1100份,两个面试,其中一个还是我去线下招聘会投的简历,有时候这东西也得看运气
无实习如何秋招上岸
点赞 评论 收藏
分享
06-08 22:25
门头沟学院 Java
从零开始的转码生活:这hr不会打开手机不分青红皂白给所有人群发这句话,过一会再给所有人再发一遍,这肯定会有重复的,不管,再过一会再发一遍
点赞 评论 收藏
分享
不愿透露姓名的神秘牛友
07-01 11:27
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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