Physical Address
304 North Cardinal St.
Dorchester Center, MA 02124
In a season, each player has three statistics: runs, wickets, and catches. Given the season stats of two players A and B, denoted by R, W, and C respectively, the person who is better than the other in the most statistics is regarded as the better overall player. Tell who is better amongst A and B. It is known that in each statistic, the players have different values.
For each test case, output in a single line "A"
(without quotes) if player A is better than player B and "B"
(without quotes) otherwise.
Input:
3
0 1 2
2 3 4
10 10 10
8 8 8
10 0 10
0 10 0
Output:
B
A
A
Test Case 1: Player B is better than A in all 3 fields.
Test Case 2: Player A is better than B in all 3 fields.
Test Case 3: Player A is better than B in runs scored and number of catches.
# cook your dish here
for _ in range(int(input())):
l1=list(map(int,input().split()))
l2=list(map(int,input().split()))
c,d=0,0
for i in range(3):
if l1[i]>l2[i]:
c+=1
elif l1[i]<l2[i]:
d+=1
if c>d:
print("A")
else:
print("B")
#include <bits/stdc++.h>
using namespace std;
int main()
{
int i,t;
cin >> t;
while (t--)
{
int a,b,c,d,e,f,g=0,h=0;
cin >> a >> b >> c;
cin >> d >> e >> f;
/*g=a+b+c;
h=d+e+f;
if((a != d) && (b != e) && (c != f) )
{
if((a+b)>(d+e) || (b+c)>(e+f) || (a+c)>(d+f) || g>h)
{
cout << "A" << endl;
}
if((a+b)<(d+e) || (b+c)<(e+f) || (a+c)<(d+f) || g<h)
{
cout << "B" << endl;
}
}*/
if(a>d)
{
g++;
}
else
{
h++;
}
if(b>e)
{
g++;
}
else
{
h++;
}
if(c>f)
{
g++;
}
else
{
h++;
}
if (g>h)
{
cout << "A" << endl;
}
else
{
cout << "B" << endl;
}
}
return 0;
}
/* package codechef; // don't place package name! */
import java.util.*;
import java.lang.*;
import java.io.*;
/* Name of the class has to be "Main" only if the class is public. */
class Codechef
{
public static void main (String[] args) throws java.lang.Exception
{
Scanner sc = new Scanner(System.in);
int T = sc.nextInt();
while(T >0){
int r1 = sc.nextInt();
int w1 = sc.nextInt();
int c1 = sc.nextInt();
int r2 = sc.nextInt();
int w2 = sc.nextInt();
int c2 = sc.nextInt();
int count1 =0;
int count2 = 0;
if(r1 > r2)
count1++;
else
count2++;
if(w1 > w2)
count1++;
else
count2++;
if(c1 > c2)
count1++;
else
count2++;
if(count1 > count2)
System.out.println("A");
else
System.out.println("B");
T--;
}
}
}
In our experience, we suggest you solve this Cricket Ranking CodeChef Solution and gain some new skills from Professionals completely free and we assure you will be worth it.
If you are stuck anywhere between any coding problem, just visit Queslers to get the Cricket Ranking CodeChef Solution
I hope this Cricket Ranking CodeChef Solution would be useful for you to learn something new from this problem. If it helped you then don’t forget to bookmark our site for more Coding Solutions.
This Problem is intended for audiences of all experiences who are interested in learning about Data Science in a business context; there are no prerequisites.
Keep Learning!
More Coding Solutions >>