USACO竞赛全年赛程一览!USACO竞赛通过率怎么样?

美国计算机编程算法竞赛USACO第一场月赛已经结束了,距离下一场月赛仅剩一个月的时间了,还未报名注册报名的考生抓紧时间啦!

12月赛程:12月15-12月18日;

1月赛程:1月26-1月29日;

2月赛程:2月16日-2月19日;

3月美国公开赛:3月15-3月18日

赛程时间内任选连续4小时时间参赛即可

USACO竞赛的参赛门槛相对较低,任何具有编程语言中级知识的学生都可以参加比赛。参赛者只能以个人身份参赛,不能以团体形式参赛。

USACO竞赛的在线进行使得参赛者可以在任何地方参加比赛,只需要有互联网连接和编程软件即可。参赛者可以在家中或任何有条件的地方进行比赛。比赛通常在周末进行,参赛者可以根据自己的时间安排,在比赛周末的任何时间启动个人计时器进行比赛。

USACO竞赛通过率怎么样?

Bronze级别,通过率在过去三年大约在15%左右,相对较低:

2019~2020赛季,Bronze级别的参赛人数相对较多,但通过率却只有19%左右。到了2021和2022年,这个级别的通过率下降到了10%出头和15%左右,整体来看过去三年Bronze级别的通过率在15%左右。这可能是因为该级别是初级级别,参与人数较多,竞争压力较大。

Silver级别的通过率在过去几年也较低,大约在5%到6%左右

在2019~2020赛季的通过率为5%,而在2020~2021赛季则上升到了6%左右。到了2022年,这个级别的通过率也有所下降。在Silver级别,参赛者需要更多的时间和精力来解决更复杂的问题,可能需要更多的练习和模拟测试来提高解题能力。

Gold级别的通过率相对较低,大约在2%到3%左右

两年前Gold和Bronze以及Silver类似,是偏知识性的这种级别,近几年Gold级别题目出现更多的套路,这可能意味着参赛者需要更多的时间来研究和理解题目,掌握解题的技巧和方法。解决Gold级别的问题需要更深入的算法和数据结构知识,以及更高的编程能力。

USACO学术活动长线备考班、冲刺班已开启,扫描文末二维码领取限时优惠及备赛真题资料~

USACO秋季课程 正在火热组班中

金牌导师&精编讲义“强强联手”

USACO竞赛一般多少分才可以晋级?推荐哪些类型的学生参加USACO?

USACO是一项面向全球中小学生开放并且免费参加的计算机编程算法竞赛。其目的是选拔出参加国际信息学奥林匹克竞赛(IOI)的美国队队员。这项竞赛与国内的NOIP比赛相类似,备受美国名校关注,并具有极高的权威性。参加USACO能够在最大程度上提升学术背景,以最低的成本为海外升学提供帮助。

USACO竞赛一般多少分才可以晋级?

满分晋级:如果你在某个组别的所有题目上取得满分(总分为1000分),系统会提示你直接晋级到下一个级别。

分数线晋级:如果你没有取得满分,你将等待分数线的公布。通常在每次月赛考试结束后,会公布晋级分数线。如果你的总分高于或等于分数线,你将有资格在下一个月的比赛中参加更高级别的竞赛。晋级分数线通常设置在较高的分数范围,例如750分或800分以上。

推荐哪些类型的学生参加USACO?

参加USACO竞赛需要一定的备考时间和持续的努力。

1.8-12年级的中学生可以考虑参加USACO竞赛。

2.对于对编程感兴趣但没有比赛经验的学生,参加USACO竞赛可以提供一个锻炼和展示自己编程能力的机会。通过参加竞赛,他们可以学习不同的算法和编程技巧,提高自己的解决问题的能力。

3.对于目标申请计算相关专业的学生,参加USACO竞赛可以证明他们在计算机编程方面的能力和潜力,为将来的大学申请增加竞争力。计算机、数学、物理等专业通常需要一定的计算机编程能力或工具使用能力,USACO竞赛的经历可以在申请过程中起到积极的作用。

4.对于已经掌握一门或多门计算机语言的学生,通过参加USACO竞赛可以通过实际的竞赛成绩来证明自己的编程能力。这对于将来的大学申请也是有益的。

USACO学术活动长线备考班、冲刺班已开启,扫描文末二维码领取限时优惠及备赛真题资料~

