Result: Accepted
Time: 9ms
Memory: 1092kB
#include <stdio.h>
int main()
{ int a,b,c,d,e,f;scanf("%d %d %d",&a,&b,&c);
scanf("%d %d %d",&d,&e,&f);
if(d-a==1&&a!=7&&d!=1){
if(((24-b-1+e)*60+f+60-c)<=1440)printf("Y e s\n");
else printf("N o\n");
}
else if(a==7&&d==1){
if(((24-b-1+e)*60+f+60-c)<=1440)printf("Y e s\n");
else printf("N o\n");
}
else if(d-a==0){
if((e-b)>0&&(((e-b-1)*60+f+60-c)<=1440))printf("Y e s\n");
else printf("N o\n");
if((e-b)==0)printf("Y e s\n");
}
else printf("N o\n");
return 0;
}