2026 USACO 重大改革落地!三大变化+难度升级 家长和学生必须提前知道!

USACO(美国计算机奥林匹克竞赛)作为全球最具含金量的中学生编程赛事,不仅是申请 MIT、斯坦福、CMU 等顶尖理工院校的“硬通货”,更是检验算法思维与工程能力的黄金标尺。

而 2026 赛季,USACO 迎来历史性变革——
赛制调整
AI 全面禁用
难度结构性升级

这些变化将直接影响能否晋级、如何备赛、甚至是否值得投入。本文为你逐条拆解关键信息,并提供针对性备考策略。

一、2026 USACO 赛程安排(中国学生重点关注)

比赛 时间(美国时间) 对应北京时间
第一场月赛 2026年1月9日–12日 1月10日–13日
第二场月赛 2026年1月30日–2月2日 1月31日–2月3日
第三场月赛 2026年2月20日–23日 2月21日–24日
US Open(美国公开赛) 2026年3月28日(仅限受邀美国选手线下参加) ❌ 中国学生无法参与

重要提醒:
自2026年起,US Open 改为线下邀请制,仅面向美国本土顶尖选手。
中国学生的全部机会集中在前三场月赛——务必抓住!

二、2026 USACO三大核心改革:影响深远

改革一:黄金 & 铂金组新增【认证成绩】机制

要求:若想成绩被官方认定为“认证成绩”(用于大学申请),
必须在 美国东部时间周六中午 12:00–12:15 点击“Start Contest”。

对中国学生的影响:

对应 北京时间周日凌晨 01:00–01:15(冬令时);

需熬夜参赛,且错过窗口则成绩不被认证(仅显示分数,无官方效力)。

行动建议:

目标黄金/铂金的学生,务必调整生物钟,确保能在凌晨1点准时开赛。

改革二:全面禁止生成式AI工具

2026年起,严禁使用任何AI辅助编程工具,包括:

代码生成类:ChatGPT、Claude、Gemini、通义千问

代码补全类:GitHub Copilot、Tabnine、通义灵码

后果严重:一旦检测到AI痕迹,成绩作废 + 可能禁赛。
正确做法:所有代码必须独立手写,训练真实编码能力。

改革三:US Open 转为线下邀请制

往年:全球线上开放

2026年起:仅限美国本土高分选手线下监考参赛

对中国学生意味着:

前三场月赛 = 唯一舞台;

必须在月赛中冲击黄金/铂金高分认证,才能体现竞争力。

三、2026 难度升级:从“套模板”到“真能力”的跨越

USACO 已彻底告别“刷题就能晋级”的时代。2026 赛季呈现三大难度特征:

1. 低级别门槛大幅提升

铜组:不再只是“输入输出+循环”,已出现位运算、简单DP等原属金组的考点;

银组:弱化模板套用,强调自主建模,图论、贪心构造题需自行推导关键逻辑,通过率明显下降。

2. 高级别聚焦性能优化与综合应用

金组:

数据规模增大,O(n²) 必超时;

要求掌握 O(n log n) 及更优算法,并进行常数优化(如减少函数调用、优化内存访问)。

铂金组:

直接对标 IOI(国际信息学奥赛);

出现交互式编程、概率算法、多算法融合等高阶内容。

3. 注重考察实战技能

无一道“原题”或“标准模板题”;

即使是铜组模拟题,也需优化枚举策略;

银组区间问题需灵活运用双指针、前缀和、单调栈等组合技巧。

USACO竞赛9.9元体验课+集训班

铜级→银级→金级,金牌导师亲授!

扫码了解详细课程安排

USACO 竞赛核心特点是什么?2026赛季USACO 三场月赛参赛数据整理与分析!

USACO(USA Computing Olympiad)由美国计算机竞赛委员会官方组织,旨在选拔美国国家队参加国际信息学奥林匹克(IOI)。作为全球最具权威性和影响力的编程竞赛之一,USACO不仅为参赛者提供了展示编程能力的平台,还为他们打开了通往顶尖大学的大门。

一、USACO 的核心特点

1️⃣ 国家级背景,选拔美国国家队

全称:USA Computing Olympiad;

使命:选拔美国IOI(国际信息学奥林匹克)国家队;