USACO秋季课程 正在火热组班中

金牌导师&精编讲义“强强联手”

尽管有人认为计算机编程与校内学科不同,但实际上,通过学习基本的编程语言和算法知识,并通过练习和参加竞赛,学生可以逐步提高自己的编程能力,并在USACO竞赛中取得好成绩。

2023年12月USACO竞赛晋级分数线出炉!附USACO竞赛各级别晋级难度分析!

2023-2024赛季的USACO竞赛考试已于12月18日正式结束,近日,USACO官方公布了2023-2024赛季首场月赛的晋级分数线。

2023年12月USACO竞赛各组别晋级分数线

USACO 12月比赛(铜组)

铜组总参赛人数12591人,所有在本次比赛中得分达到700分或以上的参赛者将自动晋升至白银组。

USACO 12月比赛(白银组)

白银组共有3841名参赛者,所有在本次比赛中得分达到750分或以上的参赛者将自动晋升至黄金组。

USACO 12月比赛(黄金组)

黄金组共有1375名参赛者,所有在本次比赛中得分达到800分或以上的参赛者将自动晋级白金组。

USACO 12月比赛(白金组)

白金组共有673名参赛者,祝贺所有优秀参赛者取得的优异成绩!

恭喜所有晋级选手,在1月月赛可以进入下一组别参赛!没有晋级的同学,可以利用寒假好好准备一月份的竞赛!

各级别晋级难度分析

青铜级:作为入门级别,铜级考试相对较容易,主要考察基本的编程知识和算法思维。学生只要掌握了基本的编程概念和算法,认真备赛和练习,就有很大的机会顺利晋级到下一个级别。

白银级:相比铜级,白银级的考试难度有所提升,涉及的算法和题目类型更多。学生需要具备一定的算法基础和解决实际问题的能力。

黄金级:黄金级的考试难度较高,要求学生具备全面的计算机算法知识和良好的算法编程能力。

铂金级:铂金级是USACO竞赛中最高级别的考试,难度极高,其级别难度相当于AMC竞赛中的AIME(美国数学邀请赛)。每年全球仅有约不足50名pre-college的学生通过铂金组的考试。

USACO学术活动长线备考班、冲刺班已开启,扫描文末二维码领取限时优惠及备赛真题资料~

USACO秋季课程 正在火热组班中

金牌导师&精编讲义“强强联手”

USACO竞赛规则一文说清!USACO竞赛编程语言怎么选?

USACO被MIT麻省理工学院录取的三名中国学霸中的每一个人都参加了数学和信息学的国际级别竞赛。这足以证明顶尖美本对学生数学和计算机能力的看重。USACO竞赛是藤校认证的国际计算机竞赛之一,在留学申请简历中获得USACO竞赛金级铂金证书会受到招生官的特别关注。

USACO竞赛规则

参赛方式:个人赛

参赛语言:C、C++、Java、Python

竞赛赛制:采取积分赛制,分为月赛和公开赛两轮。USACO分为铜、银、金、铂金四个级别,难度依次递增。

晋级路径:青铜级→白银级→黄金级→铂金级,难度逐级递增。新注册的参赛选手需要从最低组别开始打起。

USACO竞赛满分1000分,共三道题目,从往年的分数线为例,晋级只需要750分左右。

USACO竞赛中常用的编程语言有C++、Java、Python和Pascal等。

每种语言都有其特点和适用场景:

C++语言:C++是一种高效的编程语言,在计算机竞赛中被广泛采用。它具有高执行效率和丰富的标准库,适合处理大规模计算和复杂的数据结构。C++对于算法和数据结构的实现更为灵活,因此在USACO竞赛中常被选手使用。

Java语言:Java是一种通用的编程语言,具有良好的跨平台性和可移植性。它的语法相对简单,易于学习和使用。Java在面向对象编程和图形用户界面方面有很好的支持,适合开发大型应用程序。在USACO竞赛中,Java常被用于解决复杂的问题和实现高级数据结构。

Python语言:Python是一种简单易学的编程语言,具有清晰简洁的语法和强大的标准库。它的易用性和可读性使得Python成为初学者和快速原型开发的首选语言。在USACO竞赛中,Python常被用于解决中小规模的问题和快速实现算法。

