使用鼠标点击矩阵上下左右的数字初始化为1 计算所需总共点击次数矩阵所有数字变成1的时间算法

2024-10-04 06:45:52 浏览数 (2)

代码语言:txt复制
import java.util.ArrayList;

public class HuaweiTest2 {
    public static void main(String[] args) {
//        System.out.println("Hello World!");
    }

    public static Integer getMilliSecondsForInputInicialize2One(String inputStr){
        String trim = inputStr.trim();
        if (trim==null){
            return null;
        }
        if (trim.isEmpty()){
            return null;
        }
        String[] split = trim.split("\s");
        String s = split[0];
        String trim1 = s.trim();
        Integer i1 = Integer.valueOf(trim1);
        String s1 = split[1];
        String trim2 = s1.trim();
        Integer i2 = Integer.valueOf(trim2);
        ArrayList<ArrayList<Integer>> arrayLists = new ArrayList<>();
        ArrayList<Integer> integers = new ArrayList<>();
        for (int i = 0; i < split.length; i  ) {
            if ((integers.size() 1)%i2==0){
                continue;
            }else {
                ArrayList<Integer> integers1 = new ArrayList<>();
                String s2 = split[i 2];
                integers1.add(Integer.valueOf(s2));
                String s3 = split[i 3];
                integers1.add(Integer.valueOf(s3));
                String s4 = split[i 4];
                integers1.add(Integer.valueOf(s4));
                arrayLists.add(integers1);
                integers=integers1;
            }
        }
        return null;
    }
}

class MetrixSynchronizedInput{
    private String id;
    private Integer mLine;
    private Integer nColmn;
    private Integer dataInt;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public Integer getmLine() {
        return mLine;
    }

    public void setmLine(Integer mLine) {
        this.mLine = mLine;
    }

    public Integer getnColmn() {
        return nColmn;
    }

    public void setnColmn(Integer nColmn) {
        this.nColmn = nColmn;
    }

    public Integer getDataInt() {
        return dataInt;
    }

    public void setDataInt(Integer dataInt) {
        this.dataInt = dataInt;
    }
}

class MetrixCordination{
    private String id;
    private Integer inicializeIIndex;
    private Integer inicializeJIndex;
    private Integer anotherExpandKIndex;
    private Integer anotherExpandLIndex;
    private String metixSynchronizedInputId;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public Integer getInicializeIIndex() {
        return inicializeIIndex;
    }

    public void setInicializeIIndex(Integer inicializeIIndex) {
        this.inicializeIIndex = inicializeIIndex;
    }

    public Integer getInicializeJIndex() {
        return inicializeJIndex;
    }

    public void setInicializeJIndex(Integer inicializeJIndex) {
        this.inicializeJIndex = inicializeJIndex;
    }

    public Integer getAnotherExpandKIndex() {
        return anotherExpandKIndex;
    }

    public void setAnotherExpandKIndex(Integer anotherExpandKIndex) {
        this.anotherExpandKIndex = anotherExpandKIndex;
    }

    public Integer getAnotherExpandLIndex() {
        return anotherExpandLIndex;
    }

    public void setAnotherExpandLIndex(Integer anotherExpandLIndex) {
        this.anotherExpandLIndex = anotherExpandLIndex;
    }

    public String getMetixSynchronizedInputId() {
        return metixSynchronizedInputId;
    }

    public void setMetixSynchronizedInputId(String metixSynchronizedInputId) {
        this.metixSynchronizedInputId = metixSynchronizedInputId;
    }
}

0 人点赞