Getting started with the game (ACM game combination)

Source: Internet
Author: User

Miyu original, post Please note: Reprinted from__________ White House

Find a balance (also known as a defeat, Singular situation), (YES: any non-equilibrium state can be changed to an equilibrium state after an operation)

(I)Bashi game(Bash game ):

only a bunch of n items , two people take things from these items in turn , specify at least one , up to m . winners .

N = (m + 1) R + S, (R is any natural number, S ≤ m), that is, N % (m + 1 )! = 0, the first accessor must win

(II)Weizoboyi(Wythoff game ):

There are two heaps of items,Two people take the same number of items from one or both of them in turn.,Requires at least one,Unlimited,The final winner.

(AK, BK) (Ak ≤ BK, K = 0, 1, 2,..., n) indicatesSingular situation

Method:

Ak = [K (1 + √ 5)/2], BK = ak + K (k = 0, 1, 2,..., n square brackets indicate the entire function)

Judgment:

Gold = (1 + SQRT (5.0)/2.0;

1) Assume that (a, B) is a singular situation of the K type (k =, 2...) So k = B-;

2) judge its A = (INT) (K * gold). If it is equal, it is a strange situation.

(Note: Use appropriate methods,The non-singular situation can be changed to a singular situation..

Assume that the situation is (a, B)

If B = A, a object is taken from both heaps and changed to a singular situation (0, 0 );

1.If a = ak,

1.1B> BK, then, the objects B-BK are taken away, that is, the singular situation (AK, BK );

1.2B <BK takes Ak-A [B-Ak] objects from the two heaps at the same time and changes to a singular situation (A [B-Ak], A [B-Ak] + B-ak );

2If a = BK,

2.1B> AK, the excess number of B-ak is removed from the second heap.

2.2B <AK, if B = AJ (j <k) takes the excess number A-BJ from the first heap; (a> BJ)

If B = BJ (j <K) is removed from the first heap a-AJ; (a> AJ)

)

Example:PKU 1067

( 3 ) nimboi (nimm game):

Yes n items in the heap , two people take multiple items from a pile in turn , specify at least one , unlimited , final winner .

AnySingular situation(A1, A2 ,... , An) all have A1 (+) A2 (+ )... (+) An = 0. (+) is by bit ^)

About Nim games:

(1) There are two players;

(2) There are three groups of playing cards (for example, 5, 7, and 9 cards );

    The two sides of the game operate in turn;

(3) Each player's operation is to select a pile of cards and take any cards from them;

    The winner of the last shot;

Definition: Suppose (XM · X0) 2 and (ym · y0) 2 Nim-sum is (ZM · z0) 2, then we represent (XM · X0) 2 values (ym · y0) 2 = (ZM · z0) 2,
Here, zk = XK + YK (mod 2) (k = 0... M ).

Theorem 1 of Nim games:

For a nim game location (x1, x2, X3), when and only when the Nim-sum of each of its parts is equal to 0 (that is, X1 ready X2 ready X3 = 0) (x1, x2, X3 do an exception or operation ^), it is currently in a bid.

 Theorem 1 applies to more heap cases!

Example:PKU 2234

Example:HDU 1730

Example:PKU 1740

Example:PKU 1704

Example:PKU 1082 (Massive Analysis...The conclusion is simple. It can also be simulated based on simple inferences.)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.