用java实现野人传教士过河问题

传教士和野人各三人过河,只有一条船,都会划船,一次只能载两人,野多于传时传就会被吃掉求安全过河的解?如何用Java实现?急求源代码!
最新回答
暗恋是最省钱的

2024-11-27 05:28:59

//CrossRiverQuestion.java
import java.util.ArrayList;
import java.util.List;

public class CrossRiverQuestion {
    public static void main(String[] args) {
        CrossRiverQuestion q = new CrossRiverQuestion(5, 4);
        q.solveQuestion();
    }
    private int peoNum;
    private int savageNum;
    private List<Node> resultList = new ArrayList<Node>();
    public List<Node> solveQuestion() {
        Node n = new Node(peoNum,savageNum,0,0,0,new ArrayList<Integer>(),0,0);
        boolean dfsResult = dfs(n);
        if(dfsResult) {
            resultList.add(0,n);
            for(Node node : resultList) {
                System.out.println("左岸传教士:"+node.getLeftPeo()+"左岸野人: "+node.getLeftSavage()+" 右岸传教士: "+node.getRightPeo()+"右岸野人:"+node.getRightSavage()+"船上传教士:"+node.getOnBoatPeoNum()+"船上野人:"+node.getOnBoatSavageNum());
            }
            return resultList;
        }
        return null;
    }
    
    public CrossRiverQuestion(int peoNum, int savageNum) {
        super();
        this.peoNum = peoNum;
        this.savageNum = savageNum;
    }

    private boolean dfs(Node n) {
        if(n.hasVisited()) return false;
        n.addCheckSum();
        if(n.getLeftPeo()==0&&n.getLeftSavage()==0) return true;
        if(n.getLeftPeo()<0||n.getRightPeo()<0||n.getLeftSavage()<0||n.getRightSavage()<0) {
            return false;
        }
        if(n.getLeftPeo()<n.getLeftSavage()&&n.getLeftPeo()>0) return false;
        if(n.getRightPeo()<n.getRightSavage()&&n.getRightPeo()>0) return false;
        if(n.getCURR_STATE()==n.getStateBoatLeft()) {
            Node n1 = new Node(n.getLeftPeo()-1,n.getLeftSavage()-1,n.getRightPeo()+1,n.getRightSavage()+1,n.getStateBoatRight(),n.getNodesCheckSum(),1,1);
            if(dfs(n1)) {
                resultList.add(0,n1);
                return true;
            }
            Node n4 = new Node(n.getLeftPeo()-2,n.getLeftSavage(),n.getRightPeo()+2,n.getRightSavage(),n.getStateBoatRight(),n.getNodesCheckSum(),2,0);
            if(dfs(n4)) {
                resultList.add(0,n4);
                return true;
            }
            Node n5 = new Node(n.getLeftPeo(),n.getLeftSavage()-2,n.getRightPeo(),n.getRightSavage()+2,n.getStateBoatRight(),n.getNodesCheckSum(),0,2);
            if(dfs(n5))  {
                resultList.add(0,n5);
                return true;
            }
        } 
        else {
            Node n6 = new Node(n.getLeftPeo(),n.getLeftSavage()+1,n.getRightPeo(),n.getRightSavage()-1,n.getStateBoatLeft(),n.getNodesCheckSum(),0,1);
            if(dfs(n6)) {
                resultList.add(0,n6);
                return true;
            }
            Node n7 = new Node(n.getLeftPeo()+1,n.getLeftSavage(),n.getRightPeo()-1,n.getRightSavage(),n.getStateBoatLeft(),n.getNodesCheckSum(),1,0);
            if(dfs(n7)) {
                resultList.add(0,n7);
                return true;
            }
            Node n1 = new Node(n.getLeftPeo()+1,n.getLeftSavage()+1,n.getRightPeo()-1,n.getRightSavage()-1,n.getStateBoatLeft(),n.getNodesCheckSum(),1,1);
            if(dfs(n1)) {
                resultList.add(0,n1);
                return true;
            }
            Node n4 = new Node(n.getLeftPeo()+2,n.getLeftSavage(),n.getRightPeo()-2,n.getRightSavage(),n.getStateBoatLeft(),n.getNodesCheckSum(),2,0);
            if(dfs(n4)) {
                resultList.add(0,n4);
                return true;
            }
            Node n5 = new Node(n.getLeftPeo(),n.getLeftSavage()+2,n.getRightPeo(),n.getRightSavage()-2,n.getStateBoatLeft(),n.getNodesCheckSum(),0,2);
            if(dfs(n5))  {
                resultList.add(0,n5);
                return true;
            }
        }
        return false;
    }
    public List<Node> getResultList() {
        return resultList;
    }
    
}