权威性:命题质量高、评分严谨、全球认可度极高,远超民间机构举办的同类比赛。

2️⃣ 完全免费,全球开放

注册账号完全免费,无国籍、学校、年龄限制;

低门槛:只要有电脑和网络,任何人都能参与;

公平竞争:非一线城市、非国际学校的学生也有机会证明自己。

3️⃣ 四级递进,路径清晰

USACO分为四个级别:

青铜(Bronze)

白银(Silver)

黄金(Gold)

铂金(Platinum)

晋级机制:

新选手从青铜级开始;

每场比赛满分(1000分)可当场晋级下一等级;

若未满1000分,则等赛后官方划线,达到分数线也能晋级;

容错率极高:一个赛季有4次机会(3场月赛+1场公开赛),直到打出理想成绩为止。

二、USACO 赛事数据分析

1️⃣ 参赛人数 + 难度变化

参赛人数走势:

第一场:14,273人报名,历史级人数;

第二场:9,854人,大量退赛;

第三场:约8,300人,继续下降。

数据解读:

很多人第一场冲动报名,第二场被现实教育后退出;

第三场只剩真正想打算法的人;

整体参赛提交情况:

第一场:总注册14,273,有效提交11,896;

第二场:总注册9,854,有效提交7,031;

第三场:总注册约8,000+,有效提交约6,000。

2️⃣ 各组别参赛人数对比

组别 第一场 第二场 第三场
Bronze 10,377 5,137 3,014
Silver 3,876 2,721 2,446
Gold 1,917 1,366 1,245
Platinum 191 180 300

数据解读:

Bronze 组掉人最多:很多人意识到USACO不是“编程竞赛”,而是“算法竞赛”;

Platinum 组反常增长:第三场Gold难度过高,部分高分选手被分流,老选手回归刷成绩。

三、USACO 备考策略与课程推荐

1️⃣ 全年开班,多种课程选择

铜升银

银升金

银升铂金

USACO直通车课程

课程亮点:

中英双语/全英上课;

师资背景强劲,均来自计算机强校;

系统化培训,帮助学生稳步提升。

2️⃣ 高效备考建议

① 查漏补缺 + 知识闭环

快速过一遍基础算法,不抠细枝末节;

重点攻克高频丢分板块:

动态规划

图论

贪心算法

数据结构优化

② 真题刷题 + 限时训练

刷近5年真题,只做考场难度;

严格按4小时模拟,目标:

正确率稳定在75%+冲金

85%+冲超金

每天:1套真题+错题精析

③ 模考冲刺 + 考场策略

每周2套全真模考,整理错题本/陷阱本;

背高频英文专业词,掌握常见算法套路;

调整心态,模拟高压环境下的应试技巧。

USACO竞赛9.9元体验课+集训班

铜级→银级→金级,金牌导师亲授!

扫码了解详细课程安排

USACO 到底考什么?2027 赛季 USACO 分级备战指南来了!

USACO早已不是单纯考察“会不会写快排”或“背不背模板”的传统编程赛。2025–2026 赛季起,USACO 正式完成从“算法知识测试”向“综合计算思维能力评估”的转型。

本文将系统解析 USACO 的四大核心能力、近年规则重大变革、各组别考查重点及 2027 赛季精准备考路径,助你用真实实力,在公平而严苛的新赛制中稳步晋级。

一、USACO 到底考什么?四大核心能力

USACO 不再只看“答案对不对”,而是评估你如何思考、如何实现、如何应对失败:

能力维度 考察内容 典型表现
1. 结构化思维 能否将模糊现实问题 → 清晰可计算模型 能快速识别“这是图论问题”“需离散化处理”
2. 算法选择能力 在时间压力下匹配最优解法 面对10⁶数据量,果断放弃暴力,选用线段树或前缀和
3. 代码稳定性 写出鲁棒、无边界错误、内存安全的程序 处理空输入、极端值、重复操作仍能通过所有测试点
4. 调试能力 快速定位逻辑/边界/性能错误 10分钟内发现“数组越界”或“递归爆栈”

二、2025–2026 赛季 vs 往年:六大规则变革

