这是 2026-10-23 的上一版评测(LiveCodeBench 最新 35 题)。最新的阶梯评测见 首页。
结果
Kimi K3.1 ProKimi
✓
通过
- 函数调用,官方测试全部通过判题
- 14.1k输出 token(含思考) ↓
- 220 秒延迟 ↓
- 0.27 秒(5.0×)最慢测试的 CPU 时间 ↓
- 32 MB峰值内存 ↓
- 6Pylint 问题 ↓
- 5.71Pylint 得分 ↑
- 7圈复杂度 ↓
- 84.0可维护性指数 ↑
- 14有效行
- 1SonarQube 问题 ↓
DeepSeek-V4.1-FlashDS-Flash
✓
通过
- 函数调用,官方测试全部通过判题
- 5.9k输出 token(含思考) ↓
- 33 秒延迟 ↓
- 0.67 秒(12.5×)最慢测试的 CPU 时间 ↓
- 32 MB峰值内存 ↓
- 6Pylint 问题 ↓
- 7.60Pylint 得分 ↑
- 5圈复杂度 ↓
- 52.3可维护性指数 ↑
- 25有效行
- 1SonarQube 问题 ↓
DeepSeek-V4-ProDS-Pro
✓
通过
- 函数调用,官方测试全部通过判题
- 34.9k输出 token(含思考) ↓
- 250 秒延迟 ↓
- 0.05 秒(最快)最慢测试的 CPU 时间 ↓
- 32 MB峰值内存 ↓
- 6Pylint 问题 ↓
- 6.47Pylint 得分 ↑
- 7圈复杂度 ↓
- 76.9可维护性指数 ↑
- 17有效行
- 1SonarQube 问题 ↓
↑ 越大越好,↓ 越小越好,有效行只描述代码长短。CPU 时间与内存只统计能区分性能的题(最慢答案扣除进程启动后仍 ≥ 0.1 秒),括号内为相对最快者的倍数(≥ 2 时标出)。静态质量按 arXiv:2610.19167 的口径(见 原理)。判题方法见 原理 › 判题。
代码
Kimi K3.1 Pro · 22 行
from typing import List class Solution: def minOperations(self, queries: List[List[int]]) -> int: answer = 0 for l, r in queries: total_depth = 0 max_depth = 0 power = 1 # A number x needs one operation for each power 1, 4, 16, ... <= x. while power <= r: max_depth += 1 total_depth += r - max(l, power) + 1 power *= 4 # Each operation handles two unit steps, while the deepest element # can be processed at most once per operation. answer += max(max_depth, (total_depth + 1) // 2) return answer
DeepSeek-V4.1-Flash · 32 行
from typing import List class Solution: def minOperations(self, queries: List[List[int]]) -> int: def prefix(n: int) -> int: total = 0 p = 1 k = 1 while p <= n: end = min(n, p * 4 - 1) total += k * (end - p + 1) p *= 4 k += 1 return total def max_steps(x: int) -> int: steps = 0 while x > 0: x //= 4 steps += 1 return steps answer = 0 for l, r in queries: total_steps = prefix(r) - prefix(l - 1) max_required = max_steps(r) answer += max(max_required, (total_steps + 1) // 2) return answer
DeepSeek-V4-Pro · 26 行
from typing import List class Solution: def minOperations(self, queries: List[List[int]]) -> int: # pref[k] = total base-4 digits of all positive integers # with at most k digits (i.e. numbers 1..4^k - 1) pref = [0] * 64 for k in range(1, 64): pref[k] = pref[k - 1] + k * 3 * (1 << (2 * (k - 1))) def total_digits_upto(n: int) -> int: if n <= 0: return 0 # d = number of base-4 digits of n d = (n.bit_length() + 1) // 2 first_d_digit = 1 << (2 * (d - 1)) return pref[d - 1] + d * (n - first_d_digit + 1) ans = 0 for l, r in queries: total_steps = total_digits_upto(r) - total_digits_upto(l - 1) ans += (total_steps + 1) // 2 return ans