当前位置:网站首页>[daily question in summer] Luogu p6408 [coci2008-2009 3] pet
[daily question in summer] Luogu p6408 [coci2008-2009 3] pet
2022-07-29 07:28:00 【AC_ Dragon】
Topic link :P6408 [COCI2008-2009#3] PET - Luogu | New ecology of computer science education (luogu.com.cn)
Title Description
In a popular competition Dinner for Five in , Yes 5 Contestants and 4 A referee , this 4 A referee will use for every dish 1 ~ 5 To evaluate , The total score of each player is the sum of the scores of all referees , Contestants will score from 1 To 5 Number .
Please write a program , Output the number of the player with the highest score and its score .
Input format
Input common 5 That's ok , Every line has 4 A positive integer , It means that each referee is right about the i The score of players .
Entering data will ensure that the winner is unique .
Output format
Output only 1 That's ok , Yes 2 A positive integer , There is a space in the middle , Respectively indicate the player with the highest score and his score .
Examples #1
The sample input #1
5 4 4 5
5 4 4 4
5 5 4 4
5 5 5 4
4 4 4 5Sample output #1
4 19Examples #2
The sample input #2
4 4 3 3
5 4 3 5
5 5 2 4
5 5 5 1
4 4 4 4Sample output #2
2 17Tips
explain
The title is translated from COCI2008-2009 CONTEST #3 T1 PET.
AC code:
#include<iostream>
#include<algorithm>
using namespace std;
int main()
{
int mx=-1;
int ri;
for(int i=0;i<5;i++)
{
int sum=0;
for(int j=0;j<4;j++)
{
int x;
cin>>x;
sum+=x;
}
if(sum > mx)
{
mx=sum;
ri=i+1;
}
}
cout<<ri<<" "<<mx;
return 0;
}边栏推荐
- My personal website doesn't allow access to wechat, so I did this
- CMOS芯片制造全工艺流程
- [OpenGL] use of shaders
- @RequestMapping 用法详解
- Homebrew brew update doesn't respond for a long time (or stuck in updating homebrew...)
- 【WPF】通过动态/静态资源实现语言切换
- Some learning and understanding of vintage analysis
- Introduction to logback appender
- QT basic day 2 (2) QT basic components: button class, layout class, output class, input class, container and other individual examples
- 【暑期每日一题】洛谷 P6320 [COCI2006-2007#4] SIBICE
猜你喜欢

作业7.28 文件IO与标准IO

Spingboot integrates the quartz framework to realize dynamic scheduled tasks (support real-time addition, deletion, modification and query tasks)

QT连接两个qslite数据库报错QSqlQuery::exec: database not open

利用C语言巧妙实现棋类游戏——三子棋

使用自定义注解校验list的大小

用户列表 圆形头像并跟随小板块

H3C_ Using setting default static routing priority to realize the active and standby function of export dual lines
![【暑期每日一题】洛谷 P7760 [COCI2016-2017#5] Tuna](/img/9a/f857538c574fb54bc1accb737d7aec.png)
【暑期每日一题】洛谷 P7760 [COCI2016-2017#5] Tuna

同步/异步、阻塞/非阻塞 与 IO

2-unified return class dto object
随机推荐
请问flink支持sqlServer数据库么?获取sqlServer数据库的变化
WPF interface layout must know basis
Gin template
OA项目之会议通知(查询&是否参会&反馈详情)
PAT甲级 1150 旅行商问题
Gin routing, parameters, output
CMOS芯片制造全工艺流程
Amazon cloud assistant applet is coming!
时钟树综合(一)
力扣(LeetCode)209. 长度最小的子数组(2022.07.28)
1 - background project construction
@RequestMapping 用法详解
Remote invocation of microservices
关于大龄读博的几点回答?
halcon的安装以及在vs2017中测试,vs2017中dll的配置
电子元器件贸易企业如何借助ERP系统,解决仓库管理难题?
女研究生做“思维导图”与男友吵架!网友:吵架届的“内卷之王”....
QT基础第二天(2)qt基础部件:按钮类,布局类,输出类,输入类,容器等个别举例
Introduction to logback filter
zip gzip tar压缩进阶版