摘要: 题面 Description 墨墨购买了一套N支彩色画笔(其中有些颜色可能相同),摆成一排,你需要回答墨墨的提问。墨墨会像你发布如下指令: 1、 Q L R代表询问你从第L支画笔到第R支画笔中共有几种不同颜色的画笔。 2、 R P Col 把第P支画笔替换为颜色Col。 为了满足墨墨的要求,你知道你 阅读全文
posted @ 2017-08-17 19:22 小蒟蒻yyb 阅读(332) 评论(0) 推荐(0) 编辑
摘要: 题面 题目描述 小B有一个序列,包含N个1~K之间的整数。他一共有M个询问,每个询问给定一个区间[L..R],求Sigma(c(i)^2)的值,其中i的值从1到K,其中c(i)表示数字i在[L..R]中的重复次数。小B请你帮助他回答询问。 输入格式: 第一行,三个整数N、M、K。 第二行,N个整数, 阅读全文
posted @ 2017-08-17 16:21 小蒟蒻yyb 阅读(275) 评论(2) 推荐(0) 编辑
摘要: 题面 Description 作为一个生活散漫的人,小Z每天早上都要耗费很久从一堆五颜六色的袜子中找出一双来穿。终于有一天,小Z再也无法忍受这恼人的找袜子过程,于是他决定听天由命…… 具体来说,小Z把这N只袜子从1到N编号,然后从编号L到R(L 尽管小Z并不在意两只袜子是不是完整的一双,甚至不在意两 阅读全文
posted @ 2017-08-16 21:16 小蒟蒻yyb 阅读(356) 评论(0) 推荐(0) 编辑
该文被密码保护。 阅读全文
posted @ 2017-08-16 17:29 小蒟蒻yyb 阅读(11) 评论(2) 推荐(0) 编辑
摘要: 题面 C国的死对头A国这段时间正在进行军事演习,所以C国间谍头子Derek和他手下Tidy又开始忙乎了。A国在海岸线沿直线布置了N个工兵营地,Derek和Tidy的任务就是要监视这些工兵营地的活动情况。由于采取了某种先进的监测手段,所以每个工兵营地的人数C国都掌握的一清二楚,每个工兵营地的人数都有可 阅读全文
posted @ 2017-08-14 20:42 小蒟蒻yyb 阅读(247) 评论(0) 推荐(1) 编辑
摘要: 题目不再重复叙述 请参考: "洛谷" "CJOJ" 题解 先来说说非完美解法,也是我去年考场上的做法 考虑一下每一只蚯蚓增加的长度, 这个值并不需要每一次依次增加, 用一个变量维护即可,每次取出蚯蚓就加上这个值,切断蚯蚓就减去这个值。 接下来如何维护最大的蚯蚓,考虑使用一个堆来进行维护 时间复杂度O 阅读全文
posted @ 2017-08-03 23:35 小蒟蒻yyb 阅读(339) 评论(0) 推荐(0) 编辑
摘要: 题面 Dearboy, a goods victualer, now comes to a big problem, and he needs your help. In his sale area there are N shopkeepers (marked from 1 to N) which 阅读全文
posted @ 2017-08-03 20:21 小蒟蒻yyb 阅读(318) 评论(0) 推荐(0) 编辑
摘要: 题面 On a grid map there are n little men and n houses. In each unit time, every little man can move one unit step, either horizontally, or vertically, 阅读全文
posted @ 2017-08-03 16:53 小蒟蒻yyb 阅读(259) 评论(2) 推荐(0) 编辑
摘要: 题面 You are in charge of setting up the press room for the inaugural meeting of the United Nations Internet eXecutive (UNIX), which has an internationa 阅读全文
posted @ 2017-08-03 15:49 小蒟蒻yyb 阅读(439) 评论(0) 推荐(0) 编辑
摘要: 如果想要知道怎么求凸包的直径 先去学习一下怎么求解凸包 "点这里去看凸包" 好了 现在知道了凸包是什么 我们很显然可以得出,品面内最远的点对一定在凸包上面(为啥自己想呀) 而凸包的直径也就是凸包上最远点对的距离。 继续,考虑如何求解最远点对 暴力枚举? 显然不一定所有点都会在凸包上,显然比O(n^2 阅读全文
posted @ 2017-07-30 23:09 小蒟蒻yyb 阅读(4751) 评论(8) 推荐(1) 编辑
摘要: 一直听大佬们说:凸包、凸包、凸包 一直不会。。。。。 然后。。。。 今天考试,考了一道计算几何的简单题。。。。 这,,,还是学一下吧。。 然后考试现场学习一下凸包算法。 先理解一下凸包是啥东西。 看看这张图 解释一下凸包是什么 如果你有一堆点(原谅我画的很凌乱) 那么,找到一个点集 依次连接这些点 阅读全文
posted @ 2017-07-30 21:22 小蒟蒻yyb 阅读(5472) 评论(0) 推荐(4) 编辑
摘要: 题面 Like everyone else, cows like to stand close to their friends when queuing for feed. FJ has N (2 =d 变为 Xa Xa include include include include includ 阅读全文
posted @ 2017-07-30 17:07 小蒟蒻yyb 阅读(239) 评论(0) 推荐(0) 编辑
摘要: 题面 Bessie, Farmer John's prize cow, has just won first place in a bovine beauty contest, earning the title 'Miss Cow World'. As a result, Bessie will 阅读全文
posted @ 2017-07-30 16:55 小蒟蒻yyb 阅读(326) 评论(0) 推荐(0) 编辑
摘要: 题面 懒得粘贴了。。。 大致题意:坐标系内有若干个点,问把这些点都圈起来的最小凸包周长。 题解 直接求出凸包,统计一遍答案即可 cpp include include include include include include include using namespace std; defin 阅读全文
posted @ 2017-07-30 16:53 小蒟蒻yyb 阅读(194) 评论(0) 推荐(0) 编辑
摘要: 题面 Do not sincere non interference。 Like that show, now starvae also take part in a show, but it take place between city A and B. Starvae is in city A 阅读全文
posted @ 2017-07-29 20:07 小蒟蒻yyb 阅读(424) 评论(0) 推荐(0) 编辑
摘要: 题目背景 在农夫约翰的农场上,每逢下雨,贝茜最喜欢的三叶草地就积聚了一潭水。这意味着草地被水淹没了,并且小草要继续生长还要花相当长一段时间。因此,农夫约翰修建了一套排水系统来使贝茜的草地免除被大水淹没的烦恼(不用担心,雨水会流向附近的一条小溪)。作为一名一流的技师,农夫约翰已经在每条排水沟的一端安上 阅读全文
posted @ 2017-07-28 23:45 小蒟蒻yyb 阅读(274) 评论(0) 推荐(0) 编辑
摘要: 学习网络流中。。。 目前的三个算法: FF算法 大致步骤: DFS不断寻找增广路径然后更新最大流 Dinic 这是目前,我学的最优的一个最大流算法~~(我太弱了!!!)~~ 大致步骤: 先用BFS对图进行分层 再用DFS寻找增广路径 Dinic是FF的升级版?(我是这么觉得的。。。) 效率高很多 但 阅读全文
posted @ 2017-07-28 23:31 小蒟蒻yyb 阅读(755) 评论(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 ≤ X ≤ N). A tot 阅读全文
posted @ 2017-07-26 23:52 小蒟蒻yyb 阅读(187) 评论(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 who tells him 阅读全文
posted @ 2017-07-26 23:12 小蒟蒻yyb 阅读(224) 评论(1) 推荐(0) 编辑
摘要: 题面 Freddy Frog is sitting on a stone in the middle of a lake. Suddenly he notices Fiona Frog who is sitting on another stone. He plans to visit her, b 阅读全文
posted @ 2017-07-26 14:32 小蒟蒻yyb 阅读(308) 评论(0) 推荐(0) 编辑
摘要: 题面 Bessie is out in the field and wants to get back to the barn to get as much sleep as possible before Farmer John wakes her for the morning milking. 阅读全文
posted @ 2017-07-25 23:26 小蒟蒻yyb 阅读(225) 评论(1) 推荐(0) 编辑
摘要: manachar算法用来解决字符串的最大回文子串的问题 代码十分简单!!! 所以,我先贴代码再来解释原因。 这句话是干啥的 好的 来解决一下这个问题 这样画一下图就解释了上面那一条语句的原因 这一条很简单,检查一下是否能够继续增加回文子串的长度 最后是对于id和mx的更新 好了 这样差不多就解决完了 阅读全文
posted @ 2017-07-24 20:42 小蒟蒻yyb 阅读(737) 评论(4) 推荐(4) 编辑
摘要: 题目描述 The good folks in Texas are having a heatwave this summer. Their Texas Longhorn cows make for good eating but are not so adept at creating creamy 阅读全文
posted @ 2017-07-24 16:37 小蒟蒻yyb 阅读(276) 评论(0) 推荐(0) 编辑
摘要: 题面 Bessie wants to navigate her spaceship through a dangerous asteroid field in the shape of an N x N grid (1 include include include include include 阅读全文
posted @ 2017-07-24 10:02 小蒟蒻yyb 阅读(288) 评论(2) 推荐(1) 编辑
摘要: 题面 Description 在 Mars 星球上,每个 Mars 人都随身佩带着一串能量项链。在项链上有 N 颗能量珠。能量珠是一颗有头标记与尾标记的珠子,这些标记对应着某个正整数。并且,对于相邻的两颗珠子,前一颗珠子的尾标记一定等于后一颗珠子的头标记。 因为只有这样,通过吸盘(吸盘是 Mars 阅读全文
posted @ 2017-07-23 22:22 小蒟蒻yyb 阅读(252) 评论(2) 推荐(0) 编辑