Tuesday, April 12, 2011

11917 - Do Your Own Homework

#include<iostream>
#include<cstdio>
#include<map>
#include<string>
using namespace std;

int main()
{
    map<string,int>MP;
    string sub;
    int t,n,st,i,j,k;
    //freopen("in.txt","r",stdin);

    scanf("%d",&t);
    for(k=1;k<=t;k++)
    {
        scanf("%d",&n);
        for(j=1;j<=n;j++)
        {
            cin>>sub>>st;
            MP[sub]=st;
        }

        cin>>st>>sub;

        if(MP.find(sub)==MP.end())
            printf("Case %d: Do your own homework!\n",k);
        else
        {
            if(MP[sub]<=st)
                printf("Case %d: Yesss\n",k);
            else if(MP[sub]<=st+5)
                printf("Case %d: Late\n",k);
            else
                printf("Case %d: Do your own homework!\n",k);
        }
        MP.clear();
    }
    return 0;
}

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.