Result: Accepted
Time: 6ms
Memory: 1092kB
#include<stdio.h>
#include<stdlib.h>
#include<math.h>
int main()
{
int week,hour,min;
int weekn,hourn,minn;
scanf("%d %d %d",&week,&hour,&min);
scanf("%d %d %d",&weekn,&hourn,&minn);
min = (24-hour)*60 - min;
minn = hour*60 + minn;
if(week==7)
{
if( (min+minn)<=1440 )
printf("Y e s");
else
printf("N o");
}
else if( (weekn-week)==1)
{
if( (min+minn)<=1440 )
printf("Y e s");
else
printf("N o");
}
else if( (weekn-week)==0)
{
printf("Y e s");
}
else
{
printf("N o");
}
return 0;
}