原文链接: https://leetcode-cn.com/problems/nim-game 英文原文You are playing the following Nim Game with your friend: Initially, there is a heap of stones on the table. You and your friend will alternate taking turns, and you go first. On each turn, the perso…
标签详情
博弈 分类
原文链接: https://leetcode-cn.com/problems/guess-number-higher-or-lower-ii 英文原文We are playing the Guessing Game. The game will work as follows: I pick a number between 1 and n. You guess a number. If you guess the right number, you win the game. If you g…
原文链接: https://leetcode-cn.com/problems/can-i-win 英文原文In the "100 game" two players take turns adding, to a running total, any integer from 1 to 10. The player who first causes the running total to reach or exceed 100 wins. What if we change the game …
原文链接: https://leetcode-cn.com/problems/predict-the-winner 英文原文You are given an integer array nums. Two players are playing a game with this array: player 1 and player 2. Player 1 and player 2 take turns, with player 1 starting first. Both players sta…
原文链接: https://leetcode-cn.com/problems/chalkboard-xor-game 英文原文You are given an array of integers nums represents the numbers written on a chalkboard. Alice and Bob take turns erasing exactly one number from the chalkboard, with Alice starting first.…
原文链接: https://leetcode-cn.com/problems/guess-the-word 英文原文This is an interactive problem. You are given an array of unique strings wordlist where wordlist[i] is 6 letters long, and one word in this list is chosen as secret. You may call Master.guess(…
原文链接: https://leetcode-cn.com/problems/stone-game 英文原文Alice and Bob play a game with piles of stones. There are an even number of piles arranged in a row, and each pile has a positive integer number of stones piles[i]. The objective of the game is to…
原文链接: https://leetcode-cn.com/problems/cat-and-mouse 英文原文A game on an undirected graph is played by two players, Mouse and Cat, who alternate turns. The graph is given as follows: graph[a] is a list of all nodes b such that ab is an edge of the graph…
原文链接: https://leetcode-cn.com/problems/divisor-game 英文原文Alice and Bob take turns playing a game, with Alice starting first. Initially, there is a number n on the chalkboard. On each player's turn, that player makes a move consisting of: Choosing any …
原文链接: https://leetcode-cn.com/problems/stone-game-ii 英文原文Alice and Bob continue their games with piles of stones. There are a number of piles arranged in a row, and each pile has a positive integer number of stones piles[i]. The objective of the game…
原文链接: https://leetcode-cn.com/problems/stone-game-iii 英文原文Alice and Bob continue their games with piles of stones. There are several stones arranged in a row, and each stone has an associated value which is an integer given in the array stoneValue. A…
原文链接: https://leetcode-cn.com/problems/stone-game-iv 英文原文Alice and Bob take turns playing a game, with Alice starting first. Initially, there are n stones in a pile. On each player's turn, that player makes a move consisting of removing any non-zero …
原文链接: https://leetcode-cn.com/problems/stone-game-v 英文原文There are several stones arranged in a row, and each stone has an associated value which is an integer given in the array stoneValue. In each round of the game, Alice divides the row into two no…
原文链接: https://leetcode-cn.com/problems/stone-game-viii 英文原文Alice and Bob take turns playing a game, with Alice starting first. There are n stones arranged in a row. On each player's turn, while the number of stones is more than one, they will do the …
原文链接: https://leetcode-cn.com/problems/sum-game 英文原文Alice and Bob take turns playing a game, with Alice starting first. You are given a string num of even length consisting of digits and '?' characters. On each turn, a player will do the following if…
原文链接: https://leetcode-cn.com/problems/remove-colored-pieces-if-both-neighbors-are-the-same-color 英文原文There are n pieces arranged in a line, and each piece is colored either by 'A' or by 'B'. You are given a string colors of length n where colors[i] …
原文链接: https://leetcode-cn.com/problems/stone-game-ix 英文原文Alice and Bob continue their games with stones. There is a row of n stones, and each stone has an associated value. You are given an integer array stones, where stones[i] is the value of the it…
原文链接: https://leetcode-cn.com/problems/fsa7oZ 英文原文 中文题目小力正在通过残局练习来备战「力扣挑战赛」中的「五子棋」项目,他想请你能帮他预测当前残局的输赢情况。棋盘中的棋子分布信息记录于二维数组 `pieces` 中,其中 `pieces[i] = [x,y,color]` 表示第 `i` 枚棋子的横坐标为 `x`,纵坐标为 `y`,棋子颜色为 `color`(`0` 表示黑棋,`1` 表示白棋)。假如黑棋先行,并且黑棋和白棋都按最优策略落子,请你…