- 博客(5)
- 收藏
- 关注
原创 P1044栈(卡特兰数)
题解:栈的特点是先进先出,n个元素进栈,每个元素都有机会成为栈低元素,假设第K个元素处于栈低,那么f[k]=f[n-k]*f[k-1]+......+f[k-1]*f[n-k];题目背景栈是计算机中经典的数据结构,简单的说,栈就是限制在一端进行插入删除操作的线性表。栈有两种最重要的操作,即poppop(从栈顶弹出一个元素)和pushpush(将一个元素进栈)。栈的重要性不言自明,任...
2018-09-26 13:46:20 168
原创 P1028 数的计算(洛谷递归)
题目描述我们要求找出具有下列性质数的个数(包含输入的自然数nn):先输入一个自然数nn(n \le 1000n≤1000),然后对此自然数按照如下方法进行处理: 不作任何处理; 在它的左边加上一个自然数,但该自然数不能超过原数的一半; 加上数后,继续按此规则进行处理,直到不能再加自然数为止. 输入输出格式输入格式: 1个自然数n( n≤1000)...
2018-09-14 13:34:02 745 3
原创 Lakes in Berland CodeForces - 723D
The map of Berland is a rectangle of the size n × m, which consists of cells of size 1 × 1. Each cell is either land or water. The map is surrounded by the ocean.Lakes are the maximal regions of wat...
2018-09-07 13:21:46 135
原创 Fox And Two Dots(dfs)
Fox Ciel is playing a mobile puzzle game called "Two Dots". The basic levels are played on a board of size n × m cells, like this:Each cell contains a dot that has some color. We will use differen...
2018-09-05 23:45:29 154
原创 How Many Equations Can You Find (HDU2266)dfs
Now give you an string which only contains 0, 1 ,2 ,3 ,4 ,5 ,6 ,7 ,8 ,9.You are asked to add the sign ‘+’ or ’-’ between the characters. Just like give you a string “12345”, you can work out a string ...
2018-09-04 23:31:58 143
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人