棋盘覆盖(二) 时间限制:1000 ms | 内存限制:65535 KB 描述 The banquet hall of Computer Scientists' Palace has a rectangular form of the size M x N (1<=M<=9, 1<=N<=9). It is necessary to lay hardwood floors in the hall. There are wood pieces of two forms:1…
144. Meeting time limit per test: 0.25 sec. memory limit per test: 4096 KB Two of the three members of the winning team of one of the ACM regional contests are going to meet in order to train for the upcoming World Finals. They decided that they will…
Given a list of N numbers you will be allowed to choose any M of them. So you can choose in NCM ways. You will have to determine how many of these chosen groups have a sum, which is divisible by D. Input Input starts with an integer T (≤ 20), denotin…
Tickets Description Conductor is quite a boring profession, as all you have to do is just to sell tickets to the passengers. So no wonder that once upon a time in a faraway galaxy one conductor decided to diversify this occupation. Now this conduct…
104. Little shop of flowers time limit per test: 0.25 sec. memory limit per test: 4096 KB PROBLEM You want to arrange the window of your flower shop in a most pleasant way. You have F bunches of flowers, each being of a different kind, and at least a…
Description 用字符矩阵来表示一个8x8的棋盘,'.'表示是空格,'P'表示人质,'K'表示骑士.每一步,骑士可以移动到他周围的8个方格中的任意一格.如果你移动到的格子中有人质(即'P'),你将俘获他.但不能移到出棋盘或当前是'K'的格子中.请问最少要移动多少步骑士才能俘获所有的人质. Input Format 第一行一个整数N(<=5),表示有多少个棋盘.即多组测试数据.每一组有8行,每行8个字符.字符只有'.',大写'P',大写'K'三种字符.'P'和'K'的个数范围都在[1,10…
132. Another Chocolate Maniac time limit per test: 0.25 sec. memory limit per test: 4096 KB Bob really LOVES chocolate. He thinks he never gets enough. Imagine his joy when his parents told him that they would buy him many rectangular chocolate piece…