自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 HDU-1560 DNA sequence (迭代深搜)

The twenty-first century is a biology-technology developing century. We know that a gene is made of DNA. The nucleotide bases from which DNA is built are A(adenine), C(cytosine), G(guanine), and T(thy

2017-07-29 21:25:22 660

原创 HDU-3622 Bomb Game

Bomb GameTime Limit: 10000/3000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 5595    Accepted Submission(s): 2004Problem DescriptionRobbie is playi

2017-07-27 22:26:45 402

原创 HDU-6053 TrickGCD

TrickGCDTime Limit: 5000/2500 MS (Java/Others)    Memory Limit: 262144/262144 K (Java/Others)Total Submission(s): 549    Accepted Submission(s): 211Problem DescriptionYou are given an

2017-07-27 21:41:56 610

原创 HDU-5115 Dire Wolf

Dire WolfTime Limit: 5000/5000 MS (Java/Others)    Memory Limit: 512000/512000 K (Java/Others)Total Submission(s): 2486    Accepted Submission(s): 1459Problem DescriptionDire wolves, a

2017-07-27 09:57:27 462

原创 HDU-4280 Island Transport

In the vast waters far far away, there are many islands. People are living on the islands, and all the transport among the islands relies on the ships.   You have a transportation company there. Som

2017-07-26 21:27:43 627

原创 HDU-4729 Number

Here are two numbers A and B (0   For each x, f(x) equals to the amount of x’s special numbers.   For example, f(6)=1, because 6 only have one special number which is 4. And f(12)=3, its special n

2017-07-26 19:31:31 282

原创 HDU 6038 Function

FunctionTime Limit: 4000/2000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 607    Accepted Submission(s): 243Problem DescriptionYou are given a p

2017-07-26 10:37:57 507

原创 HDU 6034

Balala Power!Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 1145    Accepted Submission(s): 200Problem DescriptionTalente

2017-07-25 20:55:17 944

原创 D. Misha, Grisha and Underground(LCA 倍增)

D. Misha, Grisha and Undergroundtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputMisha and Grisha are funny

2017-07-25 10:33:19 994 2

转载 FZU2259 : 图

假设删除的边是(u,v),分两种情况讨论:1.删除(u,v)之后(u,v)不再连通,那么说明(u,v)是图的桥,同时整个图都要是二分图。2.删除(u,v)之后(u,v)依然连通,那么图不能是二分图,但是删除(u,v)之后必须要是二分图,这说明(u,v)位于所有奇环的交上,在忽略这条边之后可以进行黑白染色,且u,v必定同色。对图求出dfs生成树,找出所有基环,对每条边标记它被多少个奇

2017-07-24 21:18:26 364

转载 跳跃的舞者,舞蹈链(Dancing Links)算法——求解精确覆盖问题

精确覆盖问题的定义:给定一个由0-1组成的矩阵,是否能找到一个行的集合,使得集合中每一列都恰好包含一个1例如:如下的矩阵就包含了这样一个集合(第1、4、5行) 如何利用给定的矩阵求出相应的行的集合呢?我们采用回溯法 矩阵1: 先假定选择第1行,如下所示:如上图中所示,红色的那行是选中的一行,这一行中有3个1,分

2017-07-21 19:38:45 482

原创 HUST - 1017 Exact cover (Dancing Links)

There is an N*M matrix with only 0s and 1s, (1 InputThere are multiply test cases. First line: two integers N, M; The following N lines: Every line first comes an integer C(1 <= C <= 100), represent

2017-07-21 19:33:08 283

原创 HDU 2476 String painter (区间DP)

There are two strings A and B with equal length. Both strings are made up of lower case letters. Now you have a powerful string painter. With the help of the painter, you can change a segment of chara

2017-07-19 19:17:57 339

原创 HDU4283 You Are the One

The TV shows such as You Are the One has been very popular. In order to meet the need of boys who are still single, TJUT hold the show itself. The show is hold in the Small hall, so it attract a lot o

2017-07-19 17:11:32 233

原创 ZOJ-3469 Food Delivery

When we are focusing on solving problems, we usually prefer to stay in front of computers rather than go out for lunch. At this time, we may call for food delivery.Suppose there are N people living

2017-07-18 19:29:22 318

原创 poj1651 Multiplication Puzzle

The multiplication puzzle is played with a row of cards, each containing a single positive integer. During the move player takes one card out of the row and scores the number of points equal to the pr

2017-07-18 16:42:51 309

原创 CF 149D 区间dp

Once Petya read a problem about a bracket sequence. He gave it much thought but didn't find a solution. Today you will face it.You are given string s. It represents a correct bracket sequence. A cor

2017-07-18 15:26:53 468

原创 poj2955 Brackets

We give the following inductive definition of a “regular brackets” sequence:the empty sequence is a regular brackets sequence,if s is a regular brackets sequence, then (s) and [s] are regular brac

2017-07-18 13:28:02 236

原创 LightOJ 1422 Halloween Costumes

Gappu has a very busy weekend ahead of him. Because, next weekend is Halloween, and he is planning to attend as many parties as he can. Since it's Halloween, these parties are all costume parties, Gap

2017-07-17 23:16:44 766

原创 ZOJ-3537 Cake

You want to hold a party. Here's a polygon-shaped cake on the table. You'd like to cut the cake into several triangle-shaped parts for the invited comers. You have a knife to cut. The trace of each cu

2017-07-17 17:38:53 231

原创 bzoj 2049: [Sdoi2008]Cave 洞穴勘测

题目链接:http://www.lydsy.com/JudgeOnline/problem.php?id=2049他们都说是LCT的板子题,然而并不会LCT。这里纯粹是来练时间分治的。主要是学习了一下时间分治加可撤销的并查集。然后加深了对深搜递归的应用的理解。回溯撤销。我们把操作全部记录下来,把每条边的存活区间记录下来。对于一个时间点的查询,我们把当前存活的边连接起来看一下

2017-07-06 13:44:40 427

原创 cogs 1752. [BOI2007]摩基亚Mokia

题目链接:http://www.cogs.pro/cogs/problem/problem.php?pid=1752cdq分治模版题。就是处理前缀和的时候这里变成了矩阵前缀和。我们采用扫描线的方法,用树状数组来维护一个矩阵的前缀和。然后对于一个询问,我们采用矩阵前缀和的形式来处理这个询问,转化为4个操作。也就是对4个矩阵的处理。然后看代码就可以了。#include #in

2017-07-05 19:49:11 327

原创 hdu 1166 敌兵布阵(cdq分治)

第一次听了cdq分治,然后着手开始写了一下。其实就是把操作全部记录下来,注意当前的操作其实就是已经按照时间排好序的。我们把它按照时间分治,也就是类似归并排序那样,分治。然后每次计算并记录时间早(左区间)对时间晚的(右区间)的一个影响。具体的看代码可能更好理解一下。可以参考这里:http://blog.csdn.net/braketbn/article/details/51187

2017-07-04 20:52:54 277

原创 CF422 div2 C. Hacker, pack your bags!

C. Hacker, pack your bags!time limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputIt's well known that the best wa

2017-07-03 13:37:03 503

原创 CF422 div2 B. Crossword solving

B. Crossword solvingtime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputErelong Leha was bored by calculating o

2017-07-03 13:32:17 398

原创 spoj10606 Balanced Numbers

Balanced numbers have been used by mathematicians for centuries. A positive integer is considered a balanced number if:1)      Every even digit appears an odd number of times in its decimal represen

2017-07-02 22:27:01 252

转载 HDU4507 吉哥系列故事――恨7不成妻

单身!   依然单身!   吉哥依然单身!   DS级码农吉哥依然单身!   所以,他生平最恨情人节,不管是214还是77,他都讨厌!      吉哥观察了214和77这两个数,发现:   2+1+4=7   7+7=7*2   77=7*11   最终,他发现原来这一切归根到底都是因为和7有关!所以,他现在甚至讨厌一切和7有关的数!   什么样的数

2017-07-02 21:08:08 396

原创 HDU4734 F(x)

For a decimal number x with n digits (A nA n-1A n-2 ... A 2A 1), we define its weight as F(x) = A n * 2 n-1 + A n-1 * 2 n-2 + ... + A 2 * 2 + A 1 * 1. Now you are given two numbers A and B, please c

2017-07-02 17:17:26 459

原创 HDU3652 B-number

A wqb-number, or B-number for short, is a non-negative integer whose decimal form contains the sub- string "13" and can be divided by 13. For example, 130 and 2613 are wqb-numbers, but 143 and 2639 ar

2017-07-01 22:26:04 194

原创 HDU 3709

A balanced number is a non-negative integer that can be balanced if a pivot is placed at some digit. More specifically, imagine each digit as a box with weight indicated by the digit. When a pivot is

2017-07-01 21:42:18 299

原创 poj3252 Round Numbers

The cows, as you know, have no fingers or thumbs and thus are unable to play Scissors, Paper, Stone' (also known as 'Rock, Paper, Scissors', 'Ro, Sham, Bo', and a host of other names) in order to make

2017-07-01 20:34:37 277

原创 hdu3555 Bomb

The counter-terrorists found a time bomb in the dust. But this time the terrorists improve on the time bomb. The number sequence of the time bomb counts from 1 to N. If the current number sequence inc

2017-07-01 18:41:18 202

原创 hdu2089 不要62

杭州人称那些傻乎乎粘嗒嗒的人为62(音:laoer)。 杭州交通管理局经常会扩充一些的士车牌照,新近出来一个好消息,以后上牌照,不再含有不吉利的数字了,这样一来,就可以消除个别的士司机和乘客的心理障碍,更安全地服务大众。 不吉利的数字为所有含有4或62的号码。例如: 62315 73418 88914 都属于不吉利号码。但是,61152虽然含有6和2,但不是62连号,所以不属于不吉

2017-07-01 18:24:58 239

原创 HDU 4352 XHXJ's LIS

#define xhxj (Xin Hang senior sister(学姐)) If you do not know xhxj, then carefully reading the entire description is very important. As the strongest fighting force in UESTC, xhxj grew up in Jintan

2017-07-01 17:59:57 425

转载 最长上升子序列(LIS)长度的O(nlogn)算法

hdu 1950 Bridging signalshttp://acm.hdu.edu.cn/showproblem.php?pid=1950===================================最长上升子序列(LIS)的典型变形,熟悉的n^2的动归会超时。LIS问题可以优化为nlogn的算法。定义d[k]:长度为k的上升子序列的最末元素,若有多个长度为

2017-07-01 13:57:49 397

空空如也

空空如也

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

TA关注的人

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