题意:给你n个数(n<=100,ai<=300) 一个T,求n重复T次的最长非递减子序列。 题解:我直接考虑4 3 2 1 的例子,当其重复4次时会出现1 2 3 4 的子序列 ,此时再怎么重复,这也是最长的递增序列,无非是多出(T-n)个1. 所以直接不完全(不会证明地)归纳处一个答案:ans=T ...
分类:
其他好文 时间:
2018-03-19 20:49:47
阅读次数:
275
1.递归 (1)调用自身 (2)结束返回条件 2.举例: (1)1-100求和 分析: (2)斐波那契数列(Fibonacci sequence),又称黄金分割数列、因数学家列昂纳多·斐波那契(Leonardoda Fibonacci)以兔子繁殖为例子而引入,故又称为“兔子数列”,指的是这样一个数列 ...
分类:
编程语言 时间:
2018-03-19 13:46:44
阅读次数:
232
# 1、使用while循环输入 1 2 3 4 5 6 8 9 10 count = 0 while count 2: print("go away") else: print('please try again') ...
分类:
其他好文 时间:
2018-03-16 21:36:10
阅读次数:
213
1.模块概念的官网描述 —— "Module" If you quit from the Python interpreter and enter it again, the definitions you have made (functions and variables) are lost. ...
分类:
其他好文 时间:
2018-03-15 00:29:13
阅读次数:
244
Description定义$F(x)$为$F(x?1)$与$F(x?2)$的连接(其中$F(0)="0"$,$F(1)="1"$)给出一个长度为$n$的$01$字符串$s$,询问$s$在$F(x)$的所有子序列中出现了多少次。$1≤n≤100$$0≤x≤100$ExamplesInput2 411O ...
分类:
其他好文 时间:
2018-03-14 12:42:43
阅读次数:
204
CentOS7.3昨天用的还好好的的,但是今天开机提示如下(如图提示):welcome to emergency mode!after logging in ,type “journalctl -xb” to view system logs,“systemctl reboot” to reboot ,“systemctl default” to try again to boot into de
分类:
其他好文 时间:
2018-03-13 16:30:58
阅读次数:
1641
题目链接: http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=2060 题目描述: There are another kind of Fibonacci numbers: F(0) = 7, F(1) = 11, F(n) = ...
分类:
其他好文 时间:
2018-03-11 14:18:35
阅读次数:
228
Dima is a beginner programmer. During his working process, he regularly has to repeat the following operation again and again: to remove every second ...
分类:
其他好文 时间:
2018-03-10 11:54:51
阅读次数:
192
1. 问题的现象 比如在webConfig中定义了一个viewResolver 然后定义了一个controller,URL路径为"/home", 它返回名字叫home的view 然后定义了个Test 那么执行Test是就会报类似错误并抛出异常: 2. 首先,首先说下原因: 当没有声明ViewReso ...
分类:
Web程序 时间:
2018-03-06 13:47:21
阅读次数:
991