自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(21)
  • 收藏
  • 关注

原创 7224: The puzzle

五更眠;最无益,莫过一日曝十日寒。 7224: The puzzle 时间限制: 1 Sec  内存限制: 128 MB 提交: 90  解决: 46 [提交] [状态] [讨论版] [命题人:admin] 题目描述 Kayaking is playing a puzzle game containing n different blocks. He marks the blocks wi...

2018-09-05 13:56:52 597

原创 7221: Flower

7221: Flower 时间限制: 1 Sec  内存限制: 128 MB 提交: 152  解决: 44 [提交] [状态] [讨论版] [命题人:admin] 题目描述 Rabbit loves flowers very much and she plants n pots of flowers in her house. But she never prunes them becau...

2018-09-05 13:29:53 654

原创 树形dp

本文转自:http://blog.csdn.net/angon823/article/details/52334548 转载博主的树形dp分了入门 一般 难 三部分题目 不定时更新 1、什么是树型动态规划  顾名思义,树型动态规划就是在“树”的数据结构上的动态规划,平时作的动态规划都是线性的或者是建立在图上的,线性的动态规划有二种方向既向前和向后,相应的线性的动态规划有二种方法既顺推与逆推,...

2018-08-09 16:19:46 156

原创 6616: Small Multiple

6616: Small Multiple 时间限制: 1 Sec  内存限制: 512 MB 提交: 408  解决: 61 [提交] [状态] [讨论版] [命题人:admin] 题目描述 Find the smallest possible sum of the digits in the decimal notation of a positive multiple of K. Con...

2018-08-04 09:11:27 201

转载 单调栈&单调队列入门

单调栈&单调队列入门 单调队列是什么呢?可以直接从问题开始来展开。Poj 2823 给定一个数列,从左至右输出每个长度为m的数列段内的最小数和最大数。 数列长度:N<=106,m<=NN<=106,m<=N 解法① 很直观的一种解法,那就是从数列的开头,将窗放上去,然后找到这最开始的k个数的最大值,然后窗最后移一个单元,继续找到k个数中的最大值。 这种方法每求...

2018-08-03 10:05:31 137

原创 问题 A: Problem A. Ascending Rating

问题 A: Problem A. Ascending Rating 时间限制: 5 Sec  内存限制: 512 MB 提交: 51  解决: 14 [提交] [状态] [讨论版] [命题人:admin] 题目描述 Before the start of contest, there are n ICPC contestants waiting in a long queue. They a...

2018-08-03 09:58:32 175

原创 问题 G: Friends number

问题 G: Friends number 时间限制: 1 Sec  内存限制: 128 MB 提交: 7  解决: 6 [提交] [状态] [讨论版] [命题人:外部导入] 题目描述   Paula and Tai are couple. There are many stories between them. The day Paula left by airplane, Tai sen...

2018-08-02 20:55:11 244

原创 Swaps and Inversions

Long long ago, there was an integer sequence a.  Tonyfang think this sequence is messy, so he will count the number of inversions in this sequence. Because he is angry, you will have to pay x yuan for...

2018-08-02 10:39:49 225

原创 Distinct Values

/upload/file/20180723/20180723180716_87193.pdf   [题意] n 个数, m 个区间[l,r]  内 保证 不能重复,  但 相交区域外的可以重复, 问 最小字典序的 这样一个序列 [思路] 采用 Set 维护,  Set 中 存放 1-n   ,  每次 在 [L,R]  中 从set 取一个,删除一个,   然后 将L 之前的 在存入s...

2018-08-02 10:06:51 150

原创 问题 A: ConvexScore

问题 A: ConvexScore 时间限制: 1 Sec  内存限制: 128 MB 提交: 65  解决: 28 [提交] [状态] [讨论版] [命题人:admin] 题目描述 You are given N points (xi,yi) located on a two-dimensional plane. Consider a subset S of the N points th...

2018-08-01 10:15:54 125

