03 2018 档案

摘要:L2-004. 这是二叉搜索树吗?时间限制400 ms内存限制65536 kB代码长度限制8000 B判题程序Standard作者陈越一棵二叉搜索树可被递归地定义为具有下列性质的二叉树:对于任一结点,其左子树中所有结点的键值小于该结点的键值;其右子树中所有结点的键值大... 阅读全文
posted @ 2018-03-30 10:56 wyboooo 阅读(142) 评论(0) 推荐(0) 编辑
摘要:L2-003. 月饼时间限制100 ms内存限制65536 kB代码长度限制8000 B判题程序Standard作者陈越月饼是中国人在中秋佳节时吃的一种传统食品,不同地区有许多不同风味的月饼。现给定所有种类月饼的库存量、总售价、以及市场的最大需求量,请你计算可以获得的... 阅读全文
posted @ 2018-03-29 18:41 wyboooo 阅读(99) 评论(0) 推荐(0) 编辑
摘要:计算几何公式大全:https://blog.csdn.net/clasky/article/details/9990235矢量叉积:计算矢量叉积是与直线和线段相关算法的核心部分。设矢量P = (x1,y1) ,Q = (x2,y2),则矢量叉积定义为由(0,0)、p1... 阅读全文
posted @ 2018-03-25 22:12 wyboooo 阅读(173) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2018-03-22 20:33 wyboooo 阅读(88) 评论(0) 推荐(0) 编辑
摘要:During the kindergarten days, flymouse was the monitor of his class. Occasionally the head-teacher brought the kids of flymouse’s class a large bag of 阅读全文
posted @ 2018-03-22 20:20 wyboooo 阅读(137) 评论(0) 推荐(0) 编辑
摘要:首先我们依照读入的顺序为每一条边进行编号(1~m)。比方第一条边“1 4 9”的编号就是1,“1 3 7”这条边的编号是5。这里用u、v和w三个数组用来记录每条边的详细信息,即u[i]、v[i]和w[i]表示第i条边是从第u[i]号顶点到v[i]号顶点(u[i]àv[... 阅读全文
posted @ 2018-03-22 19:54 wyboooo 阅读(189) 评论(0) 推荐(0) 编辑
摘要:While exploring his many farms, Farmer John has discovered a number of amazing wormholes. A wormhole is very peculiar because it is a ... 阅读全文
posted @ 2018-03-19 22:01 wyboooo 阅读(108) 评论(0) 推荐(0) 编辑
摘要:N (1 ≤ N ≤ 100) cows, conveniently numbered 1..N, are participating in a programming contest. As we all know, some cows code better th... 阅读全文
posted @ 2018-03-19 20:46 wyboooo 阅读(115) 评论(0) 推荐(0) 编辑
摘要:Several currency exchange points are working in our city. Let us suppose that each point specializes in two particular currencies and ... 阅读全文
posted @ 2018-03-18 20:43 wyboooo 阅读(252) 评论(0) 推荐(0) 编辑
摘要:One cow from each of N farms (1 ≤ N ≤ 1000) conveniently numbered 1..N is going to attend the big cow party to be held at farm #X (1 ≤... 阅读全文
posted @ 2018-03-18 19:37 wyboooo 阅读(119) 评论(0) 推荐(0) 编辑
摘要:[E] 简单的图论问题? 时间限制: 5000 ms 内存限制: 65535 K 问题描述 给一个 n 行 m 列的迷宫,每个格子要么是障碍物要么是空地。每个空地里都有一个权值。你的 任务是从找一条(r1,c1)到(r2,c2)的路径,使得经过的空地的权值之和最小。每一步可以往上下 左右四个方向之一 阅读全文
posted @ 2018-03-17 16:54 wyboooo 阅读(173) 评论(0) 推荐(0) 编辑
摘要:Background Hugo Heavy is happy. After the breakdown of the Cargolifter project he can now expand business. But he needs a clever man w... 阅读全文
posted @ 2018-03-15 21:32 wyboooo 阅读(139) 评论(0) 推荐(0) 编辑
摘要:松弛操作:当dis[i] > dis[j] + g[j][i]时 dis[i] = dis[j] + g[j][i]dijkstra 单源最短路 O(n^2)本质是贪心 不能处理负边分成两个集合 用vis标记 一个是已经找到最短路的一个是没有找到最短路的从已经找到最短... 阅读全文
posted @ 2018-03-15 20:10 wyboooo 阅读(161) 评论(0) 推荐(0) 编辑
摘要:A - Til the Cows Come Home POJ - 2387 Bessie is out in the field and wants to get back to the barn to get as much sleep as possible be... 阅读全文
posted @ 2018-03-15 17:58 wyboooo 阅读(157) 评论(0) 推荐(0) 编辑
摘要:The little cat is so famous, that many couples tramp over hill and dale to Byteland, and asked the little cat to give names to their newly-born babies 阅读全文
posted @ 2018-03-11 20:07 wyboooo 阅读(103) 评论(0) 推荐(0) 编辑
摘要:Given two strings a and b we define a*b to be their concatenation. For example, if a = "abc" and b = "def" then a*b = "abcdef". If we think of concate 阅读全文
posted @ 2018-03-08 19:35 wyboooo 阅读(93) 评论(0) 推荐(0) 编辑
摘要:https://wenku.baidu.com/view/206c8178d0d233d4b04e69ed.html 问题定义:给定两个字符串S和T(长度分别为n和m),下标从0开始,定义extend[i]等于S[i]...S[n-1]与T的最长公共前缀的长度,求出所有的extend[i]。举个例子 阅读全文
posted @ 2018-03-07 21:40 wyboooo 阅读(112) 评论(0) 推荐(0) 编辑
摘要:吉哥又想出了一个新的完美队形游戏! 假设有n个人按顺序站在他的面前,他们的身高分别是h[1], h[2] ... h[n],吉哥希望从中挑出一些人,让这些人形成一个新的队形,新的队形若满足以下三点要求,则就是新的完美队形: 1、挑出的人保持原队形的相对顺序不变,且必须都是在原队形中连续的; 2、左右 阅读全文
posted @ 2018-03-07 19:56 wyboooo 阅读(128) 评论(0) 推荐(0) 编辑
摘要:It is well known that AekdyCoin is good at string problems as well as number theory problems. When given a string s, we can write down... 阅读全文
posted @ 2018-03-06 21:56 wyboooo 阅读(101) 评论(0) 推荐(0) 编辑
摘要:http://blog.csdn.net/zzkksunboy/article/details/72600679 https://segmentfault.com/a/1190000008484167 求最长回文长度的一个算法 O(n) 首先解决要判断奇字符偶字符的问题 在每一个字符前加一个不可能在 阅读全文
posted @ 2018-03-06 20:09 wyboooo 阅读(129) 评论(0) 推荐(0) 编辑
摘要:复杂度都是O(n) 扩展1:BM算法 KMP的匹配是从模式串的开头开始匹配的,而1977年,德克萨斯大学的Robert S. Boyer教授和J Strother Moore教授发明了一种新的字符串匹配算法:Boyer-Moore算法,简称BM算法。该算法从模式串的尾部开始匹配,且拥有在最坏情况下O 阅读全文
posted @ 2018-03-04 22:08 wyboooo 阅读(186) 评论(0) 推荐(0) 编辑
摘要:节选自 https://www.cnblogs.com/zhangtianq/p/5839909.html 字符串匹配 KMP O(m+n) O原来的暴力算法 当不匹配的时候 尽管之前文本串和模式串已经分别匹配到了S[9]、P[5],但因为S[10]跟P[6]不匹配,所以文本串回溯到S[5],模式串 阅读全文
posted @ 2018-03-04 19:28 wyboooo 阅读(208) 评论(0) 推荐(0) 编辑