 Dominoes

Problem Description
Some day, Tom's father buys him a box of dominoes blocks. In the box, there are 12 different blocks, which are shown above. Tom is a boy who likes to do practice in intelligence, so he spends a whole afternoon in finishing two different rectangles with 3 * 20, which are shown below.
①⑤⑤⑤⑤⑨⑩⑩⑩⑥⑥⑧②②②②②③④④
①⑤⑿⑿⑨⑨⑨⑩⑥⑥⑦⑧⑧⑧⑾⑾③③③④
①①①⑿⑿⑿⑨⑩⑥⑦⑦⑦⑦⑧⑾⑾⑾③④④①⑧⑦⑦⑦⑦⑥⑩⑨⑿⑿⑿②②②②②③④④
①⑧⑧⑧⑦⑥⑥⑩⑨⑨⑨⑿⑿⑤⑾⑾③③③④
①①①⑧⑥⑥⑩⑩⑩⑨⑤⑤⑤⑤⑾⑾⑾③④④Tom is sure that these are the only solutions for 3 * 20, and he wants to know the number of solutions for 4 * 15, 5 * 12, ... Can you help him?
You should notice that if a solution will be the same as the other by some flip or rotate, these two solutions should be consider as the same.
Input
There may be several test cases. Each contains a single line with two positive integers M and N, which means the shape of M * N. Here M * N = 60.Output
For each test case, output a line contains the number of solutions.Sample Input
1 60
3 20Sample Output
0
2
Dominoes _course
20170725Problem Description ![](http://acm.hdu.edu.cn/data/images/C15010141.jpg) Some day, Tom's father buys him a box of dominoes blocks. In the box, there are 12 different blocks, which are shown above. Tom is a boy who likes to do practice in intelligence, so he spends a whole afternoon in finishing two different rectangles with 3 * 20, which are shown below. ①⑤⑤⑤⑤⑨⑩⑩⑩⑥⑥⑧②②②②②③④④ ①⑤⑿⑿⑨⑨⑨⑩⑥⑥⑦⑧⑧⑧⑾⑾③③③④ ①①①⑿⑿⑿⑨⑩⑥⑦⑦⑦⑦⑧⑾⑾⑾③④④ ①⑧⑦⑦⑦⑦⑥⑩⑨⑿⑿⑿②②②②②③④④ ①⑧⑧⑧⑦⑥⑥⑩⑨⑨⑨⑿⑿⑤⑾⑾③③③④ ①①①⑧⑥⑥⑩⑩⑩⑨⑤⑤⑤⑤⑾⑾⑾③④④ Tom is sure that these are the only solutions for 3 * 20, and he wants to know the number of solutions for 4 * 15, 5 * 12, ... Can you help him? You should notice that if a solution will be the same as the other by some flip or rotate, these two solutions should be consider as the same. Input There may be several test cases. Each contains a single line with two positive integers M and N, which means the shape of M * N. Here M * N = 60. Output For each test case, output a line contains the number of solutions. Sample Input 1 60 3 20 Sample Output 0 2
Tiling Dominoes _course
20170819描述 Is it possible to tile a chessboard of size N*M with dominoes of size 2*1, satisfying that each square is covered exactly once? Foreseeable is such a smart guy to solve this problem. But what he really wants is a compact solution. A solution is called compact if and only if after Foreseeable tiles the chessboard like that, he cannot divide the chessboard into two rectangles without cutting off any piece of domino. Can you find a compact solution for him? 输入 The first line contains an integer T (1 <= T <= 200), indicating the number of test cases. For each test case: One line contains two integers N and M (1 <= N,M <= 100), indicating the size of the chessboard. 输出 For each test case: If there is no compact solution, output "impossible" on a single line; If there are several compact solutions, output any one of them. Output N lines, each line contains a string of M upper case letters ("A" to "Z"), indicating the way to tile the chessboard with dominoes. Each domino is represented by two adjacent (sharing a common edge) squares with the same letter. You can mark each domino with any upper case letter, however, any two adjacent (sharing at least one common edge) dominoes should be marked with different letters. 样例输入 4 1 2 3 4 5 6 7 7 样例输出 AA impossible ABBABB ACCADC CDBBDC CDACCA BBABBA impossible
Tiling a Grid With Dominoes_course
20161228Problem Description We wish to tile a grid 4 units high and N units long with rectangles (dominoes) 2 units by one unit (in either orientation). For example, the figure shows the five different ways that a grid 4 units high and 2 units wide may be tiled. Write a program that takes as input the width, W, of the grid and outputs the number of different ways to tile a 4byW grid. Input The first line of input contains a single integer N, (1 ≤ N ≤ 1000) which is the number of datasets that follow. Each dataset contains a single decimal integer, the width, W, of the grid for this problem instance. Output For each problem instance, there is one line of output: The problem instance number as a decimal integer (start counting at one), a single space and the number of tilings of a 4byW grid. The values of W will be chosen so the count will fit in a 32bit integer. Sample Input 3 2 3 7 Sample Output 1 5 2 11 3 781
Dominoes 程序设计问题_course
20191122Problem Description A domino contains two ends, each labeled with number between 1 and 6. You are to write a program that determines if a set of dominoes can be organized in a line so that all dominoes are used; numbers on successive dominoes match; and the numbers on both ends match. You are allowed to rearrange and flip the dominoes arbitrarily. For example, the five dominos: (3 3), (3 1), (4 3), (1 6), and (4 6) can be arranged as: The five dominos: (4 5), (3 4), (1 2), (2 3), and (5 5) cannot be arranged with all ends matching. Input The input contains a list of dominosets. The first line of each set contains a single integer corresponding to the number of dominos in the set – 3 <= N <= 10. The next N lines each contain the two values on a single domino. The end of input is denoted by N = 0. Output Your program should produce one line of output for every set of dominos. The format should be: “Set #1: YES” or “Set #1: NO”. Sample Input 3 1 2 3 2 3 1 5 4 5 3 4 1 2 2 3 5 5 5 3 3 3 1 4 3 1 6 4 6 0 Sample Output Set #1: YES Set #2: NO Set #3: YES
Dominoes 怎么编写的呢_course
20191220Problem Description Some day, Tom's father buys him a box of dominoes blocks. In the box, there are 12 different blocks, which are shown above. Tom is a boy who likes to do practice in intelligence, so he spends a whole afternoon in finishing two different rectangles with 3 * 20, which are shown below. ①⑤⑤⑤⑤⑨⑩⑩⑩⑥⑥⑧②②②②②③④④ ①⑤⑿⑿⑨⑨⑨⑩⑥⑥⑦⑧⑧⑧⑾⑾③③③④ ①①①⑿⑿⑿⑨⑩⑥⑦⑦⑦⑦⑧⑾⑾⑾③④④ ①⑧⑦⑦⑦⑦⑥⑩⑨⑿⑿⑿②②②②②③④④ ①⑧⑧⑧⑦⑥⑥⑩⑨⑨⑨⑿⑿⑤⑾⑾③③③④ ①①①⑧⑥⑥⑩⑩⑩⑨⑤⑤⑤⑤⑾⑾⑾③④④ Tom is sure that these are the only solutions for 3 * 20, and he wants to know the number of solutions for 4 * 15, 5 * 12, ... Can you help him? You should notice that if a solution will be the same as the other by some flip or rotate, these two solutions should be consider as the same. Input There may be several test cases. Each contains a single line with two positive integers M and N, which means the shape of M * N. Here M * N = 60. Output For each test case, output a line contains the number of solutions. Sample Input 1 60 3 20 Sample Output 0 2
Tiling a Grid With Dominoes 实现_course
20191206Problem Description We wish to tile a grid 4 units high and N units long with rectangles (dominoes) 2 units by one unit (in either orientation). For example, the figure shows the five different ways that a grid 4 units high and 2 units wide may be tiled. Write a program that takes as input the width, W, of the grid and outputs the number of different ways to tile a 4byW grid. Input The first line of input contains a single integer N, (1 ≤ N ≤ 1000) which is the number of datasets that follow. Each dataset contains a single decimal integer, the width, W, of the grid for this problem instance. Output For each problem instance, there is one line of output: The problem instance number as a decimal integer (start counting at one), a single space and the number of tilings of a 4byW grid. The values of W will be chosen so the count will fit in a 32bit integer. Sample Input 3 2 3 7 Sample Output 1 5 2 11 3 781
Tri Tiling _course
20170325In how many ways can you tile a 3xn rectangle with 2x1 dominoes? Here is a sample tiling of a 3x12 rectangle. Input Input consists of several test cases followed by a line containing 1. Each test case is a line containing an integer 0 ≤ n ≤ 30. Output For each test case, output one integer number giving the number of possible tilings. Sample Input 2 8 12 1 Sample Output 3 153 2131
Warm up 2 _course
20171113Problem Description Some 1×2 dominoes are placed on a plane. Each dominoe is placed either horizontally or vertically. It's guaranteed the dominoes in the same direction are not overlapped, but horizontal and vertical dominoes may overlap with each other. You task is to remove some dominoes, so that the remaining dominoes do not overlap with each other. Now, tell me the maximum number of dominoes left on the board. Input There are multiple input cases. The first line of each case are 2 integers: n(1 <= n <= 1000), m(1 <= m <= 1000), indicating the number of horizontal and vertical dominoes. Then n lines follow, each line contains 2 integers x (0 <= x <= 100) and y (0 <= y <= 100), indicating the position of a horizontal dominoe. The dominoe occupies the grids of (x, y) and (x + 1, y). Then m lines follow, each line contains 2 integers x (0 <= x <= 100) and y (0 <= y <= 100), indicating the position of a horizontal dominoe. The dominoe occupies the grids of (x, y) and (x, y + 1). Input ends with n = 0 and m = 0. Output For each test case, output the maximum number of remaining dominoes in a line. Sample Input 2 3 0 0 0 3 0 1 1 1 1 3 4 5 0 1 0 2 3 1 2 2 0 0 1 0 2 0 4 1 3 2 0 0 Sample Output 4 6
DomiNo Grid _course
20170405Dominoes are small, flat, rectangularshaped game pieces. Domino pieces are usually twice as long as they are wide and are usually made to be exactly half as thick as they are wide so that they can stand on edge without falling over. If we push one end of a queue of dominoes, the whole queue will fall over. Now, you will be given some descriptions of domino grid with a '.' indicating an open space and an uppercase 'X' indicating a domino and the force used on one domino. You are to compute the ending descriptions. The force consists of two parts : location and direction. There are 8 directions shown below. direction abbreviation West : W NorthWest : V North : N NorthEast : Y East : E SouthEast : Q South : S SouthWest : J The falling direction of the pushed domino is always the same as the force. Other dominoes will fall over if: 1) it's adjacent with a previous fallen domino. 2) it's within 45 degree of the falling direction of the previous domino. The direction of falling is the relative position of it to the previous fallen domino. No two dominoes will cause the same domino to fall over simultaneously. See the following example for more details. XXX XXX XXX We say the outer 8 dominoes are adjacent with the middle one. With a force to east on the middle domino, the 3 dominoes in the third column will fall over and the direction will be northeast, east, southeast. So the ending grid is : XXY XEE XXQ Input There are multiple test cases. Each case begins with a line containing two positive integer n and m (1 <= n, m <= 500) that are the number of rows and columns of the grid. The next n lines each with m chars (only '.' and 'X') describe one row of the grid. At last, two integers i, j (ith row, jth column, both i and j start from 1) indicate the location of the force and a char C describes the direction of the force. You can assume that there is a domino at the location (i, j). Process to the end of file. Output Print the ending description of the grid, using the abbreviations for the fallen dominoes. Print a blank line between cases. Sample Input 2 4 ..XX XX.. 1 3 S 4 4 XXX. ...X X..X XXX. 3 1 E Sample Output ..SX WJ.. WWV. ...N E..Y XQE.
Domino Puzzle _course
20170304Dominoes game played with small, rectangular blocks of wood or other material, each identified by a number of dots, or pips, on its face. The blocks usually are called bones, dominoes, or pieces and sometimes men, stones, or even cards. The face of each piece is divided, by a line or ridge, into two squares, each of which is marked as would be a pair of dice... The principle in nearly all modern dominoes games is to match one end of a piece to another that is identically or reciprocally numbered. ENCYCLOPEDIA BRITANNICA Consider an arbitrary set of domino pieces where each piece is marked with two digits from 1 to 6. Some sets can be completely laid out in a row matching one end of a piece to another that is identically numbered, while others cannot. For example, the set consisting of 5 pieces: (1, 5), (1, 6), (5, 5) and (2, 4) twice, cannot be laid out in a row. However, if we add (2, 5) piece to the above set we could lay out the resulting set in the following row: However, we are interested in a row having the smallest sum of digits on its pieces. In our example, instead of the piece (2, 5) with a sum of 7, we could add two pieces (1, 2) with a total sum of 6 to lay out the following row: Your task is to write a program that for a given domino set will find an additional (possibly empty) set with the smallest possible sum of digits, so that a row could be laid out with both sets combined. Input The first line of the input contains a single integer N (2 <= N <= 100) representing the total number of pieces in the domino set. The following N lines describe pieces. Each piece is represented on a separate line in a form of two digits from 1 to 6 separated by a space. The digits of a piece can be written in any order. Output On the first line of the output file write the smallest sum of digits of the additional set or 0 if that set is empty. On the second line write the total number of pieces in the additional set or 0 if that set is empty. Then write the pieces of the additional set in the same format as in input. If there are a number of additional sets with the same smallest sum of digits exist then write any one of them. This problem contains multiple test cases! The first line of a multiple input is an integer N, then a blank line followed by N input blocks. Each input block is in the format indicated in the problem description. There is a blank line between input blocks. The output format consists of N output blocks. There is a blank line between output blocks. Sample Input 2 6 6 1 1 5 5 5 5 2 2 4 4 2 5 1 5 6 1 5 5 2 4 2 4 Sample Output 0 0 6 2 1 2 1 2
How many ways _course
20170601Problem Description 这是一个简单的生存游戏，你控制一个机器人从一个棋盘的起始点(1,1)走到棋盘的终点(n,m)。游戏的规则描述如下： 1.机器人一开始在棋盘的起始点并有起始点所标有的能量。 2.机器人只能向右或者向下走，并且每走一步消耗一单位能量。 3.机器人不能在原地停留。 4.当机器人选择了一条可行路径后，当他走到这条路径的终点时，他将只有终点所标记的能量。 如上图，机器人一开始在(1,1)点，并拥有4单位能量，蓝色方块表示他所能到达的点，如果他在这次路径选择中选择的终点是(2,4) 点，当他到达(2,4)点时将拥有1单位的能量，并开始下一次路径选择，直到到达(6,6)点。 我们的问题是机器人有多少种方式从起点走到终点。这可能是一个很大的数，输出的结果对10000取模。 Input 第一行输入一个整数T,表示数据的组数。 对于每一组数据第一行输入两个整数n,m(1 <= n,m <= 100)。表示棋盘的大小。接下来输入n行,每行m个整数e(0 <= e < 20)。 Output 对于每一组数据输出方式总数对10000取模的结果. Sample Input 1 6 6 4 5 6 6 4 3 2 2 3 1 7 2 1 1 4 6 2 7 5 8 4 3 9 5 7 6 6 2 1 5 3 1 1 3 7 2 Sample Output 3948
How Many Equations Can You Find _course
20170526Problem Description Now give you an string which only contains 0, 1 ,2 ,3 ,4 ,5 ,6 ,7 ,8 ,9.You are asked to add the sign ‘+’ or ’’ between the characters. Just like give you a string “12345”, you can work out a string “123+45”. Now give you an integer N, please tell me how many ways can you find to make the result of the string equal to N .You can only choose at most one sign between two adjacent characters. Input Each case contains a string s and a number N . You may be sure the length of the string will not exceed 12 and the absolute value of N will not exceed 999999999999. Output The output contains one line for each data set : the number of ways you can find to make the equation. Sample Input 123456789 3 21 1 Sample Output 18 1
How Many People Can Survive _course
20170730Problem Description Two opposing armies are lost in a big forest. The forest is dangerous ,because it is filled with poisonous gas . People can only survive by staying at the place that is surrounded by trees.As the two armies are opposing, if one army are able to move to the other one , they wil fight with each other. Only the army that with the more people will survive, if the number is equal, no one will survive. Now you are asked to find out how many people will survive. Input There are several test cases. Each case begins with an integer n and m (3<=n,m<=300) stands for the size of forest. Then follows n lines , each line contains m characters . ‘.’ Stands for empty place ‘#’Stands for tree and can’t been walked through ‘o’Stands for the first army ‘v’stands for the second army Output The output contains one line for each data set : two integers, p and q, stands for the number of the first army that can survive and the number of the second army that can survive. Sample Input 3 3 ..# ovo … 10 10 ...vvvoo.. ########## #....oo.o# #..v.v...# #........# #..####..# #..#o.#..# #..#.v#..# #..####..# ########## Sample Output 0 0 3 0
c++ sort排序二维数组之后结果未自动保存的问题_course
20200526LeetCode 1128, 题目链接 https://leetcode.com/problems/numberofequivalentdominopairs/ ```CPP class Solution { public: int numEquivDominoPairs(vector<vector<int>>& dominoes) { int ret = 0; for (auto i : dominoes) { sort(i.begin(), i.end()); cout << i[0] << i[1] << endl; // 输出1 } for (int i = 0; i < dominoes.size()  1; ++i) { for (int j = i + 1; j < dominoes.size(); ++j) { cout << dominoes[i][0] << dominoes[i][1] << endl; // 输出2 cout << dominoes[j][0] << dominoes[j][1] << endl; if (dominoes[i] == dominoes[j]) { ret++; } } } return ret; } }; int main() { vector<vector<int>> vec = { {1,2}, {2,1} }; Solution s; cout << s.numEquivDominoPairs(vec) << endl; return 0; } ``` 对二维数组的每一行进行排序，所以上面输出1的结果是12和12，但是在输出2的结果却是12和21，有没有大佬能解释一下为什么？
Statement的正确性判断的矩阵程序，怎么利用C程序的语言的代码结构实现的呢？_course
20190508Problem Description The board is a rectangle of unit grids with N rows and M columns. There are infinity 1×2 and 2×1 dominoes. Some grids are broken, so they are removed, marked with 'X' character. It is pressure to place dominoes in the board as many as possible. But sometimes there may be one grid unfilled no matter how you place them. The board has only one special gird marked with '@'. This special grid can place domino, but should be empty when you finish placement. It is a pity that the only empty grid is marked with '.' when you finish placement. You have chance to move the dominoes.The domino can be moved when the short edge is adjacent to the blank grid. The domino will move horizontally or vertically one grid. You can move the domino as many times as you want. Now, the question is how many initial placement can be adjust with movement to the final state which means every droppable grid except '@' grid, marked with '.', should be filled with domino, and the '@' grid empty. Input The first line of the input gives the number of test cases T; T test cases follow. Each case begins with one line with two integers N and M : the number of rows and columns in the grid. The N lines of M characters each follow; each character is '.', 'X' or '@', as described in the statement. Limits T≤100 1≤N,M≤8 Each character in the grid is one of '.', 'X' or '@'. '@' will appear exactly once; Output For each test case output one integer denotes the answer. As for the answer may be too large, you should output it modulo 1000000007 (109+7). Sample Input 3 3 5 ....X .@... ...X. 3 5 ..... .@... ..... 3 3 ... ... ..@ Sample Output 4 10 16
 11.3MB
