当前位置:网站首页>你知道你的ABC吗(春季每日一题 1)
你知道你的ABC吗(春季每日一题 1)
2022-06-24 21:39:00 【51CTO】
Farmer John
的奶牛正在 mooZ
视频会议平台上举行每日集会。
她们发明了一个简单的数字游戏,为会议增添一些乐趣。
Elsie 有三个正整数 和
。
这些数字是保密的,她不会直接透露给她的姐妹 Bessie。
她告诉 Bessie 七个范围在 1…109 之间的整数(不一定各不相同),并宣称这是 和
的某种排列。
给定这七个整数,请帮助 Bessie 求出 和
。
可以证明,答案是唯一的。
输入格式
输入一行,包含七个空格分隔的整数。
输出格式
输出 和
,用空格分隔。
数据范围 所有输入的整数
输入样例:
输出样例:
using namespace std;
const int INF = 2e9;
int main(){
int a, b, c;
cin >> a >> b;
if( a > b) swap( a, b);
c = max( a, b);
for( int i = 0; i < 5; i ++){
int x;
cin >> x;
if( x > c) c = x;
if( x <= a) b = a, a = x;
else if( x < b) b = x;
}
cout << a << ' ' << b << ' ' << c - a - b << endl;
return 0;
}
- 1.
- 2.
- 3.
- 4.
- 5.
- 6.
- 7.
- 8.
- 9.
- 10.
- 11.
- 12.
- 13.
- 14.
- 15.
- 16.
- 17.
- 18.
- 19.
- 20.
- 21.
- 22.
- 23.
- 24.
- 25.
- 26.
- 27.
- 28.
- 29.
- 30.
边栏推荐
- (CVPR 2020) Learning Object Bounding Boxes for 3D Instance Segmentation on Point Clouds
- pbcms添加循环数字标签
- 为猪脸识别而进行自己数据集的构建、训练「建议收藏」
- Chinese and English instructions of Papain
- Texture enhancement
- Linux64Bit下安装MySQL5.6-不能修改root密码
- How to prepare for the last day of tomorrow's exam? Complete compilation of the introduction to the second building test site
- C language boundary calculation and asymmetric boundary
- Bi SQL alias
- IPC mechanism
猜你喜欢
全排列II[存在相同元素去重 + 标准回溯]
最长连续序列[扩散法+空间换时间]
AutoCAD - two extension modes
Linux64Bit下安装MySQL5.6-不能修改root密码
同一服务器两个端口不同的应用session覆盖解决方案
leetcode:2104. Subarray range and
Bi-sql - different join
Bi SQL constraints
Full arrangement ii[duplicate removal of the same elements + standard backtracking]
多模态数据也能进行MAE?伯克利&谷歌提出M3AE,在图像和文本数据上进行MAE!最优掩蔽率可达75%,显著高于BERT的15%
随机推荐
Longest continuous sequence [diffusion method + space for time]
‘distutils‘ has no attribute ‘version
JVM directive
Fan benefits, JVM manual (including PDF)
php中preg_replace如何替换变量数据
Unity C # e-learning (VI) -- FTP (I)
How to prepare for the last day of tomorrow's exam? Complete compilation of the introduction to the second building test site
为猪脸识别而进行自己数据集的构建、训练「建议收藏」
Tencent moved!
MPLS notes Part 1
归并排序模板 & 理解
Elastase instructions in Chinese and English
Bi SQL constraints
Bi-sql - different join
matlab 取整
木瓜蛋白酶中英文说明书
(CVPR 2020) Learning Object Bounding Boxes for 3D Instance Segmentation on Point Clouds
Reverse ordinal number by merge sort
1. package your own scaffold 2 Create code module
PS5连接OPPO K9电视不支持2160P/4K