自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

转载 Codeforces 789D Weird journey - 欧拉路 - 图论

Little boy Igor wants to become a traveller. At first, he decided to visit all the cities of his motherland— Uzhlyandia.It is widely known that Uzhlyandia hasncities connected withmbidir...

2017-08-26 21:24:00 104

转载 Codeforces 827E Rusty String - 快速傅里叶变换 - 暴力

Grigory loves strings. Recently he found a metal strip on a loft. The strip had lengthnand consisted of letters "V" and "K". Unfortunately, rust has eaten some of the letters so tha...

2017-08-21 22:52:00 136

转载 Codeforces 841D Leha and another game about graph - 差分

Leha plays a computer game, where is on each level is given a connected graph withnvertices andmedges. Graph can contain multiple edges, but can not contain self loops. Each vertex has an i...

2017-08-21 22:20:00 81

转载 bzoj 3560 DZY Loves Math V - 线性筛 - 扩展欧几里得算法

给定n个正整数a1,a2,…,an,求的值(答案模10^9+7)。Input第一行一个正整数n。接下来n行,每行一个正整数,分别为a1,a2,…,an。Output仅一行答案。Sample Input361015Sample Output1595Hint1<=n<=10^5,1<=ai<=10^7。共...

2017-08-16 22:51:00 97

转载 Codeforces 833A The Meaningless Game - 数论 - 牛顿迭代法 - 二分法

Slastyona and her loyal dog Pushok are playing a meaninglessgamethat is indeed very interesting.Thegameconsists of multiplerounds. Its rules are very simple: in each round, a natural num...

2017-08-15 21:31:00 103

转载 Codeforces 839C Journey - 树形动态规划 - 数学期望

There arencities andn - 1roads in the Seven Kingdoms, each road connects two cities and we can reach any city from any other by the roads.Theon and Yara Greyjoy are on a horse i...

2017-08-15 14:54:00 155

转载 Codeforces 839B Game of the Rows - 贪心

Daenerys Targaryen has an army consisting ofkgroups of soldiers, thei-th group containsaisoldiers. She wants to bring her army to the other side of the sea to get the Iron Throne. ...

2017-08-15 14:43:00 66

转载 Codeforces 839A Arya and Bran

Bran and his older sister Arya are from the same house. Bran like candies so much, so Arya is going to give him some Candies.At first, Arya and Bran have0Candies. There arendays, ...

2017-08-15 14:29:00 86

转载 hdu 4366 Successor - CDQ分治 - 线段树 - 树分块

Sean owns a company and he is the BOSS.The other Staff has one Superior.every staff has a loyalty and ability.Some times Sean will fire one staff.Then one of the fired man’s Subordinates will rep...

2017-08-12 13:39:00 216

转载 poj 2942 Knights of the Round Table - Tarjan

Being a knight is a very attractive career: searching for the Holy Grail, saving damsels in distress, and drinking with the other knights are fun things to do. Therefore, it is not very surprisin...

2017-08-10 21:14:00 107

转载 bzoj 1093 最大半连通子图 - Tarjan - 拓扑排序 - 动态规划

一个有向图G=(V,E)称为半连通的(Semi-Connected),如果满足:?u,v∈V,满足u→v或v→u,即对于图中任意两点u,v,存在一条u到v的有向路径或者从v到u的有向路径。若G'=(V',E')满足V'?V,E'是E中所有跟V'有关的边,则称G'是G的一个导出子图。若G'是G的导出子图,且G'半连通,则称G'为G的半连通子图。若G'是G所有半连通子图中包含节点数最多的,则...

2017-08-09 16:53:00 101

转载 HihoCoder 1236 Scores - bitset - 分块

Kyle is a student of Programming Monkey Elementary School. Just as others, he is deeply concerned with his grades.Last month, the school held an examination including five subjects, without any...

2017-08-08 17:29:00 79

转载 NOIP 车站分级 (luogu 1983 & codevs 3294 & vijos 1851) - 拓扑排序 - bitset

描述一条单向的铁路线上,依次有编号为 1, 2, ..., n 的 n 个火车站。每个火车站都有一个级别,最低为 1 级。现有若干趟车次在这条线路上行驶,每一趟都满足如下要求:如果这趟车次停靠了火车站 x,则始发站、终点站之间所有级别大于等于火车站 x 的都必须停靠。(注意:起始站和终点站自然也算作事先已知需要停靠的站点)例如,下表是 5 趟车次的运行情况。其中,前 4 趟车次均满足...

2017-08-08 14:02:00 169

转载 Codeforces 825D Suitable Replacement - 贪心 - 二分答案

You are given two strings s and t consisting of small Latin letters, string s can also contain '?' characters. Suitability of string s is calculated by following metric:Any two letters can ...