项目 2024 及以前 2025–2026 新规 影响
比赛结构 4场线上月赛 3场月赛 + 1场监考制 US Open Open 含金量提升,成选拔关键
成绩认证 Gold/Platinum 需在开赛15分钟内启动才算“认证成绩” 防止代打,确保成绩真实有效
晋级规则 单场可连升多级(如 Bronze→Silver→Gold) 每场最多晋级一级 降低偶然性,强调稳定发挥
训练营选拔 综合全年成绩 需 2–3 场认证成绩 + US Open 表现 高阶选手必须多次证明自己
AI 工具 无明确限制 严禁 ChatGPT、GitHub Copilot 等生成式 AI 违规=永久封号+通报学校
VPN/IP 规则 无要求 美国选手须用注册地 IP,禁用代理 提升公平性,防止跨区作弊

三、2027 赛季 USACO 分级备战指南

铜组(Bronze)——入门筑基

目标:稳过 700 分,顺利晋级 Silver

核心任务:

掌握 C++ 或 Python 基础语法(推荐 C++,效率更高);

熟练使用 循环、条件、数组、字符串、简单模拟;

学会 优化暴力解法(如减少嵌套循环、提前终止);

刷透 USACO 官方 Guide 铜组题库(约 30–50 题);

模拟 4 小时完整比赛流程,避免因不熟悉提交系统丢分。

避坑:不要死磕难题,确保前两题 100% 正确。

银组(Silver)——算法启蒙

目标:摆脱暴力,掌握基础算法灵活应用

核心任务:

系统学习四大支柱:

贪心策略(活动选择、区间调度)

搜索(DFS/BFS,状态表示)

二分查找(答案/位置二分)

前缀和 / 差分(高效区间操作)

强化 图论建模能力:最短路(Floyd/Dijkstra)、拓扑排序;

学会 从样例反推规律,培养构造思维;

每周完成 2–3 道 Silver 真题,限时 2 小时。

关键突破:理解“为什么用这个算法”,而非“怎么抄模板”。

金组(Gold)——高阶融合

目标:掌握高级算法,应对大规模数据

核心任务:

重点攻克:

动态规划:区间 DP、树形 DP、状态压缩

图论进阶:最小生成树(Kruskal/Prim)、强连通分量

数据结构:树状数组、线段树(支持区间更新)

常数优化训练:避免 vector 频繁 resize、IO 优化(scanf/printf);

严格按认证规则模拟:开赛 15 分钟内启动,4 小时内提交;

刷近 5 年 Gold 真题,总结“套路题”与“创新题”差异。

晋级关键:第三题部分分也要拿,Gold 常靠“2.5题”晋级。

铂金组(Platinum)——顶尖挑战

目标:具备 IOI 级别建模与创新能力

核心任务:

深入学习:

网络流(最大流、费用流)

数位 DP / 博弈 DP

计算几何(凸包、旋转卡壳)

字符串(KMP、Trie、哈希)

刷 IOI、CEOI、USACO Platinum 历年真题;

参与 Codeforces Div.1 / AtCoder Grand Contest 保持手感;

注重 算法组合创新(如“线段树维护 DP 状态”);

强化 代码规范与可读性,便于快速调试。

铂金真相:题目无标准解法,考的是“现场发明算法”的能力。

USACO竞赛9.9元体验课+集训班

铜级→银级→金级,金牌导师亲授!

扫码了解详细课程安排

USACO 竞赛晋级体系一文说清!为什么顶尖大学如此认可 USACO?

在美本申请日益“内卷”的今天,一个高含金量、可量化、当场出分的学术竞赛,已成为冲刺 MIT、斯坦福、CMU 等顶尖理工院校的“关键筹码”。
而 USACO(美国计算机奥林匹克竞赛),正是这样一项——
✅ 零门槛报名
✅ 当场出成绩、一周内放榜
✅ 级别明确、含金量分层清晰
✅ RD 申请前最后的“闪光点”机会

本文将为你系统拆解:USACO 考什么?怎么晋级?不同级别对申请意味着什么?以及如何科学规划冲奖路径?

一、USACO 基础信息:零门槛,高回报

项目 说明
参赛资格 不限国籍、不限年级、无报名费
报名方式 官网注册即自动进入 青铜级(Bronze)
编程语言 C++、C、Java、Python、Pascal(强烈推荐 C++)
出分速度 当场出成绩,官方榜单通常 1周内公布
适合人群

