Result: Accepted
Time: 5ms
Memory: 1092kB
#include <stdio.h>
int main(){
int day,hour,minite,day1,hour1,minite1;
scanf("%d %d %d",&day,&hour,&minite);
scanf("%d %d %d",&day1,&hour1,&minite1);
if((day1-day)>1)
printf("N o\n");
else if((day1-day)==1&&(((23-hour+hour1)*3600)+((60-minite)+minite1)*60)<=86400)
printf("Y e s\n");
else if((day1-day)==0&&((23-hour)*3600)+(60-minite)*60<=86400)
printf("Y e s\n");
else if((day1-day)==-6&&(((23-hour+hour1)*3600)+((60-minite)+minite1)*60)<=86400)
printf("Y e s\n");
else
printf("N o\n");
}