2020年9月新版CKA真题
202010192020年九月新版CKA考试真题，是博主在考试时候偷偷截的图，考试是在线考试，具体的考试攻略可以参考我的博客，如有疑问可以在博客下面留言，我看到就会回复的。博客地址：https://blog.csdn
手把手带你学会Python
20200303当下最火的计算机语言，难道你还只停留知道的阶段吗？快跟着老司机一起起飞吧~ 零基础开始学，只要跟着视频一步一步来，多思考，多练习，我相信你会有质的飞越。 学习路上会很苦，也会很累。但是这些等你学会以后，会发现这些都是值得。 还在等什么？快来学习吧~
R语言入门基础
20190601本课程旨在帮助学习者快速入门R语言： 课程系统详细地介绍了使用R语言进行数据处理的基本思路和方法。 课程能够帮助初学者快速入门数据处理。 课程通过大量的案例详细地介绍了如何使用R语言进行数据分析和处理 课程操作实际案例教学，通过编写代码演示R语言的基本使用方法和技巧
Java进阶高手课Java基础编程提升
20200427课程聚焦Java基础编程提升的核心知识点，以真实场景项目实战为导向，循序渐进，深入浅出的了解Java基础编程，讲解Java这门使用广泛的编程语言，助你能够游刃有余地游走在这些技术之中。
 41.83MB
