祝你好运呀
祝你好运呀
全部文章
题解
归档
标签
去牛客网
登录
/
注册
祝你好运呀的博客
全部文章
/ 题解
(共9篇)
题解 | #有多少个不同的二叉搜索树#
n=int(input()) dp=[0]*(n+1) dp[0] = 1 dp[1] = 1 for i in range(2,n+1): for j in&n...
Python3
2022-04-11
0
420
题解 | #跳台阶扩展问题#
n=int(input()) from functools import reduce dp=[1]*(n+1) if n<2: print(dp[n]) else: &...
Python3
2022-04-11
0
323
题解 | #跳台阶#
n=int(input()) dp=[1]*(n+1) if n<2: print(dp[n]) else: for i in range(2,n+1): &...
Python3
2022-04-11
0
426
题解 | #斐波那契数列#
n=int(input()) dp=[1]*(n+1) dp[0]=0 if n<2: print(dp[n]) else: for i in range(2...
Python3
2022-04-11
0
522
题解 | #打家劫舍(一)#
def rob(self, nums: List[int]) -> int: # write code here n&...
Python3
2022-04-11
0
276
题解 | #打家劫舍(二)#
# # 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 # # # @param nums int整型一维数组 # @return int整型 # class Solution: ...
Python3
2022-04-11
1
432
题解 | #买卖股票的最好时机(三)#
# # 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 # # 两次交易所能获得的最大收益 # @param prices int整型一维数组 股票每一天的价格 # @return int整型 ...
Python3
2022-04-11
3
334
题解 | #整数与IP地址间的转换#
arr=list(map(int,input().split('.'))) k=int(input()) brr='' for i in arr: brr+=bin(i)[2:].rjust(8,'0') print(in...
Python3
2022-04-08
12
569
题解 | #[NOIP2008]笨小猴#
def sushu(n): fac=[] if n==1: return else: for i in range(2,n): if n%i==0: fac.append(i) if not fac: return n else: return s=input() arr=[] for i in s...
Python3
2022-03-30
1
354