A9717 | Vasya and Basketball
时间限制1s
内存限制256MB
通过 / 提交0/0
题目描述
Vasya follows a basketball game and marks the distances from which each team makes a throw. He knows that each successful throw has value of either 2 or 3 points. A throw is worth 2 points if the distance it was made from doesn't exceed some value of $d$ meters, and a throw is worth 3 points if the distance is larger than $d$ meters, where $d$ is some non-negative integer.
Vasya would like the advantage of the points scored by the first team (the points of the first team minus the points of the second team) to be maximum. For that he can mentally choose the value of $d$ . Help him to do that.
Vasya would like the advantage of the points scored by the first team (the points of the first team minus the points of the second team) to be maximum. For that he can mentally choose the value of $d$ . Help him to do that.
输入格式
Vasya follows a basketball game and marks the distances from which each team makes a throw. He knows that each successful throw has value of either 2 or 3 points. A throw is worth 2 points if the distance it was made from doesn't exceed some value of $d$ meters, and a throw is worth 3 points if the distance is larger than $d$ meters, where $d$ is some non-negative integer.
Vasya would like the advantage of the points scored by the first team (the points of the first team minus the points of the second team) to be maximum. For that he can mentally choose the value of $d$ . Help him to do that.
Vasya would like the advantage of the points scored by the first team (the points of the first team minus the points of the second team) to be maximum. For that he can mentally choose the value of $d$ . Help him to do that.
输出格式
Print two numbers in the format a:b — the score that is possible considering the problem conditions where the result of subtraction $a-b$ is maximum. If there are several such scores, find the one in which number $a$ is maximum.
输入输出样例
输入 #1
3 1 2 3 2 5 6
输出 #1
9:6
输入 #2
5 6 7 8 9 10 5 1 2 3 4 5
输出 #2
15:10
暂无题解
C++ 编辑器
输入
输出
可保存默认模板;新题优先使用已保存模板。
当前快捷键仅展示,暂不支持修改。
- 撤销
Ctrl / ⌘ + Z - 重做
Ctrl / ⌘ + Y - 查找
Ctrl / ⌘ + F - 全选
Ctrl / ⌘ + A - 复制
Ctrl / ⌘ + C - 剪切
Ctrl / ⌘ + X - 粘贴
Ctrl / ⌘ + V - 自动排版
工具栏排版按钮 - 草稿保存
编辑时自动保存到本机
历史
提交记录
状态说明时间源码
AI
作答助手
你好,我是作答助手。可以问思路、复杂度、样例含义或代码报错原因;不会直接给出完整 AC 代码。
确定要清空代码吗?
提交通过
评测结果:Accepted