Result: Accepted
Time: 7ms
Memory: 1092kB
#include<stdio.h>
int main()
{
int d,d1,t,t1,m,m1;
scanf("%d %d %d",&d,&t,&m);
scanf("%d %d %d",&d1,&t1,&m1);
if(d1-d==0)
printf("Y e s\n");
if(d1-d>1)
printf("N o\n");
if(d1-d<0&&d1-d>-6)
printf("N o\n");
if(d1-d==1)
{
if(24-t+t1>24)
printf("N o\n");
if(24-t+t1==24)
{
if(m-m1>=0)
printf("Y e s\n");
if(m-m1<0)
printf("N o\n");
}
if(24-t+t1<24)
printf("Y e s\n");
}
if(d1-d==-6)
{
if(24-t+t1>24)
printf("N o\n");
if(24-t+t1==24)
{
if(m-m1>=0)
printf("Y e s\n");
if(m-m1<0)
printf("N o\n");
}
if(24-t+t1<24)
printf("Y e s\n");
}
return 0;
}