摘要: Description 司令部的将军们打算在N*M的网格地图上部署他们的炮兵部队。一个N*M的地图由N行M列组成,地图的每一格可能是山地(用"H" 表示),也可能是平原(用"P"表示),如下图。在每一格平原地形上最多可以布置一支炮兵部队(山地上不能够部署炮兵部队);一支炮兵部队在地图上的攻击范围如图 阅读全文
posted @ 2016-03-27 16:50 ZhMZ 阅读(153) 评论(0) 推荐(0) 编辑
摘要: Description After coding so many days,Mr Acmer wants to have a good rest.So travelling is the best choice!He has decided to visit n cities(he insists on seeing all the ci... 阅读全文
posted @ 2016-03-25 13:56 ZhMZ 阅读(296) 评论(0) 推荐(0) 编辑
摘要: Description The Pizazz Pizzeria prides itself in delivering pizzas to its customers as fast as possible. Unfortunately, due to cutbacks, they can afford to hire only one ... 阅读全文
posted @ 2016-03-24 21:33 ZhMZ 阅读(449) 评论(0) 推荐(0) 编辑
摘要: Description Long long ago, there was a coder named Marlon. One day he picked two string on the street. A problem suddenly crash his brain... Let Si..j 阅读全文
posted @ 2016-03-24 16:12 ZhMZ 阅读(305) 评论(0) 推荐(0) 编辑
摘要: 这道题应该可以早就过的,却拖了一下午=_=,主要是我遇到了很奇怪的问题,现在还不知道原因。 那就是我一开始写的输入是: while(T--&&(scanf("%s",s+1)!=EOF)) { ...... } 一直wa,最后实在感觉没错,很无奈,照着别人的代码一个字符一个字符比对,发现改成以下格式就过了: while(T--) { scanf("%s"... 阅读全文
posted @ 2016-03-23 20:20 ZhMZ 阅读(1147) 评论(1) 推荐(0) 编辑
摘要: hdu 3336 Count the string Description It is well known that AekdyCoin is good at string problems as well as number theory problems. When given a string s, we can... 阅读全文
posted @ 2016-03-22 20:09 ZhMZ 阅读(409) 评论(0) 推荐(0) 编辑
摘要: kmp能够实现单模板串的快速匹配。 备忘:cstring 头文件里的char* strstr 函数也是比较一个字符串是否为另一个字符串的子串,与KMP功能相同,速度究竟谁快? 经过测试,aaaaaa…….aaaab(len =1000) 去匹配 aaaaaaa…..aaab(len=1000000) strstr 函数用了将近一秒钟,而kmp算法只花了不到0.1秒的时间。除了这种极端的... 阅读全文
posted @ 2016-03-22 18:51 ZhMZ 阅读(172) 评论(0) 推荐(0) 编辑
摘要: Description Squares and rectangles fascinated the famous Dutch painter Piet Mondriaan. One night, after producing the drawings in his 'toilet series' (where he had to use... 阅读全文
posted @ 2016-03-21 18:46 ZhMZ 阅读(224) 评论(0) 推荐(0) 编辑
摘要: 原文地址:http://www.cnblogs.com/liuxianan/archive/2013/04/13/3018732.html 去年就知道有这个功能,不过没去深究总结过,最近有写网络博客的欲望了,于是又重新拾起这玩意儿。 具体到底是用Windows Live Writer 2012还是用 阅读全文
posted @ 2016-03-20 16:14 ZhMZ 阅读(126) 评论(0) 推荐(0) 编辑
摘要: An array of size n ≤ 10 6 is given to you. There is a sliding window of size k which is moving from the very left of the array to the very right. You can only see the k numbers in the window. Each tim... 阅读全文
posted @ 2016-03-20 15:41 ZhMZ 阅读(210) 评论(0) 推荐(0) 编辑