当前位置:网站首页>[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;
}边栏推荐
- Reflect reflect
- MySQL uses the client and select methods to view the summary of blob type fields
- Spingboot integrates the quartz framework to realize dynamic scheduled tasks (support real-time addition, deletion, modification and query tasks)
- logback中RollingFileAppender属性简介说明
- I'd like to ask, my flick job writes data in the way of upsert Kafka, but I'm more careful in MySQL
- do end用法的妙处
- 【Unity实战100例】Unity万能答题系统之单选多选判断题全部通用
- 同步/异步、阻塞/非阻塞 与 IO
- Gin service exit
- Synchronous / asynchronous, blocking / non blocking and IO
猜你喜欢

Practice of online problem feedback module (XVII): realize the online download function of excel template

我,28岁,测试员,10月无情被辞:想给还在学测试 的人提个醒......

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

1-后台项目搭建
![【暑期每日一题】洛谷 P6461 [COCI2006-2007#5] TRIK](/img/bf/c0e03f1bf477730f0b3661b3256d1d.png)
【暑期每日一题】洛谷 P6461 [COCI2006-2007#5] TRIK

H3C_ Using setting default static routing priority to realize the active and standby function of export dual lines

一篇长文---深入理解synchronized

js第四天流程控制(if语句和switch语句)

2-unified return class dto object

thinkphp6 实现数据库备份
随机推荐
do end用法的妙处
gcc/g++的使用
【OpenGL】着色器(Shader)的使用
彻底搞懂kubernetes调度框架与插件
My personal website doesn't allow access to wechat, so I did this
路由中的生命周期钩子 - activated与deactivated
Calculate program run time demo
Summary of OCR optical character recognition methods
I, 28, a tester, was ruthlessly dismissed in October: I want to remind people who are still learning to test
QT basic day 2 (2) QT basic components: button class, layout class, output class, input class, container and other individual examples
logback简介及引入方法
tp6 使用 ProtoBuf
我想问一下,我flink作业是以upsert-kafka的方式写入数据的,但是我在mysql里面去更
Thoroughly understand kubernetes scheduling framework and plug-ins
Paper reading (62):pointer networks
cdc source能读完MySqlSnapshotSplit 就退出嘛
能在SQL 语句中 指定 内存参数吗?
作业7.28 文件IO与标准IO
Redis Basics
2-统一返回类DTO对象