10 2017 档案
摘要:所谓的二分图 : 就是指相同的部分没有边,那么这个图就是二分图。 注:以下转自 http://blog.csdn.net/dark_scope/article/details/8880547匈牙利算法是由匈牙利数学家Edmonds于1965年提出,因而得名。匈牙利算法是基于Hall定理中充分性证明的
阅读全文
摘要:依赖性的关系 : 就是指其后一个的状态由其前一个所决定,这种优化方法可以用在很多的地方, 例如 : 一串东西,有正有反,每次只能操作一段区间,将此区间正反颠倒,向这种模型就可以建立成依赖型的模型,改变一个区间的【a, b】的时候,实则我只要改变 a 的依赖值与 b+1 的依赖值。那么对于整个区间便进
阅读全文
摘要:推荐博客 :string 写的大数加法 : http://www.cnblogs.com/duanguyuan/p/3285836.html
阅读全文
摘要:在一个给定形状的棋盘(形状可能是不规则的)上面摆放棋子,棋子没有区别。要求摆放时任意的两个棋子不能放在棋盘中的同一行或者同一列,请编程求解对于给定形状和大小的棋盘,摆放k个棋子的所有可行的摆放方案C。 Input 输入含有多组测试数据。 每组数据的第一行是两个正整数,n k,用一个空格隔开,表示了将
阅读全文
摘要:Given a positive integer n, write a program to find out a nonzero multiple m of n whose decimal representation contains only the digits 0 and 1. You m
阅读全文
摘要:Farmer John knows that an intellectually satisfied cow is a happy cow who will give more milk. He has arranged a brainy activity for cows in which the
阅读全文
摘要:Farmer John has been informed of the location of a fugitive cow and wants to catch her immediately. He starts at a point N (0 ≤ N ≤ 100,000) on a numb
阅读全文
摘要:You are trapped in a 3D dungeon and need to find the quickest way out! The dungeon is composed of unit cubes which may or may not be filled with rock.
阅读全文
摘要:推荐博客 :http://blog.163.com/yichangjun1989@126/blog/static/13197202820145226051666/ 问题描述 : 在一个 8 * 8 的棋盘上 , 可以放置8个皇后 , 皇后们如果在相同的一行或一列就会相互攻击,或者是在斜的对角线上也会
阅读全文
摘要:A number of rectangular posters, photographs and other pictures of the same shape are pasted on a wall. Their sides are all vertical or horizontal. Ea
阅读全文
摘要:给定平面上若干矩形,求出被这些矩形覆盖过至少两次的区域的面积. Input输入数据的第一行是一个正整数T(1<=T<=100),代表测试数据的数量.每个测试数据的第一行是一个正整数N(1<=N<=1000),代表矩形的数量,然后是N行数据,每一行包含四个浮点数,代表平面上的一个矩形的左上角坐标和右下
阅读全文
摘要:There are several ancient Greek texts that contain descriptions of the fabled island Atlantis. Some of these texts even include maps of parts of the i
阅读全文
摘要:Due to recent rains, water has pooled in various places in Farmer John's field, which is represented by a rectangle of N x M (1 <= N <= 100; 1 <= M <=
阅读全文
摘要:There is a company that has N employees(numbered from 1 to N),every employee in the company has a immediate boss (except for the leader of whole compa
阅读全文
摘要:B. Balanced Substring time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output You are given a str
阅读全文
摘要:A lot of battleships of evil are arranged in a line before the battle. Our commander decides to use our secret weapon to eliminate the battleships. Ea
阅读全文
摘要:A. String Game time limit per test 2 seconds memory limit per test 512 megabytes input standard input output standard output Little Nastya has a hobby
阅读全文
摘要:很多时候会遇到一类题, 这类题点的个数很少 , 但是每个点的数据特别大 , 这时基本有两种想法 。 1 . 用map 处理 , map 是一个关联容器 , 可以实现元素的一对一 , 用map 后 , 你就可以实现对数据的桶排了。 2 . 对数据离散化处理 先是点的离散化 例如 只有 3 个数据 ,
阅读全文
摘要:博客 :http://www.cnblogs.com/wuyiqi/archive/2012/03/19/2405885.html The citizens of Bytetown, AB, could not stand that the candidates in the mayoral ele
阅读全文
摘要:推荐博客 : https://www.cnblogs.com/RabbitHu/p/BIT.html https://www.cnblogs.com/lcf-2000/p/5866170.html 树状数组的作用 : 修改某点的值 , 查询某段区间的和 , 这是树状数组的强项 。其区间查询的和 为
阅读全文
摘要:推荐博客 :http://www.cnblogs.com/TheRoadToTheGold/p/6254255.html 一、基本概念 1、线段树是一棵二叉搜索树,它储存的是一个区间的信息。 2、每个节点以结构体的方式存储,结构体包含以下几个信息: 区间左端点、右端点;(这两者必有) 这个区间要维护
阅读全文
摘要:C. Journey time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output There are n cities and n - 1
阅读全文
摘要:vector 是一个容器, 它能存放各种类型的对象,简单的说, vector 是一个可以存放任意类型的动态数组,可以动态改变大小。 vector 的功能 vector<int>c; c.clear() // 清空数组中的全部元素 c.empty() // 判断容器是否为空 c.erase(pos)
阅读全文
摘要:poj 2406 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 o
阅读全文
摘要:推荐博客 :http://www.cnblogs.com/yjiyjige/p/3263858.html 什么是KMP 算法呢 ? KMP是三位大牛:D.E.Knuth、J.H.Morris和V.R.Pratt同时发现的。 问题 : 有两个字符串 , 一个叫模式串 , 一个叫主串 , 用模式串向主串
阅读全文