这是 2026-10-23 的上一版评测(LiveCodeBench 最新 35 题)。最新的阶梯评测见 首页。
结果
Kimi K3.1 ProKimi
✓
通过
- 官方测试 5/5(校验器)判题
- 20.9k输出 token(含思考) ↓
- 322 秒延迟 ↓
- —最慢测试的 CPU 时间 ↓
- —峰值内存 ↓
- 24Pylint 问题 ↓
- 7.04Pylint 得分 ↑
- 13圈复杂度 ↓
- 61.3可维护性指数 ↑
- 85有效行
- 1SonarQube 问题 ↓
DeepSeek-V4.1-FlashDS-Flash
✓
通过
- 官方测试 5/5(校验器)判题
- 22.4k输出 token(含思考) ↓
- 120 秒延迟 ↓
- —最慢测试的 CPU 时间 ↓
- —峰值内存 ↓
- 10Pylint 问题 ↓
- 8.51Pylint 得分 ↑
- 19圈复杂度 ↓
- 57.8可维护性指数 ↑
- 81有效行
- 1SonarQube 问题 ↓
DeepSeek-V4-ProDS-Pro
✓
通过
- 官方测试 5/5(校验器)判题
- 64.1k输出 token(含思考) ↓
- 453 秒延迟 ↓
- —最慢测试的 CPU 时间 ↓
- —峰值内存 ↓
- 26Pylint 问题 ↓
- 7.26Pylint 得分 ↑
- 37圈复杂度 ↓
- 41.4可维护性指数 ↑
- 101有效行
- 8SonarQube 问题 ↓
↑ 越大越好,↓ 越小越好,有效行只描述代码长短。CPU 时间与内存只统计能区分性能的题(最慢答案扣除进程启动后仍 ≥ 0.1 秒),括号内为相对最快者的倍数(≥ 2 时标出)。静态质量按 arXiv:2610.19167 的口径(见 原理)。判题方法见 原理 › 判题。
代码
Kimi K3.1 Pro · 119 行
import sys def main(): it = iter(map(int, sys.stdin.buffer.read().split())) T = next(it) output = [] for _ in range(T): R = next(it) B = next(it) N = R + B # Every red move changes the parity of r+c, while every blue move # preserves it. Thus R must be even. If there are only blue pieces, # every move also changes the parity of r, so B must be even. if (R & 1) or (R == 0 and (B & 1)): output.append("No") continue colors = [] rows = [] cols = [] nxt = [] def add_node(color, r, c): idx = len(colors) colors.append(color) rows.append(r) cols.append(c) nxt.append(-1) return idx # Replace edge u -> v, where v = u + e, by # u -> u+f -> u+f+e -> v. # This inserts two pieces of the same color as u. Repeating the # operation on the new middle edge grows the construction without # collisions. def extend(u, e, f): v = nxt[u] ar = rows[u] + f[0] ac = cols[u] + f[1] a = add_node(colors[u], ar, ac) b = add_node(colors[u], ar + e[0], ac + e[1]) nxt[u] = a nxt[a] = b nxt[b] = v return a start = -1 if R == 0: # Base cycle for two blue pieces. start = add_node("B", 0, 0) other = add_node("B", 1, 1) nxt[start] = other nxt[other] = start u = start for _ in range((B - 2) // 2): u = extend(u, (1, 1), (1, -1)) else: # Every mixed or all-red construction starts with two red pieces. start = add_node("R", 0, 0) # A second = add_node("R", 1, 0) # C blue_extension = -1 base_blue = 0 if B == 0: nxt[start] = second nxt[second] = start elif B & 1: # R,R,B triangle: (0,0) -> (1,0) -> (1,1) -> (0,0). last_blue = add_node("B", 1, 1) nxt[start] = second nxt[second] = last_blue nxt[last_blue] = start blue_extension = last_blue base_blue = 1 else: # Base cycle with R=B=2. first_blue = add_node("B", 2, 0) last_blue = add_node("B", 1, 1) nxt[start] = second nxt[second] = first_blue nxt[first_blue] = last_blue nxt[last_blue] = start blue_extension = last_blue base_blue = 2 # Add red pieces in pairs, growing downward from A -> C. u = start for _ in range((R - 2) // 2): u = extend(u, (1, 0), (0, -1)) # Add blue pieces in pairs, growing upward/left from the # last blue piece toward A. if base_blue: u = blue_extension for _ in range((B - base_blue) // 2): u = extend(u, (-1, -1), (-1, 1)) # Translate the construction onto the positive board. row_shift = 1 - min(rows) col_shift = 1 - min(cols) output.append("Yes") cur = start for _ in range(N): output.append( f"{colors[cur]} {rows[cur] + row_shift} {cols[cur] + col_shift}" ) cur = nxt[cur] sys.stdout.write("\n".join(output) + "\n") if __name__ == "__main__": main()
DeepSeek-V4.1-Flash · 103 行
import sys def solve() -> None: data = list(map(int, sys.stdin.buffer.read().split())) if not data: return T = data[0] idx = 1 out = [] # Directions sorted by polar angle in the (dr, dc) plane. order = { (0, 1): 0, # right (1, 1): 1, # down-right (1, 0): 2, # down (1, -1): 3, # down-left (0, -1): 4, # left (-1, -1): 5, # up-left (-1, 0): 6, # up (-1, 1): 7, # up-right } OFFSET = 10 ** 8 for _ in range(T): R = data[idx] B = data[idx + 1] idx += 2 # Necessary and sufficient condition: # R must be even, and if R == 0 then B must be even. if R % 2 == 1 or (R == 0 and B % 2 == 1): out.append("No") continue red = [] blue = [] if R > 0: if B % 2 == 1: # Red vectors sum to (-1, -1), cancelling the extra blue (1, 1). red.append((-1, 0)) red.append((0, -1)) rem = R - 2 for _ in range(rem // 2): red.append((1, 0)) red.append((-1, 0)) else: if R == 2: red.append((0, 1)) red.append((0, -1)) else: k = R // 2 for _ in range(k - 1): red.append((0, 1)) red.append((0, -1)) red.append((1, 0)) red.append((-1, 0)) if B > 0: if B % 2 == 1: # One extra blue vector, cancelled by the special red vectors. blue.append((1, 1)) rem = B - 1 for _ in range(rem // 2): blue.append((1, 1)) blue.append((-1, -1)) else: if B == 2: blue.append((1, 1)) blue.append((-1, -1)) else: k = B // 2 blue.append((1, -1)) blue.append((-1, 1)) for _ in range(k - 1): blue.append((1, 1)) blue.append((-1, -1)) vectors = red + blue vectors.sort(key=lambda v: order[v]) cur_r = 0 cur_c = 0 out.append("Yes") for dr, dc in vectors: if dr == 0 or dc == 0: piece = "R" else: piece = "B" out.append(f"{piece} {cur_r + OFFSET} {cur_c + OFFSET}") cur_r += dr cur_c += dc sys.stdout.write("\n".join(out)) if __name__ == "__main__": solve()
DeepSeek-V4-Pro · 120 行
import sys SHIFT = 10**6 def canonical_red_path(L, side): if L == 1: return [(0, 0), (1, 0)] m = (L - 1) // 2 pos = [(0, 0)] pos.append((0, side)) for i in range(1, m + 1): pos.append((i, side)) for i in range(m, 0, -1): pos.append((i, 0)) return pos def map_red(p, v): x, y = p if v == (1, 0): return (x, y) if v == (-1, 0): return (-x, y) if v == (0, 1): return (-y, x) return (y, -x) # (0, -1) def red_expanded_steps(v, L, side): pos = canonical_red_path(L, side) mapped = [map_red(p, v) for p in pos] return [ (mapped[i + 1][0] - mapped[i][0], mapped[i + 1][1] - mapped[i][1]) for i in range(L) ] def map_blue(p, v): r, c = p if v == (1, 1): return (r, c) if v == (1, -1): return (r, -c) if v == (-1, 1): return (-r, c) return (-r, -c) # (-1, -1) def blue_expanded_steps(v, L, side): pos = canonical_red_path(L, side) blue_pos = [(x + y, x - y) for x, y in pos] mapped = [map_blue(p, v) for p in blue_pos] return [ (mapped[i + 1][0] - mapped[i][0], mapped[i + 1][1] - mapped[i][1]) for i in range(L) ] def build_steps(R, B): if R == 0: Lb = B - 1 steps = [(s, 'B') for s in blue_expanded_steps((1, 1), Lb, -1)] steps.append(((-1, -1), 'B')) return steps if B == 0: Lr = R - 1 steps = [(s, 'R') for s in red_expanded_steps((1, 0), Lr, -1)] steps.append(((-1, 0), 'R')) return steps if B % 2 == 1: Lr = R - 1 Lb = B steps = [(s, 'R') for s in red_expanded_steps((1, 0), Lr, -1)] steps.append(((0, 1), 'R')) steps.extend((s, 'B') for s in blue_expanded_steps((-1, -1), Lb, 1)) return steps # B is even and B > 0 Lr = R - 1 Lb = B - 1 steps = [(s, 'R') for s in red_expanded_steps((-1, 0), Lr, -1)] steps.extend((s, 'B') for s in blue_expanded_steps((1, 1), Lb, -1)) steps.append(((-1, 0), 'R')) steps.append(((1, -1), 'B')) return steps def solve(): data = sys.stdin.read().split() if not data: return T = int(data[0]) idx = 1 out = [] for _ in range(T): R = int(data[idx]) B = int(data[idx + 1]) idx += 2 if R % 2 == 1 or (R == 0 and B % 2 == 1): out.append("No") continue steps = build_steps(R, B) N = len(steps) vertices = [(0, 0)] x, y = 0, 0 for (dx, dy), _ in steps[:-1]: x += dx y += dy vertices.append((x, y)) out.append("Yes") for i, ((dx, dy), color) in enumerate(steps): r = vertices[i][0] + SHIFT c = vertices[i][1] + SHIFT out.append(f"{color} {r} {c}") sys.stdout.write("\n".join(out)) if __name__ == "__main__": solve()