牛客459000288号
牛客459000288号
全部文章
分类
题解(9)
归档
标签
去牛客网
登录
/
注册
牛客459000288号的博客
全部文章
(共37篇)
题解 | 迷宫
from collections import deque # Process input m, n = map(int, input().split()) mat = [None] * m start = None end = None for i in range(m): mat[i]...
2026-01-08
0
5
题解 | 迷宫问题
h, w = map(int, input().split()) mat = [list(map(int, input().split())) for _ in range(h)] # Algo def dfs(mat, i, j, path): if i+j == w+h-1: ...
2026-01-08
0
7
题解 | 火车进站
# Process input n = int(input()) ax = input().split() # DFS def dfs(arr, i, station, seq, orders): if i == len(arr) and not station: orde...
2026-01-08
0
10
题解 | 小红的字符串
# Process input s = input() # Algo cnt = 0 for i in range(len(s)//2): chLeft = s[i] chRight = s[len(s)-i-1] ordL = ord(chLeft) ordR =...
2026-01-07
0
5
题解 | 清楚姐姐买竹鼠
# Process input a, b, x = map(int, input().split()) # Algo if a > b/3: print((x//3)*b+min((x%3)*a, b)) else: print(x*a)
2026-01-07
0
8
题解 | 【模板】滑动窗口
# Process input n, k = map(int, input().split()) ax = list(map(int, input().split())) # Compute maxVals = [] lastMax = 1e10 lastMaxI = -1 for i in ra...
2026-01-07
0
6
题解 | kotori和素因子
# Process input n = int(input()) ax = list(map(int, input().split())) # Functions def prime_factors(n): factors = set() d = 2 while d*d &...
2026-01-07
0
5
题解 | 实现字通配符*
import re # Process input p = input() s = input() # Algo chips = re.split(r"\*+", p) # - Special cases if len(chips) == 2 and chips[0] == ...
2026-01-07
0
7
题解 | 模意义下最大子序列和(Easy Version)
# Process input n, m = tuple(map(int, input().split())) arr = list(map(int, input().split())) # DFS def dfs(i, acc): if i == len(arr): re...
2026-01-07
0
8
题解 | 数组分组
# Process input n = int(input()) arr = list(map(int, input().split())) # DFS def dfs(arr, i, sumA, sumB): if i == len(arr): return sumA =...
2026-01-07
0
8
首页
上一页
1
2
3
4
下一页
末页