自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 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 469

原创 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 767

原创 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 240

原创 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

原创 Beautiful numbers

Volodya is an odd boy and his taste is strange as well. It seems to him that a positive integer number is beautiful if and only if it is divisible by each of its nonzero digits. We will not argue with

2017-06-24 20:26:28 528

原创 Satisfactory Pairs

Given a positive integer, , find and print the number of pairs of positive integers , where , that exist such that the equation  (where  and  are positive integers) has at least one solution.

2017-06-23 15:26:33 296

原创 Range Minimum Queries

You are given an array of N integers. You should support the following queries on this array.0 L R : Find the minimum integer in the range AL, AL+1, ..., AR.1 L R X : You should apply the assignme

2017-06-23 15:06:54 378

原创 C. Arithmetic Progression

C. Arithmetic Progressiontime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputEverybody knows what an arithmetic

2017-06-21 13:40:27 658

原创 B. Number Busters

B. Number Busterstime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputArthur and Alexander are number busters. T

2017-06-21 13:31:37 432

转载 Making the Grade (线性+优化思维?)

A straight dirt road connects two fields on FJ's farm, but it changes elevation more than FJ would like. His cows do not mind climbing up or down a single slope, but they are not fond of an alternatin

2017-06-21 13:18:56 2849 1

原创 poj3616 Milking Time

Bessie is such a hard-working cow. In fact, she is so focused on maximizing her productivity that she decides to schedule her next N (1 ≤ N ≤ 1,000,000) hours (conveniently labeled 0..N-1) so that she

2017-06-19 21:13:03 392

原创 HDU 2859 Phalanx (DP)

Today is army day, but the servicemen are busy with the phalanx for the celebration of the 60th anniversary of the PRC. A phalanx is a matrix of size n*n, each element is a character (a~z or A~Z), s

2017-06-19 20:31:31 356

原创 FatMouse and Cheese

FatMouse has stored some cheese in a city. The city can be considered as a square grid of dimension n: each grid location is labelled (p,q) where 0 <= p < n and 0 <= q < n. At each grid location Fatmo

2017-06-19 16:52:11 198

原创 区间价值 HihoCoder - 1483

给定n个数A1...An,小Ho想了解AL..AR中有多少对元素值相同。小Ho把这个数目定义为区间[L,R]的价值,用v[L,R]表示。例如1 1 1 2 2这五个数所组成的区间的价值为4。现在小Ho想知道在所有的的v[L,R](1 Input第一行一个数T(T对于每一组数据:第一行两个数n,k(1第二行n个数A1…An(1iOutput一个数表示答案。

2017-06-19 15:59:22 725

原创 HackerRank - stone-division

Consider the following game:There are two players, First and Second, sitting in front of a pile of  stones. First always plays first.There is a set, , of  distinct integers defined as .The p

2017-06-18 16:30:56 312

原创 HDU-4027 Can you answer these queries?

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. Each of the battleships can be marked a value of end

2017-06-18 13:43:13 291

原创 C. Karen and Game

C. Karen and Gametime limit per test2 secondsmemory limit per test512 megabytesinputstandard inputoutputstandard outputOn the way to school, Karen became fixate

2017-06-18 13:09:09 442

原创 Help Jimmy

"Help Jimmy" 是在下图所示的场景上完成的游戏。 场景中包括多个长度和高度各不相同的平台。地面是最低的平台,高度为零,长度无限。 Jimmy老鼠在时刻0从高于所有平台的某处开始下落,它的下落速度始终为1米/秒。当Jimmy落到某个平台上时,游戏者选择让它向左还是向右跑,它跑动的速度也是1米/秒。当Jimmy跑到平台的边缘时,开始继续下落。Jimmy每次下落的高度不能超

2017-06-17 16:51:33 414

原创 URAL - 1932

Davy Jones: You've been captain of the Black Pearl for 13 years. That was our agreement. Jack: Technically I was only captain for two years, then I was mutinied upon.  Davy Jones: Then you were a

2017-06-16 21:52:54 359

原创 ZOJ - 3795

Suppose there are N people in ZJU, whose ages are unknown. We have some messages about them. The i-th message shows that the age of person si is not smaller than the age of person ti. Now we need to

2017-06-16 15:04:03 439

原创 POJ - 3107

Last years Chicago was full of gangster fights and strange murders. The chief of the police got really tired of all these crimes, and decided to arrest the mafia leaders.Unfortunately, the structure

2017-06-16 14:56:44 287

转载 Jury Compromise

In Frobnia, a far-away country, the verdicts in court trials are determined by a jury consisting of members of the general public. Every time a trial is set to begin, a jury has to be selected, which

2017-06-14 19:40:22 280

原创 C. The Tag Game

C. The Tag Gametime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputAlice got tired of playing the tag game by t

2017-06-14 16:19:45 304

原创 B.The Golden Age

B. The Golden Agetime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputUnlucky year in Berland is such a year tha

2017-06-14 16:07:18 354

原创 FatMouse's Speed

FatMouse believes that the fatter a mouse is, the faster it runs. To disprove this, you want to take the data on a collection of mice and put as large a subset of this data as possible into a sequence

2017-06-12 12:06:35 239

空空如也

空空如也

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

TA关注的人

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