牛客459000288号
牛客459000288号
全部文章
分类
题解(9)
归档
标签
去牛客网
登录
/
注册
牛客459000288号的博客
全部文章
(共56篇)
题解 | 画展布置
N, M = map(int, input().split()) arr = list(map(int, input().split())) # Algo arr.sort() minL = min(arr[i]**2-arr[i-M+1]**2 for i in range(M-1, N)) ...
2026-01-10
0
32
题解 | 画展布置
N, M = map(int, input().split()) arr = list(map(int, input().split())) # Algo arr.sort() cost = [arr[i]**2-arr[i-1]**2 for i in range(1, N)] m, n = M...
2026-01-10
0
30
题解 | 相差不超过k的最多数
n, k = map(int, input().split()) arr = list(map(int, input().split())) # Algo arr.sort() maxLen = 0 arr.append(1e10) # Sentinel n += 1 i = 0 for j i...
2026-01-09
0
25
题解 | 游游的最长稳定子数组
n = int(input()) arr = list(map(int, input().split())) # Algo i = 0 maxLen = 1 arr.append(1e10) # Sentinel n += 1 for j in range(n-1): if abs(ar...
2026-01-09
0
21
题解 | 小苯的IDE括号问题(easy)
n, k = map(int, input().split()) s = input() oprs = [input() for _ in range(k)] # Algo arr = list(s) ic = arr.index('I') i, j = ic-1, ic+1 for opr in...
2026-01-09
0
20
题解 | 【模板】双指针
n = int(input()) arr = list(map(int, input().split())) res = [] occ = [-1] * n maxLen = -1 i = 0 arr.append(arr[-1]) # Sentinel n += 1 for j in rang...
2026-01-09
0
33
题解 | 走一个大整数迷宫
from collections import deque # Process input n, m, p = map(int, input().split()) ma = [list(map(int, input().split())) for _ in range(n)] mb = [list...
2026-01-09
0
44
题解 | 时津风的资源收集
from collections import deque # Build distance matrix dist = [float("inf")] * 301 dist[10] = 0 dist[300] = 1 q = deque() q.append(10) q.app...
2026-01-09
0
31
题解 | 太阳系DISCO
from collections import deque # Input n, k, a, b, x, y = map(int, input().split()) # BFS q = deque() q.append((a, 0, k)) visited = [False] * n minTi...
2026-01-08
0
25
题解 | 迷宫
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
25
首页
上一页
1
2
3
4
5
6
下一页
末页