屁颠屁颠の父
屁颠屁颠の父
全部文章
分类
归档
标签
去牛客网
登录
/
注册
屁颠屁颠の父的博客
全部文章
(共4篇)
题解 | 小红的二叉树
depth = int(input()) dp = [0] * depth dp[0] = 0 if depth == 1: print(dp[0]) elif depth == 2: dp[1] = 1 print(dp[1]) else: dp[1] = 1 ...
2025-03-13
0
58
题解 | 小红的01子序列构造(easy)
from collections import defaultdict # 双指针 滑动窗口 哈希 n, k = map(int, input().split()) s = input() left = 0 cur_01 = 0 # 代表当前01子串个数 cache = defaultdict(...
2025-03-13
0
61
题解 | 查找两个字符串a,b中的最长公共子串
# 最长公共子串(连续) # LCS 是不连续的 二维动态规划 text1 = input() text2 = input() # abcdefghijklmnop # abcsafjklmnopqrstuvw # 动态规划 if len(text1) > len(text2): # 让t...
2025-03-11
0
43
题解 | 24点游戏算法
from itertools import permutations, product """permutations 求全排列""" """product 求集合笛卡尔集(求组合) repeat"...
2025-03-10
0
65