Node.java

import java.util.ArrayList;
import java.util.List;

public class Node {
    private List<Integer> nodesCheckSum = new ArrayList<Integer>();
    private int leftPeo;
    private int rightPeo;
    private int leftSavage;
    private int rightSavage;
    private int CURR_STATE = 0;
    private int onBoatPeoNum = 0;
    private int onBoatSavageNum = 0;
    private final int STATE_BOAT_LEFT = 0;
    private final int STATE_BOAT_RIGHT = 1;
    public Node(int leftPeo, int leftSavage, int rightPeo, int rightSavage, int state, List checkSumList, int onBoatPeoNum, int onBoatSavageNum) {
        this.CURR_STATE = state;
        this.leftPeo = leftPeo;
        this.leftSavage = leftSavage;
        this.rightPeo = rightPeo;
        this.rightSavage = rightSavage;
        this.nodesCheckSum.addAll(checkSumList);
        this.onBoatPeoNum = onBoatPeoNum;
        this.onBoatSavageNum = onBoatSavageNum;
    }
    public int getLeftPeo() {
        return leftPeo;
    }
    public void setLeftPeo(int leftPeo) {
        this.leftPeo = leftPeo;
    }
    public int getRightPeo() {
        return rightPeo;
    }
    public void setRightPeo(int rightPeo) {
        this.rightPeo = rightPeo;
    }
    public int getLeftSavage() {
        return leftSavage;
    }
    public void setLeftSavage(int leftSavage) {
        this.leftSavage = leftSavage;
    }
    public int getRightSavage() {
        return rightSavage;
    }
    public void setRightSavage(int rightSavage) {
        this.rightSavage = rightSavage;
    }
    @Override
    public String toString() {
        return leftPeo+","+leftSavage+","+rightPeo+","+rightSavage+","+CURR_STATE;
    }
    public int getCURR_STATE() {
        return CURR_STATE;
    }
    public void setCURR_STATE(int cURR_STATE) {
        CURR_STATE = cURR_STATE;
    }
    public int getStateBoatLeft() {
        return STATE_BOAT_LEFT;
    }
    public int getStateBoatRight() {
        return STATE_BOAT_RIGHT;
    }
    public int calcCheckSum() {
        return 1*getCURR_STATE()+10*getLeftPeo()+100*getLeftSavage()+1000*getRightPeo()+10000*getRightSavage();
    }
    public void addCheckSum() {
        int checkSum = calcCheckSum();
        nodesCheckSum.add(checkSum);
    }
    public boolean hasVisited() {
        int sum = calcCheckSum();
        for (Integer checkSum : nodesCheckSum) {
            if(checkSum==sum) return true;
        }
        return false;
    }
    public List<Integer> getNodesCheckSum() {
        return nodesCheckSum;
    }
    public int getOnBoatPeoNum() {
        return onBoatPeoNum;
    }
    public void setOnBoatPeoNum(int onBoatPeoNum) {
        this.onBoatPeoNum = onBoatPeoNum;
    }
    public int getOnBoatSavageNum() {
        return onBoatSavageNum;
    }
    public void setOnBoatSavageNum(int onBoatSavageNum) {
        this.onBoatSavageNum = onBoatSavageNum;
    }
    
}

劣性失格

2024-11-27 06:02:08

 
 
 
解题时可以把渡河的过程省略掉,也就是可以忽略河的存在。
为了用 Java 解这道题,我写了 3 个类:
河边(RiverSide)、河景(RiverScene)和解题者(MACPS,即 Missionaries And Cannibals Puzzle Solver)。

问题中的传教士、野人和船都是非常简单的物件,所以就简单地用单字符字符串“m”、“c” 和 “v”来代表。

其实那三个类都很简单;它们之间的关系也很简单:
1)每个河边都能有 0 或更多的 m 和 c,及最多 1 个 v。
2)每个河景里有两个河边。
3)解题者里有两个河景:初始河景和终极河景。

