这是 2026-10-23 的上一版评测(LiveCodeBench 最新 35 题)。最新的阶梯评测见 首页。
结果
Kimi K3.1 ProKimi
✓
通过
- 官方测试 44/44判题
- 26.7k输出 token(含思考) ↓
- 416 秒延迟 ↓
- —最慢测试的 CPU 时间 ↓
- —峰值内存 ↓
- 4Pylint 问题 ↓
- 9.29Pylint 得分 ↑
- 14圈复杂度 ↓
- 55.7可维护性指数 ↑
- 56有效行
- 1SonarQube 问题 ↓
DeepSeek-V4.1-FlashDS-Flash
✓
通过
- 官方测试 44/44判题
- 49.0k输出 token(含思考) ↓
- 290 秒延迟 ↓
- —最慢测试的 CPU 时间 ↓
- —峰值内存 ↓
- 16Pylint 问题 ↓
- 8.32Pylint 得分 ↑
- 44圈复杂度 ↓
- 36.5可维护性指数 ↑
- 95有效行
- 1SonarQube 问题 ↓
DeepSeek-V4-ProDS-Pro
✓
通过
- 官方测试 44/44判题
- 63.9k输出 token(含思考) ↓
- 544 秒延迟 ↓
- —最慢测试的 CPU 时间 ↓
- —峰值内存 ↓
- 14Pylint 问题 ↓
- 8.51Pylint 得分 ↑
- 34圈复杂度 ↓
- 39.2可维护性指数 ↑
- 94有效行
- 2SonarQube 问题 ↓
↑ 越大越好,↓ 越小越好,有效行只描述代码长短。CPU 时间与内存只统计能区分性能的题(最慢答案扣除进程启动后仍 ≥ 0.1 秒),括号内为相对最快者的倍数(≥ 2 时标出)。静态质量按 arXiv:2610.19167 的口径(见 原理)。判题方法见 原理 › 判题。
代码
Kimi K3.1 Pro · 76 行
import sys from collections import deque def main(): data = sys.stdin.buffer.read().split() it = iter(data) h = int(next(it)) w = int(next(it)) grid = [next(it) for _ in range(h)] a = int(next(it)) b = int(next(it)) c = int(next(it)) d = int(next(it)) n = h * w start = (a - 1) * w + (b - 1) goal = (c - 1) * w + (d - 1) inf = n + 1 dist = [inf] * n dist[start] = 0 dq = deque([start]) popleft = dq.popleft append = dq.append appendleft = dq.appendleft finished = bytearray(n) # Moving to an adjacent original road costs 0. # A kick makes the cells one and two steps away in its direction usable, # so reaching either of those cells can be represented by a cost-1 edge. directions = ((-1, 0, -w), (1, 0, w), (0, -1, -1), (0, 1, 1)) while dq: v = popleft() if finished[v]: continue finished[v] = 1 dv = dist[v] if v == goal: print(dv) return r, col = divmod(v, w) nd = dv + 1 for dr, dc, step in directions: r1 = r + dr c1 = col + dc if 0 <= r1 < h and 0 <= c1 < w: u = v + step if grid[r1][c1] == 46 and dv < dist[u]: # '.' dist[u] = dv appendleft(u) if nd < dist[u]: dist[u] = nd append(u) r2 = r1 + dr c2 = c1 + dc if 0 <= r2 < h and 0 <= c2 < w: u += step if nd < dist[u]: dist[u] = nd append(u) print(dist[goal]) if __name__ == "__main__": main()
DeepSeek-V4.1-Flash · 126 行
import sys from collections import deque def main(): data = sys.stdin.buffer.read().split() H = int(data[0]) W = int(data[1]) S = data[2:2 + H] A = int(data[2 + H]) B = int(data[3 + H]) C = int(data[4 + H]) D = int(data[5 + H]) grid = b''.join(S) N = H * W start = (A - 1) * W + (B - 1) goal = (C - 1) * W + (D - 1) INF = 10 ** 9 dist = [INF] * N visited = bytearray(N) dist[start] = 0 dq = deque([start]) DOT = ord('.') while dq: v = dq.popleft() if visited[v]: continue visited[v] = 1 d = dist[v] if v == goal: break r = v // W c = v - r * W # Move to an adjacent original road, cost 0. if v >= W: u = v - W if not visited[u] and grid[u] == DOT and d < dist[u]: dist[u] = d dq.appendleft(u) if v + W < N: u = v + W if not visited[u] and grid[u] == DOT and d < dist[u]: dist[u] = d dq.appendleft(u) if c > 0: u = v - 1 if not visited[u] and grid[u] == DOT and d < dist[u]: dist[u] = d dq.appendleft(u) if c + 1 < W: u = v + 1 if not visited[u] and grid[u] == DOT and d < dist[u]: dist[u] = d dq.appendleft(u) nd = d + 1 # Front kick: up to two cells in one of four directions, cost 1. if r >= 1: u = v - W if not visited[u] and nd < dist[u]: dist[u] = nd dq.append(u) if r >= 2: u = v - 2 * W if not visited[u] and nd < dist[u]: dist[u] = nd dq.append(u) if r + 1 < H: u = v + W if not visited[u] and nd < dist[u]: dist[u] = nd dq.append(u) if r + 2 < H: u = v + 2 * W if not visited[u] and nd < dist[u]: dist[u] = nd dq.append(u) if c >= 1: u = v - 1 if not visited[u] and nd < dist[u]: dist[u] = nd dq.append(u) if c >= 2: u = v - 2 if not visited[u] and nd < dist[u]: dist[u] = nd dq.append(u) if c + 1 < W: u = v + 1 if not visited[u] and nd < dist[u]: dist[u] = nd dq.append(u) if c + 2 < W: u = v + 2 if not visited[u] and nd < dist[u]: dist[u] = nd dq.append(u) print(dist[goal]) if __name__ == "__main__": main()
DeepSeek-V4-Pro · 110 行
import sys from collections import deque def solve(): input = sys.stdin.readline H, W = map(int, input().split()) road = bytearray(H * W) for i in range(H): s = input().strip() base = i * W for j, ch in enumerate(s): if ch == '.': road[base + j] = 1 A, B, C, D = map(int, input().split()) start = (A - 1) * W + (B - 1) target = (C - 1) * W + (D - 1) INF = 10 ** 9 dist = [INF] * (H * W) dist[start] = 0 dq = deque([start]) popleft = dq.popleft appendleft = dq.appendleft append = dq.append while dq: idx = popleft() d = dist[idx] if idx == target: print(d) return r = idx // W c = idx - r * W # 0-cost moves: move to adjacent initially-road cells if r > 0: nidx = idx - W if road[nidx] and d < dist[nidx]: dist[nidx] = d appendleft(nidx) if r + 1 < H: nidx = idx + W if road[nidx] and d < dist[nidx]: dist[nidx] = d appendleft(nidx) if c > 0: nidx = idx - 1 if road[nidx] and d < dist[nidx]: dist[nidx] = d appendleft(nidx) if c + 1 < W: nidx = idx + 1 if road[nidx] and d < dist[nidx]: dist[nidx] = d appendleft(nidx) nd = d + 1 # 1-cost front kicks: up to 2 cells in each direction if r >= 1: nidx = idx - W if nd < dist[nidx]: dist[nidx] = nd append(nidx) if r >= 2: nidx = idx - 2 * W if nd < dist[nidx]: dist[nidx] = nd append(nidx) if r + 1 < H: nidx = idx + W if nd < dist[nidx]: dist[nidx] = nd append(nidx) if r + 2 < H: nidx = idx + 2 * W if nd < dist[nidx]: dist[nidx] = nd append(nidx) if c >= 1: nidx = idx - 1 if nd < dist[nidx]: dist[nidx] = nd append(nidx) if c >= 2: nidx = idx - 2 if nd < dist[nidx]: dist[nidx] = nd append(nidx) if c + 1 < W: nidx = idx + 1 if nd < dist[nidx]: dist[nidx] = nd append(nidx) if c + 2 < W: nidx = idx + 2 if nd < dist[nidx]: dist[nidx] = nd append(nidx) print(dist[target]) if __name__ == "__main__": solve()