A971 | Do You Know Your ABCs
来源USACO
时间限制1s
内存限制128MB
通过 / 提交0/0
题目描述
Farmer John's cows have been holding a daily online gathering on the "mooZ"
video meeting platform. For fun, they have invented a simple number game to
play during the meeting to keep themselves entertained.
Elsie has three positive integers $A$, $B$, and $C$ ($A\le B\le C$). These
integers are supposed to be secret, so she will not directly reveal them to
her sister Bessie. Instead, she gives Bessie seven (not necessarily distinct)
integers in the range $1 \ldots 10^9$, claiming that they are $A$, $B$, $C$,
$A+B$, $B+C$, $C+A$, and $A+B+C$ in some order.
Given a list of these seven numbers, please help Bessie determine $A$, $B$,
and $C$. It can be shown that the answer is unique.
video meeting platform. For fun, they have invented a simple number game to
play during the meeting to keep themselves entertained.
Elsie has three positive integers $A$, $B$, and $C$ ($A\le B\le C$). These
integers are supposed to be secret, so she will not directly reveal them to
her sister Bessie. Instead, she gives Bessie seven (not necessarily distinct)
integers in the range $1 \ldots 10^9$, claiming that they are $A$, $B$, $C$,
$A+B$, $B+C$, $C+A$, and $A+B+C$ in some order.
Given a list of these seven numbers, please help Bessie determine $A$, $B$,
and $C$. It can be shown that the answer is unique.
输入格式
The only line of input consists of seven space-separated integers.
输出格式
Print $A$, $B$, and $C$ separated by spaces.
输入输出样例
输入 #1
2 2 11 4 9 7 9
输出 #1
2 2 7
暂无题解
C++ 编辑器
输入
输出
可保存默认模板;新题优先使用已保存模板。
当前快捷键仅展示,暂不支持修改。
- 撤销
Ctrl / ⌘ + Z - 重做
Ctrl / ⌘ + Y - 查找
Ctrl / ⌘ + F - 全选
Ctrl / ⌘ + A - 复制
Ctrl / ⌘ + C - 剪切
Ctrl / ⌘ + X - 粘贴
Ctrl / ⌘ + V - 自动排版
工具栏排版按钮 - 草稿保存
编辑时自动保存到本机
历史
提交记录
状态说明时间源码
AI
作答助手
你好,我是作答助手。可以问思路、复杂度、样例含义或代码报错原因;不会直接给出完整 AC 代码。
确定要清空代码吗?
提交通过
评测结果:Accepted