这是 2026-10-23 的上一版评测(LiveCodeBench 最新 35 题)。最新的阶梯评测见 首页。
结果
Kimi K3.1 ProKimi
✓†
通过
- API 返回与题目无关的内容;人工另行调用验证正确,按通过计判题
- 2.8k输出 token(含思考) ↓
- 51 秒延迟 ↓
- —最慢测试的 CPU 时间 ↓
- —峰值内存 ↓
- —Pylint 问题 ↓
- —Pylint 得分 ↑
- —圈复杂度 ↓
- —可维护性指数 ↑
- —有效行
- —SonarQube 问题 ↓
DeepSeek-V4.1-FlashDS-Flash
✓
通过
- 官方测试 44/44判题
- 26.3k输出 token(含思考) ↓
- 164 秒延迟 ↓
- —最慢测试的 CPU 时间 ↓
- —峰值内存 ↓
- 8Pylint 问题 ↓
- 8.55Pylint 得分 ↑
- 23圈复杂度 ↓
- 51.1可维护性指数 ↑
- 55有效行
- 2SonarQube 问题 ↓
DeepSeek-V4-ProDS-Pro
✓
通过
- 官方测试 44/44判题
- 55.0k输出 token(含思考) ↓
- 463 秒延迟 ↓
- —最慢测试的 CPU 时间 ↓
- —峰值内存 ↓
- 11Pylint 问题 ↓
- 8.04Pylint 得分 ↑
- 24圈复杂度 ↓
- 56.5可维护性指数 ↑
- 56有效行
- 3SonarQube 问题 ↓
↑ 越大越好,↓ 越小越好,有效行只描述代码长短。CPU 时间与内存只统计能区分性能的题(最慢答案扣除进程启动后仍 ≥ 0.1 秒),括号内为相对最快者的倍数(≥ 2 时标出)。静态质量按 arXiv:2610.19167 的口径(见 原理)。判题方法见 原理 › 判题。
代码
没有代码:API 返回的内容与题目无关。
DeepSeek-V4.1-Flash · 78 行
import sys from itertools import product def solve(): data = sys.stdin.read().split() if not data: return N = int(data[0]) S = data[1] T = data[2] f = [-1] * 26 for s, t in zip(S, T): a = ord(s) - ord('a') b = ord(t) - ord('a') if f[a] == -1: f[a] = b elif f[a] != b: print(-1) return present = [i for i in range(26) if f[i] != -1] targets = set(f[i] for i in present) # If all 26 letters must remain present, no temporary letter is available. # The only possible transformation is the identity. if len(targets) == 26: possible = all(f[i] == i for i in present) print(0 if possible else -1) return groups_by_target = {d: [] for d in targets} for a in present: groups_by_target[f[a]].append(a) groups = list(groups_by_target.values()) merge_count = len(present) - len(targets) answer = 10**9 for reps in product(*groups): selected = set(reps) non_fixed = sum(1 for a in reps if f[a] != a) visited = set() cycles = 0 for start in reps: if start in visited: continue cur = start path_pos = {} path = [] while cur in selected and cur not in visited: visited.add(cur) path_pos[cur] = len(path) path.append(cur) cur = f[cur] if cur in selected and cur in path_pos: cycle_len = len(path) - path_pos[cur] if cycle_len >= 2: cycles += 1 cost = merge_count + non_fixed + cycles answer = min(answer, cost) print(answer) if __name__ == "__main__": solve()
DeepSeek-V4-Pro · 77 行
import sys def solve(): input = sys.stdin.readline N = int(input().strip()) S = input().strip() T = input().strip() f = [-1] * 26 domain = [False] * 26 target_used = [False] * 26 for sc, tc in zip(S, T): s = ord(sc) - 97 t = ord(tc) - 97 if f[s] == -1: f[s] = t elif f[s] != t: print(-1) return domain[s] = True target_used[t] = True # If S uses all 26 letters and T uses all 26 letters but S != T, # no operation can be performed without reducing the number of distinct letters. if S != T and all(domain) and all(target_used): print(-1) return # Count characters that must be changed at least once. changed = 0 for c in range(26): if domain[c] and f[c] != c: changed += 1 # In-degree from source letters. indeg = [0] * 26 for c in range(26): if domain[c]: indeg[f[c]] += 1 # Find cycles of length >= 2 that have no extra incoming edges from outside the cycle. state = [0] * 26 extra = 0 for v in range(26): if domain[v] and state[v] == 0: path = [] cur = v while domain[cur] and state[cur] == 0: state[cur] = 1 path.append(cur) cur = f[cur] if domain[cur] and state[cur] == 1: idx = path.index(cur) cycle = path[idx:] if len(cycle) >= 2: pure = True for node in cycle: if indeg[node] != 1: pure = False break if pure: extra += 1 for node in path: state[node] = 2 print(changed + extra) if __name__ == "__main__": solve()