这是 2026-10-23 的上一版评测(LiveCodeBench 最新 35 题)。最新的阶梯评测见 首页。
结果
Kimi K3.1 ProKimi
✓
通过
- 官方测试 43/43判题
- 54.6k输出 token(含思考) ↓
- 924 秒延迟 ↓
- 0.15 秒(最快)最慢测试的 CPU 时间 ↓
- 14 MB峰值内存 ↓
- 8Pylint 问题 ↓
- 9.02Pylint 得分 ↑
- 25圈复杂度 ↓
- 56.2可维护性指数 ↑
- 85有效行
- 1SonarQube 问题 ↓
DeepSeek-V4.1-FlashDS-Flash
✓
通过
- 官方测试 43/43判题
- 16.7k输出 token(含思考) ↓
- 96 秒延迟 ↓
- 1.30 秒(8.5×)最慢测试的 CPU 时间 ↓
- 91 MB峰值内存 ↓
- 15Pylint 问题 ↓
- 7.06Pylint 得分 ↑
- 17圈复杂度 ↓
- 41.8可维护性指数 ↑
- 53有效行
- 5SonarQube 问题 ↓
DeepSeek-V4-ProDS-Pro
✓
通过
- 官方测试 43/43判题
- 55.7k输出 token(含思考) ↓
- 454 秒延迟 ↓
- 0.96 秒(6.3×)最慢测试的 CPU 时间 ↓
- 119 MB峰值内存 ↓
- 25Pylint 问题 ↓
- 6.99Pylint 得分 ↑
- 24圈复杂度 ↓
- 51.0可维护性指数 ↑
- 83有效行
- 5SonarQube 问题 ↓
↑ 越大越好,↓ 越小越好,有效行只描述代码长短。CPU 时间与内存只统计能区分性能的题(最慢答案扣除进程启动后仍 ≥ 0.1 秒),括号内为相对最快者的倍数(≥ 2 时标出)。静态质量按 arXiv:2610.19167 的口径(见 原理)。判题方法见 原理 › 判题。
代码
Kimi K3.1 Pro · 124 行
import sys from bisect import bisect_left def solve(): it = iter(map(int, sys.stdin.buffer.read().split())) n = next(it) A = [next(it) for _ in range(n)] B = [next(it) for _ in range(n)] count_a = {} count_b = {} wild_a = 0 wild_b = 0 for x in A: if x == -1: wild_a += 1 else: count_a[x] = count_a.get(x, 0) + 1 for x in B: if x == -1: wild_b += 1 else: count_b[x] = count_b.get(x, 0) + 1 wild = wild_a + wild_b # All fixed elements can be paired with wildcards. if wild >= n: sys.stdout.write("Yes\n") return # In any feasible pairing, at least `need` pairs must consist of two # fixed values. All pairs in such a pairing must have the same sum. need = n - wild # The largest fixed A value and largest fixed B value always provide # one usable fixed-fixed pair. if need == 1: sys.stdout.write("Yes\n") return a_items = sorted(count_a.items()) b_items = sorted(count_b.items()) a_vals = [x for x, _ in a_items] b_vals = [x for x, _ in b_items] b_cnts = [c for _, c in b_items] u = len(a_items) v = len(b_items) # Every fixed value must not exceed the final common sum. min_sum = max(a_vals[-1], b_vals[-1]) # Select more than q fixed A items (or more than p fixed B items). # At least one selected item must belong to a fixed-fixed pair in any # feasible configuration, so its pair sum is a sufficient candidate set. def make_core(items, amount): core = [] covered = 0 for value, cnt in sorted(items, key=lambda z: z[1], reverse=True): core.append(value) covered += cnt if covered >= amount: break return core core_a = make_core(a_items, wild_b + 1) core_b = make_core(b_items, wild_a + 1) candidates_a_size = 0 for a in core_a: candidates_a_size += v - bisect_left(b_vals, min_sum - a) candidates_b_size = 0 for b in core_b: candidates_b_size += u - bisect_left(a_vals, min_sum - b) candidates = {} if candidates_a_size <= candidates_b_size: for a in core_a: start = bisect_left(b_vals, min_sum - a) for j in range(start, v): candidates[a + b_vals[j]] = 0 else: for b in core_b: start = bisect_left(a_vals, min_sum - b) for i in range(start, u): candidates[a_vals[i] + b] = 0 if not candidates: sys.stdout.write("No\n") return # For a fixed sum s, different A values use different B values. # Therefore the maximum number of fixed-fixed pairs is # sum_a min(count_a[a], count_b[s-a]). # Accumulate this quantity only for the sufficient candidate sums. get_candidate = candidates.get for a, acnt in a_items: start = bisect_left(b_vals, min_sum - a) for j in range(start, v): s = a + b_vals[j] current = get_candidate(s) if current is None: continue bcnt = b_cnts[j] current += acnt if acnt < bcnt else bcnt if current >= need: sys.stdout.write("Yes\n") return candidates[s] = current sys.stdout.write("No\n") if __name__ == "__main__": solve()
DeepSeek-V4.1-Flash · 72 行
import sys from collections import Counter def solve(): data = list(map(int, sys.stdin.buffer.read().split())) if not data: return N = data[0] A = data[1:1 + N] B = data[1 + N:1 + 2 * N] knownA = [x for x in A if x != -1] knownB = [x for x in B if x != -1] a = len(knownA) b = len(knownB) if a + b <= N: print("Yes") return L = a + b - N if L == 1: print("Yes") return M = max(max(knownA), max(knownB)) countA = Counter(knownA) countB = Counter(knownB) sums = [] for u, cu in countA.items(): for v, cv in countB.items(): s = u + v if s < M: continue w = cu if cu < cv else cv if w == 1: sums.append(s) else: sums.extend([s] * w) if not sums: print("No") return sums.sort() it = iter(sums) prev = next(it) run = 1 for s in it: if s == prev: run += 1 if run >= L: print("Yes") return else: prev = s run = 1 print("No") if __name__ == "__main__": solve()
DeepSeek-V4-Pro · 107 行
import sys from collections import Counter from bisect import bisect_left def solve(): data = list(map(int, sys.stdin.buffer.read().split())) if not data: return N = data[0] A = data[1:1 + N] B = data[1 + N:1 + 2 * N] FA = [x for x in A if x != -1] FB = [x for x in B if x != -1] M = len(FA) P = len(FB) UB = N - P # number of unknown B K = M - UB # minimum number of fixed A that must be paired with fixed B if K <= 0: print("Yes") return # K = 1 is always possible: pair max(A) with max(B). if K == 1: print("Yes") return maxA = max(FA) maxB = max(FB) L = max(maxA, maxB) freqA = Counter(FA) freqB = Counter(FB) # Quick check with S = maxA + maxB S0 = maxA + maxB total0 = 0 for a, fa in freqA.items(): fb = freqB.get(S0 - a, 0) if fb: total0 += fa if fa < fb else fb if total0 >= K: print("Yes") return a_items = list(freqA.items()) b_items = list(freqB.items()) b_items.sort() # sort by B value b_vals = [b for b, _ in b_items] b_freqs = [fb for _, fb in b_items] nb = len(b_vals) SHIFT = 11 # max frequency is 2000 < 2048 b_shifts = [b << SHIFT for b in b_vals] starts = [] V = 0 for a, _ in a_items: start = bisect_left(b_vals, L - a) starts.append(start) V += nb - start if V == 0: print("No") return # Pack sum and contribution into one integer: (sum << SHIFT) | c pairs = [0] * V idx = 0 for (a, fa), start in zip(a_items, starts): a_shift = a << SHIFT for j in range(start, nb): fb = b_freqs[j] c = fa if fa < fb else fb pairs[idx] = a_shift + b_shifts[j] + c idx += 1 pairs.sort() MASK = (1 << SHIFT) - 1 n = len(pairs) i = 0 while i < n: val = pairs[i] key = val >> SHIFT total = val & MASK i += 1 while i < n: val = pairs[i] if (val >> SHIFT) != key: break total += val & MASK i += 1 if total >= K: print("Yes") return print("No") if __name__ == "__main__": solve()