- 博客(9)
- 资源 (2)
- 收藏
- 关注
原创 HDU-1069 Monkey and Banana [DP -> 二维最长上升串]
A group of researchers are designing an experiment to test the IQ of a monkey. They will hang a banana at the roof of a building, and at the mean time, provide the monkey with some blocks. If the monk...
2018-04-29 04:10:03 135
原创 51Nod 1013 3的幂的和 经典模板题+思路详细讲解【等比数列+快速幂+逆元】
求:3^0 + 3^1 +...+ 3^(N) mod 1000000007Input输入一个数N(0 <= N <= 10^9)Output输出:计算结果Input示例3Output示例40 题目大意&&解题思路:根据题目描述,即求一个a1为1,q为3的等比数列之和,公式为a1(1-q^n)/1-q ——>> (3^n-1)/2。这里有两个点需要思考...
2018-04-27 21:23:08 183
原创 Intervals ZOJ - 3953(贪心就完事了)【浙大17th校赛】
Chiaki has n intervals and the i-th of them is [li, ri]. She wants to delete some intervals so that there does not exist three intervals a, b and c such that a intersects with b, b intersects with c a...
2018-04-15 20:40:55 180
原创 Partitioning by Palindromes UVA - 11584(最小回文串分解DP)
We say a sequence of charactersis a palindrome if itis the same written forwardsand backwards. For example,‘racecar’ is a palindrome, but‘fastcar’ is not. A partition of a sequence ofcharacters...
2018-04-15 01:14:07 168
原创 POJ 1777 Picture(线段树+离散化+扫描线)
A number of rectangular posters, photographs and other pictures of the same shape are pasted on a wall. Their sides are all vertical or horizontal. Each rectangle can be partially or totally covered b...
2018-04-13 00:19:41 264
原创 HDU-1556 Color the ball(线段树-区间染色)
N个气球排成一排,从左到右依次编号为1,2,3....N.每次给定2个整数a b(a <= b),lele便为骑上他的“小飞鸽"牌电动车从气球a开始到气球b依次给每个气球涂一次颜色。但是N次以后lele已经忘记了第I个气球已经涂过几次颜色了,你能帮他算出每个气球被涂过几次颜色吗?Input每个测试实例第一行为一个整数N,(N <= 100000).接下来的N行,每行包括2个整数a b(...
2018-04-11 00:25:57 504
原创 Common Subsequence (LCS最大公共串模版题)POJ - 1458
A subsequence of a given sequence is the given sequence with some elements (possible none) left out. Given a sequence X = < x1, x2, ..., xm > another sequence Z = < z1, z2, ..., zk > is a ...
2018-04-06 14:55:28 199
原创 Brute Force Sorting (数组实现双向链表 经典模版)ACM-ICPC 青岛站
Beerus needs to sort an array of NN integers. Algorithms are not Beerus's strength. Destruction is what he excels. He can destroy all unsorted numbers in the array simultaneously. A number A[i]A[i] of...
2018-04-06 14:45:02 338
原创 Alphacode (动态规划思想)POJ - 2033 HDU - 1508
Alice and Bob need to send secret messages to each other and are discussing ways to encode their messages: Alice: "Let's just use a very simple code: We'll assign 'A' the c...
2018-04-02 23:36:53 517
多种群遗传算法函数优化
2018-03-06
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人