Result: Accepted
Time: 6ms
Memory: 1092kB
#include <stdio.h>
#include<math.h>
int main()
{ int week1,hour1,minute1;
int week2,hour2,minute2;
scanf("%d%d%d%d%d%d",&week1,&hour1,&minute1,&week2,&hour2,&minute2);
if(week1==week2)printf("Y e s");
else if((week2-week1)>1)printf("N o");
else if((week2-week1)==1||(week2-week1)==-6)
{
if((hour2+24-hour1)<24)printf("Y e s");
else if((hour2+24-hour1)>24)printf("N o");
else if((hour2+24-hour1)==24)
{
if((minute2-minute1)>0)printf("N o");
else printf("Y e s");
}
}
else printf("N o");
return 0;
}