当前位置:网站首页>【暑期每日一题】洛谷 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;
}边栏推荐
猜你喜欢

MySQL - multi table query

JS break and continue and return keywords

Kubernetes (V) -- deploy kubernetes dashboard
![[Charles' daily problems] when you open Charles, you can't use nails](/img/ef/037fc416175d4de769ac6484cb53df.png)
[Charles' daily problems] when you open Charles, you can't use nails

MySQL 有这一篇就够(呕心狂敲37k字,只为博君一点赞!!!)
![[OpenGL] use of shaders](/img/73/1322afec8add6462ca4b82cb8112d1.png)
[OpenGL] use of shaders

Job 7.28 file IO and standard IO

JS 鸡生蛋与蛋生鸡问题,Object与Function究竟谁出现的更早?Function算不算Function的实例?

2-unified return class dto object

gcc/g++的使用
随机推荐
Summer summary (II)
7-2 计算正五边形的面积和周长 (25分)
09 bloom filter
5-整合swagger2
logback 中FileAppender具有什么功能呢?
tp6 使用 ProtoBuf
Logback log level introduction
Vite3.0 has been released, can you still roll it (list of new features)
一篇长文---深入理解synchronized
Description of rollingfileappender attribute in logback
H3C_ Using setting default static routing priority to realize the active and standby function of export dual lines
Explanation of suffix automata (SAM) + Luogu p3804 [template] suffix automata (SAM)
gcc/g++的使用
Introduction to log4j layout
第7节-程序的编译(预处理操作)+链接
Excel file reading and writing (creation and parsing)
Remote invocation of microservices
【WPF】通过动态/静态资源实现语言切换
WPF simple login page completion case
Synchronous / asynchronous, blocking / non blocking and IO