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: 6ms
Memory: 1092kB
In contest: 1258

#include<stdio.h>
#include<math.h>
#include<string.h>
int main(){
	int n,m,k,n1,m1,k1;
	scanf("%d %d %d",&n,&m,&k);
	scanf("%d %d %d",&n1,&m1,&k1);
	if(n1<n){
		n1+=7;
	}
	if(n1-n>1){
		printf("N o\n");
	}
	else{
		if(n1-n==0){
			printf("Y e s\n");
		}
		if(n1-n==1){
            if(k<=k1&&k!=0){
               if((24-m-1+m1)*60+k1+60-k<=1440){
				   printf("Y e s\n");
			   }else{
				   printf("N o\n");
			   }
			}
			if(k<=k1&&k==0){
				if((24-m+m1)*60+k1<=1440){
				   printf("Y e s\n");
			   }else{
				   printf("N o\n");
			   }
			}
			if(k>k1){
               if((24-m-1+m1)*60+60-k+k1<=1440){
				   printf("Y e s\n");
			   }else{
				   printf("N o\n");
			   }
			}
		}
	}
	return 0;
}