对计算机、数学、工程方向感兴趣的学生

临近申请季但缺乏强背提活动者(RD 截止前仍可冲刺!)

关键优势:

相比需数月等待结果的竞赛,USACO 是 “最后一刻也能逆袭” 的少数选择。

二、四级晋级体系:层层递进,含金量逐级跃升

USACO 采用阶梯式晋级制,每通过一级,学术价值显著提升:

青铜级(Bronze)—— 入门起点

考察内容:基础语法、模拟、枚举、简单逻辑

能力要求:能读懂题意,写出正确逻辑即可

申请价值:体现兴趣入门,不足以作为核心亮点

白银级(Silver)—— 能力分水岭

核心考点:

贪心策略

二分查找

DFS / BFS 搜索

时间复杂度初步分析

能力跃迁:从“会写代码”到“会设计算法”

申请价值:

Top 30–50 院校:有力加分项

藤校 / Top 10:仅为基础门槛,需继续冲击黄金

黄金级(Gold)—— 名校“硬通货”

核心考点:

动态规划(DP)

最短路(Dijkstra)

并查集、线段树等高级数据结构

对标水平:≈ 国内 NOIP 省一等奖

申请价值:

可作为 Common App “Honors” 栏目重点填写

MIT、Stanford、CMU、UCB、UIUC 等校高度认可

证明具备顶尖计算机专业的学习潜力

铂金级(Platinum)—— 顶峰王者

核心考点:

网络流、计算几何

复杂 DP 优化(斜率优化、状态压缩)

交互式/概率算法

对标水平:≈ IOI 国家队选拔级别

申请价值:

全球每年仅数百人达到

在藤校申请中近乎“决定性优势”

中国学生凤毛麟角,极具稀缺性

三、为什么顶尖大学如此认可 USACO?

招生官看重的,从来不是“你会不会编程”,而是:

1. 真实问题建模能力

USACO 题目常以生活场景为背景:

“奶牛如何排队拍照最省时间?”

“如何调度灌溉系统覆盖所有农田?”
→ 学生需将现实抽象为数学模型,这正是 AI、数据科学的核心思维。

2. 算法思维 vs 死记硬背

题目无模板可套,必须理解原理并灵活组合。
例如:一道题可能融合 贪心 + 二分 + 图论,考验综合应用能力。

3. 可量化的学术成长轨迹

从 Bronze → Platinum 的晋级路径清晰可见,
招生官能直观看到学生的持续投入与能力跃迁。

四、科学备赛规划建议

目标导向型路径

申请目标 建议目标级别 备赛周期
Top 10 / 藤校 Gold 起步,冲刺 Platinum 12–18 个月
Top 30(如 NYU、BU) Silver → Gold 6–12 个月
Top 50(如 UIUC、Purdue) Silver 稳定通过 3–6 个月

语言选择建议

首选 C++:执行效率高、STL 库强大,NOIP 也仅支持 C++,实现“一学两用”;

慎用 Python:虽易上手,但在 Gold+ 级别极易因超时失分。

时间节点提醒

2026 赛季月赛:1月、1月底、2月中(共3场)

RD 申请截止:通常 11 月–1 月
→ 12 月参加月赛,1 月拿 Gold,仍可赶 RD!

USACO竞赛9.9元体验课+集训班

铜级→银级→金级,金牌导师亲授!

扫码了解详细课程安排

2026 年 USACO竞赛 第三场比赛铜奖组问题三—Swap to Win

Farmer John has a favorite string t with M characters. He also has N strings s1,s2,…,sN each with M characters (1≤N,M≤1000).

FJ can perform the following two types of operations:

FJ chooses any string sx
and two indices p
and q
. Then, he swaps the p
'th and q
'th character of sx
(1≤x≤N,1≤p,q≤M
).
FJ chooses two strings sx
and sy
and an index k
. Then, he swaps the k
'th characters of sx
and sy
(1≤x,y≤N,1≤k≤M
).
His goal is to make s1
equal to t
. Find any series of operations that fulfills his goal. Because FJ is in a hurry, he only has time to perform a total of 2M
operations. The inputs guarantee that it is possible to fulfill FJ's goal.

