当前位置:网站首页>【暑期每日一题】洛谷 P6408 [COCI2008-2009#3] PET
【暑期每日一题】洛谷 P6408 [COCI2008-2009#3] PET
2022-07-29 07:08:00 【AC_Dragon】
题目链接:P6408 [COCI2008-2009#3] PET - 洛谷 | 计算机科学教育新生态 (luogu.com.cn)
题目描述
在一项受欢迎的比赛 Dinner for Five 中,有 5 名选手和 4 名裁判,这 4 个裁判会对每一道菜用 1 ~ 5 的数字进行评估,每位选手的总分即是所有裁判评分的总和,参赛者按照其评分顺序从 1 到 5 进行编号。
请你编写一个程序,输出评分最高的选手的编号以及其分数。
输入格式
输入共 5 行,每一行有 4 个正整数,表示每位裁判对第 i 位选手的评分。
输入数据将确保胜者是唯一的。
输出格式
输出仅 1 行,有 2 个正整数,中间有一个空格,分别表示评分最高的选手以及其分数。
样例 #1
样例输入 #1
5 4 4 5
5 4 4 4
5 5 4 4
5 5 5 4
4 4 4 5
样例输出 #1
4 19
样例 #2
样例输入 #2
4 4 3 3
5 4 3 5
5 5 2 4
5 5 5 1
4 4 4 4
样例输出 #2
2 17
提示
说明
题目译自 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;
}
边栏推荐
- Comparison of advantages between can & canfd integrated test analysis software lkmaster and PCA Explorer 6 analysis software
- Leetcode 209. subarray with the smallest length (2022.07.28)
- WPF nested layout case
- Interface test actual project 03: execute test cases
- Cvpr2021 | multi view stereo matching based on self supervised learning (cvpr2021)
- 0 8 动态规划(Dynamic Programming)
- Gin routing, parameters, output
- After three years of outsourcing, the salary of automatic testing after job hopping is twice that of the original. The secret is
- 【Unity实战100例】Unity万能答题系统之单选多选判断题全部通用
- CDC source can quit after reading MySQL snapshot split
猜你喜欢
Summary of OCR optical character recognition methods
Amazon cloud assistant applet is coming!
JS break and continue and return keywords
Remote invocation of microservices
2-统一返回类DTO对象
Cvpr2021 | multi view stereo matching based on self supervised learning (cvpr2021)
ERROR 1045 (28000) Access denied for user ‘root‘@‘localhost‘解决方法
论文阅读 (62):Pointer Networks
Kubernetes (V) -- deploy kubernetes dashboard
第7节-程序的编译(预处理操作)+链接
随机推荐
Operator3 - design an operator
ERROR 1045 (28000) Access denied for user ‘root‘@‘localhost‘解决方法
zip gzip tar压缩进阶版
Zabbix 其他基础监控项
Vite3.0 has been released, can you still roll it (list of new features)
Using C language to skillfully realize the chess game -- Sanzi chess
LevelFilter简介说明
Tp6 use protobuf
[OpenGL] use of shaders
logback appender简介说明
Introduction and introduction of logback
do end用法的妙处
How does MySQL convert rows to columns?
Homebrew brew update doesn't respond for a long time (or stuck in updating homebrew...)
My personal website doesn't allow access to wechat, so I did this
Redis Basics
09 bloom filter
Interface test actual project 03: execute test cases
js中break与continue和return关键字
Scala 高阶(十):Scala中的异常处理