In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-21 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly explains "how to use C++ to build building block Mini Game". The content of the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought. Let's study and learn how to use C++ to build Mini Game.
Xiao Ming is very interested in building blocks. His building blocks are all cubes of the same size.
When building blocks, Xiaoming selects m blocks as the foundation, arranges them word by word on the table, leaving no space in the middle, and calls them the zero floor.
Then, Xiao Ming can put the first floor, the second floor, …... , up to the nth floor Three rules must be followed in the placement of building blocks
Rule 1: each building block must be placed directly above a building block and aligned with the building block on the next floor
Rule 2: the building blocks in the same layer must be placed continuously with no gaps in the middle.
Rule 3: you can't put building blocks in places that Xiaoming doesn't like.
Among them, the locations that Xiaoming does not like are marked on the drawings. There are n lines in the drawing, and each line from bottom to top corresponds to the first floor to the nth floor of the building block. Each line has m characters, and the character may be'.' Or'X', where'X 'indicates that this position is not liked by Xiaoming.
Now, Xiao Ming wants to know how many building blocks there are. He found you to take part in the Blue Bridge Cup to help him calculate the answer.
Since the answer may be large, you only need to answer the result of modeling the answer to 1000000007 (1.000000007 billion).
Note: leaving nothing on the foundation is also one of the solutions.
Input format:
The first row of the data has two positive integers n and m, which represent the size of the drawing.
Then n lines, each with m characters, are used to describe the drawing. Each character can only be'.' Or'X'.
Output format:
An integer that represents the result of the answer modeled on 1000000007.
Enter sample 1:
2 3
.. X
.X.
Sample output 1:
four
Enter sample 2:
3 3
.. X
.X.
...
Sample output 2:
sixteen
Ideas for solving the problem:
First of all, we derive the recursive formula and observe the topic:
Expressed in code is:
For (int cymb1 / n > m; getchar (); for (int I = n; I > 0; iMel -) {/ / initialize the prefix and for (int j = 1; j
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.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.