What · 是什么
AI 竞赛编程(AI for Competitive Programming)趋势指 2024-2026 年大模型在算法竞赛(尤其 Codeforces)上能力的爆发式提升:从早期只能做 Div2 A/B,到 2025 年逐步接近并超越人类强手。2026 年 3 月,GrandCode(多智能体强化学习系统)在 Codeforces Round 1087-1089 三次 live round 全部获得第一名,首次在线上正式比赛中全面胜过人类传奇大师(legendary grandmaster);同期 Solvita 提出 agentic evolution 框架,用 Planner/Solver/Oracle/Hacker 四智能体 + 图结构知识网络在无权重更新的情况下持续学习。核心技术趋势:test-time reinforcement learning(测试时 RL)、agentic loop(多智能体编排)、Agentic GRPO、可认证监督(certified supervision)、对抗式 hacking 自举。
Why · 为什么
早期 LLM 写竞赛题像『背诵模板』,遇到全新构造/交互题就崩。突破来自把『解题』从单次生成改为多智能体循环:先假设、再实现、再用测试样例/评审器自我检验、失败的反馈回灌策略。本质是把『人解题的验证-试错闭环』搬进模型,并用 RL 把成功经验固化为网络/知识库。
GrandCode 两大支柱:(1) 多智能体模块编排——hypothesis proposal(假设生成)、solver(求解器)、test generator(测试生成)、summarization(总结)等模块经后训练与在线 test-time RL 联合优化;(2) Agentic GRPO——专为多阶段 rollout、延迟奖励与严重 off-policy drift 设计的 RL 目标。Solvita 则强调『无状态→有状态』:每轮任务的经验(通过/失败/被 hack 的漏洞)被编码进可训练的图结构知识网络,Planner/Solver/Oracle/Hacker 各自带网络,后续任务按历史成败动态路由。评测:CodeContests、APPS、AetherCode、live CF。
2024-2025:AlphaCode 2、Codeforces 上 GPT-o1 系列达到 Div2 高手水平;2025-2026:Gemini 3 Deep Think 以非正式条件获 CF 第 8,随后 GrandCode 在 2026-03 的 Round 1087/1088/1089 正式 live 全胜人类(arXiv 2604.02721)。Solvita(arXiv 2605.15301)将多智能体与持续学习结合,确立代码生成智能体 SOTA,单次 pass 基线近乎翻倍。
How · 实现
伪代码
# 无固定伪代码——本文为趋势综述节点。多智能体 loop 抽象示意:
while not solved:
hypothesis = planner(problem)
code = solver(hypothesis)
verdict = oracle(code, test_cases)
if verdict == AC: break
update(hypothesis, code, verdict) # test-time RL 回灌Python 实现
def evaluate_agent_on_problem(agent, problem, timeout=10):
"""模拟 agentic loop 的简单评测框架:假设->实现->自测->反馈。
示意教学代码,非正式基准。
"""
hypotheses = agent.propose(problem.statement) # 假设/建模
code = agent.solve(hypotheses) # 生成代码
feedback = ""
for sample in problem.samples: # 样例自测
out = run(code, sample.inp, timeout)
if out != sample.out:
feedback += f"sample failed: {sample}"
break
if not feedback and agent.run_unit_tests(code, problem): # 自生成测试
feedback = agent.hack(code) # 对抗式检验
return {"code": code, "feedback": feedback, "accepted": not feedback}
if __name__ == "__main__":
print("ai-cp-trend: 多智能体 test-time RL 闭环示意(假设->实现->自测->反馈)")
print("关键技术词: test-time RL / Agentic GRPO / agentic loop / certified supervision")
| 时间复杂度 | 单题耗时取决于 token 预算与迭代轮数(秒~分钟级) |
|---|---|
| 空间复杂度 | 依赖部署模型规模(数十~数千亿参数) |
易错点
- 不要把『正式评测』与『非正式样例级测试』混为一谈(Gemini3 Deep Think 第8名未按 live 条件)
- AI 通过率数据差异大,需区分官方 arXiv 声明与社区转引
- 不能直接用这些系统参加 ICPC/NOI 类比赛(规则禁止外部工具/联网)
- 趋势节点内容更新快,引用须标注 arXiv 编号与时间
例题
| OJ | 题号 | 难度 | 考点 | 链接 |
|---|---|---|---|---|
| Codeforces | Round 1087-1089 | 8 | GrandCode 三次 live round 全胜人类(含传奇大师),AI 首次正式超越 | https://codeforces.com/contest/1087 |