UVa 11917 - Do Your Own Homework

题目:Soha有很多作业要写,而Sparrow会帮助他,不过每个作业要一定的时间完成,

现在给你需要交的作业和时间期限,问能否完成,在期限后5天内完成属于交晚。

分析:简单题,字符串。字符串相同的比较天数即可。

说明:╮(╯▽╰)╭。

#include <algorithm>
#include <iostream>
#include <cstdlib>
#include <cstring>
#include <cstdio>
#include <cmath>

using namespace std;

char work[505][22],test[22];
int  days[505],day;

int main()
{
	int T,n;
	while (~scanf("%d",&T))
	for (int t = 1; t <= T; ++ t) {
		scanf("%d",&n);
		for (int i = 0; i < n; ++ i)
			scanf("%s%d",work[i],&days[i]);
		scanf("%d%s",&day,test);

		printf("Case %d: ",t);
		int get = 0;
		for (int i = 0; i < n; ++ i)
			if (!strcmp(test, work[i])) {
				if (days[i] <= day+5) {
					if (days[i] <= day) puts("Yesss");
					else puts("Late");
					get = 1;
				}
			}
		if (!get) puts("Do your own homework!");
	}
    return 0;
}
时间: 2024-08-04 14:10:01

UVa 11917 - Do Your Own Homework的相关文章

uva 1489 - Math teacher&#39;s homework(数位dp)

题目链接:uva 1489 - Math teacher's homework 题目大意:给定n,k,以及序列m1,m2,-,mn, 要求找到一个长度为n的序列,满足0<=xi<=mi, 并且x1XORx2XOR-XORxn=k 解题思路:数位dp,在网上看了别人的代码,高大上... 假设有二进制数 k : 00001xxxx mi:0001xxxxx, 那么对于xi即可以满足任意的x1XORx2XOR-XORxi?1XORxi+1XOR-XORxn,根据这一点进行数位dp. dp[i][j]

UVa 12412 A Typical Homework(学生信息管理系统)

A Typical Homework(a.k.a Shi Xiong Bang Bang Mang) Hi, I am an undergraduate student in institute of foreign languages. As you know, C programming is a required course in our university, even if his/her major is far from computer science. I don't lik

UVa 11878 - Homework Checker

题目:给你一些加减法计算式,判断有几个是正确的. 分析:简单题.直接模拟即可. 说明:╮(╯▽╰)╭. #include <algorithm> #include <iostream> #include <cstdlib> #include <cstring> #include <cstdio> #include <cmath> using namespace std; int main() { int a,b,count = 0;

Brute Force --- UVA 10167: Birthday Cake

 Problem G. Birthday Cake  Problem's Link:http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&category=13&problem=1108&mosmsg=Submission+received+with+ID+14413715 Mean: http://luckycat.kshs.kh.edu.tw/

UVA之409 - Excuses, Excuses!

 Excuses, Excuses!  Judge Ito is having a problem with people subpoenaed for jury duty giving rather lame excuses in order to avoid serving. In order to reduce the amount of time required listening to goofy excuses, Judge Ito has asked that you write

UVA (POJ 1598)Excuses, Excuses!

Excuses, Excuses! Time Limit:3000MS     Memory Limit:0KB     64bit IO Format:%lld & %llu Submit Status Description  Excuses, Excuses!  Judge Ito is having a problem with people subpoenaed for jury duty giving rather lame excuses in order to avoid ser

UVA 562 Dividing coins --01背包的变形

01背包的变形. 先算出硬币面值的总和,然后此题变成求背包容量为V=sum/2时,能装的最多的硬币,然后将剩余的面值和它相减取一个绝对值就是最小的差值. 代码: #include <iostream> #include <cstdio> #include <cstring> #include <cmath> #include <algorithm> using namespace std; #define N 50007 int c[102],d

UVA 10341 Solve It

Problem F Solve It Input: standard input Output: standard output Time Limit: 1 second Memory Limit: 32 MB Solve the equation: p*e-x + q*sin(x) + r*cos(x) + s*tan(x) + t*x2 + u = 0 where 0 <= x <= 1. Input Input consists of multiple test cases and te

UVA 11014 - Make a Crystal(容斥原理)

UVA 11014 - Make a Crystal 题目链接 题意:给定一个NxNxN的正方体,求出最多能选几个整数点.使得随意两点PQ不会使PQO共线. 思路:利用容斥原理,设f(k)为点(x, y, z)三点都为k的倍数的点的个数(要扣掉一个原点O).那么全部点就是f(1),之后要去除掉共线的,就是扣掉f(2), f(3), f(5)..f(n).n为素数.由于这些素数中包括了合数的情况,而且这些点必定与f(1)除去这些点以外的点共线,所以扣掉.可是扣掉后会扣掉一些反复的.比方f(6)在f