Pascal语言:Pascal是一种结构化的编程语言,具有清晰的语法和良好的可读性。它在学术界和教育领域广泛使用,适合初学者学习编程和算法。在USACO竞赛中,Pascal相对较少使用,但仍然有部分选手选择使用。

USACO学术活动长线备考班、冲刺班已开启,扫描文末二维码领取限时优惠及备赛真题资料~

USACO秋季课程 正在火热组班中

金牌导师&精编讲义“强强联手”

2024年USACO竞赛时间安排一览!没有编程基础应该如何准备USACO?

参加USACO不仅可以锻炼编程和算法能力,还可以为未来的大学申请增添亮点。获得USACO竞赛的金级铂金证书将成为申请名校的强有力证明,对申请者在激烈的竞争中起到独特的优势。因此,在你准备申请大学的过程中,不妨考虑参加USACO竞赛,为自己的未来铺就坚实的基础,打开进入名校的大门。

2024年USACO竞赛时间安排

第一次月赛:2023年12月15日-18日(已结束)

第二次月赛:2024年1月26日-29日

第三次月赛:2024年2月16日-19日

美国公开赛:2024年3月15日-18日

(中国学生只能参加到公开赛)

集训营:2024年5月23日-6月1日

EGOI:2024年7月21日-27日(荷兰)

