使用C++11的hash函数对字符串进行散列处理

c++11 在 <functional> 头文件有个hash的函数 使用方法也很简单,以字符串hash为例： std::hash<std::string> h; //声明一个字符串类型的hash string s; s="aaaa"; cout<<h(s)<<endl...

One-Dimensional Maze （2017CCPC秦皇岛站）

BaoBao is trapped in a one-dimensional maze consisting of  grids arranged in a row! The grids are numbered from 1 to  from left to right, and the -th grid is marked with a character , where  is eit...

Nearest Common Ancestors UVALive – 2525 （倍增计算LCA）

A rooted tree is a well-known data structure in computer science and engineering. An example is shown below: In the figure, each node is labeled with an integer from {1, 2,...,16}. Node ...

统计难题 HDU – 1251（迷之测试数据）

Problem Description Ignatius最近遇到一个难题,老师交给他很多单词(只有小写字母组成,不会有重复的单词出现),现在老师要他统计出以某个字符串为前缀的单词数量(单词本身也是自己的前缀).   Input 输...

博客启用LaTeX排版支持

THIS IS A TEST FOR LaTeX    $e=m c^2$ $$\begin{pmatrix} a_{11} & \cdots & a_{1n}\\ \vdots & \ddots & \vdots\\ a_{m1} & \cdots & a_{mn} \end{pmatrix}$$   HO...