INPUT FORMAT (input arrives from the terminal / stdin):
The first line contains T
(1≤T≤10
), the number of independent tests. Each test is specified in the following format:
The first line contains N
and M
.

The second line contains t
.

Then, N
lines follow, the i
'th of which contains si
.

The inputs will guarantee that it is possible to fulfill FJ's goal. All strings contain lowercase English letters (a-z).

OUTPUT FORMAT (print output to the terminal / stdout):
The output for each test should be as follows:
On the first line, output an integer K
, the number of operations you will perform. K
must be a non-negative integer less than or equal to 2M
.

Then, output K
lines, denoting the operations you will perform in sequential order. Each line should be one of the following:

1 x p q
2 x y k
SAMPLE INPUT:
3
3 6
banana
nabana
banana
nnbaaa
5 3
abc
def
bca
ghi
jkl
mno
3 5
abcde
abcde
abcde
zzzzz
SAMPLE OUTPUT:
3
2 1 2 1
1 1 3 5
2 1 2 5
5
1 2 1 3
2 1 2 1
1 2 2 3
2 1 2 2
2 1 2 3
0
Here is how s
changes according to the first test's output (with letters swapped in uppercase):

nabana Babana baNaBa banaNa
banana -> Nanana -> nanana -> nanaBa
nnbaaa nnbaaa nnbaaa nnbaaa
After all three operations, s1=t
.

SCORING:
Inputs 2-6: N,M≤100
Inputs 7-12: No additional constraints.
Problem credits: Chongtian Ma

2026 年 USACO竞赛 第三场比赛铜奖组问题二—Strange Function

For all positive integers x, the function f(x) is defined as follows:

If x has any digits that aren't 0 or 1, for each digit of x, set it to 1, if it is odd or 0
otherwise, and return x.

Otherwise, return x−1.

Given a value of x (1≤x<), find how many times f needs to be applied to x until x reaches 0. As this number might be very large, output its remainder when divided by 109+7.

INPUT FORMAT (input arrives from the terminal / stdin):

The first line contains T (1≤T≤105), the number of independent tests.

The next T lines each contain a positive integer x consisting solely of the digits 0-9, with no leading zeros.

It is guaranteed that the total number of digits in all input integers does not exceed 106 .

OUTPUT FORMAT (print output to the terminal / stdout):

For each test case, output the remainder of the number of times when divided by 109+7 on a separate line.

SAMPLE INPUT:

2
24680
210

SAMPLE OUTPUT:

1
4

First test: x becomes zero after one operation.

Second test: f(x)=10,f2(x)=9,f3(x)=1,f4(x)=0

SAMPLE INPUT:

1
1234567890123456789012345678901234567890

SAMPLE OUTPUT:

511620083

SCORING:

Inputs 3-5: T≤2000, x<109
Inputs 6-7: x<1018 
Inputs 8-9: x<1060
Inputs 10-12: No additional constraints.

Problem credits: Aidan Bai

2026 年 USACO竞赛 第三场比赛铜奖组问题一—Make All Distinct

You have an integer array a1…aN with elements initially in the range [1,N](1≤N≤2⋅105), as well as a nonzero integer K(−N≤K≤N,K≠0).

You may perform the following operation as many times as you'd like (possibly zero): select an index i and set ai=ai+K.

Find the minimum number of operations to make all array elements distinct.

INPUT FORMAT (input arrives from the terminal / stdin):

The input consists of T (1≤T≤10) independent tests. Each test is described as follows:

The first line contains N and K.

The second line contains a1…aN .

It is guaranteed that the sum of N over all tests does not exceed 106.

OUTPUT FORMAT (print output to the terminal / stdout):

For each test, output a single line containing the minimum number of operations.

Note: The large size of integers involved in this problem may require the use of 64-bit integer data types (e.g., a "long long" in C/C++).

SAMPLE INPUT:

4
4 1
4 1 4 1
4 -3
4 1 4 1
4 4
4 1 4 1
3 -1
1 1 2

SAMPLE OUTPUT:

2
4
2
1

For the first test, here is a possible sequence of two operations that makes all elements distinct.

