URI ONLINE JUDGE SOLUTION 1397 - Online Judge

Latest

This is an Online Judge Solution Base Site. We can discuss & Solve any contest solution in Programming.

Friday, April 10, 2020

URI ONLINE JUDGE SOLUTION 1397

Problem Number: 1397
Problem Name: Game of The Greatest
Author’s Name: By Lucas Hermann Negri, UDESC Brasil
Timelimit: 1
Problem Category: AD-HOC
Problem Source: https://www.urionlinejudge.com.br/judge/en/problems/view/1397

Solution:

#include<iostream>
using namespace std;
int main()
{
    int n;
    cin>>n;
    while(n!=0)
    {
        int sum1=0,sum2=0;
        int a,b;
        while(n-->0)
        {
            cin>>a>>b;
            if(a>b)
            sum1+=1;
            if(b>a)
            sum2+=1;
        }
        cout<<sum1<<" "<<sum2<<endl;
        cin>>n;
    }
}

👉 SEE MORE TUTORIAL HERE





No comments:

Post a Comment

Thanks..