解题者的任务就是要搜索出能把初始河景及终极河景连起来的河景系列。
解题者的 getSolutionSteps( )以递归的方式作深度优先搜索。

其它两个“类”(Combinatorics 和 Copy)都是只提供一个方法的简单类。

代码里有文档。 有不明白的地方可以问。
你可以用类似 Jacobe (
http://www.tiobe.com/jacobe.htm
)的程序恢复代码原有的缩进。

import java.util.*;
import java.io.*;

/**
* Missionaries And Cannibals Puzzle Solver.
*
* Solution to the puzzle must not violate any of the following 2 rules:
* 1) Relative headcount: cannibals can't outnumber missionaries at any point.
* 2) Boat's loading: mustn't exceed the max.
*/
public class MACPS {
public class SolutionNotFoundException extends RuntimeException { }

static final Object MISSIONARY = "m", // Simple representation
CANNIBAL = "c", // of objects
BOAT = "v"; // in the puzzle.
private int boat_max_load,
boat_min_load = 1; // Shouldn't be any other value.
private RiverScene firstScene,
finalScene;

// Recursively searches for a solution using Depth-First Search strategy.
// Takes a Stack containing only the first scene (root of tree).
// Returns a collection of scenes connecting the first scene to the final.
// Throws SolutionNotFoundException for obvious reason.
// Deploys the following optimization strategy:
// Transfers as much as possible from source side,
// as little as possible from target side.
private Collection getSolutionSteps( Stack takenSteps ) {
RiverScene lastScene = ( RiverScene ) takenSteps.peek( );
if( lastScene.equals( finalScene ) ) return takenSteps;

RiverScene newStep = lastScene.deepCopy( );

// To allow transfer in both directions to share the same chunk of code.
int start = boat_max_load,
stop = boat_min_load - 1,
step = -1;
RiverSide from = newStep.lside,
to = newStep.rside;
if( to.hasBoat( ) ) {
start = boat_min_load;
stop = boat_max_load + 1;
step = 1;
from = newStep.rside;
to = newStep.lside;
}

for( int nPassenger = start; nPassenger != stop; nPassenger += step ) {
Collection menCombs = new HashSet( // HashSet eliminates duplicates.
Combinatorics.combinations( from.getMenList( ), nPassenger ) );

nextComb:
for( Iterator comb = menCombs.iterator( ); comb.hasNext( ); ) {
Collection menList = ( Collection ) comb.next( );
try {
from.transferMen( to, menList );

// If it's a taken step, undo and try next combination.
for( Iterator i = takenSteps.iterator( ); i.hasNext( ); )
if( i.next( ).equals( newStep ) ) {
to.transferMen( from, menList );
continue nextComb;
}

takenSteps.push( newStep );
return getSolutionSteps( takenSteps );
}
catch( SecurityException e ) {
// Transfer didn't take place. Just try next combination.
}
catch( SolutionNotFoundException e ) {
// New step led to no solution in leaves. Undo, then next.
takenSteps.pop( );
to.transferMen( from, menList );
}
}
}
// All possible steps led to no solution, so
throw new SolutionNotFoundException( );
}

// Do setup, then kick-starts getSolutionSteps( Stack takenSteps ).
public Collection
getSolutionSteps( int nMissionary, int nCannibal, int boatCapacity ) {
if( nMissionary < 0 || nCannibal < 0 || boatCapacity < 0 )
throw new IllegalArgumentException( "Negative argument value." );

RiverSide sourceSide = new RiverSide( nMissionary, nCannibal, true ),
targetSide = new RiverSide( 0, 0, false );
boat_max_load = boatCapacity;
firstScene = new RiverScene( sourceSide, targetSide );
finalScene = new RiverScene( targetSide, sourceSide );

if( firstScene.lside.fatal( ) ) // First scene can be valid but fatal.
throw new SolutionNotFoundException( );

Stack steps = new Stack( );
steps.push( firstScene );
return getSolutionSteps( steps );
}

public static void main( String[ ] args ) {
int nMissionary = 3,
nCannibal = 3,
boatCapacity = 2;

System.out.println(
"\nSolving the puzzle of Missionaries And Cannibals with\n" +
nMissionary + " missionaries and " + nCannibal + " cannibals " +
"and a boat that can take up to " + boatCapacity + " creatures.." );

try {
Collection steps = new MACPS( ).
getSolutionSteps( nMissionary, nCannibal, boatCapacity );
System.out.println( "\nSolution found:\n" );
for( Iterator step = steps.iterator( ); step.hasNext( ); )
System.out.println( step.next( ) + "\n" );
}
catch( SolutionNotFoundException e ) {
System.out.println( "\nNo solution found." );
}
}
}

