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