Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to realize the coloring game on C++

2025-01-15 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

C++ how to achieve coloring games, many novices are not very clear about this, in order to help you solve this problem, the following small series will explain in detail for everyone, there are people who need this to learn, I hope you can gain something.

On a 2*N grid, Alice and Bob begin a new game journey.

Alice and Bob take turns coloring in these cells, using two coloring tools, the first to color any cell, and the second to color any 2*2 cell. In each round, they can choose a tool to color the uncolored squares. Note that when coloring 2*2 cells, all 4 cells should be uncolored. The player who paints all the squares in the last step wins.

As always, Alice goes first, optimal strategy, who wins? Input The first line T indicates that there are T sets of test data. Each set of data contains two numbers, N and M, where M indicates how many cells have been colored. The next M rows have two numbers Xi and Yi in each row, indicating the coordinates of the grid that have been colored.

[Technical Specification]

1. 1

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report