Start: Jan, 08, 2019 19:01:00
2018年秋季学期程序设计基础(C语言)期末考试
End: Jan, 08, 2019 21:46:00
Time elapsed:
Time remaining:

Problem_ID: F
Result: Accepted
Time: 5ms
Memory: 1324kB
In contest: 1258

#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<math.h>
struct la
{
	char n[5];
	int a,b,c,s;
};
struct la ss[10001];
int cmp(const void *q, const void *p)
{
	struct la *m=(struct la *)q;
	struct la *y=(struct la *)p;
	if(m->s!=y->s)
		return(y->s - m->s);
	else if(m->s==y->s&&m->a!=y->a)
		return(y->a - m->a);
	else if(m->s==y->s&&m->a==y->a&&m->b!=y->b)
		return(y->b - m->b);
	else if(m->s==y->s&&m->a==y->a&&m->b==y->b&&m->c!=y->c)
		return(y->c - m->c);
	else
		return(strcmp(m->n ,y->n));
}
int main()
{
	int a[3],b[3];
	double s=0;
	scanf("%d%d%d%d%d%d",&a[0],&a[1],&a[2],&b[0],&b[1],&b[2]);
	if(a[0]==7&&b[0]==1)
	{
		if(b[1]<a[1]||(b[1]==a[1]&&b[2]<a[2]))
			printf("N o\n");
		else
		{
			s+=24-a[1]-1+b[1];
			s+=(60-a[2]+b[2])*1.0/60;
			s>24?printf("N o\n"):printf("Y e s\n");
		}
	}
	else if(b[0]-a[0]>=2||b[0]<a[0])
		printf("N o\n");
	else if(b[0]-a[0]<=1)
	{
		if(b[0]==a[0]&&(b[1]>a[1]||(b[1]==a[1]&&a[2]<=b[2])))
			printf("Y e s\n");
		else if(b[0]==a[0]&&(b[1]<a[1]||(b[1]==a[1]&&a[2]>b[2])))
			printf("N o\n");
		else
		{
			s+=24-a[1]-1+b[1];
			s+=(60-a[2]+b[2])*1.0/60;
			s>24?printf("N o\n"):printf("Y e s\n");
		}
	}
}