Lu_contestants

Everyone knows about the popular coding website " codeforces.com ". It is a rating based programming…

Click here to read the complete problem statement.


If you need help solving this problem, mention your approach and ask specific questions. Please avoid sharing your code and asking the Community to figure out “what’s wrong”.

I’m getting identical result as my code in Udebug but it’s not being accepted in Test Case 2…
Here’s my code:

#include
#include
using namespace std;
void roooki(int a)
{
if(a<1200){
cout<< “Newbi!.”;
}
else if(a<1400){
cout<<“Pupil!.”;
}
else if(a<1600){
cout<<“Specialist!.”;
}
else if(a<1900){
cout<< “Expert!.”;
}
}
int main()
{
ios_base::sync_with_stdio(false);
cin.tie();
int a;
cin>>a;
for(int b=1;b<=a;b++){
int man=0,c;
cin>>c;
string nam;
for(int d=0;d<c;d++){
int in;
string kk;
cin>>kk>>in;
if(in>man){
man = in;
nam = kk;
}
else if(in==man){
int jo,lob=0;
kk.size()>nam.size()?jo=nam.size():jo=kk.size();
for(int p=0;p<jo;p++){
if(kk[p]<nam[p]){
nam = kk;
lob++;
break;
}
else if(kk[p]>nam[p]){
break;
}
}
if(lob==0){
if(kk.size()<nam.size()){
nam = kk;
}
}
}
}
cout<<“Case “<<b<<”: “<<nam<<” is “;
roooki(man);
if(b != a){
cout<<”\n”;
}
}
return 0;
}

Can someone please tell me what’s the problem in it?

The Test Cases included in uDebug is not provided by Toph but by users of uDebug.
So, Just because your code is OK for the inputs in uDebug means that your code can handle all kind of errors.
The inputs of uDebug might be better or inferor.
I think you should read the problem statement carefully and try again.

Wait what? This problem has no input in uDebug. Are you might be posting in wrong topic?
Anyways, I will include some inputs.

1 Like

Problem solved… Forgot to add the ‘e’ in Newbie…
Thanks for reaching out…
Cheers!

1 Like

Included a large enough tc in uDebug. If you can pass it, then I think your code will not face any problem other than TLE.

1 Like