4 1 4 1
5 1 4 1 (a_1 += 1)
5 1 4 2 (a_4 += 1)

SCORING:

Inputs 2-4: N≤50
Inputs 5-7: N≤2000
Inputs 8-10: K=1
Inputs 11-13: No additional constraints.

Problem credits: Akshaj Arora, Benjamin Qi

2026 年 USACO竞赛 第三场比赛银奖组问题三—Point Elimination

You have N (2≤N≤105,N is even) points (xi,yi)(1≤xi,yi≤106) on an infinite 2D-coordinate plane.

You can perform the following two types of operations any number of times:

Choose two points that are directly adjacent to each other (manhattan distance of 1), and remove both points.

Choose any two points and swap their y-coordinates. Formally, points (a,b) and (c,d) become (a,d) and (c,b) respectively.

Determine if it is possible to eliminate all points on the board. Note that it may be the case that two points may map to the same coordinate; they should still be treated as different points. You also may not directly delete points on the same coordinate, as they are technically not directly adjacent.

INPUT FORMAT (input arrives from the terminal / stdin):

The first line contains T (1≤T≤5000), the number of test cases.

The first line of each test case contains an integer N.

The following N lines contain two integers xi and yi.

It is guaranteed that the sum of N over all test cases does not exceed 5⋅105.

OUTPUT FORMAT (print output to the terminal / stdout):

For each test case, output "YES" or "NO" on a new line.

SAMPLE INPUT:

4
2
1 1
1 1
4
6 10
7 11
8 1
8 1
6
1 2
1 3
1 4
1 5
10 10
11 10
6
1 1
1 1
1 1
1 1
10 10
11 11

SAMPLE OUTPUT:

NO
YES
YES
NO

For the first test, the only two points are equal, so no swaps will do anything. Thus, our answer is NO.

In the second test, we can swap the y-coordinates of 6 and 7 with 8 and 8. Then, we can remove the first two points (horizontal adjacency) and the last two (vertical).

For the third test, no swaps are needed. We can remove the first pair, second, and third.

In the last test, it can be shown that no matter how we swap the y-coordinates, we will never be able to remove all the points in adjacent pairs.

SCORING:

Input 2: T≤1000, N≤6
Inputs 3-5: N≤100
Inputs 6-11: No additional constraints.

Problem credits: Alex Pylypenko, Chongtian Ma

2026 年 USACO竞赛 第三场比赛银奖组问题二—Milk Buckets

There are N (1≤N≤2⋅105) buckets in a stack where the i-th bucket from the top has capacity ai gallons (1≤ai≤109). A tap above the top bucket sends one gallon of milk per second into the first bucket per second. There is also a pool below bucket N.

When a bucket reaches its capacity after t seconds, at the start of the t+1 th second it flips to dump its contents into either the bucket below if it is not the last bucket or the pool otherwise (it reverts back to filling at the end of the t+1th second). A bucket cannot collect milk while it is flipped; any milk arriving at the bucket above during this second is lost. Additionally, any amount of milk exceeding the capacity of the bucket below is lost.

Handle Q (1≤Q≤3⋅105) queries, each specified by three integers i, v, and t:

1.First, set ai =v (1≤i≤N,1≤v≤109).
2.Then answer the following question: Suppose that at time 0, all buckets as well as the pool are empty. Determine the number of gallons of milk in the pool after t seconds (1≤t 1018 ).

The ai=v updates persist through later queries.

INPUT FORMAT (input arrives from the terminal / stdin):

The first line contains N.

The second line contains a1…aN.

The next line contains Q.

Then the following Q lines contain three integers i, v, and t. This means that you should set ai=v and then answer the question for t.

OUTPUT FORMAT (print output to the terminal / stdout):

Output the answer to each question on a separate line.

SAMPLE INPUT:

3
1 1 1
30
1 1 1
1 1 2
1 1 3
1 1 4
1 1 5
1 1 6
1 1 7
1 1 8
1 1 9
1 1 10
1 2 1
1 2 2
1 2 3
1 2 4
1 2 5
1 2 6
1 2 7
1 2 8
1 2 9
1 2 10
2 2 1
2 2 2
2 2 3
2 2 4
2 2 5
2 2 6
2 2 7
2 2 8
2 2 9
2 2 10