IOI:2024年9月1日-8日(埃及

美国计算机编程算法竞赛USACO

如果你没有编程基础,应该要怎么学?

学习编程基础:

首先,你需要选择一门编程语言作为学习和参加USACO竞赛的工具。常见的选择是C++、Java和Python。如果你已经有了Python语言基础,那么转换到C++可能需要大约两周的时间。如果你已经有了Java语言基础,那么转换到C++可能只需要一周的时间。如果你是编程新手,想要入门一门编程语言,大约需要1.5个月的时间。

学习算法和数据结构:

USACO竞赛主要考察算法和数据结构的应用。你需要学习各种常见的算法和数据结构,如排序算法、搜索算法、图算法、动态规划等。可以通过参考教材、在线教程和练习题来学习和练习这些内容。

刷题练习:

刷题是提高编程能力和解决问题能力的重要途径,我们已经为大家汇总了USACO历年真题,还有精编讲义,现在扫码即可免费领取~你可以从简单的题目开始,逐渐提高难度,掌握各种算法和数据结构的应用。

参加在线培训班或辅导课程:

如果你想系统地学习USACO竞赛的知识和技巧,可以考虑参加在线培训班或辅导课程。这些课程通常由有经验的教师或竞赛选手授课,可以提供更深入的指导和练习。

USACO学术活动长线备考班、冲刺班已开启,扫描文末二维码领取限时优惠及备赛真题资料~

USACO秋季课程 正在火热组班中

金牌导师&精编讲义“强强联手”

2023 年 12 月比赛——最终结果

2023 年 12 月的比赛以算法编程问题为特色,涵盖了广泛的技术和难度级别。

在为期 4 天的比赛中,共有 16732 名不同的用户登录了比赛。共有来自132个不同国家的14350名参与者提交了至少一个解决方案:

5794 USA 5763 CHN 483 CAN 377 KOR 151 ROU 139 IND 127 ISR
124 MYS 120 SGP 103 TWN 72 HKG 68 POL 63 DEU 58 VNM
53 IRN 46 AUS 44 GBR 40 EGY 37 JPN 33 BLR 31 FRA
29 ABW 28 GEO 23 UZB 21 ARM 20 SLV 18 ZAF 18 NZL
18 BRA 17 HRV 16 NLD 16 CUB 13 IDN 13 CHE 12 TUR
12 TKM 11 SRB 11 PAK 11 ESP 11 BDI 10 THA 10 SYR
10 KGZ 10 ASM 9 BGD 9 AUT 9 ARE 8 UKR 8 PHL
8 COL 8 CHL 8 AZE 7 AIA 6 TUN 6 SWE 6 RUS
6 MEX 6 KAZ 6 AGO 5 ITA 5 IRL 5 GRC 5 FIN
5 EST 5 ANT 5 ALA 4 PRK 4 MNG 4 MLT 4 LTU
4 HUN 4 CYP 4 ATG 4 ARG 4 AND 4 ALB 4 AFG
3 MKD 3 MAC 3 KEN 3 HTI 3 CCK 3 BGR 2 YEM
2 VGB 2 QAT 2 PRT 2 NOR 2 MCO 2 GHA 2 BWA
2 BLM 2 BEL 1 ZWE 1 VUT 1 VEN 1 URY 1 UGA
1 TTO 1 TJK 1 SWZ 1 SMR 1 SAU 1 PSE 1 NPL
1 NGA 1 NER 1 NAM 1 MNE 1 MAR 1 LUX 1 LSO
1 LAO 1 KHM 1 ISL 1 IOT 1 HMD 1 GUY 1 GUM
1 GMB 1 GAB 1 FSM 1 FJI 1 DNK 1 DJI 1 CZE
1 CRI 1 CMR 1 CIV 1 BLZ 1 BHS 1 BHR

共有 67 名白金美国大学预科参与者参加了“认证”比赛 比赛窗口。在整个比赛中,共有 38095 份分级作品,按语言细分如下:

20207 C++17
7673 C++11
5342 Python 3.6.9
4633 Java
195 C
45 Python 2.7.17

以下是每场白金、黄金、白银和铜牌比赛的详细结果。 您还可以找到每个问题的解决方案和测试数据。

USACO 2023 年 12 月学术活动,白金奖

白金部门共有 673 名参与者,其中 455 名是大学预科生。最佳得分手的成绩在这里。恭喜所有顶尖选手取得优异成绩!

1 Cowntact Tracing
查看问题 | 测试数据 | 解决方案
2 A Graph Problem
查看问题 | 测试数据 | 解决方案
3 Train Scheduling
查看问题 | 测试数据 | 解决方案

USACO 2023 年 12 月比赛,金奖

黄金组共有 1375 名参与者,其中 980 名是大学预科生。所有在本次比赛中得分达到或超过800分的选手将自动晋升为白金组。所有晋升者的详细结果都在这里。

1 Flight Routes
查看问题 | 测试数据 | 解决方案
2 Minimum Longest Trip
查看问题 | 测试数据 | 解决方案
3 Haybale Distribution
查看问题 | 测试数据 | 解决方案

USACO 2023 年 12 月比赛,银奖

白银组共有3841名参与者,其中2967名是大学预科生。所有在本次比赛中得分达到或超过750分的参赛者将自动晋升为黄金组。

1 Bovine Acrobatics
查看问题 | 测试数据 | 解决方案
2 Cycle Correspondence
查看问题 | 测试数据 | 解决方案
3 Target Practice
查看问题 | 测试数据 | 解决方案

USACO 2023 年 12 月比赛,铜奖

青铜组共有12591名参赛者,其中9707名是大学预科生。所有在本次比赛中得分达到或超过700分的选手将自动晋升为银牌组。

1 Candy Cane Feast
查看问题 | 测试数据 | 解决方案
2 Cowntact Tracing 2
查看问题 | 测试数据 | 解决方案
3 Farmer John Actually Farms
查看问题 | 测试数据 | 解决方案

结语

欢迎来到 2023-2024 USACO 赛季!我很高兴看到我们的 第一届比赛进行得很顺利,涉及的用户数量创下了历史新高。相当多的参与者得分很高并得到了晋升,尽管这是一场具有挑战性的问题阵容。看到如此强劲的表现令人鼓舞,特别是考虑到人工智能等领域的最新创新和势头可能在上升,因而对具有卓越计算机天赋的学生的要求越来越高。

对于那些尚未晋升的人, 请记住,练习越多越好 你的算法编码技能将成为 -- 拜托坚持下去!USACO竞赛旨在挑战甚至最好的学生,这可能需要大量的努力在他们身上出类拔萃。为了帮助您修复代码中的任何错误,您需要 现在可以重新提交您的解决方案并从 使用“分析模式”判断服务器。

很多人为质量做出了贡献以及USACO竞赛的成功。那些帮助过这件事的人 参赛作品包括Mihir Singhal、Agastya Goel、Chongtian 马、Suhas Nagar、Eric Hsu、Benjamin Qi、Claire Zhang、Spencer Compton、Brandon Wang、Nick Wu、Jichao Qian、Nathan Wang、Danny Mittal、Andi Quad、Ho Tin Fan、Benjamin Chen、David 胡、Richard Qi、Andrew Gu和Anand John。 谢谢 也感谢我们的翻译人员和克莱姆森CCIT提供的 我们的比赛基础设施。最后,我们心存感激 感谢USACO赞助商的慷慨支持: Citadel、Ansatz、X-Camp、TwoSigma、VPlanet 编码、EasyFunCoding、 Orijtech 和 Jump Trading。

我们期待在 2024 年 1 月的比赛中再次见到大家。

祝您编码愉快!

2023年12月美国计算机奥赛USACO竞赛铜奖组问题三—Farmer John Actually Farms

Farmer John is growing N (1≤N≤2⋅105) plants of asparagus on his farm! However some of his plants have genetic differences, so some plants will grow faster than others. The initial height of the ith plant is hi inches, and after each day, the ith plant grows by ai inches.

FJ likes some of his plants more than others, and he wants some specific plants to be taller than others. He gives you an array of distinct values t1,…,tN containing all integers from 0 to N−1 and he wants the ith plant to have exactly ti other plants that are taller than it. Find the minimum number of days so that FJ's request is satisfied, or determine that it is impossible.

INPUT FORMAT (pipe stdin):

The first will consist of an integer T, denoting the number of independent test cases (1≤T≤10).

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

The second line consists of N integers hi (1≤hi ≤109) denoting the initial height of the ith plant in inches.

The third line consists of N integers ai (1≤ai≤109) denoting the number of inches the ith plant grows each day.

The fourth line consists of N distinct integers ti denoting the array that FJ gives you.

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

OUTPUT FORMAT (pipe stdout):

Output T lines, the answer to each test case on a different line. If it is not possible, output −1.

Note that 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:

6
1
10
1
0
2
7 3
8 10
1 0
2
3 6
10 8
0 1
2
7 3
8 9
1 0
2
7 7
8 8
0 1
2
7 3
8 8
1 0

SAMPLE OUTPUT:

0
3
2
5
-1
-1

In the first sample input, there are 6 test cases.

In the first test case, there is only one plant, so the condition is satisfied on day 0.

In the second test case, we need the first plant to be shorter than the second plant. After day 1, the heights are 15 and 13. After day 2, the heights are both 23. After day 3, the heights are 31 and 33, and that's the first day in which the condition is satisfied.

The third and fourth test cases are similar to the second.

In the fifth test case, both plants start with an initial height of 7 and a growth rate of 8. So they will always have identical heights, and therefore the condition is never satisfied.

In the sixth test case, the condition is not satisfied initially and the growth rates are the same. So the condition can never be satisfied.

SAMPLE INPUT:

2
5
7 4 1 10 12
3 4 5 2 1
2 1 0 3 4
5
4 10 12 7 1
3 1 1 4 5
2 4 3 1 0

SAMPLE OUTPUT:

4
7
In the second sample input, there are 2 test cases.

In the first test case, the final heights after day 4 are 19, 20, 21, 18, 16.

In the second test case, the final heights after day 7 are 25, 17, 19, 35, 36.

SCORING:

Input 3: N≤2
Inputs 4-5: N≤50 and ai,hi≤103
Inputs 6-8: N≤103
Inputs 9-13: No additional constraints.
Problem credits: Chongtian Ma

扫码领取USACO试题答案+详细解析

咨询一对一备赛规划

2023年12月美国计算机奥赛USACO竞赛铜奖组问题二—Cowntact Tracing 2

Farmer John has N cows in a line (1≤N≤3⋅105). Unfortunately, there is a sickness spreading throughout.

Initially, some cows start off infected. Every night, an infected cow spreads the sickness to the cows on their left and right (if they exist). Once a cow is infected, she stays infected.

After some amount of nights, Farmer John realizes that the issue has gotten out of control, so he tests his cows to determine who has the sickness. Find the minimum number of cows that could have started with the sickness.

INPUT FORMAT (pipe stdin):

The first line contains N, the number of cows that Farmer John has.
The next line contains an N character bitstring of only 1s and 0s where a 1 represents an infected cow and a 0 represents an uninfected cow after some number of nights.

OUTPUT FORMAT (pipe stdout):

Output a single integer: the minimum number of cows that could have started with the sickness.

SAMPLE INPUT:

5
11111

SAMPLE OUTPUT:

1
Suppose the middle cow was the only cow to start off infected. Then the cows would be infected in the following order:


After two or more nights, the final state of the cows would look like the input. There are many other initial states and number of nights that could have produced the input state, such as:

All of these initial states contain at least one infected cow.

SAMPLE INPUT:

6
011101

SAMPLE OUTPUT:

4
The only initial state and number of nights that could have led to this final state is if no nights have passed and each of the four infected cows in the input started off with the sickness.

SCORING:

Inputs 3-7: N≤1000
Inputs 8-12: No additional constraints.
Problem credits: Suhas Nagar

扫码领取USACO试题答案+详细解析

咨询一对一备赛规划

2023年12月美国计算机奥赛USACO竞赛铜奖组问题一—Candy Cane Feast

Farmer John's cows have quite the sweet tooth, and they especially enjoy eating candy canes! FJ has N total cows, each with a certain initial height and he wants to feed them M candy canes, each also of varying height (1≤N,M≤2⋅105).

FJ plans to feed the candy canes one by one to the cows, in the order they are given in the input. To feed a candy cane to his cows, he will hang the candy cane so that initially the candy cane is just touching the ground. The cows will then line up one by one, in the order given by the input, and go up to the candy cane, each eating up to their height (since they cannot reach any higher). The candy cane stays suspended in place where it is initially set up and is not lowered to the ground, even after cows eat the bottom of the candy cane. It is possible a cow may eat nothing during her turn, if the base of the candy cane is already above that cow's height. After every cow has had their turn, the cows grow in height by how many units of candy cane they ate, and Farmer John hangs the next candy cane and the cows repeat the process again (with cow 1 again being the first to start eating the next candy cane).

INPUT FORMAT (pipe stdin):

The first line contains N and M.

The next line contains the initial heights of the N cows, each in the range [1,109].

The next line contains the heights of the M candy canes, each in the range [1,109].

OUTPUT FORMAT (pipe stdout):

The final heights of each of the N cows on separate lines.

Note that 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:

3 2
3 2 5
6 1

SAMPLE OUTPUT:
7
2
7

The first candy cane is 6 units tall.

The first cow eats the portion of the first candy cane up to height 3, after which the remaining portion of the first candy cane occupies heights [3,6].
The second cow is not tall enough to eat any of the remaining portion of the first candy cane.
The third cow eats two additional units of the first candy cane. The remaining portion of the first candy cane, occupying heights [5,6], is not eaten.
Next, each cow grows by the amount she ate, so the heights of the cows become [3+3,2+0,5+2]=[6,2,7].

The second candy cane is 1 unit tall, and the first cow eats all of it.

SCORING:

Inputs 2-10: N,M≤103
Inputs 11-14: No additional constraints.
Problem credits: Agastya Goel

扫码领取USACO试题答案+详细解析

咨询一对一备赛规划

USACO竞赛考试网-二维码

2023年12月美国计算机奥赛USACO竞赛银奖组问题三—Target Practice

Bessie is a robovine, also known as a cowborg. She is on a number line trying to shoot a series of T (1≤T≤105) targets located at distinct positions. Bessie starts at position 0 and follows a string of C (1≤C≤105) commands, each one of L, F, or R:

L: Bessie moves one unit to the left.
R: Bessie moves one unit to the right.
F: Bessie fires. If there is a target at Bessie's current position, it is hit and destroyed, and cannot be hit again.

If you are allowed to change up to one command in the string to a different command before Bessie starts following it, what is the maximum number of targets that Bessie can hit?

INPUT FORMAT (pipe stdin):

The first line contains T and C.

The next line contains the locations of the T targets, distinct integers in the range [−C,C].

The next line contains the command string of length C, containing only the characters F, L, and R.

OUTPUT FORMAT (pipe stdout):

Print the maximum number of targets that Bessie can hit after changing up to one command in the string.

SAMPLE INPUT:

3 7
0 -1 1
LFFRFRR

SAMPLE OUTPUT:

3

If you make no changes to the string, Bessie will hit two targets:

If you change the last command from R to F, Bessie will hit all three targets:

SAMPLE INPUT:

1 5
0
FFFFF

SAMPLE OUTPUT:

1

If the commands are left unchanged, the only target at 0 will be destroyed. Since a target cannot be destroyed multiple times, the answer is 1.

SAMPLE INPUT:

5 6
1 2 3 4 5
FFRFRF

SAMPLE OUTPUT:
3

SCORING:

Inputs 4-6: T,C≤1000
Inputs 7-15: No additional constraints.
Problem credits: Suhas Nagar

扫码领取USACO试题答案+详细解析

咨询一对一备赛规划