CF 305C (set容器)

题目链接: 题目大意:给你一个n表示有n个ai,ai表示2^ai。问你需要再加几个b代表2^b,让他们的总和为2^v-1。(v是任意一个数)。 思路:2^v-1的结果的二进制表示肯定仅由1组成,所以我们...

2018-11-28 21:25:08

阅读数 29

评论数 0

UVA - 10020 Minimal coverage (区间更新,贪心)

 Minimal coverage  The Problem Given several segments of line (int the X axis) with coordinates [Li,Ri]. You are to choose the minimal amount of the...

2018-11-28 12:17:32

阅读数 31

评论数 0

反素数学习~Codeforces 27E (模板题)

先上一篇大佬的文章学习一下反素数的概念   Given the number n, find the smallest positive integer which ha...

2018-11-27 22:12:15

阅读数 54

评论数 0

CF892C (gcd++)

You have an array a with length n, you can perform operations. Each operation is like this: choose two adjacent elements from a, say xand y, and rep...

2018-11-27 13:05:36

阅读数 250

评论数 0

CF 288B Polo the Penguin and Houses(purfer序列公式)

Little penguin Polo loves his home village. The village has n houses, indexed by integers from 1 to n. Each house has a plaque containing an integer...

2018-11-25 22:09:57

阅读数 38

评论数 0

POJ1905 Expanding Rods(二分)

Description When a thin rod of length L is heated n degrees, it expands to a new length L'=(1+n*C)*L, where C is the coefficient of heat expansion....

2018-11-22 15:58:44

阅读数 42

评论数 0


广义表一般记作 LS = (a1, a2, ···, an), n是它的长度,ai可以是单个元素(原子),也可以是广义表(子表),当广义表非空时,称第一个元素a1为LS的表头,称其余元素组成的表为LS的表尾。注意:表头是元素(可以是原子,也可以是广表),表尾一定是广义表。E=(a, E)是一个递...

2018-11-21 21:09:47

阅读数 67

评论数 0

(超详细)POJ3104 Drying(让我痛不欲生的二分)

Description It is very hard to wash and especially to dry clothes in winter. But Jane is a very smart girl. She is not afraid of this boring proces...

2018-11-21 19:49:31

阅读数 270

评论数 1

POJ3258 River Hopscotch(二分)

Description Every year the cows hold an event featuring a peculiar version of hopscotch that involves carefully jumping from rock to rock in a rive...

2018-11-21 09:43:58

阅读数 43

评论数 0

POJ 2456 Aggressive cows(二分)

Description Farmer John has built a new long barn, with N (2 <= N <= 100,000) stalls. The stalls are located along a straight...

2018-11-20 21:14:30

阅读数 30

评论数 0

Codeforces 284C Cows and Sequence(思维)

Bessie and the cows are playing with sequences and need your help. They start with a sequence, initially containing just the number 0, and perform n...

2018-11-20 16:43:00

阅读数 45

评论数 0

CodeForces - 280B Maximum Xor Secondary(单调栈)

Bike loves looking for the second maximum element in the sequence. The second maximum element in the sequence of distinct numbers x1, x2, ..., xk (k...

2018-11-19 20:00:18

阅读数 49

评论数 0

CodeForces - 270C Magical Boxes(思维)

Emuskald is a well-known illusionist. One of his trademark tricks involves a set of magical boxes. The essence of the trick is in packing the boxes ...

2018-11-18 15:15:43

阅读数 54

评论数 0

CodeForces - 271B Prime Matrix (素数打表)

You've got an n × m matrix. The matrix consists of integers. In one move, you can apply a single transformation to the matrix: choose an arbitrary e...

2018-11-17 20:42:40

阅读数 103

评论数 0

HDU 1852 Beijing 2008(快速幂+取模)

Problem Description As we all know, the next Olympic Games will be held in Beijing in 2008. So the year 2008 seems a little special somehow....

2018-11-16 12:20:49

阅读数 48

评论数 0

hdu6170 Two strings (DP)

  Problem Description Giving two strings and you should judge if they are matched. The first string contains lowercase letters and upperca...

2018-11-14 21:22:44

阅读数 32

评论数 0

HDU 4595 Shaolin (c++ map)

  Problem Description Shaolin temple is very famous for its Kongfu monks.A lot of young men go to Shaolin temple every year, trying to be a m...

2018-11-13 19:28:09

阅读数 36

评论数 0

HDU 1233 还是畅通工程(最小生成树prim 模板)

Problem Description 某省调查乡村交通状况,得到的统计表中列出了任意两村庄间的距离。省政府“畅通工程”的目标是使全省任何两个村庄间都可以实现公路交通(但不一定有直接的公路相连,只要能间接通过公路可达即可),并要求铺设的公路总长度为最小。请计算最小的公路总长度。     I...

2018-11-11 15:48:59

阅读数 63

评论数 0

CodeForces - 255B Code Parsing (找规律简单)

Little Vitaly loves different algorithms. Today he has invented a new algorithm just for you. Vitaly's algorithm works with string s, consisting of ...

2018-11-10 21:08:58

阅读数 27

评论数 0

HDU 1575 Tr A(矩阵快速幂模板)

Problem Description A为一个方阵,则Tr A表示A的迹(就是主对角线上各项的和),现要求Tr(A^k)%9973。     Input 数据的第一行是一个T,表示有T组数据。 每组数据的第一行有n(2 &lt...

2018-11-10 19:41:43

阅读数 54

评论数 0

取消 删除