1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
#include <iostream> #include <cstdio> #include <sstream> #include <string> #include <map> using namespace std; int main() { int t,n,d,D; scanf("%d",&t); string sub,s; int kase=1,res; while(t--) { scanf("%d",&n); map<string,int> mp; for(int i=1;i<=n;i++) { cin>>s; scanf("%d",&d); mp[s]=d; } scanf("%d",&D); cin>>sub; res = mp[sub]; if(res==0 || res>(D+5)) printf("Case %d: Do your own homework!\n",kase++); else if(res>D && res<=(D+5)) printf("Case %d: Late\n",kase++); else if(res && res<=D) printf("Case %d: Yesss\n",kase++); } return 0; } |