/**
* Represents a riverside in the puzzle.
*/
class RiverSide implements Serializable {
private ArrayList men = new ArrayList( ),
boat = new ArrayList( );

public RiverSide( int nMissionary, int nCannibal, boolean withBoat ) {
men.addAll( Collections.nCopies( nMissionary, MACPS.MISSIONARY ) );
men.addAll( Collections.nCopies( nCannibal, MACPS.CANNIBAL ) );
Collections.sort( men );
if( withBoat ) boat.add( MACPS.BOAT );
}

public RiverSide deepCopy( ) {
return ( RiverSide ) Copy.deepCopy( this );
}

public Collection getMenList( ) {
return ( Collection ) Copy.deepCopy( men );
}

public boolean equals( Object otherSide ) {
RiverSide other = ( RiverSide ) otherSide;
Collections.sort( men );
Collections.sort( other.men );
return this.men.equals( other.men ) && this.boat.equals( other.boat );
}

public String toString( ) {
return "BOAT" + boat + "\t" + "MEN" + men;
}

public boolean hasBoat( ) {
return ! boat.isEmpty( );
}

// Checks for violation of Rule #1.
public boolean fatal( ) {
int mCount = 0, cCount = 0;
for( Iterator i = men.iterator( ); i.hasNext( ); ) {
Object val = i.next( );
if( val.equals( MACPS.MISSIONARY ) ) ++mCount;
if( val.equals( MACPS.CANNIBAL ) ) ++cCount;
}
return mCount > 0 && mCount < cCount;
}

// Throws SecurityException if the transfer of all men in menList
// from this to destination *will* result in violation of Rule #1.
// Else, executes the transfer.
public void transferMen( RiverSide destination, Collection menList ) {
for( Iterator i = menList.iterator( ); i.hasNext( ); )
destination.men.add( men.remove( men.indexOf( i.next( ) ) ) );

// A nice place to automate boat transfer.
_transferBoat( destination );

// Undo the transfer if it led to violation of Rule #1.
if( fatal( ) || destination.fatal( ) ) {
destination.transferMen( this, menList );
throw new SecurityException( );
}
}

// Tansfers boat from this to destination. Called only by transferMen( ).
private void _transferBoat( RiverSide destination ) {
destination.boat.add( boat.remove( 0 ) );
}
}

/**
* Combines two riversides. Serves mainly as a data object.
*/
class RiverScene implements Serializable {
RiverSide lside, rside; // Package access.

public RiverScene( RiverSide lside, RiverSide rside ) {
this.lside = lside.deepCopy( );
this.rside = rside.deepCopy( );
}

public RiverScene deepCopy( ) {
return ( RiverScene ) Copy.deepCopy( this );
}

public boolean equals( Object otherScene ) {
RiverScene other = ( RiverScene ) otherScene;
return lside.equals( other.lside ) && rside.equals( other.rside );
}

public String toString( ) {
return "Left Side:\t" + lside + "\n" + "Right Side:\t" + rside;
}
}

/**
* Provides a static method to generate combinations of items taken r at a time.
*/
class Combinatorics {
public static Collection combinations( Collection items, int r ) {
if( r == 0 ) // Return [ [ ] ]. Note that [ ] denotes a List.
return Collections.nCopies( 1, new ArrayList( ) );

List copy = new ArrayList( items ), // To enable subListing of items.
result = new ArrayList( );
for( int i = 0; i < copy.size( ); ++i ) {
Collection subCombs =
combinations( copy.subList( i + 1, copy.size( ) ), r - 1 );
for( Iterator iter = subCombs.iterator( ); iter.hasNext( ); ) {
// Assign [ [ items.get( i ) ] ] to subComb.
List subComb = new ArrayList( copy.subList( i, i + 1 ) );

subComb.addAll( ( List ) iter.next( ) );
result.add( subComb );
}
}
return result;
}
}

