随笔分类 - OJ -- POJ
摘要:【POJ1704】Georgia and Bob(博弈论) 题面 "POJ" "Vjudge" 题解 这种一列格子中移动棋子的问题一般可以看做成一个阶梯博弈。 将一个棋子向左移动时,它和前面棋子的距离变小,和后面棋子的距离变大,并且减小的值和增大的值是相等的,因此,这个过程我们就可以等价成一个阶梯博
阅读全文
摘要:【POJ2411】Mondriaan's Dream(轮廓线DP) 题面 "Vjudge" 题解 这题我会大力状压!!! 时间复杂度大概是,设表示当前第行向下伸展出去的状态为 那么每次枚举一下当前行的放法,进行转移就好了。 然后就长成了这个样
阅读全文
摘要:【POJ2891】Strange Way to Express Integers(拓展CRT) 题面 "Vjudge" 板子题。 题解 拓展模板题。 cpp include include using namespace std; define ll long long define MA
阅读全文
摘要:【POJ3621】【洛谷2868】Sightseeing Cows(分数规划) 题面 "Vjudge" "洛谷" 大意: 在有向图图中选出一个环,使得这个环的点权边权最大 题解 分数规划 二分答案之后把每条边的边权换为边权 出点的点权 然后检查有没有负环就行啦
阅读全文
摘要:【POJ2728】Desert King(分数规划) 题面 "vjudge" 翻译: 有个点,每个点有一个坐标和高度 两点之间的费用是高度之差的绝对值 两点之间的距离就是欧几里得距离 求一棵生成数,使得单位距离的费用最小 题解 使得最小 这是分数规划问题
阅读全文
摘要:【POJ2976】Dropping Tests(分数规划) 题面 "Vjudge" 翻译在上有(而且很皮) 题解 简单的分数规划 需要我们做的是最大化 考虑二分答案 将最大化问题转换为判定问题 $\sum{a[i]}
阅读全文
摘要:【POJ1741】Tree(点分治) 题面 "Vjudge" 题目大意: 求树中距离小于的点对的数量 题解 完全不觉得点分治了。。 简直,更别说动态点分治了。。。 于是来复习一下。 对于每一层分治重心 求出它到子树中任意点的距离 然后计算满足大于的点对
阅读全文
摘要:【POJ1151】Atlantis(线段树,扫描线) 题面 "Vjudge" 题解 学一学扫描线 其实很简单啦 这道题目要求的就是若干矩形的面积和 把扫描线平行于某个轴扫过去(我选的平行轴扫) 这样只需要求出每次和轴覆盖的长度 就可以两两相乘,求出面积 最后累计和就行啦 cpp incl
阅读全文
摘要:【POJ1743】Musical Theme(后缀数组) 题面 "洛谷,这题是弱化版的,能过" "hihoCoder 有一点点区别" "POJ 多组数据" 题解 要求的是最长不可重叠重复子串 也就是找两个最长的相同子串 使得它们不相交 先求出 考虑一下如果两
阅读全文
摘要:【POJ2774】Long Long Message(后缀数组) 题面 "Vjudge" Description Little cat在Byterland的首都读物理专业。这些天他收到了一条悲伤地信息:他的母亲生病了。担心买火车票花钱太多(Byterland是一个巨大的国家,因此他坐火车回家需要16
阅读全文
摘要:题面 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
阅读全文
摘要:题面 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,
阅读全文
摘要:题面 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
阅读全文
摘要:题面 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
阅读全文
摘要:题面 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
阅读全文
摘要:题面 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
阅读全文
摘要:题面 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
阅读全文
摘要:题面 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.
阅读全文
摘要:题面 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
阅读全文
摘要:题面 The French author Georges Perec (1936–1982) once wrote a book, La disparition, without the letter 'e'. He was a member of the Oulipo group. A quote
阅读全文