Python高级编程.pdf
20130801《Python高级编程》通过大量的实例，介绍了Python语言的最佳实践和敏捷开发方法，并涉及整个软件生命周期的高级主题，诸如持续集成、版本控制系统、包的发行和分发、开发模式、文档编写等。《Pytho
Python进阶Pandas数据分析库
20181218您观看课程学习后 免费入群领取【超全Python资料包+17本学习电子书】 Pandas是python中非常常用的数据分析库，在数据分析，机器学习，深度学习等领域经常被使用。本课程会讲解到pandas中最核心的一些知识点，包括Series以及DataFrame的构建，赋值，操作，选择数据，合并等等，以及使用pandas对文件进行读取和写入，使用pandas绘图等等。
 111.65MB
DirectX修复工具V4.0增强版
20200613DirectX修复工具(DirectX Repair)是一款系统级工具软件，简便易用。本程序为绿色版，无需安装，可直接运行。 本程序的主要功能是检测当前系统的DirectX状态，如果发现异常则进行修复
Java学习指南（Java入门与进阶）
20170809这是Java学习指南系列课程的第1篇，介绍Java语言的入门语法，引领希望学习Java语言编程的初学者进入Java大门。 本课程不需要其他语言作为基础，可以直接学习。 课程从Java开发平台的下载和安装开始，从浅到深、从易到难，循序渐进地进行语法讲解。 为了让学员更好的掌握Java语言，本课程配套在线的Java题库及答案解析。 相比于其他语言，Java语言更科学、更容易掌握，快来和大家一起学习Java吧。
 22.3MB
