CodeBus
www.codebus.net
Search
Sign in
Sign up
Hot Search :
Source
embeded
web
remote control
p2p
game
More...
Location :
Home
Search - FIRST FOLLOW S
Main Category
SourceCode
Documents
Books
WEB Code
Develop Tools
Other resource
Sub Category
Compress-Decompress algrithms
STL
Data structs
Algorithm
AI-NN-PR
matlab
Bio-Recognize
Crypt_Decrypt algrithms
mathematica
Maple
DataMining
Big Data
comsol
physical calculation
chemical calculation
simulation modeling
Search - FIRST FOLLOW S - List
[
Mathimatics-Numerical algorithms
]
find_the_marble
DL : 0
利用动态规划算法解决猜测弹珠位置的问题Alice and Bob are playing a game. This game is played with several identical pots and one marble.-Alice and Bob are playing a game. This game is played with several identical pots and one marble. When the game starts, Alice puts the pots in one line and puts the marble in one of the pots. After that, Bob cannot see the inside of the pots. Then Alice makes a sequence of swappings and Bob guesses which pot the marble is in. In each of the swapping, Alice chooses two different pots and swaps their positions. Unfortunately, Alice s actions are very fast, so Bob can only catch k of m swappings and regard these k swappings as all actions Alice has performed. Now given the initial pot the marble is in, and the sequence of swappings, you are asked to calculate which pot Bob most possibly guesses. You can assume that Bob missed any of the swappings with equal possibility. Input There are several test cases in the input file. The first line of the input file contains an integer N (N ≈ 100), then N cases follow. The first line of each test case contains 4 integers n, m, k and s(0 < s
Date
: 2025-12-20
Size
: 1kb
User
:
曦馨
CodeBus
is one of the largest source code repositories on the Internet!
Contact us :
1999-2046
CodeBus
All Rights Reserved.