贝_Z
贝_Z
全部文章
题解
归档
标签
去牛客网
登录
/
注册
贝_Z的博客
全部文章
/ 题解
(共6篇)
Python 哈希表+双向链表/有序字典
最近使用的放在链表尾部 哈希表 + 双向链表 class DListNode: def __init__(self, x=0, y=0): self.key = x self.value = y self.pre = None ...
python
有序字典
双向链表
哈希表
2020-10-11
7
1378
Python3 扑克牌大小
while True: try: s1, s2 = input().split('-') a, b = s1.split(), s2.split() n1, n2 = len(a), len(b) d = {'3':3, '4'...
python
2020-09-10
13
1742
Python3 矩阵乘法
while True: try: x = int(input()) y = int(input()) z = int(input()) A, B = [], [] res = [[0] * z for _ in ...
python
2020-09-09
15
1509
Python3 DFS 递归
import sys def dfs(nums): l = len(nums) if len(nums) == 1: return abs(nums[0] - 24) < eps for i in range(l): for j in r...
DFS
递归
python
2020-09-09
6
1219
Python3 动态规划
while True: try: s1 = input() s2 = input() if len(s1) > len(s2): s1, s2 = s2, s1 m, n = len(s1), le...
python
动态规划
2020-09-09
9
1558
Python3 MP3光标位置
def move(orders): pos, min_pos = 0, 0 # 光标位置, 当前页面最小值 for order in orders: if order == 'U': pos = (pos-1) % n # 一般上翻页 ...
2020-09-09
2
790