/**
* Provides a static method to perform deepcopy of object via serialization.
*/
class Copy {
public static Object deepCopy( Object o ) {
try {
ByteArrayOutputStream baos = new ByteArrayOutputStream( );
ObjectOutputStream oos = new ObjectOutputStream( baos );
oos.writeObject( o );
oos.close( );

ObjectInputStream ois =
new ObjectInputStream(
new ByteArrayInputStream( baos.toByteArray( ) ) );
return ois.readObject( );
}
catch ( Exception e ) {
throw new RuntimeException( e );
}
}
}
 
 
 
一生玺爱

2024-11-27 04:58:09

野人过河问题算法分析

野人过河问题属于人工智能学科中的一个经典问题,问题描述如下: 有三个牧师(也有的翻译为传教士)和三个野人过河,只有一条能装下两个人的船,在河的任何一方或者船上,如果野人的人数大于牧师的人数,那么牧师就会有危险. 你能不能找出一种安全的渡河方法呢?
一、算法分析
先来看看问题的初始状态和目标状态,假设和分为甲岸和乙岸:
初始状态:甲岸,3野人,3牧师;
乙岸,0野人,0牧师;
船停在甲岸,船上有0个人;
目标状态:甲岸,0野人,0牧师;
乙岸,3野人,3牧师;
船停在乙岸,船上有0个人;
整个问题就抽象成了怎样从初始状态经中间的一系列状态达到目标状态。问题状态的改变是通过划船渡河来引发的,所以合理的渡河操作就成了通常所说的算符,根据题目要求,可以得出以下5个算符(按照渡船方向的不同,也可以理解为10个算符):
渡1野人、渡1牧师、渡1野人1牧师、渡2野人、渡2牧师
算符知道以后,剩下的核心问题就是搜索方法了,本文采用深度优先搜索,通过一个findnext(…)函数找出下一步可以进行的渡河操作中的最优操作,如果没有找到则返回其父节点,看看是否有其它兄弟节点可以扩展,然后用process(…)函数递规调用findnext(…),一级一级的向后扩展。
搜索中采用的一些规则如下:
1、渡船优先规则:甲岸一次运走的人越多越好(即甲岸运多人优先),同时野人优先运走;
乙岸一次运走的人越少越好(即乙岸运少人优先),同时牧师优先运走;
2、不能重复上次渡船操作(通过链表中前一操作比较),避免进入死循环;
3、任何时候河两边的野人和牧师数均分别大于等于0且小于等于3;
4、由于只是找出最优解,所以当找到某一算符(当前最优先的)满足操作条件后,不再搜索其兄弟节点,而是直接载入链表。
5、若扩展某节点a的时候,没有找到合适的子节点,则从链表中返回节点a的父节点b,从上次已经选择了的算符之后的算符中找最优先的算符继续扩展b。

二、基本数据结构
仔细阅读问题,可以发现有些基本东西我们必须把握,例如:每时刻河两岸野人牧师各自的数目、船的状态、整个问题状态。所以我们定义如下几个数据结构:
typedef struct _riverside // 岸边状态类型
{
int wildman; // 野人数
int churchman; // 牧师数
}riverside;
typedef struct _boat // 船的状态类型
{
int wildman; // 野人数
int churchman; // 牧师数
}boat;
typedef struct _question // 整个问题状态
{
riverside riverside1; // 甲岸
riverside riverside2; // 乙岸
int side; // 船的位置, 甲岸为-1, 乙岸为1
boat boat; // 船的状态
_question* pprev; // 指向前一渡船操作
_question* pnext; // 指向后一渡船操作
}question;
用question来声明一个最基本的链表。

三、程序流程及具体设计
本文只找出了最优解,据我所知,本问题有三种解。如果真要找出这三种解,^_^,那就得加强对链表的操作了,比如说自己写一个动态链表类,顺便完成一些初始化工作,估计看起来会舒服些。
下面给出部分关键程序:
// 主函数
int main()
{
// 初始化
question* phead = new question;
phead->riverside1.wildman = 3;
phead->riverside1.churchman = 3;
phead->riverside2.wildman = 0;
phead->riverside2.churchman = 0;
phead->side = -1; // 船在甲岸
phead->pprev = null;
phead->pnext = null;

phead->boat.wildman = 0;
phead->boat.churchman = 0;
if (process(phead))
{
// ......... 遍历链表输出结果
}
cout<<"成功渡河。";
}
else
cout<<"到底怎样才能渡河呢? 郁闷!"<<endl;
// 回收内存空间
while (phead)
{
question* ptemp = phead->pnext;
delete phead;
phead=ptemp;
}
phead = null;
return 0;
}