2017-08-06 17:40:00 68

转载 OpenJudge cdqz/Data Structure Challenge 2 (Problem 5822) - 可持久化线段树

描述给一个空数列,有M次操作,每次操作是以下三种之一:(1)在数列后加一个数(2)求数列中某位置的值(3)撤销掉最后进行的若干次操作(1和3)输入第一行一个正整数M。 接下来M行,每行开头是一个字符,若该字符为'A',则表示一个加数操作,接下来一个整数x,表示在数列后加一个整数x;若该字符为'Q',则表示一个询问操作,接下来一个整数x,表示求x位置的值;若该字符为...

2017-08-06 13:21:00 95

转载 Codeforces 834D The Bakery - 动态规划 - 线段树

Some time ago Slastyona the Sweetmaid decided to open her own bakery! She bought required ingredients and a wonder-oven which can bake several types of cakes, and opened the bakery.Soon the exp...

2017-08-06 12:06:00 82

转载 hdu 1394 Minimum Inversion Number - 树状数组

The inversion number of a given number sequence a1, a2, ..., an is the number of pairs (ai, aj) that satisfy i < j and ai > aj. For a given sequence of numbers a1, a2, ..., an, if we move...

2017-08-05 17:10:00 75

转载 Codeforces 837E Vasya's Function - 数论

Vasya is studying number theory. He has denoted a function f(a, b) such that:f(a, 0) = 0; f(a, b) = 1 + f(a, b - gcd(a, b)), where gcd(a, b) is the greatest common divisor of a and b. ...

2017-08-05 16:49:00 169

转载 Codeforces 837D Round Subset - 动态规划 - 数论

Let's call the roundness of the number the number of zeros to which it ends.You have an array of n numbers. You need to choose a subset of exactly k numbers so that the roundness of the produ...

2017-08-05 15:48:00 173

转载 Codeforces 825E Minimal Labels - 拓扑排序 - 贪心

You are given a directed acyclic graph with n vertices and m edges. There are no self-loops or multiple edges between any pair of vertices. Graph can be disconnected.You should assign labels ...

2017-08-05 14:16:00 92

转载 Codeforces 437D The Child and Zoo - 树分治 - 贪心 - 并查集 - 最大生成树

Of course our child likes walking in a zoo. The zoo has n areas, that are numbered from 1 to n. The i-th area contains ai animals in it. Also there are m roads in the zoo, and each road connect...

2017-08-05 13:42:00 105

转载 Codeforces 798D Mike and distribution - 贪心

Mike has always been thinking about the harshness of social inequality. He's so obsessed with it that sometimes it even affects him while solving problems. At the moment, Mike has two sequences...

2017-08-04 21:17:00 77

转载 Codeforces 822D My pretty girl Noora - 线性筛 - 动态规划

In Pavlopolis University where Noora studies it was decided to hold beauty contest "Miss Pavlopolis University". Let's describe the process of choosing the most beautiful girl in the universi...

2017-08-02 17:44:00 110

转载 Codeforces 799D Field expansion - 搜索 - 贪心

In one of the games Arkady is fond of the game process happens on a rectangular field. In the game process Arkady can buy extensions for his field, each extension enlarges one of the field sizes ...

2017-08-02 15:45:00 105

转载 Codeforces 438D The Child and Sequence - 线段树

At the children's day, the child came to Picks's house, and messed his house up. Picks was angry at him. A lot of important things were lost, in particular the favorite sequence of Picks.Fort...

2017-08-01 13:52:00 104

转载 Codeforces Round #427 (Div. 2) Problem D Palindromic characteristics (Codeforces 835D) - 记忆化搜索...

Palindromic characteristics of string s with length |s| is a sequence of |s| integers, where k-th number is the total number of non-empty substrings of s which are k-palindromes.A string is 1...

2017-08-01 10:58:00 64

转载 Codeforces Round #427 (Div. 2) Problem C Star sky (Codeforces 835C) - 前缀和

The Cartesian coordinate system is set in the sky. There you can see n stars, the i-th has coordinates (xi, yi), a maximum brightness c, equal for all stars, and an initial brightness si (0 ≤ s...

2017-08-01 09:33:00 77

转载 Codeforces Round #427 (Div. 2) Problem B The number on the board (Codeforces 835B) - 贪心

Some natural number was written on the board. Its sum of digits was not less than k. But you were distracted a bit, and someone changed this number to n, replacing some digits with others. It's...

2017-08-01 09:22:00 62

转载 Codeforces Round #427 (Div. 2) Problem A Key races (Codeforces 835 A)

Two boys decided to compete in text typing on the site "Key races". During the competition, they have to type a text consisting of s characters. The first participant types one character in v1 ...

2017-08-01 09:14:00 96

空空如也

空空如也

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

TA关注的人

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