UVA – 11917 – Do Your Own Homework

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

int main() {
	string s;
	int T, t, N, limit, D;
	cin >> T;
	for (t = 1; t <= T; t++) {
		map<string, int> m;
		cin >> N;
		while (N-- && (cin >> s >> limit))	m[s] = limit;
		cin >> D >> s;

		if (!m[s] || m[s] > D+5)	printf("Case %d: Do your own homework!\n", t);
		else if (m[s] <= D)			printf("Case %d: Yesss\n", t);
		else if (m[s] <= D + 5)		printf("Case %d: Late\n", t);
	}
	return 0;
}
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: