第 14 / 17 页
非代码面试题
显示 20 / 321 道匹配题目
答题状态:未尝试未正确已正确
ID题目领域难度题型进度权限
5690Fibonacci NimA pile has 50 stones. On the FIRST move a player may remove any number of stones from 1 to 49 (not the whole pile). After that, a player may remove any number of stones up to TWICE the number the opponent just removed. The player taking the last stone wins. Does the first player win, and if so how many stones should they remove on the first move?脑筋急转弯中等数值题未尝试免费5691Chomp on a 2x3 BarChomp is played on a 2-by-3 grid of chocolate squares; the top-left square (row 1, column 1) is poisoned. A move picks any remaining square and eats it together with every square below and to the right of it. The player forced to eat the poisoned top-left square loses. Under optimal play, does the first player win or lose, and what is the standard argument?脑筋急转弯中等brainteaser未尝试免费5692Kayles Grundy ValueKayles is played on a single row of n adjacent bowling pins. A move knocks down either one pin or two ADJACENT pins, possibly splitting the row into two independent shorter rows. The player who knocks down the last pin wins. Compute the Sprague-Grundy value of a single row of 7 pins.脑筋急转弯中等数值题未尝试免费5693Dawson's Chess Grundy ValueDawson's chess is the octal game .137, whose Grundy values g(n) for n = 0,1,2,... are the well-known sequence 0,0,1,1,2,0,3,1,1,0,3,3,2,2,4,0,5,... (eventually periodic with period 34). In this game a position made of several independent strips is a win for the mover iff the XOR of the strips' Grundy values is nonzero. Using the published sequence, what is g(8)?脑筋急转弯困难数值题未尝试面试订阅5694Green Hackenbush StalksGreen Hackenbush is played on graphs of green edges rooted to the ground. A move deletes one edge; any edges no longer connected to the ground also disappear. The player unable to move loses. The position consists of three separate vertical stalks (paths) rising from the ground, of heights 4, 6, and 9 edges. Under optimal play, does the first player win or lose?脑筋急转弯简单brainteaser未尝试免费5695Turning Turtles (Coin-Turning Game)Turning Turtles is a coin-turning game on a row of coins numbered 1, 2, 3, ... A move chooses a coin showing HEADS at some position k, turns it to TAILS, and simultaneously turns over EXACTLY ONE other coin at a position j < k (to either face). The player who cannot move (all tails) loses. A standard result is that a single heads at position k is equivalent to a Nim heap of size k, and a position is the XOR (disjunctive sum) of its heads. If the only heads are at positions 3 and 6, does the player to move win or lose?脑筋急转弯中等brainteaser未尝试免费5696Grundy Values on a Game DAGA token sits on a vertex of a directed acyclic graph; a move slides it along one outgoing edge, and a player who cannot move (token on a sink) loses. The edges are: S to A, S to B, S to C; A to two distinct sinks; B to A and B to a sink; C to B. Sinks have Grundy value 0. Compute the Grundy values of A, B, C, and S.脑筋急转弯简单数值题未尝试免费5697Subtraction by Perfect SquaresFrom a single pile a player may remove any positive perfect-square number of stones (1, 4, 9, 16, ...). The player taking the last stone wins. Among pile sizes n = 0, 1, ..., 20, identify the losing (P-)positions for the player about to move, and state the 5th positive losing position.脑筋急转弯中等brainteaser未尝试免费5698Twelve Coins, Unknown DirectionYou have 12 coins that look identical. Exactly one is counterfeit and has a different weight from the rest, but you do NOT know whether it is heavier or lighter. Using only a two-pan balance scale (each weighing reports left-heavy, right-heavy, or balanced), what is the minimum number of weighings that guarantees you both identify the counterfeit AND determine whether it is heavy or light? Weighings may be chosen adaptively.脑筋急转弯中等brainteaser未尝试免费5699Sorting Five With Fewest ComparisonsYou must sort 5 distinct numbers using only pairwise comparisons, each of which returns which of the two compared elements is larger. What is the information-theoretic lower bound on the worst-case number of comparisons any comparison-based sorting algorithm needs, AND is that bound actually achievable for 5 elements? Give the minimum worst-case number of comparisons that guarantees a full sort.脑筋急转弯中等brainteaser未尝试免费5700Ten Hats in a Line10 players stand in a line. Each wears a red or blue hat, assigned independently by a fair coin. Each player sees all hats in FRONT of them but not their own nor those behind. Starting from the back of the line, each player in turn announces a single guess of their own hat color, heard by everyone. They agree on a strategy beforehand (no communication after hats are placed except the public guesses). Using the optimal parity strategy, how many of the 10 players are GUARANTEED to guess correctly regardless of the hat assignment?脑筋急转弯中等brainteaser未尝试免费5701Guess the Number 1 to 1000An adversary picks a secret integer between 1 and 1000 inclusive. You may ask yes/no questions, each answered truthfully, and you may choose each question adaptively based on previous answers. What is the minimum number of questions that guarantees you can determine the secret number in the worst case?脑筋急转弯简单brainteaser未尝试免费5702One Poisoned Bottle, Binary TestersYou have 1000 bottles of wine, exactly one of which is poisoned. A tester who drinks any amount containing the poison dies after exactly the same fixed delay, and you can have each tester sip from any combination of bottles simultaneously in a single round (results observed after the delay, before the celebration). If you only get ONE round of testing, what is the minimum number of testers needed to guarantee identifying the poisoned bottle?脑筋急转弯中等brainteaser未尝试免费5703Eight Coins, One Known LighterYou have 8 visually identical coins; exactly one is counterfeit and is known to be LIGHTER than the rest. Using a two-pan balance scale (left-heavy / right-heavy / balanced per weighing), what is the minimum number of weighings that guarantees identifying the light coin in the worst case? Weighings may be adaptive.脑筋急转弯简单brainteaser未尝试免费5704Heaviest and Runner-UpYou have 8 coins of pairwise-distinct weights and a balance scale that compares two single coins and tells you which is heavier. What is the minimum number of pairwise weighings, in the worst case, needed to identify BOTH the heaviest coin and the second-heaviest coin? (This is the classic tournament problem.)脑筋急转弯中等brainteaser未尝试免费5705Prisoners and the Lightbulb Counter100 prisoners take turns, one at a time in an arbitrary order chosen by a warden, entering a room with a single lightbulb (initially OFF). Each visiting prisoner may toggle the bulb and observe its state, but cannot otherwise communicate. At any point any prisoner may declare 'every prisoner has now visited at least once'; they win only if the declaration is true. They strategize beforehand. In the standard single-counter strategy, exactly one designated counter increments a tally when he finds the bulb ON (then switches it OFF), and every other prisoner switches the bulb ON the FIRST time they find it OFF (and never again). What total count must the counter reach before he can safely declare everyone has visited?脑筋急转弯困难brainteaser未尝试面试订阅5706How Many Coins in Three Weighings (Known Heavy)Among a pile of identical-looking coins exactly one is counterfeit and is known to be HEAVIER than the others. With a two-pan balance scale (each weighing returns left-heavy, right-heavy, or balanced) and exactly 3 weighings allowed, what is the LARGEST number of coins for which you can always guarantee identifying the heavy one? Weighings may be adaptive.脑筋急转弯简单brainteaser未尝试免费5707100 Prisoners and 100 Boxes100 prisoners are numbered 1 to 100. In a room, 100 boxes each contain one slip with a distinct number 1 to 100, placed by a uniformly random permutation. Each prisoner enters alone, may open at most 50 boxes, must find the slip bearing his own number, then leaves without communicating or altering anything. All 100 must succeed for the group to win. Using the optimal strategy (each prisoner opens the box with his number, then the box whose number matches the slip just found, following the permutation cycle), the win probability equals 1 minus the sum of 1/k for k from 51 to 100. To the nearest whole percent, what is this winning probability?脑筋急转弯困难brainteaser未尝试面试订阅5708Reference Coin Boosts CapacityExactly one coin among a pile is counterfeit, with weight different from the genuine ones, but you do NOT know whether it is heavier or lighter. You also have ONE extra coin that is guaranteed genuine, which you may place on the scale freely. Using a two-pan balance (each weighing returns left-heavy, right-heavy, or balanced) with exactly 3 weighings, what is the LARGEST number of suspect coins for which you can always both identify the fake and determine its direction? Weighings may be adaptive.脑筋急转弯困难brainteaser未尝试面试订阅5709Two Light Fakes Among SixYou have 6 visually identical coins. Exactly TWO of them are counterfeit and each counterfeit weighs the same known-lighter amount (both fakes are equally light); the other four are genuine and equal. Using a two-pan balance scale (each weighing returns left-heavy, right-heavy, or balanced), what is the minimum number of weighings that guarantees identifying WHICH two coins are the light pair in the worst case? Weighings may be adaptive.脑筋急转弯困难brainteaser未尝试面试订阅