Physical Address
304 North Cardinal St.
Dorchester Center, MA 02124
Chef has obtained the results of a past Cook-Off. He wants to estimate the skill level of each contestant. The contestants can be classified with high probability (w.h.p.) based on the number of solved problems:
Please help Chef to identify the programming level of each participant.
For each participant, print a single line containing one string denoting Chef’s classification of that contestant — one of the strings “Beginner”, “Junior Developer”, “Middle Developer”, “Senior Developer”, “Hacker”, “Jeff Dean” (without quotes).
Input:
7
0 0 0 0 0
0 1 0 1 0
0 0 1 0 0
1 1 1 1 1
0 1 1 1 0
0 1 1 1 1
1 1 1 1 0
Output:
Beginner
Middle Developer
Junior Developer
Jeff Dean
Senior Developer
Hacker
Hacker
The first contestant has no solved problems, therefore he is a beginner. The second contestant solved 2 problems (the second and fourth problem), therefore he has the skills of a middle developer. The third contestant solved 1 problem, therefore he’s at the expected level of a junior developer. The fourth contestant solved 5 problems — we can guess it was Jeff Dean. The fifth contestant solved 3 problems, so he is a senior developer. And the last two contestants should be hackers because they solved exactly 4 problems each.
/* 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
{
// your code goes here
Scanner sc = new Scanner(System.in);
int t = sc.nextInt();
while(t-- >0)
{
int count = 0;
int arr[] = new int[5];
for(int i = 0 ; i < 5 ; i++)
arr[i] = sc.nextInt();
for(int i =0 ; i < 5 ; i++)
{
if(arr[i] == 1)
count++;
}
if(count == 0)
System.out.println("Beginner");
else if(count == 1)
System.out.println("Junior Developer");
else if(count == 2)
System.out.println("Middle Developer");
else if(count == 3)
System.out.println("Senior Developer");
else if(count == 4)
System.out.println("Hacker");
else if(count == 5)
System.out.println("Jeff Dean");
}
}
}
#include <iostream>
using namespace std;
int main() {
// your code goes here
int n;
cin>>n;
for (int i=0; i<n; i++){
int a, sum = 0;
for (int j=0; j<5; j++){
cin>>a;
sum += a;
}
if(sum == 0) cout<<"Beginner"<<endl;
else if(sum == 1) cout<<"Junior Developer"<<endl;
else if(sum == 2) cout<<"Middle Developer"<<endl;
else if(sum == 3) cout<<"Senior Developer"<<endl;
else if(sum == 4) cout<<"Hacker"<<endl;
else cout<<"Jeff Dean"<<endl;
}
return 0;
}
# cook your dish here
for i in range(int(input())):
a = list(map(int,input().strip().split()))[:5]
if a.count(1)==0:
print("Beginner")
elif a.count(1)==1:
print("Junior Developer")
elif a.count(1)==2:
print("Middle Developer")
elif a.count(1)==3:
print("Senior Developer")
elif a.count(1)==4:
print("Hacker")
else:
print("Jeff Dean")
In our experience, we suggest you solve this Chef and Cook-Off 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 Chef and Cook-Off CodeChef Solution
I hope this Chef and Cook-Off 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 >>