当前位置:网站首页>[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;
}边栏推荐
- Ethernet interface introduction
- [OpenGL] use of shaders
- Docker's latest super detailed tutorial - docker creates, runs, and mounts MySQL
- 利用C语言巧妙实现棋类游戏——三子棋
- logback filter过滤器简介说明
- Homebrew brew update doesn't respond for a long time (or stuck in updating homebrew...)
- Vagrant box cluster processing
- Leetcode 209. subarray with the smallest length (2022.07.28)
- logback中RollingFileAppender属性简介说明
- What is the function of fileappender in logback?
猜你喜欢

Interface test actual project 03: execute test cases

1 - background project construction

WPF simple login page completion case

OA项目之会议通知(查询&是否参会&反馈详情)
![[OpenGL] use of shaders](/img/73/1322afec8add6462ca4b82cb8112d1.png)
[OpenGL] use of shaders

Docker's latest super detailed tutorial - docker creates, runs, and mounts MySQL

亚马逊云助手小程序来啦!

2-unified return class dto object

Error 1045 (28000) access denied for user 'root' @ 'localhost' solution
Scala higher order (10): exception handling in Scala
随机推荐
5-integrate swagger2
时钟树综合(一)
MySQL uses the client and select methods to view the summary of blob type fields
cdc source能读完MySqlSnapshotSplit 就退出嘛
20-40k | mecarmand 3D vision algorithm / software / Product Manager Recruitment
Round avatar of user list and follow small blocks
Description of rollingfileappender attribute in logback
能在SQL 语句中 指定 内存参数吗?
论文阅读 (62):Pointer Networks
【暑期每日一题】洛谷 P6500 [COCI2010-2011#3] ZBROJ
Docker最新超详细教程——Docker创建运行MySQL并挂载
Introduction to log4j layout
[OpenGL] use of shaders
Comparison of advantages between can & canfd integrated test analysis software lkmaster and PCA Explorer 6 analysis software
vue-router路由缓存
反射reflect
Thoroughly understand kubernetes scheduling framework and plug-ins
QT专题:基础部件(按钮类,布局类,输出类,输入类,容器类)
Remote invocation of microservices
Full process flow of CMOS chip manufacturing