Problem Description Ignatius最近遇到一个难题,老师交给他很多单词(只有小写字母组成,不会有重复的单词出现),现在老师要他统计出以某个字符串为前缀的单词数量(单词本身也是自己的前缀). Input 输...
小希的迷宫 HDU – 1272(广度优先搜索)
上次Gardon的迷宫城堡小希玩了很久(见Problem B),现在她也想设计一个迷宫让Gardon来走。但是她设计迷宫的思路不一样,首先她认为所有的通道都应该是双向连通的,就是说如果有一个通道连通了房间A和B,那么...
博客启用LaTeX排版支持
THIS IS A TEST OF LaTeX $ e=m c^2 $ $$\begin{pmatrix} a_{11} & \cdots & a_{1n}\\ \vdots & \ddots & \vdots\\ a_{m1} & \cdots & a_{mn} \end{pmatrix}$$ HOW TO USE? Add <...
Bounce[2017 ACM 北京站网络赛]
题目7 : Bounce 时间限制:1000ms 单点时限:1000ms 内存限制:256MB 描述 For Argo, it is very interesting watching a circle bouncing in a rectangle. As shown in the figure below, th...
Hotel POJ – 3667 (线段树的区间更新)洛谷P2894 [USACO08FEB]
题目描述 The cows are journeying north to Thunder Bay in Canada to gain cultural enrichment and enjoy a vacation on the sunny shores of Lake Superior. Bessie, ever the competent travel agent, has ...
Just a Hook HDU – 1698 (线段树的区间更新)
Problem Description In the game of DotA, Pudge’s meat hook is actually the most horrible thing for most of the heroes. The hook is made up of several consecutive metallic sticks which are of the s...
A Simple Problem with Integers POJ – 3468(线段树的区间更新)
Time Limit: 5000MS Memory Limit: 131072K Total Submissions: 118228 Accepted: 36755 Case Time Limit: 2000MS Description You have N integers, A1, A2, ... , AN. Y...
I Count Two Three HDU – 5878 (打表+二分搜索+输入挂)
I will show you the most popular board game in the Shanghai Ingress Resistance Team. It all started several months ago. We found out the home address of the enlightened agent Icount2three...
Sticks Problem POJ – 2452 (线段树)
Sticks Problem Time Limit: 6000MS Memory Limit: 65536K Total Submissions: 10724 Accepted: 2855 Description Xuanxuan has n sticks of different length. One day, she pu...
基于ST表的RMQ算法
基于ST表的RMQ算法可以在O(1)的时间复杂度内计算出一个区间内的最值。 基本思想是将一段长度中的最值保存下来。查询的时候直接返回。避免了常规算法中的一次一次比较的操作。 详细请参考书籍:《算法竞赛入...