A897 | Promotion Counting--Bronze
来源USACO
时间限制1s
内存限制128MB
通过 / 提交0/0
题目描述
Bessie the cow is helping Farmer John run the USA Cow Olympiad (USACO), an on-
line contest where participants answer challenging questions to demonstrate
their mastery of bovine trivia.
In response to a wider range of participant backgrounds, Farmer John recently
expanded the contest to include four divisions of difficulty: bronze, silver,
gold, and platinum. All new participants start in the bronze division, and any
time they score perfectly on a contest they are promoted to the next-higher
division. It is even possible for a participant to be promoted several times
within the same contest. Farmer John keeps track of a list of all contest
participants and their current divisions, so that he can start everyone out at
the right level any time he holds a contest.
When publishing the results from his most recent contest, Farmer John wants to
include information on the number of participants who were promoted from
bronze to silver, from silver to gold, and from gold to platinum. However, he
neglected to count promotions as they occurred during the contest. Bessie,
being the clever bovine she is, realizes however that Farmer John can deduce
the number of promotions that occurred solely from the number of participants
at each level before and after the contest. Please help her perform this
computation!
line contest where participants answer challenging questions to demonstrate
their mastery of bovine trivia.
In response to a wider range of participant backgrounds, Farmer John recently
expanded the contest to include four divisions of difficulty: bronze, silver,
gold, and platinum. All new participants start in the bronze division, and any
time they score perfectly on a contest they are promoted to the next-higher
division. It is even possible for a participant to be promoted several times
within the same contest. Farmer John keeps track of a list of all contest
participants and their current divisions, so that he can start everyone out at
the right level any time he holds a contest.
When publishing the results from his most recent contest, Farmer John wants to
include information on the number of participants who were promoted from
bronze to silver, from silver to gold, and from gold to platinum. However, he
neglected to count promotions as they occurred during the contest. Bessie,
being the clever bovine she is, realizes however that Farmer John can deduce
the number of promotions that occurred solely from the number of participants
at each level before and after the contest. Please help her perform this
computation!
输入格式
Input consists of four lines, each containing two integers in the range
0..1,000,000. The first line specifies the number of bronze participants
registered before and after the contest. The second line specifies the number
of silver participants before and after the contest. The third line specifies
the number of gold participants before and after the contest. The last line
specifies the number of platinum participants before and after the contest.
0..1,000,000. The first line specifies the number of bronze participants
registered before and after the contest. The second line specifies the number
of silver participants before and after the contest. The third line specifies
the number of gold participants before and after the contest. The last line
specifies the number of platinum participants before and after the contest.
输出格式
Please output three lines, each containing a single integer. The first line
should contain the number of participants who were promoted from bronze to
silver. The second line should contain the number of participants who were
promoted from silver to gold. The last line should contain the number of
participants who were promoted from gold to platinum.
should contain the number of participants who were promoted from bronze to
silver. The second line should contain the number of participants who were
promoted from silver to gold. The last line should contain the number of
participants who were promoted from gold to platinum.
输入输出样例
输入 #1
1 2 1 1 1 1 1 2
输出 #1
1 1 1
In this example, 1 participant was registered in each division prior to the
contest. At the end of the contest, 2 participants were registered in bronze
and platinum. One way this could have happened is that 2 new participants
joined during the contest; one was promoted all the way to platinum, and the
other stayed in bronze.
contest. At the end of the contest, 2 participants were registered in bronze
and platinum. One way this could have happened is that 2 new participants
joined during the contest; one was promoted all the way to platinum, and the
other stayed in bronze.
C++ 编辑器
输入
输出
可保存默认模板;新题优先使用已保存模板。
当前快捷键仅展示,暂不支持修改。
- 撤销
Ctrl / ⌘ + Z - 重做
Ctrl / ⌘ + Y - 查找
Ctrl / ⌘ + F - 全选
Ctrl / ⌘ + A - 复制
Ctrl / ⌘ + C - 剪切
Ctrl / ⌘ + X - 粘贴
Ctrl / ⌘ + V - 自动排版
工具栏排版按钮 - 草稿保存
编辑时自动保存到本机
历史
提交记录
状态说明时间源码
AI
作答助手
你好,我是作答助手。可以问思路、复杂度、样例含义或代码报错原因;不会直接给出完整 AC 代码。
确定要清空代码吗?
提交通过
评测结果:Accepted