当前位置:网站首页>[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 5
Sample output #1
4 19
Examples #2
The sample input #2
4 4 3 3
5 4 3 5
5 5 2 4
5 5 5 1
4 4 4 4
Sample output #2
2 17
Tips
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;
}
边栏推荐
- 第7节-程序的编译(预处理操作)+链接
- SpingBoot整合Quartz框架实现动态定时任务(支持实时增删改查任务)
- 3-global exception handling
- How does MySQL convert rows to columns?
- Docker最新超详细教程——Docker创建运行MySQL并挂载
- Use of gcc/g++
- Life cycle hooks in routing - activated and deactivated
- 能在SQL 语句中 指定 内存参数吗?
- 2022-07-28: what is the output of the following go language code? A:AA; B:AB; C:BA; D:BB。 package main import ( “fmt“ ) func main() { f
- logback filter过滤器简介说明
猜你喜欢
【暑期每日一题】洛谷 P7760 [COCI2016-2017#5] Tuna
关于大龄读博的几点回答?
2022-07-28: what is the output of the following go language code? A:AA; B:AB; C:BA; D:BB。 package main import ( “fmt“ ) func main() { f
用户列表 圆形头像并跟随小板块
QT连接两个qslite数据库报错QSqlQuery::exec: database not open
【OpenGL】着色器(Shader)的使用
Synchronous / asynchronous, blocking / non blocking and IO
如何与斯堪尼亚SCANIA建立EDI连接?
Leetcode buckle classic problem -- 4. Find the median of two positively ordered arrays
Full process flow of CMOS chip manufacturing
随机推荐
Custom events
Description of rollingfileappender attribute in logback
09 bloom filter
Scala higher order (10): exception handling in Scala
我,28岁,测试员,10月无情被辞:想给还在学测试 的人提个醒......
Error 1045 (28000) access denied for user 'root' @ 'localhost' solution
7-2 计算正五边形的面积和周长 (25分)
PAT甲级 1150 旅行商问题
彻底搞懂kubernetes调度框架与插件
[OpenGL] use of shaders
Round avatar of user list and follow small blocks
I, 28, a tester, was ruthlessly dismissed in October: I want to remind people who are still learning to test
logback简介及引入方法
Leetcode buckle classic problem -- 4. Find the median of two positively ordered arrays
用户列表 圆形头像并跟随小板块
Unity sends a post request to the golang server for parsing and returning
关于大龄读博的几点回答?
Amazon cloud assistant applet is coming!
Comparison of advantages between can & canfd integrated test analysis software lkmaster and PCA Explorer 6 analysis software
jdbc入门