ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1585. Penguins

С++ решение(нужно ускорить)
Posted by Romanchillihotpepper 8 Oct 2021 15:17
#include <iostream>
#include<string>
#include<cmath>
int main() {
    int n=0,a=0,b=0,c=0;std::string r;
    std::cin>>n;
    for(n;n>=0;n--){
        std::getline(std::cin,r);
        if(r[0]=='E') a++;
        else if(r[0]=='M') b++;
        else if(r[0]=='L')c++;
    }
    n=std::max(a,std::max(b,c));
    n==a?std::cout<<"Emperor Penguin":n==b?std::cout<<"Macaroni Penguin":std::cout<<"Little Penguin";
return 0;
}
Re: С++ решение(нужно ускорить)
Posted by xinxer 25 Dec 2023 12:04
Thanks, good trick!