SAMPLE OUTPUT:

0
0
0
1
1
2
2
3
3
4
0
0
0
0
1
1
1
2
2
2
0
0
0
0
1
1
1
2
2
2

When a=[1,1,1],

Bucket 1 flips at times 2,4,6,…
Bucket 2 flips at times 3,5,7,…
Bucket 3 flips at times 4,6,8,…

When a=[2,1,1],

Bucket 1 flips at times 3,6,9,…
Bucket 2 flips at times 4,7,10,…
Bucket 3 flips at times 5,8,11,…

When a=[2,2,1],

Bucket 1 flips at times 3,6,9,…
Bucket 2 flips at times 4,7,10,…
Bucket 3 flips at times 5,8,11,…

SAMPLE INPUT:

2
1 2
10
1 1 1
1 1 2
1 1 3
1 1 4
1 1 5
1 1 6
1 1 7
1 1 8
1 1 9
1 1 10

SAMPLE OUTPUT:

0
0
0
0
2
2
2
2
4
4

SAMPLE INPUT:

3
1 1 1
1
1 1 1000000000000000000

SAMPLE OUTPUT:

499999999999999999

SCORING:

Inputs 4-5: N≤10,Q≤100, and all t≤104
Inputs 6-11: N≤103,Q≤104
Inputs 12-23: No additional constraints.

Problem credits: Akshaj Arora

2026 年 USACO竞赛 第三场比赛银奖组问题一—Clash!

Farmer John is playing a famous and strategic card game with his dear cow Bessie. FJ has N (2≤N≤2⋅105) cards, conveniently numbered from 1 to N. The i'th card costs ai (1≤ai ≤109) moolixir if FJ wants to play it.

His hand always consists of H cards at any given time (1≤H<N). Initially, his hand consists of cards 1 through H. The remaining cards are in a draw queue. Every time FJ plays a card in his hand, he will draw its replacement from the front of the draw queue to his hand. Then, FJ will put the card he just played to the back of the draw queue. Initially, cards H+1 through N are arranged from the front to the back of the draw queue in that order.

In this game, time is measured in integer seconds. Initially, the game starts at time 0 with FJ having 0 moolixir. Immediately before each of integer times t=1,2,3,…,moolixir increases by 1. At each integer time, FJ may choose to play a card in his hand if its cost does not exceed FJ's current moolixir count, which subtracts FJ's current moolixir count by the card's cost.

FJ marks a subset of his cards s1,s2,…,sK as win-conditions (1≤kN, 1≤siN). If FJ has at least one win-condition in his hand, the next card he plays must be a win-condition.

He asks you Q (1≤Q≤2⋅105 ) queries. Each query is of the following form: what is the maximum number of win-conditions he could have placed down within t time (1≤t≤1018)?

INPUT FORMAT (input arrives from the terminal / stdin):

The first line contains N and H.

The second line contains N integers a1,a2,…,aN .

The third line contains an integer k, the number of win-conditions.

The fourth line contains k distinct integers s1,s2,…,sK.

The fifth line contains an integer Q.

The following Q lines each contain an integer t, the time to answer for each query.

OUTPUT FORMAT (print output to the terminal / stdout):

For each query, output the maximum number of win-conditions that FJ could've put down within t time.

SAMPLE INPUT:

6 3
2 4 3 5 7 6
2
1 4
6
1
2
3
7
10
1000000000000000

SAMPLE OUTPUT:

0
1
1
2
2
142857142857143

In this case, you start with card 1, a win condition on your hand. You can play it after you accumulate 2 elixir in 2 seconds. This means that just after t=1 you can play no cards, but after t=2 you can play your first card, which must be your win condition.

After t=3, it is still most optimal to play card 1 and have 1 elixir remaining, so the answer here is still 1.

You then draw card 4, which is also a win condition. You play it immediately after t=7, so you have played 2 win conditions at this time.

You then draw card 5 and have no win conditions in your hand. After t=10, even if you play card 3 with the 3 elixir you have, your number of win conditions does not change.

SCORING:

Inputs 2-3: N,Q≤100
Inputs 4-5: H=1
Inputs 6-11: No additional constraints.

Problem credits: Chongtian Ma