Source code
#include <iostream>
#include<vector>
#include<string.h>
#include<map>
using namespace std;
int main()
{
int T,i=0;
cin>>T;
while(T>0)
{
i++;
int n,D;
map<string,int>M;
string str,new_str;
int date;
cin>>n;
M.clear();
for(int i=1 ; i<=n ; i++)
{
cin>>str>>date;
M[str] = date;
}
cin>>D;
cin>>new_str;
int a = M[new_str];
if(a<=D && a!=0)
{
cout<<"Case "<<i<<": Yesss"<<endl;
}
else if(a==0 || (a>D))
{
if(a>(D+5)|| a==0)
{
cout<<"Case "<<i<<": Do your own homework!"<<endl;
}
else if(a<=(D+5))
{
cout<<"Case "<<i<<": Late"<<endl;
}
}
T--;
}
return 0;
}
Add your comment