Round Numbers POJ - 3252(数位dp )

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, Sha...

2019-01-27 13:52:14

阅读数 12

评论数 0

HDU 3555 Bomb(数位dp )

Problem Description The counter-terrorists found a time bomb in the dust. But this time the terrorists improve on the time bomb. The number sequence ...

2019-01-27 09:41:27

阅读数 24

评论数 0

HDU - 2089 不要62(数位dp )

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

2019-01-26 19:07:38

阅读数 27

评论数 0

D-City HDU - 4496(并查集)

Luxer is a really bad guy. He destroys everything he met. One day Luxer went to D-city. D-city has N D-points and M D-lines. Each D-line connects exa...

2019-01-02 11:36:27

阅读数 11

评论数 0

GCD and LCM HDU - 4497(容斥 & 唯一分解)

Given two positive integers G and L, could you tell me how many solutions of (x, y, z) there are, satisfying that gcd(x, y, z) = G and lcm(x, y, z) =...

2019-01-02 11:00:59

阅读数 9

评论数 0

CodeForces - 510D Fox And Jumping (dp & 数论)

Fox Ciel is playing a game. In this game there is an infinite long tape with cells indexed by integers (positive, negative and zero). At the beginnin...

2018-12-29 11:35:52

阅读数 13

评论数 0

CodeForces - 520B Two Buttons(逆向思维)

Vasya has found a strange device. On the front panel of a device there are: a red button, a blue button and a display showing some positive integer. ...

2018-12-28 14:36:28

阅读数 10

评论数 0

DNA Alignment CodeForces - 520C(思维)

Vasya became interested in bioinformatics. He’s going to write an article about similar cyclic DNA sequences, so he invented a new method for determi...

2018-12-26 11:20:27

阅读数 11

评论数 0

POJ 4047 Garden(线段树)

这个题目,emmm,PDF格式,我复制出来实在是没啥格式可言,这里就不挂题目了。 参考题解 有n个连续的一维上的点,每个点有一个美丽值。 每次有三种操作: 1、将x点的美丽值改为y。 2、将x、y交换 3、查询[x y]间,连续k个点的美丽值总和的最大值。 这里我是看的题解的做法,利...

2018-12-24 20:48:53

阅读数 7

评论数 0

Gym 101911A Coffee Break(优先队列)

Recently Monocarp got a job. His working day lasts exactly m minutes. During work, Monocarp wants to drink coffee at certain moments: there are n min...

2018-12-17 18:19:17

阅读数 9

评论数 0

LightOJ - 1031 - Easy Game(区间dp )

You are playing a two player game. Initially there are n integer numbers in an array and player A and B get chance to take them alternatively. Each p...

2018-12-03 16:45:30

阅读数 11

评论数 0

CodeForces - 340D - Bubble Sort Graph(最长非降子序列)

Iahub recently has learned Bubble Sort, an algorithm that is used to sort a permutation with n elements a1, a2, …, an in ascending order. He is bored...

2018-12-03 16:37:54

阅读数 14

评论数 0

HihoCoder - 1110 - Regular Expression(区间dp )

Your task is to judge whether the input is a legal regular expression. A regular expression is defined as follow: 1: 0 and 1 are both regular express...

2018-12-03 16:24:42

阅读数 11

评论数 0

CodeForces - 298D Fish Weight(思维)

It is known that there are k fish species in the polar ocean, numbered from 1 to k. They are sorted by non-decreasing order of their weight, which is...

2018-11-28 13:12:18

阅读数 14

评论数 0


Drainage Ditches 参考博客 用这篇博客学习了一下bfs求解最大流,然后先做一下笔记。(以下均为笔者自己理解,有不对之处还望大佬指出) 首先,我们学习最大流就要先了解什么是最大流。 最大流问题定义:管道网络中每条边的最大通过能力(容量)是有限的,实际流量不超过容量。最大流问...

2018-11-27 13:35:13

阅读数 34

评论数 0

POJ - 1947 - Rebuilding Roads(树形dp )

The cows have reconstructed Farmer John’s farm, with its N barns (1 <= N <= 150, number 1…N) after the terrible earthqu...

2018-11-16 19:21:52

阅读数 19

评论数 0

CodeForces - 264A - Escape from Stones(栈和队列的应用)

Squirrel Liss lived in a forest peacefully, but unexpected trouble happens. Stones fall from a mountain. Initially Squirrel Liss occupies an interval...

2018-11-14 10:51:48

阅读数 5

评论数 0

hdu-2376 - Average distance(树形dp )

Given a tree, calculate the average distance between two vertices in the tree. For example, the average distance between two vertices in the followin...

2018-11-14 10:28:04

阅读数 9

评论数 0

CodeForces - 260 - BAncient Prophesy(暴力)

A recently found Ancient Prophesy is believed to contain the exact Apocalypse date. The prophesy is a string that only consists of digits and charact...

2018-11-13 09:34:11

阅读数 48

评论数 0

CodeForces - 260A - Adding Digits(思维)

Vasya has got two number: a and b. However, Vasya finds number a too short. So he decided to repeat the operation of lengthening number a n times. On...

2018-11-13 09:27:23

阅读数 45

评论数 0

取消 删除