这是 2026-10-23 的上一版评测(LiveCodeBench 最新 35 题)。最新的阶梯评测见 首页。
结果
Kimi K3.1 ProKimi
✗
未通过:答案错误
- 官方测试 39/43判题
- 118.7k输出 token(含思考) ↓
- 1888 秒延迟 ↓
- —最慢测试的 CPU 时间 ↓
- —峰值内存 ↓
- 5Pylint 问题 ↓
- 8.75Pylint 得分 ↑
- 13圈复杂度 ↓
- 57.7可维护性指数 ↑
- 41有效行
- 2SonarQube 问题 ↓
DeepSeek-V4.1-FlashDS-Flash
✓
通过
- 官方测试 43/43判题
- 63.4k输出 token(含思考) ↓
- 327 秒延迟 ↓
- —最慢测试的 CPU 时间 ↓
- —峰值内存 ↓
- 12Pylint 问题 ↓
- 8.29Pylint 得分 ↑
- 23圈复杂度 ↓
- 49.9可维护性指数 ↑
- 79有效行
- 1SonarQube 问题 ↓
DeepSeek-V4-ProDS-Pro
✓
通过
- 官方测试 43/43判题
- 174.0k输出 token(含思考) ↓
- 1378 秒延迟 ↓
- —最慢测试的 CPU 时间 ↓
- —峰值内存 ↓
- 31Pylint 问题 ↓
- 7.37Pylint 得分 ↑
- 18圈复杂度 ↓
- 51.3可维护性指数 ↑
- 127有效行
- 15SonarQube 问题 ↓
↑ 越大越好,↓ 越小越好,有效行只描述代码长短。CPU 时间与内存只统计能区分性能的题(最慢答案扣除进程启动后仍 ≥ 0.1 秒),括号内为相对最快者的倍数(≥ 2 时标出)。静态质量按 arXiv:2610.19167 的口径(见 原理)。判题方法见 原理 › 判题。
代码
Kimi K3.1 Pro · 57 行
import sys def main(): input = sys.stdin.buffer.readline n, m = map(int, input().split()) graph = [[] for _ in range(n)] for _ in range(m): u, v = map(int, input().split()) u -= 1 v -= 1 graph[u].append(v) graph[v].append(u) color = [-1] * n odd_components = 0 odd_product_components = 0 for start in range(n): if color[start] != -1: continue color[start] = 0 stack = [start] side = [0, 0] vertices = 0 while stack: v = stack.pop() vertices += 1 side[color[v]] += 1 for to in graph[v]: if color[to] == -1: color[to] = color[v] ^ 1 stack.append(to) if vertices & 1: odd_components += 1 # The product of the two color-class sizes is odd exactly when # both sizes are odd. if (side[0] & 1) and (side[1] & 1): odd_product_components ^= 1 if n & 1: aoki_wins = (m & 1) == 1 else: value = (m + odd_product_components + odd_components // 2) & 1 aoki_wins = value == 1 print("Aoki" if aoki_wins else "Takahashi") if __name__ == "__main__": main()
DeepSeek-V4.1-Flash · 92 行
import sys def solve(): data = list(map(int, sys.stdin.buffer.read().split())) if not data: return it = iter(data) N = next(it) M = next(it) adj = [[] for _ in range(N)] for _ in range(M): u = next(it) - 1 v = next(it) - 1 adj[u].append(v) adj[v].append(u) visited = [False] * N color = [-1] * N k = 0 # number of isolated vertices B = 0 # number of non-isolated components with both sides odd D = 0 # number of non-isolated components with exactly one side odd for start in range(N): if visited[start]: continue stack = [start] visited[start] = True color[start] = 0 cnt0 = 0 cnt1 = 0 size = 0 while stack: u = stack.pop() size += 1 if color[u] == 0: cnt0 += 1 else: cnt1 += 1 for v in adj[u]: if not visited[v]: visited[v] = True color[v] = color[u] ^ 1 stack.append(v) if size == 1: k += 1 else: a, b = cnt0, cnt1 if (a & 1) and (b & 1): B += 1 elif (a & 1) == 0 and (b & 1) == 0: # both even, irrelevant for g pass else: D += 1 bpar = B & 1 if D >= 3: g = bpar elif D == 2: if k % 2 == 0: g = 2 + bpar else: g = bpar elif D == 1: if k % 2 == 1: g = 2 + bpar else: g = bpar else: # D == 0 if k % 2 == 1: g = bpar else: if k % 4 == 2: g = 1 else: g = 0 p = (B + M) & 1 sg = g ^ p if sg != 0: print("Aoki") else: print("Takahashi") if __name__ == "__main__": solve()
DeepSeek-V4-Pro · 165 行
import sys def main(): data = list(map(int, sys.stdin.buffer.read().split())) if not data: return N, M = data[0], data[1] adj = [[] for _ in range(N)] it = iter(data[2:]) for _ in range(M): u = next(it) - 1 v = next(it) - 1 adj[u].append(v) adj[v].append(u) # For odd N, total number of moves always has the parity of M. if N % 2 == 1: print("Aoki" if M % 2 == 1 else "Takahashi") return visited = [False] * N color = [0] * N cnt_I = 0 # isolated vertices (component size 1) cnt_V = 0 # non-isolated odd components cnt_E0 = 0 # even components with both parts even cnt_E1 = 0 # even components with both parts odd total_K = 0 # sum of missing internal edges modulo 2 for s in range(N): if visited[s]: continue visited[s] = True color[s] = 0 q = [s] comp = [] while q: u = q.pop() comp.append(u) cu = color[u] for w in adj[u]: if not visited[w]: visited[w] = True color[w] = cu ^ 1 q.append(w) x = 0 for u in comp: if color[u] == 0: x += 1 y = len(comp) - x m = sum(len(adj[u]) for u in comp) // 2 # missing internal edges in this component modulo 2 k_par = ((x & 1) & (y & 1)) ^ (m & 1) total_K ^= k_par size = x + y if size == 1: cnt_I += 1 elif size % 2 == 0: if x % 2 == 0: cnt_E0 += 1 else: cnt_E1 += 1 else: cnt_V += 1 # Grundy number of the complete-components game. # Types: # 0: isolated (I) # 1: non-isolated odd (V) # 2: even, both parts even (E0) # 3: even, both parts odd (E1) types = [ (1, 0, 1), # I: p=1, q=0, empty=1 (0, 1, 0), # V: p=0, q=1 (0, 0, 0), # E0 (1, 1, 0), # E1 ] memo = {} def grundy(i, v, a, b): # Reduce according to the periodic structure. # I and V have period 4, E0/E1 have period 2. if i > 7: i = 4 + (i % 4) if v > 7: v = 4 + (v % 4) if a > 4: a = 2 + (a % 2) if b > 4: b = 2 + (b % 2) key = (i, v, a, b) if key in memo: return memo[key] if i + v + a + b <= 1: memo[key] = 0 return 0 counts = [i, v, a, b] options = set() for A in range(4): if counts[A] == 0: continue for B in range(A, 4): if counts[B] == 0: continue if A == B and counts[A] < 2: continue pA, qA, eA = types[A] pB, qB, eB = types[B] # align is unavailable only for I-I avail = [] if not (A == 0 and B == 0): avail.append('align') avail.append('swap') for orient in avail: if orient == 'align': p = pA ^ pB q = qA ^ qB c_par = (pA & qB) ^ (qA & pB) else: p = pA ^ qB q = qA ^ pB c_par = (pA & pB) ^ (qA & qB) k_par = c_par ^ 1 # k = c - 1 if p != q: new_type = 1 elif p == 0: new_type = 2 else: new_type = 3 new = counts.copy() new[A] -= 1 new[B] -= 1 new[new_type] += 1 val = grundy(new[0], new[1], new[2], new[3]) ^ k_par options.add(val) g = 0 while g in options: g += 1 memo[key] = g return g g = grundy(cnt_I, cnt_V, cnt_E0, cnt_E1) sg = g ^ total_K print("Aoki" if sg != 0 else "Takahashi") if __name__ == "__main__": main()