// 渡船过程, 递规调用函数findnext(...)

bool process(question* pquest)
{
if (findnext(pquest))
{
question* pnew = new question;
pnew->riverside1.wildman = pquest->riverside1.wildman + pquest->boat.wildman*(pquest->side);
pnew->riverside1.churchman = pquest->riverside1.churchman + pquest->boat.churchman*(pquest->side);
pnew->riverside2.wildman = 3 - pnew->riverside1.wildman;
pnew->riverside2.churchman = 3 - pnew->riverside1.churchman;
pnew->side = (-1)*pquest->side;
pnew->pprev = pquest;
pnew->pnext = null;
pnew->boat.wildman = 0;
pnew->boat.churchman = 0;
pquest->pnext = pnew;
if (pnew->riverside2.wildman==3 && pnew->riverside2.churchman==3)
return true; // 完成
return process(pnew);
}
else
{
question* pprev = pquest->pprev;
if (pprev == null)
return false; // 无解
delete pquest;
pprev->pnext = null;
return process(pprev); // 返回其父节点重新再找
}
return true;
}

// 判断有否下一个渡河操作, 即根据比较算符找出可以接近目标节点的操作
// 算符共5个: 1野/ 1牧 / 1野1牧 / 2野 / 2牧
bool findnext(question* pquest)
{
// 基本规则
// 渡船的优先顺序: 甲岸运多人优先, 野人优先; 乙岸运少人优先, 牧师优先.
static boat boatstate[5]; // 5个算符
if (pquest->side == -1)
{
boatstate[0].wildman = 2;

boatstate[0].churchman = 0;
boatstate[1].wildman = 1;
boatstate[1].churchman = 1;
boatstate[2].wildman = 0;
boatstate[2].churchman = 2;
boatstate[3].wildman = 1;
boatstate[3].churchman = 0;
boatstate[4].wildman = 0;
boatstate[4].churchman = 1;
}
else
{
boatstate[0].wildman = 0;
boatstate[0].churchman = 1;
boatstate[1].wildman = 1;
boatstate[1].churchman = 0;
boatstate[2].wildman = 0;
boatstate[2].churchman = 2;
boatstate[3].wildman = 1;
boatstate[3].churchman = 1;
boatstate[4].wildman = 2;
boatstate[4].churchman = 0;
}
int i; // 用来控制算符
if (pquest->boat.wildman == 0 && pquest->boat.churchman == 0) // 初始状态, 第一次渡河时
i = 0; // 取算符1
else
{
for (i=0; i<5; i++) // 扩展同一节点时, 已经用过的算符不再用, 按优先级来
if (pquest->boat.wildman == boatstate[i].wildman && pquest->boat.churchman == boatstate[i].churchman)
break;
i++;
}
if (i < 5)
{
int j;
for (j=i; j<5; j++)
{
int nwildman1 = pquest->riverside1.wildman + boatstate[j].wildman * pquest->side;
int nchurchman1 = pquest->riverside1.churchman + boatstate[j].churchman * pquest->side;
int nwildman2 = 3 - nwildman1;
int nchurchman2 = 3 - nchurchman1;
// 判断本次操作的安全性, 即牧师数量>=野人或牧师数为0
if ((nwildman1 <= nchurchman1 || nchurchman1 == 0) &&

(nwildman2 <= nchurchman2 || nchurchman2 == 0) &&
nwildman1 >=0 && nchurchman1 >=0 && nwildman2 >=0 && nchurchman2 >= 0)
{
// 本操作是否重复上次操作,注意方向不同
if (pquest->pprev != null)
{
if (pquest->pprev->boat.wildman == boatstate[j].wildman &&
pquest->pprev->boat.churchman == boatstate[j].churchman)
continue;
}
break; // 该操作可行, 推出循环,只找出当前最优节点
}
}
if (j < 5)
{
pquest->boat.wildman = boatstate[j].wildman;
pquest->boat.churchman = boatstate[j].churchman;
return true;
}
}
return false;

}
初夏迷音ㄣ

2024-11-27 04:40:13

思路:2野 2传 1传1野
离鸿

2024-11-27 07:11:15

有点麻烦