题目链接:uva 10237 - Bishops
题目大意:给出n和k,问在n?n的棋盘上放k个主教互相不攻击能有多少种方法,主教的攻击方式是斜线。
解题思路:将棋盘旋转45度,然后将黑白格子互相分开,因为在国际里面,黑格的主教是永远无法攻击到白格的主教。所以将黑白格分开考虑。
然后对于一种格子的颜色来说,它就类似与在一个棋盘上放车,dp[i][j]表示i行放了j个车,dp[i][j...
分类:
其他好文 时间:
2014-06-07 01:57:47
阅读次数:
216
题目:给你一些单词(数字和字母构成),再给你几行文章,要求建立单词所在行数的索引。
分析:字符串、字典树。这题好恶心,数据范围完全没有╮(╯▽╰)╭,57次提交才AC。
数据分为单词表和文章两部分,每部分由一个空行做结束标志。
首先,将单词中的小写字母全部转化成大写字母,然后存入字典树。
然后,查找时将文章中所有的小写...
分类:
其他好文 时间:
2014-06-05 11:37:56
阅读次数:
229
题目如下:
S-Trees
A Strange Tree (S-tree) over the variable set is a binary tree representing a Boolean function
.Each path of the S-tree begins at the
root node and consists ...
分类:
其他好文 时间:
2014-06-05 11:04:37
阅读次数:
248
题目如下:
Tree
You are to determine the value of the leaf node in a given binary treethat is the terminal node of a path of least value from the root of thebinary tree to any le...
分类:
其他好文 时间:
2014-06-05 05:27:11
阅读次数:
268
题目:给你R个红球和B个黑球,从这些球中取出相同颜色的概率是50%;
然后丢了一些黑球,剩下的黑球不少于原来的70%;
现在给你红球和剩下的黑球个数,求可能丢了几个黑球。
分析:数学题。
首先,根据组合数学列出等式2*[C(n,2)+C(m,2)] = C(m+n,2):...
分类:
其他好文 时间:
2014-06-05 05:18:35
阅读次数:
187
题目链接:点击打开链接
题意:给定s*a的方格点,有b个坐标是有且仅有一个人的。
每个点只能被经过一次
能不能让所有人都移动到矩阵边缘。
拆点一下,建图还是挺明显的。。
太卡了提交半天没结果,贴一下代码改天再搞好了。。
#include
#include
#include
#include
#include
using namespace std;
#define ll...
分类:
其他好文 时间:
2014-06-05 04:36:13
阅读次数:
238
题目如下;
Quadtrees
A quadtree is a representation format used to encode images. The fundamental ideabehind the quadtree is that any image can be split into four quadrants. Each...
分类:
其他好文 时间:
2014-06-05 04:20:06
阅读次数:
226
12508 - Triangles in the Grid
题目链接
题意:给定一个n?m格子的矩阵,然后给定A,B,问能找到几个面积在A到B之间的三角形。
思路:枚举每一个子矩阵,然后求[0,A]的个数减去[0,B]的个数就是答案,然后对于每个子矩阵个数很好求为(n?r+1)?(m?c+1)。关键在于怎么求每个子矩阵的符合个数。
想了好久,参考别人题解才想出来,分3种情况...
分类:
其他好文 时间:
2014-06-05 01:09:44
阅读次数:
248
The Blocks Problem
Background
Many areas of Computer Science use simple, abstract domains for both analytical and empirical studies. For example, an early AI study of planning and robo...
分类:
其他好文 时间:
2014-06-04 21:55:37
阅读次数:
313
K - Quadtrees
Time Limit:3000MS Memory Limit:0KB 64bit IO Format:%lld
& %llu
Submit Status
Appoint description:
System Crawler (2014-01-02)
Description
Quadt...
分类:
其他好文 时间:
2014-06-03 01:41:23
阅读次数:
268