转载 尼姆博弈(Nimm's Game)

尼姆博弈(Nimm's Game) 题型 尼姆博弈模型,大致上是这样的: 有3堆各若干个物品,两个人轮流从某一堆取任意多的物品,规定每次至少取1个,多者不限,最后取光者得胜。   分析 1、首先自己想一下,就会发现只要最后剩两堆物品一样多(不为零),第三堆为零,那面对这种局势的一方就必败 那我们用(a,b,c)表示某种局势,首先(0,0,0)显然是必败态,无论谁面对(0,0,0) ,...

2018-07-31 10:55:09 459

转载 SG函数(尼姆博弈)

今天考了一道博弈论的题,让我重新复习一下SG定理吧。  首先通常的Nim游戏的定义是这样的:有若干堆石子,每堆石子的数量都是有限的,合法的移动是“选择一堆石子并拿走若干颗(不能不拿)”,如果轮到某个人时所有的石子堆都已经被拿空了,则判负(因为他此刻没有任何合法的移动)。 我们知道对于最普通最一般的NIM取石子来说,所有石子个数异或起来如果为0,那么先手必败,如果不为0那么先手必胜。 具体证明如...

2018-07-30 12:56:10 228

原创 5500: 经营与开发(中石油)

5500: 经营与开发 时间限制: 1 Sec  内存限制: 128 MB 提交: 141  解决: 100 [提交] [状态] [讨论版] [命题人:admin] 题目描述 4X概念体系,是指在PC战略游戏中一种相当普及和成熟的系统概念,得名自4个同样以“EX”为开头的英语单词。 eXplore(探索) eXpand(拓张与发展) eXploit(经营与开发) eXterminate(征服...

2018-07-29 20:29:34 198

原创 Abbott的复仇(Abbott's Revenge)

题目链接:https://uva.onlinejudge.org/external/8/816.pdf 紫书:P165 题意: 有一个最多包含9*9个交叉点的迷宫。输入起点、离开起点时的朝向和终点,求一条最短路(多解时任意输出一个即可)。   【分析】        利用队列实现广度搜索BFS来遍历图寻找最短路径。        用一个三元组(r, c, dir)表示“位于(r, c...

2018-07-29 19:40:44 344

转载 树状数组

树状数组确实是个好东西啊,以前搞比赛的时候了解过它,会套用模版,但确没有深入理解这个东西,先学会用轮子,然后再学造轮子嘛,这段时间再回头研究了一下,发现二进制在算法中真的是的好东西,它可以使算法的时间复杂度降到n的二进制表示中的1相关,大家都知道,求一个二进制中的1的个数,这个时间复杂度为O(logn)O(logn)。 有时候觉得树状数组难以理解,我觉得根本原因是:你还在用十进制的视角来看待树状...

2018-07-28 09:47:57 157 1

原创 6585: Cat Snuke and a Voyage(中石油)

6585: Cat Snuke and a Voyage 时间限制: 1 Sec  内存限制: 128 MB 提交: 202  解决: 86 [提交] [状态] [讨论版] [命题人:admin] 题目描述 In Takahashi Kingdom, there is an archipelago of N islands, called Takahashi Islands. For con...

2018-07-26 17:05:04 264

原创 6580: Splitting Pile(中石油)

6580: Splitting Pile 时间限制: 1 Sec  内存限制: 128 MB 提交: 293  解决: 88 [提交] [状态] [讨论版] [命题人:admin] 题目描述 Snuke and Raccoon have a heap of N cards. The i-th card from the top has the integer ai written on it...

2018-07-26 16:27:41 201

原创 C - Alternating Sum (杭电集训营2)

You are given two integers aa and bb. Moreover, you are given a sequence s0,s1,…,sns0,s1,…,sn. All values in ssare integers 11 or −1−1. It's known that sequence is kk-periodic and kk divides n+1n+1. I...

2018-07-24 21:21:18 214

原创 问题 A: Cakey McCakeFace

Cakey McCakeFace’s signature pastry, the Unknowable Cake, is baked daily in their Paris facility.The make-or-break trick for this cake is the cooking time, which is a very well-kept secret. Eve, the w...

2018-04-30 21:49:59 630

原创 5109: Boolean Satisability

Boolean satisfiability problem (SAT) is known to be a very hard problem in computer science. In this problem you are given a Boolean formula, and you need to find out if the variables of a given formu...

2018-04-29 11:56:12 266

原创 5088: Nine Knights

In the game of chess, knights are unique due to their “L-shaped” movement. A knight can move, as shown in figure A.1, by either moving two squares sideways and one square up or down, or moving one squ...

2018-04-24 11:35:40 227

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除