Result: Accepted
Time: 6ms
Memory: 1092kB
#include<stdio.h>
#include<string.h>
int main()
{
int week,h,m,week2,h2,m2;
scanf("%d %d %d",&week,&h,&m);
scanf("%d %d %d",&week2,&h2,&m2);
if(week==week2)
{
printf("Y e s");
}
else if((week2-week==1)&&(h-h2>0))
{
printf("Y e s");
}
else if((week2-week==1)&&(h==h2)&&(m-m2>=0))
{
printf("Y e s");
}
else if(week==7&&week2==1)
{
if(h-h2>0)
{
printf("Y e s");
}
else if((h==h2)&&(m-m2>=0))
{
printf("Y e s");
}
else
{
printf("N o");
}
}
else
{
printf("N o");
}
}