www.日本精品,久久中文视频,中文字幕第一页在线播放,香蕉视频免费网站,老湿机一区午夜精品免费福利,91久久综合精品国产丝袜长腿,欧美日韩视频精品一区二区

999.,車可用捕獲量x

發(fā)布時間:2020-09-07 來源: 講話發(fā)言 點擊:

 999. 車的可用捕獲量 在一個 8 x 8 的棋盤上,有一個白色車(rook)。也可能有空方塊,白色的象(bishop)和黑色的卒(pawn)。它們分別以字符 “R”,“.”,“B” 和 “p” 給出。大寫字符表示白棋,小寫字符表示黑棋。

 車按國際象棋中的規(guī)則移動:它選擇四個基本方向中的一個(北,東,西和南),然后朝那個方向移動,直到它選擇停止、到達棋盤的邊緣或移動到同一方格來捕獲該方格上顏色相反的卒。另外,車不能與其他友方(白色)象進入同一個方格。

 返回車能夠在一次移動中捕獲到的卒的數(shù)量。

  示例 1:

。

  輸入:[[".",".",".",".",".",".",".","."],[".",".",".","p",".",".",".","."],[".",".",".","R",".",".",".","p"],[".",".",".",".",".",".",".","."],[".",".",".",".",".",".",".","."],[".",".",".","p",".",".",".","."],[".",".",".",".",".",".",".","."],[".",".",".",".",".",".",".","."]]

 輸出:3

 解釋:

 在本例中,車能夠捕獲所有的卒。

 示例 2:

。

  輸入:[[".",".",".",".",".",".",".","."],[".","p","p","p","p","p",".","."],[".","p","p","B","p","p",".","."],[".","p","B","R","B","p",".","."],[".","p","p","B","p","p",".","."],[".","p","p","p","p","p",".","."],[".",".",".",".",".",".",".","."],[".",".",".",".",".",".",".","."]]

 輸出:0

 解釋:

 象阻止了車捕獲任何卒。

 示例 3:

。

  輸入:[[".",".",".",".",".",".",".","."],[".",".",".","p",".",".",".","."],[".",".",".","p",".",".",".","."],["p","p",".","R",".","p","B","."],[".",".",".",".",".",".",".","."],[".",".",".","B",".",".",".","."],[".",".",".","p",".",".",".","."],[".",".",".",".",".",".",".","."]]

 輸出:3

 解釋:

 車可以捕獲位置 b5,d6 和 f5 的卒。

 提示:

 提示:

 1 board.length == board[i].length == 8

 2 board[i][j]

 可以是 "R" , "." , "B"

 或 "p"

 3. 只有一個格子上存在 board[i][j] == "R"

相關(guān)熱詞搜索:捕獲量 可用 999

版權(quán)所有 蒲公英文摘 www.newchangjing.com