西北工业大学软件学院软件测试实验1lab1.zip
20200713西北工业大学，软件学院，软件测试实验1，lab1，嵌入式系统测试，包含讲解资料以及测试结果表格（2017年测试大赛题目）
 博客 常量引用或指向常量的指针，其所指对象可以是非const对象（C++）
 学院 Flutter项目的调试技巧
 学院 uniapp基础入门到精通知识点精讲(第一季)
 博客 pytorch模型保存与加载自己训练的模型详解
 学院 基于vue.js的uniapp服装商城APP（使用教程）
 学院 Facebook工程师带你全解数据结构与算法
 学院 基于vue.js的uniapp鲜花礼品商城APP（使用教程）
 下载 ARM汇编指令集PDF版
 博客 二分查找（函数实现）
 博客 SQL Server 操作要重建表被禁止
 学院 朱老师鸿蒙系列课程第1期1.鸿蒙系统HarmonyOS打通开发实践
 博客 走进Kudu
 下载 basketball的csv数据，NBA官方
 学院 vueelementadmin从入门到进阶实战
 学院 基于uniapp+springboot的商业项目（第一季）
 下载 一个按钮搞定excel文件上传和导入[完美方案]
 下载 北交925数据结构真题及答案.zip
 博客 SQL查询语句 (Oracle)
 学院 基于vue.js的uniapp珠宝首饰商城APP（使用教程）
 下载 PID控制PWM温度系统.rar
 博客 编程和网络编程入门
 博客 hadoop访问不到8088解决方案
 学院 企业级SpringBoot使用
 博客 unicode
 博客 SwiftUI LazyHGrid 让组件全部充满空间GridItem GeometryReader (教程含源码)
 学院 Spring Boot2.x从青铜到王者分布式事务MInIO等技术
 学院 Java+FFmpeg开发音视频流媒体直播等
 博客 katana材质的制作2
 博客 SQL SERVER数据库datediff函数引发的性能问题
 学院 ES6语法详解